]> git.saurik.com Git - wxWidgets.git/commitdiff
GTK+ 1 compilation fixes
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 24 Dec 2005 02:20:15 +0000 (02:20 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 24 Dec 2005 02:20:15 +0000 (02:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36559 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/cursor.cpp
src/gtk/menu.cpp
src/gtk/toplevel.cpp
src/gtk/window.cpp
src/gtk1/cursor.cpp
src/gtk1/menu.cpp
src/gtk1/toplevel.cpp
src/gtk1/window.cpp

index 1421608aa92021e84d297a779adb7cdee28a56dc..f277f4b0c9750e88cc65fd94dd00eeb5fcc01290 100644 (file)
@@ -69,7 +69,7 @@ wxCursor::wxCursor( int cursorId )
         case wxCURSOR_BLANK:
             {
                 static const gchar bits[] = { 0 };
-                static const GdkColor color = { 0, 0, 0, 0 };
+                static /* const -- not in GTK1 */ GdkColor color = { 0, 0, 0, 0 };
 
                 GdkPixmap *pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1);
                 M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap(pixmap,
index f0dad01dcfe8962984494eb891bfd0f599f10c9d..af9c1f673893a61d3409f7562e56dde27b2f4096 100644 (file)
 // we use normal item but with a special id for the menu title
 static const int wxGTK_TITLE_ID = -3;
 
+// defined in window.cpp
+#ifndef __WXGTK20__
+    extern guint32 wxGtkTimeLastClick;
+#endif
+
 //-----------------------------------------------------------------------------
 // idle system
 //-----------------------------------------------------------------------------
@@ -1624,7 +1629,7 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
 #ifdef __WXGTK20__
                   gtk_get_current_event_time()
 #else
-                  gs_timeLastClick              // the time of activation
+                  wxGtkTimeLastClick            // the time of activation
 #endif
                 );
 
index 5f3bdc21c8682da646d0a85b1cba25fe27d8f6fb..21f458ae6474eab2675fdae0a3d785bdda03c969 100644 (file)
@@ -1364,13 +1364,16 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
 
 void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
 {
+#ifdef __WXGTK20__
     // Store which styles were changed
     long styleChanges = style ^ m_windowStyle;
+#endif
 
     // Process wxWindow styles. This also updates the internal variable
     // Therefore m_windowStyle bits carry now the _new_ style values
     wxWindow::SetWindowStyleFlag(style);
 
+#ifdef __WXGTK20__
     // just return for now if widget does not exist yet
     if (!m_widget)
         return;
@@ -1378,11 +1381,12 @@ void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
 #ifdef __WXGTK24__
     if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) )
         gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP);
-#endif
+#endif // GTK+ 2.4
 #if GTK_CHECK_VERSION(2,2,0)
     if ( (styleChanges & wxFRAME_NO_TASKBAR) && !gtk_check_version(2,2,0) )
     {
         gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_widget), m_windowStyle & wxFRAME_NO_TASKBAR);
     }
-#endif
+#endif // GTK+ 2.2
+#endif // GTK+ 2.0
 }
index 48e5a7b17a8dd5ee7eb85604cba6078cb3e44caa..2cfd697af3644d533268d2d3977e337d599e035e 100644 (file)
@@ -238,9 +238,9 @@ wxWindowGTK *g_focusWindowLast = (wxWindowGTK*) NULL;
 wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
 
 // hack: we need something to pass to gtk_menu_popup, so we store the time of
-// the last click here
+// the last click here (extern: used from gtk/menu.cpp)
 #ifndef __WXGTK20__
-static guint32 gs_timeLastClick = 0;
+guint32 wxGtkTimeLastClick = 0;
 #endif
 
 extern bool g_mainThreadLocked;
@@ -1802,7 +1802,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
         win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
 
 #ifndef __WXGTK20__
-    gs_timeLastClick = gdk_event->time;
+    wxGtkTimeLastClick = gdk_event->time;
 
     if (event_type == wxEVT_LEFT_DCLICK)
     {
index 1421608aa92021e84d297a779adb7cdee28a56dc..f277f4b0c9750e88cc65fd94dd00eeb5fcc01290 100644 (file)
@@ -69,7 +69,7 @@ wxCursor::wxCursor( int cursorId )
         case wxCURSOR_BLANK:
             {
                 static const gchar bits[] = { 0 };
-                static const GdkColor color = { 0, 0, 0, 0 };
+                static /* const -- not in GTK1 */ GdkColor color = { 0, 0, 0, 0 };
 
                 GdkPixmap *pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1);
                 M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap(pixmap,
index f0dad01dcfe8962984494eb891bfd0f599f10c9d..af9c1f673893a61d3409f7562e56dde27b2f4096 100644 (file)
 // we use normal item but with a special id for the menu title
 static const int wxGTK_TITLE_ID = -3;
 
+// defined in window.cpp
+#ifndef __WXGTK20__
+    extern guint32 wxGtkTimeLastClick;
+#endif
+
 //-----------------------------------------------------------------------------
 // idle system
 //-----------------------------------------------------------------------------
@@ -1624,7 +1629,7 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
 #ifdef __WXGTK20__
                   gtk_get_current_event_time()
 #else
-                  gs_timeLastClick              // the time of activation
+                  wxGtkTimeLastClick            // the time of activation
 #endif
                 );
 
index 5f3bdc21c8682da646d0a85b1cba25fe27d8f6fb..21f458ae6474eab2675fdae0a3d785bdda03c969 100644 (file)
@@ -1364,13 +1364,16 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
 
 void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
 {
+#ifdef __WXGTK20__
     // Store which styles were changed
     long styleChanges = style ^ m_windowStyle;
+#endif
 
     // Process wxWindow styles. This also updates the internal variable
     // Therefore m_windowStyle bits carry now the _new_ style values
     wxWindow::SetWindowStyleFlag(style);
 
+#ifdef __WXGTK20__
     // just return for now if widget does not exist yet
     if (!m_widget)
         return;
@@ -1378,11 +1381,12 @@ void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
 #ifdef __WXGTK24__
     if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) )
         gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP);
-#endif
+#endif // GTK+ 2.4
 #if GTK_CHECK_VERSION(2,2,0)
     if ( (styleChanges & wxFRAME_NO_TASKBAR) && !gtk_check_version(2,2,0) )
     {
         gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_widget), m_windowStyle & wxFRAME_NO_TASKBAR);
     }
-#endif
+#endif // GTK+ 2.2
+#endif // GTK+ 2.0
 }
index 48e5a7b17a8dd5ee7eb85604cba6078cb3e44caa..2cfd697af3644d533268d2d3977e337d599e035e 100644 (file)
@@ -238,9 +238,9 @@ wxWindowGTK *g_focusWindowLast = (wxWindowGTK*) NULL;
 wxWindowGTK *g_delayedFocus = (wxWindowGTK*) NULL;
 
 // hack: we need something to pass to gtk_menu_popup, so we store the time of
-// the last click here
+// the last click here (extern: used from gtk/menu.cpp)
 #ifndef __WXGTK20__
-static guint32 gs_timeLastClick = 0;
+guint32 wxGtkTimeLastClick = 0;
 #endif
 
 extern bool g_mainThreadLocked;
@@ -1802,7 +1802,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
         win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
 
 #ifndef __WXGTK20__
-    gs_timeLastClick = gdk_event->time;
+    wxGtkTimeLastClick = gdk_event->time;
 
     if (event_type == wxEVT_LEFT_DCLICK)
     {