comparison dw.h @ 2202:c677d728e143

GTK3: Switch to using GResource for compiled in image resources. Second commit with similar changes coming for GTK2 soon. dwindows-config --gresource will return "enabled" if GResource is supported. GLib 2.32 is required for GResource support, if GLib is older than 2.32 Dynamic Windows will fall back to the old style compiled in resource array.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 28 Nov 2020 23:47:30 +0000
parents 6533fc42c951
children 12fb7f32f3a9
comparison
equal deleted inserted replaced
2201:ae6626a4331f 2202:c677d728e143
1344 typedef struct _resource_struct { 1344 typedef struct _resource_struct {
1345 long resource_max, *resource_id; 1345 long resource_max, *resource_id;
1346 char **resource_data; 1346 char **resource_data;
1347 } DWResources; 1347 } DWResources;
1348 1348
1349 /* As of Dynamic Windows 3.1 GResource is default if supported.
1350 * Defining DW_INCLUDE_DEPRECATED_RESOURCES at compile time will
1351 * include support for our old home brewed resource system.
1352 * GLib 2.32 is required for GResource, so we automatically
1353 * enable our old system if using an old Glib.
1354 * Test for GResource using: dwindows-config --gresource
1355 */
1356 #ifndef DW_INCLUDE_DEPRECATED_RESOURCES
1357 #if !GLIB_CHECK_VERSION(2,32,0)
1358 #define DW_INCLUDE_DEPRECATED_RESOURCES 1
1359 #endif
1360 #endif
1361
1362 /* Only reference our old style resources if required. */
1363 #ifdef DW_INCLUDE_DEPRECATED_RESOURCES
1349 #if !defined(DW_RESOURCES) || defined(BUILD_DLL) 1364 #if !defined(DW_RESOURCES) || defined(BUILD_DLL)
1350 static DWResources DW_UNUSED(_resources) = { 0, 0, 0 }; 1365 static DWResources DW_UNUSED(_resources) = { 0, 0, 0 };
1351 #else 1366 #else
1352 extern DWResources _resources; 1367 extern DWResources _resources;
1368 #endif
1353 #endif 1369 #endif
1354 1370
1355 #endif 1371 #endif
1356 1372
1357 #if !defined(__OS2__) && !defined(__EMX__) 1373 #if !defined(__OS2__) && !defined(__EMX__)
1624 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); 1640 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad);
1625 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); 1641 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad);
1626 void API dw_box_pack_at_index(HWND box, HWND item, int index, int width, int height, int hsize, int vsize, int pad); 1642 void API dw_box_pack_at_index(HWND box, HWND item, int index, int width, int height, int hsize, int vsize, int pad);
1627 HWND API dw_box_unpack_at_index(HWND box, int index); 1643 HWND API dw_box_unpack_at_index(HWND box, int index);
1628 int API dw_box_unpack(HWND handle); 1644 int API dw_box_unpack(HWND handle);
1629 #if !defined(__OS2__) && !defined(__WIN32__) && !defined(__EMX__) && !defined(__MAC__) 1645 #ifdef DW_INCLUDE_DEPRECATED_RESOURCES
1630 int API dw_int_init(DWResources *res, int newthread, int *argc, char **argv[]); 1646 int API dw_int_init(DWResources *res, int newthread, int *argc, char **argv[]);
1631 #define dw_init(a, b, c) dw_int_init(&_resources, a, &b, &c) 1647 #define dw_init(a, b, c) dw_int_init(&_resources, a, &b, &c)
1632 #else 1648 #else
1633 int API dw_init(int newthread, int argc, char *argv[]); 1649 int API dw_init(int newthread, int argc, char *argv[]);
1634 #endif 1650 #endif