-#include "wx/frame.h"
-#include "wx/app.h"
-#include "wx/cursor.h"
-
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "wx/gtk/win_gtk.h"
-
-//-----------------------------------------------------------------------------
-// idle system
-//-----------------------------------------------------------------------------
-
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
-extern int g_openDialogs;
-
-//-----------------------------------------------------------------------------
-// data
-//-----------------------------------------------------------------------------
-
-extern wxList wxPendingDelete;
-
-//-----------------------------------------------------------------------------
-// "focus" from m_window
-//-----------------------------------------------------------------------------
-
-static gint gtk_dialog_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- // This disables GTK's tab traversal
- gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus" );
- return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-// "delete_event"
-//-----------------------------------------------------------------------------
-
-bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- if (win->IsEnabled())
- win->Close();
-
- return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-// "size_allocate"
-//-----------------------------------------------------------------------------
-
-static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxDialog *win )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- if (!win->m_hasVMT) return;
-
- if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
- {
- win->m_width = alloc->width;
- win->m_height = alloc->height;
- win->GtkUpdateSize();
- }
-}
-
-//-----------------------------------------------------------------------------
-// "configure_event"
-//-----------------------------------------------------------------------------
-
-static gint
-#if (GTK_MINOR_VERSION > 0)
-gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDialog *win )
-#else
-gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxDialog *win )
-#endif
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- if (!win->m_hasVMT) return FALSE;
-
-#if (GTK_MINOR_VERSION > 0)
- int x = 0;
- int y = 0;
- gdk_window_get_root_origin( win->m_widget->window, &x, &y );
- win->m_x = x;
- win->m_y = y;
-#else
- win->m_x = event->x;
- win->m_y = event->y;
-#endif
-
- wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
- mevent.SetEventObject( win );
- win->GetEventHandler()->ProcessEvent( mevent );
-
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-// "realize" from m_widget
-//-----------------------------------------------------------------------------
-
-/* we cannot MWM hints and icons before the widget has been realized,
- so we do this directly after realization */
-
-static gint
-gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxDialog *win )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- /* all this is for Motif Window Manager "hints" and is supposed to be
- recognized by other WM as well. not tested. */
- long decor = (long) GDK_DECOR_BORDER;
- long func = (long) GDK_FUNC_MOVE ;
-
- /* Some WM don't display any border around the frame contents if
- used with these hints, so we add a resize border around it,
- without automatically allowinng it to be resized though.