Permalink
Browse files

Misc patches removing wxWidgets < 2.9 support

Ignore-this: e5dff79eb4725668e456b6e40cd1b79

Minor tidy up of source code to remove support for wxWidgets 2.8 (mainly
#ifdefs, but some type safety changes brought in with wxWidgets 2.9)

darcs-hash:20120325113337-75908-31aa55322f6b9267d29151b29a04b924fcb3881e.gz
  • Loading branch information...
1 parent 61f5c83 commit a66efa7d6f41df71c6496fccf93d8e10a5a0b70b @jodonoghue committed Mar 25, 2012
@@ -168,12 +168,12 @@ EWXWEXPORT(void,wxComboBox_SetString)(wxComboBox* self,int n,wxString* s)
EWXWEXPORT(void,wxComboBox_SetClientData)(wxComboBox* self,int n,void* clientData)
{
- self->SetClientData( n, clientData );
+ ((wxItemContainer*) self)->SetClientData( n, clientData );
}
EWXWEXPORT(void*,wxComboBox_GetClientData)(wxComboBox* self,int n)
{
- return self->GetClientData(n);
+ return ((wxItemContainer*) self)->GetClientData(n);
}
}
View
@@ -218,14 +218,8 @@ EWXWEXPORT(int,FileDataObject_GetFilenames)(void* self,void* _lst)
wxArrayString arr = ((wxFileDataObject*)self)->GetFilenames();
if (_lst)
{
- for (unsigned int i = 0; i < arr.GetCount(); i++)
- {
-#if wxVERSION_NUMBER >= 2900
- ((const wxChar**)_lst)[i] = wxStrdup ((arr.Item(i).wchar_str()));
-#else
- ((const wxChar**)_lst)[i] = wxStrdup ((arr.Item(i).c_str()));
-#endif
- }
+ for (unsigned int i = 0; i < arr.GetCount(); i++)
+ ((const wxChar**)_lst)[i] = wxStrdup (arr.Item(i).wchar_str());
}
return arr.GetCount();
}
View
@@ -45,7 +45,6 @@
#include "wx/toolbook.h"
#include "wx/treebook.h"
-
extern "C"
{
@@ -1705,11 +1704,7 @@ MAKE_EVENT_WRAPPER(EVT_WIZARD_PAGE_CHANGING)
MAKE_EVENT_WRAPPER(EVT_WIZARD_CANCEL)
MAKE_EVENT_WRAPPER(EVT_WIZARD_HELP)
MAKE_EVENT_WRAPPER(EVT_WIZARD_FINISHED)
-#if wxCHECK_VERSION(2,8,12)
MAKE_EVENT_WRAPPER(EVT_WIZARD_PAGE_SHOWN)
-#else
-MAKE_UNDEFEVENT_WRAPPER(EVT_WIZARD_PAGE_SHOWN)
-#endif
#endif
////////////////////////////////////////////////////////////////////////////////
@@ -66,13 +66,7 @@ EWXWEXPORT(int,wxFileDialog_GetPaths)(void* _obj,void* paths)
if (paths)
{
for (unsigned int i = 0; i < arr.GetCount(); i++)
- {
-#if wxVERSION_NUMBER >= 2900
((const wxChar**)paths)[i] = wxStrdup (arr.Item(i).wchar_str());
-#else
- ((const wxChar**)paths)[i] = wxStrdup ((arr.Item(i).c_str()));
-#endif
- }
}
return arr.GetCount();
}
@@ -98,13 +92,7 @@ EWXWEXPORT(int,wxFileDialog_GetFilenames)(void* _obj,void* paths)
if (paths)
{
for (unsigned int i = 0; i < arr.GetCount(); i++)
- {
-#if wxVERSION_NUMBER >= 2900
((const wxChar**)paths)[i] = wxStrdup (arr.Item(i).wchar_str());
-#else
- ((const wxChar**)paths)[i] = wxStrdup ((arr.Item(i).c_str()));
-#endif
- }
}
return arr.GetCount();
}
View
@@ -407,13 +407,7 @@ EWXWEXPORT(int,wxGrid_StringToLines)(wxGrid* self,wxString* value,void* lines)
if (lines)
{
for (int i = 0; i < result; i++)
- {
-#if wxVERSION_NUMBER >= 2900
((const wxChar**)lines)[i] = wxStrdup (arr[i].wchar_str());
-#else
- ((const wxChar**)lines)[i] = wxStrdup (arr[i].c_str());
-#endif
- }
}
return result;
}
View
@@ -27,13 +27,7 @@ EWXWEXPORT(int,wxMimeTypesManager_EnumAllFileTypes)(wxMimeTypesManager* self,voi
if (_lst)
{
for (unsigned int i = 0; i < arr.GetCount(); i++)
- {
-#if wxVERSION_NUMBER >= 2900
((const wxChar**)_lst)[i] = wxStrdup (arr.Item(i).wchar_str());
-#else
- ((const wxChar**)_lst)[i] = wxStrdup (arr.Item(i).c_str());
-#endif
- }
}
return result;
@@ -65,13 +59,7 @@ EWXWEXPORT(int,wxFileType_GetMimeTypes)(void* self,void* _lst)
if (((wxFileType*)self)->GetMimeTypes(arr) && _lst)
{
for (unsigned int i = 0; i < arr.GetCount(); i++)
- {
-#if wxVERSION_NUMBER >= 2900
((const wxChar**)_lst)[i] = wxStrdup (arr.Item(i).wchar_str());
-#else
- ((const wxChar**)_lst)[i] = wxStrdup (arr.Item(i).c_str());
-#endif
- }
}
return arr.GetCount();
@@ -84,13 +72,7 @@ EWXWEXPORT(int,wxFileType_GetExtensions)(void* self,void* _lst)
if (((wxFileType*)self)->GetExtensions(arr) && _lst)
{
for (unsigned int i = 0; i < arr.GetCount(); i++)
- {
-#if wxVERSION_NUMBER >= 2900
((const wxChar**)_lst)[i] = wxStrdup (arr.Item(i).wchar_str());
-#else
- ((const wxChar**)_lst)[i] = wxStrdup (arr.Item(i).c_str());
-#endif
- }
}
return arr.GetCount();
@@ -155,11 +155,7 @@ EWXWEXPORT(void*,wxTextValidator_GetIncludes)(void* self,int* _nitems)
for (unsigned int i = 0; i < items.GetCount(); i++)
{
-#if wxVERSION_NUMBER >= 2900
items_copy[i] = wxStrdup(items.Item(i).wchar_str());
-#else
- items_copy[i] = wxStrdup(items.Item(i).c_str());
-#endif
}
retval = (void*)items_copy;
*_nitems = items.GetCount();
@@ -188,11 +184,7 @@ EWXWEXPORT(void*,wxTextValidator_GetExcludes)(void* self,int* _nitems)
for (unsigned int i = 0; i < items.GetCount(); i++)
{
-#if wxVERSION_NUMBER >= 2900
items_copy[i] = wxStrdup(items.Item(i).wchar_str());
-#else
- items_copy[i] = wxStrdup(items.Item(i).c_str());
-#endif
}
retval = (void*)items_copy;
*_nitems = items.GetCount();
View
@@ -7,10 +7,8 @@
#include "wx/fileconf.h"
#include "wx/spinctrl.h"
-#if (wxVERSION_NUMBER >= 2800)
#include <wx/numdlg.h>
#include <wx/power.h>
-#endif
////////////////////////////////////////////////////////////////////////////////
// wxc specific events
@@ -1210,11 +1208,7 @@ EWXWEXPORT(void,wxString_Delete)(wxString* s)
EWXWEXPORT(int,wxString_GetString)(wxString* s,wxChar* buffer)
{
-#if wxVERSION_NUMBER >= 2900
if (buffer) memcpy (buffer, s->wc_str(), s->Length() * sizeof(wxChar));
-#else
- if (buffer) memcpy (buffer, s->c_str(), s->Length() * sizeof(wxChar));
-#endif
return s->Length();
}
@@ -215,7 +215,7 @@ EWXWEXPORT(void,wxGraphicsContext_DrawIcon)( wxGraphicsContext* self, const wxIc
}
EWXWEXPORT(void,wxGraphicsContext_DrawLines)( wxGraphicsContext* self, size_t n,
- wxDouble* x, wxDouble* y, int fillStyle )
+ wxDouble* x, wxDouble* y, wxPolygonFillMode fillStyle )
{
#ifdef wxUSE_GRAPHICS_CONTEXT
wxPoint2DDouble* points = (wxPoint2DDouble*)malloc (n * sizeof(wxPoint2DDouble));
@@ -236,7 +236,7 @@ EWXWEXPORT(void,wxGraphicsContext_DrawLines)( wxGraphicsContext* self, size_t n,
}
EWXWEXPORT(void,wxGraphicsContext_DrawPath)( wxGraphicsContext* self,
- const wxGraphicsPath* path, int fillStyle )
+ const wxGraphicsPath* path, wxPolygonFillMode fillStyle )
{
#ifdef wxUSE_GRAPHICS_CONTEXT
#if (wxVERSION_NUMBER >= 2900)
@@ -283,7 +283,7 @@ EWXWEXPORT(void,wxGraphicsContext_DrawTextWithAngle)( wxGraphicsContext* self,
}
EWXWEXPORT(void,wxGraphicsContext_FillPath)( wxGraphicsContext* self,
- const wxGraphicsPath* path, int fillStyle )
+ const wxGraphicsPath* path, wxPolygonFillMode fillStyle )
{
#ifdef wxUSE_GRAPHICS_CONTEXT
#if (wxVERSION_NUMBER >= 2900)
@@ -421,7 +421,7 @@ EWXWEXPORT(void,wxGraphicsContext_StrokeLine)( wxGraphicsContext* self, wxDouble
}
EWXWEXPORT(void,wxGraphicsContext_StrokeLines)( wxGraphicsContext* self, size_t n,
- wxDouble* x, wxDouble* y, int fillStyle )
+ wxDouble* x, wxDouble* y, wxPolygonFillMode fillStyle )
{
#ifdef wxUSE_GRAPHICS_CONTEXT
wxPoint2DDouble* points = (wxPoint2DDouble*)malloc (n * sizeof(wxPoint2DDouble));
@@ -737,7 +737,7 @@ EWXWEXPORT(void,wxGraphicsPath_CloseSubpath)( wxGraphicsPath* self )
#endif
}
-EWXWEXPORT(void,wxGraphicsPath_Contains)( wxGraphicsPath* self, wxDouble x, wxDouble y, int fillStyle )
+EWXWEXPORT(void,wxGraphicsPath_Contains)( wxGraphicsPath* self, wxDouble x, wxDouble y, wxPolygonFillMode fillStyle )
{
#ifdef wxUSE_GRAPHICS_CONTEXT
#if (wxVERSION_NUMBER >= 2900)
View
@@ -532,20 +532,9 @@ EWXWEXPORT(void,wxTreeCtrl_HitTest)(wxTreeCtrl* self,int _x,int _y,void* flags,w
EWXWEXPORT(wxRect*,wxTreeCtrl_GetBoundingRect)(wxTreeCtrl* self,wxTreeItemId* item,bool textOnly)
{
-#ifdef __WIN32__
- wxRect rct;
- int result = self->GetBoundingRect(*item, rct, textOnly);
- if (result)
- {
- wxRect* rt = new wxRect();
- *rt = self->GetRect();
- return rt;
- }
- wxRect* rt = new wxRect(-1,-1,-1,-1);
- return rt;
-#else
- return 0;
-#endif
+ wxRect * const rct = new wxRect(-1,-1,-1,-1);
+ self->GetBoundingRect(*item, *rct, textOnly);
+ return rct;
}
}
@@ -75,8 +75,8 @@ int expEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE();
int expEVT_COMMAND_DATAVIEW_ITEM_DROP();
int expEVT_DATE_CHANGED();
int expEVT_WINDOW_MODAL_DIALOG_CLOSED();
-int expEVT_DIALUP_CONNECTED();
-int expEVT_DIALUP_DISCONNECTED();
+//int expEVT_DIALUP_CONNECTED();
+//int expEVT_DIALUP_DISCONNECTED();
int expEVT_COMMAND_BUTTON_CLICKED();
int expEVT_COMMAND_CHECKBOX_CLICKED();
int expEVT_COMMAND_CHOICE_SELECTED();
@@ -100,12 +100,12 @@
#define TStringOut TChar*
#define TStringLen int
-#define TByteData char*
-#define TByteString TByteData* d, int n
-#define TByteStringLazy TByteData* d, int n
-#define TByteStringOut TByteData
-#define TByteStringLazyOut TByteData
-#define TByteStringLen int
+#define TByteData char*
+#define TByteString(d,n) TByteData* d, int n
+#define TByteStringLazy(d,n) TByteData* d, int n
+#define TByteStringOut TByteData
+#define TByteStringLazyOut TByteData
+#define TByteStringLen int
/* structures */
#define TPoint(x,y) int x, int y

0 comments on commit a66efa7

Please sign in to comment.