]> Pileus Git - ~andy/gtk/blobdiff - gdk/quartz/gdkpixmap-quartz.c
Whitespace cleanup. (synthesize_crossing_events): Add comments and prevent
[~andy/gtk] / gdk / quartz / gdkpixmap-quartz.c
index 3dc7790531229143f0faae21ddfe75d2a9b54572..8176e75d15e1ded5c6202786505fbf9083393905 100644 (file)
@@ -114,7 +114,6 @@ gdk_pixmap_new (GdkDrawable *drawable,
   GdkPixmap *pixmap;
   GdkDrawableImplQuartz *draw_impl;
   GdkPixmapImplQuartz *pix_impl;
-  GdkColormap *cmap;
   gint window_depth;
   CGColorSpaceRef colorspace;
   CGDataProviderRef data_provider;
@@ -201,7 +200,7 @@ gdk_bitmap_create_from_data (GdkDrawable *window,
 {
   GdkPixmap *pixmap;
   GdkPixmapImplQuartz *impl;
-  int x, y;
+  int x, y, bpl;
 
   g_return_val_if_fail (data != NULL, NULL);
   g_return_val_if_fail ((width != 0) && (height != 0), NULL);
@@ -212,19 +211,21 @@ gdk_bitmap_create_from_data (GdkDrawable *window,
 
   g_assert (CGImageGetBytesPerRow (impl->image) == width);
 
+  /* Bytes per line: Each line consumes an integer number of bytes, possibly
+   * ignoring any excess bits. */
+  bpl = (width + 7) / 8;
   for (y = 0; y < height; y++)
     {
-      guchar *ptr = impl->data + y * width;
-      gint idx;
-      
+      guchar *dst = impl->data + y * width;
+      const gchar *src = data + (y * bpl);   
       for (x = 0; x < width; x++)
        {
-         if ((data[(y * width + x) / 8] >> x % 8) & 1)
-           *ptr = 0xff;
+         if ((src[x / 8] >> x % 8) & 1)
+           *dst = 0xff;
          else
-           *ptr = 0;
+           *dst = 0;
 
-         ptr++;
+         dst++;
        }
     }
 
@@ -257,6 +258,16 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid)
    return NULL;
 }
 
+GdkPixmap *
+gdk_pixmap_foreign_new_for_screen (GdkScreen       *screen,
+                                  GdkNativeWindow  anid,
+                                  gint             width,
+                                  gint             height,
+                                  gint             depth)
+{
+  return NULL;
+}
+
 GdkPixmap*
 gdk_pixmap_lookup (GdkNativeWindow anid)
 {