-//-----------------------------------------------------------------------------
-// "event" of m_wxwindow
-//-----------------------------------------------------------------------------
-
-#ifndef __WXGTK20__
-
-// GTK thinks it is clever and filters out a certain amount of "unneeded"
-// expose events. We need them, of course, so we override the main event
-// procedure in GtkWidget by giving our own handler for all system events.
-// There, we look for expose events ourselves whereas all other events are
-// handled normally.
-
-extern "C" {
-static
-gint gtk_window_event_event_callback( GtkWidget *widget,
- GdkEventExpose *event,
- wxWindow *win )
-{
- if (event->type == GDK_EXPOSE)
- {
- gint ret = gtk_window_expose_callback( widget, event, win );
- return ret;
- }
-
- return FALSE;
-}
-}
-
-#endif // !GTK+ 2
-
-//-----------------------------------------------------------------------------
-// "draw" of m_wxwindow
-//-----------------------------------------------------------------------------
-
-#ifndef __WXGTK20__
-
-// This callback is a complete replacement of the gtk_pizza_draw() function,
-// which is disabled.
-
-extern "C" {
-static void gtk_window_draw_callback( GtkWidget *widget,
- GdkRectangle *rect,
- wxWindow *win )
-{
- DEBUG_MAIN_THREAD
-
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- // if there are any children we must refresh everything
- //
- // VZ: why?
- if ( !win->HasFlag(wxFULL_REPAINT_ON_RESIZE) &&
- win->GetChildren().IsEmpty() )
- {
- return;
- }
-
-#if 0
- if (win->GetName())
- {
- wxPrintf( wxT("OnDraw from ") );
- if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
- wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( wxT(" %d %d %d %d\n"), (int)rect->x,
- (int)rect->y,
- (int)rect->width,
- (int)rect->height );
- }
-#endif
-
-#ifndef __WXUNIVERSAL__
- GtkPizza *pizza = GTK_PIZZA (widget);
-
- if (win->GetThemeEnabled() && win->GetBackgroundStyle() == wxBG_STYLE_SYSTEM)
- {
- wxWindow *parent = win->GetParent();
- while (parent && !parent->IsTopLevel())
- parent = parent->GetParent();
- if (!parent)
- parent = win;
-
- gtk_paint_flat_box (parent->m_widget->style,
- pizza->bin_window,
- GTK_STATE_NORMAL,
- GTK_SHADOW_NONE,
- rect,
- parent->m_widget,
- (char *)"base",
- 0, 0, -1, -1);
- }
-#endif
-
- win->m_clearRegion.Union( rect->x, rect->y, rect->width, rect->height );
- win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
-
- // Update immediately, not in idle time.
- win->GtkUpdate();
-
-#ifndef __WXUNIVERSAL__
- // Redraw child widgets
- GList *children = pizza->children;
- while (children)
- {
- GtkPizzaChild *child = (GtkPizzaChild*) children->data;
- children = children->next;
-
- GdkRectangle child_area;
- if (gtk_widget_intersect (child->widget, rect, &child_area))
- {
- gtk_widget_draw (child->widget, &child_area /* (GdkRectangle*) NULL*/ );
- }
- }
-#endif
-}
-}
-
-#endif
-