[totem] Use accessor functions instead direct access
- From: Javier Jardón <jjardon src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [totem] Use accessor functions instead direct access
- Date: Fri, 12 Feb 2010 18:54:11 +0000 (UTC)
commit eb74e996cbddfa6758b2bb392fbbaf7310adf3b6
Author: Javier Jardón <jjardon gnome org>
Date: Fri Feb 12 18:02:21 2010 +0100
Use accessor functions instead direct access
This is necessary to build with -DGSEAL_ENABLE
Required GTK+ version bumped to 2.19.5
http://bugzilla.gnome.org/show_bug.cgi?id=594053
browser-plugin/totem-glow-button.c | 90 ++++++++++++--------
browser-plugin/totem-plugin-viewer.c | 28 +++---
configure.in | 2 +-
src/backend/bacon-resize.c | 2 +-
src/backend/bacon-video-widget-gst-0.10.c | 80 ++++++++++--------
.../bacon-video-widget-gst-missing-plugins.c | 4 +-
.../brasero-disc-recorder/totem-disc-recorder.c | 2 +-
src/plugins/screenshot/gnome-screenshot-widget.c | 10 ++-
src/plugins/skipto/totem-skipto.c | 2 +-
src/plugins/totem-plugin-manager.c | 4 +-
src/plugins/totem-plugins-engine.c | 2 +-
src/totem-cell-renderer-video.c | 69 ++++++++++-----
src/totem-fullscreen.c | 8 +-
src/totem-interface.c | 4 +-
src/totem-menu.c | 6 +-
src/totem-object.c | 54 +++++++-----
src/totem-open-location.c | 4 +-
src/totem-playlist.c | 6 +-
src/totem-preferences.c | 9 +-
src/totem-sidebar.c | 15 ++--
src/totem-statusbar.c | 19 +++-
src/totem.c | 4 +-
22 files changed, 254 insertions(+), 170 deletions(-)
---
diff --git a/browser-plugin/totem-glow-button.c b/browser-plugin/totem-glow-button.c
index 0ff0317..9ace690 100644
--- a/browser-plugin/totem-glow-button.c
+++ b/browser-plugin/totem-glow-button.c
@@ -67,25 +67,28 @@ totem_glow_button_do_expose (TotemGlowButton *button)
{
GdkRectangle area;
GtkWidget *buttonw;
+ GtkAllocation allocation;
buttonw = GTK_WIDGET (button);
- if (buttonw->window == NULL)
+ if (gtk_widget_get_window (buttonw) == NULL)
return;
- area.x = buttonw->allocation.x;
- area.y = buttonw->allocation.y;
- area.width = buttonw->allocation.width;
- area.height = buttonw->allocation.height;
+ gtk_widget_get_allocation (buttonw, &allocation);
+ area.x = allocation.x;
+ area.y = allocation.y;
+ area.width = allocation.width;
+ area.height = allocation.height;
/* Send a fake expose event */
- gdk_window_invalidate_rect (buttonw->window, &area, TRUE);
- gdk_window_process_updates (buttonw->window, TRUE);
+ gdk_window_invalidate_rect (gtk_widget_get_window (buttonw), &area, TRUE);
+ gdk_window_process_updates (gtk_widget_get_window (buttonw), TRUE);
}
static gboolean
totem_glow_button_glow (TotemGlowButton *button)
{
GtkWidget *buttonw;
+ GtkAllocation allocation;
GTimeVal tv;
gdouble glow_factor, now;
gfloat fade_opacity, loop_time;
@@ -93,7 +96,7 @@ totem_glow_button_glow (TotemGlowButton *button)
buttonw = GTK_WIDGET (button);
- if (GTK_WIDGET_REALIZED (buttonw) == FALSE)
+ if (gtk_widget_get_realized (buttonw) == FALSE)
return TRUE;
if (button->screenshot == NULL) {
@@ -141,12 +144,13 @@ totem_glow_button_glow (TotemGlowButton *button)
glow_factor = FADE_OPACITY_DEFAULT * 0.5;
}
- gdk_window_begin_paint_rect (buttonw->window,
- &buttonw->allocation);
+ gtk_widget_get_allocation (buttonw, &allocation);
+ gdk_window_begin_paint_rect (gtk_widget_get_window (buttonw),
+ &allocation);
- cr = gdk_cairo_create (buttonw->window);
- gdk_cairo_rectangle (cr, &buttonw->allocation);
- cairo_translate (cr, buttonw->allocation.x, buttonw->allocation.y);
+ cr = gdk_cairo_create (gtk_widget_get_window (buttonw));
+ gdk_cairo_rectangle (cr, &allocation);
+ cairo_translate (cr, allocation.x, allocation.y);
cairo_clip (cr);
cairo_save (cr);
@@ -163,7 +167,7 @@ totem_glow_button_glow (TotemGlowButton *button)
cairo_destroy (cr);
- gdk_window_end_paint (buttonw->window);
+ gdk_window_end_paint (gtk_widget_get_window (buttonw));
if (button->anim_finished != FALSE)
totem_glow_button_set_timeout (button, FALSE);
@@ -196,6 +200,7 @@ fake_expose_widget (GtkWidget *widget,
gint x,
gint y)
{
+ GtkAllocation allocation;
GdkWindow *tmp_window;
GdkEventExpose event;
@@ -205,41 +210,51 @@ fake_expose_widget (GtkWidget *widget,
event.region = NULL;
event.count = 0;
- tmp_window = widget->window;
- widget->window = pixmap;
- widget->allocation.x += x;
- widget->allocation.y += y;
+ tmp_window = gtk_widget_get_window (widget);
+ gtk_widget_set_window (widget, pixmap);
+ gtk_widget_get_allocation (widget, &allocation);
+ allocation.x += x;
+ allocation.y += y;
+ gtk_widget_set_allocation (widget, &allocation);
- event.area = widget->allocation;
+ event.area = allocation;
gtk_widget_send_expose (widget, (GdkEvent *) &event);
- widget->window = tmp_window;
- widget->allocation.x -= x;
- widget->allocation.y -= y;
+ gtk_widget_set_window (widget, tmp_window);
+ gtk_widget_get_allocation (widget, &allocation);
+ allocation.x -= x;
+ allocation.y -= y;
+ gtk_widget_set_allocation (widget, &allocation);
}
static GdkPixmap *
take_screenshot (TotemGlowButton *button)
{
GtkWidget *buttonw;
+ GtkAllocation allocation;
+ GtkStyle *style;
GdkPixmap *pixmap;
gint width, height;
buttonw = GTK_WIDGET (button);
+ gtk_widget_get_allocation (buttonw, &allocation);
- width = buttonw->allocation.width;
- height = buttonw->allocation.height;
+ width = allocation.width;
+ height = allocation.height;
- pixmap = gdk_pixmap_new (buttonw->window, width, height, -1);
+ pixmap = gdk_pixmap_new (gtk_widget_get_window (buttonw),
+ width, height, -1);
/* Draw a rectangle with bg[SELECTED] */
- gdk_draw_rectangle (pixmap, buttonw->style->bg_gc[GTK_STATE_SELECTED],
+ style = gtk_widget_get_style (buttonw);
+ gdk_draw_rectangle (pixmap,
+ style->bg_gc[GTK_STATE_SELECTED],
TRUE, 0, 0, width + 1, height + 1);
/* then the image */
fake_expose_widget (gtk_button_get_image (GTK_BUTTON(button)), pixmap,
- -buttonw->allocation.x, -buttonw->allocation.y);
+ -allocation.x, -allocation.y);
return pixmap;
}
@@ -248,17 +263,22 @@ static GdkPixmap *
copy_pixmap (GtkWidget *widget)
{
GdkPixmap *pixmap;
+ GtkAllocation allocation;
+ GtkStyle *style;
- pixmap = gdk_pixmap_new (widget->window,
- widget->allocation.width,
- widget->allocation.height, -1);
+ gtk_widget_get_allocation (widget, &allocation);
+ pixmap = gdk_pixmap_new (gtk_widget_get_window (widget),
+ allocation.width,
+ allocation.height, -1);
+
+ style = gtk_widget_get_style (widget);
gdk_draw_drawable (pixmap,
- widget->style->bg_gc[GTK_STATE_NORMAL],
- widget->window,
- widget->allocation.x, widget->allocation.y,
+ style->bg_gc[GTK_STATE_NORMAL],
+ gtk_widget_get_window (widget),
+ allocation.x, allocation.y,
0, 0,
- widget->allocation.width, widget->allocation.height);
+ allocation.width, allocation.height);
return pixmap;
}
@@ -423,7 +443,7 @@ totem_glow_button_set_glow (TotemGlowButton *button, gboolean glow)
g_return_if_fail (TOTEM_IS_GLOW_BUTTON (button));
- if (GTK_WIDGET_MAPPED (GTK_WIDGET (button)) == FALSE
+ if (gtk_widget_get_mapped (GTK_WIDGET (button)) == FALSE
&& glow != FALSE) {
button->glow = glow;
return;
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index 323c102..0c363b2 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -348,7 +348,7 @@ totem_embedded_set_state (TotemEmbedded *emb, TotemStates state)
(TOTEM_TIME_LABEL (emb->fs->time_label), 0, 0);
if (emb->href_uri != NULL && emb->hidden == FALSE) {
gdk_window_set_cursor
- (GTK_WIDGET (emb->bvw)->window,
+ (gtk_widget_get_window (GTK_WIDGET (emb->bvw)),
emb->cursor);
}
break;
@@ -361,7 +361,7 @@ totem_embedded_set_state (TotemEmbedded *emb, TotemStates state)
totem_statusbar_set_text (emb->statusbar, _("Playing"));
if (emb->href_uri == NULL && emb->hidden == FALSE) {
gdk_window_set_cursor
- (GTK_WIDGET (emb->bvw)->window,
+ (gtk_widget_get_window (GTK_WIDGET (emb->bvw)),
NULL);
}
break;
@@ -538,7 +538,7 @@ totem_embedded_set_href (TotemEmbedded *embedded,
g_free (embedded->href_uri);
embedded->href_uri = NULL;
gdk_window_set_cursor
- (GTK_WIDGET (embedded->bvw)->window, NULL);
+ (gtk_widget_get_window (GTK_WIDGET (embedded->bvw)), NULL);
}
if (target != NULL) {
@@ -758,7 +758,7 @@ totem_embedded_set_fullscreen (TotemEmbedded *emb,
/* Move the fullscreen window to the screen where the
* video widget currently is */
monitor = gdk_screen_get_monitor_at_window (gtk_widget_get_screen (GTK_WIDGET (emb->bvw)),
- GTK_WIDGET (emb->bvw)->window);
+ gtk_widget_get_window (GTK_WIDGET (emb->bvw)));
gdk_screen_get_monitor_geometry (gtk_widget_get_screen (GTK_WIDGET (emb->bvw)),
monitor, &rect);
gtk_window_move (GTK_WINDOW (emb->fs_window), rect.x, rect.y);
@@ -1200,19 +1200,21 @@ popup_menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, Gt
GtkWidget *widget = GTK_WIDGET (button);
GtkRequisition menu_req;
GtkTextDirection direction;
+ GtkAllocation allocation;
gtk_widget_size_request (GTK_WIDGET (menu), &menu_req);
direction = gtk_widget_get_direction (widget);
- gdk_window_get_origin (widget->window, x, y);
- *x += widget->allocation.x;
- *y += widget->allocation.y;
+ gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
+ gtk_widget_get_allocation (widget, &allocation);
+ *x += allocation.x;
+ *y += allocation.y;
if (direction == GTK_TEXT_DIR_LTR)
- *x += MAX (widget->allocation.width - menu_req.width, 0);
- else if (menu_req.width > widget->allocation.width)
- *x -= menu_req.width - widget->allocation.width;
+ *x += MAX (allocation.width - menu_req.width, 0);
+ else if (menu_req.width > allocation.width)
+ *x -= menu_req.width - allocation.width;
/* This might not work properly if the popup button is right at the
* top of the screen, but really, what are the chances */
@@ -1240,7 +1242,7 @@ on_popup_button_toggled (GtkToggleButton *button, TotemEmbedded *emb)
menu = GTK_MENU (gtk_builder_get_object (emb->menuxml, "menu"));
- if (gtk_toggle_button_get_active (button) && !GTK_WIDGET_VISIBLE (menu)) {
+ if (gtk_toggle_button_get_active (button) && !gtk_widget_get_visible (GTK_WIDGET (menu))) {
/* we get here only when the menu is activated by a key
* press, so that we can select the first menu item */
popup_menu_over_arrow (button, menu, NULL);
@@ -1257,7 +1259,7 @@ on_popup_button_button_pressed (GtkToggleButton *button,
GtkMenu *menu;
menu = GTK_MENU (gtk_builder_get_object (emb->menuxml, "menu"));
- if (!GTK_WIDGET_VISIBLE (menu)) {
+ if (!gtk_widget_get_visible (GTK_WIDGET (menu))) {
popup_menu_over_arrow (button, menu, event);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
} else {
@@ -1426,7 +1428,7 @@ on_video_button_press_event (BaconVideoWidget *bvw,
totem_interface_error (_("An error occurred"), emb->error->message, (GtkWindow *) (emb->window));
g_error_free (emb->error);
emb->error = NULL;
- } else if (!GTK_WIDGET_VISIBLE (menu)) {
+ } else if (!gtk_widget_get_visible (GTK_WIDGET (menu))) {
g_message ("emitting signal");
g_signal_emit (emb, signals[BUTTON_PRESS], 0,
event->time,
diff --git a/configure.in b/configure.in
index 01ba2aa..13e3292 100644
--- a/configure.in
+++ b/configure.in
@@ -38,7 +38,7 @@ AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
# Requirements
GLIB_REQS=2.22
-GTK_REQS=2.19.1
+GTK_REQS=2.19.5
TOTEM_PLPARSER_REQS=2.29.1
GNOMEICON_REQS=2.15.90
DBUS_REQS=0.61
diff --git a/src/backend/bacon-resize.c b/src/backend/bacon-resize.c
index 7dce88d..e5370e0 100644
--- a/src/backend/bacon-resize.c
+++ b/src/backend/bacon-resize.c
@@ -167,7 +167,7 @@ set_video_widget (BaconResize *resize, GtkWidget *video_widget)
int event_basep, error_basep;
XRRScreenConfiguration *xr_screen_conf;
#endif
- g_return_if_fail (GTK_WIDGET_REALIZED (video_widget));
+ g_return_if_fail (gtk_widget_get_realized (video_widget));
resize->priv->video_widget = video_widget;
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index ae6f9f2..3e19739 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -553,6 +553,7 @@ bacon_video_widget_realize (GtkWidget * widget)
GdkColor colour;
GdkWindow *window;
GdkEventMask event_mask;
+ GtkAllocation allocation;
event_mask = gtk_widget_get_events (widget)
| GDK_POINTER_MOTION_MASK
@@ -567,8 +568,9 @@ bacon_video_widget_realize (GtkWidget * widget)
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = 0;
attributes.y = 0;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ gtk_widget_get_allocation (widget, &allocation);
+ attributes.width = allocation.width;
+ attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK |
@@ -588,7 +590,7 @@ bacon_video_widget_realize (GtkWidget * widget)
gtk_widget_set_style (widget,
gtk_style_attach (gtk_widget_get_style (widget), window));
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
/* Connect to configure event on the top level window */
g_signal_connect (G_OBJECT (gtk_widget_get_toplevel (widget)),
@@ -685,6 +687,7 @@ bacon_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event)
gboolean draw_logo;
XID window;
GdkWindow *win;
+ GtkAllocation allocation;
if (event && event->count > 0)
return TRUE;
@@ -707,8 +710,9 @@ bacon_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event)
/* Start with a nice black canvas */
win = gtk_widget_get_window (widget);
+ gtk_widget_get_allocation (widget, &allocation);
gdk_draw_rectangle (win, gtk_widget_get_style (widget)->black_gc, TRUE, 0, 0,
- widget->allocation.width, widget->allocation.height);
+ allocation.width, allocation.height);
/* If there's only audio and no visualisation, draw the logo as well.
* If we have a cover image to display, we display it regardless of whether we're
@@ -729,12 +733,12 @@ bacon_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event)
cr = gdk_cairo_create (gtk_widget_get_window (widget));
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
- cairo_rectangle (cr, 0, 0, widget->allocation.width, widget->allocation.height);
+ cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
s_width = gdk_pixbuf_get_width (pixbuf);
s_height = gdk_pixbuf_get_height (pixbuf);
- d_width = widget->allocation.width;
- d_height = widget->allocation.height;
+ d_width = allocation.width;
+ d_height = allocation.height;
/* Limit the width/height to 256Ã?256 pixels, but only if we're displaying the logo proper */
if (!bvw->priv->cover_pixbuf && d_width > LOGO_SIZE && d_height > LOGO_SIZE)
@@ -763,7 +767,7 @@ bacon_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event)
else
logo = g_object_ref (G_OBJECT (pixbuf));
- gdk_cairo_set_source_pixbuf (cr, logo, (widget->allocation.width - s_width) / 2, (widget->allocation.height - s_height) / 2);
+ gdk_cairo_set_source_pixbuf (cr, logo, (allocation.width - s_width) / 2, (allocation.height - s_height) / 2);
cairo_paint (cr);
cairo_destroy (cr);
@@ -772,8 +776,8 @@ bacon_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event)
/* No pixbuf, just draw a black background then */
gdk_window_clear_area (win,
0, 0,
- widget->allocation.width,
- widget->allocation.height);
+ allocation.width,
+ allocation.height);
}
} else {
/* no logo, pass the expose to gst */
@@ -783,8 +787,8 @@ bacon_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event)
/* No xoverlay to expose yet */
gdk_window_clear_area (win,
0, 0,
- widget->allocation.width,
- widget->allocation.height);
+ allocation.width,
+ allocation.height);
}
}
if (xoverlay != NULL)
@@ -896,29 +900,29 @@ bacon_video_widget_size_request (GtkWidget * widget,
static void
resize_video_window (BaconVideoWidget *bvw)
{
- const GtkAllocation *allocation;
+ GtkAllocation allocation;
gfloat width, height, ratio, x, y;
int w, h;
g_return_if_fail (bvw != NULL);
g_return_if_fail (BACON_IS_VIDEO_WIDGET (bvw));
- allocation = >K_WIDGET (bvw)->allocation;
+ gtk_widget_get_allocation (GTK_WIDGET (bvw), &allocation);
get_media_size (bvw, &w, &h);
if (!w || !h) {
- w = allocation->width;
- h = allocation->height;
+ w = allocation.width;
+ h = allocation.height;
}
width = w;
height = h;
/* calculate ratio for fitting video into the available space */
- if ((gfloat) allocation->width / width >
- (gfloat) allocation->height / height) {
- ratio = (gfloat) allocation->height / height;
+ if ((gfloat) allocation.width / width >
+ (gfloat) allocation.height / height) {
+ ratio = (gfloat) allocation.height / height;
} else {
- ratio = (gfloat) allocation->width / width;
+ ratio = (gfloat) allocation.width / width;
}
/* apply zoom factor */
@@ -926,8 +930,8 @@ resize_video_window (BaconVideoWidget *bvw)
width *= ratio;
height *= ratio;
- x = (allocation->width - width) / 2;
- y = (allocation->height - height) / 2;
+ x = (allocation.width - width) / 2;
+ y = (allocation.height - height) / 2;
gdk_window_move_resize (bvw->priv->video_window, x, y, width, height);
gtk_widget_queue_draw (GTK_WIDGET (bvw));
@@ -941,9 +945,9 @@ bacon_video_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
g_return_if_fail (widget != NULL);
g_return_if_fail (BACON_IS_VIDEO_WIDGET (widget));
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
- if (GTK_WIDGET_REALIZED (widget)) {
+ if (gtk_widget_get_realized (widget)) {
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x, allocation->y,
@@ -1274,8 +1278,8 @@ bacon_video_widget_init (BaconVideoWidget * bvw)
{
BaconVideoWidgetPrivate *priv;
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bvw), GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_can_focus (GTK_WIDGET (bvw), TRUE);
+ gtk_widget_set_double_buffered (GTK_WIDGET (bvw), TRUE);
bvw->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (bvw, BACON_TYPE_VIDEO_WIDGET, BaconVideoWidgetPrivate);
@@ -1334,6 +1338,7 @@ bvw_handle_application_message (BaconVideoWidget *bvw, GstMessage *msg)
{
const gchar *msg_name;
GdkWindow *window;
+ GtkAllocation allocation;
msg_name = gst_structure_get_name (msg->structure);
g_return_if_fail (msg_name != NULL);
@@ -1356,8 +1361,9 @@ bvw_handle_application_message (BaconVideoWidget *bvw, GstMessage *msg)
&& !bvw->priv->window_resized) {
bacon_video_widget_set_scale_ratio (bvw, 1);
} else {
+ gtk_widget_get_allocation (GTK_WIDGET (bvw), &allocation);
bacon_video_widget_size_allocate (GTK_WIDGET (bvw),
- >K_WIDGET (bvw)->allocation);
+ &allocation);
/* Uhm, so this ugly hack here makes media loading work for
* weird laptops with NVIDIA graphics cards... Dunno what the
@@ -1684,7 +1690,7 @@ bvw_check_missing_auth (BaconVideoWidget * bvw, GstMessage * err_msg)
retval = FALSE;
if (bvw->priv->use_type != BVW_USE_TYPE_VIDEO ||
- GTK_WIDGET_REALIZED (bvw) == FALSE)
+ gtk_widget_get_realized (GTK_WIDGET (bvw)) == FALSE)
return retval;
/* The user already tried, and we aborted */
@@ -2520,11 +2526,11 @@ parse_stream_info (BaconVideoWidget *bvw)
g_object_get (bvw->priv->play, "flags", &flags, NULL);
if (bvw->priv->show_vfx) {
gdk_window_show (bvw->priv->video_window);
- GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_double_buffered (GTK_WIDGET (bvw), FALSE);
flags |= GST_PLAY_FLAGS_VIS;
} else {
gdk_window_hide (bvw->priv->video_window);
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_double_buffered (GTK_WIDGET (bvw), TRUE);
flags &= ~GST_PLAY_FLAGS_VIS;
}
g_object_set (bvw->priv->play, "flags", flags, NULL);
@@ -3548,6 +3554,7 @@ gboolean
bacon_video_widget_open (BaconVideoWidget * bvw,
const gchar * mrl, const gchar *subtitle_uri, GError ** error)
{
+ GtkAllocation allocation;
GstMessage *err_msg = NULL;
GFile *file;
gboolean ret;
@@ -3617,9 +3624,10 @@ bacon_video_widget_open (BaconVideoWidget * bvw,
if (bvw->priv->video_window) {
gdk_window_hide (bvw->priv->video_window);
/* We also take the whole widget until we know video size */
+ gtk_widget_get_allocation (GTK_WIDGET (bvw), &allocation);
gdk_window_move_resize (bvw->priv->video_window, 0, 0,
- GTK_WIDGET (bvw)->allocation.width,
- GTK_WIDGET (bvw)->allocation.height);
+ allocation.width,
+ allocation.height);
}
/* Visualization settings changed */
@@ -4207,10 +4215,10 @@ bacon_video_widget_set_logo_mode (BaconVideoWidget * bvw, gboolean logo_mode)
if (priv->video_window) {
if (logo_mode) {
gdk_window_hide (priv->video_window);
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_double_buffered (GTK_WIDGET (bvw), TRUE);
} else {
gdk_window_show (priv->video_window);
- GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_double_buffered (GTK_WIDGET (bvw), FALSE);
}
}
@@ -4749,11 +4757,11 @@ setup_vis (BaconVideoWidget * bvw)
g_object_get (bvw->priv->play, "flags", &flags, NULL);
if (bvw->priv->show_vfx && !bvw->priv->cover_pixbuf) {
gdk_window_show (bvw->priv->video_window);
- GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_double_buffered (GTK_WIDGET (bvw), FALSE);
flags |= GST_PLAY_FLAGS_VIS;
} else {
gdk_window_hide (bvw->priv->video_window);
- GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
+ gtk_widget_set_double_buffered (GTK_WIDGET (bvw), TRUE);
flags &= ~GST_PLAY_FLAGS_VIS;
}
g_object_set (bvw->priv->play, "flags", flags, NULL);
diff --git a/src/backend/bacon-video-widget-gst-missing-plugins.c b/src/backend/bacon-video-widget-gst-missing-plugins.c
index 85c6db0..e762de3 100644
--- a/src/backend/bacon-video-widget-gst-missing-plugins.c
+++ b/src/backend/bacon-video-widget-gst-missing-plugins.c
@@ -98,7 +98,7 @@ bacon_video_widget_gst_get_toplevel (GtkWidget *widget)
if (GTK_IS_PLUG (parent))
return bacon_video_widget_gtk_plug_get_toplevel (GTK_PLUG (parent));
else
- return GDK_WINDOW_XID(parent->window);
+ return GDK_WINDOW_XID(gtk_widget_get_window (parent));
}
#endif
@@ -272,7 +272,7 @@ bacon_video_widget_gst_on_missing_plugins_event (BaconVideoWidget *bvw, char **d
install_ctx = gst_install_plugins_context_new ();
#ifdef GDK_WINDOWING_X11
- if (GTK_WIDGET (bvw)->window != NULL && GTK_WIDGET_REALIZED (bvw))
+ if (gtk_widget_get_window (GTK_WIDGET (bvw)) != NULL && gtk_widget_get_realized (GTK_WIDGET (bvw)))
{
gulong xid = 0;
diff --git a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
index 3e3bcc6..1e45344 100644
--- a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
+++ b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
@@ -108,7 +108,7 @@ totem_disc_recorder_plugin_start_burning (TotemDiscRecorderPlugin *pi,
main_window = totem_get_main_window (pi->totem);
screen = gtk_widget_get_screen (GTK_WIDGET (main_window));
- xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE (GTK_WIDGET (main_window)->window));
+ xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE (gtk_widget_get_window (GTK_WIDGET (main_window))));
xid_str = g_strdup_printf ("%d", xid);
g_ptr_array_add (array, (gpointer) "-x");
g_ptr_array_add (array, xid_str);
diff --git a/src/plugins/screenshot/gnome-screenshot-widget.c b/src/plugins/screenshot/gnome-screenshot-widget.c
index 42ed3fb..2862775 100644
--- a/src/plugins/screenshot/gnome-screenshot-widget.c
+++ b/src/plugins/screenshot/gnome-screenshot-widget.c
@@ -266,10 +266,13 @@ on_preview_expose_event (GtkWidget *drawing_area, GdkEventExpose *event, GnomeSc
{
GdkPixbuf *pixbuf = NULL;
gboolean free_pixbuf = FALSE;
+ GtkStyle *style;
+
+ style = gtk_widget_get_style (drawing_area);
/* Stolen from GtkImage. I really should just make the drawing area an
* image some day (TODO) */
- if (GTK_WIDGET_STATE (drawing_area) != GTK_STATE_NORMAL) {
+ if (gtk_widget_get_state (drawing_area) != GTK_STATE_NORMAL) {
GtkIconSource *source;
source = gtk_icon_source_new ();
@@ -277,7 +280,8 @@ on_preview_expose_event (GtkWidget *drawing_area, GdkEventExpose *event, GnomeSc
gtk_icon_source_set_size (source, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_icon_source_set_size_wildcarded (source, FALSE);
- pixbuf = gtk_style_render_icon (drawing_area->style, source, gtk_widget_get_direction (drawing_area), GTK_WIDGET_STATE (drawing_area),
+ pixbuf = gtk_style_render_icon (style, source,
+ gtk_widget_get_direction (drawing_area), gtk_widget_get_state (drawing_area),
(GtkIconSize) -1, drawing_area, "gtk-image");
free_pixbuf = TRUE;
gtk_icon_source_free (source);
@@ -286,7 +290,7 @@ on_preview_expose_event (GtkWidget *drawing_area, GdkEventExpose *event, GnomeSc
}
/* FIXME: Draw it insensitive in that case */
- gdk_draw_pixbuf (drawing_area->window, drawing_area->style->white_gc, pixbuf, event->area.x, event->area.y, event->area.x, event->area.y,
+ gdk_draw_pixbuf (gtk_widget_get_window (drawing_area), style->white_gc, pixbuf, event->area.x, event->area.y, event->area.x, event->area.y,
event->area.width, event->area.height, GDK_RGB_DITHER_NORMAL, 0, 0);
g_object_unref (pixbuf);
diff --git a/src/plugins/skipto/totem-skipto.c b/src/plugins/skipto/totem-skipto.c
index acc1b16..93e2f43 100644
--- a/src/plugins/skipto/totem-skipto.c
+++ b/src/plugins/skipto/totem-skipto.c
@@ -182,7 +182,7 @@ totem_skipto_new (TotemSkiptoPlugin *plugin)
container = GTK_WIDGET (gtk_builder_get_object (skipto->priv->xml,
"tstw_skip_vbox"));
gtk_container_set_border_width (GTK_CONTAINER (skipto), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (skipto)->vbox),
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (skipto))),
container,
TRUE, /* expand */
TRUE, /* fill */
diff --git a/src/plugins/totem-plugin-manager.c b/src/plugins/totem-plugin-manager.c
index 5ae6faf..26331b0 100644
--- a/src/plugins/totem-plugin-manager.c
+++ b/src/plugins/totem-plugin-manager.c
@@ -187,10 +187,12 @@ cursor_changed_cb (GtkTreeSelection *selection,
/* rescale icon to fit header if needed */
GdkPixbuf *icon_scaled;
gint width, height, header_height;
+ GtkAllocation allocation;
width = gdk_pixbuf_get_width (icon);
height = gdk_pixbuf_get_height (icon);
- header_height = pm->priv->header_hbox->allocation.height;
+ gtk_widget_get_allocation (pm->priv->header_hbox, &allocation);
+ header_height = allocation.height;
if (height > header_height) {
icon_scaled = gdk_pixbuf_scale_simple (icon,
(gfloat)width/height*header_height, header_height,
diff --git a/src/plugins/totem-plugins-engine.c b/src/plugins/totem-plugins-engine.c
index 09f9964..16e3c33 100644
--- a/src/plugins/totem-plugins-engine.c
+++ b/src/plugins/totem-plugins-engine.c
@@ -681,7 +681,7 @@ totem_plugins_engine_configure_plugin (TotemPluginInfo *info,
gtk_window_set_transient_for (GTK_WINDOW (conf_dlg),
parent);
- wg = parent->group;
+ wg = gtk_window_get_group (parent);
if (wg == NULL)
{
wg = gtk_window_group_new ();
diff --git a/src/totem-cell-renderer-video.c b/src/totem-cell-renderer-video.c
index d7b7b77..33a28de 100644
--- a/src/totem-cell-renderer-video.c
+++ b/src/totem-cell-renderer-video.c
@@ -243,14 +243,26 @@ get_size (GtkCellRenderer *cell,
GdkRectangle *thumbnail_area)
{
TotemCellRendererVideoPrivate *priv = TOTEM_CELL_RENDERER_VIDEO (cell)->priv;
+ GtkStyle *style;
guint pixbuf_width = 0;
guint pixbuf_height = 0;
guint title_width, title_height;
guint calc_width, calc_height;
+ gint cell_width;
+ guint cell_xpad, cell_ypad;
+ gfloat cell_xalign, cell_yalign;
PangoContext *context;
PangoFontMetrics *metrics;
PangoFontDescription *font_desc;
+ g_object_get (cell,
+ "width", &cell_width,
+ "xpad", &cell_xpad,
+ "ypad", &cell_ypad,
+ "xalign", &cell_xalign,
+ "yalign", &cell_yalign,
+ NULL);
+
/* Calculate thumbnail dimensions */
if (priv->thumbnail != NULL) {
pixbuf_width = gdk_pixbuf_get_width (priv->thumbnail);
@@ -262,13 +274,14 @@ get_size (GtkCellRenderer *cell,
pixbuf_width = width;
pixbuf_height = height;
} else {
- pixbuf_width = cell->width;
- pixbuf_height = cell->width;
+ pixbuf_width = cell_width;
+ pixbuf_height = cell_width;
}
}
/* Calculate title dimensions */
- font_desc = pango_font_description_copy_static (widget->style->font_desc);
+ style = gtk_widget_get_style (widget);
+ font_desc = pango_font_description_copy_static (style->font_desc);
if (priv->thumbnail != NULL)
pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
context = gtk_widget_get_pango_context (widget);
@@ -276,8 +289,8 @@ get_size (GtkCellRenderer *cell,
if (cell_area)
title_width = cell_area->width;
- else if (cell->width != -1)
- title_width = cell->width;
+ else if (cell_width != -1)
+ title_width = cell_width;
else
title_width = pixbuf_width;
@@ -287,23 +300,23 @@ get_size (GtkCellRenderer *cell,
pango_font_description_free (font_desc);
/* Calculate the total final size */
- calc_width = cell->xpad * 2 + MAX (pixbuf_width, title_width);
- calc_height = cell->ypad * 3 + pixbuf_height + title_height;
+ calc_width = cell_xpad * 2 + MAX (pixbuf_width, title_width);
+ calc_height = cell_ypad * 3 + pixbuf_height + title_height;
if (draw_area) {
if (cell_area && calc_width > 0 && calc_height > 0) {
draw_area->x = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
- (1.0 - cell->xalign) : cell->xalign) * (cell_area->width - calc_width));
+ (1.0 - cell_xalign) : cell_xalign) * (cell_area->width - calc_width));
draw_area->x = MAX (draw_area->x, 0);
- draw_area->y = (cell->yalign * (cell_area->height - calc_height));
+ draw_area->y = (cell_yalign * (cell_area->height - calc_height));
draw_area->y = MAX (draw_area->y, 0);
} else {
draw_area->x = 0;
draw_area->y = 0;
}
- draw_area->x += cell->xpad;
- draw_area->y += cell->ypad;
+ draw_area->x += cell_xpad;
+ draw_area->y += cell_ypad;
draw_area->width = calc_width;
draw_area->height = calc_height;
@@ -318,18 +331,18 @@ get_size (GtkCellRenderer *cell,
title_area->height = title_height;
if (pixbuf_height > 0)
- title_area->y = draw_area->y + pixbuf_height + cell->ypad;
+ title_area->y = draw_area->y + pixbuf_height + cell_ypad;
else
title_area->y = draw_area->y;
}
if (pixbuf_height > 0 && thumbnail_area) {
thumbnail_area->x = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
- (1.0 - cell->xalign) : cell->xalign) *
+ (1.0 - cell_xalign) : cell_xalign) *
(cell_area->width - pixbuf_width));
thumbnail_area->x = MAX (thumbnail_area->x, 0);
thumbnail_area->y = draw_area->y;
- thumbnail_area->width = cell->xpad * 2 + pixbuf_width;
+ thumbnail_area->width = cell_xpad * 2 + pixbuf_width;
thumbnail_area->height = pixbuf_height;
}
}
@@ -376,13 +389,22 @@ totem_cell_renderer_video_render (GtkCellRenderer *cell,
cairo_t *cr;
PangoLayout *layout;
GtkStateType state;
+ GtkStyle *style;
+ guint cell_xpad, cell_ypad;
+ gboolean cell_is_expander;
+
+ g_object_get (cell,
+ "xpad", &cell_xpad,
+ "ypad", &cell_ypad,
+ "is_expander", cell_is_expander,
+ NULL);
get_size (cell, widget, cell_area, &draw_area, &title_area, &thumbnail_area);
draw_area.x += cell_area->x;
draw_area.y += cell_area->y;
- draw_area.width -= cell->xpad * 2;
- draw_area.height -= cell->ypad * 2;
+ draw_area.width -= cell_xpad * 2;
+ draw_area.height -= cell_ypad * 2;
if (!gdk_rectangle_intersect (cell_area, &draw_area, &draw_rect) ||
!gdk_rectangle_intersect (expose_area, &draw_rect, &draw_rect))
@@ -396,31 +418,32 @@ totem_cell_renderer_video_render (GtkCellRenderer *cell,
else
pixbuf = NULL;
- if (cell->is_expander)
+ if (cell_is_expander)
return;
/* Sort out the title */
- if (!cell->sensitive) {
+ if (!gtk_cell_renderer_get_sensitive (cell)) {
state = GTK_STATE_INSENSITIVE;
} else if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) {
- if (GTK_WIDGET_HAS_FOCUS (widget))
+ if (gtk_widget_has_focus (widget))
state = GTK_STATE_SELECTED;
else
state = GTK_STATE_ACTIVE;
} else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT &&
- GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) {
+ gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT) {
state = GTK_STATE_PRELIGHT;
} else {
- if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
+ if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
else
state = GTK_STATE_NORMAL;
}
/* Draw the title */
+ style = gtk_widget_get_style (widget);
layout = gtk_widget_create_pango_layout (widget, priv->title);
if (pixbuf != NULL) {
- PangoFontDescription *desc = pango_font_description_copy_static (widget->style->font_desc);
+ PangoFontDescription *desc = pango_font_description_copy_static (style->font_desc);
pango_font_description_set_weight (desc, PANGO_WEIGHT_BOLD);
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);
@@ -430,7 +453,7 @@ totem_cell_renderer_video_render (GtkCellRenderer *cell,
pango_layout_set_width (layout, title_area.width * PANGO_SCALE);
pango_layout_set_alignment (layout, priv->alignment);
- gtk_paint_layout (widget->style, window, state, TRUE, expose_area, widget, "cellrenderervideotitle",
+ gtk_paint_layout (style, window, state, TRUE, expose_area, widget, "cellrenderervideotitle",
cell_area->x + title_area.x,
cell_area->y + title_area.y,
layout);
diff --git a/src/totem-fullscreen.c b/src/totem-fullscreen.c
index f368dc0..1d4e537 100644
--- a/src/totem-fullscreen.c
+++ b/src/totem-fullscreen.c
@@ -94,14 +94,16 @@ totem_fullscreen_move_popups (TotemFullscreen *fs)
GdkScreen *screen;
GdkRectangle fullscreen_rect;
+ GdkWindow *window;
TotemFullscreenPrivate *priv = fs->priv;
g_return_if_fail (priv->parent_window != NULL);
/* Obtain the screen rectangle */
screen = gtk_window_get_screen (GTK_WINDOW (priv->parent_window));
+ window = gtk_widget_get_window (priv->parent_window);
gdk_screen_get_monitor_geometry (screen,
- gdk_screen_get_monitor_at_window (screen, priv->parent_window->window),
+ gdk_screen_get_monitor_at_window (screen, window),
&fullscreen_rect);
/* Get the popup window sizes */
@@ -256,7 +258,7 @@ totem_fullscreen_set_cursor (TotemFullscreen *fs, gboolean state)
static gboolean
totem_fullscreen_is_volume_popup_visible (TotemFullscreen *fs)
{
- return GTK_WIDGET_VISIBLE (gtk_scale_button_get_popup (GTK_SCALE_BUTTON (fs->volume)));
+ return gtk_widget_get_visible (gtk_scale_button_get_popup (GTK_SCALE_BUTTON (fs->volume)));
}
static void
@@ -429,7 +431,7 @@ totem_fullscreen_parent_window_notify (GtkWidget *parent_window,
popup = gtk_scale_button_get_popup (GTK_SCALE_BUTTON (fs->volume));
if (parent_window == fs->priv->parent_window &&
gtk_window_is_active (GTK_WINDOW (parent_window)) == FALSE &&
- GTK_WIDGET_VISIBLE (popup) == FALSE) {
+ gtk_widget_get_visible (popup) == FALSE) {
totem_fullscreen_force_popup_hide (fs);
totem_fullscreen_set_cursor (fs, TRUE);
} else {
diff --git a/src/totem-interface.c b/src/totem-interface.c
index dd6532b..87f5a91 100644
--- a/src/totem-interface.c
+++ b/src/totem-interface.c
@@ -183,7 +183,7 @@ totem_interface_error_with_link (const char *title, const char *reason,
hbox = gtk_hbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), link_button, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (error_dialog)->vbox), hbox, TRUE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (error_dialog))), hbox, TRUE, FALSE, 0);
gtk_widget_show_all (hbox);
gtk_dialog_set_default_response (GTK_DIALOG (error_dialog), GTK_RESPONSE_OK);
@@ -338,7 +338,7 @@ totem_interface_set_transient_for (GtkWindow *window, GtkWindow *parent)
toplevel = totem_gtk_plug_get_toplevel (GTK_PLUG (parent));
if (toplevel != NULL) {
gdk_window_set_transient_for
- (GTK_WIDGET (window)->window, toplevel);
+ (gtk_widget_get_window (GTK_WIDGET (window)), toplevel);
g_object_unref (toplevel);
}
} else {
diff --git a/src/totem-menu.c b/src/totem-menu.c
index e294a44..044f01a 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -524,7 +524,7 @@ connect_proxy_cb (GtkActionGroup *action_group,
if (!GTK_IS_MENU_ITEM (proxy))
return;
- label = GTK_LABEL (GTK_BIN (proxy)->child);
+ label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (proxy)));
gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_MIDDLE);
gtk_label_set_max_width_chars (label,TOTEM_MAX_RECENT_ITEM_LEN);
@@ -1379,7 +1379,7 @@ plugins_action_callback (GtkAction *action, Totem *totem)
GTK_RESPONSE_CLOSE,
NULL);
gtk_container_set_border_width (GTK_CONTAINER (totem->plugins), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (totem->plugins)->vbox), 2);
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (totem->plugins))), 2);
gtk_dialog_set_has_separator (GTK_DIALOG (totem->plugins), FALSE);
g_signal_connect_object (G_OBJECT (totem->plugins),
@@ -1393,7 +1393,7 @@ plugins_action_callback (GtkAction *action, Totem *totem)
manager = totem_plugin_manager_new ();
gtk_widget_show_all (GTK_WIDGET (manager));
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (totem->plugins)->vbox),
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (totem->plugins))),
manager);
}
diff --git a/src/totem-object.c b/src/totem-object.c
index dde2bae..12c676f 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -1716,11 +1716,11 @@ totem_action_set_mrl_with_warning (Totem *totem,
else
bacon_video_widget_set_user_agent (totem->bvw, NULL);
- totem_gdk_window_set_waiting_cursor (totem->win->window);
+ totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
totem_try_restore_position (totem, mrl);
retval = bacon_video_widget_open (totem->bvw, mrl, subtitle ? subtitle : autoload_sub, &err);
g_free (autoload_sub);
- gdk_window_set_cursor (totem->win->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
totem->mrl = g_strdup (mrl);
/* Play/Pause */
@@ -2152,7 +2152,7 @@ totem_action_drop_files (Totem *totem, GtkSelectionData *data,
GList *p, *file_list;
gboolean cleared = FALSE;
- list = g_uri_list_extract_uris ((const char *)data->data);
+ list = g_uri_list_extract_uris ((const char *) gtk_selection_data_get_data (data));
file_list = NULL;
for (i = 0; list[i] != NULL; i++) {
@@ -2170,7 +2170,7 @@ totem_action_drop_files (Totem *totem, GtkSelectionData *data,
if (file_list == NULL)
return FALSE;
- totem_gdk_window_set_waiting_cursor (totem->win->window);
+ totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
if (drop_type != 1)
file_list = g_list_sort (file_list, (GCompareFunc) strcmp);
@@ -2221,7 +2221,7 @@ totem_action_drop_files (Totem *totem, GtkSelectionData *data,
bail:
g_list_foreach (file_list, (GFunc) g_free, NULL);
g_list_free (file_list);
- gdk_window_set_cursor (totem->win->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
/* ... and reconnect because we're nice people */
if (cleared != FALSE)
@@ -2288,7 +2288,7 @@ drag_motion_video_cb (GtkWidget *widget,
{
GdkModifierType mask;
- gdk_window_get_pointer (widget->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (widget), NULL, NULL, &mask);
if (mask & GDK_CONTROL_MASK) {
gdk_drag_status (context, GDK_ACTION_COPY, _time);
} else if (mask & GDK_MOD1_MASK || context->suggested_action == GDK_ACTION_ASK) {
@@ -2334,7 +2334,7 @@ drag_motion_playlist_cb (GtkWidget *widget,
{
GdkModifierType mask;
- gdk_window_get_pointer (widget->window, NULL, NULL, &mask);
+ gdk_window_get_pointer (gtk_widget_get_window (widget), NULL, NULL, &mask);
if (mask & GDK_MOD1_MASK || context->suggested_action == GDK_ACTION_ASK) {
gdk_drag_status (context, GDK_ACTION_ASK, _time);
@@ -2367,7 +2367,7 @@ drag_video_cb (GtkWidget *widget,
len = strlen (text);
- gtk_selection_data_set (selection_data, selection_data->target,
+ gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
8, (guchar *) text, len);
g_free (text);
@@ -2401,10 +2401,10 @@ on_got_redirect (BaconVideoWidget *bvw, const char *mrl, Totem *totem)
bacon_video_widget_close (totem->bvw);
totem_file_closed (totem);
- totem_gdk_window_set_waiting_cursor (totem->win->window);
+ totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
bacon_video_widget_open (totem->bvw, new_mrl ? new_mrl : mrl, NULL, NULL);
totem_file_opened (totem, new_mrl ? new_mrl : mrl);
- gdk_window_set_cursor (totem->win->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
bacon_video_widget_play (bvw, NULL);
g_free (new_mrl);
}
@@ -2727,7 +2727,7 @@ totem_action_open_files_list (Totem *totem, GSList *list)
if (list == NULL)
return changed;
- totem_gdk_window_set_waiting_cursor (totem->win->window);
+ totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
for (l = list ; l != NULL; l = l->next)
{
@@ -2781,7 +2781,7 @@ totem_action_open_files_list (Totem *totem, GSList *list)
g_free (filename);
}
- gdk_window_set_cursor (totem->win->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
/* ... and reconnect because we're nice people */
if (cleared != FALSE)
@@ -2799,6 +2799,7 @@ show_controls (Totem *totem, gboolean was_fullscreen)
{
GtkAction *action;
GtkWidget *menubar, *controlbar, *statusbar, *bvw_box, *widget;
+ GtkAllocation allocation;
int width = 0, height = 0;
if (totem->bvw == NULL)
@@ -2812,11 +2813,12 @@ show_controls (Totem *totem, gboolean was_fullscreen)
action = gtk_action_group_get_action (totem->main_action_group, "show-controls");
gtk_action_set_sensitive (action, !totem_is_fullscreen (totem));
+ gtk_widget_get_allocation (widget, &allocation);
if (totem->controls_visibility == TOTEM_CONTROLS_VISIBLE) {
if (was_fullscreen == FALSE) {
- height = widget->allocation.height;
- width = widget->allocation.width;
+ height = allocation.height;
+ width = allocation.width;
}
gtk_widget_set_sensitive (menubar, TRUE);
@@ -2830,6 +2832,7 @@ show_controls (Totem *totem, gboolean was_fullscreen)
*/
GValue value = { 0, };
GtkWidget *pane;
+ GtkAllocation allocation_sidebar;
int handle_size;
g_value_init (&value, G_TYPE_INT);
@@ -2841,8 +2844,8 @@ show_controls (Totem *totem, gboolean was_fullscreen)
g_value_unset (&value);
gtk_widget_show (totem->sidebar);
- width += totem->sidebar->allocation.width
- + handle_size;
+ gtk_widget_get_allocation (totem->sidebar, &allocation_sidebar);
+ width += allocation_sidebar.width + handle_size;
} else {
gtk_widget_hide (totem->sidebar);
}
@@ -2851,9 +2854,16 @@ show_controls (Totem *totem, gboolean was_fullscreen)
BVW_VBOX_BORDER_WIDTH);
if (was_fullscreen == FALSE) {
- height += menubar->allocation.height
- + controlbar->allocation.height
- + statusbar->allocation.height
+ GtkAllocation allocation_menubar;
+ GtkAllocation allocation_controlbar;
+ GtkAllocation allocation_statusbar;
+
+ gtk_widget_get_allocation (menubar, &allocation_menubar);
+ gtk_widget_get_allocation (controlbar, &allocation_controlbar);
+ gtk_widget_get_allocation (statusbar, &allocation_statusbar);
+ height += allocation.height
+ + allocation.height
+ + allocation.height
+ 2 * BVW_VBOX_BORDER_WIDTH;
width += 2 * BVW_VBOX_BORDER_WIDTH;
gtk_window_resize (GTK_WINDOW(totem->win),
@@ -2861,8 +2871,8 @@ show_controls (Totem *totem, gboolean was_fullscreen)
}
} else {
if (totem->controls_visibility == TOTEM_CONTROLS_HIDDEN) {
- width = widget->allocation.width;
- height = widget->allocation.height;
+ width = allocation.width;
+ height = allocation.height;
}
/* Hide and make the menubar unsensitive */
@@ -3889,7 +3899,7 @@ main_pane_size_allocated (GtkWidget *main_pane, GtkAllocation *allocation, Totem
{
gulong handler_id;
- if (!totem->maximised || GTK_WIDGET_MAPPED (totem->win)) {
+ if (!totem->maximised || gtk_widget_get_mapped (totem->win)) {
handler_id = g_signal_handler_find (main_pane,
G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
0, 0, NULL,
diff --git a/src/totem-open-location.c b/src/totem-open-location.c
index afa2451..3973144 100644
--- a/src/totem-open-location.c
+++ b/src/totem-open-location.c
@@ -231,13 +231,13 @@ totem_open_location_new (Totem *totem)
container = GTK_WIDGET (gtk_builder_get_object (open_location->priv->xml,
"open_uri_dialog_content"));
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (open_location)->vbox),
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (open_location))),
container,
TRUE, /* expand */
TRUE, /* fill */
0); /* padding */
- gtk_widget_show_all (GTK_DIALOG (open_location)->vbox);
+ gtk_widget_show_all (gtk_dialog_get_content_area (GTK_DIALOG (open_location)));
return GTK_WIDGET (open_location);
}
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index 84b4d3f..78479b7 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -221,7 +221,7 @@ totem_playlist_set_waiting_cursor (TotemPlaylist *playlist)
GtkWidget *parent;
parent = GTK_WIDGET (totem_playlist_get_toplevel (playlist));
- totem_gdk_window_set_waiting_cursor (parent->window);
+ totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (parent));
}
static void
@@ -230,7 +230,7 @@ totem_playlist_unset_waiting_cursor (TotemPlaylist *playlist)
GtkWidget *parent;
parent = GTK_WIDGET (totem_playlist_get_toplevel (playlist));
- gdk_window_set_cursor (parent->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window (parent), NULL);
}
static void
@@ -510,7 +510,7 @@ drop_cb (GtkWidget *widget,
if (context->action == GDK_ACTION_MOVE)
totem_playlist_clear (playlist);
- list = g_uri_list_extract_uris ((char *)data->data);
+ list = g_uri_list_extract_uris ((char *) gtk_selection_data_get_data (data));
file_list = NULL;
for (i = 0; list[i] != NULL; i++) {
diff --git a/src/totem-preferences.c b/src/totem-preferences.c
index 3198eae..b0a186b 100644
--- a/src/totem-preferences.c
+++ b/src/totem-preferences.c
@@ -502,7 +502,7 @@ encoding_changed_cb (GConfClient *client, guint cnxn_id,
void
totem_setup_preferences (Totem *totem)
{
- GtkWidget *menu;
+ GtkWidget *menu, *content_area;
GtkAction *action;
gboolean show_visuals, auto_resize, is_local, deinterlace, lock_screensaver_on_audio;
int connection_speed;
@@ -547,9 +547,10 @@ totem_setup_preferences (Totem *totem)
NULL);
gtk_dialog_set_has_separator (GTK_DIALOG (totem->prefs), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (totem->prefs), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (totem->prefs)->vbox), 2);
- gtk_widget_reparent (GTK_WIDGET (item), GTK_DIALOG (totem->prefs)->vbox);
- gtk_widget_show_all (GTK_DIALOG (totem->prefs)->vbox);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (totem->prefs));
+ gtk_box_set_spacing (GTK_BOX (content_area), 2);
+ gtk_widget_reparent (GTK_WIDGET (item), content_area);
+ gtk_widget_show_all (content_area);
item = gtk_builder_get_object (totem->xml, "totem_preferences_window");
gtk_widget_destroy (GTK_WIDGET (item));
diff --git a/src/totem-sidebar.c b/src/totem-sidebar.c
index 9e370b1..56c5b4d 100644
--- a/src/totem-sidebar.c
+++ b/src/totem-sidebar.c
@@ -35,10 +35,12 @@ cb_resize (Totem * totem)
GValue gvalue_size = { 0, };
gint handle_size;
GtkWidget *pane;
+ GtkAllocation allocation;
int w, h;
- w = totem->win->allocation.width;
- h = totem->win->allocation.height;
+ gtk_widget_get_allocation (totem->win, &allocation);
+ w = allocation.width;
+ h = allocation.height;
g_value_init (&gvalue_size, G_TYPE_INT);
pane = GTK_WIDGET (gtk_builder_get_object (totem->xml, "tmw_main_pane"));
@@ -46,10 +48,11 @@ cb_resize (Totem * totem)
handle_size = g_value_get_int (&gvalue_size);
g_value_unset (&gvalue_size);
+ gtk_widget_get_allocation (totem->sidebar, &allocation);
if (totem->sidebar_shown) {
- w += totem->sidebar->allocation.width + handle_size;
+ w += allocation.width + handle_size;
} else {
- w -= totem->sidebar->allocation.width + handle_size;
+ w -= allocation.width + handle_size;
}
if (w > 0 && h > 0)
@@ -62,7 +65,7 @@ totem_sidebar_toggle (Totem *totem, gboolean state)
GtkAction *action;
GtkWidget *box, *arrow;
- if (GTK_WIDGET_VISIBLE (GTK_WIDGET (totem->sidebar)) == state)
+ if (gtk_widget_get_visible (GTK_WIDGET (totem->sidebar)) == state)
return;
if (state != FALSE)
@@ -104,7 +107,7 @@ has_popup (void)
list = gtk_window_list_toplevels ();
for (l = list; l != NULL; l = l->next) {
GtkWindow *window = GTK_WINDOW (l->data);
- if (GTK_WIDGET_VISIBLE (window) && gtk_window_get_window_type (window) == GTK_WINDOW_POPUP) {
+ if (gtk_widget_get_visible (GTK_WIDGET (window)) && gtk_window_get_window_type (window) == GTK_WINDOW_POPUP) {
retval = TRUE;
break;
}
diff --git a/src/totem-statusbar.c b/src/totem-statusbar.c
index 6423fc2..f2615f8 100644
--- a/src/totem-statusbar.c
+++ b/src/totem-statusbar.c
@@ -57,16 +57,19 @@ static void
totem_statusbar_init (TotemStatusbar *statusbar)
{
GtkStatusbar *gstatusbar = GTK_STATUSBAR (statusbar);
- GtkWidget *packer, *hbox, *vbox;
+ GtkWidget *packer, *hbox, *vbox, *label;
+ GList *children_list;
statusbar->time = 0;
statusbar->length = -1;
hbox = gtk_statusbar_get_message_area (gstatusbar);
+ children_list = gtk_container_get_children (GTK_CONTAINER (hbox));
+ label = children_list->data;
- gtk_box_set_child_packing (GTK_BOX (hbox), gstatusbar->label,
+ gtk_box_set_child_packing (GTK_BOX (hbox), label,
FALSE, FALSE, 0, GTK_PACK_START);
- gtk_label_set_ellipsize (GTK_LABEL (gstatusbar->label), FALSE);
+ gtk_label_set_ellipsize (GTK_LABEL (label), FALSE);
/* progressbar for network streams */
vbox = gtk_vbox_new (FALSE, 0);
@@ -286,19 +289,25 @@ totem_statusbar_set_seeking (TotemStatusbar *statusbar,
static void
totem_statusbar_sync_description (TotemStatusbar *statusbar)
{
+ GtkWidget *message_area, *label;
AtkObject *obj;
+ GList *children_list;
char *text;
+ message_area = gtk_statusbar_get_message_area (GTK_STATUSBAR (statusbar));
+ children_list = gtk_container_get_children (GTK_CONTAINER (message_area));
+ label = children_list->data;
+
obj = gtk_widget_get_accessible (GTK_WIDGET (statusbar));
if (statusbar->pushed == FALSE) {
/* eg: Paused, 0:32 / 1:05 */
text = g_strdup_printf (_("%s, %s"),
- gtk_label_get_text (GTK_LABEL (GTK_STATUSBAR (statusbar)->label)),
+ gtk_label_get_text (GTK_LABEL (label)),
gtk_label_get_text (GTK_LABEL (statusbar->time_label)));
} else {
/* eg: Buffering, 75 % */
text = g_strdup_printf (_("%s, %d %%"),
- gtk_label_get_text (GTK_LABEL (GTK_STATUSBAR (statusbar)->label)),
+ gtk_label_get_text (GTK_LABEL (label)),
statusbar->percentage);
}
diff --git a/src/totem.c b/src/totem.c
index 5061bab..1a9a6e4 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -244,7 +244,7 @@ main (int argc, char **argv)
* we have so far */
if (optionstate.fullscreen == FALSE) {
gtk_widget_show (totem->win);
- totem_gdk_window_set_waiting_cursor (totem->win->window);
+ totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
long_action ();
} else {
gtk_widget_realize (totem->win);
@@ -289,7 +289,7 @@ main (int argc, char **argv)
bacon_video_widget_set_logo (totem->bvw, "totem");
if (optionstate.fullscreen == FALSE)
- gdk_window_set_cursor (totem->win->window, NULL);
+ gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
if (totem->app != NULL) {
g_signal_connect (totem->app, "message-received",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]