]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/app.cpp
compilation fixes after the last commit
[wxWidgets.git] / src / x11 / app.cpp
index 71650e7b2313c789a2743aea5949f208b4731fad..511b5fb034717810252b868c3426f87f864bdfb9 100644 (file)
@@ -26,6 +26,9 @@
 #include "wx/intl.h"
 #include "wx/evtloop.h"
 
 #include "wx/intl.h"
 #include "wx/evtloop.h"
 
+#include "wx/univ/theme.h"
+#include "wx/univ/renderer.h"
+
 #if wxUSE_THREADS
     #include "wx/thread.h"
 #endif
 #if wxUSE_THREADS
     #include "wx/thread.h"
 #endif
@@ -197,11 +200,11 @@ int wxEntryStart( int& argc, char *argv[] )
             if (i < (argc - 1))
             {
                 i ++;
             if (i < (argc - 1))
             {
                 i ++;
-                windowGeometry = argv[i];
+                wxString windowGeometry = argv[i];
                 int w, h;
                 if (wxSscanf(windowGeometry.c_str(), _T("%dx%d"), &w, &h) != 2)
                 {
                 int w, h;
                 if (wxSscanf(windowGeometry.c_str(), _T("%dx%d"), &w, &h) != 2)
                 {
-                    wxLogError(_("Invalid geometry specification '%s'", windowGeometry.c_str());
+                    wxLogError(_("Invalid geometry specification '%s'"), windowGeometry.c_str());
                 }
                 else
                 {
                 }
                 else
                 {
@@ -248,7 +251,7 @@ int wxEntryStart( int& argc, char *argv[] )
     
     XSelectInput( xdisplay, XDefaultRootWindow(xdisplay), PropertyChangeMask);
         
     
     XSelectInput( xdisplay, XDefaultRootWindow(xdisplay), PropertyChangeMask);
         
-//    wxSetDetectableAutoRepeat( TRUE );
+    wxSetDetectableAutoRepeat( TRUE );
 
     if (!wxApp::Initialize())
         return -1;
 
     if (!wxApp::Initialize())
         return -1;
@@ -405,7 +408,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
     wxWindow* win = NULL;
     Window window = event->xany.window;
     Window actualWindow = window;
     wxWindow* win = NULL;
     Window window = event->xany.window;
     Window actualWindow = window;
-
+    
     // Find the first wxWindow that corresponds to this event window
     // Because we're receiving events after a window
     // has been destroyed, assume a 1:1 match between
     // Find the first wxWindow that corresponds to this event window
     // Because we're receiving events after a window
     // has been destroyed, assume a 1:1 match between
@@ -481,8 +484,8 @@ void wxApp::ProcessXEvent(WXEvent* _event)
             if (win && !win->IsEnabled())
                 return;
 
             if (win && !win->IsEnabled())
                 return;
 
-            Atom wm_delete_window = XInternAtom(wxGlobalDisplay(), "WM_DELETE_WINDOW", True);;
-            Atom wm_protocols = XInternAtom(wxGlobalDisplay(), "WM_PROTOCOLS", True);;
+            Atom wm_delete_window = XInternAtom(wxGlobalDisplay(), "WM_DELETE_WINDOW", True);
+            Atom wm_protocols = XInternAtom(wxGlobalDisplay(), "WM_PROTOCOLS", True);
 
             if (event->xclient.message_type == wm_protocols)
             {
 
             if (event->xclient.message_type == wm_protocols)
             {
@@ -548,21 +551,49 @@ void wxApp::ProcessXEvent(WXEvent* _event)
 
             return;
         }
 
             return;
         }
+        case GraphicsExpose:
+        {
+            if (win)
+            {
+                // wxLogDebug( "GraphicsExpose from %s", win->GetName().c_str(),
+                //                              event->xgraphicsexpose.x, event->xgraphicsexpose.y,
+                //                              event->xgraphicsexpose.width, event->xgraphicsexpose.height);
+                    
+                win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
+                                              event->xgraphicsexpose.width, event->xgraphicsexpose.height);
+                                              
+                win->GetClearRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y,
+                                             event->xgraphicsexpose.width, event->xgraphicsexpose.height);
+                                              
+                // if (event->xgraphicsexpose.count == 0)
+                //    win->Update();
+            }
+
+            return;
+        }
         case EnterNotify:
         case LeaveNotify:
         case ButtonPress:
         case ButtonRelease:
         case MotionNotify:
         {
         case EnterNotify:
         case LeaveNotify:
         case ButtonPress:
         case ButtonRelease:
         case MotionNotify:
         {
-            if (win && !win->IsEnabled())
+            if (!win)
                 return;
                 return;
-
-            if (win)
+                
+            if (!win->IsEnabled())
+                return;
+            
+#if 1
+            if (event->type == ButtonPress)
             {
             {
-                wxMouseEvent wxevent;
-                wxTranslateMouseEvent(wxevent, win, window, event);
-                win->GetEventHandler()->ProcessEvent( wxevent );
+                if ((win != wxWindow::FindFocus()) && win->AcceptsFocus())
+                   win->SetFocus();
             }
             }
+#endif
+
+            wxMouseEvent wxevent;
+            wxTranslateMouseEvent(wxevent, win, window, event);
+            win->GetEventHandler()->ProcessEvent( wxevent );
             return;
         }
         case FocusIn:
             return;
         }
         case FocusIn:
@@ -585,7 +616,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
                 if (win && event->xfocus.detail != NotifyPointer)
 #endif
                 {
                 if (win && event->xfocus.detail != NotifyPointer)
 #endif
                 {
-                    wxLogDebug( "FocusOut from %s\n", win->GetName().c_str() );
+                    wxLogDebug( "FocusOut from %s", win->GetName().c_str() );
                     
                     wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
                     focusEvent.SetEventObject(win);
                     
                     wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
                     focusEvent.SetEventObject(win);
@@ -838,37 +869,9 @@ bool wxApp::Yield(bool onlyIfNeeded)
     return TRUE;
 }
 
     return TRUE;
 }
 
-// XPM hack: make the arrays const
-#define static static const
-
-#include "wx/generic/info.xpm"
-#include "wx/generic/error.xpm"
-#include "wx/generic/question.xpm"
-#include "wx/generic/warning.xpm"
-
-#undef static
-
-wxIcon
-wxApp::GetStdIcon(int which) const
+wxIcon wxApp::GetStdIcon(int which) const
 {
 {
-    switch(which)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon(info_xpm);
-
-        case wxICON_QUESTION:
-            return wxIcon(question_xpm);
-
-        case wxICON_EXCLAMATION:
-            return wxIcon(warning_xpm);
-
-        default:
-            wxFAIL_MSG("requested non existent standard icon");
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon(error_xpm);
-    }
+    return wxTheme::Get()->GetRenderer()->GetStdIcon(which);
 }
 
 void wxApp::OnAssert(const wxChar *file, int line, const wxChar *msg)
 }
 
 void wxApp::OnAssert(const wxChar *file, int line, const wxChar *msg)