comparison gtk/dw.c @ 2950:0577a97fe36d

Added dw_pixmap_get_width() and dw_pixmap_get_height() by request for language bindings. These APIs function identical to the already existing DW_PIXMAP_HEIGHT/WIDTH() macros. The macros will exist at least until the end of the 3.x series, at which point they may be retired.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 03 Jan 2023 22:23:08 +0000
parents edb4307ac7ce
children b40adda4a129
comparison
equal deleted inserted replaced
2949:a1d0522d7edf 2950:0577a97fe36d
9357 * Destroys an allocated pixmap. 9357 * Destroys an allocated pixmap.
9358 * Parameters: 9358 * Parameters:
9359 * pixmap: Handle to a pixmap returned by 9359 * pixmap: Handle to a pixmap returned by
9360 * dw_pixmap_new.. 9360 * dw_pixmap_new..
9361 */ 9361 */
9362 void dw_pixmap_destroy(HPIXMAP pixmap) 9362 void API dw_pixmap_destroy(HPIXMAP pixmap)
9363 { 9363 {
9364 int _dw_locked_by_me = FALSE; 9364 int _dw_locked_by_me = FALSE;
9365 9365
9366 DW_MUTEX_LOCK; 9366 DW_MUTEX_LOCK;
9367 gdk_pixmap_unref(pixmap->pixmap); 9367 gdk_pixmap_unref(pixmap->pixmap);
9369 free(pixmap->font); 9369 free(pixmap->font);
9370 if(pixmap->pixbuf) 9370 if(pixmap->pixbuf)
9371 g_object_unref(pixmap->pixbuf); 9371 g_object_unref(pixmap->pixbuf);
9372 free(pixmap); 9372 free(pixmap);
9373 DW_MUTEX_UNLOCK; 9373 DW_MUTEX_UNLOCK;
9374 }
9375
9376 /*
9377 * Returns the width of the pixmap, same as the DW_PIXMAP_WIDTH() macro,
9378 * but exported as an API, for non-C language bindings.
9379 */
9380 unsigned long API dw_pixmap_get_width(HPIXMAP pixmap)
9381 {
9382 return pixmap ? pixmap->width : 0;
9383 }
9384
9385 /*
9386 * Returns the height of the pixmap, same as the DW_PIXMAP_HEIGHT() macro,
9387 * but exported as an API, for non-C language bindings.
9388 */
9389 unsigned long API dw_pixmap_get_height(HPIXMAP pixmap)
9390 {
9391 return pixmap ? pixmap->height : 0;
9374 } 9392 }
9375 9393
9376 #if GTK_CHECK_VERSION(2,10,0) 9394 #if GTK_CHECK_VERSION(2,10,0)
9377 /* Cairo version of dw_pixmap_bitblt() from GTK3, use if either pixmap is a cairo surface */ 9395 /* Cairo version of dw_pixmap_bitblt() from GTK3, use if either pixmap is a cairo surface */
9378 int _dw_cairo_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc, int srcwidth, int srcheight) 9396 int _dw_cairo_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc, int srcwidth, int srcheight)