Mercurial > projects > dwt-linux
comparison dwt/widgets/Display.d @ 361:4bffbf81e2d6
redirect direct prints to DwtLogger
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 20 Mar 2009 21:00:06 +0100 |
parents | ffb904674b52 |
children |
comparison
equal
deleted
inserted
replaced
360:ee1dd551f5b1 | 361:4bffbf81e2d6 |
---|---|
46 import tango.stdc.string; | 46 import tango.stdc.string; |
47 import dwt.dwthelper.utils; | 47 import dwt.dwthelper.utils; |
48 import dwt.dwthelper.Runnable; | 48 import dwt.dwthelper.Runnable; |
49 | 49 |
50 import tango.core.Thread; | 50 import tango.core.Thread; |
51 import tango.io.Stdout; | |
52 | 51 |
53 /** | 52 /** |
54 * Instances of this class are responsible for managing the | 53 * Instances of this class are responsible for managing the |
55 * connection between DWT and the underlying operating | 54 * connection between DWT and the underlying operating |
56 * system. Their most important function is to implement | 55 * system. Their most important function is to implement |
612 allChildrenProcCallbackData.display = this; | 611 allChildrenProcCallbackData.display = this; |
613 allChildrenProcCallbackData.data = cast(void*)recurse; | 612 allChildrenProcCallbackData.data = cast(void*)recurse; |
614 OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&allChildrenProcFunc, &allChildrenProcCallbackData); | 613 OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&allChildrenProcFunc, &allChildrenProcCallbackData); |
615 } | 614 } |
616 private static extern(C) int /*long*/ allChildrenProcFunc (GtkWidget* handle, void* user_data) { | 615 private static extern(C) int /*long*/ allChildrenProcFunc (GtkWidget* handle, void* user_data) { |
617 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 616 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
618 CallbackData* cbdata = cast(CallbackData*)user_data; | 617 CallbackData* cbdata = cast(CallbackData*)user_data; |
619 return cbdata.display.allChildrenProc( cast(GtkWidget*)handle, cast(int)cbdata.data ); | 618 return cbdata.display.allChildrenProc( cast(GtkWidget*)handle, cast(int)cbdata.data ); |
620 } | 619 } |
621 int /*long*/ allChildrenProc (GtkWidget* widget, int /*long*/ recurse) { | 620 int /*long*/ allChildrenProc (GtkWidget* widget, int /*long*/ recurse) { |
622 allChildren = OS.g_list_append (allChildren, widget); | 621 allChildren = OS.g_list_append (allChildren, widget); |
744 GtkCellRenderer *cell, | 743 GtkCellRenderer *cell, |
745 GtkTreeModel *tree_model, | 744 GtkTreeModel *tree_model, |
746 GtkTreeIter *iter, | 745 GtkTreeIter *iter, |
747 void* data) | 746 void* data) |
748 { | 747 { |
749 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 748 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
750 CallbackData* cbdata = cast(CallbackData*)data; | 749 CallbackData* cbdata = cast(CallbackData*)data; |
751 return cbdata.display.cellDataProc( tree_column, cell, tree_model, iter, cbdata.data ); | 750 return cbdata.display.cellDataProc( tree_column, cell, tree_model, iter, cbdata.data ); |
752 } | 751 } |
753 | 752 |
754 void cellDataProc( | 753 void cellDataProc( |
779 } | 778 } |
780 } | 779 } |
781 } | 780 } |
782 | 781 |
783 private static extern(C) int checkIfEventProcFunc (void* display, XEvent* xEvent, char* userData) { | 782 private static extern(C) int checkIfEventProcFunc (void* display, XEvent* xEvent, char* userData) { |
784 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 783 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
785 auto disp = cast(Display)userData; | 784 auto disp = cast(Display)userData; |
786 return disp.checkIfEventProcMeth( display, xEvent ); | 785 return disp.checkIfEventProcMeth( display, xEvent ); |
787 } | 786 } |
788 | 787 |
789 int checkIfEventProcMeth (void* display, XEvent* xEvent) { | 788 int checkIfEventProcMeth (void* display, XEvent* xEvent) { |
914 register (this); | 913 register (this); |
915 if (Default is null) Default = this; | 914 if (Default is null) Default = this; |
916 } | 915 } |
917 | 916 |
918 private static extern(C) int XErrorHandler( void*, XErrorEvent* ){ | 917 private static extern(C) int XErrorHandler( void*, XErrorEvent* ){ |
919 Stdout.formatln ("*** XError" ); | 918 getDwtLogger().error ("*** XError" ); |
920 byte* p; | 919 byte* p; |
921 *p = 3; | 920 *p = 3; |
922 return 0; | 921 return 0; |
923 } | 922 } |
924 | 923 |
938 | 937 |
939 OS.XSetErrorHandler( &Display.XErrorHandler ); | 938 OS.XSetErrorHandler( &Display.XErrorHandler ); |
940 char* ptr = OS.gtk_check_version (MAJOR, MINOR, MICRO); | 939 char* ptr = OS.gtk_check_version (MAJOR, MINOR, MICRO); |
941 if (ptr !is null) { | 940 if (ptr !is null) { |
942 char [] buffer = fromStringz(ptr); | 941 char [] buffer = fromStringz(ptr); |
943 Stdout.formatln ("***WARNING: {}", buffer ); | 942 getDwtLogger().warn ("***WARNING: {}", buffer ); |
944 Stdout.formatln ("***WARNING: DWT requires GTK {}.{}.{}", MAJOR, MINOR, MICRO ); | 943 getDwtLogger().warn ("***WARNING: DWT requires GTK {}.{}.{}", MAJOR, MINOR, MICRO ); |
945 int major = OS.gtk_major_version (), minor = OS.gtk_minor_version (), micro = OS.gtk_micro_version (); | 944 int major = OS.gtk_major_version (), minor = OS.gtk_minor_version (), micro = OS.gtk_micro_version (); |
946 Stdout.formatln ("***WARNING: Detected: {}.{}.{}", major, minor, micro); | 945 getDwtLogger().warn ("***WARNING: Detected: {}.{}.{}", major, minor, micro); |
947 } | 946 } |
948 if (fixed_type is 0) { | 947 if (fixed_type is 0) { |
949 GTypeInfo* fixed_info = new GTypeInfo (); | 948 GTypeInfo* fixed_info = new GTypeInfo (); |
950 fixed_info.class_size = GtkFixedClass.sizeof; | 949 fixed_info.class_size = GtkFixedClass.sizeof; |
951 fixed_info.class_init = & fixedClassInitProcFunc; | 950 fixed_info.class_init = & fixedClassInitProcFunc; |
1203 void error (int code) { | 1202 void error (int code) { |
1204 DWT.error (code); | 1203 DWT.error (code); |
1205 } | 1204 } |
1206 | 1205 |
1207 private static extern(C) void eventProcFunc (GdkEvent* event, void* data) { | 1206 private static extern(C) void eventProcFunc (GdkEvent* event, void* data) { |
1208 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 1207 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
1209 Display disp = cast(Display)data; | 1208 Display disp = cast(Display)data; |
1210 disp.eventProcMeth(event); | 1209 disp.eventProcMeth(event); |
1211 } | 1210 } |
1212 void eventProcMeth (GdkEvent* event) { | 1211 void eventProcMeth (GdkEvent* event) { |
1213 /* | 1212 /* |
1318 checkDevice (); | 1317 checkDevice (); |
1319 return null; | 1318 return null; |
1320 } | 1319 } |
1321 | 1320 |
1322 private static extern(C) void fixedClassInitProcFunc (void* g_class, void* class_data) { | 1321 private static extern(C) void fixedClassInitProcFunc (void* g_class, void* class_data) { |
1323 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 1322 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
1324 GtkWidgetClass* klass = cast(GtkWidgetClass*)g_class; | 1323 GtkWidgetClass* klass = cast(GtkWidgetClass*)g_class; |
1325 klass.map = &fixedMapProcFunc; | 1324 klass.map = &fixedMapProcFunc; |
1326 oldFixedSizeAllocateProc = klass.size_allocate; | 1325 oldFixedSizeAllocateProc = klass.size_allocate; |
1327 klass.size_allocate = &fixedSizeAllocateProc; | 1326 klass.size_allocate = &fixedSizeAllocateProc; |
1328 } | 1327 } |
1329 | 1328 |
1330 private static extern(C) void fixedMapProcFunc (GtkWidget * handle) { | 1329 private static extern(C) void fixedMapProcFunc (GtkWidget * handle) { |
1331 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 1330 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
1332 Display display = getCurrent (); | 1331 Display display = getCurrent (); |
1333 Widget widget = display.getWidget (handle); | 1332 Widget widget = display.getWidget (handle); |
1334 if (widget !is null) widget.fixedMapProc (handle); | 1333 if (widget !is null) widget.fixedMapProc (handle); |
1335 } | 1334 } |
1336 | 1335 |
1340 if (widget !is null) return widget.fixedSizeAllocateProc (handle, allocation); | 1339 if (widget !is null) return widget.fixedSizeAllocateProc (handle, allocation); |
1341 return oldFixedSizeAllocateProc(handle, allocation); | 1340 return oldFixedSizeAllocateProc(handle, allocation); |
1342 } | 1341 } |
1343 | 1342 |
1344 private static extern(C) void rendererClassInitProcFunc (void* g_class, void* class_data) { | 1343 private static extern(C) void rendererClassInitProcFunc (void* g_class, void* class_data) { |
1345 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 1344 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
1346 GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class; | 1345 GtkCellRendererClass* klass = cast(GtkCellRendererClass*)g_class; |
1347 klass.render = &rendererRenderProcFunc; | 1346 klass.render = &rendererRenderProcFunc; |
1348 klass.get_size = &rendererGetSizeProcFunc; | 1347 klass.get_size = &rendererGetSizeProcFunc; |
1349 | 1348 |
1350 } | 1349 } |
1355 int *x_offset, | 1354 int *x_offset, |
1356 int *y_offset, | 1355 int *y_offset, |
1357 int *width, | 1356 int *width, |
1358 int *height) | 1357 int *height) |
1359 { | 1358 { |
1360 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 1359 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
1361 Display display = getCurrent (); | 1360 Display display = getCurrent (); |
1362 Widget widget = display.getWidget (handle); | 1361 Widget widget = display.getWidget (handle); |
1363 if (widget !is null) widget.rendererGetSizeProc (cell, handle, cell_area, x_offset, y_offset, width, height); | 1362 if (widget !is null) widget.rendererGetSizeProc (cell, handle, cell_area, x_offset, y_offset, width, height); |
1364 } | 1363 } |
1365 private static extern(C) void rendererRenderProcFunc(GtkCellRenderer * cell, GdkDrawable * window, GtkWidget * handle, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, int flags){ | 1364 private static extern(C) void rendererRenderProcFunc(GtkCellRenderer * cell, GdkDrawable * window, GtkWidget * handle, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, int flags){ |
1366 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 1365 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
1367 Display display = getCurrent (); | 1366 Display display = getCurrent (); |
1368 Widget widget = display.getWidget (handle); | 1367 Widget widget = display.getWidget (handle); |
1369 if (widget !is null) widget.rendererRenderProc (cell, window, handle, background_area, cell_area, expose_area, flags); | 1368 if (widget !is null) widget.rendererRenderProc (cell, window, handle, background_area, cell_area, expose_area, flags); |
1370 } | 1369 } |
1371 | 1370 |
1514 if (filterTable is null) return false; | 1513 if (filterTable is null) return false; |
1515 return filterTable.hooks (eventType); | 1514 return filterTable.hooks (eventType); |
1516 } | 1515 } |
1517 | 1516 |
1518 private static extern(C) int filterProcFunc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) { | 1517 private static extern(C) int filterProcFunc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) { |
1519 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 1518 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
1520 auto callbackdata = cast(CallbackData*)data; | 1519 auto callbackdata = cast(CallbackData*)data; |
1521 auto disp = callbackdata.display; | 1520 auto disp = callbackdata.display; |
1522 if( disp is null ) return 0; | 1521 if( disp is null ) return 0; |
1523 auto res = disp.filterProcMeth(xEvent,gdkEvent,callbackdata); | 1522 auto res = disp.filterProcMeth(xEvent,gdkEvent,callbackdata); |
1524 return res; | 1523 return res; |
2353 } | 2352 } |
2354 return null; | 2353 return null; |
2355 } | 2354 } |
2356 | 2355 |
2357 private static extern(C) int idleProcFunc (void* data) { | 2356 private static extern(C) int idleProcFunc (void* data) { |
2358 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 2357 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
2359 auto dbdata = cast(CallbackData*)data; | 2358 auto dbdata = cast(CallbackData*)data; |
2360 return dbdata.display.idleProc(); | 2359 return dbdata.display.idleProc(); |
2361 } | 2360 } |
2362 private int idleProc () { | 2361 private int idleProc () { |
2363 bool result = runAsyncMessages (false); | 2362 bool result = runAsyncMessages (false); |
2795 hasLocation ? &menuPositionProcFunc : null, | 2794 hasLocation ? &menuPositionProcFunc : null, |
2796 cast(void*)this, 0, getLastEventTime() ); | 2795 cast(void*)this, 0, getLastEventTime() ); |
2797 } | 2796 } |
2798 | 2797 |
2799 private static extern(C) void menuPositionProcFunc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) { | 2798 private static extern(C) void menuPositionProcFunc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) { |
2800 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 2799 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
2801 auto display = cast(Display)user_data; | 2800 auto display = cast(Display)user_data; |
2802 display.menuPositionProc( menu, x, y, push_in, null ); | 2801 display.menuPositionProc( menu, x, y, push_in, null ); |
2803 } | 2802 } |
2804 | 2803 |
2805 void menuPositionProc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) { | 2804 void menuPositionProc (GtkMenu* menu, int* x, int* y, int* push_in, void* user_data) { |
2874 if (fromRTL !is toRTL) rect.x -= rect.width; | 2873 if (fromRTL !is toRTL) rect.x -= rect.width; |
2875 return rect; | 2874 return rect; |
2876 } | 2875 } |
2877 | 2876 |
2878 private static extern(C) int /*long*/ mouseHoverProcFunc ( void* user_data) { | 2877 private static extern(C) int /*long*/ mouseHoverProcFunc ( void* user_data) { |
2879 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 2878 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
2880 CallbackData* cbdata = cast(CallbackData*)user_data; | 2879 CallbackData* cbdata = cast(CallbackData*)user_data; |
2881 return cbdata.display.mouseHoverProc( cast(GtkWidget*)cbdata.data ); | 2880 return cbdata.display.mouseHoverProc( cast(GtkWidget*)cbdata.data ); |
2882 } | 2881 } |
2883 int /*long*/ mouseHoverProc (GtkWidget* handle) { | 2882 int /*long*/ mouseHoverProc (GtkWidget* handle) { |
2884 Widget widget = getWidget (handle); | 2883 Widget widget = getWidget (handle); |
3648 setDirectionProcCallbackData.data = cast(void*)direction; | 3647 setDirectionProcCallbackData.data = cast(void*)direction; |
3649 OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&setDirectionProcFunc, &setDirectionProcCallbackData); | 3648 OS.gtk_container_forall (cast(GtkContainer*)widget, cast(GtkCallback)&setDirectionProcFunc, &setDirectionProcCallbackData); |
3650 } | 3649 } |
3651 | 3650 |
3652 package static extern(C) int /*long*/ setDirectionProcFunc (GtkWidget* widget, void* data) { | 3651 package static extern(C) int /*long*/ setDirectionProcFunc (GtkWidget* widget, void* data) { |
3653 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 3652 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
3654 CallbackData* cbdata = cast(CallbackData*)data; | 3653 CallbackData* cbdata = cast(CallbackData*)data; |
3655 return cbdata.display.setDirectionProc( widget, cast(int)cbdata.data ); | 3654 return cbdata.display.setDirectionProc( widget, cast(int)cbdata.data ); |
3656 } | 3655 } |
3657 int /*long*/ setDirectionProc (GtkWidget* widget, int /*long*/ direction) { | 3656 int /*long*/ setDirectionProc (GtkWidget* widget, int /*long*/ direction) { |
3658 OS.gtk_widget_set_direction (widget, direction); | 3657 OS.gtk_widget_set_direction (widget, direction); |
3897 } | 3896 } |
3898 } | 3897 } |
3899 | 3898 |
3900 | 3899 |
3901 private static extern(C) int timerProcFunc ( void * data ) { | 3900 private static extern(C) int timerProcFunc ( void * data ) { |
3902 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 3901 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
3903 CallbackData* cbdata = cast( CallbackData* ) data; | 3902 CallbackData* cbdata = cast( CallbackData* ) data; |
3904 return cbdata.display.timerProc( cast(int) cbdata.data ); | 3903 return cbdata.display.timerProc( cast(int) cbdata.data ); |
3905 } | 3904 } |
3906 | 3905 |
3907 int /*long*/ timerProc (int /*long*/ i) { | 3906 int /*long*/ timerProc (int /*long*/ i) { |
3915 } | 3914 } |
3916 return 0; | 3915 return 0; |
3917 } | 3916 } |
3918 | 3917 |
3919 private static extern(C) int caretProcFunc ( void * data ) { | 3918 private static extern(C) int caretProcFunc ( void * data ) { |
3920 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 3919 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
3921 CallbackData* cbdata = cast( CallbackData* ) data; | 3920 CallbackData* cbdata = cast( CallbackData* ) data; |
3922 return cbdata.display.caretProc( cast(int) cbdata.data ); | 3921 return cbdata.display.caretProc( cast(int) cbdata.data ); |
3923 } | 3922 } |
3924 int /*long*/ caretProc (int /*long*/ clientData) { | 3923 int /*long*/ caretProc (int /*long*/ clientData) { |
3925 caretId = 0; | 3924 caretId = 0; |
3944 cbdata.data = cast(void*)widget; | 3943 cbdata.data = cast(void*)widget; |
3945 return OS.g_signal_connect (cast(void*)window, OS.size_allocate.ptr, cast(GCallback)&sizeAllocateProcFunc, cast(void*)&cbdata); | 3944 return OS.g_signal_connect (cast(void*)window, OS.size_allocate.ptr, cast(GCallback)&sizeAllocateProcFunc, cast(void*)&cbdata); |
3946 } | 3945 } |
3947 | 3946 |
3948 private static extern(C) void sizeAllocateProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { | 3947 private static extern(C) void sizeAllocateProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
3949 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 3948 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
3950 auto cbdata = cast(CallbackData*)user_data; | 3949 auto cbdata = cast(CallbackData*)user_data; |
3951 cbdata.display.sizeAllocateProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); | 3950 cbdata.display.sizeAllocateProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); |
3952 } | 3951 } |
3953 | 3952 |
3954 void sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { | 3953 void sizeAllocateProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
3963 cbdata.data = cast(void*)widget; | 3962 cbdata.data = cast(void*)widget; |
3964 return OS.g_signal_connect (cast(void*)window, OS.size_request.ptr, cast(GCallback)&sizeRequestProcFunc, cast(void*)&cbdata ); | 3963 return OS.g_signal_connect (cast(void*)window, OS.size_request.ptr, cast(GCallback)&sizeRequestProcFunc, cast(void*)&cbdata ); |
3965 } | 3964 } |
3966 | 3965 |
3967 private static extern(C) void sizeRequestProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { | 3966 private static extern(C) void sizeRequestProcFunc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
3968 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 3967 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
3969 auto cbdata = cast(CallbackData*)user_data; | 3968 auto cbdata = cast(CallbackData*)user_data; |
3970 cbdata.display.sizeRequestProcMeth( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); | 3969 cbdata.display.sizeRequestProcMeth( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); |
3971 } | 3970 } |
3972 | 3971 |
3973 int /*long*/ sizeRequestProcMeth (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { | 3972 int /*long*/ sizeRequestProcMeth (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
3981 cbdata.data = cast(void*)widget; | 3980 cbdata.data = cast(void*)widget; |
3982 OS.gtk_tree_selection_selected_foreach (selection, &treeSelectionProcFunc, widget); | 3981 OS.gtk_tree_selection_selected_foreach (selection, &treeSelectionProcFunc, widget); |
3983 } | 3982 } |
3984 | 3983 |
3985 private static extern(C) void treeSelectionProcFunc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void* data) { | 3984 private static extern(C) void treeSelectionProcFunc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void* data) { |
3986 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 3985 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
3987 auto cbdata = cast(CallbackData*)data; | 3986 auto cbdata = cast(CallbackData*)data; |
3988 cbdata.display.treeSelectionProcMeth( model, path, iter, cbdata.data ); | 3987 cbdata.display.treeSelectionProcMeth( model, path, iter, cbdata.data ); |
3989 } | 3988 } |
3990 | 3989 |
3991 void treeSelectionProcMeth (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void* data) { | 3990 void treeSelectionProcMeth (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, void* data) { |
4047 caretProcCallbackData.data = cast(void*)0; | 4046 caretProcCallbackData.data = cast(void*)0; |
4048 caretId = OS.gtk_timeout_add (blinkRate, &caretProcFunc, &caretProcCallbackData); | 4047 caretId = OS.gtk_timeout_add (blinkRate, &caretProcFunc, &caretProcCallbackData); |
4049 } | 4048 } |
4050 | 4049 |
4051 private static extern(C) int /*long*/ shellMapProcFunc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) { | 4050 private static extern(C) int /*long*/ shellMapProcFunc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) { |
4052 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 4051 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
4053 auto cbdata = cast(CallbackData*)user_data; | 4052 auto cbdata = cast(CallbackData*)user_data; |
4054 return cbdata.display.shellMapProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); | 4053 return cbdata.display.shellMapProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); |
4055 } | 4054 } |
4056 | 4055 |
4057 int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { | 4056 int /*long*/ shellMapProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
4059 if (widget is null) return 0; | 4058 if (widget is null) return 0; |
4060 return widget.shellMapProc (handle, arg0, user_data); | 4059 return widget.shellMapProc (handle, arg0, user_data); |
4061 } | 4060 } |
4062 | 4061 |
4063 private static extern(C) int /*long*/ styleSetProcFunc (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) { | 4062 private static extern(C) int /*long*/ styleSetProcFunc (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) { |
4064 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 4063 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
4065 auto cbdata = cast(CallbackData*)user_data; | 4064 auto cbdata = cast(CallbackData*)user_data; |
4066 return cbdata.display.styleSetProcMeth( gobject, arg1, cast(int)cbdata.data ); | 4065 return cbdata.display.styleSetProcMeth( gobject, arg1, cast(int)cbdata.data ); |
4067 } | 4066 } |
4068 int /*long*/ styleSetProcMeth (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) { | 4067 int /*long*/ styleSetProcMeth (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ user_data) { |
4069 settingsChanged = true; | 4068 settingsChanged = true; |
4176 } | 4175 } |
4177 return '\0'; | 4176 return '\0'; |
4178 } | 4177 } |
4179 | 4178 |
4180 private static extern(C) int /*long*/ windowProcFunc2 (GtkWidget* handle, int /*long*/ user_data) { | 4179 private static extern(C) int /*long*/ windowProcFunc2 (GtkWidget* handle, int /*long*/ user_data) { |
4181 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 4180 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
4182 CallbackData* cbdata = cast(CallbackData*)user_data; | 4181 CallbackData* cbdata = cast(CallbackData*)user_data; |
4183 return cbdata.display.windowProc( handle, cast(int)cbdata.data ); | 4182 return cbdata.display.windowProc( handle, cast(int)cbdata.data ); |
4184 } | 4183 } |
4185 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ user_data) { | 4184 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ user_data) { |
4186 Widget widget = getWidget (handle); | 4185 Widget widget = getWidget (handle); |
4187 if (widget is null) return 0; | 4186 if (widget is null) return 0; |
4188 return widget.windowProc (handle, user_data); | 4187 return widget.windowProc (handle, user_data); |
4189 } | 4188 } |
4190 | 4189 |
4191 private static extern(C) int /*long*/ windowProcFunc3 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) { | 4190 private static extern(C) int /*long*/ windowProcFunc3 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) { |
4192 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 4191 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
4193 CallbackData* cbdata = cast(CallbackData*)user_data; | 4192 CallbackData* cbdata = cast(CallbackData*)user_data; |
4194 return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); | 4193 return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, cast(int)cbdata.data ); |
4195 } | 4194 } |
4196 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { | 4195 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
4197 Widget widget = getWidget (handle); | 4196 Widget widget = getWidget (handle); |
4198 if (widget is null) return 0; | 4197 if (widget is null) return 0; |
4199 return widget.windowProc (handle, arg0, user_data); | 4198 return widget.windowProc (handle, arg0, user_data); |
4200 } | 4199 } |
4201 | 4200 |
4202 private static extern(C) int /*long*/ windowProcFunc4 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) { | 4201 private static extern(C) int /*long*/ windowProcFunc4 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) { |
4203 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 4202 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
4204 CallbackData* cbdata = cast(CallbackData*)user_data; | 4203 CallbackData* cbdata = cast(CallbackData*)user_data; |
4205 return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, cast(int)cbdata.data ); | 4204 return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, cast(int)cbdata.data ); |
4206 } | 4205 } |
4207 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) { | 4206 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) { |
4208 Widget widget = getWidget (handle); | 4207 Widget widget = getWidget (handle); |
4209 if (widget is null) return 0; | 4208 if (widget is null) return 0; |
4210 return widget.windowProc (handle, arg0, arg1, user_data); | 4209 return widget.windowProc (handle, arg0, arg1, user_data); |
4211 } | 4210 } |
4212 | 4211 |
4213 private static extern(C) int /*long*/ windowProcFunc5 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) { | 4212 private static extern(C) int /*long*/ windowProcFunc5 (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) { |
4214 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 4213 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
4215 CallbackData* cbdata = cast(CallbackData*)user_data; | 4214 CallbackData* cbdata = cast(CallbackData*)user_data; |
4216 return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, arg2, cast(int)cbdata.data ); | 4215 return cbdata.display.windowProc( cast(GtkWidget*)handle, arg0, arg1, arg2, cast(int)cbdata.data ); |
4217 } | 4216 } |
4218 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) { | 4217 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) { |
4219 Widget widget = getWidget (handle); | 4218 Widget widget = getWidget (handle); |
4224 package int doWindowTimerAdd( CallbackData* cbdata, int delay, GtkWidget* widget ){ | 4223 package int doWindowTimerAdd( CallbackData* cbdata, int delay, GtkWidget* widget ){ |
4225 OS.g_object_set_data(cast(GObject*)widget, Display.classinfo.name.ptr, cast(void*)this); | 4224 OS.g_object_set_data(cast(GObject*)widget, Display.classinfo.name.ptr, cast(void*)this); |
4226 return OS.gtk_timeout_add (delay, &windowTimerProcFunc, widget); | 4225 return OS.gtk_timeout_add (delay, &windowTimerProcFunc, widget); |
4227 } | 4226 } |
4228 private static extern(C) int /*long*/ windowTimerProcFunc (void* user_data) { | 4227 private static extern(C) int /*long*/ windowTimerProcFunc (void* user_data) { |
4229 version(LOG) Stderr.formatln( "Display {}:", __LINE__ ).flush; | 4228 version(LOG) getDwtLogger().error( "Display {}:", __LINE__ ).flush; |
4230 Display d = cast(Display) OS.g_object_get_data(cast(GObject*)user_data, Display.classinfo.name.ptr ); | 4229 Display d = cast(Display) OS.g_object_get_data(cast(GObject*)user_data, Display.classinfo.name.ptr ); |
4231 return d.windowTimerProc( cast(GtkWidget*)user_data ); | 4230 return d.windowTimerProc( cast(GtkWidget*)user_data ); |
4232 } | 4231 } |
4233 | 4232 |
4234 int /*long*/ windowTimerProc (GtkWidget* handle) { | 4233 int /*long*/ windowTimerProc (GtkWidget* handle) { |