pidgin/gtkutils.c

changeset 15474
673a21839b11
parent 15442
2ff7f5308727
child 15496
76b5ca00a36c
equal deleted inserted replaced
15473:9768d20d4221 15474:673a21839b11
3122 3122
3123 return result; 3123 return result;
3124 } 3124 }
3125 3125
3126 3126
3127 gboolean gaim_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf) {
3128 int width, height, rowstride, i;
3129 unsigned char *pixels;
3130 unsigned char *row;
3131
3132 if (!gdk_pixbuf_get_has_alpha(pixbuf))
3133 return TRUE;
3134
3135 width = gdk_pixbuf_get_width (pixbuf);
3136 height = gdk_pixbuf_get_height (pixbuf);
3137 rowstride = gdk_pixbuf_get_rowstride (pixbuf);
3138 pixels = gdk_pixbuf_get_pixels (pixbuf);
3139
3140 row = pixels;
3141 for (i = 3; i < rowstride; i+=4) {
3142 if (row[i] != 0xff)
3143 return FALSE;
3144 }
3145
3146 for (i = 1; i < height - 1; i++) {
3147 row = pixels + (i*rowstride);
3148 if (row[3] != 0xff || row[rowstride-1] != 0xff) {
3149 printf("0: %d, last: %d\n", row[3], row[rowstride-1]);
3150 return FALSE;
3151 }
3152 }
3153
3154 row = pixels + ((height-1) * rowstride);
3155 for (i = 3; i < rowstride; i+=4) {
3156 if (row[i] != 0xff)
3157 return FALSE;
3158 }
3159
3160 return TRUE;
3161 }
3162
3127 #if !GTK_CHECK_VERSION(2,2,0) 3163 #if !GTK_CHECK_VERSION(2,2,0)
3128 GtkTreePath * 3164 GtkTreePath *
3129 gtk_tree_path_new_from_indices (gint first_index, ...) 3165 gtk_tree_path_new_from_indices (gint first_index, ...)
3130 { 3166 {
3131 int arg; 3167 int arg;

mercurial