[evolution/foocanvas: 4/4] Adapt to API changes between GnomeCanvas and FooCanvas.
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution/foocanvas: 4/4] Adapt to API changes between GnomeCanvas and FooCanvas.
- Date: Wed, 13 Jan 2010 21:03:23 +0000 (UTC)
commit c9c64c23f230d55cc2672ffb1d63ed7951fd3fbc
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Aug 13 22:48:30 2009 -0400
Adapt to API changes between GnomeCanvas and FooCanvas.
calendar/gui/e-day-view-main-item.c | 19 ++++++----
calendar/gui/e-day-view-time-item.c | 25 +++++++------
calendar/gui/e-day-view-top-item.c | 17 +++++----
calendar/gui/e-meeting-time-sel-item.c | 20 +++++++----
calendar/gui/e-week-view-event-item.c | 17 +++++----
calendar/gui/e-week-view-main-item.c | 17 +++++----
calendar/gui/e-week-view-titles-item.c | 17 +++++----
calendar/gui/weekday-picker.c | 1 -
widgets/misc/e-calendar-item.c | 29 ++++++++-------
widgets/misc/e-canvas-background.c | 21 +++++------
widgets/misc/e-canvas-utils.c | 6 ++--
widgets/misc/e-canvas.c | 2 +-
widgets/table/e-cell-text.c | 1 +
widgets/table/e-table-field-chooser-item.c | 13 +++++--
widgets/table/e-table-header-item.c | 13 +++++--
widgets/table/e-table-item.c | 13 +++++--
widgets/table/e-tree.c | 1 +
widgets/table/e-tree.h | 1 -
widgets/text/e-reflow.c | 24 ++++++------
widgets/text/e-text.c | 55 +++++++++++++++-------------
20 files changed, 181 insertions(+), 131 deletions(-)
---
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index d41e3e9..222c737 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -29,6 +29,8 @@
#include <config.h>
#endif
+#include <math.h>
+
#include <libecal/e-cal-time-util.h>
#include <e-calendar-view.h>
@@ -965,15 +967,15 @@ day_view_main_item_dispose (GObject *object)
static void
day_view_main_item_update (FooCanvasItem *item,
- gdouble *affine,
- ArtSVP *clip_path,
+ double i2w_dx,
+ double i2w_dy,
gint flags)
{
FooCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
canvas_item_class = FOO_CANVAS_ITEM_CLASS (parent_class);
- canvas_item_class->update (item, affine, clip_path, flags);
+ canvas_item_class->update (item, i2w_dx, i2w_dy, flags);
/* The item covers the entire canvas area. */
item->x1 = 0;
@@ -985,10 +987,7 @@ day_view_main_item_update (FooCanvasItem *item,
static void
day_view_main_item_draw (FooCanvasItem *canvas_item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
EDayViewMainItem *main_item;
EDayView *day_view;
@@ -999,6 +998,7 @@ day_view_main_item_draw (FooCanvasItem *canvas_item,
gint work_day_start_y, work_day_end_y;
gint day_x, day_w, work_day;
gint start_row, end_row, rect_x, rect_y, rect_width, rect_height;
+ gint x, y, width, height;
struct icaltimetype day_start_tt, today_tt;
gint weekday;
cairo_t *cr;
@@ -1006,6 +1006,11 @@ day_view_main_item_draw (FooCanvasItem *canvas_item,
GdkRegion *draw_region;
GdkRectangle rect;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
cr = gdk_cairo_create (drawable);
main_item = E_DAY_VIEW_MAIN_ITEM (canvas_item);
diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c
index 9b666d1..3778f76 100644
--- a/calendar/gui/e-day-view-time-item.c
+++ b/calendar/gui/e-day-view-time-item.c
@@ -74,12 +74,12 @@ struct _EDayViewTimeItemPrivate {
};
static void e_day_view_time_item_update (FooCanvasItem *item,
- double *affine,
- ArtSVP *clip_path, gint flags);
+ double i2w_dx,
+ double i2w_dy,
+ gint flags);
static void e_day_view_time_item_draw (FooCanvasItem *item,
GdkDrawable *drawable,
- gint x, gint y,
- gint width, gint height);
+ GdkEventExpose *expose);
static double e_day_view_time_item_point (FooCanvasItem *item,
double x, double y,
gint cx, gint cy,
@@ -258,12 +258,12 @@ e_day_view_time_item_get_type (void)
static void
e_day_view_time_item_update (FooCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
+ double i2w_dx,
+ double i2w_dy,
gint flags)
{
if (FOO_CANVAS_ITEM_CLASS (parent_class)->update)
- (* FOO_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
+ (* FOO_CANVAS_ITEM_CLASS (parent_class)->update) (item, i2w_dx, i2w_dy, flags);
/* The item covers the entire canvas area. */
item->x1 = 0;
@@ -616,16 +616,19 @@ edvti_draw_zone (FooCanvasItem *canvas_item,
static void
e_day_view_time_item_draw (FooCanvasItem *canvas_item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
EDayViewTimeItem *time_item;
+ gint x, y, width, height;
time_item = E_DAY_VIEW_TIME_ITEM (canvas_item);
g_return_if_fail (time_item != NULL);
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
edvti_draw_zone (canvas_item, drawable, x, y, width, height, 0, NULL);
if (time_item->priv->second_zone)
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index c9792c3..759241e 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -556,15 +556,15 @@ day_view_top_item_dispose (GObject *object)
static void
day_view_top_item_update (FooCanvasItem *item,
- gdouble *affine,
- ArtSVP *clip_path,
+ double i2w_dx,
+ double i2w_dy,
gint flags)
{
FooCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
canvas_item_class = FOO_CANVAS_ITEM_CLASS (parent_class);
- canvas_item_class->update (item, affine, clip_path, flags);
+ canvas_item_class->update (item, i2w_dx, i2w_dy, flags);
/* The item covers the entire canvas area. */
item->x1 = 0;
@@ -576,10 +576,7 @@ day_view_top_item_update (FooCanvasItem *item,
static void
day_view_top_item_draw (FooCanvasItem *canvas_item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
EDayViewTopItem *top_item;
EDayView *day_view;
@@ -592,8 +589,14 @@ day_view_top_item_draw (FooCanvasItem *canvas_item,
PangoLayout *layout;
cairo_t *cr;
GdkColor fg, bg, light, dark;
+ gint x, y, width, height;
gboolean show_dates;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
top_item = E_DAY_VIEW_TOP_ITEM (canvas_item);
day_view = e_day_view_top_item_get_day_view (top_item);
g_return_if_fail (day_view != NULL);
diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c
index 2fd01db..a00c6b3 100644
--- a/calendar/gui/e-meeting-time-sel-item.c
+++ b/calendar/gui/e-meeting-time-sel-item.c
@@ -48,12 +48,12 @@ static void e_meeting_time_selector_item_set_property (GObject *object,
static void e_meeting_time_selector_item_realize (FooCanvasItem *item);
static void e_meeting_time_selector_item_unrealize (FooCanvasItem *item);
static void e_meeting_time_selector_item_update (FooCanvasItem *item,
- double *affine,
- ArtSVP *clip_path, gint flags);
+ double i2w_dx,
+ double i2w_dy,
+ gint flags);
static void e_meeting_time_selector_item_draw (FooCanvasItem *item,
GdkDrawable *drawable,
- gint x, gint y,
- gint width, gint height);
+ GdkEventExpose *expose);
static double e_meeting_time_selector_item_point (FooCanvasItem *item,
double x, double y,
gint cx, gint cy,
@@ -226,10 +226,10 @@ e_meeting_time_selector_item_unrealize (FooCanvasItem *item)
}
static void
-e_meeting_time_selector_item_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags)
+e_meeting_time_selector_item_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
{
if (FOO_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update)
- (* FOO_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update) (item, affine, clip_path, flags);
+ (* FOO_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update) (item, i2w_dx, i2w_dy, flags);
/* The grid covers the entire canvas area. */
item->x1 = 0;
@@ -243,18 +243,24 @@ e_meeting_time_selector_item_update (FooCanvasItem *item, double *affine, ArtSVP
*/
static void
-e_meeting_time_selector_item_draw (FooCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height)
+e_meeting_time_selector_item_draw (FooCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose)
{
EMeetingTimeSelector *mts;
EMeetingTimeSelectorItem *mts_item;
EMeetingAttendee *ia;
gint day_x, meeting_start_x, meeting_end_x, bar_y, bar_height;
gint row, row_y, start_x, end_x;
+ gint x, y, width, height;
GDate date, last_date, current_date;
gboolean is_display_top, show_meeting_time;
GdkGC *gc, *stipple_gc;
cairo_t *cr;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
mts_item = E_MEETING_TIME_SELECTOR_ITEM (item);
mts = mts_item->mts;
g_return_if_fail (mts != NULL);
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index dc0710b..384da8b 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -590,8 +590,8 @@ week_view_event_item_get_property (GObject *object,
static void
week_view_event_item_update (FooCanvasItem *item,
- gdouble *affine,
- ArtSVP *clip_path,
+ double i2w_dx,
+ double i2w_dy,
gint flags)
{
FooCanvasItemClass *canvas_item_class;
@@ -606,7 +606,7 @@ week_view_event_item_update (FooCanvasItem *item,
/* Chain up to parent's update() method. */
canvas_item_class = FOO_CANVAS_ITEM_CLASS (parent_class);
- canvas_item_class->update (item, affine, clip_path, flags);
+ canvas_item_class->update (item, i2w_dx, i2w_dy, flags);
item->x1 = 0;
item->y1 = 0;
@@ -631,10 +631,7 @@ week_view_event_item_update (FooCanvasItem *item,
static void
week_view_event_item_draw (FooCanvasItem *canvas_item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
EWeekViewEventItem *event_item;
EWeekView *week_view;
@@ -644,6 +641,7 @@ week_view_event_item_draw (FooCanvasItem *canvas_item,
gint x1, y1, x2, y2, time_x, time_y;
gint icon_x, icon_y, time_width, min_end_time_x, max_icon_x;
gint rect_x, rect_w, rect_x2 = 0;
+ gint x, y, width, height;
gboolean one_day_event, editing_span = FALSE;
gint start_hour, start_minute, end_hour, end_minute;
gboolean draw_start, draw_end;
@@ -659,6 +657,11 @@ week_view_event_item_draw (FooCanvasItem *canvas_item,
GdkRegion *draw_region;
GdkRectangle rect;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
event_item = E_WEEK_VIEW_EVENT_ITEM (canvas_item);
week_view = E_WEEK_VIEW (GTK_WIDGET (canvas_item->canvas)->parent);
g_return_if_fail (E_IS_WEEK_VIEW (week_view));
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
index d81cf4f..629784d 100644
--- a/calendar/gui/e-week-view-main-item.c
+++ b/calendar/gui/e-week-view-main-item.c
@@ -354,15 +354,15 @@ week_view_main_item_dispose (GObject *object)
static void
week_view_main_item_update (FooCanvasItem *item,
- gdouble *affine,
- ArtSVP *clip_path,
+ double i2w_dx,
+ double i2w_dy,
gint flags)
{
FooCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
canvas_item_class = FOO_CANVAS_ITEM_CLASS (parent_class);
- canvas_item_class->update (item, affine, clip_path, flags);
+ canvas_item_class->update (item, i2w_dx, i2w_dy, flags);
/* The item covers the entire canvas area. */
item->x1 = 0;
@@ -374,15 +374,18 @@ week_view_main_item_update (FooCanvasItem *item,
static void
week_view_main_item_draw (FooCanvasItem *canvas_item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
EWeekViewMainItem *main_item;
EWeekView *week_view;
GDate date;
gint num_days, day, day_x, day_y, day_w, day_h;
+ gint x, y, width, height;
+
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
main_item = E_WEEK_VIEW_MAIN_ITEM (canvas_item);
week_view = e_week_view_main_item_get_week_view (main_item);
diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c
index 2e62f1f..70de78a 100644
--- a/calendar/gui/e-week-view-titles-item.c
+++ b/calendar/gui/e-week-view-titles-item.c
@@ -97,15 +97,15 @@ week_view_titles_item_dispose (GObject *object)
static void
week_view_titles_item_update (FooCanvasItem *item,
- gdouble *affine,
- ArtSVP *clip_path,
+ double i2w_dx,
+ double i2w_dy,
gint flags)
{
FooCanvasItemClass *canvas_item_class;
/* Chain up to parent's update() method. */
canvas_item_class = FOO_CANVAS_ITEM_CLASS (parent_class);
- canvas_item_class->update (item, affine, clip_path, flags);
+ canvas_item_class->update (item, i2w_dx, i2w_dy, flags);
/* The item covers the entire canvas area. */
item->x1 = 0;
@@ -117,10 +117,7 @@ week_view_titles_item_update (FooCanvasItem *item,
static void
week_view_titles_item_draw (FooCanvasItem *canvas_item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
EWeekViewTitlesItem *titles_item;
EWeekView *week_view;
@@ -131,8 +128,14 @@ week_view_titles_item_draw (FooCanvasItem *canvas_item,
GdkRectangle clip_rect;
gboolean abbreviated;
gint weekday;
+ gint x, y, width, height;
PangoLayout *layout;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
titles_item = E_WEEK_VIEW_TITLES_ITEM (canvas_item);
week_view = e_week_view_titles_item_get_week_view (titles_item);
g_return_if_fail (week_view != NULL);
diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c
index e72e452..f578d41 100644
--- a/calendar/gui/weekday-picker.c
+++ b/calendar/gui/weekday-picker.c
@@ -631,4 +631,3 @@ weekday_picker_get_week_start_day (WeekdayPicker *wp)
priv = wp->priv;
return priv->week_start_day;
}
-
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index 9310c28..daa0170 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -57,15 +57,12 @@ static void e_calendar_item_realize (FooCanvasItem *item);
static void e_calendar_item_unrealize (FooCanvasItem *item);
static void e_calendar_item_unmap (FooCanvasItem *item);
static void e_calendar_item_update (FooCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
+ double i2w_dx,
+ double i2w_dy,
gint flags);
static void e_calendar_item_draw (FooCanvasItem *item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height);
+ GdkEventExpose *expose);
static void e_calendar_item_draw_month (ECalendarItem *calitem,
GdkDrawable *drawable,
gint x,
@@ -880,9 +877,9 @@ e_calendar_item_unmap (FooCanvasItem *item)
static void
e_calendar_item_update (FooCanvasItem *item,
- double *affine,
- ArtSVP *clip_path,
- gint flags)
+ double i2w_dx,
+ double i2w_dy,
+ gint flags)
{
FooCanvasItemClass *item_class;
ECalendarItem *calitem;
@@ -895,7 +892,7 @@ e_calendar_item_update (FooCanvasItem *item,
item_class = FOO_CANVAS_ITEM_CLASS (e_calendar_item_parent_class);
if (item_class->update != NULL)
- item_class->update (item, affine, clip_path, flags);
+ item_class->update (item, i2w_dx, i2w_dy, flags);
calitem = E_CALENDAR_ITEM (item);
style = gtk_widget_get_style (GTK_WIDGET (item->canvas));
@@ -1016,26 +1013,30 @@ e_calendar_item_update (FooCanvasItem *item,
static void
e_calendar_item_draw (FooCanvasItem *canvas_item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
ECalendarItem *calitem;
GtkStyle *style;
GdkGC *base_gc, *bg_gc;
gint char_height, row, col, row_y, bar_height, col_x;
gint xthickness, ythickness;
+ gint x, y, width, height;
PangoFontDescription *font_desc;
PangoContext *pango_context;
PangoFontMetrics *font_metrics;
cairo_t *cr;
GdkColor base, bg;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
#if 0
g_print ("In e_calendar_item_draw %i,%i %ix%i\n",
x, y, width, height);
#endif
+
calitem = E_CALENDAR_ITEM (canvas_item);
style = gtk_widget_get_style (GTK_WIDGET (canvas_item->canvas));
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c
index 9dc1408..abeb836 100644
--- a/widgets/misc/e-canvas-background.c
+++ b/widgets/misc/e-canvas-background.c
@@ -36,6 +36,7 @@
#include "misc/e-canvas.h"
#include "misc/e-canvas-utils.h"
#include "misc/e-hsv-utils.h"
+#include "libfoocanvas/libart-compat.h"
#include "e-canvas-background.h"
@@ -127,13 +128,13 @@ ecb_bounds (FooCanvasItem *item, double *x1, double *y1, double *x2, double *y2)
* FooCanvasItem::update method
*/
static void
-ecb_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags)
+ecb_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
{
ArtPoint o1, o2;
ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
if (FOO_CANVAS_ITEM_CLASS (ecb_parent_class)->update)
- FOO_CANVAS_ITEM_CLASS (ecb_parent_class)->update (item, affine, clip_path, flags);
+ FOO_CANVAS_ITEM_CLASS (ecb_parent_class)->update (item, i2w_dx, i2w_dy, flags);
o1.x = item->x1;
o1.y = item->y1;
@@ -268,9 +269,7 @@ ecb_set_property (GObject *object,
if (FOO_CANVAS_ITEM_REALIZED & GTK_OBJECT_FLAGS(item)) {
get_color (ecb);
- if (!item->canvas->aa) {
- gdk_gc_set_foreground (ecb->priv->gc, &ecb->priv->color);
- }
+ gdk_gc_set_foreground (ecb->priv->gc, &ecb->priv->color);
}
}
@@ -346,8 +345,7 @@ ecb_realize (FooCanvasItem *item)
ecb->priv->gc = gdk_gc_new (bin_window);
get_color (ecb);
- if (!item->canvas->aa)
- gdk_gc_set_foreground (ecb->priv->gc, &ecb->priv->color);
+ gdk_gc_set_foreground (ecb->priv->gc, &ecb->priv->color);
set_stipple (ecb, NULL, FALSE);
@@ -370,16 +368,17 @@ ecb_unrealize (FooCanvasItem *item)
static void
ecb_draw (FooCanvasItem *item,
GdkDrawable *drawable,
- gint x,
- gint y,
- gint width,
- gint height)
+ GdkEventExpose *expose)
{
ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item);
gint x1, x2, y1, y2;
+ gint width, height;
double i2c [6];
ArtPoint upper_left, lower_right, ecb_base_point;
+ width = expose->area.width;
+ height = expose->area.height;
+
/*
* Find out our real position after grouping
*/
diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c
index 264afb6..0cdedc3 100644
--- a/widgets/misc/e-canvas-utils.c
+++ b/widgets/misc/e-canvas-utils.c
@@ -31,9 +31,9 @@ e_canvas_item_move_absolute (FooCanvasItem *item, double dx, double dy)
g_return_if_fail (item != NULL);
g_return_if_fail (FOO_IS_CANVAS_ITEM (item));
- art_affine_translate (translate, dx, dy);
-
- foo_canvas_item_affine_absolute (item, translate);
+ /* FooCanvas does not provide this functionality. */
+ /*art_affine_translate (translate, dx, dy);*/
+ /*foo_canvas_item_affine_absolute (item, translate);*/
}
static double
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 0706346..aa5e36d 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -282,7 +282,7 @@ e_canvas_key (GtkWidget *widget, GdkEventKey *event)
* be in the parent's item-relative coordinate system. This routine applies the
* inverse of the item's transform, maintaining the affine invariant.
*/
-#define HACKISH_AFFINE
+/*#define HACKISH_AFFINE*/
static double
foo_canvas_item_invoke_point (FooCanvasItem *item, double x, double y, gint cx, gint cy,
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index b73e87c..38c9235 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -53,6 +53,7 @@
#include "e-util/e-text-event-processor-emacs-like.h"
#include "e-util/e-util.h"
#include "misc/e-canvas.h"
+#include "libfoocanvas/libart-compat.h"
#include "e-util/e-unicode.h"
#include "e-table.h"
diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c
index 6b5ec44..ef55532 100644
--- a/widgets/table/e-table-field-chooser-item.c
+++ b/widgets/table/e-table-field-chooser-item.c
@@ -35,6 +35,7 @@
#include "e-util/e-util.h"
#include "e-util/e-xml-utils.h"
#include "misc/e-canvas.h"
+#include "libfoocanvas/libart-compat.h"
#include "e-table-col-dnd.h"
#include "e-table-defines.h"
@@ -176,14 +177,14 @@ etfci_reflow (FooCanvasItem *item, gint flags)
}
static void
-etfci_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags)
+etfci_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
{
ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
double i2c [6];
ArtPoint c1, c2, i1, i2;
if (FOO_CANVAS_ITEM_CLASS (etfci_parent_class)->update)
- (*FOO_CANVAS_ITEM_CLASS (etfci_parent_class)->update)(item, affine, clip_path, flags);
+ (*FOO_CANVAS_ITEM_CLASS (etfci_parent_class)->update)(item, i2w_dx, i2w_dy, flags);
i1.x = i1.y = 0;
i2.x = etfci->width;
@@ -447,19 +448,25 @@ etfci_unrealize (FooCanvasItem *item)
}
static void
-etfci_draw (FooCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height)
+etfci_draw (FooCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose)
{
ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);
FooCanvas *canvas = item->canvas;
gint rows;
gint y1, y2;
gint row;
+ gint x, y, width, height;
GtkStyle *style;
GtkStateType state;
if (etfci->combined_header == NULL)
return;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
rows = e_table_header_count (etfci->combined_header);
style = GTK_WIDGET (canvas)->style;
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 39385de..702a948 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -39,6 +39,7 @@
#include "e-util/e-xml-utils.h"
#include "misc/e-canvas.h"
#include "misc/e-popup-menu.h"
+#include "libfoocanvas/libart-compat.h"
#include "e-table.h"
#include "e-table-col-dnd.h"
@@ -183,7 +184,7 @@ e_table_header_item_get_height (ETableHeaderItem *ethi)
}
static void
-ethi_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags)
+ethi_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
{
ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
@@ -191,7 +192,7 @@ ethi_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags)
ArtPoint c1, c2, i1, i2;
if (FOO_CANVAS_ITEM_CLASS (ethi_parent_class)->update)
- (*FOO_CANVAS_ITEM_CLASS (ethi_parent_class)->update)(item, affine, clip_path, flags);
+ (*FOO_CANVAS_ITEM_CLASS (ethi_parent_class)->update)(item, i2w_dx, i2w_dy, flags);
if (ethi->sort_info)
ethi->group_indent_width = e_table_sort_info_grouping_get_count(ethi->sort_info) * GROUP_INDENT;
@@ -935,15 +936,21 @@ ethi_unrealize (FooCanvasItem *item)
}
static void
-ethi_draw (FooCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height)
+ethi_draw (FooCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose)
{
ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
FooCanvas *canvas = item->canvas;
const gint cols = e_table_header_count (ethi->eth);
gint x1, x2;
gint col;
+ gint x, y, width, height;
GHashTable *arrows = g_hash_table_new (NULL, NULL);
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
if (ethi->sort_info) {
gint length = e_table_sort_info_grouping_get_count(ethi->sort_info);
gint i;
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 9756baa..c36551e 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -43,6 +43,7 @@
#include "misc/e-canvas.h"
#include "misc/e-canvas-utils.h"
#include "misc/e-hsv-utils.h"
+#include "libfoocanvas/libart-compat.h"
#include "e-cell.h"
#include "e-table-item.h"
@@ -474,13 +475,13 @@ eti_reflow (FooCanvasItem *item, gint flags)
* FooCanvasItem::update method
*/
static void
-eti_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags)
+eti_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
{
ArtPoint o1, o2;
ETableItem *eti = E_TABLE_ITEM (item);
if (FOO_CANVAS_ITEM_CLASS (eti_parent_class)->update)
- (*FOO_CANVAS_ITEM_CLASS (eti_parent_class)->update)(item, affine, clip_path, flags);
+ (*FOO_CANVAS_ITEM_CLASS (eti_parent_class)->update)(item, i2w_dx, i2w_dy, flags);
o1.x = item->x1;
o1.y = item->y1;
@@ -1759,7 +1760,7 @@ eti_unrealize (FooCanvasItem *item)
}
static void
-eti_draw (FooCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height)
+eti_draw (FooCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose)
{
ETableItem *eti = E_TABLE_ITEM (item);
const gint rows = eti->rows;
@@ -1769,6 +1770,7 @@ eti_draw (FooCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width
gint first_row, last_row, y_offset, yd;
gint x1, x2;
gint f_x1, f_x2, f_y1, f_y2;
+ gint x, y, width, height;
gboolean f_found;
double i2c [6];
ArtPoint eti_base, eti_base_item, lower_right;
@@ -1776,6 +1778,11 @@ eti_draw (FooCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width
gint height_extra = eti->horizontal_draw_grid ? 1 : 0;
cairo_t *cr;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
cr = gdk_cairo_create (drawable);
/*
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 13c0ce8..c088e6e 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -36,6 +36,7 @@
#include "misc/e-canvas.h"
#include "misc/e-canvas-utils.h"
#include "misc/e-canvas-background.h"
+#include "libfoocanvas/foo-canvas.h"
#include "text/e-text.h"
#include "e-table-column-specification.h"
diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h
index 2c558e9..d5c0a78 100644
--- a/widgets/table/e-tree.h
+++ b/widgets/table/e-tree.h
@@ -25,7 +25,6 @@
#include <gtk/gtk.h>
#include <libxml/tree.h>
-#include <libfoocanvas/foo-canvas.h>
#include <misc/e-printable.h>
#include <table/e-table-extras.h>
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index 9dfd7b1..381efea 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -41,8 +41,8 @@ static gboolean e_reflow_event (FooCanvasItem *item, GdkEvent *event);
static void e_reflow_realize (FooCanvasItem *item);
static void e_reflow_unrealize (FooCanvasItem *item);
static void e_reflow_draw (FooCanvasItem *item, GdkDrawable *drawable,
- gint x, gint y, gint width, gint height);
-static void e_reflow_update (FooCanvasItem *item, double affine[6], ArtSVP *clip_path, gint flags);
+ GdkEventExpose *expose);
+static void e_reflow_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags);
static double e_reflow_point (FooCanvasItem *item, double x, double y, gint cx, gint cy, FooCanvasItem **actual_item);
static void e_reflow_reflow (FooCanvasItem *item, gint flags);
static void set_empty(EReflow *reflow);
@@ -861,9 +861,6 @@ e_reflow_realize (FooCanvasItem *item)
adjustment->step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2;
adjustment->page_increment = adjustment->page_size - adjustment->step_increment;
gtk_adjustment_changed(adjustment);
-
- if (!item->canvas->aa) {
- }
}
static void
@@ -873,9 +870,6 @@ e_reflow_unrealize (FooCanvasItem *item)
reflow = E_REFLOW (item);
- if (!item->canvas->aa) {
- }
-
gdk_cursor_unref (reflow->arrow_cursor);
gdk_cursor_unref (reflow->default_cursor);
reflow->arrow_cursor = NULL;
@@ -1102,16 +1096,22 @@ e_reflow_event (FooCanvasItem *item, GdkEvent *event)
}
static void e_reflow_draw (FooCanvasItem *item, GdkDrawable *drawable,
- gint x, gint y, gint width, gint height)
+ GdkEventExpose *expose)
{
gint x_rect, y_rect, width_rect, height_rect;
+ gint x, y, width, height;
gdouble running_width;
EReflow *reflow = E_REFLOW(item);
gint i;
double column_width;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
if (FOO_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw)
- FOO_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw (item, drawable, x, y, width, height);
+ FOO_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw (item, drawable, expose);
column_width = reflow->column_width;
running_width = E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
x_rect = running_width;
@@ -1176,7 +1176,7 @@ static void e_reflow_draw (FooCanvasItem *item, GdkDrawable *drawable,
}
static void
-e_reflow_update (FooCanvasItem *item, double affine[6], ArtSVP *clip_path, gint flags)
+e_reflow_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
{
EReflow *reflow;
double x0, x1, y0, y1;
@@ -1184,7 +1184,7 @@ e_reflow_update (FooCanvasItem *item, double affine[6], ArtSVP *clip_path, gint
reflow = E_REFLOW (item);
if (FOO_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update)
- FOO_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update (item, affine, clip_path, flags);
+ FOO_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update (item, i2w_dx, i2w_dy, flags);
x0 = item->x1;
y0 = item->y1;
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index f84b32b..3cc79cb 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -53,6 +53,7 @@
#include <glib/gi18n.h>
#include "e-util/e-text-event-processor-emacs-like.h"
#include "e-util/e-util.h"
+#include "libfoocanvas/libart-compat.h"
#include "e-text.h"
@@ -1005,8 +1006,7 @@ e_text_set_property (GObject *object,
text->color = color;
gdk_rgb_find_color (colormap, &text->color);
- if (!item->canvas->aa)
- set_text_gc_foreground (text);
+ set_text_gc_foreground (text);
text->needs_redraw = 1;
needs_update = 1;
@@ -1200,7 +1200,7 @@ e_text_reflow (FooCanvasItem *item, gint flags)
/* Update handler for the text item */
static void
-e_text_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags)
+e_text_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
{
EText *text;
double x1, y1, x2, y2;
@@ -1208,29 +1208,26 @@ e_text_update (FooCanvasItem *item, double *affine, ArtSVP *clip_path, gint flag
text = E_TEXT (item);
if (FOO_CANVAS_ITEM_CLASS (e_text_parent_class)->update)
- (* FOO_CANVAS_ITEM_CLASS (e_text_parent_class)->update) (item, affine, clip_path, flags);
-
- if ( text->needs_recalc_bounds
- || (flags & FOO_CANVAS_UPDATE_AFFINE)) {
- if (!item->canvas->aa) {
- set_text_gc_foreground (text);
- set_stipple (text, text->stipple, TRUE);
- get_bounds (text, &x1, &y1, &x2, &y2);
- if ( item->x1 != x1 ||
- item->x2 != x2 ||
- item->y1 != y1 ||
- item->y2 != y2 ) {
- foo_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
- item->x1 = x1;
- item->y1 = y1;
- item->x2 = x2;
- item->y2 = y2;
- text->needs_redraw = 1;
- item->canvas->need_repick = TRUE;
- }
- if (!text->fill_clip_rectangle)
- item->canvas->need_repick = TRUE;
+ (* FOO_CANVAS_ITEM_CLASS (e_text_parent_class)->update) (item, i2w_dx, i2w_dy, flags);
+
+ if ( text->needs_recalc_bounds) {
+ set_text_gc_foreground (text);
+ set_stipple (text, text->stipple, TRUE);
+ get_bounds (text, &x1, &y1, &x2, &y2);
+ if ( item->x1 != x1 ||
+ item->x2 != x2 ||
+ item->y1 != y1 ||
+ item->y2 != y2 ) {
+ foo_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
+ item->x1 = x1;
+ item->y1 = y1;
+ item->x2 = x2;
+ item->y2 = y2;
+ text->needs_redraw = 1;
+ item->canvas->need_repick = TRUE;
}
+ if (!text->fill_clip_rectangle)
+ item->canvas->need_repick = TRUE;
text->needs_recalc_bounds = 0;
}
if ( text->needs_redraw ) {
@@ -1379,11 +1376,12 @@ show_pango_rectangle (EText *text, PangoRectangle rect)
/* Draw handler for the text item */
static void
e_text_draw (FooCanvasItem *item, GdkDrawable *drawable,
- gint x, gint y, gint width, gint height)
+ GdkEventExpose *expose)
{
EText *text;
GdkRectangle rect, *clip_rect;
gint xpos, ypos;
+ gint x, y, width, height;
GdkGC *main_gc;
FooCanvas *canvas;
GtkWidget *widget;
@@ -1391,6 +1389,11 @@ e_text_draw (FooCanvasItem *item, GdkDrawable *drawable,
GtkStyle *style;
GtkStateType state;
+ x = expose->area.x;
+ y = expose->area.y;
+ width = expose->area.width;
+ height = expose->area.height;
+
text = E_TEXT (item);
canvas = FOO_CANVAS_ITEM(text)->canvas;
widget = GTK_WIDGET(canvas);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]