extern "C" {
#endif /* __cplusplus */
-
#define GTK_PIZZA(obj) GTK_CHECK_CAST (obj, gtk_pizza_get_type (), GtkPizza)
#define GTK_PIZZA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_pizza_get_type (), GtkPizzaClass)
#define GTK_IS_PIZZA(obj) GTK_CHECK_TYPE (obj, gtk_pizza_get_type ())
/* Shadow types */
typedef enum
{
- GTK_MYSHADOW_NONE,
- GTK_MYSHADOW_THIN,
- GTK_MYSHADOW_IN,
- GTK_MYSHADOW_OUT
+ GTK_MYSHADOW_NONE,
+ GTK_MYSHADOW_THIN,
+ GTK_MYSHADOW_IN,
+ GTK_MYSHADOW_OUT
} GtkMyShadowType;
typedef struct _GtkPizza GtkPizza;
struct _GtkPizza
{
- GtkContainer container;
- GList *children;
- GtkMyShadowType shadow_type;
+ GtkContainer container;
+ GList *children;
+ GtkMyShadowType shadow_type;
- guint width;
- guint height;
+ guint width;
+ guint height;
- guint xoffset;
- guint yoffset;
+ guint xoffset;
+ guint yoffset;
- GdkWindow *bin_window;
+ GdkWindow *bin_window;
- GdkVisibilityState visibility;
- gulong configure_serial;
- gint scroll_x;
- gint scroll_y;
+ GdkVisibilityState visibility;
+ gulong configure_serial;
+ gint scroll_x;
+ gint scroll_y;
- gboolean clear_on_draw;
+ gboolean clear_on_draw;
+ gboolean use_filter;
};
struct _GtkPizzaClass
guint gtk_pizza_get_type (void);
GtkWidget* gtk_pizza_new (void);
-void gtk_pizza_set_shadow_type (GtkPizza *pizza,
- GtkMyShadowType type);
+void gtk_pizza_set_shadow_type (GtkPizza *pizza,
+ GtkMyShadowType type);
+
+void gtk_pizza_set_clear (GtkPizza *pizza,
+ gboolean clear);
-void gtk_pizza_set_clear (GtkPizza *pizza,
- gboolean clear);
+void gtk_pizza_set_filter (GtkPizza *pizza,
+ gboolean use);
-void gtk_pizza_scroll (GtkPizza *pizza,
- gint dx,
- gint dy);
+void gtk_pizza_scroll (GtkPizza *pizza,
+ gint dx,
+ gint dy);
-void gtk_pizza_put (GtkPizza *pizza,
- GtkWidget *widget,
- gint x,
- gint y,
- gint width,
- gint height);
-
-void gtk_pizza_move (GtkPizza *pizza,
- GtkWidget *widget,
- gint x,
- gint y );
+void gtk_pizza_put (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+
+void gtk_pizza_move (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint x,
+ gint y );
-void gtk_pizza_resize (GtkPizza *pizza,
- GtkWidget *widget,
- gint width,
- gint height );
+void gtk_pizza_resize (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint width,
+ gint height );
-void gtk_pizza_set_size (GtkPizza *pizza,
- GtkWidget *widget,
- gint x,
- gint y,
- gint width,
- gint height);
+void gtk_pizza_set_size (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
#ifdef __cplusplus
}
#endif /* __cplusplus */
extern "C" {
#endif /* __cplusplus */
-
#define GTK_PIZZA(obj) GTK_CHECK_CAST (obj, gtk_pizza_get_type (), GtkPizza)
#define GTK_PIZZA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_pizza_get_type (), GtkPizzaClass)
#define GTK_IS_PIZZA(obj) GTK_CHECK_TYPE (obj, gtk_pizza_get_type ())
/* Shadow types */
typedef enum
{
- GTK_MYSHADOW_NONE,
- GTK_MYSHADOW_THIN,
- GTK_MYSHADOW_IN,
- GTK_MYSHADOW_OUT
+ GTK_MYSHADOW_NONE,
+ GTK_MYSHADOW_THIN,
+ GTK_MYSHADOW_IN,
+ GTK_MYSHADOW_OUT
} GtkMyShadowType;
typedef struct _GtkPizza GtkPizza;
struct _GtkPizza
{
- GtkContainer container;
- GList *children;
- GtkMyShadowType shadow_type;
+ GtkContainer container;
+ GList *children;
+ GtkMyShadowType shadow_type;
- guint width;
- guint height;
+ guint width;
+ guint height;
- guint xoffset;
- guint yoffset;
+ guint xoffset;
+ guint yoffset;
- GdkWindow *bin_window;
+ GdkWindow *bin_window;
- GdkVisibilityState visibility;
- gulong configure_serial;
- gint scroll_x;
- gint scroll_y;
+ GdkVisibilityState visibility;
+ gulong configure_serial;
+ gint scroll_x;
+ gint scroll_y;
- gboolean clear_on_draw;
+ gboolean clear_on_draw;
+ gboolean use_filter;
};
struct _GtkPizzaClass
guint gtk_pizza_get_type (void);
GtkWidget* gtk_pizza_new (void);
-void gtk_pizza_set_shadow_type (GtkPizza *pizza,
- GtkMyShadowType type);
+void gtk_pizza_set_shadow_type (GtkPizza *pizza,
+ GtkMyShadowType type);
+
+void gtk_pizza_set_clear (GtkPizza *pizza,
+ gboolean clear);
-void gtk_pizza_set_clear (GtkPizza *pizza,
- gboolean clear);
+void gtk_pizza_set_filter (GtkPizza *pizza,
+ gboolean use);
-void gtk_pizza_scroll (GtkPizza *pizza,
- gint dx,
- gint dy);
+void gtk_pizza_scroll (GtkPizza *pizza,
+ gint dx,
+ gint dy);
-void gtk_pizza_put (GtkPizza *pizza,
- GtkWidget *widget,
- gint x,
- gint y,
- gint width,
- gint height);
-
-void gtk_pizza_move (GtkPizza *pizza,
- GtkWidget *widget,
- gint x,
- gint y );
+void gtk_pizza_put (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+
+void gtk_pizza_move (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint x,
+ gint y );
-void gtk_pizza_resize (GtkPizza *pizza,
- GtkWidget *widget,
- gint width,
- gint height );
+void gtk_pizza_resize (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint width,
+ gint height );
-void gtk_pizza_set_size (GtkPizza *pizza,
- GtkWidget *widget,
- gint x,
- gint y,
- gint width,
- gint height);
+void gtk_pizza_set_size (GtkPizza *pizza,
+ GtkWidget *widget,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
#ifdef __cplusplus
}
#endif /* __cplusplus */
MyFrame *m_owner;
ScreenToShow m_show;
+ wxBitmap m_smile_bmp;
+ wxIcon m_std_icon;
DECLARE_EVENT_TABLE()
};
EVT_MOTION (MyCanvas::OnMouseMove)
END_EVENT_TABLE()
+#include "../image/smile.xpm"
+
MyCanvas::MyCanvas( MyFrame *parent ) : wxScrolledWindow( parent )
{
m_owner = parent;
m_show = Show_Default;
+ m_smile_bmp = wxBitmap(smile_xpm);
+ m_std_icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
}
//draw a polygon and an overlapping rectangle
dc.DrawCheckMark(25, 80, 30, 30);
dc.DrawCheckMark(60, 80, 60, 60);
- // this is the test for "blitting bitmap into DC damages selected brush"
- // bug
- wxIcon icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
- wxCoord rectSize = icon.GetWidth() + 10;
+ // this is the test for "blitting bitmap into DC damages selected brush" bug
+ wxIcon m_std_icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
+ wxCoord rectSize = m_std_icon.GetWidth() + 10;
wxCoord x = 100;
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush( *wxGREEN_BRUSH );
dc.DrawRectangle(x, 10, rectSize, rectSize);
- dc.DrawBitmap(icon, x + 5, 15, TRUE);
+ dc.DrawBitmap(m_std_icon, x + 5, 15, TRUE);
x += rectSize + 10;
dc.DrawRectangle(x, 10, rectSize, rectSize);
- dc.DrawIcon(wxTheApp->GetStdIcon(wxICON_INFORMATION), x + 5, 15);
+ dc.DrawIcon(m_std_icon, x + 5, 15);
x += rectSize + 10;
dc.DrawRectangle(x, 10, rectSize, rectSize);
// test for "transparent" bitmap drawing (it intersects with the last
// rectangle above)
//dc.SetBrush( *wxTRANSPARENT_BRUSH );
- #include "../image/smile.xpm"
- wxBitmap bmp(smile_xpm);
- if (bmp.Ok())
- dc.DrawBitmap(bmp, x + rectSize - 20, rectSize - 10, TRUE);
+ if (m_smile_bmp.Ok())
+ dc.DrawBitmap(m_smile_bmp, x + rectSize - 20, rectSize - 10, TRUE);
dc.SetBrush( *wxBLACK_BRUSH );
dc.DrawRectangle( 0, 160, 1000, 300 );
// Implement Pool of Graphic contexts. Creating them takes too much time.
//-----------------------------------------------------------------------------
+enum wxPoolGCType
+{
+ wxGC_ERROR = 0,
+ wxTEXT_MONO,
+ wxBG_MONO,
+ wxPEN_MONO,
+ wxBRUSH_MONO,
+ wxTEXT_COLOUR,
+ wxBG_COLOUR,
+ wxPEN_COLOUR,
+ wxBRUSH_COLOUR
+};
+
struct wxGC
{
- GdkGC *m_gc;
- bool m_mono;
- bool m_used;
+ GdkGC *m_gc;
+ wxPoolGCType m_type;
+ bool m_used;
};
static wxGC wxGCPool[200];
}
}
-static GdkGC* wxGetPoolGC( GdkWindow *window, bool mono=FALSE )
+static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
{
for (int i = 0; i < 200; i++)
{
{
wxGCPool[i].m_gc = gdk_gc_new( window );
gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
- wxGCPool[i].m_mono = mono;
+ wxGCPool[i].m_type = type;
wxGCPool[i].m_used = FALSE;
}
- if ((!wxGCPool[i].m_used) && (wxGCPool[i].m_mono == mono))
+ if ((!wxGCPool[i].m_used) && (wxGCPool[i].m_type == type))
{
wxGCPool[i].m_used = TRUE;
return wxGCPool[i].m_gc;
if (!m_penGC)
{
- m_penGC = wxGetPoolGC( m_window );
- m_brushGC = wxGetPoolGC( m_window );
- m_textGC = wxGetPoolGC( m_window );
- m_bgGC = wxGetPoolGC( m_window );
+ m_penGC = wxGetPoolGC( m_window, wxPEN_COLOUR );
+ m_brushGC = wxGetPoolGC( m_window, wxBRUSH_COLOUR );
+ m_textGC = wxGetPoolGC( m_window, wxTEXT_COLOUR );
+ m_bgGC = wxGetPoolGC( m_window, wxBG_COLOUR );
}
/* background colour */
gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() );
gdk_gc_set_fill( m_textGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_textGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
/* m_penGC */
m_pen.GetColour().CalcPixel( m_cmap );
gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() );
gdk_gc_set_background( m_penGC, bg_col );
- gdk_gc_set_fill( m_penGC, GDK_SOLID );
gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
gdk_gc_set_background( m_brushGC, bg_col );
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_brushGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
/* m_bgGC */
gdk_gc_set_foreground( m_bgGC, bg_col );
gdk_gc_set_fill( m_bgGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_bgGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
/* ROPs */
gdk_gc_set_function( m_textGC, GDK_COPY );
gdk_gc_set_function( m_brushGC, GDK_COPY );
gdk_gc_set_function( m_penGC, GDK_COPY );
- gdk_gc_set_function( m_bgGC, GDK_COPY );
/* clipping */
gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL );
wxPaintDC::wxPaintDC( wxWindow *win )
: wxWindowDC( win )
{
-/*
if (!win->GetUpdateRegion().IsEmpty())
{
m_paintClippingRegion = win->GetUpdateRegion();
gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() );
}
-*/
}
//-----------------------------------------------------------------------------
pizza->visibility = GDK_VISIBILITY_PARTIAL;
pizza->clear_on_draw = TRUE;
+ pizza->use_filter = FALSE;
}
GtkWidget*
void
gtk_pizza_set_shadow_type (GtkPizza *pizza,
- GtkMyShadowType type)
+ GtkMyShadowType type)
{
g_return_if_fail (pizza != NULL);
g_return_if_fail (GTK_IS_PIZZA (pizza));
void
gtk_pizza_set_clear (GtkPizza *pizza,
- gboolean clear)
+ gboolean clear)
{
g_return_if_fail (pizza != NULL);
g_return_if_fail (GTK_IS_PIZZA (pizza));
pizza->clear_on_draw = clear;
}
+void
+gtk_pizza_set_filter (GtkPizza *pizza,
+ gboolean use)
+{
+ g_return_if_fail (pizza != NULL);
+ g_return_if_fail (GTK_IS_PIZZA (pizza));
+
+ pizza->use_filter = use;
+}
+
void
gtk_pizza_put (GtkPizza *pizza,
GtkWidget *widget,
if (!IS_ONSCREEN (x, y))
GTK_PRIVATE_SET_FLAG (widget, GTK_IS_OFFSCREEN);
+/*
if (GTK_WIDGET_REALIZED (pizza))
gtk_widget_realize (widget);
+*/
gtk_widget_set_usize (widget, width, height);
+/*
if (GTK_WIDGET_VISIBLE (pizza) && GTK_WIDGET_VISIBLE (widget))
{
if (GTK_WIDGET_MAPPED (pizza))
gtk_widget_queue_resize (widget);
}
+*/
}
void
pizza = GTK_PIZZA (widget);
-/*
- if (event->window == widget->window)
- {
- gtk_pizza_draw_border( pizza );
- return FALSE;
- }
-*/
-
if (event->window != pizza->bin_window)
return FALSE;
gint dx,
gint dy)
{
- GList *tmp_list;
- GtkPizzaAdjData data;
+ GList *tmp_list;
+ GtkPizzaAdjData data;
- data.dx = dx;
- data.dy = dy;
+ data.dx = dx;
+ data.dy = dy;
- tmp_list = pizza->children;
- while (tmp_list)
+ tmp_list = pizza->children;
+ while (tmp_list)
{
- GtkPizzaChild *child = tmp_list->data;
- tmp_list = tmp_list->next;
+ GtkPizzaChild *child = tmp_list->data;
+ tmp_list = tmp_list->next;
- child->widget->allocation.x += dx;
- child->widget->allocation.y += dy;
+ child->widget->allocation.x += dx;
+ child->widget->allocation.y += dy;
- if (GTK_WIDGET_NO_WINDOW (child->widget) &&
- GTK_IS_CONTAINER (child->widget))
- gtk_container_forall (GTK_CONTAINER (child->widget),
- gtk_pizza_adjust_allocations_recurse,
- &data);
+ if (GTK_WIDGET_NO_WINDOW (child->widget) &&
+ GTK_IS_CONTAINER (child->widget))
+ {
+ gtk_container_forall (GTK_CONTAINER (child->widget),
+ gtk_pizza_adjust_allocations_recurse,
+ &data);
+ }
}
}
gtk_pizza_expose_area (GtkPizza *pizza,
gint x, gint y, gint width, gint height)
{
- if (pizza->visibility == GDK_VISIBILITY_UNOBSCURED)
+ if (pizza->visibility == GDK_VISIBILITY_UNOBSCURED)
{
- GdkEventExpose event;
+ GdkEventExpose event;
- event.type = GDK_EXPOSE;
- event.send_event = TRUE;
- event.window = pizza->bin_window;
- event.count = 0;
+ event.type = GDK_EXPOSE;
+ event.send_event = TRUE;
+ event.window = pizza->bin_window;
+ event.count = 0;
- event.area.x = x;
- event.area.y = y;
- event.area.width = width;
- event.area.height = height;
+ event.area.x = x;
+ event.area.y = y;
+ event.area.width = width;
+ event.area.height = height;
- gdk_window_ref (event.window);
- gtk_widget_event (GTK_WIDGET (pizza), (GdkEvent *)&event);
- gdk_window_unref (event.window);
+ gdk_window_ref (event.window);
+ gtk_widget_event (GTK_WIDGET (pizza), (GdkEvent *)&event);
+ gdk_window_unref (event.window);
}
}
GdkEvent *event,
gpointer data)
{
- XEvent *xevent;
- GtkPizza *pizza;
-
- xevent = (XEvent *)gdk_xevent;
- pizza = GTK_PIZZA (data);
+ XEvent *xevent;
+ GtkPizza *pizza;
+ xevent = (XEvent *)gdk_xevent;
+
+ pizza = GTK_PIZZA (data);
+
switch (xevent->type)
{
case Expose:
break;
}
- return GDK_FILTER_CONTINUE;
+ return GDK_FILTER_CONTINUE;
}
/* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
GdkEvent *event,
gpointer data)
{
- XEvent *xevent;
- GtkPizza *pizza;
+ XEvent *xevent;
+ GtkPizza *pizza;
- xevent = (XEvent *)gdk_xevent;
- pizza = GTK_PIZZA (data);
+ xevent = (XEvent *)gdk_xevent;
+ pizza = GTK_PIZZA (data);
- if (xevent->type == VisibilityNotify)
+ if (xevent->type == VisibilityNotify)
{
- switch (xevent->xvisibility.state)
+ switch (xevent->xvisibility.state)
{
- case VisibilityFullyObscured:
- pizza->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
- break;
+ case VisibilityFullyObscured:
+ pizza->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
+ break;
- case VisibilityPartiallyObscured:
- pizza->visibility = GDK_VISIBILITY_PARTIAL;
- break;
+ case VisibilityPartiallyObscured:
+ pizza->visibility = GDK_VISIBILITY_PARTIAL;
+ break;
- case VisibilityUnobscured:
- pizza->visibility = GDK_VISIBILITY_UNOBSCURED;
- break;
+ case VisibilityUnobscured:
+ pizza->visibility = GDK_VISIBILITY_UNOBSCURED;
+ break;
}
-
- return GDK_FILTER_REMOVE;
+
+ return GDK_FILTER_REMOVE;
}
-
- return GDK_FILTER_CONTINUE;
+ return GDK_FILTER_CONTINUE;
}
{
DEBUG_MAIN_THREAD
- if (!win->m_hasVMT)
- return;
-
-/*
if (win->GetName() == wxT("columntitles"))
{
wxPrintf( wxT("OnExpose from ") );
(int)gdk_event->area.width,
(int)gdk_event->area.height );
}
-*/
win->GetUpdateRegion().Union( gdk_event->area.x,
gdk_event->area.y,
if (gdk_event->count > 0)
return;
+ if (!win->m_hasVMT)
+ return;
+
wxEraseEvent eevent( win->GetId() );
eevent.SetEventObject( win );
win->GetEventHandler()->ProcessEvent(eevent);
if (g_isIdle)
wxapp_install_idle_handler();
+
+ if ((rect->x == 0) && (rect->y == 0) && (rect->width <= 1) && (rect->height <= 1))
+ return;
-/*
- if ((win->GetName() == wxT("columntitles")) && (rect->x == 2))
+ if (win->GetName() == wxT("columntitles"))
{
wxPrintf( wxT("OnDraw from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
(int)rect->width,
(int)rect->height );
}
-*/
win->GetUpdateRegion().Union( rect->x, rect->y,
rect->width, rect->height );
+ if (!win->m_hasVMT)
+ return;
+
wxEraseEvent eevent( win->GetId() );
eevent.SetEventObject( win );
win->GetEventHandler()->ProcessEvent(eevent);
// Implement Pool of Graphic contexts. Creating them takes too much time.
//-----------------------------------------------------------------------------
+enum wxPoolGCType
+{
+ wxGC_ERROR = 0,
+ wxTEXT_MONO,
+ wxBG_MONO,
+ wxPEN_MONO,
+ wxBRUSH_MONO,
+ wxTEXT_COLOUR,
+ wxBG_COLOUR,
+ wxPEN_COLOUR,
+ wxBRUSH_COLOUR
+};
+
struct wxGC
{
- GdkGC *m_gc;
- bool m_mono;
- bool m_used;
+ GdkGC *m_gc;
+ wxPoolGCType m_type;
+ bool m_used;
};
static wxGC wxGCPool[200];
}
}
-static GdkGC* wxGetPoolGC( GdkWindow *window, bool mono=FALSE )
+static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
{
for (int i = 0; i < 200; i++)
{
{
wxGCPool[i].m_gc = gdk_gc_new( window );
gdk_gc_set_exposures( wxGCPool[i].m_gc, FALSE );
- wxGCPool[i].m_mono = mono;
+ wxGCPool[i].m_type = type;
wxGCPool[i].m_used = FALSE;
}
- if ((!wxGCPool[i].m_used) && (wxGCPool[i].m_mono == mono))
+ if ((!wxGCPool[i].m_used) && (wxGCPool[i].m_type == type))
{
wxGCPool[i].m_used = TRUE;
return wxGCPool[i].m_gc;
if (!m_penGC)
{
- m_penGC = wxGetPoolGC( m_window );
- m_brushGC = wxGetPoolGC( m_window );
- m_textGC = wxGetPoolGC( m_window );
- m_bgGC = wxGetPoolGC( m_window );
+ m_penGC = wxGetPoolGC( m_window, wxPEN_COLOUR );
+ m_brushGC = wxGetPoolGC( m_window, wxBRUSH_COLOUR );
+ m_textGC = wxGetPoolGC( m_window, wxTEXT_COLOUR );
+ m_bgGC = wxGetPoolGC( m_window, wxBG_COLOUR );
}
/* background colour */
gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() );
gdk_gc_set_fill( m_textGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_textGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
/* m_penGC */
m_pen.GetColour().CalcPixel( m_cmap );
gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() );
gdk_gc_set_background( m_penGC, bg_col );
- gdk_gc_set_fill( m_penGC, GDK_SOLID );
gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
gdk_gc_set_background( m_brushGC, bg_col );
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_brushGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
/* m_bgGC */
gdk_gc_set_foreground( m_bgGC, bg_col );
gdk_gc_set_fill( m_bgGC, GDK_SOLID );
- gdk_gc_set_line_attributes( m_bgGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
/* ROPs */
gdk_gc_set_function( m_textGC, GDK_COPY );
gdk_gc_set_function( m_brushGC, GDK_COPY );
gdk_gc_set_function( m_penGC, GDK_COPY );
- gdk_gc_set_function( m_bgGC, GDK_COPY );
/* clipping */
gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL );
wxPaintDC::wxPaintDC( wxWindow *win )
: wxWindowDC( win )
{
-/*
if (!win->GetUpdateRegion().IsEmpty())
{
m_paintClippingRegion = win->GetUpdateRegion();
gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() );
}
-*/
}
//-----------------------------------------------------------------------------
pizza->visibility = GDK_VISIBILITY_PARTIAL;
pizza->clear_on_draw = TRUE;
+ pizza->use_filter = FALSE;
}
GtkWidget*
void
gtk_pizza_set_shadow_type (GtkPizza *pizza,
- GtkMyShadowType type)
+ GtkMyShadowType type)
{
g_return_if_fail (pizza != NULL);
g_return_if_fail (GTK_IS_PIZZA (pizza));
void
gtk_pizza_set_clear (GtkPizza *pizza,
- gboolean clear)
+ gboolean clear)
{
g_return_if_fail (pizza != NULL);
g_return_if_fail (GTK_IS_PIZZA (pizza));
pizza->clear_on_draw = clear;
}
+void
+gtk_pizza_set_filter (GtkPizza *pizza,
+ gboolean use)
+{
+ g_return_if_fail (pizza != NULL);
+ g_return_if_fail (GTK_IS_PIZZA (pizza));
+
+ pizza->use_filter = use;
+}
+
void
gtk_pizza_put (GtkPizza *pizza,
GtkWidget *widget,
if (!IS_ONSCREEN (x, y))
GTK_PRIVATE_SET_FLAG (widget, GTK_IS_OFFSCREEN);
+/*
if (GTK_WIDGET_REALIZED (pizza))
gtk_widget_realize (widget);
+*/
gtk_widget_set_usize (widget, width, height);
+/*
if (GTK_WIDGET_VISIBLE (pizza) && GTK_WIDGET_VISIBLE (widget))
{
if (GTK_WIDGET_MAPPED (pizza))
gtk_widget_queue_resize (widget);
}
+*/
}
void
pizza = GTK_PIZZA (widget);
-/*
- if (event->window == widget->window)
- {
- gtk_pizza_draw_border( pizza );
- return FALSE;
- }
-*/
-
if (event->window != pizza->bin_window)
return FALSE;
gint dx,
gint dy)
{
- GList *tmp_list;
- GtkPizzaAdjData data;
+ GList *tmp_list;
+ GtkPizzaAdjData data;
- data.dx = dx;
- data.dy = dy;
+ data.dx = dx;
+ data.dy = dy;
- tmp_list = pizza->children;
- while (tmp_list)
+ tmp_list = pizza->children;
+ while (tmp_list)
{
- GtkPizzaChild *child = tmp_list->data;
- tmp_list = tmp_list->next;
+ GtkPizzaChild *child = tmp_list->data;
+ tmp_list = tmp_list->next;
- child->widget->allocation.x += dx;
- child->widget->allocation.y += dy;
+ child->widget->allocation.x += dx;
+ child->widget->allocation.y += dy;
- if (GTK_WIDGET_NO_WINDOW (child->widget) &&
- GTK_IS_CONTAINER (child->widget))
- gtk_container_forall (GTK_CONTAINER (child->widget),
- gtk_pizza_adjust_allocations_recurse,
- &data);
+ if (GTK_WIDGET_NO_WINDOW (child->widget) &&
+ GTK_IS_CONTAINER (child->widget))
+ {
+ gtk_container_forall (GTK_CONTAINER (child->widget),
+ gtk_pizza_adjust_allocations_recurse,
+ &data);
+ }
}
}
gtk_pizza_expose_area (GtkPizza *pizza,
gint x, gint y, gint width, gint height)
{
- if (pizza->visibility == GDK_VISIBILITY_UNOBSCURED)
+ if (pizza->visibility == GDK_VISIBILITY_UNOBSCURED)
{
- GdkEventExpose event;
+ GdkEventExpose event;
- event.type = GDK_EXPOSE;
- event.send_event = TRUE;
- event.window = pizza->bin_window;
- event.count = 0;
+ event.type = GDK_EXPOSE;
+ event.send_event = TRUE;
+ event.window = pizza->bin_window;
+ event.count = 0;
- event.area.x = x;
- event.area.y = y;
- event.area.width = width;
- event.area.height = height;
+ event.area.x = x;
+ event.area.y = y;
+ event.area.width = width;
+ event.area.height = height;
- gdk_window_ref (event.window);
- gtk_widget_event (GTK_WIDGET (pizza), (GdkEvent *)&event);
- gdk_window_unref (event.window);
+ gdk_window_ref (event.window);
+ gtk_widget_event (GTK_WIDGET (pizza), (GdkEvent *)&event);
+ gdk_window_unref (event.window);
}
}
GdkEvent *event,
gpointer data)
{
- XEvent *xevent;
- GtkPizza *pizza;
-
- xevent = (XEvent *)gdk_xevent;
- pizza = GTK_PIZZA (data);
+ XEvent *xevent;
+ GtkPizza *pizza;
+ xevent = (XEvent *)gdk_xevent;
+
+ pizza = GTK_PIZZA (data);
+
switch (xevent->type)
{
case Expose:
break;
}
- return GDK_FILTER_CONTINUE;
+ return GDK_FILTER_CONTINUE;
}
/* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
GdkEvent *event,
gpointer data)
{
- XEvent *xevent;
- GtkPizza *pizza;
+ XEvent *xevent;
+ GtkPizza *pizza;
- xevent = (XEvent *)gdk_xevent;
- pizza = GTK_PIZZA (data);
+ xevent = (XEvent *)gdk_xevent;
+ pizza = GTK_PIZZA (data);
- if (xevent->type == VisibilityNotify)
+ if (xevent->type == VisibilityNotify)
{
- switch (xevent->xvisibility.state)
+ switch (xevent->xvisibility.state)
{
- case VisibilityFullyObscured:
- pizza->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
- break;
+ case VisibilityFullyObscured:
+ pizza->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
+ break;
- case VisibilityPartiallyObscured:
- pizza->visibility = GDK_VISIBILITY_PARTIAL;
- break;
+ case VisibilityPartiallyObscured:
+ pizza->visibility = GDK_VISIBILITY_PARTIAL;
+ break;
- case VisibilityUnobscured:
- pizza->visibility = GDK_VISIBILITY_UNOBSCURED;
- break;
+ case VisibilityUnobscured:
+ pizza->visibility = GDK_VISIBILITY_UNOBSCURED;
+ break;
}
-
- return GDK_FILTER_REMOVE;
+
+ return GDK_FILTER_REMOVE;
}
-
- return GDK_FILTER_CONTINUE;
+ return GDK_FILTER_CONTINUE;
}
{
DEBUG_MAIN_THREAD
- if (!win->m_hasVMT)
- return;
-
-/*
if (win->GetName() == wxT("columntitles"))
{
wxPrintf( wxT("OnExpose from ") );
(int)gdk_event->area.width,
(int)gdk_event->area.height );
}
-*/
win->GetUpdateRegion().Union( gdk_event->area.x,
gdk_event->area.y,
if (gdk_event->count > 0)
return;
+ if (!win->m_hasVMT)
+ return;
+
wxEraseEvent eevent( win->GetId() );
eevent.SetEventObject( win );
win->GetEventHandler()->ProcessEvent(eevent);
if (g_isIdle)
wxapp_install_idle_handler();
+
+ if ((rect->x == 0) && (rect->y == 0) && (rect->width <= 1) && (rect->height <= 1))
+ return;
-/*
- if ((win->GetName() == wxT("columntitles")) && (rect->x == 2))
+ if (win->GetName() == wxT("columntitles"))
{
wxPrintf( wxT("OnDraw from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
(int)rect->width,
(int)rect->height );
}
-*/
win->GetUpdateRegion().Union( rect->x, rect->y,
rect->width, rect->height );
+ if (!win->m_hasVMT)
+ return;
+
wxEraseEvent eevent( win->GetId() );
eevent.SetEventObject( win );
win->GetEventHandler()->ProcessEvent(eevent);