f-spot r4749 - in trunk: libeog libfspot
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4749 - in trunk: libeog libfspot
- Date: Fri, 3 Apr 2009 14:30:44 +0000 (UTC)
Author: sdelcroix
Date: Fri Apr 3 14:30:44 2009
New Revision: 4749
URL: http://svn.gnome.org/viewvc/f-spot?rev=4749&view=rev
Log:
Some GObject love, but doesn't fix my bug
Modified:
trunk/libeog/image-view.h
trunk/libfspot/f-image-view.c
trunk/libfspot/f-image-view.h
Modified: trunk/libeog/image-view.h
==============================================================================
--- trunk/libeog/image-view.h (original)
+++ trunk/libeog/image-view.h Fri Apr 3 14:30:44 2009
@@ -58,9 +58,10 @@
#define TYPE_IMAGE_VIEW (image_view_get_type ())
#define IMAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMAGE_VIEW, ImageView))
-#define IMAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMAGE_VIEW, ImageViewClass))
#define IS_IMAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMAGE_VIEW))
+#define IMAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMAGE_VIEW, ImageViewClass))
#define IS_IMAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMAGE_VIEW))
+#define IMAGE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMAGE_VIEW, ImageViewClass))
typedef struct _ImageView ImageView;
typedef struct _ImageViewClass ImageViewClass;
@@ -68,7 +69,7 @@
typedef struct _ImageViewPrivate ImageViewPrivate;
struct _ImageView {
- GtkWidget widget;
+ GtkWidget parent_instance;
/* Private data */
ImageViewPrivate *priv;
Modified: trunk/libfspot/f-image-view.c
==============================================================================
--- trunk/libfspot/f-image-view.c (original)
+++ trunk/libfspot/f-image-view.c Fri Apr 3 14:30:44 2009
@@ -31,9 +31,7 @@
#include "libeog/cursors.h"
-#define PARENT_TYPE image_view_get_type ()
-static ImageViewClass *parent_class = NULL;
-
+G_DEFINE_TYPE (FImageView, f_image_view, TYPE_IMAGE_VIEW);
/* Thickness of the rectangle drawn to show the current selection. */
#define SELECTION_LINE_WIDTH 1
@@ -595,7 +593,7 @@
GdkRegion *selection;
GdkRectangle rect;
- (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
+ (* GTK_WIDGET_CLASS (f_image_view_parent_class)->expose_event) (widget, event);
if (! priv->selection_active)
return FALSE;
@@ -629,7 +627,7 @@
{
FImageViewPrivate *priv = F_IMAGE_VIEW (widget)->priv;
- (* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
+ (* GTK_WIDGET_CLASS (f_image_view_parent_class)->realize) (widget);
set_cursor (F_IMAGE_VIEW (widget));
@@ -645,7 +643,7 @@
static void
impl_unrealize (GtkWidget *widget)
{
- (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
+ (* GTK_WIDGET_CLASS (f_image_view_parent_class)->unrealize) (widget);
F_UNREF (F_IMAGE_VIEW (widget)->priv->selection_gc);
}
@@ -659,7 +657,7 @@
Mode mode;
if (priv->pointer_mode == F_IMAGE_VIEW_POINTER_MODE_SCROLL)
- return (* GTK_WIDGET_CLASS (parent_class)->button_press_event) (widget, button_event);
+ return (* GTK_WIDGET_CLASS (f_image_view_parent_class)->button_press_event) (widget, button_event);
else if (priv->pointer_mode == F_IMAGE_VIEW_POINTER_MODE_NONE)
return FALSE;
@@ -722,7 +720,7 @@
GdkRectangle current;
if (priv->pointer_mode == F_IMAGE_VIEW_POINTER_MODE_SCROLL)
- return (* GTK_WIDGET_CLASS (parent_class)->motion_notify_event) (widget, motion_event);
+ return (* GTK_WIDGET_CLASS (f_image_view_parent_class)->motion_notify_event) (widget, motion_event);
if (motion_event->is_hint)
gdk_window_get_pointer (widget->window, &x, &y, &mods);
@@ -845,7 +843,7 @@
FImageViewPrivate *priv = F_IMAGE_VIEW (widget)->priv;
if (priv->pointer_mode == F_IMAGE_VIEW_POINTER_MODE_SCROLL)
- return (* GTK_WIDGET_CLASS (parent_class)->button_release_event) (widget, button_event);
+ return (* GTK_WIDGET_CLASS (f_image_view_parent_class)->button_release_event) (widget, button_event);
priv->is_new_selection = FALSE;
priv->mode = MODE_IDLE;
@@ -865,18 +863,18 @@
g_free (priv);
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ (* G_OBJECT_CLASS (f_image_view_parent_class)->finalize) (object);
}
/* Initialization. */
static void
-class_init (FImageViewClass *class)
+f_image_view_class_init (FImageViewClass *klass)
{
- ImageViewClass *image_view_class = IMAGE_VIEW_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GObjectClass *object_class = G_OBJECT_CLASS (class);
+ ImageViewClass *image_view_class = IMAGE_VIEW_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
image_view_class->paint_extra = impl_paint_extra;
@@ -889,10 +887,8 @@
object_class->finalize = impl_finalize;
- parent_class = g_type_class_peek_parent (class);
-
signals[SELECTION_CHANGED] = g_signal_new ("selection_changed",
- G_TYPE_FROM_CLASS (class),
+ G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FImageViewClass, selection_changed),
NULL, NULL,
@@ -901,7 +897,7 @@
}
static void
-init (FImageView *image_view)
+f_image_view_init (FImageView *image_view)
{
FImageViewPrivate *priv;
@@ -915,10 +911,11 @@
/* Instantiation. */
-GtkWidget *
+FImageView *
f_image_view_new (void)
{
- return g_object_new (f_image_view_get_type (), NULL);
+ g_warning ("f_image_view_new");
+ return g_object_new (F_TYPE_IMAGE_VIEW, NULL);
}
@@ -993,6 +990,3 @@
emit_selection_changed (image_view);
}
}
-
-
-F_MAKE_TYPE (FImageView, f_image_view)
Modified: trunk/libfspot/f-image-view.h
==============================================================================
--- trunk/libfspot/f-image-view.h (original)
+++ trunk/libfspot/f-image-view.h Fri Apr 3 14:30:44 2009
@@ -28,10 +28,10 @@
#define F_TYPE_IMAGE_VIEW (f_image_view_get_type ())
#define F_IMAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), F_TYPE_IMAGE_VIEW, FImageView))
-#define F_IMAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), F_TYPE_IMAGE_VIEW, FImageViewClass))
#define F_IS_IMAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), F_TYPE_IMAGE_VIEW))
+#define F_IMAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), F_TYPE_IMAGE_VIEW, FImageViewClass))
#define F_IS_IMAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), F_TYPE_IMAGE_VIEW))
-
+#define F_IMAGE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), F_TYPE_IMAGE_VIEW, FImageViewClass))
enum _FImageViewPointerMode {
F_IMAGE_VIEW_POINTER_MODE_NONE,
@@ -46,7 +46,7 @@
typedef struct _FImageViewClass FImageViewClass;
struct _FImageView {
- ImageView parent;
+ ImageView parent_instance;
FImageViewPrivate *priv;
};
@@ -60,7 +60,7 @@
GType f_image_view_get_type (void);
-GtkWidget *f_image_view_new (void);
+FImageView *f_image_view_new (void);
void f_image_view_set_pointer_mode (FImageView *image_view,
FImageViewPointerMode mode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]