]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
*** empty log message ***
[wxWidgets.git] / src / gtk / window.cpp
index 9a6841c797c516f3b9bf69116544edfa89b250e8..25f072ef1de057922df3f075ccb8ceb59da0545f 100644 (file)
@@ -223,18 +223,21 @@ static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget),
 
 void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window )
 {
-/*
-    wxString tmp = name;
-    tmp += wxT(" FROM ");
-    tmp += window;
+    // suppress warnings about gtk_debug_focus_in_callback being unused with
+    // this "if ( 0 )"
+    if ( 0 )
+    {
+        wxString tmp = name;
+        tmp += wxT(" FROM ");
+        tmp += window;
 
-    wxChar *s = new wxChar[tmp.Length()+1];
+        wxChar *s = new wxChar[tmp.Length()+1];
 
-    wxStrcpy( s, tmp );
+        wxStrcpy( s, tmp );
 
-    gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
-      GTK_SIGNAL_FUNC(gtk_debug_focus_in_callback), (gpointer)s );
-*/
+        gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
+          GTK_SIGNAL_FUNC(gtk_debug_focus_in_callback), (gpointer)s );
+    }
 }
 
 #endif // Debug
@@ -1651,27 +1654,36 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(m_widget), wxWindow *win )
 // "size_allocate"
 //-----------------------------------------------------------------------------
 
+#ifdef HAVE_XIM
+    #define WXUNUSED_UNLESS_XIM(param)  param
+#else
+    #define WXUNUSED_UNLESS_XIM(param)  WXUNUSED(param)
+#endif
+
 /* Resize XIM window */
 
-static void gtk_wxwindow_size_callback( GtkWidget *widget, GtkAllocation* alloc, wxFrame *win )
+static
+void gtk_wxwindow_size_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
+                                 GtkAllocation * WXUNUSED_UNLESS_XIM(alloc),
+                                 wxFrame * WXUNUSED_UNLESS_XIM(win) )
 {
     if (g_isIdle)
         wxapp_install_idle_handler();
 
+#ifdef HAVE_XIM
     if (!win->m_ic)
         return;
 
-#ifdef HAVE_XIM
     if  (gdk_ic_get_style (win->m_ic) & GDK_IM_PREEDIT_POSITION)
     {
         gint width, height;
 
-       gdk_window_get_size (widget->window, &width, &height);
+        gdk_window_get_size (widget->window, &width, &height);
         win->m_icattr->preedit_area.width = width;
         win->m_icattr->preedit_area.height = height;
         gdk_ic_set_attr (win->m_ic, win->m_icattr, GDK_IC_PREEDIT_AREA);
     }
-#endif
+#endif // HAVE_XIM
 }
 
 //-----------------------------------------------------------------------------
@@ -1681,7 +1693,8 @@ static void gtk_wxwindow_size_callback( GtkWidget *widget, GtkAllocation* alloc,
 /* Initialize XIM support */
 
 static gint
-gtk_wxwindow_realized_callback( GtkWidget *widget, wxWindow *win )
+gtk_wxwindow_realized_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
+                                wxWindow * WXUNUSED_UNLESS_XIM(win) )
 {
     if (g_isIdle)
         wxapp_install_idle_handler();
@@ -1698,7 +1711,7 @@ gtk_wxwindow_realized_callback( GtkWidget *widget, wxWindow *win )
     GdkEventMask mask;
     GdkColormap *colormap;
     GdkICAttr *attr = win->m_icattr;
-    GdkICAttributesType attrmask = GDK_IC_ALL_REQ;
+    unsigned attrmask = GDK_IC_ALL_REQ;
     GdkIMStyle style;
     GdkIMStyle supported_style = (GdkIMStyle)
                                   (GDK_IM_PREEDIT_NONE |
@@ -1748,7 +1761,7 @@ gtk_wxwindow_realized_callback( GtkWidget *widget, wxWindow *win )
          break;
     }
        
-      win->m_ic = gdk_ic_new (attr, attrmask);
+      win->m_ic = gdk_ic_new (attr, (GdkICAttributesType)attrmask);
      
       if (win->m_ic == NULL)
        g_warning ("Can't create input context.");