]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/gtk/private.h
implemented UTF-16/32 using To/FromWChar() instead of MB2WC/WC2MB for sizeof(wchar_t...
[wxWidgets.git] / include / wx / gtk / private.h
index 7219dba13b6b6e95e33a899e705327ec29fdf846..2ce2865725f3fbf12c5ee31d08941f272af4e66f 100644 (file)
     #define wxGTK_CONV_BACK(s)  wxConvLocal.cWC2WX( (wxConvUTF8.cMB2WC( s ) ) )
 #endif
 
+// Some deprecated GTK+ prototypes we still use often
+// FIXME: Don't use them if possible.
+G_BEGIN_DECLS
+
+// Should use gtk_image_new, but the mask seems to be handled different,
+// and we need to migrate
+GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap,
+                           GdkBitmap *mask);
+
+// Deprecated since GTK+-1.3.7:
+// Trivial wrapper around gtk_window_move, with some side effects we seem to rely on
+void gtk_widget_set_uposition (GtkWidget *widget,
+                               gint      x,
+                               gint      y);
+
+// We rely on the allow_shrink parameter in one place
+void gtk_window_set_policy (GtkWindow *window,
+                            gint       allow_shrink,
+                            gint       allow_grow,
+                            gint       auto_shrink);
+
+G_END_DECLS
+
+//-----------------------------------------------------------------------------
+// idle system
+//-----------------------------------------------------------------------------
+
+extern void wxapp_install_idle_handler();
+extern bool g_isIdle;
+
+//-----------------------------------------------------------------------------
+// Convenience class for g_freeing a gchar* on scope exit automatically
+//-----------------------------------------------------------------------------
+
+class wxGtkString
+{
+public:
+    explicit wxGtkString(gchar *s) : m_str(s) { }
+    ~wxGtkString() { g_free(m_str); }
+
+    const gchar *c_str() const { return m_str; }
+
+    operator gchar *() const { return m_str; }
+
+private:
+    gchar *m_str;
+
+    DECLARE_NO_COPY_CLASS(wxGtkString)
+};
+
+//-----------------------------------------------------------------------------
+// GTK+ scroll types -> wxEventType
+//-----------------------------------------------------------------------------
+
 // translate a GTK+ scroll type to a wxEventType
 inline wxEventType GtkScrollTypeToWx(guint scrollType)
 {
@@ -66,6 +120,11 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
             wxEVT_SCROLLWIN_TOP - wxEVT_SCROLL_TOP;
 }
 
+
+//-----------------------------------------------------------------------------
+// Misc. functions
+//-----------------------------------------------------------------------------
+
 // Needed for implementing e.g. combobox on wxGTK within a modal dialog.
 void wxAddGrab(wxWindow* window);
 void wxRemoveGrab(wxWindow* window);