]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/private.h
fix for longlongHash for architectures where sizeof(long long) == sizeof(long)
[wxWidgets.git] / include / wx / gtk / private.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/private.h
3 // Purpose: wxGTK private macros, functions &c
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 12.03.02
7 // RCS-ID: $Id$
8 // Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GTK_PRIVATE_H_
13 #define _WX_GTK_PRIVATE_H_
14
15 #include <gtk/gtk.h>
16
17 #include "wx/event.h"
18 #include "wx/gtk/private/string.h"
19
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
24 #endif
25
26 #if wxUSE_UNICODE
27 #define wxGTK_CONV(s) wxConvUTF8.cWX2MB((s))
28 #define wxGTK_CONV_ENC(s, enc) wxGTK_CONV((s))
29 #define wxGTK_CONV_FONT(s, font) wxGTK_CONV((s))
30 #define wxGTK_CONV_SYS(s) wxGTK_CONV((s))
31 #define wxGTK_CONV_BACK(s) wxConvUTF8.cMB2WX((s))
32 #else
33 #include "wx/font.h"
34
35 // convert the text in given encoding to UTF-8 used by wxGTK
36 extern wxCharBuffer
37 wxConvertToGTK(const wxString& s,
38 wxFontEncoding enc = wxFONTENCODING_SYSTEM);
39
40 // helper: use the encoding of the given font if it's valid
41 inline wxCharBuffer wxConvertToGTK(const wxString& s, const wxFont& font)
42 {
43 return wxConvertToGTK(s, font.Ok() ? font.GetEncoding()
44 : wxFONTENCODING_SYSTEM);
45 }
46
47 #define wxGTK_CONV_ENC(s, enc) wxConvertToGTK((s), (enc))
48 #define wxGTK_CONV_FONT(s, font) wxConvertToGTK((s), (font))
49 #define wxGTK_CONV(s) wxGTK_CONV_FONT((s), m_font)
50 #define wxGTK_CONV_SYS(s) wxConvertToGTK((s))
51 #define wxGTK_CONV_BACK(s) wxConvLocal.cWC2WX(wxConvUTF8.cMB2WC((s)))
52 #endif
53
54 // Some deprecated GTK+ prototypes we still use often
55 // FIXME: Don't use them if possible.
56 G_BEGIN_DECLS
57
58 // Should use gtk_image_new, but the mask seems to be handled different,
59 // and we need to migrate
60 GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap,
61 GdkBitmap *mask);
62
63 // Deprecated since GTK+-1.3.7:
64 // Trivial wrapper around gtk_window_move, with some side effects we seem to rely on
65 void gtk_widget_set_uposition (GtkWidget *widget,
66 gint x,
67 gint y);
68
69 // We rely on the allow_shrink parameter in one place
70 void gtk_window_set_policy (GtkWindow *window,
71 gint allow_shrink,
72 gint allow_grow,
73 gint auto_shrink);
74
75 G_END_DECLS
76
77 //-----------------------------------------------------------------------------
78 // idle system
79 //-----------------------------------------------------------------------------
80
81 extern void wxapp_install_idle_handler();
82 extern bool g_isIdle;
83
84 //-----------------------------------------------------------------------------
85 // Misc. functions
86 //-----------------------------------------------------------------------------
87
88 // Needed for implementing e.g. combobox on wxGTK within a modal dialog.
89 void wxAddGrab(wxWindow* window);
90 void wxRemoveGrab(wxWindow* window);
91
92 // Escapes string so that it is valid Pango markup XML string:
93 WXDLLIMPEXP_CORE wxString wxEscapeStringForPangoMarkup(const wxString& str);
94
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
97 // for Solaris 9 x86.
98 #ifdef NEED_GTK_ICON_SIZE_LOOKUP
99 extern "C" gboolean gtk_icon_size_lookup (GtkIconSize size,
100 gint *width,
101 gint *height);
102 #endif
103
104 #endif // _WX_GTK_PRIVATE_H_
105