X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dbf858b5d69f53efd3950cae99322f54355aa983..ef44a62179cde47dffb369b9731b2f74d54de52f:/src/gtk1/dcscreen.cpp?ds=sidebyside diff --git a/src/gtk1/dcscreen.cpp b/src/gtk1/dcscreen.cpp index ed085d15d7..bdb29ad1bd 100644 --- a/src/gtk1/dcscreen.cpp +++ b/src/gtk1/dcscreen.cpp @@ -34,8 +34,8 @@ extern "C" { #include "gdk/gdkx.h" #include -int nevent_masks = 17; -int event_mask_table[19] = +int my_nevent_masks = 17; +int my_event_masks_table[19] = { ExposureMask, PointerMotionMask, @@ -122,6 +122,8 @@ gdk_window_transparent_new ( GdkWindow *parent, gprivate->height = (attributes->height > 1) ? (attributes->height) : (1); gprivate->window_type = attributes->window_type; gprivate->extension_events = FALSE; + +#ifndef NEW_GTK_DND_CODE gprivate->dnd_drag_data_type = None; gprivate->dnd_drag_data_typesavail = gprivate->dnd_drop_data_typesavail = NULL; @@ -130,6 +132,7 @@ gdk_window_transparent_new ( GdkWindow *parent, gprivate->dnd_drop_data_numtypesavail = gprivate->dnd_drag_data_numtypesavail = 0; gprivate->dnd_drag_eventmask = gprivate->dnd_drag_savedeventmask = 0; +#endif gprivate->filters = NULL; gprivate->children = NULL; @@ -143,10 +146,10 @@ gdk_window_transparent_new ( GdkWindow *parent, xvisual = ((GdkVisualPrivate*) visual)->xvisual; xattributes.event_mask = StructureNotifyMask; - for (i = 0; i < nevent_masks; i++) + for (i = 0; i < my_nevent_masks; i++) { if (attributes->event_mask & (1 << (i + 1))) - xattributes.event_mask |= event_mask_table[i]; + xattributes.event_mask |= my_event_masks_table[i]; } if (xattributes.event_mask) @@ -209,7 +212,11 @@ gdk_window_transparent_new ( GdkWindow *parent, if (attributes_mask & GDK_WA_TITLE) title = attributes->title; else +#if (GTK_MINOR_VERSION == 1) + title = "Unknown"; // GLH: Well I don't know for the moment what to write here. +#else title = gdk_progname; +#endif XmbSetWMProperties (gprivate->xdisplay, gprivate->xwindow, title, title, @@ -238,54 +245,56 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC) wxScreenDC::wxScreenDC(void) { - m_ok = FALSE; - m_window = (GdkWindow *) NULL; - m_cmap = gdk_colormap_get_system(); + m_ok = FALSE; + m_window = (GdkWindow *) NULL; + m_cmap = gdk_colormap_get_system(); - if (sm_overlayWindow) - { - m_window = sm_overlayWindow; - m_deviceOriginX = - sm_overlayWindowX; - m_deviceOriginY = - sm_overlayWindowY; - } - else - m_window = GDK_ROOT_PARENT(); + if (sm_overlayWindow) + { + m_window = sm_overlayWindow; + m_deviceOriginX = - sm_overlayWindowX; + m_deviceOriginY = - sm_overlayWindowY; + } + else + { + m_window = GDK_ROOT_PARENT(); + } - SetUpDC(); + SetUpDC(); - gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS ); - gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS ); - gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS ); - gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS ); + gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS ); + gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS ); + gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS ); + gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS ); } wxScreenDC::~wxScreenDC(void) { - EndDrawingOnTop(); + EndDrawingOnTop(); } bool wxScreenDC::StartDrawingOnTop( wxWindow *window ) { - if (!window) return StartDrawingOnTop(); + if (!window) return StartDrawingOnTop(); - int x = 0; - int y = 0; - window->GetPosition( &x, &y ); - int w = 0; - int h = 0; - window->GetSize( &w, &h ); - window->ClientToScreen( &x, &y ); + int x = 0; + int y = 0; + window->GetPosition( &x, &y ); + int w = 0; + int h = 0; + window->GetSize( &w, &h ); + window->ClientToScreen( &x, &y ); - wxRectangle rect; - rect.x = x; - rect.y = y; - rect.width = 0; - rect.height = 0; + wxRect rect; + rect.x = x; + rect.y = y; + rect.width = 0; + rect.height = 0; - return StartDrawingOnTop( &rect ); + return StartDrawingOnTop( &rect ); } -bool wxScreenDC::StartDrawingOnTop( wxRectangle *rect ) +bool wxScreenDC::StartDrawingOnTop( wxRect *rect ) { int x = 0; int y = 0; @@ -322,12 +331,12 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *rect ) bool wxScreenDC::EndDrawingOnTop(void) { - if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow ); + if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow ); - sm_overlayWindow = NULL; - sm_overlayWindowX = 0; - sm_overlayWindowY = 0; + sm_overlayWindow = NULL; + sm_overlayWindowX = 0; + sm_overlayWindowY = 0; - return TRUE; + return TRUE; }