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 // FIXME: Make gtk2 only, so no macros needed - MR
34 // GTK+ 2.0 compatibility define is broken when used from C++ as it
35 // casts enum to int implicitly
36 #undef gtk_signal_disconnect_by_func
37 #define gtk_signal_disconnect_by_func(object,func,data) \
38 gtk_signal_compat_matched((object), (func), (data), \
39 (GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \
40 G_SIGNAL_MATCH_DATA), 0)
42 // translate a GTK+ scroll type to a wxEventType
43 inline wxEventType
GtkScrollTypeToWx(guint scrollType
)
48 case GTK_SCROLL_STEP_BACKWARD
:
49 command
= wxEVT_SCROLL_LINEUP
;
52 case GTK_SCROLL_STEP_FORWARD
:
53 command
= wxEVT_SCROLL_LINEDOWN
;
56 case GTK_SCROLL_PAGE_BACKWARD
:
57 command
= wxEVT_SCROLL_PAGEUP
;
60 case GTK_SCROLL_PAGE_FORWARD
:
61 command
= wxEVT_SCROLL_PAGEDOWN
;
65 command
= wxEVT_SCROLL_THUMBTRACK
;
71 inline wxEventType
GtkScrollWinTypeToWx(guint scrollType
)
73 // GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
74 return GtkScrollTypeToWx(scrollType
) +
75 wxEVT_SCROLLWIN_TOP
- wxEVT_SCROLL_TOP
;
78 // Needed for implementing e.g. combobox on wxGTK within a modal dialog.
79 void wxAddGrab(wxWindow
* window
);
80 void wxRemoveGrab(wxWindow
* window
);
82 // Escapes string so that it is valid Pango markup XML string:
83 WXDLLIMPEXP_CORE wxString
wxEscapeStringForPangoMarkup(const wxString
& str
);
85 // The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
86 // GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
88 #ifdef NEED_GTK_ICON_SIZE_LOOKUP
89 extern "C" gboolean
gtk_icon_size_lookup (GtkIconSize size
,
94 #endif // _WX_GTK_PRIVATE_H_