1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/private.h
3 // Purpose: wxGTK private macros, functions &c
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GTK_PRIVATE_H_
13 #define _WX_GTK_PRIVATE_H_
19 // fail all version tests if the GTK+ version is so ancient that it doesn't
20 // even have GTK_CHECK_VERSION
21 #ifndef GTK_CHECK_VERSION
22 #define GTK_CHECK_VERSION(a, b, c) 0
26 #define wxGTK_CONV(s) wxConvUTF8.cWX2MB(s)
27 #define wxGTK_CONV_BACK(s) wxConvUTF8.cMB2WX(s)
29 #define wxGTK_CONV(s) wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC(s) )
30 #define wxGTK_CONV_BACK(s) wxConvLocal.cWC2WX( (wxConvUTF8.cMB2WC( s ) ) )
33 // Some deprecated GTK+ prototypes we still use often
34 // FIXME: Don't use them if possible.
37 // Should use gtk_image_new, but the mask seems to be handled different,
38 // and we need to migrate
39 GtkWidget
* gtk_pixmap_new (GdkPixmap
*pixmap
,
42 // Deprecated since GTK+-1.3.7:
43 // Trivial wrapper around gtk_window_move, with some side effects we seem to rely on
44 void gtk_widget_set_uposition (GtkWidget
*widget
,
48 // We rely on the allow_shrink parameter in one place
49 void gtk_window_set_policy (GtkWindow
*window
,
56 //-----------------------------------------------------------------------------
58 //-----------------------------------------------------------------------------
60 extern void wxapp_install_idle_handler();
63 //-----------------------------------------------------------------------------
64 // GTK+ scroll types -> wxEventType
65 //-----------------------------------------------------------------------------
67 // translate a GTK+ scroll type to a wxEventType
68 inline wxEventType
GtkScrollTypeToWx(guint scrollType
)
73 case GTK_SCROLL_STEP_BACKWARD
:
74 command
= wxEVT_SCROLL_LINEUP
;
77 case GTK_SCROLL_STEP_FORWARD
:
78 command
= wxEVT_SCROLL_LINEDOWN
;
81 case GTK_SCROLL_PAGE_BACKWARD
:
82 command
= wxEVT_SCROLL_PAGEUP
;
85 case GTK_SCROLL_PAGE_FORWARD
:
86 command
= wxEVT_SCROLL_PAGEDOWN
;
90 command
= wxEVT_SCROLL_THUMBTRACK
;
96 inline wxEventType
GtkScrollWinTypeToWx(guint scrollType
)
98 // GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
99 return GtkScrollTypeToWx(scrollType
) +
100 wxEVT_SCROLLWIN_TOP
- wxEVT_SCROLL_TOP
;
104 //-----------------------------------------------------------------------------
106 //-----------------------------------------------------------------------------
108 // Needed for implementing e.g. combobox on wxGTK within a modal dialog.
109 void wxAddGrab(wxWindow
* window
);
110 void wxRemoveGrab(wxWindow
* window
);
112 // Escapes string so that it is valid Pango markup XML string:
113 WXDLLIMPEXP_CORE wxString
wxEscapeStringForPangoMarkup(const wxString
& str
);
115 // The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
116 // GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
117 // for Solaris 9 x86.
118 #ifdef NEED_GTK_ICON_SIZE_LOOKUP
119 extern "C" gboolean
gtk_icon_size_lookup (GtkIconSize size
,
124 #endif // _WX_GTK_PRIVATE_H_