comparison dw.h @ 1146:9d97610b2140

Adding dw_pixmap_set_font() which is equivalent to dw_window_set_font() except for pixmaps. When drawing to pixmaps, normally the font is obtained from the associated window handle. This will allow overriding of the font for this pixmap, and will allow setting fonts on pixmaps that don't have associated window handles. This commit has the Mac support. Other platforms coming in the next hour.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 11 Sep 2011 21:36:07 +0000
parents 1a5b0908659b
children 439f276042cc
comparison
equal deleted inserted replaced
1145:9c47a0245872 1146:9d97610b2140
304 void *data; 304 void *data;
305 } WindowData; 305 } WindowData;
306 306
307 typedef struct _hpixmap { 307 typedef struct _hpixmap {
308 unsigned long width, height; 308 unsigned long width, height;
309 void *image; 309 void *image, *font;
310 HWND handle; 310 HWND handle;
311 } *HPIXMAP; 311 } *HPIXMAP;
312 312
313 void _dw_pool_drain(void); 313 void _dw_pool_drain(void);
314 314
634 HDC hdc; 634 HDC hdc;
635 unsigned long transcolor; 635 unsigned long transcolor;
636 HWND handle; 636 HWND handle;
637 void *bits; 637 void *bits;
638 unsigned long depth; 638 unsigned long depth;
639 HFONT font;
639 } *HPIXMAP; 640 } *HPIXMAP;
640 641
641 typedef HWND HMENUI; 642 typedef HWND HMENUI;
642 #endif 643 #endif
643 644
1255 int size; 1256 int size;
1256 }; 1257 };
1257 1258
1258 typedef struct _hpixmap { 1259 typedef struct _hpixmap {
1259 unsigned long width, height; 1260 unsigned long width, height;
1261 HWND handle;
1262 void *font;
1260 #if GTK_MAJOR_VERSION > 2 1263 #if GTK_MAJOR_VERSION > 2
1261 GdkPixbuf *pixbuf; /* the actual image */ 1264 GdkPixbuf *pixbuf; /* the actual image */
1262 cairo_surface_t *image; /* Going to have dual storage for now */ 1265 cairo_surface_t *image; /* Going to have dual storage for now */
1263 #else 1266 #else
1264 GdkPixmap *pixmap; /* the actual image */ 1267 GdkPixmap *pixmap; /* the actual image */
1265 GdkBitmap *bitmap; /* if not null, the image mask representing the transparency mask */ 1268 GdkBitmap *bitmap; /* if not null, the image mask representing the transparency mask */
1266 #endif 1269 #endif
1267 HWND handle;
1268 } *HPIXMAP; 1270 } *HPIXMAP;
1269 1271
1270 typedef GtkWidget *HMENUI; 1272 typedef GtkWidget *HMENUI;
1271 typedef void *HTREEITEM; 1273 typedef void *HTREEITEM;
1272 typedef void *HSHM; 1274 typedef void *HSHM;
1645 HPIXMAP API dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth); 1647 HPIXMAP API dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth);
1646 HPIXMAP API dw_pixmap_new_from_file(HWND handle, char *filename); 1648 HPIXMAP API dw_pixmap_new_from_file(HWND handle, char *filename);
1647 HPIXMAP API dw_pixmap_new_from_data(HWND handle, char *data, int len); 1649 HPIXMAP API dw_pixmap_new_from_data(HWND handle, char *data, int len);
1648 HPIXMAP API dw_pixmap_grab(HWND handle, ULONG id); 1650 HPIXMAP API dw_pixmap_grab(HWND handle, ULONG id);
1649 void API dw_pixmap_set_transparent_color( HPIXMAP pixmap, ULONG color ); 1651 void API dw_pixmap_set_transparent_color( HPIXMAP pixmap, ULONG color );
1652 int API dw_pixmap_set_font(HPIXMAP pixmap, char *fontname);
1650 void API dw_pixmap_destroy(HPIXMAP pixmap); 1653 void API dw_pixmap_destroy(HPIXMAP pixmap);
1651 void API dw_beep(int freq, int dur); 1654 void API dw_beep(int freq, int dur);
1652 int API dw_messagebox(char *title, int flags, char *format, ...); 1655 int API dw_messagebox(char *title, int flags, char *format, ...);
1653 void API dw_environment_query(DWEnv *env); 1656 void API dw_environment_query(DWEnv *env);
1654 int API dw_exec(char *program, int type, char **params); 1657 int API dw_exec(char *program, int type, char **params);