[cheese] Replaced deprecated symbols
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] Replaced deprecated symbols
- Date: Mon, 7 Mar 2011 09:41:01 +0000 (UTC)
commit d777218c196b88e462949ded611abd1a11bd7773
Author: Patricia Santana Cruz <patriciasc openismus com>
Date: Wed Feb 16 19:15:03 2011 +0100
Replaced deprecated symbols
data/cheese-main-window.ui | 1 +
libcheese/cheese-avatar-chooser.c | 1 -
libcheese/cheese-camera.c | 2 +-
libcheese/cheese-flash.c | 14 +++++++-------
libcheese/cheese-widget.c | 21 +++++++++------------
src/cheese-main.vala | 17 ++++++++---------
src/cheese-window.vala | 3 +--
src/thumbview/cheese-thumb-view.c | 2 +-
src/thumbview/eog-thumb-nav.c | 24 ++++++++++++------------
9 files changed, 40 insertions(+), 45 deletions(-)
---
diff --git a/data/cheese-main-window.ui b/data/cheese-main-window.ui
index 78d6905..41b3d3a 100644
--- a/data/cheese-main-window.ui
+++ b/data/cheese-main-window.ui
@@ -3,6 +3,7 @@
<requires lib="gtk+" version="2.16"/>
<object class="GtkVBox" id="mainbox_normal">
<property name="homogeneous">False</property>
+ <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<object class="GtkMenuBar" id="main_menubar" constructor="menu_ui_man">
</object>
diff --git a/libcheese/cheese-avatar-chooser.c b/libcheese/cheese-avatar-chooser.c
index 6094514..14a3d37 100644
--- a/libcheese/cheese-avatar-chooser.c
+++ b/libcheese/cheese-avatar-chooser.c
@@ -208,7 +208,6 @@ cheese_avatar_chooser_init (CheeseAvatarChooser *chooser)
GTK_RESPONSE_ACCEPT,
NULL);
gtk_window_set_title (GTK_WINDOW (chooser), _("Take a photo"));
- gtk_dialog_set_has_separator (GTK_DIALOG (chooser), FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (chooser),
GTK_RESPONSE_ACCEPT,
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index f231e6b..bfb7772 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -1088,7 +1088,7 @@ cheese_camera_class_init (CheeseCameraClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- camera_signals[STATE_CHANGED] = g_signal_new ("state-changed", G_OBJECT_CLASS_TYPE (klass),
+ camera_signals[STATE_CHANGED] = g_signal_new ("state-flags-changed", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (CheeseCameraClass, state_changed),
NULL, NULL,
diff --git a/libcheese/cheese-flash.c b/libcheese/cheese-flash.c
index 8d3d32f..8b470ab 100644
--- a/libcheese/cheese-flash.c
+++ b/libcheese/cheese-flash.c
@@ -58,15 +58,15 @@ typedef struct
} CheeseFlashPrivate;
static gboolean
-cheese_flash_window_expose_event_cb (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
+cheese_flash_window_expose_event_cb (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
- cairo_t *cr;
+ //cairo_t *cr;
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
- cairo_set_source_rgb (cr, 1, 1, 1);
- cairo_rectangle (cr, event->area.x, event->area.y, event->area.width, event->area.height);
+ //cr = gdk_cairo_create (gtk_widget_get_window (widget));
+ //cairo_set_source_rgb (cr, 1, 1, 1);
+ //cairo_rectangle (cr, event->area.x, event->area.y, event->area.width, event->area.height);
cairo_fill (cr);
- cairo_destroy (cr);
+ //cairo_destroy (cr);
return TRUE;
}
@@ -99,7 +99,7 @@ cheese_flash_init (CheeseFlash *self)
gdk_window_input_shape_combine_region (gtk_widget_get_window (GTK_WIDGET (window)), input_region, 0, 0);
cairo_region_destroy (input_region);
- g_signal_connect (G_OBJECT (window), "expose-event", G_CALLBACK (cheese_flash_window_expose_event_cb), NULL);
+ g_signal_connect (G_OBJECT (window), "draw", G_CALLBACK (cheese_flash_window_expose_event_cb), NULL);
priv->window = window;
}
diff --git a/libcheese/cheese-widget.c b/libcheese/cheese-widget.c
index acd5845..62af9b0 100644
--- a/libcheese/cheese-widget.c
+++ b/libcheese/cheese-widget.c
@@ -144,25 +144,22 @@ cheese_widget_logo_draw (GtkWidget *w,
static void
cheese_widget_spinner_invert (GtkWidget *spinner, GtkWidget *parent)
{
- GtkStyle *style;
+ GtkStyleContext *context;
guint i;
for (i = GTK_STATE_NORMAL; i <= GTK_STATE_INSENSITIVE; i++)
{
- GdkColor *fg, *bg;
+ GdkRGBA fg, bg;
- style = gtk_widget_get_style (spinner);
- fg = gdk_color_copy (&style->fg[i]);
- bg = gdk_color_copy (&style->bg[i]);
+ context = gtk_widget_get_style_context (spinner);
+ gtk_style_context_get_color (context, gtk_style_context_get_state (context), &fg);
+ gtk_style_context_get_background_color (context, gtk_style_context_get_state (context), &bg);
- gtk_widget_modify_fg (spinner, i, bg);
- gtk_widget_modify_bg (spinner, i, fg);
+ gtk_widget_override_color (spinner, i, &bg);
+ gtk_widget_override_background_color (spinner, i, &fg);
- gtk_widget_modify_fg (parent, i, bg);
- gtk_widget_modify_bg (parent, i, fg);
-
- gdk_color_free (fg);
- gdk_color_free (bg);
+ gtk_widget_override_color (parent, i, &bg);
+ gtk_widget_override_background_color (parent, i, &fg);
}
}
diff --git a/src/cheese-main.vala b/src/cheese-main.vala
index fa05790..928d284 100644
--- a/src/cheese-main.vala
+++ b/src/cheese-main.vala
@@ -41,14 +41,14 @@ public class Cheese.Main : Gtk.Application
{null}
};
- public void on_app_activate ()
+ public Main (string app_id, ApplicationFlags flags)
{
- GLib.List list;
- Gtk.Widget window;
-
- list = get_windows ();
+ GLib.Object (application_id: app_id, flags: flags);
+ }
- if (list != null)
+ public void on_app_activate ()
+ {
+ if (get_windows () != null)
main_window.present ();
else
{
@@ -148,13 +148,12 @@ public class Cheese.Main : Gtk.Application
Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (Config.GETTEXT_PACKAGE);
- Gtk.rc_parse (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "gtkrc"));
+ //Gtk.rc_parse (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "gtkrc"));
GtkClutter.init (ref args);
Cheese.Main app;
- app = new Cheese.Main ();
- app.set_application_id ("org.gnome.Cheese");
+ app = new Cheese.Main ("org.gnome.Cheese", ApplicationFlags.FLAGS_NONE);
app.activate.connect (app.on_app_activate);
int status = app.run();
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 4067e94..84ac245 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -631,8 +631,7 @@ public class Cheese.MainWindow : Gtk.Window
* viewport, see above) but can still be shrinked down */
Gtk.Requisition req;
- //this.size_request (out req);
- this.get_preferred_size(req, req);
+ this.get_preferred_size(out req, out req);
this.resize (req.width, req.height);
viewport_widget.set_size_request (-1, -1);
}
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index 3f2ba24..89e77ba 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -25,7 +25,7 @@
#include <glib.h>
#include <gtk/gtk.h>
-#include <libgnomeui/gnome-desktop-thumbnail.h>
+#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include <string.h>
#include "cheese-fileutil.h"
diff --git a/src/thumbview/eog-thumb-nav.c b/src/thumbview/eog-thumb-nav.c
index 87b3305..427ff00 100644
--- a/src/thumbview/eog-thumb-nav.c
+++ b/src/thumbview/eog-thumb-nav.c
@@ -435,12 +435,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_left,
- "pressed",
+ "button-press-event",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_left,
- "released",
+ "button-release-event",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -458,12 +458,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_left,
- "pressed",
+ "button-press-event",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_left,
- "released",
+ "button-release-event",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -522,12 +522,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_right,
- "pressed",
+ "button-press-event",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_right,
- "released",
+ "button-release-event",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -545,12 +545,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_down,
- "pressed",
+ "button-press-event",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_down,
- "released",
+ "button-release-event",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -568,12 +568,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_up,
- "pressed",
+ "button-press-event",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_up,
- "released",
+ "button-release-event",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -658,8 +658,8 @@ eog_thumb_nav_set_show_buttons (EogThumbNav *nav, gboolean show_buttons)
}
else
{
- gtk_widget_hide_all (nav->priv->button_left);
- gtk_widget_hide_all (nav->priv->button_right);
+ gtk_widget_hide (nav->priv->button_left);
+ gtk_widget_hide (nav->priv->button_right);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]