[telegnome] Build cleanly with -DGSEAL_ENABLE.
- From: Colin Watson <cjwatson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [telegnome] Build cleanly with -DGSEAL_ENABLE.
- Date: Wed, 3 Nov 2010 01:35:41 +0000 (UTC)
commit 2e99d56e46a708066a6eac2710f323fd333e5550
Author: Colin Watson <cjwatson debian org>
Date: Wed Nov 3 01:33:43 2010 +0000
Build cleanly with -DGSEAL_ENABLE.
* configure.ac (PKG_CHECK_MODULES): Bump gtk+-2.0 requirement to
2.20.
* src/gui.c (cb_about, cb_drag): Use accessor functions rather than
direct field access.
* src/pixpack.c (pixpack_init, pixpack_realize, pixpack_unrealize,
pixpack_paint): Likewise.
* src/prefs.c (prefs_show): Likewise.
* NEWS: Document this.
ChangeLog | 13 +++++++++++++
NEWS | 2 ++
configure.ac | 2 +-
src/gui.c | 6 +++---
src/pixpack.c | 48 ++++++++++++++++++++++++++++--------------------
src/prefs.c | 4 ++--
6 files changed, 49 insertions(+), 26 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c30004e..fa3033e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-03 Colin Watson <cjwatson debian org>
+
+ Build cleanly with -DGSEAL_ENABLE.
+
+ * configure.ac (PKG_CHECK_MODULES): Bump gtk+-2.0 requirement to
+ 2.20.
+ * src/gui.c (cb_about, cb_drag): Use accessor functions rather than
+ direct field access.
+ * src/pixpack.c (pixpack_init, pixpack_realize, pixpack_unrealize,
+ pixpack_paint): Likewise.
+ * src/prefs.c (prefs_show): Likewise.
+ * NEWS: Document this.
+
2010-03-07 Colin Watson <cjwatson debian org>
* src/http.c (get_the_image): Remove unused variables output,
diff --git a/NEWS b/NEWS
index e5c7a39..206a84a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
Changes in TeleGNOME 0.1.2
==========================
+ * Build cleanly with -DGSEAL_ENABLE.
+
Changes in TeleGNOME 0.1.1
==========================
diff --git a/configure.ac b/configure.ac
index 4dbff25..730827a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ AC_PROG_CPP
AC_HEADER_STDC
AC_PROG_INSTALL
-PKG_CHECK_MODULES([TELEGNOME], [glib-2.0 gtk+-2.0 >= 2.12 gdk-pixbuf-2.0 libgnomeui-2.0 gnome-vfs-2.0])
+PKG_CHECK_MODULES([TELEGNOME], [glib-2.0 gtk+-2.0 >= 2.20 gdk-pixbuf-2.0 libgnomeui-2.0 gnome-vfs-2.0])
PROGRAMS_TELEGNOME="telegnome"
AC_SUBST(PROGRAMS_TELEGNOME)
diff --git a/src/gui.c b/src/gui.c
index 920a6c4..0f332ab 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -535,8 +535,8 @@ cb_about (GtkWidget* widget, gpointer data)
NULL };
if (about) {
- gdk_window_show(about->window);
- gdk_window_raise(about->window);
+ gdk_window_show(gtk_widget_get_window(about));
+ gdk_window_raise(gtk_widget_get_window(about));
return;
}
@@ -660,7 +660,7 @@ cb_drag (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection
default:
entry=gtk_entry_get_text(GTK_ENTRY(gui.entry));
gtk_selection_data_set(selection_data,
- selection_data->target, 8,
+ gtk_selection_data_get_target(selection_data), 8,
(const guchar *)entry, strlen(entry));
break;
diff --git a/src/pixpack.c b/src/pixpack.c
index 5e4749b..24da76d 100644
--- a/src/pixpack.c
+++ b/src/pixpack.c
@@ -101,9 +101,9 @@ pixpack_init(PixPack *pixpack)
priv->autosize = FALSE;
pixpack->private_data = priv;
- GTK_WIDGET_SET_FLAGS(GTK_WIDGET(pixpack),
- GTK_CAN_FOCUS | GTK_RECEIVES_DEFAULT);
- GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(pixpack), GTK_NO_WINDOW);
+ gtk_widget_set_can_focus(GTK_WIDGET(pixpack), TRUE);
+ gtk_widget_set_receives_default(GTK_WIDGET(pixpack), TRUE);
+ gtk_widget_set_has_window(GTK_WIDGET(pixpack), TRUE);
}
GtkWidget*
@@ -149,19 +149,23 @@ pixpack_realize(GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
PixPack *pixpack;
+ GtkAllocation allocation;
+ GdkWindow *window;
g_return_if_fail(widget != NULL);
g_return_if_fail(IS_PIXPACK(widget));
pixpack = PIXPACK(widget);
- GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
+ gtk_widget_set_realized(widget, TRUE);
+
+ gtk_widget_get_allocation(widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.height = widget->allocation.height;
- attributes.width = widget->allocation.width;
+ attributes.x = allocation.x;
+ attributes.y = allocation.y;
+ attributes.height = allocation.height;
+ attributes.width = allocation.width;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual(widget);
attributes.colormap = gtk_widget_get_colormap(widget);
@@ -169,12 +173,14 @@ pixpack_realize(GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- widget->window = gdk_window_new(gtk_widget_get_parent_window(widget),
- &attributes, attributes_mask);
- gdk_window_set_user_data(widget->window, widget);
+ window = gdk_window_new(gtk_widget_get_parent_window(widget),
+ &attributes, attributes_mask);
+ gtk_widget_set_window(widget, window);
+ gdk_window_set_user_data(window, widget);
- widget->style = gtk_style_attach(widget->style, widget->window);
- gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL);
+ gtk_widget_style_attach(widget);
+ gtk_style_set_background(gtk_widget_get_style(widget), window,
+ GTK_STATE_NORMAL);
}
@@ -188,10 +194,10 @@ pixpack_unrealize(GtkWidget *widget)
pixpack = PIXPACK(widget);
- if (GTK_WIDGET_MAPPED(widget))
+ if (gtk_widget_get_mapped(widget))
gtk_widget_unmap(widget);
- GTK_WIDGET_UNSET_FLAGS(widget, GTK_MAPPED);
+ gtk_widget_set_mapped(widget, FALSE);
if (GTK_WIDGET_CLASS(parent_class)->unrealize)
(*GTK_WIDGET_CLASS(parent_class)->unrealize)(widget);
@@ -203,6 +209,7 @@ pixpack_paint(PixPack* pixpack, GdkRectangle *area)
{
GtkWidget *widget;
PixPackPrivate *private;
+ GdkWindow *window;
g_return_if_fail(pixpack != NULL);
g_return_if_fail(IS_PIXPACK(pixpack));
@@ -218,11 +225,12 @@ pixpack_paint(PixPack* pixpack, GdkRectangle *area)
}
widget = GTK_WIDGET(pixpack);
- if (!GTK_WIDGET_DRAWABLE(widget))
+ if (!gtk_widget_is_drawable(widget))
return;
- gdk_window_clear_area(widget->window, area->x, area->y, area->width, area->height);
- gdk_gc_set_clip_rectangle(widget->style->black_gc, area);
+ window = gtk_widget_get_window(widget);
+ gdk_window_clear_area(window, area->x, area->y, area->width, area->height);
+ gdk_gc_set_clip_rectangle(gtk_widget_get_style(widget)->black_gc, area);
if (NULL == private->pixbuf)
return;
@@ -233,8 +241,8 @@ pixpack_paint(PixPack* pixpack, GdkRectangle *area)
private->scaled_pixbuf = gdk_pixbuf_scale_simple(private->pixbuf,
area->width, area->height,
GDK_INTERP_BILINEAR);
- gdk_pixbuf_render_to_drawable(private->scaled_pixbuf, widget->window,
- widget->style->black_gc, 0, 0,
+ gdk_pixbuf_render_to_drawable(private->scaled_pixbuf, window,
+ gtk_widget_get_style(widget)->black_gc, 0, 0,
area->x, area->y, area->width, area->height,
GDK_RGB_DITHER_MAX, 1, 1);
diff --git a/src/prefs.c b/src/prefs.c
index 727ffc0..a758a2a 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -82,8 +82,8 @@ prefs_show(void)
GtkWidget *page;
if (prefs_window != NULL) {
- gdk_window_show(GTK_WIDGET(prefs_window->box)->window);
- gdk_window_raise(GTK_WIDGET(prefs_window->box)->window);
+ gdk_window_show(gtk_widget_get_window(GTK_WIDGET(prefs_window->box)));
+ gdk_window_raise(gtk_widget_get_window(GTK_WIDGET(prefs_window->box)));
} else {
prefs_window = g_malloc(sizeof(PrefsWindow));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]