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 // translate a GTK+ scroll type to a wxEventType
34 inline wxEventType
GtkScrollTypeToWx(guint scrollType
)
39 case GTK_SCROLL_STEP_BACKWARD
:
40 command
= wxEVT_SCROLL_LINEUP
;
43 case GTK_SCROLL_STEP_FORWARD
:
44 command
= wxEVT_SCROLL_LINEDOWN
;
47 case GTK_SCROLL_PAGE_BACKWARD
:
48 command
= wxEVT_SCROLL_PAGEUP
;
51 case GTK_SCROLL_PAGE_FORWARD
:
52 command
= wxEVT_SCROLL_PAGEDOWN
;
56 command
= wxEVT_SCROLL_THUMBTRACK
;
62 inline wxEventType
GtkScrollWinTypeToWx(guint scrollType
)
64 // GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
65 return GtkScrollTypeToWx(scrollType
) +
66 wxEVT_SCROLLWIN_TOP
- wxEVT_SCROLL_TOP
;
69 // Needed for implementing e.g. combobox on wxGTK within a modal dialog.
70 void wxAddGrab(wxWindow
* window
);
71 void wxRemoveGrab(wxWindow
* window
);
73 // Escapes string so that it is valid Pango markup XML string:
74 WXDLLIMPEXP_CORE wxString
wxEscapeStringForPangoMarkup(const wxString
& str
);
76 // The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
77 // GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
79 #ifdef NEED_GTK_ICON_SIZE_LOOKUP
80 extern "C" gboolean
gtk_icon_size_lookup (GtkIconSize size
,
85 #endif // _WX_GTK_PRIVATE_H_