From b02da6b18713d069cc9f4077f9b43df7a11bc7fb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 2 Nov 1999 18:41:23 +0000 Subject: [PATCH] many warnings fixed (from HP-UX compilation log) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dataobj.h | 42 +++++------ include/wx/event.h | 58 +++++++++++----- include/wx/gtk/dataobj2.h | 18 +++++ include/wx/gtk/region.h | 12 ++-- include/wx/gtk1/dataobj2.h | 18 +++++ include/wx/gtk1/region.h | 12 ++-- include/wx/tbarbase.h | 53 +++++++------- src/gtk/clipbrd.cpp | 14 ++-- src/gtk/combobox.cpp | 4 +- src/gtk/dnd.cpp | 4 +- src/gtk/font.cpp | 4 +- src/gtk/spinbutt.cpp | 3 +- src/gtk/spinctrl.cpp | 3 +- src/gtk/textctrl.cpp | 2 +- src/gtk/tooltip.cpp | 5 +- src/gtk/window.cpp | 138 +++++++++++++++++++------------------ src/gtk1/clipbrd.cpp | 14 ++-- src/gtk1/combobox.cpp | 4 +- src/gtk1/dnd.cpp | 4 +- src/gtk1/font.cpp | 4 +- src/gtk1/spinbutt.cpp | 3 +- src/gtk1/spinctrl.cpp | 3 +- src/gtk1/textctrl.cpp | 2 +- src/gtk1/tooltip.cpp | 5 +- src/gtk1/window.cpp | 138 +++++++++++++++++++------------------ src/unix/fontenum.cpp | 2 +- 26 files changed, 317 insertions(+), 252 deletions(-) diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index ae1a30c870..1607559a5d 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -317,15 +317,13 @@ public: private: wxString m_text; -#if defined(__VISAGECPP__) - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& WXUNUSED(rFormat), void *pBuf) const - { return(GetDataHere(pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } -#endif + // virtual function hiding supression + size_t GetDataSize(const wxDataFormat& format) const + { return(wxDataObjectSimple::GetDataSize(format)); } + bool GetDataHere(const wxDataFormat& WXUNUSED(format), void *pBuf) const + { return(wxDataObjectSimple::GetDataHere(pBuf)); } + bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) + { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; // ---------------------------------------------------------------------------- @@ -374,14 +372,12 @@ public: protected: wxArrayString m_filenames; -#if defined(__VISAGECPP__) private: // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& WXUNUSED(rformat), void* pBuf) const - { return(GetDataHere(pBuf)); } -#endif + size_t GetDataSize(const wxDataFormat& format) const + { return(wxDataObjectSimple::GetDataSize(format)); } + bool GetDataHere(const wxDataFormat& WXUNUSED(format), void* pBuf) const + { return(wxDataObjectSimple::GetDataHere(pBuf)); } }; // ---------------------------------------------------------------------------- @@ -429,15 +425,13 @@ private: size_t m_size; void *m_data; -#if defined(__VISAGECPP__) - // Virtual function hiding supression - size_t GetDataSize(const wxDataFormat& rFormat) const - { return(wxDataObjectSimple::GetDataSize(rFormat)); } - bool GetDataHere(const wxDataFormat& rFormat, void* pBuf) const - { return(wxDataObjectSimple::GetDataHere(rFormat, pBuf)); } - bool SetData(const wxDataFormat& rFormat, size_t nLen, const void* pBuf) - { return(wxDataObjectSimple::SetData(rFormat, nLen, pBuf)); } -#endif + // virtual function hiding supression + size_t GetDataSize(const wxDataFormat& format) const + { return(wxDataObjectSimple::GetDataSize(format)); } + bool GetDataHere(const wxDataFormat& format, void* pBuf) const + { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } + bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) + { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; // ---------------------------------------------------------------------------- diff --git a/include/wx/event.h b/include/wx/event.h index 1e9f2df629..10d5eb7970 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -605,15 +605,21 @@ public: bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); } // Find the position of the event - void GetPosition(long *xpos, long *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } + void GetPosition(wxCoord *xpos, wxCoord *ypos) const + { + if (xpos) + *xpos = m_x; + if (ypos) + *ypos = m_y; + } + void GetPosition(int *xpos, int *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } - void Position(long *xpos, long *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } + { + if (xpos) + *xpos = (int)m_x; + if (ypos) + *ypos = (int)m_y; + } // Find the position of the event wxPoint GetPosition() const { return wxPoint(m_x, m_y); } @@ -623,6 +629,14 @@ public: // Compatibility #if WXWIN_COMPATIBILITY + void Position(long *xpos, long *ypos) const + { + if (xpos) + *xpos = (long)m_x; + if (ypos) + *ypos = (long)m_y; + } + void Position(float *xpos, float *ypos) const { *xpos = (float) m_x; *ypos = (float) m_y; @@ -638,8 +652,8 @@ public: void CopyObject(wxObject& obj) const; public: - long m_x; - long m_y; + wxCoord m_x, m_y; + bool m_leftDown; bool m_middleDown; bool m_rightDown; @@ -674,28 +688,34 @@ public: long KeyCode() const { return m_keyCode; } // Find the position of the event - void GetPosition(long *xpos, long *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } + void GetPosition(wxCoord *xpos, wxCoord *ypos) const + { + if (xpos) *xpos = m_x; + if (ypos) *ypos = m_y; + } + void GetPosition(int *xpos, int *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } + { + if (xpos) *xpos = (int)m_x; + if (ypos) *ypos = (int)m_y; + } wxPoint GetPosition() const { return wxPoint(m_x, m_y); } // Get X position - long GetX() const { return m_x; } + wxCoord GetX() const { return m_x; } // Get Y position - long GetY() const { return m_y; } + wxCoord GetY() const { return m_y; } void CopyObject(wxObject& obj) const; public: - long m_x; - long m_y; + wxCoord m_x, m_y; + long m_keyCode; + bool m_controlDown; bool m_shiftDown; bool m_altDown; diff --git a/include/wx/gtk/dataobj2.h b/include/wx/gtk/dataobj2.h index fee8e27832..b118ece2f2 100644 --- a/include/wx/gtk/dataobj2.h +++ b/include/wx/gtk/dataobj2.h @@ -48,6 +48,15 @@ protected: void *m_pngData; void DoConvertToPng(); + +private: + // virtual function hiding supression + size_t GetDataSize(const wxDataFormat& format) const + { return(wxDataObjectSimple::GetDataSize(format)); } + bool GetDataHere(const wxDataFormat& format, void* pBuf) const + { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } + bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) + { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; // ---------------------------------------------------------------------------- @@ -65,6 +74,15 @@ public: virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); + +private: + // virtual function hiding supression + size_t GetDataSize(const wxDataFormat& format) const + { return(wxDataObjectSimple::GetDataSize(format)); } + bool GetDataHere(const wxDataFormat& format, void* pBuf) const + { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } + bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) + { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; #endif // _WX_GTK_DATAOBJ2_H_ diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index ac93125bd3..0a88482937 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -116,12 +116,12 @@ public: void operator ++ (); void operator ++ (int); - long GetX() const; - long GetY() const; - long GetW() const; - long GetWidth() const { return GetW(); } - long GetH() const; - long GetHeight() const { return GetH(); } + wxCoord GetX() const; + wxCoord GetY() const; + wxCoord GetW() const; + wxCoord GetWidth() const { return GetW(); } + wxCoord GetH() const; + wxCoord GetHeight() const { return GetH(); } wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); } private: diff --git a/include/wx/gtk1/dataobj2.h b/include/wx/gtk1/dataobj2.h index fee8e27832..b118ece2f2 100644 --- a/include/wx/gtk1/dataobj2.h +++ b/include/wx/gtk1/dataobj2.h @@ -48,6 +48,15 @@ protected: void *m_pngData; void DoConvertToPng(); + +private: + // virtual function hiding supression + size_t GetDataSize(const wxDataFormat& format) const + { return(wxDataObjectSimple::GetDataSize(format)); } + bool GetDataHere(const wxDataFormat& format, void* pBuf) const + { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } + bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) + { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; // ---------------------------------------------------------------------------- @@ -65,6 +74,15 @@ public: virtual size_t GetDataSize() const; virtual bool GetDataHere(void *buf) const; virtual bool SetData(size_t len, const void *buf); + +private: + // virtual function hiding supression + size_t GetDataSize(const wxDataFormat& format) const + { return(wxDataObjectSimple::GetDataSize(format)); } + bool GetDataHere(const wxDataFormat& format, void* pBuf) const + { return(wxDataObjectSimple::GetDataHere(format, pBuf)); } + bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) + { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); } }; #endif // _WX_GTK_DATAOBJ2_H_ diff --git a/include/wx/gtk1/region.h b/include/wx/gtk1/region.h index ac93125bd3..0a88482937 100644 --- a/include/wx/gtk1/region.h +++ b/include/wx/gtk1/region.h @@ -116,12 +116,12 @@ public: void operator ++ (); void operator ++ (int); - long GetX() const; - long GetY() const; - long GetW() const; - long GetWidth() const { return GetW(); } - long GetH() const; - long GetHeight() const { return GetH(); } + wxCoord GetX() const; + wxCoord GetY() const; + wxCoord GetW() const; + wxCoord GetWidth() const { return GetW(); } + wxCoord GetH() const; + wxCoord GetHeight() const { return GetH(); } wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); } private: diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h index 48f37f7e08..23247b43a1 100644 --- a/include/wx/tbarbase.h +++ b/include/wx/tbarbase.h @@ -40,9 +40,9 @@ class WXDLLEXPORT wxToolBarTool: public wxObject public: wxToolBarTool() {} #ifdef __WXGTK__ - wxToolBarTool(wxToolBar *owner, + wxToolBarTool(wxToolBar *owner, int theIndex = 0, const wxBitmap& bitmap1 = wxNullBitmap, const wxBitmap& bitmap2 = wxNullBitmap, - bool toggle = FALSE, wxObject *clientData = (wxObject *) NULL, + bool toggle = FALSE, wxObject *clientData = (wxObject *) NULL, const wxString& shortHelpString = "", const wxString& longHelpString = "", GtkWidget *pixmap = (GtkWidget *) NULL ); #else @@ -84,8 +84,8 @@ class WXDLLEXPORT wxToolBarBase : public wxControl DECLARE_ABSTRACT_CLASS(wxToolBarBase) public: - wxToolBarBase(void); - ~wxToolBarBase(void); + wxToolBarBase(); + ~wxToolBarBase(); // Handle wxToolBar events @@ -105,14 +105,14 @@ class WXDLLEXPORT wxToolBarBase : public wxControl virtual wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap, bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL, const wxString& helpString1 = wxEmptyString, const wxString& helpString2 = wxEmptyString); - virtual void AddSeparator(void); - virtual void ClearTools(void); + virtual void AddSeparator(); + virtual void ClearTools(); virtual void EnableTool(int toolIndex, bool enable); virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on virtual void SetToggle(int toolIndex, bool toggle); // Set this to be togglable (or not) virtual wxObject *GetToolClientData(int index) const; - inline wxList& GetTools(void) const { return (wxList&) m_tools; } + inline wxList& GetTools() const { return (wxList&) m_tools; } // After the toolbar has initialized, this is the size the tools take up #if WXWXIN_COMPATIBILITY @@ -135,34 +135,34 @@ class WXDLLEXPORT wxToolBarBase : public wxControl virtual void SetToolPacking(int packing); virtual void SetToolSeparation(int separation); - inline virtual wxSize GetToolMargins(void) { return wxSize(m_xMargin, m_yMargin); } - inline virtual int GetToolPacking(void) { return m_toolPacking; } - inline virtual int GetToolSeparation(void) { return m_toolSeparation; } + inline virtual wxSize GetToolMargins() { return wxSize(m_xMargin, m_yMargin); } + inline virtual int GetToolPacking() { return m_toolPacking; } + inline virtual int GetToolSeparation() { return m_toolSeparation; } virtual void SetToolBitmapSize(const wxSize& size) { m_defaultWidth = size.x; m_defaultHeight = size.y; }; - virtual wxSize GetToolBitmapSize(void) const { return wxSize(m_defaultWidth, m_defaultHeight); } + virtual wxSize GetToolBitmapSize() const { return wxSize(m_defaultWidth, m_defaultHeight); } // The button size (in some implementations) is bigger than the bitmap size: this returns // the total button size. - virtual wxSize GetToolSize(void) const { return wxSize(m_defaultWidth, m_defaultHeight); } ; + virtual wxSize GetToolSize() const { return wxSize(m_defaultWidth, m_defaultHeight); } ; // Compatibility #if WXWIN_COMPATIBILITY - inline void SetDefaultSize(int w, int h) { SetDefaultSize(wxSize(w, h)); } - inline long GetDefaultWidth(void) const { return m_defaultWidth; } - inline long GetDefaultHeight(void) const { return m_defaultHeight; } - inline int GetDefaultButtonWidth(void) const { return (int) GetDefaultButtonSize().x; }; - inline int GetDefaultButtonHeight(void) const { return (int) GetDefaultButtonSize().y; }; + void SetDefaultSize(int w, int h) { SetDefaultSize(wxSize(w, h)); } + long GetDefaultWidth() const { return m_defaultWidth; } + long GetDefaultHeight() const { return m_defaultHeight; } + int GetDefaultButtonWidth() const { return (int) GetDefaultButtonSize().x; }; + int GetDefaultButtonHeight() const { return (int) GetDefaultButtonSize().y; }; virtual void SetDefaultSize(const wxSize& size) { SetToolBitmapSize(size); } - virtual wxSize GetDefaultSize(void) const { return GetToolBitmapSize(); } - virtual wxSize GetDefaultButtonSize(void) const { return GetToolSize(); } + virtual wxSize GetDefaultSize() const { return GetToolBitmapSize(); } + virtual wxSize GetDefaultButtonSize() const { return GetToolSize(); } #endif // Lay the tools out virtual void LayoutTools(); - + // Add all the buttons: required for Win95. - virtual bool CreateTools(void) { return TRUE; } + virtual bool CreateTools() { return TRUE; } // Calls the appropriate function after tools have been created. // E.g. Layout, or CreateTools. @@ -184,7 +184,7 @@ class WXDLLEXPORT wxToolBarBase : public wxControl virtual void Scroll(int x_pos, int y_pos); virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const; virtual void EnableScrolling(bool x_scrolling, bool y_scrolling); - virtual void AdjustScrollbars(void); + virtual void AdjustScrollbars(); // Prepare the DC by translating it according to the current scroll position virtual void PrepareDC(wxDC& dc); @@ -199,7 +199,7 @@ class WXDLLEXPORT wxToolBarBase : public wxControl virtual void GetVirtualSize(int *x, int *y) const; // Do the toolbar button updates (check for EVT_UPDATE_UI handlers) - virtual void DoToolbarUpdates(void); + virtual void DoToolbarUpdates(); inline void SetMaxRowsCols(int rows, int cols) { m_maxRows = rows; m_maxCols = cols; } inline int GetMaxRows() const { return m_maxRows; } @@ -222,13 +222,14 @@ class WXDLLEXPORT wxToolBarBase : public wxControl int m_yMargin; int m_toolPacking; int m_toolSeparation; - long m_defaultWidth; - long m_defaultHeight; + + wxCoord m_defaultWidth; + wxCoord m_defaultHeight; public: //////////////////////////////////////////////////////////////////////// //// IMPLEMENTATION - + // Calculate scroll increment virtual int CalcScrollInc(wxScrollEvent& event); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 1800ae2685..229cfd3e13 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -348,7 +348,8 @@ void wxClipboard::Clear() { m_waiting = TRUE; - gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME ); + gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); } @@ -357,7 +358,8 @@ void wxClipboard::Clear() { m_waiting = TRUE; - gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME ); + gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); } @@ -443,7 +445,7 @@ bool wxClipboard::AddData( wxDataObject *data ) /* Tell the world we offer clipboard data */ bool res = (gtk_selection_owner_set( m_clipboardWidget, clipboard, - GDK_CURRENT_TIME )); + (guint32) GDK_CURRENT_TIME )); if (m_usePrimary) m_ownsPrimarySelection = res; @@ -496,7 +498,7 @@ bool wxClipboard::IsSupported( const wxDataFormat& format ) m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY : g_clipboardAtom, g_targetsAtom, - GDK_CURRENT_TIME ); + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); @@ -542,7 +544,7 @@ bool wxClipboard::GetData( wxDataObject& data ) m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY : g_clipboardAtom, g_targetsAtom, - GDK_CURRENT_TIME ); + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); @@ -576,7 +578,7 @@ bool wxClipboard::GetData( wxDataObject& data ) m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY : g_clipboardAtom, m_targetRequested, - GDK_CURRENT_TIME ); + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index a0a91e6a58..3210098c67 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -619,13 +619,13 @@ void wxComboBox::OnSize( wxSizeEvent &event ) { event.Skip(); - return; - +#if 0 int w = 21; gtk_widget_set_usize( GTK_COMBO(m_widget)->entry, m_width-w-1, m_height ); gtk_widget_set_uposition( GTK_COMBO(m_widget)->button, m_x+m_width-w, m_y ); gtk_widget_set_usize( GTK_COMBO(m_widget)->button, w, m_height ); +#endif // 0 } void wxComboBox::ApplyWidgetStyle() diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index fec847be17..b0f7ef082f 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -503,7 +503,7 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget ) static void source_drag_data_get (GtkWidget *WXUNUSED(widget), - GdkDragContext *context, + GdkDragContext *WXUNUSED(context), GtkSelectionData *selection_data, guint WXUNUSED(info), guint WXUNUSED(time), @@ -748,7 +748,7 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove ) event.x = x; event.y = y; event.state = state; - event.time = GDK_CURRENT_TIME; + event.time = (guint32)GDK_CURRENT_TIME; /* GTK wants to know which button was pressed which caused the dragging */ int button_number = 0; diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 97c51a8968..64ff18c4e8 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -187,7 +187,7 @@ wxFont::wxFont( GdkFont *WXUNUSED(font), char *xFontName ) tn.GetNextToken(); // pixel size tmp = tn.GetNextToken(); // pointsize - int num = wxStrtol (tmp.c_str(), (wxChar **) NULL, 10); + long num = wxStrtol (tmp.c_str(), (wxChar **) NULL, 10); M_FONTDATA->m_pointSize = num / 10; tn.GetNextToken(); // x-res @@ -394,7 +394,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const } long int_scale = long(scale * 100.0 + 0.5); /* key for fontlist */ - int point_scale = (M_FONTDATA->m_pointSize * 10 * int_scale) / 100; + int point_scale = (int)((M_FONTDATA->m_pointSize * 10 * int_scale) / 100); GdkFont *font = (GdkFont *) NULL; wxNode *node = M_FONTDATA->m_scaled_xfonts.Find(int_scale); diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp index 3d75387d4d..58e83b7df7 100644 --- a/src/gtk/spinbutt.cpp +++ b/src/gtk/spinbutt.cpp @@ -116,7 +116,8 @@ bool wxSpinButton::Create(wxWindow *parent, m_widget = gtk_spin_button_new( m_adjust, 0, 0 ); - gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (m_windowStyle & wxSP_WRAP) ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), + (int)(m_windowStyle & wxSP_WRAP) ); gtk_signal_connect( GTK_OBJECT (m_adjust), "value_changed", diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index 7f04c11479..cf1e437da6 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -116,7 +116,8 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, m_widget = gtk_spin_button_new( m_adjust, 1, 0 ); - gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (m_windowStyle & wxSP_WRAP) ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), + (int)(m_windowStyle & wxSP_WRAP) ); gtk_signal_connect( GTK_OBJECT (m_adjust), "value_changed", diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 1039af2f37..d7a5312e13 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -567,7 +567,7 @@ void wxTextCtrl::SetInsertionPoint( long pos ) /* bring editable's cursor uptodate. bug in GTK. */ - GTK_EDITABLE(m_text)->current_pos = pos; + GTK_EDITABLE(m_text)->current_pos = (guint32)pos; } } diff --git a/src/gtk/tooltip.cpp b/src/gtk/tooltip.cpp index 403880e328..a80317beeb 100644 --- a/src/gtk/tooltip.cpp +++ b/src/gtk/tooltip.cpp @@ -99,9 +99,10 @@ void wxToolTip::Enable( bool flag ) void wxToolTip::SetDelay( long msecs ) { - if (!ss_tooltips) return; + if (!ss_tooltips) + return; - gtk_tooltips_set_delay( ss_tooltips, msecs ); + gtk_tooltips_set_delay( ss_tooltips, (int)msecs ); } #endif diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index f384e1d994..139fe3e85b 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -333,7 +333,7 @@ static void draw_frame( GtkWidget *widget, wxWindow *win ) if (win->HasFlag(wxSIMPLE_BORDER)) { GdkGC *gc; - gc = gdk_gc_new( widget->window ); + gc = gdk_gc_new( widget->window ); gdk_gc_set_foreground( gc, &widget->style->black ); gdk_draw_rectangle( widget->window, gc, FALSE, dx, dy, @@ -465,9 +465,9 @@ static long map_to_unmodified_wx_keysym( KeySym keysym ) { if (keysym <= 0xFF) { - guint upper = gdk_keyval_to_upper( keysym ); + guint upper = gdk_keyval_to_upper( (guint)keysym ); keysym = (upper != 0 ? upper : keysym ); /* to be MSW compatible */ - key_code = keysym; + key_code = (guint)keysym; } } } @@ -564,7 +564,7 @@ static long map_to_wx_keysym( KeySym keysym ) { if (keysym <= 0xFF) { - key_code = keysym; + key_code = (guint)keysym; } } } @@ -614,7 +614,8 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp // "draw" of m_wxwindow //----------------------------------------------------------------------------- -static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win ) +static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), + GdkRectangle *rect, wxWindow *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -634,7 +635,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW (int)rect->width, (int)rect->height ); */ - + wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); win->GetEventHandler()->ProcessEvent(eevent); @@ -707,8 +708,8 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e ret = ancestor->GetEventHandler()->ProcessEvent( command_event ); break; } - if (ancestor->m_isFrame) - break; + if (ancestor->m_isFrame) + break; ancestor = ancestor->GetParent(); } } @@ -740,11 +741,11 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e if ( (!ret) && ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab)) && (!win->HasFlag(wxTE_PROCESS_TAB)) && - (win->GetParent()) && - (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) + (win->GetParent()) && + (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) { wxNavigationKeyEvent new_event; - new_event.SetEventObject( win ); + new_event.SetEventObject( win ); /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */ new_event.SetDirection( (gdk_event->keyval == GDK_Tab) ); /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ @@ -967,23 +968,23 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton if (!g_captureWindow) { - int x = event.m_x; - int y = event.m_y; + wxCoord x = event.m_x; + wxCoord y = event.m_y; if (win->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(win->m_wxwindow); - x += pizza->xoffset; - y += pizza->yoffset; + x += pizza->xoffset; + y += pizza->yoffset; } wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); - + node = node->Next(); - if (!child->IsShown()) - continue; + if (!child->IsShown()) + continue; if (child->m_isStaticBox) { @@ -1094,13 +1095,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto if (!g_captureWindow) { - int x = event.m_x; - int y = event.m_y; + wxCoord x = event.m_x; + wxCoord y = event.m_y; if (win->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(win->m_wxwindow); - x += pizza->xoffset; - y += pizza->yoffset; + x += pizza->xoffset; + y += pizza->yoffset; } wxNode *node = win->GetChildren().First(); @@ -1109,8 +1110,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto wxWindow *child = (wxWindow*)node->Data(); node = node->Next(); - if (!child->IsShown()) - continue; + if (!child->IsShown()) + continue; if (child->m_isStaticBox) { @@ -1214,13 +1215,13 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion if (!g_captureWindow) { - int x = event.m_x; - int y = event.m_y; + wxCoord x = event.m_x; + wxCoord y = event.m_y; if (win->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(win->m_wxwindow); - x += pizza->xoffset; - y += pizza->yoffset; + x += pizza->xoffset; + y += pizza->yoffset; } wxNode *node = win->GetChildren().First(); @@ -1229,8 +1230,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion wxWindow *child = (wxWindow*)node->Data(); node = node->Next(); - if (!child->IsShown()) - continue; + if (!child->IsShown()) + continue; if (child->m_isStaticBox) { @@ -1742,7 +1743,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { wxFAIL_MSG( wxT("wxWindow creation failed") ); - return FALSE; + return FALSE; } m_insertCallback = wxInsertChildInWindow; @@ -1951,15 +1952,15 @@ void wxWindow::PostCreation() if (m_wxwindow) { if (!m_noExpose) - { + { /* these get reported to wxWindows -> wxPaintEvent */ gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event", GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this ); gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw", GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this ); - } - + } + #if (GTK_MINOR_VERSION > 0) /* these are called when the "sunken" or "raised" borders are drawn */ gtk_signal_connect( GTK_OBJECT(m_widget), "expose_event", @@ -2040,7 +2041,7 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) else { GtkPizza *pizza = GTK_PIZZA(m_parent->m_wxwindow); - + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x + pizza->xoffset; @@ -2114,10 +2115,10 @@ void wxWindow::OnInternalIdle() if (cursor.Ok()) { /* I now set the cursor anew in every OnInternalIdle call - as setting the cursor in a parent window also effects the - windows above so that checking for the current cursor is - not possible. */ - + as setting the cursor in a parent window also effects the + windows above so that checking for the current cursor is + not possible. */ + if (m_wxwindow) { GdkWindow *window = GTK_PIZZA(m_wxwindow)->bin_window; @@ -2311,8 +2312,8 @@ void wxWindow::DoGetPosition( int *x, int *y ) const if (m_parent && m_parent->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(m_parent->m_wxwindow); - dx = pizza->xoffset; - dy = pizza->yoffset; + dx = pizza->xoffset; + dy = pizza->yoffset; } if (x) (*x) = m_x - dx; @@ -2476,7 +2477,7 @@ void wxWindow::SetFocus() } else { - // ? + // ? } } } @@ -2574,7 +2575,7 @@ void wxWindow::WarpPointer( int x, int y ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (window) gdk_window_warp_pointer( window, x, y ); } @@ -2605,15 +2606,15 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) if (!rect) { if (m_wxwindow) - { - GtkPizza *pizza = GTK_PIZZA(m_wxwindow); - gboolean old_clear = pizza->clear_on_draw; - gtk_pizza_set_clear( pizza, FALSE ); - + { + GtkPizza *pizza = GTK_PIZZA(m_wxwindow); + gboolean old_clear = pizza->clear_on_draw; + gtk_pizza_set_clear( pizza, FALSE ); + gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL ); - - gtk_pizza_set_clear( pizza, old_clear ); - } + + gtk_pizza_set_clear( pizza, old_clear ); + } else gtk_widget_draw( m_widget, (GdkRectangle*) NULL ); } @@ -2626,15 +2627,15 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) gdk_rect.height = rect->height; if (m_wxwindow) - { - GtkPizza *pizza = GTK_PIZZA(m_wxwindow); - gboolean old_clear = pizza->clear_on_draw; - gtk_pizza_set_clear( pizza, FALSE ); - + { + GtkPizza *pizza = GTK_PIZZA(m_wxwindow); + gboolean old_clear = pizza->clear_on_draw; + gtk_pizza_set_clear( pizza, FALSE ); + gtk_widget_draw( m_wxwindow, &gdk_rect ); - - gtk_pizza_set_clear( pizza, old_clear ); - } + + gtk_pizza_set_clear( pizza, old_clear ); + } else gtk_widget_draw( m_widget, &gdk_rect ); } @@ -2683,7 +2684,7 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) { // indicate that a new style has been set @@ -2735,7 +2736,7 @@ bool wxWindow::SetForegroundColour( const wxColour &colour ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) { // indicate that a new style has been set @@ -2868,7 +2869,7 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y ) 0, // button used to activate it gs_timeLastClick // the time of activation ); - + while (is_waiting) { while (gtk_events_pending()) @@ -2928,7 +2929,7 @@ bool wxWindow::SetFont( const wxFont &font ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) { // indicate that a new style has been set @@ -2966,7 +2967,7 @@ void wxWindow::CaptureMouse() window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) return; gdk_pointer_grab( window, FALSE, @@ -2977,7 +2978,7 @@ void wxWindow::CaptureMouse() GDK_POINTER_MOTION_MASK), (GdkWindow *) NULL, m_cursor.GetCursor(), - GDK_CURRENT_TIME ); + (guint32)GDK_CURRENT_TIME ); g_captureWindow = this; } @@ -2992,10 +2993,11 @@ void wxWindow::ReleaseMouse() window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - - if (!window) return; + + if (!window) + return; - gdk_pointer_ungrab ( GDK_CURRENT_TIME ); + gdk_pointer_ungrab ( (guint32)GDK_CURRENT_TIME ); g_captureWindow = (wxWindow*) NULL; } diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 1800ae2685..229cfd3e13 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -348,7 +348,8 @@ void wxClipboard::Clear() { m_waiting = TRUE; - gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME ); + gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); } @@ -357,7 +358,8 @@ void wxClipboard::Clear() { m_waiting = TRUE; - gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME ); + gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); } @@ -443,7 +445,7 @@ bool wxClipboard::AddData( wxDataObject *data ) /* Tell the world we offer clipboard data */ bool res = (gtk_selection_owner_set( m_clipboardWidget, clipboard, - GDK_CURRENT_TIME )); + (guint32) GDK_CURRENT_TIME )); if (m_usePrimary) m_ownsPrimarySelection = res; @@ -496,7 +498,7 @@ bool wxClipboard::IsSupported( const wxDataFormat& format ) m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY : g_clipboardAtom, g_targetsAtom, - GDK_CURRENT_TIME ); + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); @@ -542,7 +544,7 @@ bool wxClipboard::GetData( wxDataObject& data ) m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY : g_clipboardAtom, g_targetsAtom, - GDK_CURRENT_TIME ); + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); @@ -576,7 +578,7 @@ bool wxClipboard::GetData( wxDataObject& data ) m_usePrimary ? (GdkAtom)GDK_SELECTION_PRIMARY : g_clipboardAtom, m_targetRequested, - GDK_CURRENT_TIME ); + (guint32) GDK_CURRENT_TIME ); while (m_waiting) gtk_main_iteration(); diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index a0a91e6a58..3210098c67 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -619,13 +619,13 @@ void wxComboBox::OnSize( wxSizeEvent &event ) { event.Skip(); - return; - +#if 0 int w = 21; gtk_widget_set_usize( GTK_COMBO(m_widget)->entry, m_width-w-1, m_height ); gtk_widget_set_uposition( GTK_COMBO(m_widget)->button, m_x+m_width-w, m_y ); gtk_widget_set_usize( GTK_COMBO(m_widget)->button, w, m_height ); +#endif // 0 } void wxComboBox::ApplyWidgetStyle() diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index fec847be17..b0f7ef082f 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -503,7 +503,7 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget ) static void source_drag_data_get (GtkWidget *WXUNUSED(widget), - GdkDragContext *context, + GdkDragContext *WXUNUSED(context), GtkSelectionData *selection_data, guint WXUNUSED(info), guint WXUNUSED(time), @@ -748,7 +748,7 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove ) event.x = x; event.y = y; event.state = state; - event.time = GDK_CURRENT_TIME; + event.time = (guint32)GDK_CURRENT_TIME; /* GTK wants to know which button was pressed which caused the dragging */ int button_number = 0; diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 97c51a8968..64ff18c4e8 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -187,7 +187,7 @@ wxFont::wxFont( GdkFont *WXUNUSED(font), char *xFontName ) tn.GetNextToken(); // pixel size tmp = tn.GetNextToken(); // pointsize - int num = wxStrtol (tmp.c_str(), (wxChar **) NULL, 10); + long num = wxStrtol (tmp.c_str(), (wxChar **) NULL, 10); M_FONTDATA->m_pointSize = num / 10; tn.GetNextToken(); // x-res @@ -394,7 +394,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const } long int_scale = long(scale * 100.0 + 0.5); /* key for fontlist */ - int point_scale = (M_FONTDATA->m_pointSize * 10 * int_scale) / 100; + int point_scale = (int)((M_FONTDATA->m_pointSize * 10 * int_scale) / 100); GdkFont *font = (GdkFont *) NULL; wxNode *node = M_FONTDATA->m_scaled_xfonts.Find(int_scale); diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp index 3d75387d4d..58e83b7df7 100644 --- a/src/gtk1/spinbutt.cpp +++ b/src/gtk1/spinbutt.cpp @@ -116,7 +116,8 @@ bool wxSpinButton::Create(wxWindow *parent, m_widget = gtk_spin_button_new( m_adjust, 0, 0 ); - gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (m_windowStyle & wxSP_WRAP) ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), + (int)(m_windowStyle & wxSP_WRAP) ); gtk_signal_connect( GTK_OBJECT (m_adjust), "value_changed", diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index 7f04c11479..cf1e437da6 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -116,7 +116,8 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, m_widget = gtk_spin_button_new( m_adjust, 1, 0 ); - gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (m_windowStyle & wxSP_WRAP) ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), + (int)(m_windowStyle & wxSP_WRAP) ); gtk_signal_connect( GTK_OBJECT (m_adjust), "value_changed", diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 1039af2f37..d7a5312e13 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -567,7 +567,7 @@ void wxTextCtrl::SetInsertionPoint( long pos ) /* bring editable's cursor uptodate. bug in GTK. */ - GTK_EDITABLE(m_text)->current_pos = pos; + GTK_EDITABLE(m_text)->current_pos = (guint32)pos; } } diff --git a/src/gtk1/tooltip.cpp b/src/gtk1/tooltip.cpp index 403880e328..a80317beeb 100644 --- a/src/gtk1/tooltip.cpp +++ b/src/gtk1/tooltip.cpp @@ -99,9 +99,10 @@ void wxToolTip::Enable( bool flag ) void wxToolTip::SetDelay( long msecs ) { - if (!ss_tooltips) return; + if (!ss_tooltips) + return; - gtk_tooltips_set_delay( ss_tooltips, msecs ); + gtk_tooltips_set_delay( ss_tooltips, (int)msecs ); } #endif diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index f384e1d994..139fe3e85b 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -333,7 +333,7 @@ static void draw_frame( GtkWidget *widget, wxWindow *win ) if (win->HasFlag(wxSIMPLE_BORDER)) { GdkGC *gc; - gc = gdk_gc_new( widget->window ); + gc = gdk_gc_new( widget->window ); gdk_gc_set_foreground( gc, &widget->style->black ); gdk_draw_rectangle( widget->window, gc, FALSE, dx, dy, @@ -465,9 +465,9 @@ static long map_to_unmodified_wx_keysym( KeySym keysym ) { if (keysym <= 0xFF) { - guint upper = gdk_keyval_to_upper( keysym ); + guint upper = gdk_keyval_to_upper( (guint)keysym ); keysym = (upper != 0 ? upper : keysym ); /* to be MSW compatible */ - key_code = keysym; + key_code = (guint)keysym; } } } @@ -564,7 +564,7 @@ static long map_to_wx_keysym( KeySym keysym ) { if (keysym <= 0xFF) { - key_code = keysym; + key_code = (guint)keysym; } } } @@ -614,7 +614,8 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp // "draw" of m_wxwindow //----------------------------------------------------------------------------- -static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxWindow *win ) +static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), + GdkRectangle *rect, wxWindow *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -634,7 +635,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, GdkRectangle *rect, wxW (int)rect->width, (int)rect->height ); */ - + wxEraseEvent eevent( win->GetId() ); eevent.SetEventObject( win ); win->GetEventHandler()->ProcessEvent(eevent); @@ -707,8 +708,8 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e ret = ancestor->GetEventHandler()->ProcessEvent( command_event ); break; } - if (ancestor->m_isFrame) - break; + if (ancestor->m_isFrame) + break; ancestor = ancestor->GetParent(); } } @@ -740,11 +741,11 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e if ( (!ret) && ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab)) && (!win->HasFlag(wxTE_PROCESS_TAB)) && - (win->GetParent()) && - (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) + (win->GetParent()) && + (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) ) { wxNavigationKeyEvent new_event; - new_event.SetEventObject( win ); + new_event.SetEventObject( win ); /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */ new_event.SetDirection( (gdk_event->keyval == GDK_Tab) ); /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ @@ -967,23 +968,23 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton if (!g_captureWindow) { - int x = event.m_x; - int y = event.m_y; + wxCoord x = event.m_x; + wxCoord y = event.m_y; if (win->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(win->m_wxwindow); - x += pizza->xoffset; - y += pizza->yoffset; + x += pizza->xoffset; + y += pizza->yoffset; } wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); - + node = node->Next(); - if (!child->IsShown()) - continue; + if (!child->IsShown()) + continue; if (child->m_isStaticBox) { @@ -1094,13 +1095,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto if (!g_captureWindow) { - int x = event.m_x; - int y = event.m_y; + wxCoord x = event.m_x; + wxCoord y = event.m_y; if (win->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(win->m_wxwindow); - x += pizza->xoffset; - y += pizza->yoffset; + x += pizza->xoffset; + y += pizza->yoffset; } wxNode *node = win->GetChildren().First(); @@ -1109,8 +1110,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto wxWindow *child = (wxWindow*)node->Data(); node = node->Next(); - if (!child->IsShown()) - continue; + if (!child->IsShown()) + continue; if (child->m_isStaticBox) { @@ -1214,13 +1215,13 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion if (!g_captureWindow) { - int x = event.m_x; - int y = event.m_y; + wxCoord x = event.m_x; + wxCoord y = event.m_y; if (win->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(win->m_wxwindow); - x += pizza->xoffset; - y += pizza->yoffset; + x += pizza->xoffset; + y += pizza->yoffset; } wxNode *node = win->GetChildren().First(); @@ -1229,8 +1230,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion wxWindow *child = (wxWindow*)node->Data(); node = node->Next(); - if (!child->IsShown()) - continue; + if (!child->IsShown()) + continue; if (child->m_isStaticBox) { @@ -1742,7 +1743,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { wxFAIL_MSG( wxT("wxWindow creation failed") ); - return FALSE; + return FALSE; } m_insertCallback = wxInsertChildInWindow; @@ -1951,15 +1952,15 @@ void wxWindow::PostCreation() if (m_wxwindow) { if (!m_noExpose) - { + { /* these get reported to wxWindows -> wxPaintEvent */ gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event", GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this ); gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw", GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this ); - } - + } + #if (GTK_MINOR_VERSION > 0) /* these are called when the "sunken" or "raised" borders are drawn */ gtk_signal_connect( GTK_OBJECT(m_widget), "expose_event", @@ -2040,7 +2041,7 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) else { GtkPizza *pizza = GTK_PIZZA(m_parent->m_wxwindow); - + if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0) { if (x != -1) m_x = x + pizza->xoffset; @@ -2114,10 +2115,10 @@ void wxWindow::OnInternalIdle() if (cursor.Ok()) { /* I now set the cursor anew in every OnInternalIdle call - as setting the cursor in a parent window also effects the - windows above so that checking for the current cursor is - not possible. */ - + as setting the cursor in a parent window also effects the + windows above so that checking for the current cursor is + not possible. */ + if (m_wxwindow) { GdkWindow *window = GTK_PIZZA(m_wxwindow)->bin_window; @@ -2311,8 +2312,8 @@ void wxWindow::DoGetPosition( int *x, int *y ) const if (m_parent && m_parent->m_wxwindow) { GtkPizza *pizza = GTK_PIZZA(m_parent->m_wxwindow); - dx = pizza->xoffset; - dy = pizza->yoffset; + dx = pizza->xoffset; + dy = pizza->yoffset; } if (x) (*x) = m_x - dx; @@ -2476,7 +2477,7 @@ void wxWindow::SetFocus() } else { - // ? + // ? } } } @@ -2574,7 +2575,7 @@ void wxWindow::WarpPointer( int x, int y ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (window) gdk_window_warp_pointer( window, x, y ); } @@ -2605,15 +2606,15 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) if (!rect) { if (m_wxwindow) - { - GtkPizza *pizza = GTK_PIZZA(m_wxwindow); - gboolean old_clear = pizza->clear_on_draw; - gtk_pizza_set_clear( pizza, FALSE ); - + { + GtkPizza *pizza = GTK_PIZZA(m_wxwindow); + gboolean old_clear = pizza->clear_on_draw; + gtk_pizza_set_clear( pizza, FALSE ); + gtk_widget_draw( m_wxwindow, (GdkRectangle*) NULL ); - - gtk_pizza_set_clear( pizza, old_clear ); - } + + gtk_pizza_set_clear( pizza, old_clear ); + } else gtk_widget_draw( m_widget, (GdkRectangle*) NULL ); } @@ -2626,15 +2627,15 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) gdk_rect.height = rect->height; if (m_wxwindow) - { - GtkPizza *pizza = GTK_PIZZA(m_wxwindow); - gboolean old_clear = pizza->clear_on_draw; - gtk_pizza_set_clear( pizza, FALSE ); - + { + GtkPizza *pizza = GTK_PIZZA(m_wxwindow); + gboolean old_clear = pizza->clear_on_draw; + gtk_pizza_set_clear( pizza, FALSE ); + gtk_widget_draw( m_wxwindow, &gdk_rect ); - - gtk_pizza_set_clear( pizza, old_clear ); - } + + gtk_pizza_set_clear( pizza, old_clear ); + } else gtk_widget_draw( m_widget, &gdk_rect ); } @@ -2683,7 +2684,7 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) { // indicate that a new style has been set @@ -2735,7 +2736,7 @@ bool wxWindow::SetForegroundColour( const wxColour &colour ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) { // indicate that a new style has been set @@ -2868,7 +2869,7 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y ) 0, // button used to activate it gs_timeLastClick // the time of activation ); - + while (is_waiting) { while (gtk_events_pending()) @@ -2928,7 +2929,7 @@ bool wxWindow::SetFont( const wxFont &font ) window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) { // indicate that a new style has been set @@ -2966,7 +2967,7 @@ void wxWindow::CaptureMouse() window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - + if (!window) return; gdk_pointer_grab( window, FALSE, @@ -2977,7 +2978,7 @@ void wxWindow::CaptureMouse() GDK_POINTER_MOTION_MASK), (GdkWindow *) NULL, m_cursor.GetCursor(), - GDK_CURRENT_TIME ); + (guint32)GDK_CURRENT_TIME ); g_captureWindow = this; } @@ -2992,10 +2993,11 @@ void wxWindow::ReleaseMouse() window = GTK_PIZZA(m_wxwindow)->bin_window; else window = GetConnectWidget()->window; - - if (!window) return; + + if (!window) + return; - gdk_pointer_ungrab ( GDK_CURRENT_TIME ); + gdk_pointer_ungrab ( (guint32)GDK_CURRENT_TIME ); g_captureWindow = (wxWindow*) NULL; } diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index d81c674276..bb2dbed789 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -62,7 +62,7 @@ static char **CreateFontList(wxChar spacing, int *nFonts) { wxString xencoding, xregistry; - wxGetXFontEncoding(encoding, &xencoding, &xregistry); + wxGetXFontEncoding(encoding, &xregistry, &xencoding); wxString pattern; pattern.Printf(wxT("-*-*-*-*-*-*-*-*-*-*-%c-*-%s-%s"), -- 2.45.2