From 29e461a210d5d83a8fe88a9bd9dceaf8abc32816 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 7 Sep 2011 16:56:50 +0000 Subject: [PATCH] remove unnecessary GTK declarations from defs.h, move things only used once to the place that needs them git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 51 +++++++++++++++++++------------------------- include/wx/gtk/app.h | 2 +- include/wx/gtk/bitmap.h | 4 ++-- include/wx/gtk/control.h | 2 +- include/wx/gtk/dnd.h | 4 ++-- include/wx/gtk/dvrenderer.h | 2 +- include/wx/gtk/dvrenderers.h | 2 +- include/wx/gtk/fontpicker.h | 2 +- include/wx/gtk/pen.h | 2 +- include/wx/gtk/window.h | 2 +- include/wx/gtk1/app.h | 4 +++- include/wx/gtk1/control.h | 2 +- include/wx/gtk1/dnd.h | 4 ++-- include/wx/gtk1/listbox.h | 2 ++ include/wx/gtk1/pen.h | 4 ++-- include/wx/gtk1/window.h | 4 ++++ src/gtk/bitmap.cpp | 2 +- src/gtk/dataview.cpp | 4 ++-- src/gtk/window.cpp | 2 +- 19 files changed, 51 insertions(+), 50 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index dfd737e..5376fac 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -3285,52 +3285,45 @@ typedef long WXPixel; /* safety catch in src/motif/colour.cpp */ #ifdef __WXGTK__ /* Stand-ins for GLIB types */ -typedef char gchar; -typedef signed char gint8; -typedef int gint; -typedef unsigned guint; -typedef unsigned long gulong; -typedef void* gpointer; typedef struct _GSList GSList; /* Stand-ins for GDK types */ typedef struct _GdkColor GdkColor; -typedef struct _GdkColormap GdkColormap; -typedef struct _GdkFont GdkFont; -typedef struct _GdkGC GdkGC; -typedef struct _GdkVisual GdkVisual; - -#ifdef __WXGTK20__ -typedef struct _GdkAtom *GdkAtom; -typedef struct _GdkDrawable GdkWindow; -typedef struct _GdkDrawable GdkBitmap; -typedef struct _GdkDrawable GdkPixmap; -#else /* GTK+ 1.2 */ -typedef gulong GdkAtom; -typedef struct _GdkWindow GdkWindow; -typedef struct _GdkWindow GdkBitmap; -typedef struct _GdkWindow GdkPixmap; -#endif /* GTK+ 1.2/2.0 */ - typedef struct _GdkCursor GdkCursor; -typedef struct _GdkRegion GdkRegion; typedef struct _GdkDragContext GdkDragContext; -#ifdef HAVE_XIM -typedef struct _GdkIC GdkIC; -typedef struct _GdkICAttr GdkICAttr; +#if defined(__WXGTK20__) + typedef struct _GdkAtom* GdkAtom; +#else + typedef unsigned long GdkAtom; +#endif + +#if !defined(__WXGTK30__) + typedef struct _GdkColormap GdkColormap; + typedef struct _GdkFont GdkFont; + typedef struct _GdkGC GdkGC; + typedef struct _GdkRegion GdkRegion; +#endif + +#if defined(__WXGTK30__) + typedef struct _GdkWindow GdkWindow; +#elif defined(__WXGTK20__) + typedef struct _GdkDrawable GdkWindow; + typedef struct _GdkDrawable GdkPixmap; +#else + typedef struct _GdkWindow GdkWindow; + typedef struct _GdkWindow GdkBitmap; + typedef struct _GdkWindow GdkPixmap; #endif /* Stand-ins for GTK types */ typedef struct _GtkWidget GtkWidget; typedef struct _GtkRcStyle GtkRcStyle; typedef struct _GtkAdjustment GtkAdjustment; -typedef struct _GtkList GtkList; typedef struct _GtkToolbar GtkToolbar; typedef struct _GtkNotebook GtkNotebook; typedef struct _GtkNotebookPage GtkNotebookPage; typedef struct _GtkAccelGroup GtkAccelGroup; -typedef struct _GtkItemFactory GtkItemFactory; typedef struct _GtkSelectionData GtkSelectionData; typedef struct _GtkTextBuffer GtkTextBuffer; typedef struct _GtkRange GtkRange; diff --git a/include/wx/gtk/app.h b/include/wx/gtk/app.h index 0954cd4..57ff95f 100644 --- a/include/wx/gtk/app.h +++ b/include/wx/gtk/app.h @@ -75,7 +75,7 @@ private: #if wxUSE_THREADS wxMutex m_idleMutex; #endif - guint m_idleSourceId; + unsigned m_idleSourceId; #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2 HildonProgram *m_hildonProgram; diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index 71f5d5b..560dfa2 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -30,8 +30,8 @@ public: virtual ~wxMask(); // implementation - GdkBitmap *m_bitmap; - GdkBitmap *GetBitmap() const; + GdkPixmap* m_bitmap; + GdkPixmap* GetBitmap() const; protected: virtual void FreeData(); diff --git a/include/wx/gtk/control.h b/include/wx/gtk/control.h index 594285f..7e14b84 100644 --- a/include/wx/gtk/control.h +++ b/include/wx/gtk/control.h @@ -20,7 +20,7 @@ typedef struct _GtkFrame GtkFrame; // C-linkage function pointer types for GetDefaultAttributesFromGTKWidget extern "C" { typedef GtkWidget* (*wxGtkWidgetNew_t)(void); - typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const gchar*); + typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const char*); typedef GtkWidget* (*wxGtkWidgetNewFromAdj_t)(GtkAdjustment*); } diff --git a/include/wx/gtk/dnd.h b/include/wx/gtk/dnd.h index 56fc48d..66a1c3a 100644 --- a/include/wx/gtk/dnd.h +++ b/include/wx/gtk/dnd.h @@ -50,13 +50,13 @@ public: GdkDragContext *m_dragContext; GtkWidget *m_dragWidget; GtkSelectionData *m_dragData; - guint m_dragTime; + unsigned m_dragTime; bool m_firstMotion; // gdk has no "gdk_drag_enter" event void GTKSetDragContext( GdkDragContext *dc ) { m_dragContext = dc; } void GTKSetDragWidget( GtkWidget *w ) { m_dragWidget = w; } void GTKSetDragData( GtkSelectionData *sd ) { m_dragData = sd; } - void GTKSetDragTime( guint time ) { m_dragTime = time; } + void GTKSetDragTime(unsigned time) { m_dragTime = time; } }; //------------------------------------------------------------------------- diff --git a/include/wx/gtk/dvrenderer.h b/include/wx/gtk/dvrenderer.h index c6ecb39..1c1bc50 100644 --- a/include/wx/gtk/dvrenderer.h +++ b/include/wx/gtk/dvrenderer.h @@ -48,7 +48,7 @@ public: // // it validates the new value and notifies the model about the change by // calling GtkOnCellChanged() if it was accepted - virtual void GtkOnTextEdited(const gchar *itempath, const wxString& value); + virtual void GtkOnTextEdited(const char *itempath, const wxString& value); GtkCellRenderer* GetGtkHandle() { return m_renderer; } void GtkInitHandlers(); diff --git a/include/wx/gtk/dvrenderers.h b/include/wx/gtk/dvrenderers.h index 563d309..f833f8e 100644 --- a/include/wx/gtk/dvrenderers.h +++ b/include/wx/gtk/dvrenderers.h @@ -303,7 +303,7 @@ public: virtual bool GetValue( wxVariant &value ) const; private: - virtual void GtkOnTextEdited(const gchar *itempath, const wxString& str); + virtual void GtkOnTextEdited(const char *itempath, const wxString& str); }; diff --git a/include/wx/gtk/fontpicker.h b/include/wx/gtk/fontpicker.h index 80376e5..0a7cae4 100644 --- a/include/wx/gtk/fontpicker.h +++ b/include/wx/gtk/fontpicker.h @@ -52,7 +52,7 @@ protected: public: // used by the GTK callback only - void SetNativeFontInfo(const gchar *gtkdescription) + void SetNativeFontInfo(const char *gtkdescription) { m_selectedFont.SetNativeFontInfo(wxString::FromAscii(gtkdescription)); } private: diff --git a/include/wx/gtk/pen.h b/include/wx/gtk/pen.h index 4f1a3cf..2437073 100644 --- a/include/wx/gtk/pen.h +++ b/include/wx/gtk/pen.h @@ -10,7 +10,7 @@ #ifndef _WX_GTK_PEN_H_ #define _WX_GTK_PEN_H_ -typedef gint8 wxGTKDash; +typedef signed char wxGTKDash; //----------------------------------------------------------------------------- // wxPen diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index df2e41d..8155d24 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -370,7 +370,7 @@ protected: // // This is just a wrapper for g_signal_connect() and returns the handler id // just as it does. - gulong GTKConnectWidget(const char *signal, void (*callback)()); + unsigned long GTKConnectWidget(const char *signal, void (*callback)()); // Return true from here if PostCreation() should connect to size_request // signal: this is done by default but doesn't work for some native diff --git a/include/wx/gtk1/app.h b/include/wx/gtk1/app.h index c7c2f39..cd27946 100644 --- a/include/wx/gtk1/app.h +++ b/include/wx/gtk1/app.h @@ -14,6 +14,8 @@ #include "wx/icon.h" #include "wx/strconv.h" +typedef struct _GdkVisual GdkVisual; + //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- @@ -53,7 +55,7 @@ public: bool IsInAssert() const { return m_isInAssert; } - gint m_idleTag; + int m_idleTag; void RemoveIdleTag(); unsigned char *m_colorCube; diff --git a/include/wx/gtk1/control.h b/include/wx/gtk1/control.h index 79ec3f4..8815a7e 100644 --- a/include/wx/gtk1/control.h +++ b/include/wx/gtk1/control.h @@ -31,7 +31,7 @@ typedef struct _GtkFrame GtkFrame; // C-linkage function pointer types for GetDefaultAttributesFromGTKWidget extern "C" { typedef GtkWidget* (*wxGtkWidgetNew_t)(void); - typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const gchar*); + typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const char*); typedef GtkWidget* (*wxGtkWidgetNewFromAdj_t)(GtkAdjustment*); } diff --git a/include/wx/gtk1/dnd.h b/include/wx/gtk1/dnd.h index 01187d8..8102626 100644 --- a/include/wx/gtk1/dnd.h +++ b/include/wx/gtk1/dnd.h @@ -65,13 +65,13 @@ public: GdkDragContext *m_dragContext; GtkWidget *m_dragWidget; GtkSelectionData *m_dragData; - guint m_dragTime; + unsigned m_dragTime; bool m_firstMotion; // gdk has no "gdk_drag_enter" event void SetDragContext( GdkDragContext *dc ) { m_dragContext = dc; } void SetDragWidget( GtkWidget *w ) { m_dragWidget = w; } void SetDragData( GtkSelectionData *sd ) { m_dragData = sd; } - void SetDragTime( guint time ) { m_dragTime = time; } + void SetDragTime(unsigned time) { m_dragTime = time; } }; //------------------------------------------------------------------------- diff --git a/include/wx/gtk1/listbox.h b/include/wx/gtk1/listbox.h index be62c96..c9d6a48 100644 --- a/include/wx/gtk1/listbox.h +++ b/include/wx/gtk1/listbox.h @@ -12,6 +12,8 @@ #include "wx/list.h" +typedef struct _GtkList GtkList; + class WXDLLIMPEXP_FWD_BASE wxSortedArrayString; //----------------------------------------------------------------------------- diff --git a/include/wx/gtk1/pen.h b/include/wx/gtk1/pen.h index 97fea92..724b9b7 100644 --- a/include/wx/gtk1/pen.h +++ b/include/wx/gtk1/pen.h @@ -23,9 +23,9 @@ class WXDLLIMPEXP_FWD_CORE wxPen; #if defined(__WXGTK127__) -typedef gint8 wxGTKDash; +typedef signed char wxGTKDash; #else -typedef gchar wxGTKDash; +typedef char wxGTKDash; #endif //----------------------------------------------------------------------------- diff --git a/include/wx/gtk1/window.h b/include/wx/gtk1/window.h index 8d37e57..388f06f 100644 --- a/include/wx/gtk1/window.h +++ b/include/wx/gtk1/window.h @@ -11,6 +11,10 @@ #define __GTKWINDOWH__ typedef struct _GtkTooltips GtkTooltips; +#ifdef HAVE_XIM +typedef struct _GdkIC GdkIC; +typedef struct _GdkICAttr GdkICAttr; +#endif // helper structure that holds class that holds GtkIMContext object and // some additional data needed for key events processing diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index a50e8a8..606529c 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -207,7 +207,7 @@ bool wxMask::InitFromMonoBitmap(const wxBitmap& bitmap) return true; } -GdkBitmap *wxMask::GetBitmap() const +GdkPixmap* wxMask::GetBitmap() const { return m_bitmap; } diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 9c0115e..a50f37a 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -2001,7 +2001,7 @@ wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const } void -wxDataViewRenderer::GtkOnTextEdited(const gchar *itempath, const wxString& str) +wxDataViewRenderer::GtkOnTextEdited(const char *itempath, const wxString& str) { wxVariant value(str); if (!Validate( value )) @@ -2764,7 +2764,7 @@ wxDataViewChoiceByIndexRenderer::wxDataViewChoiceByIndexRenderer( const wxArrayS { } -void wxDataViewChoiceByIndexRenderer::GtkOnTextEdited(const gchar *itempath, const wxString& str) +void wxDataViewChoiceByIndexRenderer::GtkOnTextEdited(const char *itempath, const wxString& str) { wxVariant value( (long) GetChoices().Index( str ) ); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index ed62554..6834a22 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2474,7 +2474,7 @@ void wxWindowGTK::PostCreation() gtk_widget_show( m_widget ); } -gulong wxWindowGTK::GTKConnectWidget(const char *signal, void (*callback)()) +unsigned long wxWindowGTK::GTKConnectWidget(const char *signal, void (*callback)()) { return g_signal_connect(m_widget, signal, callback, this); } -- 2.7.4