]> git.saurik.com Git - wxWidgets.git/commitdiff
SWIGged updates for wxGTK for recent changes
authorRobin Dunn <robin@alldunn.com>
Wed, 13 Feb 2002 22:17:33 +0000 (22:17 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 13 Feb 2002 22:17:33 +0000 (22:17 +0000)
A few other little cleanups

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Main.py
wxPython/src/_extras.py
wxPython/src/gtk/events.cpp
wxPython/src/gtk/events.py
wxPython/src/gtk/gdi.cpp
wxPython/src/gtk/wx.cpp
wxPython/src/gtk/wx.py

index 8e630857eff261203560c83477588429d26853af..db8bd91947c28ebe2bc6916f933cfbcd8cd731b7 100644 (file)
@@ -13,7 +13,6 @@
 
 import sys, os, time, string
 from   wxPython.wx import *
-from   wxPython.lib.splashscreen import SplashScreen
 from   wxPython.html import wxHtmlWindow
 
 import images
index f52dadab80005922070618aee35a3f79933c0ef2..f1733cee51000b6ec80ea4384f620f4b33b88ea8 100644 (file)
@@ -783,7 +783,7 @@ class __wxPyCleanup:
 
 sys.__wxPythonCleanup = __wxPyCleanup()
 
-## # another possible solution, but it gets called too eary...
+## # another possible solution, but it gets called too early...
 ## if sys.version[0] == '2':
 ##     import atexit
 ##     atexit.register(wxc.wxApp_CleanUp)
index c0b24ab2fbac165d62e93cbb3478db7650566869..84d6c249fb4935df982ce979fdcb3c103b6d4e55 100644 (file)
@@ -6192,6 +6192,48 @@ static PyObject *_wrap_wxNotifyEvent_Veto(PyObject *self, PyObject *args, PyObje
     return _resultobj;
 }
 
+static void *SwigwxDisplayChangedEventTowxEvent(void *ptr) {
+    wxDisplayChangedEvent *src;
+    wxEvent *dest;
+    src = (wxDisplayChangedEvent *) ptr;
+    dest = (wxEvent *) src;
+    return (void *) dest;
+}
+
+static void *SwigwxDisplayChangedEventTowxObject(void *ptr) {
+    wxDisplayChangedEvent *src;
+    wxObject *dest;
+    src = (wxDisplayChangedEvent *) ptr;
+    dest = (wxObject *) src;
+    return (void *) dest;
+}
+
+#define new_wxDisplayChangedEvent() (new wxDisplayChangedEvent())
+static PyObject *_wrap_new_wxDisplayChangedEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxDisplayChangedEvent * _result;
+    char *_kwnames[] = {  NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxDisplayChangedEvent",_kwnames)) 
+        return NULL;
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+        _result = (wxDisplayChangedEvent *)new_wxDisplayChangedEvent();
+
+    wxPyEndAllowThreads(__tstate);
+    if (PyErr_Occurred()) return NULL;
+}    if (_result) {
+        SWIG_MakePtr(_ptemp, (char *) _result,"_wxDisplayChangedEvent_p");
+        _resultobj = Py_BuildValue("s",_ptemp);
+    } else {
+        Py_INCREF(Py_None);
+        _resultobj = Py_None;
+    }
+    return _resultobj;
+}
+
 static void *SwigwxPaletteChangedEventTowxEvent(void *ptr) {
     wxPaletteChangedEvent *src;
     wxEvent *dest;
@@ -7097,6 +7139,7 @@ static PyMethodDef eventscMethods[] = {
         { "wxPaletteChangedEvent_GetChangedWindow", (PyCFunction) _wrap_wxPaletteChangedEvent_GetChangedWindow, METH_VARARGS | METH_KEYWORDS },
         { "wxPaletteChangedEvent_SetChangedWindow", (PyCFunction) _wrap_wxPaletteChangedEvent_SetChangedWindow, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPaletteChangedEvent", (PyCFunction) _wrap_new_wxPaletteChangedEvent, METH_VARARGS | METH_KEYWORDS },
+        { "new_wxDisplayChangedEvent", (PyCFunction) _wrap_new_wxDisplayChangedEvent, METH_VARARGS | METH_KEYWORDS },
         { "wxNotifyEvent_Veto", (PyCFunction) _wrap_wxNotifyEvent_Veto, METH_VARARGS | METH_KEYWORDS },
         { "wxNotifyEvent_Allow", (PyCFunction) _wrap_wxNotifyEvent_Allow, METH_VARARGS | METH_KEYWORDS },
         { "wxNotifyEvent_IsAllowed", (PyCFunction) _wrap_wxNotifyEvent_IsAllowed, METH_VARARGS | METH_KEYWORDS },
@@ -7306,6 +7349,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxEvent","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxEvent},
     { "_wxEvent","_wxQueryNewPaletteEvent",SwigwxQueryNewPaletteEventTowxEvent},
     { "_wxEvent","_wxPaletteChangedEvent",SwigwxPaletteChangedEventTowxEvent},
+    { "_wxEvent","_wxDisplayChangedEvent",SwigwxDisplayChangedEventTowxEvent},
     { "_wxEvent","_wxNotifyEvent",SwigwxNotifyEventTowxEvent},
     { "_wxEvent","_wxSysColourChangedEvent",SwigwxSysColourChangedEventTowxEvent},
     { "_wxEvent","_wxUpdateUIEvent",SwigwxUpdateUIEventTowxEvent},
@@ -7396,6 +7440,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxObject","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxObject},
     { "_wxObject","_wxQueryNewPaletteEvent",SwigwxQueryNewPaletteEventTowxObject},
     { "_wxObject","_wxPaletteChangedEvent",SwigwxPaletteChangedEventTowxObject},
+    { "_wxObject","_wxDisplayChangedEvent",SwigwxDisplayChangedEventTowxObject},
     { "_wxObject","_wxNotifyEvent",SwigwxNotifyEventTowxObject},
     { "_wxObject","_wxSysColourChangedEvent",SwigwxSysColourChangedEventTowxObject},
     { "_wxObject","_wxUpdateUIEvent",SwigwxUpdateUIEventTowxObject},
index 03051a07027f94c9fb2e221f96b5987f4f317030..d6ba0941e71b83c443fce8ef2c5044bfe3cc3800 100644 (file)
@@ -874,6 +874,20 @@ class wxNotifyEvent(wxNotifyEventPtr):
 
 
 
+class wxDisplayChangedEventPtr(wxEventPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def __repr__(self):
+        return "<C wxDisplayChangedEvent instance at %s>" % (self.this,)
+class wxDisplayChangedEvent(wxDisplayChangedEventPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(eventsc.new_wxDisplayChangedEvent,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
 class wxPaletteChangedEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
index a99f22279531b33175709e8d5dddbc2e1b6305f0..a8c99b144c63d69eb70c15882011866a1987f704 100644 (file)
@@ -4875,6 +4875,25 @@ static PyObject *_wrap_wxColourDatabase_FindName(PyObject *self, PyObject *args,
 }
 
 static void  wxColourDatabase_Append(wxColourDatabase *self,const wxString & name,int  red,int  green,int  blue) {
+            // first see if the name is already there
+            wxString cName = name;
+            cName.MakeUpper();
+            wxString cName2 = cName;
+            if ( !cName2.Replace("GRAY", "GREY") )
+                cName2.clear();
+
+            wxNode *node = self->First();
+            while ( node ) {
+                const wxChar *key = node->GetKeyString();
+                if ( cName == key || cName2 == key ) {
+                    wxColour* c = (wxColour *)node->Data();
+                    c->Set(red, green, blue);
+                    return;
+                }
+                node = node->Next();
+            }
+
+            // otherwise append the new colour
             self->Append(name.c_str(), new wxColour(red, green, blue));
         }
 static PyObject *_wrap_wxColourDatabase_Append(PyObject *self, PyObject *args, PyObject *kwargs) {
@@ -10107,16 +10126,25 @@ static PyObject *_wrap_wxPalette_GetRGB(PyObject *self, PyObject *args, PyObject
     wxPalette * _arg0;
     int  _arg1;
     byte * _arg2;
+    int  temp;
     byte * _arg3;
+    int  temp0;
     byte * _arg4;
+    int  temp1;
     PyObject * _argo0 = 0;
-    PyObject * _argo2 = 0;
-    PyObject * _argo3 = 0;
-    PyObject * _argo4 = 0;
-    char *_kwnames[] = { "self","pixel","OUTPUT","OUTPUT","OUTPUT", NULL };
+    char *_kwnames[] = { "self","pixel", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiOOO:wxPalette_GetRGB",_kwnames,&_argo0,&_arg1,&_argo2,&_argo3,&_argo4)) 
+{
+  _arg2 = (byte*)&temp;
+}
+{
+  _arg3 = (byte*)&temp0;
+}
+{
+  _arg4 = (byte*)&temp1;
+}
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxPalette_GetRGB",_kwnames,&_argo0,&_arg1)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -10125,27 +10153,6 @@ static PyObject *_wrap_wxPalette_GetRGB(PyObject *self, PyObject *args, PyObject
         return NULL;
         }
     }
-    if (_argo2) {
-        if (_argo2 == Py_None) { _arg2 = NULL; }
-        else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_byte_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxPalette_GetRGB. Expected _byte_p.");
-        return NULL;
-        }
-    }
-    if (_argo3) {
-        if (_argo3 == Py_None) { _arg3 = NULL; }
-        else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_byte_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxPalette_GetRGB. Expected _byte_p.");
-        return NULL;
-        }
-    }
-    if (_argo4) {
-        if (_argo4 == Py_None) { _arg4 = NULL; }
-        else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_byte_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxPalette_GetRGB. Expected _byte_p.");
-        return NULL;
-        }
-    }
 {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
         _result = (bool )wxPalette_GetRGB(_arg0,_arg1,_arg2,_arg3,_arg4);
@@ -10153,6 +10160,21 @@ static PyObject *_wrap_wxPalette_GetRGB(PyObject *self, PyObject *args, PyObject
     wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    _resultobj = Py_BuildValue("i",_result);
+{
+    PyObject *o;
+    o = PyInt_FromLong((long) (*_arg2));
+    _resultobj = t_output_helper(_resultobj, o);
+}
+{
+    PyObject *o;
+    o = PyInt_FromLong((long) (*_arg3));
+    _resultobj = t_output_helper(_resultobj, o);
+}
+{
+    PyObject *o;
+    o = PyInt_FromLong((long) (*_arg4));
+    _resultobj = t_output_helper(_resultobj, o);
+}
     return _resultobj;
 }
 
index e0dcdc6be351c06d30d75eb8d4f8dfe576dd39ff..ca356122f546daef7b6542629724531fa62cf363 100644 (file)
@@ -629,6 +629,7 @@ extern "C" SWIGEXPORT(void) initsizersc();
 extern "C" SWIGEXPORT(void) initclip_dndc();
 extern "C" SWIGEXPORT(void) initstreamsc();
 extern "C" SWIGEXPORT(void) initfilesysc();
+extern "C" SWIGEXPORT(void) initutilsc();
 
 
 
@@ -2565,6 +2566,7 @@ SWIGEXPORT(void) initwxc() {
         PyDict_SetItemString(d,"wxEVT_MENU_HIGHLIGHT", PyInt_FromLong((long) wxEVT_MENU_HIGHLIGHT));
         PyDict_SetItemString(d,"wxEVT_POPUP_MENU_INIT", PyInt_FromLong((long) wxEVT_POPUP_MENU_INIT));
         PyDict_SetItemString(d,"wxEVT_SYS_COLOUR_CHANGED", PyInt_FromLong((long) wxEVT_SYS_COLOUR_CHANGED));
+        PyDict_SetItemString(d,"wxEVT_DISPLAY_CHANGED", PyInt_FromLong((long) wxEVT_DISPLAY_CHANGED));
         PyDict_SetItemString(d,"wxEVT_SETTING_CHANGED", PyInt_FromLong((long) wxEVT_SETTING_CHANGED));
         PyDict_SetItemString(d,"wxEVT_QUERY_NEW_PALETTE", PyInt_FromLong((long) wxEVT_QUERY_NEW_PALETTE));
         PyDict_SetItemString(d,"wxEVT_PALETTE_CHANGED", PyInt_FromLong((long) wxEVT_PALETTE_CHANGED));
@@ -2625,6 +2627,7 @@ SWIGEXPORT(void) initwxc() {
     initclip_dndc();
     initstreamsc();
     initfilesysc();
+    initutilsc();
 
 
     PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION ));
index 34b37c678a2074d84839f1f70cd63e84db347e2b..81aec65c68c0a6c4832ef0635bcdfd080d76f04d 100644 (file)
@@ -853,6 +853,7 @@ wxEVT_MENU_INIT = wxc.wxEVT_MENU_INIT
 wxEVT_MENU_HIGHLIGHT = wxc.wxEVT_MENU_HIGHLIGHT
 wxEVT_POPUP_MENU_INIT = wxc.wxEVT_POPUP_MENU_INIT
 wxEVT_SYS_COLOUR_CHANGED = wxc.wxEVT_SYS_COLOUR_CHANGED
+wxEVT_DISPLAY_CHANGED = wxc.wxEVT_DISPLAY_CHANGED
 wxEVT_SETTING_CHANGED = wxc.wxEVT_SETTING_CHANGED
 wxEVT_QUERY_NEW_PALETTE = wxc.wxEVT_QUERY_NEW_PALETTE
 wxEVT_PALETTE_CHANGED = wxc.wxEVT_PALETTE_CHANGED
@@ -984,6 +985,9 @@ def EVT_INIT_DIALOG(win, func):
 def EVT_SYS_COLOUR_CHANGED(win, func):
     win.Connect(-1, -1, wxEVT_SYS_COLOUR_CHANGED, func)
 
+def EVT_DISPLAY_CHANGED(win, func):
+    win.Connect(-1, -1, wxEVT_DISPLAY_CHANGED, func)
+
 def EVT_SHOW(win, func):
     win.Connect(-1, -1, wxEVT_SHOW, func)
 
@@ -1664,7 +1668,15 @@ class __wxPyCleanup:
     def __del__(self):
         self.cleanup()
 
-__cleanMeUp = __wxPyCleanup()
+sys.__wxPythonCleanup = __wxPyCleanup()
+
+## # another possible solution, but it gets called too early...
+## if sys.version[0] == '2':
+##     import atexit
+##     atexit.register(wxc.wxApp_CleanUp)
+## else:
+##     sys.exitfunc = wxc.wxApp_CleanUp
+
 
 #----------------------------------------------------------------------------
 #----------------------------------------------------------------------------