[anjuta] foocanvas: Removed deprecated API
- From: Naba Kumar <naba src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] foocanvas: Removed deprecated API
- Date: Sat, 8 May 2010 11:38:13 +0000 (UTC)
commit 4cfb86a58c7cf67f7c9a49dfe6262250c7f240a3
Author: Naba Kumar <naba gnome org>
Date: Sat May 8 14:20:55 2010 +0300
foocanvas: Removed deprecated API
libfoocanvas/foo-canvas-pixbuf.c | 2 +-
libfoocanvas/foo-canvas-widget.c | 8 +++++---
libfoocanvas/foo-canvas.c | 22 +++++++++++-----------
3 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/libfoocanvas/foo-canvas-pixbuf.c b/libfoocanvas/foo-canvas-pixbuf.c
index 186e0d7..0816b07 100644
--- a/libfoocanvas/foo-canvas-pixbuf.c
+++ b/libfoocanvas/foo-canvas-pixbuf.c
@@ -127,7 +127,7 @@ foo_canvas_pixbuf_class_init (FooCanvasPixbufClass *klass)
object_class = (GtkObjectClass *) klass;
item_class = (FooCanvasItemClass *) klass;
- parent_class = gtk_type_class (foo_canvas_item_get_type ());
+ parent_class = g_type_class_peek (foo_canvas_item_get_type ());
gobject_class->set_property = foo_canvas_pixbuf_set_property;
gobject_class->get_property = foo_canvas_pixbuf_get_property;
diff --git a/libfoocanvas/foo-canvas-widget.c b/libfoocanvas/foo-canvas-widget.c
index 9e5d337..0ba8aba 100644
--- a/libfoocanvas/foo-canvas-widget.c
+++ b/libfoocanvas/foo-canvas-widget.c
@@ -427,6 +427,7 @@ foo_canvas_widget_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, int
(* parent_class->update) (item, i2w_dx, i2w_dy, flags);
if (witem->widget) {
+ GtkRequisition req;
if (witem->size_pixels) {
witem->cwidth = (int) (witem->width + 0.5);
witem->cheight = (int) (witem->height + 0.5);
@@ -434,8 +435,9 @@ foo_canvas_widget_update (FooCanvasItem *item, double i2w_dx, double i2w_dy, int
witem->cwidth = (int) (witem->width * item->canvas->pixels_per_unit + 0.5);
witem->cheight = (int) (witem->height * item->canvas->pixels_per_unit + 0.5);
}
-
- gtk_widget_set_usize (witem->widget, witem->cwidth, witem->cheight);
+ req.width = witem->cwidth;
+ req.height = witem->cheight;
+ gtk_widget_size_request (witem->widget, &req);
} else {
witem->cwidth = 0.0;
witem->cheight = 0.0;
@@ -464,7 +466,7 @@ foo_canvas_widget_map (FooCanvasItem *item)
FooCanvasWidget *witem = FOO_CANVAS_WIDGET (item);
if (parent_class->map)
(* parent_class->map) (item);
- if (witem->widget && GTK_WIDGET_VISIBLE (witem->widget))
+ if (witem->widget && gtk_widget_get_visible (witem->widget))
gtk_widget_map (witem->widget);
}
diff --git a/libfoocanvas/foo-canvas.c b/libfoocanvas/foo-canvas.c
index e666f8b..0ac3534 100644
--- a/libfoocanvas/foo-canvas.c
+++ b/libfoocanvas/foo-canvas.c
@@ -347,7 +347,7 @@ foo_canvas_item_realize (FooCanvasItem *item)
if (item->parent && !(item->parent->object.flags & FOO_CANVAS_ITEM_REALIZED))
(* FOO_CANVAS_ITEM_GET_CLASS (item->parent)->realize) (item->parent);
- if (item->parent == NULL && !GTK_WIDGET_REALIZED (GTK_WIDGET (item->canvas)))
+ if (item->parent == NULL && !gtk_widget_get_realized (GTK_WIDGET (item->canvas)))
gtk_widget_realize (GTK_WIDGET (item->canvas));
GTK_OBJECT_SET_FLAGS (item, FOO_CANVAS_ITEM_REALIZED);
@@ -509,7 +509,7 @@ foo_canvas_item_move (FooCanvasItem *item, double dx, double dy)
if (!FOO_CANVAS_ITEM_GET_CLASS (item)->translate) {
g_warning ("Item type %s does not implement translate method.\n",
- g_type_name (GTK_OBJECT_TYPE (item)));
+ g_type_name (G_OBJECT_TYPE (item)));
return;
}
@@ -779,7 +779,7 @@ foo_canvas_item_show (FooCanvasItem *item)
(* FOO_CANVAS_ITEM_GET_CLASS (item)->map) (item);
} else {
if (!(item->object.flags & FOO_CANVAS_ITEM_MAPPED) &&
- GTK_WIDGET_MAPPED (GTK_WIDGET (item->canvas)))
+ gtk_widget_get_mapped (GTK_WIDGET (item->canvas)))
(* FOO_CANVAS_ITEM_GET_CLASS (item)->map) (item);
}
@@ -837,7 +837,7 @@ foo_canvas_item_grab (FooCanvasItem *item, guint event_mask, GdkCursor *cursor,
int retval;
g_return_val_if_fail (FOO_IS_CANVAS_ITEM (item), GDK_GRAB_NOT_VIEWABLE);
- g_return_val_if_fail (GTK_WIDGET_MAPPED (item->canvas), GDK_GRAB_NOT_VIEWABLE);
+ g_return_val_if_fail (gtk_widget_get_mapped (GTK_WIDGET (item->canvas)), GDK_GRAB_NOT_VIEWABLE);
if (item->canvas->grabbed_item)
return GDK_GRAB_ALREADY_GRABBED;
@@ -1009,7 +1009,7 @@ foo_canvas_item_grab_focus (FooCanvasItem *item)
GdkEvent ev;
g_return_if_fail (FOO_IS_CANVAS_ITEM (item));
- g_return_if_fail (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (item->canvas)));
+ g_return_if_fail (gtk_widget_get_can_focus (GTK_WIDGET (item->canvas)));
focused_item = item->canvas->focused_item;
@@ -2424,7 +2424,7 @@ emit_event (FooCanvas *canvas, GdkEvent *event)
guint mask;
/* Could be an old pick event */
- if (!GTK_WIDGET_REALIZED (canvas)) {
+ if (!gtk_widget_get_realized (GTK_WIDGET (canvas))) {
return FALSE;
}
@@ -2860,7 +2860,7 @@ foo_canvas_expose (GtkWidget *widget, GdkEventExpose *event)
canvas = FOO_CANVAS (widget);
- if (!GTK_WIDGET_DRAWABLE (widget) || (event->window != canvas->layout.bin_window)) return FALSE;
+ if (!gtk_widget_is_drawable (widget) || (event->window != canvas->layout.bin_window)) return FALSE;
#ifdef VERBOSE
g_print ("Expose\n");
@@ -3148,7 +3148,7 @@ foo_canvas_set_pixels_per_unit (FooCanvas *canvas, double n)
* scrolling the window scroll causing exposes.
*/
window = NULL;
- if (GTK_WIDGET_MAPPED (widget)) {
+ if (gtk_widget_get_mapped (widget)) {
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
@@ -3310,7 +3310,7 @@ foo_canvas_request_redraw (FooCanvas *canvas, int x1, int y1, int x2, int y2)
g_return_if_fail (FOO_IS_CANVAS (canvas));
- if (!GTK_WIDGET_DRAWABLE (canvas) || (x1 >= x2) || (y1 >= y2)) return;
+ if (!gtk_widget_is_drawable (GTK_WIDGET (canvas)) || (x1 >= x2) || (y1 >= y2)) return;
bbox.x = x1;
bbox.y = y1;
@@ -3754,7 +3754,7 @@ foo_canvas_item_accessible_grab_focus (AtkComponent *component)
foo_canvas_item_grab_focus (item);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item->canvas));
- if (GTK_WIDGET_TOPLEVEL (toplevel)) {
+ if (gtk_widget_is_toplevel (toplevel)) {
gtk_window_present (GTK_WINDOW (toplevel));
}
@@ -3821,7 +3821,7 @@ foo_canvas_item_accessible_ref_state_set (AtkObject *accessible)
atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
}
}
- if (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (item->canvas))) {
+ if (gtk_widget_get_can_focus (GTK_WIDGET (item->canvas))) {
atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
if (item->canvas->focused_item == item) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]