wxWidgets3: update to svn r70933

This commit is contained in:
Shawn Hoffman
2012-03-17 18:12:27 -07:00
parent 0ed8af2287
commit a648aca65c
906 changed files with 39468 additions and 17244 deletions

View File

@ -4,7 +4,7 @@
// Author: Julian Smart and Guillermo Rodriguez Garcia
// Modified by: Francesco Montorsi
// Created: 13/8/99
// RCS-ID: $Id: animate.h 53629 2008-05-17 22:51:52Z VZ $
// RCS-ID: $Id: animate.h 70520 2012-02-05 22:53:39Z SN $
// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/anybutton.h
// Purpose: wxGTK wxAnyButton class declaration
// Author: Robert Roebling
// Created: 1998-05-20 (extracted from button.h)
// Id: $Id: anybutton.h 67931 2011-06-14 13:00:42Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_ANYBUTTON_H_
#define _WX_GTK_ANYBUTTON_H_
//-----------------------------------------------------------------------------
// wxAnyButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton()
{
m_isCurrent =
m_isPressed = false;
}
virtual bool Enable( bool enable = true );
// implementation
// --------------
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// called from GTK callbacks: they update the button state and call
// GTKUpdateBitmap()
void GTKMouseEnters();
void GTKMouseLeaves();
void GTKPressed();
void GTKReleased();
protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual void DoSetBitmapPosition(wxDirection dir);
private:
typedef wxAnyButtonBase base_type;
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
// update the bitmap to correspond to the current button state
void GTKUpdateBitmap();
// return the current button state from m_isXXX flags (which means that it
// might not correspond to the real current state as e.g. m_isCurrent will
// never be true if we don't have a valid current bitmap)
State GTKGetCurrentState() const;
// show the given bitmap (must be valid)
void GTKDoShowBitmap(const wxBitmap& bitmap);
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
wxBitmap m_bitmaps[State_Max];
// true iff mouse is currently over the button
bool m_isCurrent;
// true iff the button is in pressed state
bool m_isPressed;
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
};
#endif // _WX_GTK_ANYBUTTON_H_

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/app.h
// Purpose: wxApp definition for wxGTK
// Author: Robert Roebling
// Id: $Id: app.h 63091 2010-01-07 18:30:18Z PC $
// Id: $Id: app.h 69020 2011-09-07 16:56:50Z PC $
// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -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;

View File

@ -2,19 +2,13 @@
// Name: wx/gtk/assertdlg_gtk.h
// Purpose: GtkAssertDialog
// Author: Francesco Montorsi
// Id: $Id: assertdlg_gtk.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: assertdlg_gtk.h 67338 2011-03-30 05:35:24Z PC $
// Copyright: (c) 2006 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////// */
#ifndef __GTK_ASSERTDLG_H__
#define __GTK_ASSERTDLG_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <gtk/gtk.h>
#ifndef _WX_GTK_ASSERTDLG_H_
#define _WX_GTK_ASSERTDLG_H_
#define GTK_TYPE_ASSERT_DIALOG (gtk_assert_dialog_get_type ())
#define GTK_ASSERT_DIALOG(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ASSERT_DIALOG, GtkAssertDialog))
@ -82,10 +76,4 @@ void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
const gchar *sourcefile,
guint line_number);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_ASSERTDLG_H__ */
#endif /* _WX_GTK_ASSERTDLG_H_ */

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/bitmap.h
// Purpose:
// Author: Robert Roebling
// RCS-ID: $Id: bitmap.h 63774 2010-03-28 23:20:49Z VZ $
// RCS-ID: $Id: bitmap.h 70165 2011-12-29 14:42:13Z SN $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -30,8 +30,8 @@ public:
virtual ~wxMask();
// implementation
GdkBitmap *m_bitmap;
GdkBitmap *GetBitmap() const;
GdkPixmap* m_bitmap;
GdkPixmap* GetBitmap() const;
protected:
virtual void FreeData();
@ -94,7 +94,7 @@ public:
#if wxUSE_PALETTE
wxPalette *GetPalette() const;
void SetPalette(const wxPalette& palette);
wxPalette *GetColourMap() const { return GetPalette(); };
wxPalette *GetColourMap() const { return GetPalette(); }
#endif // wxUSE_PALETTE
static void InitStandardHandlers();

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/button.h
// Purpose: wxGTK wxButton class declaration
// Author: Robert Roebling
// Id: $Id: button.h 67066 2011-02-27 12:48:30Z VZ $
// Id: $Id: button.h 67931 2011-06-14 13:00:42Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -17,7 +17,7 @@
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
{
public:
wxButton() { Init(); }
wxButton() {}
wxButton(wxWindow *parent, wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
@ -25,8 +25,6 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
{
Init();
Create(parent, id, label, pos, size, style, validator, name);
}
@ -39,7 +37,6 @@ public:
virtual wxWindow *SetDefault();
virtual void SetLabel( const wxString &label );
virtual bool Enable( bool enable = true );
// implementation
// --------------
@ -61,12 +58,6 @@ protected:
virtual wxSize DoGetBestSize() const;
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
virtual wxBitmap DoGetBitmap(State which) const;
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual void DoSetBitmapPosition(wxDirection dir);
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
@ -74,42 +65,9 @@ protected:
private:
typedef wxButtonBase base_type;
// common part of all ctors
void Init()
{
m_isCurrent =
m_isPressed = false;
}
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
// update the bitmap to correspond to the current button state
void GTKUpdateBitmap();
// return the current button state from m_isXXX flags (which means that it
// might not correspond to the real current state as e.g. m_isCurrent will
// never be true if we don't have a valid current bitmap)
State GTKGetCurrentState() const;
// show the given bitmap (must be valid)
void GTKDoShowBitmap(const wxBitmap& bitmap);
// Return the GtkLabel used by this button.
GtkLabel *GTKGetLabel() const;
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
wxBitmap m_bitmaps[State_Max];
// true iff mouse is currently over the button
bool m_isCurrent;
// true iff the button is in pressed state
bool m_isPressed;
DECLARE_DYNAMIC_CLASS(wxButton)
};

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/calctrl.h
// Purpose: wxGtkCalendarCtrl control
// Author: Marcin Wojdyr
// RCS-ID: $Id: calctrl.h 58757 2009-02-08 11:45:59Z VZ $
// RCS-ID: $Id: calctrl.h 67987 2011-06-19 22:46:36Z VZ $
// Copyright: (C) 2008 Marcin Wojdyr
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -38,15 +38,31 @@ public:
virtual bool SetDate(const wxDateTime& date);
virtual wxDateTime GetDate() const;
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
const wxDateTime& upperdate = wxDefaultDateTime);
virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const;
virtual bool EnableMonthChange(bool enable = true);
virtual void Mark(size_t day, bool mark);
// implementation
// --------------
wxDateTime m_selectedDate;
void GTKGenerateEvent(wxEventType type);
private:
bool IsInValidRange(const wxDateTime& dt) const;
// Range of the dates that can be selected by user, either or both may be
// invalid to indicate that no corresponding restriction is set.
wxDateTime m_validStart,
m_validEnd;
// Last known selected date, may be different from the real selection in
// the control while a handler for day-selected is running.
wxDateTime m_selectedDate;
DECLARE_DYNAMIC_CLASS(wxGtkCalendarCtrl)
wxDECLARE_NO_COPY_CLASS(wxGtkCalendarCtrl);
};

View File

@ -3,7 +3,7 @@
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id: $Id: combobox.h 65324 2010-08-16 17:48:28Z RR $
// Id: $Id: combobox.h 70880 2012-03-11 23:55:19Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -88,6 +88,9 @@ public:
{
return wxItemContainer::GetStringSelection();
}
virtual void SetString(unsigned int n, const wxString& string);
virtual void Popup();
virtual void Dismiss();
@ -97,7 +100,9 @@ public:
wxItemContainer::Clear();
}
bool IsEmpty() const { return wxItemContainer::IsEmpty(); }
// See wxComboBoxBase discussion of IsEmpty().
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
void OnChar( wxKeyEvent &event );

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/control.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: control.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: control.h 70714 2012-02-27 17:49:33Z PC $
// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -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*);
}
@ -75,20 +75,20 @@ protected:
static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
bool useBase = false,
int state = -1);
int state = 0);
static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(wxGtkWidgetNew_t,
bool useBase = false,
int state = -1);
int state = 0);
static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromStr_t,
bool useBase = false,
int state = -1);
int state = 0);
static wxVisualAttributes
GetDefaultAttributesFromGTKWidget(wxGtkWidgetNewFromAdj_t,
bool useBase = false,
int state = -1);
int state = 0);
// Widgets that use the style->base colour for the BG colour should
// override this and return true.

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/dataview.h
// Purpose: wxDataViewCtrl GTK+2 implementation header
// Author: Robert Roebling
// Id: $Id: dataview.h 65562 2010-09-17 19:07:02Z RR $
// Id: $Id: dataview.h 70377 2012-01-17 14:05:17Z VS $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -44,9 +44,8 @@ public:
virtual void SetSortable( bool sortable );
virtual void SetSortOrder( bool ascending );
virtual void SetAsSortKey(bool sort = true);
virtual void SetResizeable( bool resizeable );
virtual void SetResizeable( bool resizable );
virtual void SetHidden( bool hidden );
virtual void SetMinWidth( int minWidth );
@ -76,8 +75,7 @@ public:
virtual int GetFlags() const { return GetFromIndividualFlags(); }
// implementation
GtkWidget* GetGtkHandle() { return m_column; }
GtkWidget* GetConstGtkHandle() const { return m_column; }
GtkWidget* GetGtkHandle() const { return m_column; }
private:
// holds the GTK handle
@ -143,7 +141,7 @@ public:
virtual wxDataViewColumn *GetSortingColumn() const;
virtual wxDataViewItem GetSelection() const;
virtual int GetSelectedItemsCount() const;
virtual int GetSelections( wxDataViewItemArray & sel ) const;
virtual void SetSelections( const wxDataViewItemArray & sel );
virtual void Select( const wxDataViewItem & item );
@ -160,6 +158,10 @@ public:
virtual wxRect GetItemRect( const wxDataViewItem &item,
const wxDataViewColumn *column = NULL ) const;
virtual bool SetRowHeight( int rowHeight );
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column);
virtual void Expand( const wxDataViewItem & item );
virtual void Collapse( const wxDataViewItem & item );
virtual bool IsExpanded( const wxDataViewItem & item ) const;
@ -167,6 +169,8 @@ public:
virtual bool EnableDragSource( const wxDataFormat &format );
virtual bool EnableDropTarget( const wxDataFormat &format );
virtual wxDataViewColumn *GetCurrentColumn() const;
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
@ -181,6 +185,8 @@ public:
virtual void OnInternalIdle();
int GTKGetUniformRowHeight() const { return m_uniformRowHeight; }
protected:
virtual void DoSetExpanderColumn();
virtual void DoSetIndent();
@ -193,6 +199,12 @@ private:
virtual wxDataViewItem DoGetCurrentItem() const;
virtual void DoSetCurrentItem(const wxDataViewItem& item);
// Return wxDataViewColumn matching the given GtkTreeViewColumn.
//
// If the input argument is NULL, return NULL too. Otherwise we must find
// the matching column and assert if we didn't.
wxDataViewColumn* FromGTKColumn(GtkTreeViewColumn *gtk_col) const;
friend class wxDataViewCtrlDCImpl;
friend class wxDataViewColumn;
friend class wxDataViewCtrlInternal;
@ -202,6 +214,11 @@ private:
wxDataViewColumnList m_cols;
wxDataViewItem m_ensureVisibleDefered;
// By default this is set to -1 and the height of the rows is determined by
// GetRect() methods of the renderers but this can be set to a positive
// value to force the height of all rows to the given value.
int m_uniformRowHeight;
virtual void AddChildGTK(wxWindowGTK* child);
void GtkEnableSelectionEvents();
void GtkDisableSelectionEvents();

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/dc.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: dc.h 50547 2007-12-06 16:22:00Z PC $
// Id: $Id: dc.h 70165 2011-12-29 14:42:13Z SN $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -23,7 +23,7 @@ public:
virtual ~wxGTKDCImpl();
#if wxUSE_PALETTE
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }
#endif // wxUSE_PALETTE
// Resolution in pixels per logical inch

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/dirdlg.h
// Purpose: wxDirDialog
// Author: Francesco Montorsi
// Id: $Id: dirdlg.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: dirdlg.h 70898 2012-03-14 12:32:27Z VZ $
// Copyright: (c) 2006 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -26,7 +26,13 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
bool Create(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
virtual ~wxDirDialog() { }

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/dnd.h
// Purpose: declaration of the wxDropTarget class
// Author: Robert Roebling
// RCS-ID: $Id: dnd.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: dnd.h 69020 2011-09-07 16:56:50Z PC $
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -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; }
};
//-------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
// Purpose: wxDataViewRenderer for GTK wxDataViewCtrl implementation
// Author: Robert Roebling, Vadim Zeitlin
// Created: 2009-11-07 (extracted from wx/gtk/dataview.h)
// RCS-ID: $Id: dvrenderer.h 66404 2010-12-19 19:43:46Z RR $
// RCS-ID: $Id: dvrenderer.h 69020 2011-09-07 16:56:50Z PC $
// Copyright: (c) 2006 Robert Roebling
// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
@ -48,11 +48,11 @@ 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();
void GtkUpdateAlignment();
void GtkUpdateAlignment() { GtkApplyAlignment(m_renderer); }
// should be overridden to return true if the renderer supports properties
// corresponding to wxDataViewItemAttr field, see wxGtkTreeCellDataFunc()
@ -85,6 +85,9 @@ protected:
const wxDataViewItem& item,
unsigned col);
// Apply our effective alignment (i.e. m_alignment if specified or the
// associated column alignment by default) to the given renderer.
void GtkApplyAlignment(GtkCellRenderer *renderer);
GtkCellRenderer *m_renderer;
int m_alignment;

View File

@ -3,7 +3,7 @@
// Purpose: All GTK wxDataViewCtrl renderer classes
// Author: Robert Roebling, Vadim Zeitlin
// Created: 2009-11-07 (extracted from wx/gtk/dataview.h)
// RCS-ID: $Id: dvrenderers.h 67120 2011-03-03 17:51:52Z PC $
// RCS-ID: $Id: dvrenderers.h 70300 2012-01-09 06:31:07Z PC $
// Copyright: (c) 2006 Robert Roebling
// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
@ -117,18 +117,12 @@ public:
wxDC *dc,
int state);
struct GTKRenderParams;
// store GTK render call parameters for possible later use
void GTKStashRenderParams(GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *expose_area,
int flags)
void GTKSetRenderParams(GTKRenderParams* renderParams)
{
m_renderParams.window = window;
m_renderParams.widget = widget;
m_renderParams.background_area = background_area;
m_renderParams.expose_area = expose_area;
m_renderParams.flags = flags;
m_renderParams = renderParams;
}
// we may or not support attributes, as we don't know it, return true to
@ -147,20 +141,17 @@ protected:
bool Init(wxDataViewCellMode mode, int align);
private:
// Called from GtkGetTextRenderer() to really create the renderer if
// necessary.
void GtkInitTextRenderer();
wxDC *m_dc;
GtkCellRendererText *m_text_renderer;
// parameters of the original render() call stored so that we could pass
// them forward to m_text_renderer if our RenderText() is called
struct GTKRenderParams
{
GdkWindow *window;
GtkWidget *widget;
GdkRectangle *background_area;
GdkRectangle *expose_area;
int flags;
} m_renderParams;
GTKRenderParams* m_renderParams;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
};
@ -185,9 +176,17 @@ public:
virtual wxSize GetSize() const;
private:
void GTKSetLabel();
wxString m_label;
int m_value;
#if !wxUSE_UNICODE
// Flag used to indicate that we need to set the label because we were
// unable to do it in the ctor (see comments there).
bool m_needsToSetLabel;
#endif // !wxUSE_UNICODE
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
};
@ -223,34 +222,6 @@ private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
};
// ---------------------------------------------------------
// wxDataViewDateRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewDateRenderer( const wxString &varianttype = "datetime",
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
virtual bool Render( wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const;
virtual bool Activate( const wxRect& cell,
wxDataViewModel *model,
const wxDataViewItem &item,
unsigned int col );
private:
wxDateTime m_date;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
};
// -------------------------------------
// wxDataViewChoiceRenderer
// -------------------------------------
@ -291,7 +262,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);
};

View File

@ -4,7 +4,7 @@
// Author: Diaa M. Sami
// Modified by:
// Created: Aug-10-2007
// RCS-ID: $Id: filectrl.h 64429 2010-05-29 10:35:47Z VZ $
// RCS-ID: $Id: filectrl.h 70165 2011-12-29 14:42:13Z SN $
// Copyright: (c) Diaa M. Sami
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -88,7 +88,7 @@ public:
Create( parent, id, defaultDirectory, defaultFilename, wildCard, style, pos, size, name );
}
virtual ~wxGtkFileCtrl() {};
virtual ~wxGtkFileCtrl() {}
void Init();
bool Create( wxWindow *parent,

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/filedlg.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: filedlg.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: filedlg.h 70898 2012-03-14 12:32:27Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -30,6 +30,15 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
bool Create(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxFileDialogNameStr);
virtual ~wxFileDialog();
virtual wxString GetPath() const;

View File

@ -5,7 +5,7 @@
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Francesco Montorsi
// RCS-ID: $Id: filepicker.h 63690 2010-03-16 00:23:57Z VZ $
// RCS-ID: $Id: filepicker.h 70043 2011-12-18 12:34:47Z VZ $
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
@ -101,6 +101,7 @@ public: // overrides
void OnDialogOK(wxCommandEvent &);
virtual void SetPath(const wxString &str);
virtual void SetInitialDirectory(const wxString& dir);
// see macro defined above
FILEDIRBTN_OVERRIDES
@ -171,6 +172,7 @@ public: // overrides
}
virtual void SetPath(const wxString &str);
virtual void SetInitialDirectory(const wxString& dir);
// see macro defined above
FILEDIRBTN_OVERRIDES

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/font.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: font.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: font.h 70476 2012-01-29 08:14:34Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -63,6 +63,12 @@ public:
SetPixelSize(pixelSize);
}
wxFont(int pointSize,
wxFontFamily family,
int flags = wxFONTFLAG_DEFAULT,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
bool Create(int size,
wxFontFamily family,
wxFontStyle style,
@ -82,6 +88,7 @@ public:
virtual wxFontWeight GetWeight() const;
virtual wxString GetFaceName() const;
virtual bool GetUnderlined() const;
virtual bool GetStrikethrough() const;
virtual wxFontEncoding GetEncoding() const;
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
virtual bool IsFixedWidth() const;
@ -92,10 +99,18 @@ public:
virtual void SetWeight(wxFontWeight weight);
virtual bool SetFaceName( const wxString& faceName );
virtual void SetUnderlined( bool underlined );
virtual void SetStrikethrough(bool strikethrough);
virtual void SetEncoding(wxFontEncoding encoding);
wxDECLARE_COMMON_FONT_METHODS();
// Set Pango attributes in the specified layout. Currently only
// underlined and strike-through attributes are handled by this function.
//
// If neither of them is specified, returns false, otherwise sets up the
// attributes and returns true.
bool GTKSetPangoAttrs(PangoLayout* layout) const;
// implementation from now on
void Unshare();

View File

@ -5,7 +5,7 @@
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Francesco Montorsi
// RCS-ID: $Id: fontpicker.h 49668 2007-11-06 00:32:34Z MR $
// RCS-ID: $Id: fontpicker.h 69020 2011-09-07 16:56:50Z PC $
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
@ -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:

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/gauge.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: gauge.h 42077 2006-10-17 14:44:52Z ABX $
// Id: $Id: gauge.h 70165 2011-12-29 14:42:13Z SN $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -43,8 +43,8 @@ public:
void SetShadowWidth( int WXUNUSED(w) ) { }
void SetBezelFace( int WXUNUSED(w) ) { }
int GetShadowWidth() const { return 0; };
int GetBezelFace() const { return 0; };
int GetShadowWidth() const { return 0; }
int GetBezelFace() const { return 0; }
// determinate mode API
void SetRange( int r );

View File

@ -4,13 +4,13 @@
// Author: Francesco Montorsi
// Modified by:
// Created: 14/2/2007
// RCS-ID: $Id: hyperlink.h 44647 2007-03-07 22:12:47Z VZ $
// RCS-ID: $Id: hyperlink.h 67378 2011-04-02 20:43:29Z PC $
// Copyright: (c) 2007 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKHYPERLINKCTRLH__
#define __GTKHYPERLINKCTRLH__
#ifndef _WX_GTKHYPERLINKCTRL_H_
#define _WX_GTKHYPERLINKCTRL_H_
#include "wx/generic/hyperlink.h"
@ -62,16 +62,12 @@ public:
virtual void SetLabel(const wxString &label);
protected:
// overridden base class virtuals
// Returns the best size for the window, which is the size needed
// to display the text label.
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestClientSize() const;
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
private:
DECLARE_DYNAMIC_CLASS(wxHyperlinkCtrl)
};
#endif // __GTKHYPERLINKCTRLH__
#endif // _WX_GTKHYPERLINKCTRL_H_

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/listbox.h
// Purpose: wxListBox class declaration
// Author: Robert Roebling
// Id: $Id: listbox.h 65936 2010-10-27 23:22:00Z VZ $
// Id: $Id: listbox.h 67298 2011-03-23 17:36:10Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -82,11 +82,7 @@ public:
// implementation from now on
GtkWidget *GetConnectWidget();
#if wxUSE_TOOLTIPS
void GTKApplyToolTip( GtkTooltips *tips, const gchar *tip );
#endif // wxUSE_TOOLTIPS
virtual GtkWidget *GetConnectWidget();
struct _GtkTreeView *m_treeview;
struct _GtkListStore *m_liststore;

View File

@ -3,7 +3,7 @@
// Purpose: TDI-based MDI implementation for wxGTK
// Author: Robert Roebling
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
// Id: $Id: mdi.h 59523 2009-03-14 01:24:45Z FM $
// Id: $Id: mdi.h 69528 2011-10-25 16:56:57Z PC $
// Copyright: (c) 1998 Robert Roebling
// (c) 2008 Vadim Zeitlin
// Licence: wxWindows licence
@ -118,9 +118,9 @@ public:
void OnActivate( wxActivateEvent& event );
void OnMenuHighlight( wxMenuEvent& event );
virtual void GTKHandleRealized();
wxMenuBar *m_menuBar;
GtkNotebookPage *m_page;
bool m_justInserted;
private:

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/menu.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: menu.h 66180 2010-11-17 05:57:21Z PC $
// Id: $Id: menu.h 70350 2012-01-15 13:41:17Z VZ $
// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -33,6 +33,7 @@ public:
virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const;
virtual void EnableTop( size_t pos, bool flag );
virtual bool IsEnabledTop(size_t pos) const;
virtual void SetMenuLabel( size_t pos, const wxString& label );
virtual wxString GetMenuLabel( size_t pos ) const;
@ -51,7 +52,7 @@ public:
private:
// common part of Append and Insert
bool GtkAppend(wxMenu *menu, const wxString& title, int pos=-1);
void GtkAppend(wxMenu* menu, const wxString& title, int pos = -1);
void Init(size_t n, wxMenu *menus[], const wxString titles[], long style);
@ -99,9 +100,8 @@ private:
void Init();
// common part of Append (if pos == -1) and Insert
bool GtkAppend(wxMenuItem *item, int pos=-1);
void GtkAppend(wxMenuItem* item, int pos = -1);
GtkWidget *m_prevRadio;
DECLARE_DYNAMIC_CLASS(wxMenu)
};

View File

@ -4,7 +4,7 @@
// Author: Vaclav Slavik
// Modified by:
// Created: 2003/02/28
// RCS-ID: $Id: msgdlg.h 65348 2010-08-18 22:48:28Z VZ $
// RCS-ID: $Id: msgdlg.h 68537 2011-08-04 22:53:42Z VZ $
// Copyright: (c) Vaclav Slavik, 2003
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -40,6 +40,7 @@ private:
virtual wxString GetDefaultNoLabel() const;
virtual wxString GetDefaultOKLabel() const;
virtual wxString GetDefaultCancelLabel() const;
virtual wxString GetDefaultHelpLabel() const;
// create the real GTK+ dialog: this is done from ShowModal() to allow
// changing the message between constructing the dialog and showing it

View File

@ -0,0 +1,44 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/nonownedwnd.h
// Purpose: wxGTK-specific wxNonOwnedWindow declaration.
// Author: Vadim Zeitlin
// Created: 2011-10-12
// RCS-ID: $Id: nonownedwnd.h 69462 2011-10-18 21:56:52Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_NONOWNEDWND_H_
#define _WX_GTK_NONOWNEDWND_H_
class wxNonOwnedWindowShapeImpl;
// ----------------------------------------------------------------------------
// wxNonOwnedWindow contains code common to wx{Popup,TopLevel}Window in wxGTK.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase
{
public:
wxNonOwnedWindow() { m_shapeImpl = NULL; }
virtual ~wxNonOwnedWindow();
// Overridden to actually set the shape when the window becomes realized.
virtual void GTKHandleRealized();
protected:
virtual bool DoClearShape();
virtual bool DoSetRegionShape(const wxRegion& region);
#if wxUSE_GRAPHICS_CONTEXT
virtual bool DoSetPathShape(const wxGraphicsPath& path);
#endif // wxUSE_GRAPHICS_CONTEXT
private:
// If non-NULL, contains information about custom window shape.
wxNonOwnedWindowShapeImpl* m_shapeImpl;
wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow);
};
#endif // _WX_GTK_NONOWNEDWND_H_

View File

@ -3,7 +3,7 @@
// Purpose: wxNotebook class
// Author: Robert Roebling
// Modified by:
// RCS-ID: $Id: notebook.h 67254 2011-03-20 00:14:35Z DS $
// RCS-ID: $Id: notebook.h 70112 2011-12-24 18:19:26Z VZ $
// Copyright: (c) Julian Smart and Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -68,13 +68,13 @@ public:
bool SetPageImage(size_t nPage, int nImage);
// control the appearance of the notebook pages
// set the size (the same for all pages)
void SetPageSize(const wxSize& size);
// set the padding between tabs (in pixels)
void SetPadding(const wxSize& padding);
// sets the size of the tabs (assumes all tabs are the same size)
void SetTabSize(const wxSize& sz);
// geometry
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
// operations
@ -89,7 +89,7 @@ public:
wxNotebookPage *win,
const wxString& strText,
bool bSelect = false,
int imageId = -1 );
int imageId = NO_IMAGE );
// handler for tab navigation
// --------------------------

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/pen.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: pen.h 54273 2008-06-17 17:28:26Z VZ $
// Id: $Id: pen.h 69020 2011-09-07 16:56:50Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -10,7 +10,7 @@
#ifndef _WX_GTK_PEN_H_
#define _WX_GTK_PEN_H_
typedef gint8 wxGTKDash;
typedef signed char wxGTKDash;
//-----------------------------------------------------------------------------
// wxPen

View File

@ -3,7 +3,7 @@
// Purpose:
// Author: Robert Roebling
// Created:
// Id: $Id: popupwin.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: popupwin.h 70739 2012-02-28 17:25:59Z PC $
// Copyright: (c) 2001 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -42,9 +42,6 @@ protected:
virtual void DoMoveWindow(int x, int y, int width, int height);
private:
virtual void AddChildGTK(wxWindowGTK* child);
#ifdef __WXUNIVERSAL__
DECLARE_EVENT_TABLE()
#endif

View File

@ -4,7 +4,7 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 12.03.02
// RCS-ID: $Id: private.h 63805 2010-03-30 16:14:11Z PC $
// RCS-ID: $Id: private.h 70475 2012-01-29 08:00:15Z PC $
// Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -15,6 +15,7 @@
#include <gtk/gtk.h>
#include "wx/gtk/private/string.h"
#include "wx/gtk/private/gtk2-compat.h"
// pango_version_check symbol is quite recent ATM (4/2007)... so we
// use our own wrapper which implements a smart trick.
@ -51,13 +52,13 @@ extern const gchar *wx_pango_version_check(int major, int minor, int micro);
// helper: use the encoding of the given font if it's valid
inline wxCharBuffer wxConvertToGTK(const wxString& s, const wxFont& font)
{
return wxConvertToGTK(s, font.Ok() ? font.GetEncoding()
return wxConvertToGTK(s, font.IsOk() ? font.GetEncoding()
: wxFONTENCODING_SYSTEM);
}
inline wxCharBuffer wxConvertFromGTK(const wxString& s, const wxFont& font)
{
return wxConvertFromGTK(s, font.Ok() ? font.GetEncoding()
return wxConvertFromGTK(s, font.IsOk() ? font.GetEncoding()
: wxFONTENCODING_SYSTEM);
}
@ -113,4 +114,3 @@ GtkWidget *GetTreeWidget();
} // wxGTKPrivate
#endif // _WX_GTK_PRIVATE_H_

View File

@ -0,0 +1,80 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private/event.h
// Purpose: Helper functions for working with GDK and wx events
// Author: Vaclav Slavik
// Created: 2011-10-14
// RCS-ID: $Id$
// Copyright: (c) 2011 Vaclav Slavik
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _GTK_PRIVATE_EVENT_H_
#define _GTK_PRIVATE_EVENT_H_
#if !GTK_CHECK_VERSION(2,10,0)
// GTK+ can reliably detect Meta key state only since 2.10 when
// GDK_META_MASK was introduced -- there wasn't any way to detect it
// in older versions. wxGTK used GDK_MOD2_MASK for this purpose, but
// GDK_MOD2_MASK is documented as:
//
// the fifth modifier key (it depends on the modifier mapping of the X
// server which key is interpreted as this modifier)
//
// In other words, it isn't guaranteed to map to Meta. This is a real
// problem: it is common to map NumLock to it (in fact, it's an exception
// if the X server _doesn't_ use it for NumLock). So the old code caused
// wxKeyEvent::MetaDown() to always return true as long as NumLock was on
// on many systems, which broke all applications using
// wxKeyEvent::GetModifiers() to check modifiers state (see e.g. here:
// http://tinyurl.com/56lsk2).
//
// Because of this, it's better to not detect Meta key state at all than
// to detect it incorrectly. Hence the following #define, which causes
// m_metaDown to be always set to false.
#define GDK_META_MASK 0
#endif
namespace wxGTKImpl
{
// init wxMouseEvent with the info from GdkEventXXX struct
template<typename T> void InitMouseEvent(wxWindowGTK *win,
wxMouseEvent& event,
T *gdk_event)
{
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK) != 0;
event.m_controlDown = (gdk_event->state & GDK_CONTROL_MASK) != 0;
event.m_altDown = (gdk_event->state & GDK_MOD1_MASK) != 0;
event.m_metaDown = (gdk_event->state & GDK_META_MASK) != 0;
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK) != 0;
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK) != 0;
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK) != 0;
// In gdk/win32 VK_XBUTTON1 is translated to GDK_BUTTON4_MASK
// and VK_XBUTTON2 to GDK_BUTTON5_MASK. In x11/gdk buttons 4/5
// are wheel rotation and buttons 8/9 don't change the state.
event.m_aux1Down = (gdk_event->state & GDK_BUTTON4_MASK) != 0;
event.m_aux2Down = (gdk_event->state & GDK_BUTTON5_MASK) != 0;
wxPoint pt = win->GetClientAreaOrigin();
event.m_x = (wxCoord)gdk_event->x - pt.x;
event.m_y = (wxCoord)gdk_event->y - pt.y;
if ((win->m_wxwindow) && (win->GetLayoutDirection() == wxLayout_RightToLeft))
{
// origin in the upper right corner
GtkAllocation a;
gtk_widget_get_allocation(win->m_wxwindow, &a);
int window_width = a.width;
event.m_x = window_width - event.m_x;
}
event.SetEventObject( win );
event.SetId( win->GetId() );
event.SetTimestamp( gdk_event->time );
}
} // namespace wxGTKImpl
#endif // _GTK_PRIVATE_EVENT_H_

View File

@ -0,0 +1,376 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private/compat.h
// Purpose: Compatibility code for older GTK+ versions
// Author: Vaclav Slavik
// Created: 2011-03-25
// RCS-ID: $Id$
// Copyright: (c) 2011 Vaclav Slavik <vslavik@fastmail.fm>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_PRIVATE_COMPAT_H_
#define _WX_GTK_PRIVATE_COMPAT_H_
// ----------------------------------------------------------------------------
// Implementations of new accessors for older GTK+ versions
// ----------------------------------------------------------------------------
// GTK+ deprecated direct access to struct members and some other stuff,
// replacing them with simple accessor functions. These aren't available in
// older versions, though, so we have to provide them for compatibility.
//
// Note: wx_ prefix is used to avoid symbol conflicts at runtime
//
// Note 2: We support building against newer GTK+ version and using an older
// one at runtime, so we must provide our implementations of these
// functions even if GTK_CHECK_VERSION would indicate the function is
// already available in GTK+.
#if !GTK_CHECK_VERSION(3,0,0) && !(defined(GTK_DISABLE_DEPRECATED) || defined(GSEAL_ENABLE))
// ----------------------------------------------------------------------------
// the following were introduced in GTK+ 2.8
static inline GtkWidget* wx_gtk_scrolled_window_get_hscrollbar(GtkScrolledWindow* scrolled_window)
{
return scrolled_window->hscrollbar;
}
#define gtk_scrolled_window_get_hscrollbar wx_gtk_scrolled_window_get_hscrollbar
static inline GtkWidget* wx_gtk_scrolled_window_get_vscrollbar(GtkScrolledWindow* scrolled_window)
{
return scrolled_window->vscrollbar;
}
#define gtk_scrolled_window_get_vscrollbar wx_gtk_scrolled_window_get_vscrollbar
// ----------------------------------------------------------------------------
// the following were introduced in GLib 2.10
static inline gpointer wx_g_object_ref_sink(gpointer object)
{
g_object_ref(object);
gtk_object_sink(GTK_OBJECT(object));
return object;
}
#define g_object_ref_sink wx_g_object_ref_sink
// ----------------------------------------------------------------------------
// the following were introduced in GTK+ 2.12 and GtkAboutDialog itself is not
// in 2.4 so skip this if we don't have it.
#if GTK_CHECK_VERSION(2,6,0)
static inline void wx_gtk_about_dialog_set_program_name(GtkAboutDialog* about, const gchar* name)
{
gtk_about_dialog_set_name(about, name);
}
#define gtk_about_dialog_set_program_name wx_gtk_about_dialog_set_program_name
#endif // 2.6.0
// ----------------------------------------------------------------------------
// the following were introduced in GTK+ 2.14
static inline gdouble wx_gtk_adjustment_get_lower(GtkAdjustment* adjustment)
{
return adjustment->lower;
}
#define gtk_adjustment_get_lower wx_gtk_adjustment_get_lower
static inline gdouble wx_gtk_adjustment_get_page_increment(GtkAdjustment* adjustment)
{
return adjustment->page_increment;
}
#define gtk_adjustment_get_page_increment wx_gtk_adjustment_get_page_increment
static inline gdouble wx_gtk_adjustment_get_page_size(GtkAdjustment* adjustment)
{
return adjustment->page_size;
}
#define gtk_adjustment_get_page_size wx_gtk_adjustment_get_page_size
static inline gdouble wx_gtk_adjustment_get_step_increment(GtkAdjustment* adjustment)
{
return adjustment->step_increment;
}
#define gtk_adjustment_get_step_increment wx_gtk_adjustment_get_step_increment
static inline gdouble wx_gtk_adjustment_get_upper(GtkAdjustment* adjustment)
{
return adjustment->upper;
}
#define gtk_adjustment_get_upper wx_gtk_adjustment_get_upper
static inline void wx_gtk_adjustment_set_page_size(GtkAdjustment* adjustment, gdouble page_size)
{
adjustment->page_size = page_size;
}
#define gtk_adjustment_set_page_size wx_gtk_adjustment_set_page_size
static inline GtkWidget* wx_gtk_color_selection_dialog_get_color_selection(GtkColorSelectionDialog* csd)
{
return csd->colorsel;
}
#define gtk_color_selection_dialog_get_color_selection wx_gtk_color_selection_dialog_get_color_selection
static inline GtkWidget* wx_gtk_dialog_get_content_area(GtkDialog* dialog)
{
return dialog->vbox;
}
#define gtk_dialog_get_content_area wx_gtk_dialog_get_content_area
static inline GtkWidget* wx_gtk_dialog_get_action_area(GtkDialog* dialog)
{
return dialog->action_area;
}
#define gtk_dialog_get_action_area wx_gtk_dialog_get_action_area
static inline guint16 wx_gtk_entry_get_text_length(GtkEntry* entry)
{
return entry->text_length;
}
#define gtk_entry_get_text_length wx_gtk_entry_get_text_length
static inline GtkWidget* wx_gtk_font_selection_dialog_get_cancel_button(GtkFontSelectionDialog* fsd)
{
return fsd->cancel_button;
}
#define gtk_font_selection_dialog_get_cancel_button wx_gtk_font_selection_dialog_get_cancel_button
static inline GtkWidget* wx_gtk_font_selection_dialog_get_ok_button(GtkFontSelectionDialog* fsd)
{
return fsd->ok_button;
}
#define gtk_font_selection_dialog_get_ok_button wx_gtk_font_selection_dialog_get_ok_button
static inline const guchar* wx_gtk_selection_data_get_data(GtkSelectionData* selection_data)
{
return selection_data->data;
}
#define gtk_selection_data_get_data wx_gtk_selection_data_get_data
static inline GdkAtom wx_gtk_selection_data_get_data_type(GtkSelectionData* selection_data)
{
return selection_data->type;
}
#define gtk_selection_data_get_data_type wx_gtk_selection_data_get_data_type
static inline gint wx_gtk_selection_data_get_format(GtkSelectionData* selection_data)
{
return selection_data->format;
}
#define gtk_selection_data_get_format wx_gtk_selection_data_get_format
static inline gint wx_gtk_selection_data_get_length(GtkSelectionData* selection_data)
{
return selection_data->length;
}
#define gtk_selection_data_get_length wx_gtk_selection_data_get_length
static inline GdkAtom wx_gtk_selection_data_get_target(GtkSelectionData* selection_data)
{
return selection_data->target;
}
#define gtk_selection_data_get_target wx_gtk_selection_data_get_target
static inline GdkWindow* wx_gtk_widget_get_window(GtkWidget* widget)
{
return widget->window;
}
#define gtk_widget_get_window wx_gtk_widget_get_window
static inline GtkWidget* wx_gtk_window_get_default_widget(GtkWindow* window)
{
return window->default_widget;
}
#define gtk_window_get_default_widget wx_gtk_window_get_default_widget
// ----------------------------------------------------------------------------
// the following were introduced in GTK+ 2.16
static inline GdkAtom wx_gtk_selection_data_get_selection(GtkSelectionData* selection_data)
{
return selection_data->selection;
}
#define gtk_selection_data_get_selection wx_gtk_selection_data_get_selection
// ----------------------------------------------------------------------------
// the following were introduced in GTK+ 2.18
static inline void wx_gtk_cell_renderer_get_alignment(GtkCellRenderer* cell, gfloat* xalign, gfloat* yalign)
{
*xalign = cell->xalign;
*yalign = cell->yalign;
}
#define gtk_cell_renderer_get_alignment wx_gtk_cell_renderer_get_alignment
static inline void wx_gtk_cell_renderer_get_padding(GtkCellRenderer* cell, gint* xpad, gint* ypad)
{
*xpad = cell->xpad;
*ypad = cell->ypad;
}
#define gtk_cell_renderer_get_padding wx_gtk_cell_renderer_get_padding
static inline void wx_gtk_widget_get_allocation(GtkWidget* widget, GtkAllocation* allocation)
{
*allocation = widget->allocation;
}
#define gtk_widget_get_allocation wx_gtk_widget_get_allocation
inline gboolean wx_gtk_widget_get_has_window(GtkWidget *widget)
{
return !GTK_WIDGET_NO_WINDOW(widget);
}
#define gtk_widget_get_has_window wx_gtk_widget_get_has_window
inline gboolean wx_gtk_widget_get_has_grab(GtkWidget *widget)
{
return GTK_WIDGET_HAS_GRAB(widget);
}
#define gtk_widget_get_has_grab wx_gtk_widget_get_has_grab
inline gboolean wx_gtk_widget_get_visible(GtkWidget *widget)
{
return GTK_WIDGET_VISIBLE(widget);
}
#define gtk_widget_get_visible wx_gtk_widget_get_visible
inline gboolean wx_gtk_widget_get_sensitive(GtkWidget *widget)
{
return GTK_WIDGET_SENSITIVE(widget);
}
#define gtk_widget_get_sensitive wx_gtk_widget_get_sensitive
inline gboolean wx_gtk_widget_is_drawable(GtkWidget *widget)
{
return GTK_WIDGET_DRAWABLE(widget);
}
#define gtk_widget_is_drawable wx_gtk_widget_is_drawable
inline gboolean wx_gtk_widget_get_can_focus(GtkWidget *widget)
{
return GTK_WIDGET_CAN_FOCUS(widget);
}
#define gtk_widget_get_can_focus wx_gtk_widget_get_can_focus
inline void wx_gtk_widget_set_can_focus(GtkWidget *widget, gboolean can)
{
if ( can )
GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);
else
GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS);
}
#define gtk_widget_set_can_focus wx_gtk_widget_set_can_focus
inline gboolean wx_gtk_widget_get_can_default(GtkWidget *widget)
{
return GTK_WIDGET_CAN_DEFAULT(widget);
}
#define gtk_widget_get_can_default wx_gtk_widget_get_can_default
inline void wx_gtk_widget_set_can_default(GtkWidget *widget, gboolean can)
{
if ( can )
GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT);
else
GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_DEFAULT);
}
#define gtk_widget_set_can_default wx_gtk_widget_set_can_default
inline gboolean wx_gtk_widget_has_default(GtkWidget *widget)
{
return GTK_WIDGET_HAS_DEFAULT(widget);
}
#define gtk_widget_has_default wx_gtk_widget_has_default
inline GtkStateType wx_gtk_widget_get_state(GtkWidget *widget)
{
return (GtkStateType)GTK_WIDGET_STATE(widget);
}
#define gtk_widget_get_state wx_gtk_widget_get_state
inline gboolean wx_gtk_widget_get_double_buffered(GtkWidget *widget)
{
return GTK_WIDGET_DOUBLE_BUFFERED(widget);
}
#define gtk_widget_get_double_buffered wx_gtk_widget_get_double_buffered
static inline gboolean wx_gtk_widget_has_grab(GtkWidget* widget)
{
return GTK_WIDGET_HAS_GRAB(widget);
}
#define gtk_widget_has_grab wx_gtk_widget_has_grab
static inline void wx_gtk_widget_set_allocation(GtkWidget* widget, const GtkAllocation* allocation)
{
widget->allocation = *allocation;
}
#define gtk_widget_set_allocation wx_gtk_widget_set_allocation
// ----------------------------------------------------------------------------
// the following were introduced in GTK+ 2.20
inline gboolean wx_gtk_widget_get_realized(GtkWidget *widget)
{
return GTK_WIDGET_REALIZED(widget);
}
#define gtk_widget_get_realized wx_gtk_widget_get_realized
inline gboolean wx_gtk_widget_get_mapped(GtkWidget *widget)
{
return GTK_WIDGET_MAPPED(widget);
}
#define gtk_widget_get_mapped wx_gtk_widget_get_mapped
static inline void wx_gtk_widget_get_requisition(GtkWidget* widget, GtkRequisition* requisition)
{
*requisition = widget->requisition;
}
#define gtk_widget_get_requisition wx_gtk_widget_get_requisition
static inline GdkWindow* wx_gtk_entry_get_text_window(GtkEntry* entry)
{
return entry->text_area;
}
#define gtk_entry_get_text_window wx_gtk_entry_get_text_window
// ----------------------------------------------------------------------------
// the following were introduced in GTK+ 2.24
static inline gint wx_gdk_window_get_height(GdkWindow* window)
{
int h;
gdk_drawable_get_size(window, NULL, &h);
return h;
}
#define gdk_window_get_height wx_gdk_window_get_height
static inline gint wx_gdk_window_get_width(GdkWindow* window)
{
int w;
gdk_drawable_get_size(window, &w, NULL);
return w;
}
#define gdk_window_get_width wx_gdk_window_get_width
#if GTK_CHECK_VERSION(2,10,0)
static inline void wx_gdk_cairo_set_source_window(cairo_t* cr, GdkWindow* window, gdouble x, gdouble y)
{
gdk_cairo_set_source_pixmap(cr, window, x, y);
}
#define gdk_cairo_set_source_window wx_gdk_cairo_set_source_window
#endif
#endif // !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
#endif // _WX_GTK_PRIVATE_COMPAT_H_

View File

@ -0,0 +1,33 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private/list.h
// Purpose: wxGtkList class.
// Author: Vadim Zeitlin
// Created: 2011-08-21
// RCS-ID: $Id: list.h 68842 2011-08-22 12:41:00Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_PRIVATE_LIST_H_
#define _WX_GTK_PRIVATE_LIST_H_
// ----------------------------------------------------------------------------
// Convenience class for calling g_list_free() automatically
// ----------------------------------------------------------------------------
class wxGtkList
{
public:
explicit wxGtkList(GList* list) : m_list(list) { }
~wxGtkList() { g_list_free(m_list); }
operator GList *() const { return m_list; }
GList * operator->() const { return m_list; }
protected:
GList* const m_list;
wxDECLARE_NO_COPY_CLASS(wxGtkList);
};
#endif // _WX_GTK_PRIVATE_LIST_H_

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/private/timer.h
// Purpose: wxTimerImpl for wxGTK
// Author: Robert Roebling
// Id: $Id: timer.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: timer.h 70165 2011-12-29 14:42:13Z SN $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -21,7 +21,7 @@
class WXDLLIMPEXP_CORE wxGTKTimerImpl : public wxTimerImpl
{
public:
wxGTKTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { m_sourceId = 0; };
wxGTKTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { m_sourceId = 0; }
virtual bool Start( int millisecs = -1, bool oneShot = false );
virtual void Stop();

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/radiobox.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: radiobox.h 60885 2009-06-03 22:33:32Z VZ $
// Id: $Id: radiobox.h 67298 2011-03-23 17:36:10Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -131,7 +131,7 @@ public:
void GtkDisableEvents();
void GtkEnableEvents();
#if wxUSE_TOOLTIPS
void GTKApplyToolTip( GtkTooltips *tips, const gchar *tip );
virtual void GTKApplyToolTip(const char* tip);
#endif // wxUSE_TOOLTIPS
wxRadioBoxButtonsInfoList m_buttonsInfo;

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/region.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: region.h 61724 2009-08-21 10:41:26Z VZ $
// Id: $Id: region.h 69815 2011-11-25 00:52:24Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -122,13 +122,11 @@ private:
void Init();
void CreateRects( const wxRegion& r );
size_t m_current;
wxRegion m_region;
wxRect *m_rects;
size_t m_numRects;
int m_numRects;
int m_current;
private:
DECLARE_DYNAMIC_CLASS(wxRegionIterator)
};

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/scrolbar.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: scrolbar.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: scrolbar.h 67326 2011-03-28 06:27:49Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -10,14 +10,6 @@
#ifndef _WX_GTK_SCROLLBAR_H_
#define _WX_GTK_SCROLLBAR_H_
#include "wx/defs.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxScrollBar;
//-----------------------------------------------------------------------------
// wxScrollBar
//-----------------------------------------------------------------------------
@ -57,10 +49,6 @@ public:
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
private:
DECLARE_DYNAMIC_CLASS(wxScrollBar)
};

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/statbox.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: statbox.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: statbox.h 70738 2012-02-28 17:06:56Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -40,7 +40,7 @@ public:
// implementation
virtual bool IsTransparentForMouse() const { return true; }
virtual bool GTKIsTransparentForMouse() const { return true; }
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;

View File

@ -3,7 +3,7 @@
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
// Id: $Id: textctrl.h 64404 2010-05-26 17:37:55Z RR $
// Id: $Id: textctrl.h 68450 2011-07-29 15:11:54Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -167,6 +167,8 @@ protected:
virtual void DoSetValue(const wxString &value, int flags = 0);
virtual wxPoint DoPositionToCoords(long pos) const;
// wrappers hiding the differences between functions doing the same thing
// for GtkTextView and GtkEntry (all of them use current window style to
// set the given characteristic)
@ -214,6 +216,7 @@ private:
GtkTextBuffer *m_buffer;
GtkTextMark* m_showPositionOnThaw;
GSList* m_anonymousMarkList;
// For wxTE_AUTO_URL
void OnUrlMouseEvent(wxMouseEvent&);

View File

@ -3,7 +3,7 @@
// Purpose: wxGTK-specific wxTextEntry implementation
// Author: Vadim Zeitlin
// Created: 2007-09-24
// RCS-ID: $Id: textentry.h 61834 2009-09-05 12:39:12Z JMS $
// RCS-ID: $Id: textentry.h 67509 2011-04-16 17:27:04Z VZ $
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -43,8 +43,6 @@ public:
virtual void SetSelection(long from, long to);
virtual void GetSelection(long *from, long *to) const;
virtual bool AutoComplete(const wxArrayString& choices);
virtual bool IsEditable() const;
virtual void SetEditable(bool editable);
@ -60,6 +58,8 @@ protected:
virtual bool DoSetMargins(const wxPoint& pt);
virtual wxPoint DoGetMargins() const;
virtual bool DoAutoCompleteStrings(const wxArrayString& choices);
private:
// implement this to return the associated GtkEntry or another widget
// implementing GtkEditable

View File

@ -5,7 +5,7 @@
// Author: John Norris, minor changes by Axel Schlueter
// Modified by:
// Created: 08.02.01
// RCS-ID: $Id: tglbtn.h 66992 2011-02-22 13:25:30Z VZ $
// RCS-ID: $Id: tglbtn.h 67931 2011-06-14 13:00:42Z VZ $
// Copyright: (c) 2000 Johnny C. Norris II
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -22,67 +22,6 @@
class WXDLLIMPEXP_FWD_CORE wxToggleButton;
class WXDLLIMPEXP_FWD_CORE wxToggleBitmapButton;
//-----------------------------------------------------------------------------
// wxBitmapToggleButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButtonBase
{
public:
// construction/destruction
wxBitmapToggleButton() {}
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
// Get/set the value
void SetValue(bool state);
bool GetValue() const;
// Set the label
virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }
virtual void SetLabel(const wxBitmap& label);
bool Enable(bool enable = true);
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// implementation
wxBitmap m_bitmap;
void OnSetBitmap();
protected:
void GTKDisableEvents();
void GTKEnableEvents();
virtual wxSize DoGetBestSize() const;
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
private:
typedef wxToggleButtonBase base_type;
DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
};
//-----------------------------------------------------------------------------
// wxToggleButton
//-----------------------------------------------------------------------------
@ -119,7 +58,6 @@ public:
// Set the label
void SetLabel(const wxString& label);
bool Enable(bool enable = true);
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
@ -130,13 +68,61 @@ protected:
virtual wxSize DoGetBestSize() const;
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
#if wxUSE_MARKUP
virtual bool DoSetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
private:
typedef wxToggleButtonBase base_type;
// Return the GtkLabel used by this toggle button.
GtkLabel *GTKGetLabel() const;
DECLARE_DYNAMIC_CLASS(wxToggleButton)
};
//-----------------------------------------------------------------------------
// wxBitmapToggleButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapToggleButton: public wxToggleButton
{
public:
// construction/destruction
wxBitmapToggleButton() {}
wxBitmapToggleButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
// Create the control
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
// deprecated synonym for SetBitmapLabel()
wxDEPRECATED_INLINE( void SetLabel(const wxBitmap& bitmap),
SetBitmapLabel(bitmap); )
// prevent virtual function hiding
virtual void SetLabel(const wxString& label) { wxToggleButton::SetLabel(label); }
private:
typedef wxToggleButtonBase base_type;
DECLARE_DYNAMIC_CLASS(wxBitmapToggleButton)
};
#endif // _WX_GTK_TOGGLEBUTTON_H_

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/toolbar.h
// Purpose: GTK toolbar
// Author: Robert Roebling
// RCS-ID: $Id: toolbar.h 66633 2011-01-07 18:15:21Z PC $
// RCS-ID: $Id: toolbar.h 70854 2012-03-10 00:01:09Z RD $
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -12,6 +12,8 @@
#if wxUSE_TOOLBAR
typedef struct _GtkTooltips GtkTooltips;
// ----------------------------------------------------------------------------
// wxToolBar
// ----------------------------------------------------------------------------
@ -56,6 +58,17 @@ public:
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
virtual wxToolBarToolBase *CreateTool(int id,
const wxString& label,
const wxBitmap& bitmap1,
const wxBitmap& bitmap2 = wxNullBitmap,
wxItemKind kind = wxITEM_NORMAL,
wxObject *clientData = NULL,
const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString);
virtual wxToolBarToolBase *CreateTool(wxControl *control,
const wxString& label);
// implementation from now on
// --------------------------
@ -71,17 +84,6 @@ protected:
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
virtual wxToolBarToolBase *CreateTool(int id,
const wxString& label,
const wxBitmap& bitmap1,
const wxBitmap& bitmap2,
wxItemKind kind,
wxObject *clientData,
const wxString& shortHelpString,
const wxString& longHelpString);
virtual wxToolBarToolBase *CreateTool(wxControl *control,
const wxString& label);
private:
void Init();
void GtkSetStyle();

View File

@ -2,15 +2,14 @@
// Name: wx/gtk/tooltip.h
// Purpose: wxToolTip class
// Author: Robert Roebling
// Id: $Id: tooltip.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: tooltip.h 67298 2011-03-23 17:36:10Z PC $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __GTKTOOLTIPH__
#define __GTKTOOLTIPH__
#ifndef _WX_GTKTOOLTIP_H_
#define _WX_GTKTOOLTIP_H_
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/object.h"
@ -18,7 +17,6 @@
// forward declarations
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxToolTip;
class WXDLLIMPEXP_FWD_CORE wxWindow;
//-----------------------------------------------------------------------------
@ -43,15 +41,10 @@ public:
wxString GetTip() const { return m_text; }
wxWindow *GetWindow() const { return m_window; }
bool IsOk() const { return m_window != NULL; }
// this forwards back to wxWindow::GTKApplyToolTip()
void GTKApply( wxWindow *win );
// this just sets the given tooltip for the specified widget
// tip must be UTF-8 encoded
static void GTKApply(GtkWidget *w, const gchar *tip);
// Implementation
void GTKSetWindow(wxWindow* win);
static void GTKApply(GtkWidget* widget, const char* tip);
private:
wxString m_text;
@ -60,4 +53,4 @@ private:
DECLARE_ABSTRACT_CLASS(wxToolTip)
};
#endif // __GTKTOOLTIPH__
#endif // _WX_GTKTOOLTIP_H_

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/toplevel.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: toplevel.h 65373 2010-08-21 09:53:25Z RR $
// Id: $Id: toplevel.h 70165 2011-12-29 14:42:13Z SN $
// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -55,9 +55,7 @@ public:
virtual void ShowWithoutActivating();
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
virtual bool IsFullScreen() const { return m_fsIsShowing; };
virtual bool SetShape(const wxRegion& region);
virtual bool IsFullScreen() const { return m_fsIsShowing; }
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
@ -95,6 +93,8 @@ public:
// GTK callbacks
virtual void OnInternalIdle();
virtual void GTKHandleRealized();
// do *not* call this to iconize the frame, this is a private function!
void SetIconizeState(bool iconic);
@ -111,12 +111,11 @@ public:
// size of WM decorations
wxSize m_decorSize;
// shape of the frame
wxRegion m_shape;
// private gtk_timeout_add result for mimicing wxUSER_ATTENTION_INFO and
// wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
int m_urgency_hint;
// timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling
unsigned m_netFrameExtentsTimerId;
// return the size of the window without WM decorations
void GTKDoGetSize(int *width, int *height) const;

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/treeentry_gtk.h
// Purpose: GtkTreeEntry - a string/userdata combo for use with treeview
// Author: Ryan Norton
// Id: $Id: treeentry_gtk.h 67254 2011-03-20 00:14:35Z DS $
// Id: $Id: treeentry_gtk.h 67326 2011-03-28 06:27:49Z PC $
// Copyright: (c) 2006 Ryan Norton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////// */
@ -19,9 +19,9 @@ extern "C" {
#include "wx/dlimpexp.h"
#define GTK_TYPE_TREE_ENTRY (gtk_tree_entry_get_type())
#define GTK_TREE_ENTRY(obj) (GTK_CHECK_CAST (obj, gtk_tree_entry_get_type (), GtkTreeEntry))
#define GTK_TREE_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, gtk_tree_entry_get_type (), GtkTreeEntryClass))
#define GTK_IS_TREE_ENTRY(obj) (GTK_CHECK_TYPE (obj, gtk_tree_entry_get_type ()))
#define GTK_TREE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, gtk_tree_entry_get_type (), GtkTreeEntry))
#define GTK_TREE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, gtk_tree_entry_get_type (), GtkTreeEntryClass))
#define GTK_IS_TREE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, gtk_tree_entry_get_type ()))
typedef struct _GtkTreeEntry GtkTreeEntry;
typedef struct _GtkTreeEntryClass GtkTreeEntryClass;
@ -47,7 +47,7 @@ WXDLLIMPEXP_CORE
GtkTreeEntry* gtk_tree_entry_new (void);
WXDLLIMPEXP_CORE
GtkType gtk_tree_entry_get_type (void);
GType gtk_tree_entry_get_type (void);
WXDLLIMPEXP_CORE
gchar* gtk_tree_entry_get_collate_key (GtkTreeEntry* entry);

View File

@ -0,0 +1,156 @@
/////////////////////////////////////////////////////////////////////////////
// Name: include/gtk/wx/webview.h
// Purpose: GTK webkit backend for web view component
// Author: Robert Roebling, Marianne Gagnon
// Id: $Id: webview_webkit.h 70768 2012-03-01 16:44:31Z PC $
// Copyright: (c) 2010 Marianne Gagnon, 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_WEBKITCTRL_H_
#define _WX_GTK_WEBKITCTRL_H_
#include "wx/setup.h"
#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
#include "wx/sharedptr.h"
#include "wx/webview.h"
typedef struct _WebKitWebView WebKitWebView;
//-----------------------------------------------------------------------------
// wxWebViewWebKit
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView
{
public:
wxWebViewWebKit() { Init(); }
wxWebViewWebKit(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr)
{
Init();
Create(parent, id, url, pos, size, style, name);
}
virtual bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr);
virtual bool Enable( bool enable = true );
// implementation
// --------------
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
virtual void Stop();
virtual void LoadURL(const wxString& url);
virtual void GoBack();
virtual void GoForward();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual bool CanGoBack() const;
virtual bool CanGoForward() const;
virtual void ClearHistory();
virtual void EnableHistory(bool enable = true);
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item);
virtual wxString GetCurrentURL() const;
virtual wxString GetCurrentTitle() const;
virtual wxString GetPageSource() const;
virtual wxString GetPageText() const;
//We do not want to hide the other overloads
using wxWebView::SetPage;
virtual void SetPage(const wxString& html, const wxString& baseUrl);
virtual void Print();
virtual bool IsBusy() const;
void SetZoomType(wxWebViewZoomType);
wxWebViewZoomType GetZoomType() const;
bool CanSetZoomType(wxWebViewZoomType) const;
virtual wxWebViewZoom GetZoom() const;
virtual void SetZoom(wxWebViewZoom);
//Clipboard functions
virtual bool CanCut() const;
virtual bool CanCopy() const;
virtual bool CanPaste() const;
virtual void Cut();
virtual void Copy();
virtual void Paste();
//Undo / redo functionality
virtual bool CanUndo() const;
virtual bool CanRedo() const;
virtual void Undo();
virtual void Redo();
//Editing functions
virtual void SetEditable(bool enable = true);
virtual bool IsEditable() const;
//Selection
virtual void DeleteSelection();
virtual bool HasSelection() const;
virtual void SelectAll();
virtual wxString GetSelectedText() const;
virtual wxString GetSelectedSource() const;
virtual void ClearSelection();
virtual void RunScript(const wxString& javascript);
//Virtual Filesystem Support
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
virtual wxVector<wxSharedPtr<wxWebViewHandler> > GetHandlers() { return m_handlerList; }
/** TODO: check if this can be made private
* The native control has a getter to check for busy state, but except in
* very recent versions of webkit this getter doesn't say everything we need
* (namely it seems to stay indefinitely busy when loading is cancelled by
* user)
*/
bool m_busy;
wxString m_vfsurl;
//We use this flag to stop recursion when we load a page from the navigation
//callback, mainly when loading a VFS page
bool m_guard;
protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
private:
void ZoomIn();
void ZoomOut();
void SetWebkitZoom(float level);
float GetWebkitZoom() const;
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
WebKitWebView *m_web_view;
int m_historyLimit;
wxVector<wxSharedPtr<wxWebViewHandler> > m_handlerList;
wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit);
};
#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
#endif

View File

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/gtk/webviewhistoryitem.h
// Purpose: wxWebViewHistoryItem header for GTK
// Author: Steven Lamerton
// Id: $Id: webviewhistoryitem_webkit.h 69770 2011-11-17 01:23:03Z RD $
// Copyright: (c) 2011 Steven Lamerton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_WEBVIEWHISTORYITEM_H_
#define _WX_GTK_WEBVIEWHISTORYITEM_H_
#include "wx/setup.h"
#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
class WXDLLIMPEXP_WEBVIEW wxWebViewHistoryItem
{
public:
wxWebViewHistoryItem(const wxString& url, const wxString& title) :
m_url(url), m_title(title) {}
wxString GetUrl() { return m_url; }
wxString GetTitle() { return m_title; }
friend class wxWebViewWebKit;
private:
wxString m_url, m_title;
void* m_histItem;
};
#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
#endif // _WX_GTK_WEBVIEWHISTORYITEM_H_

View File

@ -2,7 +2,7 @@
// Name: wx/gtk/window.h
// Purpose:
// Author: Robert Roebling
// Id: $Id: window.h 65680 2010-09-30 11:44:45Z VZ $
// Id: $Id: window.h 70569 2012-02-11 16:26:52Z VZ $
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -18,6 +18,13 @@ struct wxGtkIMData;
WX_DEFINE_EXPORTED_ARRAY_PTR(GdkWindow *, wxArrayGdkWindows);
extern "C"
{
typedef void (*wxGTKCallback)();
}
//-----------------------------------------------------------------------------
// wxWindowGTK
//-----------------------------------------------------------------------------
@ -52,8 +59,6 @@ public:
virtual bool Show( bool show = true );
virtual void SetWindowStyleFlag( long style );
virtual bool IsRetained() const;
virtual void SetFocus();
@ -76,6 +81,7 @@ public:
virtual bool SetFont( const wxFont &font );
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const;
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
@ -187,6 +193,10 @@ public:
void GTKHandleFocusOutNoDeferring();
static void GTKHandleDeferredFocusOut();
// Called when m_widget becomes realized. Derived classes must call the
// base class method if they override it.
virtual void GTKHandleRealized();
protected:
// for controls composed of multiple GTK widgets, return true to eliminate
// spurious focus events if the focus changes between GTK+ children within
@ -218,7 +228,7 @@ public:
#if wxUSE_TOOLTIPS
// applies tooltip to the widget (tip must be UTF-8 encoded)
virtual void GTKApplyToolTip( GtkTooltips *tips, const gchar *tip );
virtual void GTKApplyToolTip(const char* tip);
#endif // wxUSE_TOOLTIPS
// Called when a window should delay showing itself
@ -370,7 +380,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, wxGTKCallback 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
@ -390,7 +400,6 @@ private:
bool DoScrollByUnits(ScrollDir dir, ScrollUnit unit, int units);
virtual void AddChildGTK(wxWindowGTK* child);
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
wxDECLARE_NO_COPY_CLASS(wxWindowGTK);
};