[gthumb] fixed many compiler errors
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] fixed many compiler errors
- Date: Tue, 25 Oct 2011 14:54:24 +0000 (UTC)
commit 7876c7529cb45e0c4227ed5cb1e6764e9aa2f3e6
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Oct 16 17:50:14 2011 +0200
fixed many compiler errors
extensions/file_tools/gth-image-line-tool.c | 14 +----
extensions/file_tools/gth-image-rotator.c | 37 ++++++---------
extensions/gstreamer_tools/gth-media-viewer-page.c | 5 +--
extensions/image_print/gth-image-print-job.c | 5 +-
gthumb/gedit-message-area.c | 4 +-
gthumb/gth-cell-renderer-thumbnail.c | 27 +++++------
gthumb/gth-empty-list.c | 3 -
gthumb/gth-histogram-view.c | 3 +-
gthumb/gth-icon-view.c | 2 -
gthumb/gth-image-viewer.c | 50 +++++++------------
gthumb/gth-image-viewer.h | 2 +-
gthumb/gtk-utils.c | 8 ++--
gthumb/main.c | 2 -
13 files changed, 60 insertions(+), 102 deletions(-)
---
diff --git a/extensions/file_tools/gth-image-line-tool.c b/extensions/file_tools/gth-image-line-tool.c
index f08a5e6..fa72f8e 100644
--- a/extensions/file_tools/gth-image-line-tool.c
+++ b/extensions/file_tools/gth-image-line-tool.c
@@ -196,9 +196,8 @@ paint_image (GthImageLineTool *self,
static void
-gth_image_line_tool_expose (GthImageViewerTool *base,
- GdkEventExpose *event,
- cairo_t *cr)
+gth_image_line_tool_draw (GthImageViewerTool *base,
+ cairo_t *cr)
{
GthImageLineTool *self = GTH_IMAGE_LINE_TOOL (base);
@@ -207,13 +206,6 @@ gth_image_line_tool_expose (GthImageViewerTool *base,
cairo_save (cr);
- cairo_rectangle (cr,
- event->area.x,
- event->area.y,
- event->area.width,
- event->area.height);
- cairo_clip (cr);
-
paint_image (self, cr);
if (self->priv->first_point_set) {
@@ -350,7 +342,7 @@ gth_image_line_tool_gth_image_tool_interface_init (GthImageViewerToolIface *ifac
iface->size_allocate = gth_image_line_tool_size_allocate;
iface->map = gth_image_line_tool_map;
iface->unmap = gth_image_line_tool_unmap;
- iface->expose = gth_image_line_tool_expose;
+ iface->draw = gth_image_line_tool_draw;
iface->button_press = gth_image_line_tool_button_press;
iface->button_release = gth_image_line_tool_button_release;
iface->motion_notify = gth_image_line_tool_motion_notify;
diff --git a/extensions/file_tools/gth-image-rotator.c b/extensions/file_tools/gth-image-rotator.c
index b5e7737..5edf8e9 100644
--- a/extensions/file_tools/gth-image-rotator.c
+++ b/extensions/file_tools/gth-image-rotator.c
@@ -291,7 +291,6 @@ paint_image (GthImageRotator *self,
static void
paint_darker_background (GthImageRotator *self,
- GdkEventExpose *event,
cairo_t *cr)
{
cairo_rectangle_int_t crop_region;
@@ -346,7 +345,6 @@ paint_darker_background (GthImageRotator *self,
static void
paint_grid (GthImageRotator *self,
- GdkEventExpose *event,
cairo_t *cr)
{
cairo_rectangle_int_t grid;
@@ -366,7 +364,6 @@ paint_grid (GthImageRotator *self,
static void
paint_point (GthImageRotator *self,
- GdkEventExpose *event,
cairo_t *cr,
GdkPoint *p)
{
@@ -381,28 +378,24 @@ paint_point (GthImageRotator *self,
static void
-gth_image_rotator_expose (GthImageViewerTool *base,
- GdkEventExpose *event,
- cairo_t *cr)
+gth_image_rotator_draw (GthImageViewerTool *base,
+ cairo_t *cr)
{
GthImageRotator *self = GTH_IMAGE_ROTATOR (base);
- GtkStyle *style;
+ GtkStyleContext *style_context;
+ GdkRGBA color;
GtkAllocation allocation;
cairo_save (cr);
- cairo_rectangle (cr,
- event->area.x,
- event->area.y,
- event->area.width,
- event->area.height);
- cairo_clip (cr);
-
/* background */
- style = gtk_widget_get_style (GTK_WIDGET (self->priv->viewer));
+ style_context = gtk_widget_get_style_context (GTK_WIDGET (self->priv->viewer));
+ gtk_style_context_get_background_color (style_context,
+ gtk_widget_get_state (GTK_WIDGET (self->priv->viewer)),
+ &color);
+ gdk_cairo_set_source_rgba (cr, &color);
gtk_widget_get_allocation (GTK_WIDGET (self->priv->viewer), &allocation);
- gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
cairo_fill (cr);
@@ -426,8 +419,8 @@ gth_image_rotator_expose (GthImageViewerTool *base,
paint_image (self, cr);
if (self->priv->enable_crop) {
- paint_darker_background (self, event, cr);
- paint_grid (self, event, cr);
+ paint_darker_background (self, cr);
+ paint_grid (self, cr);
}
if (self->priv->dragging) {
@@ -438,11 +431,11 @@ gth_image_rotator_expose (GthImageViewerTool *base,
center.x = self->priv->center.x * self->priv->preview_zoom + self->priv->preview_image_area.x;
center.y = self->priv->center.y * self->priv->preview_zoom + self->priv->preview_image_area.y;
- paint_point (self, event, cr, ¢er);
+ paint_point (self, cr, ¢er);
/* used for debugging purposes
- paint_point (self, event, cr, &self->priv->drag_p1);
- paint_point (self, event, cr, &self->priv->drag_p2);
+ paint_point (self, cr, &self->priv->drag_p1);
+ paint_point (self, cr, &self->priv->drag_p2);
*/
}
@@ -676,7 +669,7 @@ gth_image_rotator_gth_image_tool_interface_init (GthImageViewerToolIface *iface)
iface->size_allocate = gth_image_rotator_size_allocate;
iface->map = gth_image_rotator_map;
iface->unmap = gth_image_rotator_unmap;
- iface->expose = gth_image_rotator_expose;
+ iface->draw = gth_image_rotator_draw;
iface->button_press = gth_image_rotator_button_press;
iface->button_release = gth_image_rotator_button_release;
iface->motion_notify = gth_image_rotator_motion_notify;
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c b/extensions/gstreamer_tools/gth-media-viewer-page.c
index ace1e7d..d7efe78 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -179,9 +179,6 @@ video_area_draw_cb (GtkWidget *widget,
GtkAllocation allocation;
GtkStyleContext *style_context;
- if (event->count > 0)
- return FALSE;
-
if (self->priv->xwin_assigned && self->priv->has_video)
return FALSE;
@@ -219,7 +216,7 @@ video_area_draw_cb (GtkWidget *widget,
}
else
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
- gdk_cairo_region (cr, event->region);
+ cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
cairo_fill (cr);
if (self->priv->icon != NULL) {
diff --git a/extensions/image_print/gth-image-print-job.c b/extensions/image_print/gth-image-print-job.c
index 1b1060d..6d4772d 100644
--- a/extensions/image_print/gth-image-print-job.c
+++ b/extensions/image_print/gth-image-print-job.c
@@ -1035,12 +1035,11 @@ preview_draw_cb (GtkWidget *widget,
gpointer user_data)
{
GthImagePrintJob *self = user_data;
- cairo_t *cr;
GtkAllocation allocation;
PangoLayout *pango_layout;
- g_return_if_fail (GTH_IS_IMAGE_PRINT_JOB (self));
- g_return_if_fail ((self->priv->page_setup != NULL) && GTK_IS_PAGE_SETUP (self->priv->page_setup));
+ g_return_val_if_fail (GTH_IS_IMAGE_PRINT_JOB (self), FALSE);
+ g_return_val_if_fail ((self->priv->page_setup != NULL) && GTK_IS_PAGE_SETUP (self->priv->page_setup), FALSE);
/* paint the paper */
diff --git a/gthumb/gedit-message-area.c b/gthumb/gedit-message-area.c
index a4795b6..79e9669 100644
--- a/gthumb/gedit-message-area.c
+++ b/gthumb/gedit-message-area.c
@@ -134,12 +134,10 @@ gedit_message_area_class_init (GeditMessageAreaClass *klass)
GtkBindingSet *binding_set;
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = gedit_message_area_finalize;
+ g_type_class_add_private (object_class, sizeof(GeditMessageAreaPrivate));
klass->close = gedit_message_area_close;
- g_type_class_add_private (object_class, sizeof(GeditMessageAreaPrivate));
-
signals[RESPONSE] = g_signal_new ("response",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
diff --git a/gthumb/gth-cell-renderer-thumbnail.c b/gthumb/gth-cell-renderer-thumbnail.c
index 3076e77..3c02c36 100644
--- a/gthumb/gth-cell-renderer-thumbnail.c
+++ b/gthumb/gth-cell-renderer-thumbnail.c
@@ -158,13 +158,13 @@ gth_cell_renderer_thumbnail_set_property (GObject *object,
static void
-gth_cell_renderer_thumbnail_get_size (GtkCellRenderer *cell,
- GtkWidget *widget,
- cairo_rectangle_int_t *cell_area,
- int *x_offset,
- int *y_offset,
- int *width,
- int *height)
+gth_cell_renderer_thumbnail_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ const GdkRectangle *cell_area,
+ int *x_offset,
+ int *y_offset,
+ int *width,
+ int *height)
{
GthCellRendererThumbnail *self;
int image_width;
@@ -226,13 +226,12 @@ gth_cell_renderer_thumbnail_get_size (GtkCellRenderer *cell,
static void
-gth_cell_renderer_thumbnail_render (GtkCellRenderer *cell,
- cairo_t *cr,
- GtkWidget *widget,
- cairo_rectangle_int_t *background_area,
- cairo_rectangle_int_t *cell_area,
- cairo_rectangle_int_t *expose_area,
- GtkCellRendererState flags)
+gth_cell_renderer_thumbnail_render (GtkCellRenderer *cell,
+ cairo_t *cr,
+ GtkWidget *widget,
+ const GdkRectangle *background_area,
+ const GdkRectangle *cell_area,
+ GtkCellRendererState flags)
{
GthCellRendererThumbnail *self;
GtkStyleContext *style_context;
diff --git a/gthumb/gth-empty-list.c b/gthumb/gth-empty-list.c
index 37a365c..ebd63c3 100644
--- a/gthumb/gth-empty-list.c
+++ b/gthumb/gth-empty-list.c
@@ -237,9 +237,6 @@ gth_empty_list_draw (GtkWidget *widget,
GtkStyleContext *style_context;
GdkRGBA color;
- if (event->window != self->priv->bin_window)
- return FALSE;
-
if (self->priv->text == NULL)
return TRUE;
diff --git a/gthumb/gth-histogram-view.c b/gthumb/gth-histogram-view.c
index c235242..4758cc9 100644
--- a/gthumb/gth-histogram-view.c
+++ b/gthumb/gth-histogram-view.c
@@ -408,7 +408,6 @@ gth_histogram_paint_rgb (GthHistogramView *self,
int max_c;
int y;
double value;
- GdkRGBA color;
value_r = gth_histogram_get_value (self->priv->histogram, 1, i);
value_g = gth_histogram_get_value (self->priv->histogram, 2, i);
@@ -465,7 +464,7 @@ gth_histogram_paint_rgb (GthHistogramView *self,
* painted in black. */
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- gdk_cairo_set_source_color (cr, &style->text[gtk_widget_get_state (GTK_WIDGET (self))]);
+ cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
value = gth_histogram_get_value (self->priv->histogram, min_c, i);
y = (int) ((allocation->height - 1) * convert_to_scale (self->priv->scale_type, value)) / max;
cairo_rectangle (cr, (i * step) + 0.5, allocation->height - y - 0.5, step, allocation->height);
diff --git a/gthumb/gth-icon-view.c b/gthumb/gth-icon-view.c
index 87dcd58..02eaaba 100644
--- a/gthumb/gth-icon-view.c
+++ b/gthumb/gth-icon-view.c
@@ -754,8 +754,6 @@ icon_view_motion_notify_event_cb (GtkWidget *widget,
if (n_selected >= 1) {
const int offset = 3;
int n_visible;
- int width;
- int height;
int border;
GdkPixbuf *dnd_icon;
GdkPixbuf *multi_dnd_icon;
diff --git a/gthumb/gth-image-viewer.c b/gthumb/gth-image-viewer.c
index 7e4d628..74b0efb 100644
--- a/gthumb/gth-image-viewer.c
+++ b/gthumb/gth-image-viewer.c
@@ -880,41 +880,41 @@ scroll_to (GthImageViewer *self,
{
cairo_rectangle_int_t area;
- GdkRegion *region;
+ cairo_region_t *region;
area.x = (delta_x < 0) ? self->priv->frame_border : self->priv->frame_border + delta_x;
area.y = (delta_y < 0) ? self->priv->frame_border : self->priv->frame_border + delta_y;
area.width = gdk_width - abs (delta_x);
area.height = gdk_height - abs (delta_y);
- region = gdk_region_rectangle (&area);
+ region = cairo_region_create_rectangle (&area);
gdk_window_move_region (window, region, -delta_x, -delta_y);
- gdk_region_destroy (region);
+ cairo_region_destroy (region);
}
/* invalidate the exposed areas */
{
- GdkRegion *region;
+ cairo_region_t *region;
cairo_rectangle_int_t area;
- region = gdk_region_new ();
+ region = cairo_region_create ();
area.x = self->priv->frame_border;
area.y = (delta_y < 0) ? self->priv->frame_border : self->priv->frame_border + gdk_height - delta_y;
area.width = gdk_width;
area.height = abs (delta_y);
- gdk_region_union_with_rect (region, &area);
+ cairo_region_union_rectangle (region, &area);
area.x = (delta_x < 0) ? self->priv->frame_border : self->priv->frame_border + gdk_width - delta_x;
area.y = self->priv->frame_border;
area.width = abs (delta_x);
area.height = gdk_height;
- gdk_region_union_with_rect (region, &area);
+ cairo_region_union_rectangle (region, &area);
gdk_window_invalidate_region (window, region, TRUE);
- gdk_region_destroy (region);
+ cairo_region_destroy (region);
}
gdk_window_process_updates (window, TRUE);
@@ -2558,38 +2558,26 @@ gth_image_viewer_paint_region (GthImageViewer *self,
int src_x,
int src_y,
cairo_rectangle_int_t *pixbuf_area,
- GdkRegion *region,
+ cairo_region_t *region,
cairo_filter_t filter)
{
- cairo_rectangle_int_t *rects;
- int n_rects;
- int i;
-
cairo_save (cr);
gdk_cairo_rectangle (cr, pixbuf_area);
cairo_clip (cr);
- gdk_region_get_rectangles (region, &rects, &n_rects);
- for (i = 0; i < n_rects; i++) {
- cairo_rectangle_int_t paint_area;
-
- if (gdk_rectangle_intersect (pixbuf_area, &rects[i], &paint_area))
- gth_image_viewer_paint (self,
- cr,
- surface,
- src_x + paint_area.x,
- src_y + paint_area.y,
- paint_area.x,
- paint_area.y,
- paint_area.width,
- paint_area.height,
- filter);
- }
+ gth_image_viewer_paint (self,
+ cr,
+ surface,
+ src_x + pixbuf_area->x,
+ src_y + pixbuf_area->y,
+ pixbuf_area->x,
+ pixbuf_area->y,
+ pixbuf_area->width,
+ pixbuf_area->height,
+ filter);
cairo_restore (cr);
-
- g_free (rects);
}
diff --git a/gthumb/gth-image-viewer.h b/gthumb/gth-image-viewer.h
index d9dd0d5..918bf6d 100644
--- a/gthumb/gth-image-viewer.h
+++ b/gthumb/gth-image-viewer.h
@@ -310,7 +310,7 @@ void gth_image_viewer_paint_region (GthImageViewer
int src_x,
int src_y,
cairo_rectangle_int_t *pixbuf_area,
- GdkRegion *region,
+ cairo_region_t *region,
cairo_filter_t filter);
void gth_image_viewer_paint_background (GthImageViewer *self,
cairo_t *cr);
diff --git a/gthumb/gtk-utils.c b/gthumb/gtk-utils.c
index adda022..63f24e5 100644
--- a/gthumb/gtk-utils.c
+++ b/gthumb/gtk-utils.c
@@ -1154,10 +1154,10 @@ gimp_scale_entry_new (GtkWidget *parent_box,
float page_increment,
int digits)
{
- GtkWidget *hbox;
- GtkWidget *scale;
- GtkWidget *spinbutton;
- GtkObject *adj;
+ GtkAdjustment *adj;
+ GtkWidget *spinbutton;
+ GtkWidget *scale;
+ GtkWidget *hbox;
adj = gtk_adjustment_new (value, lower, upper,
step_increment, page_increment,
diff --git a/gthumb/main.c b/gthumb/main.c
index 88960fb..f843387 100644
--- a/gthumb/main.c
+++ b/gthumb/main.c
@@ -269,8 +269,6 @@ gthumb_application_activate_cb (GApplication *application,
gtk_window_set_application (GTK_WINDOW (window), GTK_APPLICATION (application));
gtk_widget_show (window);
}
-
- return res;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]