]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/private.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/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_
20 // fail all version tests if the GTK+ version is so ancient that it doesn't
21 // even have GTK_CHECK_VERSION
22 #ifndef GTK_CHECK_VERSION
23 #define GTK_CHECK_VERSION(a, b, c) 0
26 #define wxGTK_CONV(s) s.c_str()
27 #define wxGTK_CONV_BACK(s) s
30 // child is not a member of GTK_BUTTON() any more in GTK+ 2.0
31 #define BUTTON_CHILD(w) GTK_BUTTON((w))->child
33 // event_window has disappeared from GtkToggleButton in GTK+ 2.0
34 #define TOGGLE_BUTTON_EVENT_WIN(w) GTK_TOGGLE_BUTTON((w))->event_window
36 // gtk_editable_{copy|cut|paste}_clipboard() had an extra argument under
37 // previous GTK+ versions but no more
38 #if defined(__WXGTK20__) || (GTK_MINOR_VERSION > 0)
39 #define DUMMY_CLIPBOARD_ARG
41 #define DUMMY_CLIPBOARD_ARG ,0
44 // _GtkEditable is private in GTK2
45 #define GET_EDITABLE_POS(w) GTK_EDITABLE((w))->current_pos
46 #define SET_EDITABLE_POS(w, pos) \
47 GTK_EDITABLE((w))->current_pos = (pos)
49 // this GtkNotebook struct field has been renamed in GTK2
50 #define NOTEBOOK_PANEL(nb) GTK_NOTEBOOK(nb)->panel
52 #define SCROLLBAR_CBACK_ARG
53 #define GET_SCROLL_TYPE(w) GTK_RANGE((w))->scroll_type
55 // translate a GTK+ scroll type to a wxEventType
56 inline wxEventType
GtkScrollTypeToWx(guint scrollType
)
61 case GTK_SCROLL_STEP_BACKWARD
:
62 command
= wxEVT_SCROLL_LINEUP
;
65 case GTK_SCROLL_STEP_FORWARD
:
66 command
= wxEVT_SCROLL_LINEDOWN
;
69 case GTK_SCROLL_PAGE_BACKWARD
:
70 command
= wxEVT_SCROLL_PAGEUP
;
73 case GTK_SCROLL_PAGE_FORWARD
:
74 command
= wxEVT_SCROLL_PAGEDOWN
;
78 command
= wxEVT_SCROLL_THUMBTRACK
;
84 inline wxEventType
GtkScrollWinTypeToWx(guint scrollType
)
86 // GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
87 return GtkScrollTypeToWx(scrollType
) +
88 wxEVT_SCROLLWIN_TOP
- wxEVT_SCROLL_TOP
;
91 // Needed for implementing e.g. combobox on wxGTK within a modal dialog.
92 void wxAddGrab(wxWindow
* window
);
93 void wxRemoveGrab(wxWindow
* window
);
95 // The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
96 // GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
98 #ifdef NEED_GTK_ICON_SIZE_LOOKUP
99 extern "C" gboolean
gtk_icon_size_lookup (GtkIconSize size
,
104 #endif // _WX_GTK_PRIVATE_H_