} glLabelObjectType;
-#define GL_TYPE_LABEL_OBJECT (gl_label_object_get_type ())
-#define GL_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_OBJECT, glLabelObject))
-#define GL_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_OBJECT, glLabelObjectClass))
-#define GL_IS_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_OBJECT))
-#define GL_IS_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_OBJECT))
+#define GL_TYPE_LABEL_OBJECT (gl_label_object_get_type ())
+#define GL_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_OBJECT, glLabelObject))
+#define GL_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_OBJECT, glLabelObjectClass))
+#define GL_IS_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_OBJECT))
+#define GL_IS_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_OBJECT))
+#define GL_LABEL_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_LABEL_OBJECT, glLabelObjectClass))
+
typedef struct _glLabelObject glLabelObject;
typedef struct _glLabelObjectClass glLabelObjectClass;
struct _glLabelObjectClass {
GObjectClass parent_class;
+ /*
+ * Methods
+ */
+
+ void (*set_size) (glLabelObject *object,
+ gdouble w,
+ gdouble h);
+
+ void (*get_size) (glLabelObject *object,
+ gdouble *w,
+ gdouble *h);
+
+ /*
+ * Signals
+ */
void (*changed) (glLabelObject *object,
gpointer user_data);
static void update_view_barcode_cb (glLabelObject *object,
glViewBarcode *view_barcode);
-static GtkWidget *construct_properties_dialog (glViewBarcode *view_barcode);
+static GtkWidget *construct_properties_dialog (glViewObject *view_object);
static void response_cb (GtkDialog *dialog,
gint response,
static void
gl_view_barcode_class_init (glViewBarcodeClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
+ glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
gl_debug (DEBUG_VIEW, "START");
object_class->finalize = gl_view_barcode_finalize;
+ view_object_class->construct_dialog = construct_properties_dialog;
+
gl_debug (DEBUG_VIEW, "END");
}
g_signal_connect (G_OBJECT (object), "changed",
G_CALLBACK (update_view_barcode_cb), view_barcode);
- /* Create a dialog for controlling/viewing object properties. */
- gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_barcode),
- GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
-
gl_debug (DEBUG_VIEW, "END");
return GL_VIEW_OBJECT (view_barcode);
/* Create a properties dialog for a barcode object. */
/*****************************************************************************/
static GtkWidget *
-construct_properties_dialog (glViewBarcode *view_barcode)
+construct_properties_dialog (glViewObject *view_object)
{
+ glViewBarcode *view_barcode = (glViewBarcode *)view_object;
GtkWidget *dialog, *wsection;
glLabelObject *object;
gdouble x, y, w, h, label_width, label_height;
gl_debug (DEBUG_VIEW, "START");
/* retrieve object and query parameters */
- object = gl_view_object_get_object (GL_VIEW_OBJECT(view_barcode));
+ object = gl_view_object_get_object (view_object);
gl_label_object_get_position (GL_LABEL_OBJECT(object), &x, &y);
text_node = gl_label_barcode_get_data(GL_LABEL_BARCODE(object));
gl_label_barcode_get_props (GL_LABEL_BARCODE(object),
/* Build dialog. */
/*-----------------------------------------------------------------*/
window = gtk_widget_get_toplevel (
- GTK_WIDGET(gl_view_object_get_view(GL_VIEW_OBJECT(view_barcode))));
+ GTK_WIDGET(gl_view_object_get_view(view_object)));
dialog = gl_hig_dialog_new_with_buttons ( _("Edit barcode object properties"),
GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
NULL );
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (response_cb), view_barcode);
+ G_CALLBACK (response_cb), view_object);
label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
static void update_view_box_cb (glLabelObject *object,
glViewBox *view_box);
-static GtkWidget *construct_properties_dialog (glViewBox *view_box);
+static GtkWidget *construct_properties_dialog (glViewObject *view_object);
static void response_cb (GtkDialog *dialog,
gint response,
static void
gl_view_box_class_init (glViewBoxClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
+ glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
gl_debug (DEBUG_VIEW, "START");
object_class->finalize = gl_view_box_finalize;
+ view_object_class->construct_dialog = construct_properties_dialog;
+
gl_debug (DEBUG_VIEW, "END");
}
g_signal_connect (G_OBJECT (object), "changed",
G_CALLBACK (update_view_box_cb), view_box);
- /* Create a dialog for controlling/viewing object properties. */
- gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_box),
- GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
-
gl_debug (DEBUG_VIEW, "END");
return GL_VIEW_OBJECT (view_box);
/* Create a properties dialog for a box object. */
/*****************************************************************************/
static GtkWidget *
-construct_properties_dialog (glViewBox *view_box)
+construct_properties_dialog (glViewObject *view_object)
{
+ glViewBox *view_box = (glViewBox *)view_object;
GtkWidget *dialog, *wsection;
glLabelObject *object;
gdouble line_width;
static void update_view_ellipse_cb (glLabelObject *object,
glViewEllipse *view_ellipse);
-static GtkWidget *construct_properties_dialog (glViewEllipse *view_ellipse);
+static GtkWidget *construct_properties_dialog (glViewObject *view_object);
static void response_cb (GtkDialog *dialog,
gint response,
static void
gl_view_ellipse_class_init (glViewEllipseClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
+ glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
gl_debug (DEBUG_VIEW, "START");
object_class->finalize = gl_view_ellipse_finalize;
+ view_object_class->construct_dialog = construct_properties_dialog;
+
gl_debug (DEBUG_VIEW, "END");
}
g_signal_connect (G_OBJECT (object), "changed",
G_CALLBACK (update_view_ellipse_cb), view_ellipse);
- /* Create a dialog for controlling/viewing object properties. */
- gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_ellipse),
- GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
-
gl_debug (DEBUG_VIEW, "END");
return GL_VIEW_OBJECT (view_ellipse);
/* Create a properties dialog for a ellipse object. */
/*****************************************************************************/
static GtkWidget *
-construct_properties_dialog (glViewEllipse *view_ellipse)
+construct_properties_dialog (glViewObject *view_object)
{
+ glViewEllipse *view_ellipse = (glViewEllipse *)view_object;
GtkWidget *dialog, *wsection;
glLabelObject *object;
gdouble line_width;
static void update_view_image_cb (glLabelObject *object,
glViewImage *view_image);
-static GtkWidget *construct_properties_dialog (glViewImage *view_image);
+static GtkWidget *construct_properties_dialog (glViewObject *view_object);
static void response_cb (GtkDialog *dialog,
gint response,
static void
gl_view_image_class_init (glViewImageClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
+ glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
gl_debug (DEBUG_VIEW, "START");
object_class->finalize = gl_view_image_finalize;
+ view_object_class->construct_dialog = construct_properties_dialog;
+
gl_debug (DEBUG_VIEW, "END");
}
g_signal_connect (G_OBJECT (object), "changed",
G_CALLBACK (update_view_image_cb), view_image);
- /* Create a dialog for controlling/viewing object properties. */
- gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_image),
- GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
-
gl_debug (DEBUG_VIEW, "END");
return GL_VIEW_OBJECT (view_image);
/* Create a properties dialog for a image object. */
/*****************************************************************************/
static GtkWidget *
-construct_properties_dialog (glViewImage *view_image)
+construct_properties_dialog (glViewObject *view_object)
{
+ glViewImage *view_image = (glViewImage *)view_object;
GtkWidget *dialog, *wsection, *wbutton;
glLabelObject *object;
gdouble x, y, w, h, label_width, label_height;
static void update_view_line_cb (glLabelObject *object,
glViewLine *view_line);
-static GtkWidget *construct_properties_dialog (glViewLine *view_line);
+static GtkWidget *construct_properties_dialog (glViewObject *view_object);
static void response_cb (GtkDialog *dialog,
gint response,
static void
gl_view_line_class_init (glViewLineClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
+ glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
gl_debug (DEBUG_VIEW, "START");
object_class->finalize = gl_view_line_finalize;
+ view_object_class->construct_dialog = construct_properties_dialog;
+
gl_debug (DEBUG_VIEW, "END");
}
g_signal_connect (G_OBJECT (object), "changed",
G_CALLBACK (update_view_line_cb), view_line);
- /* Create a dialog for controlling/viewing object properties. */
- gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_line),
- GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
-
gl_debug (DEBUG_VIEW, "END");
return GL_VIEW_OBJECT (view_line);
/* Create a properties dialog for a line object. */
/*****************************************************************************/
static GtkWidget *
-construct_properties_dialog (glViewLine *view_line)
+construct_properties_dialog (glViewObject *view_object)
{
+ glViewLine *view_line = (glViewLine *)view_object;
GtkWidget *dialog, *wsection;
glLabelObject *object;
gdouble line_width;
GtkWidget *menu;
GtkWidget *property_dialog;
-
- glViewObjectDlgConstructor dialog_constructor;
};
/*========================================================*/
gl_debug (DEBUG_VIEW, "END");
}
-/*****************************************************************************/
-/* Set dialog for controlling/viewing object properties. */
-/*****************************************************************************/
-void
-gl_view_object_set_dlg_constructor (glViewObject *view_object,
- glViewObjectDlgConstructor dlg_constructor)
-
-{
- gl_debug (DEBUG_VIEW, "START");
-
- g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object));
-
- view_object->private->dialog_constructor = dlg_constructor;
-
- gl_debug (DEBUG_VIEW, "END");
-}
-
/*****************************************************************************/
/* Return parent view associated with this view. */
/*****************************************************************************/
return;
}
- view_object->private->property_dialog =
- view_object->private->dialog_constructor (view_object);
+ if ( GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_dialog != NULL ) {
+
+ view_object->private->property_dialog =
+ GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_dialog (view_object);
- g_signal_connect (G_OBJECT (view_object->private->property_dialog),
- "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &view_object->private->property_dialog);
+ g_signal_connect (G_OBJECT (view_object->private->property_dialog),
+ "destroy",
+ G_CALLBACK (gtk_widget_destroyed),
+ &view_object->private->property_dialog);
- gtk_widget_show_all (view_object->private->property_dialog);
+ gtk_widget_show_all (view_object->private->property_dialog);
+
+ }
gl_debug (DEBUG_VIEW, "END");
static void update_view_text_cb (glLabelObject *object,
glViewText *view_text);
-static GtkWidget *construct_properties_dialog (glViewText *view_text);
+static GtkWidget *construct_properties_dialog (glViewObject *view_object);
static void response_cb (GtkDialog *dialog,
gint response,
static void
gl_view_text_class_init (glViewTextClass *klass)
{
- GObjectClass *object_class = (GObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
+ glViewObjectClass *view_object_class = (glViewObjectClass *) klass;
gl_debug (DEBUG_VIEW, "START");
object_class->finalize = gl_view_text_finalize;
+ view_object_class->construct_dialog = construct_properties_dialog;
+
gl_debug (DEBUG_VIEW, "END");
}
g_signal_connect (G_OBJECT (object), "changed",
G_CALLBACK (update_view_text_cb), view_text);
- /* Create a dialog for controlling/viewing object properties. */
- gl_view_object_set_dlg_constructor (GL_VIEW_OBJECT(view_text),
- GL_VIEW_OBJECT_DLG_CONSTRUCTOR(construct_properties_dialog));
-
gl_debug (DEBUG_VIEW, "END");
return GL_VIEW_OBJECT (view_text);
/* Create a properties dialog for a text object. */
/*****************************************************************************/
static GtkWidget *
-construct_properties_dialog (glViewText *view_text)
+construct_properties_dialog (glViewObject *view_object)
{
+ glViewText *view_text = (glViewText *)view_object;
GtkWidget *dialog, *wsection, *wbutton;
glLabelObject *object;
gdouble x, y, w, h, label_width, label_height;