diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-11-14 19:35:45 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2024-11-14 19:35:45 +0100 |
commit | df5520aa2dae5b3ce7abf8733dcdd152898af163 (patch) | |
tree | 00d3047bfb14f682bfb5a21010c731ed649bfed7 /app/wlib/gtklib/pixbuf.c | |
parent | df247efec654e512242e4f4f1b0212034f9e01fe (diff) | |
parent | ec3c0f6f6e7153fa797dc57a0e95779cbc63a23b (diff) |
Merge branch 'release/debian/1_5.3.0GA-1'debian/1_5.3.0GA-1
Diffstat (limited to 'app/wlib/gtklib/pixbuf.c')
-rw-r--r-- | app/wlib/gtklib/pixbuf.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/app/wlib/gtklib/pixbuf.c b/app/wlib/gtklib/pixbuf.c index 7b8d7d1..0d6e8b7 100644 --- a/app/wlib/gtklib/pixbuf.c +++ b/app/wlib/gtklib/pixbuf.c @@ -45,55 +45,55 @@ */ GdkPixbuf* wlibMakePixbuf( - wIcon_p ip) + wIcon_p ip) { - GdkPixbuf * pixbuf; - char line0[40]; - char line2[40]; - - assert(ip != NULL); - - if (ip->gtkIconType == gtkIcon_pixmap) { - pixbuf = gdk_pixbuf_new_from_xpm_data((const char**)ip->bits); - } else { - const char * bits; - long rgb; - int row,col,wb; - char ** pixmapData; - - wb = (ip->w+7)/8; - pixmapData = (char**)g_malloc((3+ip->h) * sizeof *pixmapData); - pixmapData[0] = line0; - rgb = wDrawGetRGB(ip->color); - sprintf(line0, " %d %d 2 1", ip->w, ip->h); - sprintf(line2, "# c #%2.2lx%2.2lx%2.2lx", (rgb>>16)&0xFF, (rgb>>8)&0xFF, - rgb&0xFF); - pixmapData[1] = ". c None s None"; - pixmapData[2] = line2; - bits = ip->bits; - - for (row = 0; row<ip->h; row++) { - pixmapData[row+3] = (char*)g_malloc((ip->w+1) * sizeof **pixmapData); - - for (col = 0; col<ip->w; col++) { - if (bits[ row*wb+(col>>3) ] & (1<<(col&07))) { - pixmapData[row+3][col] = '#'; - } else { - pixmapData[row+3][col] = '.'; - } - } - - pixmapData[row+3][ip->w] = 0; - } - - pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)pixmapData); - - for (row = 0; row<ip->h; row++) { - g_free(pixmapData[row+3]); - } - } - - return pixbuf; + GdkPixbuf * pixbuf; + char line0[40]; + char line2[40]; + + assert(ip != NULL); + + if (ip->gtkIconType == gtkIcon_pixmap) { + pixbuf = gdk_pixbuf_new_from_xpm_data((const char**)ip->bits); + } else { + const char * bits; + long rgb; + int row,col,wb; + char ** pixmapData; + + wb = (ip->w+7)/8; + pixmapData = (char**)g_malloc((3+ip->h) * sizeof *pixmapData); + pixmapData[0] = line0; + rgb = wDrawGetRGB(ip->color); + sprintf(line0, " %ld %ld 2 1", ip->w, ip->h); + sprintf(line2, "# c #%2.2lx%2.2lx%2.2lx", (rgb>>16)&0xFF, (rgb>>8)&0xFF, + rgb&0xFF); + pixmapData[1] = ". c None s None"; + pixmapData[2] = line2; + bits = ip->bits; + + for (row = 0; row<ip->h; row++) { + pixmapData[row+3] = (char*)g_malloc((ip->w+1) * sizeof **pixmapData); + + for (col = 0; col<ip->w; col++) { + if (bits[ row*wb+(col>>3) ] & (1<<(col&07))) { + pixmapData[row+3][col] = '#'; + } else { + pixmapData[row+3][col] = '.'; + } + } + + pixmapData[row+3][ip->w] = 0; + } + + pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)pixmapData); + + for (row = 0; row<ip->h; row++) { + g_free(pixmapData[row+3]); + } + } + + return pixbuf; } |