Merge wxQT branch into the trunk.

This merges in the latest sources from GSoC 2014 wxQt project with just a few
minor corrections, mostly undoing wrong changes to common files in that branch
(results of a previous bad merge?) and getting rid of whitespace-only changes.
Also remove debug logging from wxGrid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-08-24 01:50:11 +00:00
parent d513d3e2f0
commit df13791078
381 changed files with 24333 additions and 938 deletions

View File

@@ -164,6 +164,8 @@ private:
#include "wx/gtk1/accel.h"
#elif defined(__WXMAC__)
#include "wx/osx/accel.h"
#elif defined(__WXQT__)
#include "wx/qt/accel.h"
#endif
extern WXDLLIMPEXP_DATA_CORE(wxAcceleratorTable) wxNullAcceleratorTable;

View File

@@ -12,6 +12,11 @@
#ifndef _WX_ANDROID_CHKCONF_H_
#define _WX_ANDROID_CHKCONF_H_
// For Qt under Android, use default configuration procedure as most features
// should be supported (see documentation for more information)
#ifndef __WXQT__
// ----------------------------------------------------------------------------
// Disable features which don't work (yet) or don't make sense under Android.
// ----------------------------------------------------------------------------
@@ -226,5 +231,6 @@
#undef wxUSE_PRINTING_ARCHITECTURE
#define wxUSE_PRINTING_ARCHITECTURE 0
#endif // __WXQT__
#endif // _WX_ANDROID_CHKCONF_H_

View File

@@ -13,6 +13,12 @@
// 'fine-tuned' on a trial-and-error basis. This means, no in-depth analysis
// of Android docs / source was done.
// For Qt under Android, use the default configuration procedure as most
// features should be supported and the following fixed definitions will
// cause compiler warnings or other issues.
#if !defined(__WXQT__)
#define wxUSE_UNIX 1
#define __UNIX__ 1
@@ -53,3 +59,5 @@
// Android doesn't support pthread_cancel().
#undef HAVE_PTHREAD_CANCEL
#endif
#endif

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/univ/setup.h
// Purpose: Configuration for the universal build of the library
// Name: wx/android/setup.h
// Purpose: Configuration for the android build of the library
// Author: Julian Smart
// Created: 01/02/97
// Copyright: (c) Julian Smart

View File

@@ -186,6 +186,8 @@ protected:
// #include "wx/gtk1/anybutton.h"
#elif defined(__WXMAC__)
#include "wx/osx/anybutton.h"
#elif defined(__WXQT__)
#include "wx/qt/anybutton.h"
#else
typedef wxAnyButtonBase wxAnyButton;
#endif

View File

@@ -706,6 +706,8 @@ protected:
#include "wx/x11/app.h"
#elif defined(__WXMAC__)
#include "wx/osx/app.h"
#elif defined(__WXQT__)
#include "wx/qt/app.h"
#endif
#else // !GUI

View File

@@ -72,7 +72,8 @@ protected:
defined(__WXMAC__) || \
defined(__WXGTK__) || \
defined(__WXMOTIF__) || \
defined(__WXX11__)
defined(__WXX11__) || \
defined(__WXQT__)
#define wxUSE_BITMAP_BASE 1
#else
#define wxUSE_BITMAP_BASE 0
@@ -286,6 +287,9 @@ protected:
#elif defined(__WXMAC__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_PICT_RESOURCE
#include "wx/osx/bitmap.h"
#elif defined(__WXQT__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/qt/bitmap.h"
#endif
#if wxUSE_IMAGE

View File

@@ -20,7 +20,7 @@
// FIXME: right now only wxMSW, wxGTK and wxOSX implement bitmap support in wxButton
// itself, this shouldn't be used for the other platforms neither
// when all of them do it
#if (defined(__WXMSW__) || defined(__WXGTK20__) || defined(__WXOSX__)) && !defined(__WXUNIVERSAL__)
#if (defined(__WXMSW__) || defined(__WXGTK20__) || defined(__WXOSX__) || defined(__WXQT__)) && !defined(__WXUNIVERSAL__)
#define wxHAS_BUTTON_BITMAP
#endif
@@ -123,6 +123,8 @@ protected:
#include "wx/gtk1/bmpbuttn.h"
#elif defined(__WXMAC__)
#include "wx/osx/bmpbuttn.h"
#elif defined(__WXQT__)
#include "wx/qt/bmpbuttn.h"
#endif
#endif // wxUSE_BMPBUTTON

View File

@@ -81,6 +81,8 @@ public:
#include "wx/dfb/brush.h"
#elif defined(__WXMAC__)
#include "wx/osx/brush.h"
#elif defined(__WXQT__)
#include "wx/qt/brush.h"
#endif
class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase

View File

@@ -58,6 +58,8 @@ protected:
#include "wx/gtk1/button.h"
#elif defined(__WXMAC__)
#include "wx/osx/button.h"
#elif defined(__WXQT__)
#include "wx/qt/button.h"
#endif
#endif // wxUSE_BUTTON

View File

@@ -348,6 +348,9 @@ protected:
#elif defined(__WXMSW__)
#define wxHAS_NATIVE_CALENDARCTRL
#include "wx/msw/calctrl.h"
#elif defined(__WXQT__)
#define wxHAS_NATIVE_CALENDARCTRL
#include "wx/qt/calctrl.h"
#endif
#endif // !__WXUNIVERSAL__

View File

@@ -67,6 +67,23 @@
}
#endif /* Cygwin and C++ */
/* the current (as of Mar 2014) version of Android (up to api level 19) */
/* doesn't include some declarations (wscdup, wcslen, wcscasecmp, etc.) */
/* (moved out from __CYGWIN__ block) */
#if defined(__WXQT__) && !defined(wcsdup) && defined(__ANDROID__)
#ifdef __cplusplus
extern "C" {
#endif
extern wchar_t *wcsdup(const wchar_t *);
extern size_t wcslen (const wchar_t *);
extern size_t wcsnlen (const wchar_t *, size_t );
extern int wcscasecmp (const wchar_t *, const wchar_t *);
extern int wcsncasecmp (const wchar_t *, const wchar_t *, size_t);
#ifdef __cplusplus
}
#endif
#endif /* Android */
#elif defined(HAVE_WCSTR_H)
/* old compilers have relevant declarations here */
#include <wcstr.h>

View File

@@ -178,6 +178,8 @@ private:
#include "wx/gtk1/checkbox.h"
#elif defined(__WXMAC__)
#include "wx/osx/checkbox.h"
#elif defined(__WXQT__)
#include "wx/qt/checkbox.h"
#endif
#endif // wxUSE_CHECKBOX

View File

@@ -55,6 +55,8 @@ public:
#include "wx/gtk1/checklst.h"
#elif defined(__WXMAC__)
#include "wx/osx/checklst.h"
#elif defined(__WXQT__)
#include "wx/qt/checklst.h"
#endif
#endif // wxUSE_CHECKLISTBOX

View File

@@ -86,6 +86,8 @@ private:
#include "wx/gtk1/choice.h"
#elif defined(__WXMAC__)
#include "wx/osx/choice.h"
#elif defined(__WXQT__)
#include "wx/qt/choice.h"
#endif
#endif // wxUSE_CHOICE

View File

@@ -161,6 +161,8 @@ typedef void (wxEvtHandler::*wxClipboardEventFunction)(wxClipboardEvent&);
#include "wx/x11/clipbrd.h"
#elif defined(__WXMAC__)
#include "wx/osx/clipbrd.h"
#elif defined(__WXQT__)
#include "wx/qt/clipbrd.h"
#endif
// ----------------------------------------------------------------------------

View File

@@ -79,6 +79,8 @@ protected:
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/clrpicker.h"
#define wxColourPickerWidget wxColourButton
#elif defined(__WXQT__) && !defined(__WXUNIVERSAL__)
#include "wx/qt/clrpicker.h"
#else
#include "wx/generic/clrpickerg.h"
#define wxColourPickerWidget wxGenericColourButton

View File

@@ -23,6 +23,8 @@
#include "wx/osx/colordlg.h"
#elif defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/colordlg.h"
#elif defined(__WXQT__)
#include "wx/qt/colordlg.h"
#else
#include "wx/generic/colrdlgg.h"

View File

@@ -219,6 +219,8 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxColourBase* col);
#include "wx/x11/colour.h"
#elif defined(__WXMAC__)
#include "wx/osx/colour.h"
#elif defined(__WXQT__)
#include "wx/qt/colour.h"
#endif
#define wxColor wxColour

View File

@@ -81,6 +81,8 @@ public:
#include "wx/gtk1/combobox.h"
#elif defined(__WXMAC__)
#include "wx/osx/combobox.h"
#elif defined(__WXQT__)
#include "wx/qt/combobox.h"
#endif
#endif // wxUSE_COMBOBOX

View File

@@ -236,6 +236,8 @@ protected:
#include "wx/gtk1/control.h"
#elif defined(__WXMAC__)
#include "wx/osx/control.h"
#elif defined(__WXQT__)
#include "wx/qt/control.h"
#endif
#endif // wxUSE_CONTROLS

View File

@@ -462,6 +462,8 @@ private:
#include "wx/msw/ctrlsub.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/ctrlsub.h"
#elif defined(__WXQT__)
#include "wx/qt/ctrlsub.h"
#else
class WXDLLIMPEXP_CORE wxControlWithItems : public wxControlWithItemsBase
{

View File

@@ -58,6 +58,9 @@ public:
#elif defined(__WXMAC__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_MACCURSOR_RESOURCE
#include "wx/osx/cursor.h"
#elif defined(__WXQT__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR
#include "wx/qt/cursor.h"
#endif
#include "wx/utils.h"

View File

@@ -83,6 +83,8 @@ public:
#include "wx/x11/dataform.h"
#elif defined(__WXMAC__)
#include "wx/osx/dataform.h"
#elif defined(__WXQT__)
#include "wx/qt/dataform.h"
#endif
// the value for default argument to some functions (corresponds to
@@ -167,6 +169,8 @@ public:
#include "wx/gtk1/dataobj.h"
#elif defined(__WXMAC__)
#include "wx/osx/dataobj.h"
#elif defined(__WXQT__)
#include "wx/qt/dataobj.h"
#endif
// ----------------------------------------------------------------------------
@@ -556,6 +560,8 @@ private:
#include "wx/motif/dataobj2.h"
#elif defined(__WXMAC__)
#include "wx/osx/dataobj2.h"
#elif defined(__WXQT__)
#include "wx/qt/dataobj2.h"
#endif
// wxURLDataObject is simply wxTextDataObject with a different name

View File

@@ -29,7 +29,7 @@
class WXDLLIMPEXP_FWD_CORE wxImageList;
#if !(defined(__WXGTK20__) || defined(__WXOSX__)) || defined(__WXUNIVERSAL__)
#if !(defined(__WXGTK20__) || defined(__WXOSX__) ) || defined(__WXUNIVERSAL__)
// #if !(defined(__WXOSX__)) || defined(__WXUNIVERSAL__)
#define wxHAS_GENERIC_DATAVIEWCTRL
#endif
@@ -948,6 +948,8 @@ typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
#include "wx/gtk/dataview.h"
#elif defined(__WXMAC__)
#include "wx/osx/dataview.h"
#elif defined(__WXQT__)
#include "wx/qt/dataview.h"
#else
#error "unknown native wxDataViewCtrl implementation"
#endif

View File

@@ -17,7 +17,7 @@
// Split platforms into two groups - those which have well-working
// double-buffering by default, and those which do not.
#if defined(__WXMAC__) || defined(__WXGTK20__) || defined(__WXDFB__)
#if defined(__WXMAC__) || defined(__WXGTK20__) || defined(__WXDFB__) || defined(__WXQT__)
#define wxALWAYS_NATIVE_DOUBLE_BUFFER 1
#else
#define wxALWAYS_NATIVE_DOUBLE_BUFFER 0

View File

@@ -32,6 +32,7 @@
!defined(__X__) && \
!defined(__WXDFB__) && \
!defined(__WXX11__) && \
!defined(__WXQT__) && \
wxUSE_GUI
# ifdef __UNIX__
# error "No Target! You should use wx-config program for compilation flags!"
@@ -3303,6 +3304,10 @@ typedef struct _PangoFontDescription PangoFontDescription;
typedef const void* WXWidget;
#endif /* DFB */
#ifdef __WXQT__
#include "wx/qt/defs.h"
#endif
/* This is required because of clashing macros in windows.h, which may be */
/* included before or after wxWidgets classes, and therefore must be */
/* disabled here before any significant wxWidgets headers are included. */

View File

@@ -360,6 +360,8 @@ public:
#include "wx/gtk1/dialog.h"
#elif defined(__WXMAC__)
#include "wx/osx/dialog.h"
#elif defined(__WXQT__)
#include "wx/qt/dialog.h"
#endif
#endif

View File

@@ -107,6 +107,8 @@ protected:
defined(__WXX11__)
#include "wx/generic/dirdlgg.h" // Other ports use generic implementation
#define wxDirDialog wxGenericDirDialog
#elif defined(__WXQT__)
#include "wx/qt/dirdlg.h"
#endif
// ----------------------------------------------------------------------------

View File

@@ -222,6 +222,8 @@ protected:
#include "wx/gtk1/dnd.h"
#elif defined(__WXMAC__)
#include "wx/osx/dnd.h"
#elif defined(__WXQT__)
#include "wx/qt/dnd.h"
#endif
// ----------------------------------------------------------------------------

View File

@@ -41,6 +41,10 @@ class WXDLLIMPEXP_FWD_CORE wxDC;
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
#elif defined(__WXQT__)
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
#endif
#endif // wxUSE_DRAGIMAGE

View File

@@ -208,6 +208,8 @@ protected:
#include "wx/gtk/dvrenderer.h"
#elif defined(__WXMAC__)
#include "wx/osx/dvrenderer.h"
#elif defined(__WXQT__)
#include "wx/qt/dvrenderer.h"
#else
#error "unknown native wxDataViewCtrl implementation"
#endif
@@ -332,6 +334,8 @@ private:
#include "wx/gtk/dvrenderers.h"
#elif defined(__WXMAC__)
#include "wx/osx/dvrenderers.h"
#elif defined(__WXQT__)
#include "wx/qt/dvrenderers.h"
#else
#error "unknown native wxDataViewCtrl implementation"
#endif

View File

@@ -37,7 +37,8 @@ struct WXDLLIMPEXP_CORE wxNativeEncodingInfo
wxFontEncoding encoding; // so that we know what this struct represents
#if defined(__WXMSW__) || \
defined(__WXMAC__)
defined(__WXMAC__) || \
defined(__WXQT__)
wxNativeEncodingInfo()
: facename()

View File

@@ -296,6 +296,8 @@ private:
#include "wx/dfb/evtloop.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/evtloop.h"
#elif defined(__WXQT__)
#include "wx/qt/evtloop.h"
#else // other platform
#include "wx/stopwatch.h" // for wxMilliClock_t

View File

@@ -12,7 +12,6 @@
// Include the header to get wxUSE_EVENTLOOP_SOURCE definition from it.
#include "wx/evtloop.h"
// ----------------------------------------------------------------------------
// wxEventLoopSource: a source of events which may be added to wxEventLoop
// ----------------------------------------------------------------------------
@@ -95,6 +94,8 @@ inline wxEventLoopSource::~wxEventLoopSource() { }
#if defined(__DARWIN__)
#include "wx/osx/evtloopsrc.h"
#elif defined(__WXQT__)
#include "wx/unix/evtloopsrc.h"
#endif
#endif // wxUSE_EVENTLOOP_SOURCE

View File

@@ -34,7 +34,7 @@
/* taskbar is implemented in the major ports */
#if defined(__WXMSW__) \
|| defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__) \
|| defined(__WXOSX_MAC__)
|| defined(__WXOSX_MAC__) || defined(__WXQT__)
#define wxHAS_TASK_BAR_ICON
#else
#undef wxUSE_TASKBARICON
@@ -69,7 +69,7 @@
/* This is defined when the underlying toolkit handles tab traversal natively.
Otherwise we implement it ourselves in wxControlContainer. */
#ifdef __WXGTK20__
#if defined(__WXGTK20__) || defined(__WXQT__)
#define wxHAS_NATIVE_TAB_TRAVERSAL
#endif
@@ -85,7 +85,7 @@
/* Direct access to bitmap data is not implemented in all ports yet */
#if defined(__WXGTK20__) || defined(__WXMAC__) || defined(__WXDFB__) || \
defined(__WXMSW__)
defined(__WXMSW__) || defined(__WXQT__)
/*
HP aCC for PA-RISC can't deal with templates in wx/rawbmp.h.

View File

@@ -218,6 +218,8 @@ wxSaveFileSelector(const wxString& what,
#include "wx/gtk1/filedlg.h"
#elif defined(__WXMAC__)
#include "wx/osx/filedlg.h"
#elif defined(__WXQT__)
#include "wx/qt/filedlg.h"
#endif
#endif // wxUSE_FILEDLG

View File

@@ -530,6 +530,8 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
#include "wx/dfb/font.h"
#elif defined(__WXMAC__)
#include "wx/osx/font.h"
#elif defined(__WXQT__)
#include "wx/qt/font.h"
#endif
class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase

View File

@@ -78,6 +78,8 @@ protected:
#include "wx/gtk1/fontdlg.h"
#elif defined(__WXMAC__)
#include "wx/osx/fontdlg.h"
#elif defined(__WXQT__)
#include "wx/qt/fontdlg.h"
#endif
// ----------------------------------------------------------------------------

View File

@@ -264,6 +264,8 @@ protected:
#include "wx/motif/frame.h"
#elif defined(__WXMAC__)
#include "wx/osx/frame.h"
#elif defined(__WXQT__)
#include "wx/qt/frame.h"
#endif
#endif

View File

@@ -26,6 +26,8 @@
// Win32 only, is default (and only) on some other platforms
#define wxGA_SMOOTH 0x0020
// QT only, display current completed percentage (text default format "%p%")
#define wxGA_TEXT 0x0040
// GTK and Mac always have native implementation of the indeterminate mode
// wxMSW has native implementation only if comctl32.dll >= 6.00
@@ -109,6 +111,8 @@ protected:
#include "wx/gtk1/gauge.h"
#elif defined(__WXMAC__)
#include "wx/osx/gauge.h"
#elif defined(__WXQT__)
#include "wx/qt/gauge.h"
#endif
#endif // wxUSE_GAUGE

View File

@@ -191,6 +191,9 @@ enum wxStockCursor
#elif defined(__WXX11__)
// Initialize from an included XPM
#define wxICON(X) wxIcon( X##_xpm )
#elif defined(__WXQT__)
// Initialize from an included XPM
#define wxICON(X) wxIcon( X##_xpm )
#else
// This will usually mean something on any platform
#define wxICON(X) wxIcon(wxT(#X))

View File

@@ -197,6 +197,8 @@ public:
#include "wx/gtk1/glcanvas.h"
#elif defined(__WXMAC__)
#include "wx/osx/glcanvas.h"
#elif defined(__WXQT__)
#include "wx/qt/glcanvas.h"
#else
#error "wxGLCanvas not supported in this wxWidgets port"
#endif

View File

@@ -52,6 +52,9 @@
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_PNG_RESOURCE
#include "wx/generic/icon.h"
#endif
#elif defined(__WXQT__)
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/generic/icon.h"
#endif
//-----------------------------------------------------------------------------

View File

@@ -27,6 +27,8 @@
#include "wx/osx/core/joystick.h"
#elif defined(__WXMAC__)
#include "wx/osx/joystick.h"
#elif defined(__WXQT__)
#include "wx/unix/joystick.h"
#endif
#endif // wxUSE_JOYSTICK

View File

@@ -153,6 +153,8 @@ private:
#include "wx/gtk1/listbox.h"
#elif defined(__WXMAC__)
#include "wx/osx/listbox.h"
#elif defined(__WXQT__)
#include "wx/qt/listbox.h"
#endif
#endif // wxUSE_LISTBOX

View File

@@ -31,6 +31,8 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxListCtrlNameStr[];
#include "wx/msw/listctrl.h"
#elif defined(__WXMAC__) && !defined(__WXUNIVERSAL__) && wxOSX_USE_CARBON
#include "wx/osx/listctrl.h"
#elif defined(__WXQT__) && !defined(__WXUNIVERSAL__)
#include "wx/qt/listctrl.h"
#else
#include "wx/generic/listctrl.h"
#endif

View File

@@ -366,6 +366,8 @@ public:
#include "wx/gtk1/mdi.h"
#elif defined(__WXMAC__)
#include "wx/osx/mdi.h"
#elif defined(__WXQT__)
#include "wx/qt/mdi.h"
#endif
inline wxMDIClientWindow *wxMDIParentFrameBase::OnCreateClient()

View File

@@ -589,6 +589,8 @@ protected:
#include "wx/gtk1/menu.h"
#elif defined(__WXMAC__)
#include "wx/osx/menu.h"
#elif defined(__WXQT__)
#include "wx/qt/menu.h"
#endif
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY

View File

@@ -204,6 +204,8 @@ inline void wxMenuItemBase::SetText(const wxString& text) { SetItemLabel(text);
#include "wx/gtk1/menuitem.h"
#elif defined(__WXMAC__)
#include "wx/osx/menuitem.h"
#elif defined(__WXQT__)
#include "wx/qt/menuitem.h"
#endif
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY

View File

@@ -5,7 +5,7 @@
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
// Copyright: (c) 2014 wxWidgets dev team
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MINIFRAM_H_BASE_
@@ -27,6 +27,8 @@
#include "wx/x11/minifram.h"
#elif defined(__WXMAC__)
#include "wx/osx/minifram.h"
#elif defined(__WXQT__)
#include "wx/qt/minifram.h"
#else
// TODO: it seems that wxMiniFrame could be just defined here generically
// instead of having all the above port-specific headers

View File

@@ -185,7 +185,6 @@ public:
DoSetCustomLabel(m_help, help);
return true;
}
// test if any custom labels were set
bool HasCustomLabels() const
{
@@ -300,6 +299,8 @@ private:
#include "wx/gtk/msgdlg.h"
#elif defined(__WXMAC__)
#include "wx/osx/msgdlg.h"
#elif defined(__WXQT__)
#include "wx/qt/msgdlg.h"
#endif
// ----------------------------------------------------------------------------

View File

@@ -193,6 +193,8 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_NOTEBOOK_PAGE_CHANGING, wxBook
#include "wx/gtk1/notebook.h"
#elif defined(__WXMAC__)
#include "wx/osx/notebook.h"
#elif defined(__WXQT__)
#include "wx/qt/notebook.h"
#endif
// old wxEVT_COMMAND_* constants

View File

@@ -35,6 +35,8 @@ public:
#include "wx/generic/paletteg.h"
#elif defined(__WXMAC__)
#include "wx/osx/palette.h"
#elif defined(__WXQT__)
#include "wx/qt/palette.h"
#endif
#endif // wxUSE_PALETTE

View File

@@ -109,6 +109,8 @@ public:
#include "wx/dfb/pen.h"
#elif defined(__WXMAC__)
#include "wx/osx/pen.h"
#elif defined(__WXQT__)
#include "wx/qt/pen.h"
#endif
class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase

View File

@@ -78,7 +78,8 @@ enum wxPortId
wxPORT_MAC = 1 << 7, // wxOSX (former wxMac), using Cocoa, Carbon or iPhone API
wxPORT_OSX = wxPORT_MAC, // wxOSX, using Cocoa, Carbon or iPhone API
wxPORT_COCOA = 1 << 8, // wxCocoa, using Cocoa NextStep/Mac API
wxPORT_WINCE = 1 << 9 // wxWinCE, toolkit is WinCE SDK API
wxPORT_WINCE = 1 << 9, // wxWinCE, toolkit is WinCE SDK API
wxPORT_QT = 1 << 10 // wxQT, using QT4
};
// architecture of the operating system
@@ -348,4 +349,6 @@ protected:
wxEndianness m_endian;
};
#endif // _WX_PLATINFO_H_

View File

@@ -65,6 +65,8 @@ public:
#include "wx/dfb/popupwin.h"
#elif defined(__WXMAC__)
#include "wx/osx/popupwin.h"
#elif defined(__WXQT__)
#include "wx/qt/popupwin.h"
#else
#error "wxPopupWindow is not supported under this platform."
#endif

View File

@@ -23,6 +23,10 @@
#include "wx/osx/printmac.h"
#elif defined(__WXQT__)
#include "wx/qt/printqt.h"
#else
#include "wx/generic/printps.h"

62
include/wx/qt/accel.h Normal file
View File

@@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/accel.h
// Purpose: wxAcceleratorTable class
// Author: Peter Most, Javier Torres
// Modified by:
// Created: 09/08/09
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_ACCEL_H_
#define _WX_QT_ACCEL_H_
#include <QtCore/QList>
#include <QtWidgets/QShortcut>
/* wxQt accelerators implementation:
*
* Storing:
* QShortcuts are stored in wxWindow (m_qtShortcuts) to allow to delete them
* when the accelerator table is changed, and also because we need to specify
* a not-null parent from them, which is unknown at the moment of creating the
* accelerator table. So, the accelerator table only contains a list of
* wxAcceleratorEntries, which are converted to a list of QShortcuts when
* the table is fixed to a wxWindow.
*
* Passing keypresses to accelerators:
* The accelerators are implemented using QShortcut's. As there is no easy way
* to call them, we must pass all keypress events through the QApplication
* notify() function (which is the one that checks if the keypress match any
* shortcut.
*
* Executing commands when a QShortcut is triggered:
* Each QShortcut has a property ("wxQt_Command") set with the number of the
* wx command it is associated to. Then, its activated() signal is connected to
* a small handler (wxQtShortcutHandler in window_qt.h) which calls the main
* handler (wxWindow::QtHandleShortcut) passing the command extracted from the
* QShortcut. This handler will finally create and send the appropriate wx
* event to the window. */
class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
{
public:
wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
// Implementation
QList< QShortcut* > ConvertShortcutTable( QWidget *parent ) const;
bool Ok() const { return IsOk(); }
bool IsOk() const;
protected:
// ref counting code
virtual wxObjectRefData *CreateRefData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
private:
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
};
#endif // _WX_QT_ACCEL_H_

47
include/wx/qt/anybutton.h Normal file
View File

@@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/anybutton.h
// Purpose: wxQT wxAnyButton class declaration
// Author: Mariano Reingart
// Copyright: (c) 2014 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_ANYBUTTON_H_
#define _WX_QT_ANYBUTTON_H_
#include <QtWidgets/QPushButton>
//-----------------------------------------------------------------------------
// wxAnyButton
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton()
{
}
// implementation
// --------------
virtual void SetLabel( const wxString &label );
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
virtual QPushButton *GetHandle() const;
protected:
QPushButton *m_qtPushButton;
void QtCreate(wxWindow *parent);
void QtSetBitmap( const wxBitmap &bitmap );
private:
typedef wxAnyButtonBase base_type;
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
};
#endif // _WX_QT_ANYBUTTON_H_

32
include/wx/qt/app.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose: wxApp class
// Author: Peter Most
// Modified by:
// Created: 08/08/09
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_APP_H_
#define _WX_QT_APP_H_
#include <QtWidgets/QApplication>
class WXDLLIMPEXP_CORE wxApp : public wxAppBase
{
public:
wxApp();
~wxApp();
virtual bool Initialize(int& argc, wxChar **argv);
private:
QApplication *m_qtApplication;
int m_qtArgc;
char **m_qtArgv;
wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxApp );
};
#endif // _WX_QT_APP_H_

122
include/wx/qt/bitmap.h Normal file
View File

@@ -0,0 +1,122 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/bitmap.h
// Author: Peter Most
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BITMAP_H_
#define _WX_QT_BITMAP_H_
class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
class WXDLLIMPEXP_FWD_CORE wxImage;
class QImage;
class QPixmap;
class QBitmap;
class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
{
public:
wxBitmap();
wxBitmap(QPixmap pix);
wxBitmap(const wxBitmap& bmp);
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
wxBitmap(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH);
wxBitmap(const char* const* bits);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH);
static void InitStandardHandlers();
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH);
virtual bool Create(int width, int height, const wxDC& WXUNUSED(dc));
virtual int GetHeight() const;
virtual int GetWidth() const;
virtual int GetDepth() const;
#if wxUSE_IMAGE
virtual wxImage ConvertToImage() const;
#endif // wxUSE_IMAGE
virtual wxMask *GetMask() const;
virtual void SetMask(wxMask *mask);
virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = NULL) const;
virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
#if wxUSE_PALETTE
virtual wxPalette *GetPalette() const;
virtual void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
// copies the contents and mask of the given (colour) icon to the bitmap
virtual bool CopyFromIcon(const wxIcon& icon);
// implementation:
virtual void SetHeight(int height);
virtual void SetWidth(int width);
virtual void SetDepth(int depth);
void *GetRawData(wxPixelDataBase& data, int bpp);
void UngetRawData(wxPixelDataBase& data);
// these functions are internal and shouldn't be used, they risk to
// disappear in the future
bool HasAlpha() const;
QPixmap *GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
DECLARE_DYNAMIC_CLASS(wxBitmap)
};
class WXDLLIMPEXP_CORE wxMask : public wxObject
{
public:
wxMask();
// Copy constructor
wxMask(const wxMask &mask);
// Construct a mask from a bitmap and a colour indicating the transparent
// area
wxMask(const wxBitmap& bitmap, const wxColour& colour);
// Construct a mask from a bitmap and a palette index indicating the
// transparent area
wxMask(const wxBitmap& bitmap, int paletteIndex);
// Construct a mask from a mono bitmap (copies the bitmap).
wxMask(const wxBitmap& bitmap);
virtual ~wxMask();
bool Create(const wxBitmap& bitmap, const wxColour& colour);
bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap);
wxBitmap GetBitmap() const;
// Implementation
QBitmap *GetHandle() const;
protected:
DECLARE_DYNAMIC_CLASS(wxMask)
private:
QBitmap *m_qtBitmap;
};
#endif // _WX_QT_BITMAP_H_

40
include/wx/qt/bmpbuttn.h Normal file
View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/bmpbuttn.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BMPBUTTN_H_
#define _WX_QT_BMPBUTTN_H_
class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
{
public:
wxBitmapButton();
wxBitmapButton(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
protected:
wxDECLARE_DYNAMIC_CLASS(wxBitmapButton);
private:
// We re-use wxButton
};
#endif // _WX_QT_BMPBUTTN_H_

48
include/wx/qt/brush.h Normal file
View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/brush.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BRUSH_H_
#define _WX_QT_BRUSH_H_
#include <QtCore/Qt>
class QBrush;
class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase
{
public:
wxBrush();
wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID);
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple);
virtual void SetColour(const wxColour& col);
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b);
virtual void SetStyle(wxBrushStyle style);
virtual void SetStipple(const wxBitmap& stipple);
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
virtual wxColour GetColour() const;
virtual wxBrushStyle GetStyle() const;
virtual wxBitmap *GetStipple() const;
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
void SetStyle(int style) { SetStyle((wxBrushStyle)style); }
QBrush GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
};
#endif // _WX_QT_BRUSH_H_

39
include/wx/qt/button.h Normal file
View File

@@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/button.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_BUTTON_H_
#define _WX_QT_BUTTON_H_
#include "wx/control.h"
#include "wx/button.h"
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
{
public:
wxButton();
wxButton(wxWindow *parent, wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
virtual wxWindow *SetDefault();
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton);
};
#endif // _WX_QT_BUTTON_H_

94
include/wx/qt/calctrl.h Normal file
View File

@@ -0,0 +1,94 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/calctrl.h
// Purpose: wxCalendarCtrl control implementation for wxQt
// Author: Kolya Kosenko
// Created: 2010-05-12
// Copyright: (C) 2010 Kolya Kosenko
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CALCTRL_H_
#define _WX_QT_CALCTRL_H_
#include "wx/calctrl.h"
#include <QtWidgets/QCalendarWidget>
class WXDLLIMPEXP_ADV wxCalendarCtrl : public wxCalendarCtrlBase
{
public:
wxCalendarCtrl() { Init(); }
wxCalendarCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr)
{
Init();
Create(parent, id, date, pos, size, style, name);
}
virtual ~wxCalendarCtrl();
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS,
const wxString& name = wxCalendarNameStr);
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);
// holidays colours
virtual void SetHoliday(size_t day);
virtual void SetHolidayColours(const wxColour& colFg, const wxColour& colBg);
virtual const wxColour& GetHolidayColourFg() const { return m_colHolidayFg; }
virtual const wxColour& GetHolidayColourBg() const { return m_colHolidayBg; }
// header colours
virtual void SetHeaderColours(const wxColour& colFg, const wxColour& colBg);
virtual const wxColour& GetHeaderColourFg() const { return m_colHeaderFg; }
virtual const wxColour& GetHeaderColourBg() const { return m_colHeaderBg; }
// day attributes
virtual wxCalendarDateAttr *GetAttr(size_t day) const;
virtual void SetAttr(size_t day, wxCalendarDateAttr *attr);
virtual void ResetAttr(size_t day) { SetAttr(day, NULL); }
virtual void SetWindowStyleFlag(long style);
using wxCalendarCtrlBase::GenerateAllChangeEvents;
virtual QCalendarWidget *GetHandle() const;
protected:
virtual void RefreshHolidays();
private:
void Init();
void UpdateStyle();
QCalendarWidget *m_qtCalendar;
wxColour m_colHeaderFg,
m_colHeaderBg,
m_colHolidayFg,
m_colHolidayBg;
wxCalendarDateAttr *m_attrs[31];
DECLARE_DYNAMIC_CLASS(wxCalendarCtrl)
};
#endif // _WX_QT_CALCTRL_H_

47
include/wx/qt/checkbox.h Normal file
View File

@@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/checkbox.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHECKBOX_H_
#define _WX_QT_CHECKBOX_H_
#include <QtWidgets/QCheckBox>
class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
{
public:
wxCheckBox();
wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr );
virtual void SetValue(bool value);
virtual bool GetValue() const;
virtual QCheckBox *GetHandle() const;
protected:
virtual void DoSet3StateValue(wxCheckBoxState state);
virtual wxCheckBoxState DoGet3StateValue() const;
private:
QCheckBox *m_qtCheckBox;
wxDECLARE_DYNAMIC_CLASS(wxCheckBox);
};
#endif // _WX_QT_CHECKBOX_H_

58
include/wx/qt/checklst.h Normal file
View File

@@ -0,0 +1,58 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/checklst.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHECKLST_H_
#define _WX_QT_CHECKLST_H_
class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
{
public:
wxCheckListBox();
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int nStrings = 0,
const wxString *choices = (const wxString *)NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxCheckListBox();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual bool IsChecked(unsigned int item) const;
virtual void Check(unsigned int item, bool check = true);
private:
virtual void Init(); //common construction
wxDECLARE_DYNAMIC_CLASS(wxCheckListBox);
};
#endif // _WX_QT_CHECKLST_H_

81
include/wx/qt/choice.h Normal file
View File

@@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/choice.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CHOICE_H_
#define _WX_QT_CHOICE_H_
#include <QtWidgets/QComboBox>
class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
{
public:
wxChoice();
wxChoice( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
wxChoice( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr );
virtual wxSize DoGetBestSize() const;
virtual unsigned int GetCount() const;
virtual wxString GetString(unsigned int n) const;
virtual void SetString(unsigned int n, const wxString& s);
virtual void SetSelection(int n);
virtual int GetSelection() const;
virtual QComboBox *GetHandle() const;
protected:
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData,
wxClientDataType type);
virtual int DoInsertOneItem(const wxString& item, unsigned int pos);
virtual void DoSetItemClientData(unsigned int n, void *clientData);
virtual void *DoGetItemClientData(unsigned int n) const;
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int pos);
QComboBox *m_qtComboBox;
private:
DECLARE_DYNAMIC_CLASS(wxChoice)
};
#endif // _WX_QT_CHOICE_H_

44
include/wx/qt/clipbrd.h Normal file
View File

@@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toolbar.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CLIPBRD_H_
#define _WX_QT_CLIPBRD_H_
#include "wx/weakref.h"
class QtClipBoardSignalHandler;
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
{
public:
wxClipboard();
~wxClipboard();
virtual bool Open();
virtual void Close();
virtual bool IsOpened() const;
virtual bool AddData( wxDataObject *data );
virtual bool SetData( wxDataObject *data );
virtual bool GetData( wxDataObject& data );
virtual void Clear();
virtual bool IsSupported( const wxDataFormat& format );
virtual bool IsSupportedAsync(wxEvtHandler *sink);
private:
friend class QtClipBoardSignalHandler;
int Mode();
QtClipBoardSignalHandler *m_SignalHandler;
wxEvtHandlerRef m_sink;
bool m_open;
DECLARE_DYNAMIC_CLASS(wxClipboard)
};
#endif // _WX_QT_CLIPBRD_H_

50
include/wx/qt/clrpicker.h Normal file
View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/clrpicker.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CLRPICKER_H_
#define _WX_QT_CLRPICKER_H_
#include "wx/generic/clrpickerg.h"
// TODO: A QtColorPicker is available from
// http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Widgets/qtcolorpicker/
// How to integrate into wxWidgets:
//
// class WXDLLIMPEXP_CORE wxColourPickerWidget : public wxButton, public wxColourPickerWidgetBase
// TODO: For now we reuse the existing wxGenericColourButton but this should be
// changed to use the above mentioned color picker.
class WXDLLIMPEXP_CORE wxColourPickerWidget : public wxGenericColourButton
{
public:
wxColourPickerWidget();
wxColourPickerWidget(wxWindow *parent,
wxWindowID id,
const wxColour& initial = *wxBLACK,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxColour& initial = *wxBLACK,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLRBTN_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerWidgetNameStr);
protected:
virtual void UpdateColour();
private:
};
#endif // _WX_QT_CLRPICKER_H_

33
include/wx/qt/colordlg.h Normal file
View File

@@ -0,0 +1,33 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/colordlg.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_COLORDLG_H_
#define _WX_QT_COLORDLG_H_
#include "wx/dialog.h"
#include <QtWidgets/QColorDialog>
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
{
public:
wxColourDialog() { }
wxColourDialog(wxWindow *parent,
wxColourData *data = NULL) { Create(parent, data); }
bool Create(wxWindow *parent, wxColourData *data = NULL);
wxColourData &GetColourData();
QColorDialog *GetHandle() const { return static_cast<QColorDialog *>(m_qtWindow); }
private:
wxColourData m_data;
};
#endif // _WX_QT_COLORDLG_H_

48
include/wx/qt/colour.h Normal file
View File

@@ -0,0 +1,48 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/colour.h
// Purpose: wxColour class implementation for wxQt
// Author: Peter Most, Kolya Kosenko
// Created: 2010-05-12
// Copyright: (C) 2010 Kolya Kosenko
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_COLOUR_H_
#define _WX_QT_COLOUR_H_
#include <QtGui/QColor>
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
{
public:
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
wxColour(const QColor& color) : m_qtColor(color) {}
virtual bool IsOk() const { return m_qtColor.isValid(); }
virtual ChannelType Red() const { return m_qtColor.red(); }
virtual ChannelType Green() const { return m_qtColor.green(); }
virtual ChannelType Blue() const { return m_qtColor.blue(); }
virtual ChannelType Alpha() const { return m_qtColor.alpha(); }
bool operator==(const wxColour& color) const
{ return m_qtColor == color.m_qtColor; }
bool operator!=(const wxColour& color) const
{ return m_qtColor != color.m_qtColor; }
int GetPixel() const;
QColor GetHandle() const { return m_qtColor; };
protected:
virtual void
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a)
{ m_qtColor.setRgb(r, g, b, a); }
private:
QColor m_qtColor;
DECLARE_DYNAMIC_CLASS(wxColour)
};
#endif // _WX_QT_COLOUR_H_

92
include/wx/qt/combobox.h Normal file
View File

@@ -0,0 +1,92 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/combobox.h
// Author: Peter Most, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_COMBOBOX_H_
#define _WX_QT_COMBOBOX_H_
#include "wx/choice.h"
#include <QtWidgets/QComboBox>
class WXDLLIMPEXP_CORE wxComboBox : public wxChoice, public wxTextEntry
{
public:
wxComboBox();
wxComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = (const wxString *) NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
virtual void SetSelection(long from, long to);
virtual int GetSelection() const { return wxChoice::GetSelection(); }
virtual void GetSelection(long *from, long *to) const;
virtual wxString GetStringSelection() const
{
return wxItemContainer::GetStringSelection();
}
virtual void Clear()
{
wxTextEntry::Clear();
wxItemContainer::Clear();
}
// See wxComboBoxBase discussion of IsEmpty().
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
virtual void Popup();
virtual void Dismiss();
protected:
// From wxTextEntry:
virtual wxString DoGetValue() const;
private:
// From wxTextEntry:
virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; }
DECLARE_DYNAMIC_CLASS(wxComboBox)
};
#endif // _WX_QT_COMBOBOX_H_

38
include/wx/qt/control.h Normal file
View File

@@ -0,0 +1,38 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/control.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CONTROL_H_
#define _WX_QT_CONTROL_H_
class WXDLLIMPEXP_CORE wxControl : public wxControlBase
{
public:
wxControl();
wxControl(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr);
virtual wxSize DoGetBestSize() const;
protected:
bool QtCreateControl( wxWindow *parent, wxWindowID id, const wxPoint &pos,
const wxSize &size, long style, const wxValidator &validator,
const wxString &name );
private:
DECLARE_DYNAMIC_CLASS(wxControl)
};
#endif // _WX_QT_CONTROL_H_

22
include/wx/qt/ctrlsub.h Normal file
View File

@@ -0,0 +1,22 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/ctrlsub.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CTRLSUB_H_
#define _WX_QT_CTRLSUB_H_
class WXDLLIMPEXP_CORE wxControlWithItems : public wxControlWithItemsBase
{
public:
wxControlWithItems();
protected:
private:
DECLARE_ABSTRACT_CLASS(wxControlWithItems)
};
#endif // _WX_QT_CTRLSUB_H_

46
include/wx/qt/cursor.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: cursor.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_CURSOR_H_
#define _WX_QT_CURSOR_H_
#include "wx/gdicmn.h"
#include "wx/gdiobj.h"
#include "wx/image.h"
#include <QtGui/QCursor>
class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject
{
public:
wxCursor() { }
wxCursor( const wxCursor & );
wxCursor( const wxImage& image ) { InitFromImage(image); }
wxCursor( const wxString& name,
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0 );
wxCursor(wxStockCursor id) { InitFromStock(id); }
#if WXWIN_COMPATIBILITY_2_8
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
#endif
QCursor m_qtCursor;
protected:
void InitFromStock( wxStockCursor cursorId );
#if wxUSE_IMAGE
void InitFromImage( const wxImage & image );
#endif
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
DECLARE_DYNAMIC_CLASS( wxCursor )
};
#endif // _WX_QT_CURSOR_H_

39
include/wx/qt/dataform.h Normal file
View File

@@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/toolbar.h
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAFORM_H_
#define _WX_QT_DATAFORM_H_
class WXDLLIMPEXP_CORE wxDataFormat
{
public:
wxDataFormat();
wxDataFormat( wxDataFormatId formatId );
wxDataFormat(const wxString &id);
wxDataFormat(const QString &id);
wxDataFormat(const wxChar *id);
void SetId( const wxChar *id );
bool operator==(wxDataFormatId format) const;
bool operator!=(wxDataFormatId format) const;
bool operator==(const wxDataFormat& format) const;
bool operator!=(const wxDataFormat& format) const;
// string ids are used for custom types - this SetId() must be used for
// application-specific formats
wxString GetId() const;
void SetId( const wxString& id );
// implementation
wxDataFormatId GetType() const;
void SetType( wxDataFormatId type );
QString m_MimeType;
};
#endif // _WX_QT_DATAFORM_H_

30
include/wx/qt/dataobj.h Normal file
View File

@@ -0,0 +1,30 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/qt/dataobj.cpp
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAOBJ_H_
#define _WX_QT_DATAOBJ_H_
#include <QMimeData>
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
{
public:
wxDataObject() {}
virtual bool IsSupportedFormat(const wxDataFormat& format, Direction dir) const;
virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
virtual size_t GetFormatCount(Direction dir = Get) const;
virtual void GetAllFormats(wxDataFormat *formats, Direction dir = Get) const;
virtual size_t GetDataSize(const wxDataFormat& format) const;
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
virtual bool SetData(const wxDataFormat& format, size_t len, const void * buf);
private:
QMimeData m_qtMimeData; // to handle formats that have no helper classes
};
#endif // _WX_QT_DATAOBJ_H_

32
include/wx/qt/dataobj2.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dataobj2.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAOBJ2_H_
#define _WX_QT_DATAOBJ2_H_
class WXDLLIMPEXP_CORE wxBitmapDataObject : public wxBitmapDataObjectBase
{
public:
wxBitmapDataObject();
wxBitmapDataObject(const wxBitmap& bitmap);
protected:
private:
};
class WXDLLIMPEXP_CORE wxFileDataObject : public wxFileDataObjectBase
{
public:
wxFileDataObject();
void AddFile( const wxString &filename );
};
#endif // _WX_QT_DATAOBJ2_H_

141
include/wx/qt/dataview.h Normal file
View File

@@ -0,0 +1,141 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dataview.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DATAVIEW_H_
#define _WX_QT_DATAVIEW_H_
class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase
{
public:
wxDataViewColumn( const wxString &title, wxDataViewRenderer *renderer,
unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *renderer,
unsigned int model_column, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
// setters:
virtual void SetTitle( const wxString &title );
virtual void SetBitmap( const wxBitmap &bitmap );
virtual void SetOwner( wxDataViewCtrl *owner );
virtual void SetAlignment( wxAlignment align );
virtual void SetSortable( bool sortable );
virtual void SetSortOrder( bool ascending );
virtual void SetAsSortKey(bool sort = true);
virtual void SetResizeable( bool resizeable );
virtual void SetHidden( bool hidden );
virtual void SetMinWidth( int minWidth );
virtual void SetWidth( int width );
virtual void SetReorderable( bool reorderable );
virtual void SetFlags(int flags);
// getters:
virtual wxString GetTitle() const;
virtual wxAlignment GetAlignment() const;
virtual bool IsSortable() const;
virtual bool IsSortOrderAscending() const;
virtual bool IsSortKey() const;
virtual bool IsResizeable() const;
virtual bool IsHidden() const;
virtual int GetWidth() const;
virtual int GetMinWidth() const;
virtual bool IsReorderable() const;
virtual int GetFlags() const;
};
class WXDLLIMPEXP_ADV wxDataViewCtrl: public wxDataViewCtrlBase
{
public:
wxDataViewCtrl();
wxDataViewCtrl( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator );
virtual ~wxDataViewCtrl();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator );
virtual bool AssociateModel( wxDataViewModel *model );
virtual bool PrependColumn( wxDataViewColumn *col );
virtual bool AppendColumn( wxDataViewColumn *col );
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
virtual unsigned int GetColumnCount() const;
virtual wxDataViewColumn* GetColumn( unsigned int pos ) const;
virtual bool DeleteColumn( wxDataViewColumn *column );
virtual bool ClearColumns();
virtual int GetColumnPosition( const wxDataViewColumn *column ) const;
virtual wxDataViewColumn *GetSortingColumn() const;
virtual wxDataViewItem GetSelection() const;
virtual int GetSelections( wxDataViewItemArray & sel ) const;
virtual void SetSelections( const wxDataViewItemArray & sel );
virtual void Select( const wxDataViewItem & item );
virtual void Unselect( const wxDataViewItem & item );
virtual bool IsSelected( const wxDataViewItem & item ) const;
virtual void SelectAll();
virtual void UnselectAll();
virtual void EnsureVisible( const wxDataViewItem& item,
const wxDataViewColumn *column = NULL );
virtual void HitTest( const wxPoint &point,
wxDataViewItem &item,
wxDataViewColumn *&column ) const;
virtual wxRect GetItemRect( const wxDataViewItem &item,
const wxDataViewColumn *column = NULL ) const;
virtual void Expand( const wxDataViewItem & item );
virtual void Collapse( const wxDataViewItem & item );
virtual bool IsExpanded( const wxDataViewItem & item ) const;
virtual bool EnableDragSource( const wxDataFormat &format );
virtual bool EnableDropTarget( const wxDataFormat &format );
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
wxWindow *GetMainWindow() { return (wxWindow*) this; }
virtual void OnInternalIdle();
protected:
virtual void DoSetExpanderColumn();
virtual void DoSetIndent();
private:
virtual wxDataViewItem DoGetCurrentItem() const;
virtual void DoSetCurrentItem(const wxDataViewItem& item);
};
#endif // _WX_QT_DATAVIEW_H_

134
include/wx/qt/dc.h Normal file
View File

@@ -0,0 +1,134 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dc.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DC_H_
#define _WX_QT_DC_H_
#include <QtGui/QPainter>
class QImage;
class WXDLLIMPEXP_FWD_CORE wxRegion;
class WXDLLIMPEXP_CORE wxQtDCImpl : public wxDCImpl
{
public:
wxQtDCImpl( wxDC *owner );
~wxQtDCImpl();
virtual bool CanDrawBitmap() const;
virtual bool CanGetTextExtent() const;
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const;
virtual int GetDepth() const;
virtual wxSize GetPPI() const;
virtual void SetFont(const wxFont& font);
virtual void SetPen(const wxPen& pen);
virtual void SetBrush(const wxBrush& brush);
virtual void SetBackground(const wxBrush& brush);
virtual void SetBackgroundMode(int mode);
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
virtual void SetLogicalFunction(wxRasterOperationMode function);
virtual wxCoord GetCharHeight() const;
virtual wxCoord GetCharWidth() const;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const;
virtual void Clear();
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual void DestroyClippingRegion();
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
virtual void DoDrawPoint(wxCoord x, wxCoord y);
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea);
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius);
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoCrossHair(wxCoord x, wxCoord y);
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false);
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord,
wxCoord ysrcMask = wxDefaultCoord);
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset );
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
// Use Qt transformations, as they automatically scale pen widths, text...
virtual void ComputeScaleAndOrigin();
void QtPreparePainter();
virtual void* GetHandle() const { return (void*) m_qtPainter; }
protected:
QPainter *m_qtPainter;
QImage *m_qtImage;
wxRegion *m_clippingRegion;
private:
enum wxQtRasterColourOp
{
wxQtNONE,
wxQtWHITE,
wxQtBLACK,
wxQtINVERT
};
wxQtRasterColourOp m_rasterColourOp;
QColor m_qtPenColor;
QColor m_qtBrushColor;
void ApplyRasterColourOp();
};
#endif // _WX_QT_DC_H_

46
include/wx/qt/dcclient.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcclient.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCCLIENT_H_
#define _WX_QT_DCCLIENT_H_
#include "wx/qt/dc.h"
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxQtDCImpl
{
public:
wxWindowDCImpl( wxDC *owner );
wxWindowDCImpl( wxDC *owner, wxWindow *win );
~wxWindowDCImpl();
protected:
wxWindow *m_window;
private:
};
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
{
public:
wxClientDCImpl( wxDC *owner );
wxClientDCImpl( wxDC *owner, wxWindow *win );
~wxClientDCImpl();
};
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxWindowDCImpl
{
public:
wxPaintDCImpl( wxDC *owner );
wxPaintDCImpl( wxDC *owner, wxWindow *win );
};
#endif // _WX_QT_DCCLIENT_H_

32
include/wx/qt/dcmemory.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcmemory.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCMEMORY_H_
#define _WX_QT_DCMEMORY_H_
#include "wx/qt/dcclient.h"
class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxQtDCImpl
{
public:
wxMemoryDCImpl( wxMemoryDC *owner );
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
~wxMemoryDCImpl();
virtual void DoSelect(const wxBitmap& bitmap);
virtual const wxBitmap& GetSelectedBitmap() const;
virtual wxBitmap& GetSelectedBitmap();
protected:
private:
wxBitmap m_selected;
};
#endif // _WX_QT_DCMEMORY_H_

106
include/wx/qt/dcprint.h Normal file
View File

@@ -0,0 +1,106 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcprint.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCPRINT_H_
#define _WX_QT_DCPRINT_H_
#include "wx/dc.h"
class WXDLLIMPEXP_CORE wxPrinterDCImpl : public wxDCImpl
{
public:
wxPrinterDCImpl( wxPrinterDC *, const wxPrintData & );
virtual bool CanDrawBitmap() const;
virtual bool CanGetTextExtent() const;
virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const;
virtual int GetDepth() const;
virtual wxSize GetPPI() const;
virtual void SetFont(const wxFont& font);
virtual void SetPen(const wxPen& pen);
virtual void SetBrush(const wxBrush& brush);
virtual void SetBackground(const wxBrush& brush);
virtual void SetBackgroundMode(int mode);
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette);
#endif // wxUSE_PALETTE
virtual void SetLogicalFunction(wxRasterOperationMode function);
virtual wxCoord GetCharHeight() const;
virtual wxCoord GetCharWidth() const;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const;
virtual void Clear();
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
virtual void DoDrawPoint(wxCoord x, wxCoord y);
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea);
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius);
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoCrossHair(wxCoord x, wxCoord y);
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false);
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord,
wxCoord ysrcMask = wxDefaultCoord);
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset );
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
protected:
private:
};
#endif // _WX_QT_DCPRINT_H_

23
include/wx/qt/dcscreen.h Normal file
View File

@@ -0,0 +1,23 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dcscreen.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DCSCREEN_H_
#define _WX_QT_DCSCREEN_H_
#include "wx/qt/dcclient.h"
class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxWindowDCImpl
{
public:
wxScreenDCImpl( wxScreenDC *owner );
protected:
private:
};
#endif // _WX_QT_DCSCREEN_H_

17
include/wx/qt/defs.h Normal file
View File

@@ -0,0 +1,17 @@
/*
* Name: wx/qt/defs.h
* Author: Peter Most
* Copyright: (c) Peter Most
* Licence: wxWindows licence
*/
#ifndef _WX_QT_DEFS_H_
#define _WX_QT_DEFS_H_
#ifdef __cplusplus
typedef class QWidget *WXWidget;
#endif
#endif /* _WX_QT_DEFS_H_ */

46
include/wx/qt/dialog.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dialog.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DIALOG_H_
#define _WX_QT_DIALOG_H_
#include "wx/dialog.h"
#include <QtWidgets/QDialog>
class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
{
public:
wxDialog();
wxDialog( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
virtual ~wxDialog();
bool Create( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
virtual int ShowModal();
virtual void EndModal(int retCode);
virtual bool IsModal() const;
virtual QDialog *GetHandle() const;
private:
wxDECLARE_DYNAMIC_CLASS( wxDialog );
};
#endif // _WX_QT_DIALOG_H_

46
include/wx/qt/dirdlg.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dirdlg.h
// Author: Sean D'Epagnier
// Copyright: (c) 2014 Sean D'Epagnier
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DIRDLG_H_
#define _WX_QT_DIRDLG_H_
#include <QtWidgets/QFileDialog>
class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase
{
public:
wxDirDialog() { }
wxDirDialog(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);
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);
public: // overrides from wxGenericDirDialog
wxString GetPath() const wxOVERRIDE;
void SetPath(const wxString& path) wxOVERRIDE;
virtual QFileDialog *GetHandle() const;
private:
DECLARE_DYNAMIC_CLASS(wxDirDialog)
};
#endif // _WX_QT_DIRDLG_H_

46
include/wx/qt/dnd.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dnd.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DND_H_
#define _WX_QT_DND_H_
#define wxDROP_ICON(name) wxICON(name)
class WXDLLIMPEXP_CORE wxDropTarget : public wxDropTargetBase
{
public:
wxDropTarget(wxDataObject *dataObject = NULL );
virtual bool OnDrop(wxCoord x, wxCoord y);
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
virtual bool GetData();
wxDataFormat GetMatchingPair();
protected:
private:
};
class WXDLLIMPEXP_CORE wxDropSource: public wxDropSourceBase
{
public:
wxDropSource( wxWindow *win = NULL,
const wxIcon &copy = wxNullIcon,
const wxIcon &move = wxNullIcon,
const wxIcon &none = wxNullIcon);
wxDropSource( wxDataObject& data,
wxWindow *win,
const wxIcon &copy = wxNullIcon,
const wxIcon &move = wxNullIcon,
const wxIcon &none = wxNullIcon);
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly);
};
#endif // _WX_QT_DND_H_

View File

@@ -0,0 +1,32 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dvrenderer.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DVRENDERER_H_
#define _WX_QT_DVRENDERER_H_
// ----------------------------------------------------------------------------
// wxDataViewRenderer
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewRendererBase
{
public:
wxDataViewRenderer( const wxString &varianttype,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual void SetMode( wxDataViewCellMode mode );
virtual wxDataViewCellMode GetMode() const;
virtual void SetAlignment( int align );
virtual int GetAlignment() const;
virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE);
virtual wxEllipsizeMode GetEllipsizeMode() const;
};
#endif // _WX_QT_DVRENDERER_H_

176
include/wx/qt/dvrenderers.h Normal file
View File

@@ -0,0 +1,176 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/dvrenderers.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_DVRENDERERS_H_
#define _WX_QT_DVRENDERERS_H_
// ---------------------------------------------------------
// wxDataViewTextRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
{
public:
wxDataViewTextRenderer( const wxString &varianttype = wxT("string"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
void SetAlignment( int align );
};
// ---------------------------------------------------------
// wxDataViewBitmapRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
{
public:
wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
};
// ---------------------------------------------------------
// wxDataViewToggleRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
{
public:
wxDataViewToggleRenderer( const wxString &varianttype = wxT("bool"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
};
// ---------------------------------------------------------
// wxDataViewCustomRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
{
public:
wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT,
bool no_init = false );
virtual ~wxDataViewCustomRenderer();
virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0;
void RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const = 0;
virtual bool Activate( wxRect WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) )
{ return false; }
virtual bool LeftClick( wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) )
{ return false; }
virtual bool StartDrag( wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell),
wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) )
{ return false; }
// Create DC on request
virtual wxDC *GetDC();
};
// ---------------------------------------------------------
// wxDataViewProgressRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
const wxString &varianttype = wxT("long"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual ~wxDataViewProgressRenderer();
bool SetValue( const wxVariant &value );
bool GetValue( wxVariant &value ) const;
virtual bool Render( wxRect cell, wxDC *dc, int state );
virtual wxSize GetSize() const;
};
// ---------------------------------------------------------
// wxDataViewIconTextRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewIconTextRenderer( const wxString &varianttype = wxT("wxDataViewIconText"),
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int align = wxDVR_DEFAULT_ALIGNMENT );
virtual ~wxDataViewIconTextRenderer();
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 HasEditorCtrl() const { return true; }
virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value );
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
};
// ---------------------------------------------------------
// wxDataViewDateRenderer
// ---------------------------------------------------------
class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewDateRenderer( const wxString &varianttype = wxT("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( wxRect cell,
wxDataViewModel *model, const wxDataViewItem &item, unsigned int col );
};
// -------------------------------------
// wxDataViewChoiceRenderer
// -------------------------------------
class WXDLLIMPEXP_ADV wxDataViewChoiceRenderer: public wxDataViewCustomRenderer
{
public:
wxDataViewChoiceRenderer( const wxArrayString &choices,
wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
int alignment = wxDVR_DEFAULT_ALIGNMENT );
virtual bool Render( wxRect rect, wxDC *dc, int state );
virtual wxSize GetSize() const;
virtual bool SetValue( const wxVariant &value );
virtual bool GetValue( wxVariant &value ) const;
void SetAlignment( int align );
};
#endif // _WX_QT_DVRENDERERS_H_

78
include/wx/qt/evtloop.h Normal file
View File

@@ -0,0 +1,78 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/evtloop.h
// Author: Peter Most, Javier Torres
// Copyright: (c) Peter Most, Javier Torres
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_EVTLOOP_H_
#define _WX_QT_EVTLOOP_H_
#include <QtCore/QTimer>
class WXDLLIMPEXP_BASE wxQtEventLoopBase : public wxEventLoopBase
{
public:
wxQtEventLoopBase();
~wxQtEventLoopBase();
virtual int DoRun();
virtual void ScheduleExit(int rc = 0);
virtual bool Pending() const;
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
virtual void DoYieldFor(long eventsToProcess);
#if wxUSE_EVENTLOOP_SOURCE
virtual wxEventLoopSource *AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
#endif // wxUSE_EVENTLOOP_SOURCE
protected:
private:
QTimer *m_qtIdleTimer;
wxDECLARE_NO_COPY_CLASS(wxQtEventLoopBase);
};
#if wxUSE_GUI
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxQtEventLoopBase
{
public:
wxGUIEventLoop();
};
#else // !wxUSE_GUI
#if wxUSE_CONSOLE_EVENTLOOP
class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxQtEventLoopBase
{
public:
wxConsoleEventLoop();
};
#endif // wxUSE_CONSOLE_EVENTLOOP
#endif // wxUSE_GUI
class wxQtEventLoopBase;
class wxQtIdleTimer : public QTimer
{
public:
wxQtIdleTimer( wxQtEventLoopBase *eventLoop );
virtual bool eventFilter( QObject * watched, QEvent * event );
private:
void idle();
private:
wxQtEventLoopBase *m_eventLoop;
};
#endif // _WX_QT_EVTLOOP_H_

58
include/wx/qt/filedlg.h Normal file
View File

@@ -0,0 +1,58 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/filedlg.h
// Author: Sean D'Epagnier
// Copyright: (c) 2014 Sean D'Epagnier
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FILEDLG_H_
#define _WX_QT_FILEDLG_H_
#include <QtWidgets/QFileDialog>
class WXDLLIMPEXP_CORE wxFileDialog : public wxFileDialogBase
{
public:
wxFileDialog() { }
wxFileDialog(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);
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 wxString GetPath() const wxOVERRIDE;
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE;
virtual wxString GetFilename() const wxOVERRIDE;
virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE;
virtual int GetFilterIndex() const wxOVERRIDE;
virtual void SetMessage(const wxString& message) wxOVERRIDE;
virtual void SetPath(const wxString& path) wxOVERRIDE;
virtual void SetDirectory(const wxString& dir) wxOVERRIDE;
virtual void SetFilename(const wxString& name) wxOVERRIDE;
virtual void SetWildcard(const wxString& wildCard) wxOVERRIDE;
virtual void SetFilterIndex(int filterIndex) wxOVERRIDE;
virtual bool SupportsExtraControl() const wxOVERRIDE { return true; }
virtual QFileDialog *GetHandle() const;
private:
DECLARE_DYNAMIC_CLASS(wxFileDialog)
};
#endif // _WX_QT_FILEDLG_H_

82
include/wx/qt/font.h Normal file
View File

@@ -0,0 +1,82 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/font.h
// Author: Peter Most, Javier Torres, Mariano Reingart
// Copyright: (c) 2010 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FONT_H_
#define _WX_QT_FONT_H_
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{
public:
wxFont();
wxFont(const wxFontInfo& info);
wxFont(const wxString& nativeFontInfoString);
wxFont(const wxNativeFontInfo& info);
wxFont(const QFont& font);
wxFont(int size,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
wxFont(const wxSize& pixelSize,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
wxFont(int size,
int family,
int style,
int weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
bool Create(wxSize size,
wxFontFamily family,
wxFontStyle style,
wxFontWeight weight,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
// accessors: get the font characteristics
virtual int GetPointSize() const;
virtual wxFontStyle GetStyle() const;
virtual wxFontWeight GetWeight() const;
virtual bool GetUnderlined() const;
virtual wxString GetFaceName() const;
virtual wxFontEncoding GetEncoding() const;
virtual const wxNativeFontInfo *GetNativeFontInfo() const;
// change the font characteristics
virtual void SetPointSize( int pointSize );
virtual void SetFamily( wxFontFamily family );
virtual void SetStyle( wxFontStyle style );
virtual bool SetFaceName(const wxString& facename);
virtual void SetWeight( wxFontWeight weight );
virtual void SetUnderlined( bool underlined );
virtual void SetEncoding(wxFontEncoding encoding);
wxDECLARE_COMMON_FONT_METHODS();
virtual QFont GetHandle() const;
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
virtual wxFontFamily DoGetFamily() const;
DECLARE_DYNAMIC_CLASS( wxFont )
};
#endif // _WX_QT_FONT_H_

32
include/wx/qt/fontdlg.h Normal file
View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/fontdlg.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FONTDLG_H_
#define _WX_QT_FONTDLG_H_
#include <QtWidgets/QFontDialog>
class WXDLLIMPEXP_CORE wxFontDialog : public wxFontDialogBase
{
public:
wxFontDialog() { }
wxFontDialog(wxWindow *parent) { Create(parent); }
wxFontDialog(wxWindow *parent, const wxFontData& data) { Create(parent, data); }
virtual QFontDialog *GetHandle() const { return static_cast<QFontDialog *>(m_qtWindow); }
protected:
bool DoCreate(wxWindow *parent);
private:
wxFontData m_data;
DECLARE_DYNAMIC_CLASS(wxFontDialog)
};
#endif // _WX_QT_FONTDLG_H_

61
include/wx/qt/frame.h Normal file
View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/frame.h
// Purpose: wxFrame class interface
// Author: Peter Most
// Modified by:
// Created: 09.08.09
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_FRAME_H_
#define _WX_QT_FRAME_H_
#include "wx/frame.h"
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QScrollArea>
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
{
public:
wxFrame();
wxFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual ~wxFrame();
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
virtual void SetMenuBar(wxMenuBar *menubar);
virtual void SetStatusBar(wxStatusBar *statusBar );
virtual void SetToolBar(wxToolBar *toolbar);
virtual void SetWindowStyleFlag( long style );
virtual void AddChild( wxWindowBase *child );
virtual void RemoveChild( wxWindowBase *child );
virtual QMainWindow *GetHandle() const
{
return static_cast<QMainWindow*>(m_qtWindow);
}
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
private:
wxDECLARE_DYNAMIC_CLASS( wxFrame );
};
#endif // _WX_QT_FRAME_H_

51
include/wx/qt/gauge.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/gauge.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_GAUGE_H_
#define _WX_QT_GAUGE_H_
#include <QtWidgets/QProgressBar>
class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase
{
public:
wxGauge();
wxGauge(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
virtual QProgressBar *GetHandle() const;
// set/get the control range
virtual void SetRange(int range);
virtual int GetRange() const;
virtual void SetValue(int pos);
virtual int GetValue() const;
private:
QProgressBar *m_qtProgressBar;
wxDECLARE_DYNAMIC_CLASS(wxGauge);
};
#endif // _WX_QT_GAUGE_H_

65
include/wx/qt/glcanvas.h Normal file
View File

@@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////
// Name: include/wx/qt/glcanvas.cpp
// Author: Sean D'Epagnier
// Copyright: (c) Sean D'Epagnier 2014
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include <QtOpenGL/QGLWidget>
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
{
public:
wxGLContext(wxGLCanvas *win, const wxGLContext* other = NULL);
/// virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE;
private:
QGLContext *m_glContext;
DECLARE_CLASS(wxGLContext)
};
// ----------------------------------------------------------------------------
// wxGLCanvas: OpenGL output window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
{
public:
wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
virtual bool SwapBuffers();
static bool ConvertWXAttrsToQtGL(const int *wxattrs, QGLFormat &format);
virtual QGLWidget *GetHandle() const { return static_cast<QGLWidget *>(m_qtWindow); }
private:
// DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxGLCanvas)
};
#endif // _WX_GLCANVAS_H_

95
include/wx/qt/listbox.h Normal file
View File

@@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/qt/listbox.h
// Author: Peter Most
// Copyright: (c) Peter Most
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QT_LISTBOX_H_
#define _WX_QT_LISTBOX_H_
#include <QtWidgets/QListWidget>
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
{
public:
wxListBox();
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual ~wxListBox();
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr);
virtual bool IsSelected(int n) const;
virtual int GetSelections(wxArrayInt& aSelections) const;
virtual unsigned int GetCount() const;
virtual wxString GetString(unsigned int n) const;
virtual void SetString(unsigned int n, const wxString& s);
virtual void SetSelection(int n);
virtual int GetSelection() const;
virtual QListWidget *GetHandle() const;
void QtSendEvent(wxEventType evtType, const QModelIndex &index, bool selected);
protected:
virtual void DoSetFirstItem(int n);
virtual void DoSetSelection(int n, bool select);
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData,
wxClientDataType type);
virtual int DoInsertOneItem(const wxString& item, unsigned int pos);
virtual void DoSetItemClientData(unsigned int n, void *clientData);
virtual void *DoGetItemClientData(unsigned int n) const;
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int pos);
virtual QScrollArea *QtGetScrollBarsContainer() const;
#if wxUSE_CHECKLISTBOX
bool m_hasCheckBoxes;
#endif // wxUSE_CHECKLISTBOX
QListWidget *m_qtListWidget;
private:
virtual void Init(); //common construction
DECLARE_DYNAMIC_CLASS(wxListBox)
};
#endif // _WX_QT_LISTBOX_H_

Some files were not shown because too many files have changed in this diff Show More