[aravis] viewer: start a feature editor widget.



commit c66b8fb35eae7ace8b0c2f328bde665e34b856f3
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Fri Feb 18 22:04:53 2011 +0100

    viewer: start a feature editor widget.

 viewer/Makefile.am        |    4 ++-
 viewer/arvfeaturewidget.c |   75 +++++++++++++++++++++++++++++++++++++++++++++
 viewer/arvfeaturewidget.h |   59 +++++++++++++++++++++++++++++++++++
 3 files changed, 137 insertions(+), 1 deletions(-)
---
diff --git a/viewer/Makefile.am b/viewer/Makefile.am
index 2cbfd15..20b88a2 100644
--- a/viewer/Makefile.am
+++ b/viewer/Makefile.am
@@ -14,7 +14,9 @@ AM_CFLAGS = -Wall -lm
 
 bin_PROGRAMS = arv-viewer
 
-arv_viewer_SOURCES = arvviewer.c
+arv_viewer_SOURCES = arvviewer.c	\
+		     arvfeaturewidget.c
+
 arv_viewer_LDADD = $(ARAVIS_EXTRA_LIBS) $(top_builddir)/src/libaravis.la
 arv_viewerdir = $(aravis_datadir)
 arv_viewer_DATA = arv-viewer.ui
diff --git a/viewer/arvfeaturewidget.c b/viewer/arvfeaturewidget.c
new file mode 100644
index 0000000..85ffb1b
--- /dev/null
+++ b/viewer/arvfeaturewidget.c
@@ -0,0 +1,75 @@
+/* Aravis - Digital camera library
+ *
+ * Copyright © 2011 Emmanuel Pacaud
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Emmanuel Pacaud <emmanuel gnome org>
+ */
+
+#include <arvfeaturewidget.h>
+
+static GObjectClass *parent_class = NULL;
+
+struct _ArvFeatureWidgetPrivate {
+	ArvGcNode *node;
+
+	GtkWidget *entry;
+	GtkWidget *combo_box;
+	GtkWidget *spin_button;
+};
+
+ArvFeatureWidget *
+arv_feature_widget_new (ArvGcNode *node)
+{
+	ArvFeatureWidget *feature;
+
+	g_object_ref (node);
+
+	feature = g_object_new (ARV_TYPE_FEATURE_WIDGET, NULL);
+	feature->priv->node = node;
+
+	return feature;
+}
+
+static void
+arv_feature_widget_init (ArvFeatureWidget *feature)
+{
+	feature->priv = G_TYPE_INSTANCE_GET_PRIVATE (feature, ARV_TYPE_FEATURE_WIDGET, ArvFeatureWidgetPrivate);
+}
+
+static void
+arv_feature_widget_finalize (GObject *object)
+{
+	ArvFeatureWidget *feature = ARV_FEATURE_WIDGET (object);
+
+	if (feature->priv->node != NULL)
+		g_object_unref (feature->priv->node);
+
+	parent_class->finalize (object);
+}
+
+static void
+arv_feature_widget_class_init (ArvFeatureWidgetClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	parent_class = g_type_class_peek_parent (klass);
+
+	object_class->finalize = arv_feature_widget_finalize;
+}
+
+G_DEFINE_TYPE (ArvFeatureWidget, arv_feature_widget, GTK_TYPE_VBOX)
diff --git a/viewer/arvfeaturewidget.h b/viewer/arvfeaturewidget.h
new file mode 100644
index 0000000..3a525c0
--- /dev/null
+++ b/viewer/arvfeaturewidget.h
@@ -0,0 +1,59 @@
+/* Aravis - Digital camera library
+ *
+ * Copyright © 2011 Emmanuel Pacaud
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Emmanuel Pacaud <emmanuel gnome org>
+ */
+
+#ifndef ARV_FEATURE_WIDGET_H
+#define ARV_FEATURE_WIDGET_H
+
+#include <gtk/gtk.h>
+#include <arv.h>
+
+G_BEGIN_DECLS
+
+#define ARV_TYPE_FEATURE_WIDGET             (arv_feature_widget_get_type ())
+#define ARV_FEATURE_WIDGET(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), ARV_TYPE_FEATURE_WIDGET, ArvFeatureWidget))
+#define ARV_FEATURE_WIDGET_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), ARV_TYPE_FEATURE_WIDGET, ArvFeatureWidgetClass))
+#define ARV_IS_FEATURE_WIDGET(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ARV_TYPE_FEATURE_WIDGET))
+#define ARV_IS_FEATURE_WIDGET_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), ARV_TYPE_FEATURE_WIDGET))
+#define ARV_FEATURE_WIDGET_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), ARV_TYPE_FEATURE_WIDGET, ArvFeatureWidgetClass))
+
+typedef struct _ArvFeatureWidget ArvFeatureWidget;
+typedef struct _ArvFeatureWidgetPrivate ArvFeatureWidgetPrivate;
+typedef struct _ArvFeatureWidgetClass ArvFeatureWidgetClass;
+
+struct _ArvFeatureWidget {
+	GtkVBox parent;
+
+	ArvFeatureWidgetPrivate *priv;
+};
+
+struct _ArvFeatureWidgetClass {
+	GtkVBoxClass parent_class;
+};
+
+GType arv_feature_widget_get_type (void);
+
+ArvFeatureWidget * 	arv_feature_widget_new 			(ArvGcNode *node);
+
+G_END_DECLS
+
+#endif
+



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