[cheese/cheese-window-refactor: 1/9] GObjectify CheeseWindow



commit 603018b152d2e9c364c119683d2258622ba154fd
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Mon Jan 25 21:23:49 2010 +0100

    GObjectify CheeseWindow
    
    First minimal step of a CheeseWindow refactoring to obtain a tinier and
    cleaner codebase that doesn't bore you every time you want to do some
    little hacking

 libcheese/cheese-camera-device.c |    2 +-
 src/cheese-window.c              |   11 ++++++++---
 src/cheese-window.h              |   26 ++++++++++++++++++++++++++
 3 files changed, 35 insertions(+), 4 deletions(-)
---
diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c
index a0902fd..d6b08d2 100644
--- a/libcheese/cheese-camera-device.c
+++ b/libcheese/cheese-camera-device.c
@@ -1,8 +1,8 @@
 /*
+ * Copyright © 2009 Filippo Argiolas <filippo argiolas gmail com>
  * Copyright © 2007,2008 Jaap Haitsma <jaap haitsma org>
  * Copyright © 2007-2009 daniel g. siegel <dgsiegel gnome org>
  * Copyright © 2008 Ryan Zeigler <zeiglerr gmail com>
- * Copyright © 2009 Filippo Argiolas <filippo argiolas gmail com>
  *
  * Licensed under the GNU General Public License Version 2
  *
diff --git a/src/cheese-window.c b/src/cheese-window.c
index 3d23da6..82184ff 100644
--- a/src/cheese-window.c
+++ b/src/cheese-window.c
@@ -1,9 +1,9 @@
 /*
+ * Copyright © 2008-2009 Filippo Argiolas <filippo argiolas gmail com>
  * Copyright © 2007-2009 daniel g. siegel <dgsiegel gnome org>
  * Copyright © 2007,2008 Jaap Haitsma <jaap haitsma org>
  * Copyright © 2008 Patryk Zawadzki <patrys pld-linux org>
  * Copyright © 2008 Ryan Zeigler <zeiglerr gmail com>
- * Copyright © 2008 Filippo Argiolas <filippo argiolas gmail com>
  * Copyright © 2008 Felix Kaser <f kaser gmx net>
  *
  * Licensed under the GNU General Public License Version 2
@@ -177,10 +177,15 @@ typedef struct
   gboolean is_bursting;
 
   CheeseFlash *flash;
-} CheeseWindow;
+} CheeseWindowPrivate;
 
+#define CHEESE_WINDOW_GET_PRIVATE(o)                     \
+  (G_TYPE_INSTANCE_GET_PRIVATE ((o), CHEESE_TYPE_WINDOW, \
+                                CheeseWindowPrivate))
 
-/* FIXME: some code borrowed from cheese-widget 
+G_DEFINE_TYPE (CheeseWindow, cheese_window, GTK_TYPE_WINDOW);
+
+/* FIXME: some code borrowed from cheese-widget
  * We should really use it directly instead of duplicating stuff here */
 static GdkPixbuf *
 cheese_window_load_pixbuf (GtkWidget  *widget,
diff --git a/src/cheese-window.h b/src/cheese-window.h
index 1018894..76f727a 100644
--- a/src/cheese-window.h
+++ b/src/cheese-window.h
@@ -1,4 +1,5 @@
 /*
+ * Copyright © 2009 Filippo Argiolas <filippo argiolas gmail com>
  * Copyright © 2007,2008 daniel g. siegel <dgsiegel gnome org>
  *
  * Licensed under the GNU General Public License Version 2
@@ -23,8 +24,33 @@
 #include <gtk/gtk.h>
 #include "cheese-dbus.h"
 
+G_BEGIN_DECLS
 
+#define CHEESE_TYPE_WINDOW (cheese_window_get_type ())
+#define CHEESE_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CHEESE_TYPE_WINDOW, CheeseWindow))
+#define CHEESE_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_WINDOW, CheeseWindowClass))
+#define CHEESE_IS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CHEESE_TYPE_WINDOW))
+#define CHEESE_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CHEESE_TYPE_WINDOW))
+#define CHEESE_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CHEESE_TYPE_WINDOW, CheeseWindowClass))
+
+typedef struct
+{
+  GtkWindow parent;
+} CheeseWindow;
+
+typedef struct
+{
+  GtkWindowClass parent_class;
+} CheeseWindowClass;
+
+GType cheese_window_get_type (void) G_GNUC_CONST;
+
+/* public methods */
+CheeseWindow *cheese_window_new (void);
+
+#if 0
 void cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server, gboolean startup_in_wide_mode);
 void cheese_window_bring_to_front (gpointer data);
+#endif
 
 #endif /* __CHEESE_WINDOW_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]