]>
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
7 // Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_PRIVATE_H_
12 #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
25 #define wxGTK_CONV(s) s.c_str()
26 #define wxGTK_CONV_BACK(s) s
29 // child is not a member of GTK_BUTTON() any more in GTK+ 2.0
30 #define BUTTON_CHILD(w) GTK_BUTTON((w))->child
32 // event_window has disappeared from GtkToggleButton in GTK+ 2.0
33 #define TOGGLE_BUTTON_EVENT_WIN(w) GTK_TOGGLE_BUTTON((w))->event_window
35 // gtk_editable_{copy|cut|paste}_clipboard() had an extra argument under
36 // previous GTK+ versions but no more
37 #if defined(__WXGTK20__) || (GTK_MINOR_VERSION > 0)
38 #define DUMMY_CLIPBOARD_ARG
40 #define DUMMY_CLIPBOARD_ARG ,0
43 // _GtkEditable is private in GTK2
44 #define GET_EDITABLE_POS(w) GTK_EDITABLE((w))->current_pos
45 #define SET_EDITABLE_POS(w, pos) \
46 GTK_EDITABLE((w))->current_pos = (pos)
48 // this GtkNotebook struct field has been renamed in GTK2
49 #define NOTEBOOK_PANEL(nb) GTK_NOTEBOOK(nb)->panel
51 #define SCROLLBAR_CBACK_ARG
52 #define GET_SCROLL_TYPE(w) GTK_RANGE((w))->scroll_type
54 // translate a GTK+ scroll type to a wxEventType
55 inline wxEventType
GtkScrollTypeToWx(guint scrollType
)
60 case GTK_SCROLL_STEP_BACKWARD
:
61 command
= wxEVT_SCROLL_LINEUP
;
64 case GTK_SCROLL_STEP_FORWARD
:
65 command
= wxEVT_SCROLL_LINEDOWN
;
68 case GTK_SCROLL_PAGE_BACKWARD
:
69 command
= wxEVT_SCROLL_PAGEUP
;
72 case GTK_SCROLL_PAGE_FORWARD
:
73 command
= wxEVT_SCROLL_PAGEDOWN
;
77 command
= wxEVT_SCROLL_THUMBTRACK
;
83 inline wxEventType
GtkScrollWinTypeToWx(guint scrollType
)
85 // GtkScrollTypeToWx() returns SCROLL_XXX, not SCROLLWIN_XXX as we need
86 return GtkScrollTypeToWx(scrollType
) +
87 wxEVT_SCROLLWIN_TOP
- wxEVT_SCROLL_TOP
;
90 // Needed for implementing e.g. combobox on wxGTK within a modal dialog.
91 void wxAddGrab(wxWindow
* window
);
92 void wxRemoveGrab(wxWindow
* window
);
94 #endif // _WX_GTK_PRIVATE_H_