gegl r2032 - in trunk: . bin



Author: martinn
Date: Sun Feb 17 12:29:40 2008
New Revision: 2032
URL: http://svn.gnome.org/viewvc/gegl?rev=2032&view=rev

Log:
2008-02-17  Martin Nordholts  <martinn svn gnome org>

	Added gimp-bin-types.h and gimp-bin-gui-types.h and moved CLI and
	GUI typedefs there.

	* bin/gegl-bin-types.h
	* bin/gegl-bin-gui-types.h: The two new files.

	* bin/gegl.c
	* bin/export.[ch]
	* bin/editor.[ch]
	* bin/gegl-view.[nch]
	* bin/editor-optype.c
	* bin/gegl-store.[ch]
	* bin/gegl-options.[ch]
	* bin/gegl-tree-editor.[ch]
	* bin/gegl-node-editor.[ch]
	* bin/gegl-tree-editor-action.[ch]: Make sure config.h is included
	in .c files and also include the appropriate types-headers as well
	as organize the other #include:s. Remove unneccesary #include:s in
	header files. Don't include the system-gegl.h but the one in the
	source tree. Also did some other minor restructuring.

	* bin/Makefile.am: Added the two new files.


Added:
   trunk/bin/gegl-bin-gui-types.h
   trunk/bin/gegl-bin-types.h
Modified:
   trunk/ChangeLog
   trunk/bin/Makefile.am
   trunk/bin/editor-optype.c
   trunk/bin/editor.c
   trunk/bin/editor.h
   trunk/bin/export.c
   trunk/bin/export.h
   trunk/bin/gegl-node-editor.c
   trunk/bin/gegl-node-editor.h
   trunk/bin/gegl-options.c
   trunk/bin/gegl-options.h
   trunk/bin/gegl-store.c
   trunk/bin/gegl-store.h
   trunk/bin/gegl-tree-editor-action.c
   trunk/bin/gegl-tree-editor-action.h
   trunk/bin/gegl-tree-editor.c
   trunk/bin/gegl-tree-editor.h
   trunk/bin/gegl-view.c
   trunk/bin/gegl-view.h
   trunk/bin/gegl.c

Modified: trunk/bin/Makefile.am
==============================================================================
--- trunk/bin/Makefile.am	(original)
+++ trunk/bin/Makefile.am	Sun Feb 17 12:29:40 2008
@@ -15,6 +15,8 @@
 	editor-optype.h				\
 	export.c				\
 	export.h				\
+	gegl-bin-types.h			\
+	gegl-bin-gui-types.h			\
 	gegl-node-editor.c			\
 	gegl-node-editor.h			\
 	gegl-store.c				\

Modified: trunk/bin/editor-optype.c
==============================================================================
--- trunk/bin/editor-optype.c	(original)
+++ trunk/bin/editor-optype.c	Sun Feb 17 12:29:40 2008
@@ -23,6 +23,8 @@
 
 #include <gtk/gtk.h>
 
+#include "gegl-bin-gui-types.h"
+
 #include "gegl-plugin.h"  /* FIXME: should just be gegl.h */
 
 #include "editor.h"

Modified: trunk/bin/editor.c
==============================================================================
--- trunk/bin/editor.c	(original)
+++ trunk/bin/editor.c	Sun Feb 17 12:29:40 2008
@@ -16,18 +16,27 @@
  * Copyright (C) 2003, 2004, 2006 Ãyvind KolÃs
  */
 
+#include "config.h"
+
+#include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 #include <limits.h>
 #include <stdlib.h>
 #include <string.h>
+
+#include "gegl-bin-gui-types.h"
+
 #include "gegl.h"
+
+#include "editor-optype.h"
+#include "gegl-node-editor.h"
+#include "gegl-options.h"
 #include "gegl-store.h"
 #include "gegl-tree-editor.h"
-#include "gegl-node-editor.h"
-#include "editor.h"
 #include "gegl-view.h"
-#include "editor-optype.h"
-#include <gdk/gdkkeysyms.h>
+#include "gegl-view.h"
+
+#include "editor.h"
 
 #ifdef G_OS_WIN32
 #ifndef PATH_MAX

Modified: trunk/bin/editor.h
==============================================================================
--- trunk/bin/editor.h	(original)
+++ trunk/bin/editor.h	Sun Feb 17 12:29:40 2008
@@ -19,10 +19,7 @@
 #ifndef EDITOR_H
 #define EDITOR_H
 
-#include "gegl-options.h"
-#include "gegl-view.h"
-
-typedef struct Editor 
+struct _Editor 
 {
   GeglNode    *gegl;
   GeglOptions *options;
@@ -42,7 +39,7 @@
 
   GtkWidget   *graph_editor;
   GtkWidget   *view;
-} Editor;
+};
 
 extern Editor editor;
 GtkWidget * StockIcon (const gchar *id, GtkIconSize size, GtkWidget *widget);

Modified: trunk/bin/export.c
==============================================================================
--- trunk/bin/export.c	(original)
+++ trunk/bin/export.c	Sun Feb 17 12:29:40 2008
@@ -16,19 +16,29 @@
  * Copyright (C) 2003, 2004, 2006 Ãyvind KolÃs
  */
 
+#include "config.h"
+
+#include <stdio.h>
+#include <png.h>
+#include <gtk/gtk.h>
+
+#include "gegl-bin-gui-types.h"
+
+#include "gegl.h"
 #include "gegl-plugin.h"
+
 #include "graph/gegl-node.h" /*< FIXME: including internal header */
+
+#include "gegl-view.h"
 #include "editor.h"
 #include "export.h"
-#include <png.h>
+
 
 static gint
 gegl_buffer_export_png (GeglBuffer    *gegl_buffer,
                         GeglRectangle *rect,
                         const gchar   *path);
 
-#include <stdio.h>
-
 
 static void set_to_defined (GtkWidget *export)
 {

Modified: trunk/bin/export.h
==============================================================================
--- trunk/bin/export.h	(original)
+++ trunk/bin/export.h	Sun Feb 17 12:29:40 2008
@@ -18,5 +18,9 @@
 
 #ifndef EXPORT_H
 #define EXPORT_H
+
+
 void export_window (void);
+
+
 #endif

Added: trunk/bin/gegl-bin-gui-types.h
==============================================================================
--- (empty file)
+++ trunk/bin/gegl-bin-gui-types.h	Sun Feb 17 12:29:40 2008
@@ -0,0 +1,31 @@
+/* This file is part of GEGL editor -- a gtk frontend for GEGL
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2008 Martin Nordholts
+ */
+#ifndef GEGL_BIN_GUI_TYPES_H
+#define GEGL_BIN_GUI_TYPES_H
+
+
+#include "gegl-bin-types.h"
+
+
+typedef struct _Editor          Editor;
+typedef struct _GeglNodeEditor  GeglNodeEditor;
+typedef struct _GeglStore       GeglStore;
+typedef struct _GeglView        GeglView;
+
+
+#endif /* GEGL_EDITOR_TYPES_H */

Added: trunk/bin/gegl-bin-types.h
==============================================================================
--- (empty file)
+++ trunk/bin/gegl-bin-types.h	Sun Feb 17 12:29:40 2008
@@ -0,0 +1,25 @@
+/* This file is part of GEGL editor -- a gtk frontend for GEGL
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2008 Martin Nordholts
+ */
+#ifndef GEGL_BIN_TYPES_TYPES_H
+#define GEGL_BIN_TYPES_TYPES_H
+
+
+typedef struct _GeglOptions GeglOptions;
+
+
+#endif /* GEGL_BIN_TYPES_TYPES_H */

Modified: trunk/bin/gegl-node-editor.c
==============================================================================
--- trunk/bin/gegl-node-editor.c	(original)
+++ trunk/bin/gegl-node-editor.c	Sun Feb 17 12:29:40 2008
@@ -23,6 +23,10 @@
 #include <unistd.h>
 #endif
 
+#include <gtk/gtk.h>
+
+#include "gegl-bin-gui-types.h"
+
 #include "gegl.h"
 
 #include "gegl-node-editor.h"

Modified: trunk/bin/gegl-node-editor.h
==============================================================================
--- trunk/bin/gegl-node-editor.h	(original)
+++ trunk/bin/gegl-node-editor.h	Sun Feb 17 12:29:40 2008
@@ -19,9 +19,7 @@
 #ifndef GEGL_NODE_EDITOR_H
 #define GEGL_NODE_EDITOR_H
 
-#include <gtk/gtk.h>
 #include <gtk/gtkvbox.h>
-#include <gegl.h>
 
 #define GEGL_TYPE_NODE_EDITOR            (gegl_node_editor_get_type ())
 #define GEGL_NODE_EDITOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_NODE_EDITOR, GeglNodeEditor))
@@ -30,7 +28,6 @@
 #define GEGL_IS_NODE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_NODE_EDITOR))
 #define GEGL_NODE_EDITOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_NODE_EDITOR, GeglNodeEditorClass))
 
-typedef struct _GeglNodeEditor      GeglNodeEditor;
 typedef struct _GeglNodeEditorClass GeglNodeEditorClass;
 
 struct _GeglNodeEditor

Modified: trunk/bin/gegl-options.c
==============================================================================
--- trunk/bin/gegl-options.c	(original)
+++ trunk/bin/gegl-options.c	Sun Feb 17 12:29:40 2008
@@ -17,11 +17,16 @@
  */
 
 #include "config.h"
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
+
+#include "gegl-bin-types.h"
+
 #include "gegl-options.h"
 
+
 static GeglOptions *opts_new (void)
 {
   GeglOptions *o = g_malloc0 (sizeof (GeglOptions));

Modified: trunk/bin/gegl-options.h
==============================================================================
--- trunk/bin/gegl-options.h	(original)
+++ trunk/bin/gegl-options.h	Sun Feb 17 12:29:40 2008
@@ -30,7 +30,7 @@
   GEGL_RUN_MODE_XML
 } GeglRunMode;
 
-typedef struct GeglOptions
+struct _GeglOptions
 {
   GeglRunMode  mode;
 
@@ -46,7 +46,7 @@
 
   gfloat       delay;
   gboolean     play;
-} GeglOptions;
+};
 
 GeglOptions *gegl_options_parse (gint    argc,
                                  gchar **argv);

Modified: trunk/bin/gegl-store.c
==============================================================================
--- trunk/bin/gegl-store.c	(original)
+++ trunk/bin/gegl-store.c	Sun Feb 17 12:29:40 2008
@@ -16,10 +16,18 @@
  * Copyright (C) 2003, 2004, 2006 Ãyvind KolÃs
  */
 
+#include "config.h"
 
-#include <gegl.h>
-#include "gegl-store.h"
+#include <stdio.h>
 #include <string.h>
+#include <gtk/gtk.h>
+
+#include "gegl-bin-gui-types.h"
+
+#include "gegl.h"
+
+#include "gegl-store.h"
+
 
 GeglNode *
 gegl_children (GeglNode *item)
@@ -341,8 +349,6 @@
   return cnt;
 }
 
-#include <stdio.h>
-
 static GtkTreePath *
 gegl_store_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
 {
@@ -367,8 +373,6 @@
   return path;
 }
 
-#include <string.h>
-
 static void
 gegl_store_get_value (GtkTreeModel *tree_model,
                       GtkTreeIter  *iter,

Modified: trunk/bin/gegl-store.h
==============================================================================
--- trunk/bin/gegl-store.h	(original)
+++ trunk/bin/gegl-store.h	Sun Feb 17 12:29:40 2008
@@ -18,8 +18,7 @@
 #ifndef GEGL_STORE_H
 #define GEGL_STORE_H
 
-#include <gtk/gtk.h>
-#include <gegl.h>
+#include <glib-object.h>
 
 #define TYPE_GEGL_STORE                  (gegl_store_get_type ())
 #define GEGL_STORE(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GEGL_STORE, GeglStore))
@@ -41,7 +40,6 @@
   GEGL_STORE_N_COLUMNS
 };
 
-typedef struct _GeglStore GeglStore;
 typedef struct _GeglStoreClass GeglStoreClass;
 
 

Modified: trunk/bin/gegl-tree-editor-action.c
==============================================================================
--- trunk/bin/gegl-tree-editor-action.c	(original)
+++ trunk/bin/gegl-tree-editor-action.c	Sun Feb 17 12:29:40 2008
@@ -16,12 +16,19 @@
  * Copyright (C) 2003, 2004, 2006 Ãyvind KolÃs
  */
 
+#include "config.h"
+
 #include <gtk/gtk.h>
 #include <string.h>
+
+#include "gegl-bin-gui-types.h"
+
 #include "gegl.h"
-#include "gegl-view.h"
+
 #include "editor.h"
+#include "gegl-store.h"
 #include "gegl-tree-editor.h"
+#include "gegl-view.h"
 
 
 /* The reason for these surviving is that it was the API used to

Modified: trunk/bin/gegl-tree-editor-action.h
==============================================================================
--- trunk/bin/gegl-tree-editor-action.h	(original)
+++ trunk/bin/gegl-tree-editor-action.h	Sun Feb 17 12:29:40 2008
@@ -19,8 +19,6 @@
 #ifndef GEGL_TREE_EDITOR_ACTION_H
 #define GEGL_TREE_EDITOR_ACTION_H
 
-#include <gtk/gtk.h>
-
 GtkActionGroup *tree_editor_action_group (GtkWidget *tree_editor);
 GeglNode *gegl_add_sibling (const gchar *type);
 

Modified: trunk/bin/gegl-tree-editor.c
==============================================================================
--- trunk/bin/gegl-tree-editor.c	(original)
+++ trunk/bin/gegl-tree-editor.c	Sun Feb 17 12:29:40 2008
@@ -16,11 +16,21 @@
  * Copyright (C) 2003, 2004, 2006 Ãyvind KolÃs
  */
 
+#include "config.h"
+
 #include <gtk/gtk.h>
+
+#include "gegl-bin-gui-types.h"
+
+#include "gegl.h"
+
+#include "editor.h"
+#include "gegl-node-editor.h"
 #include "gegl-plugin.h"
+#include "gegl-store.h"
+#include "gegl-tree-editor-action.h"
 #include "gegl-tree-editor.h"
-#include "gegl-node-editor.h"
-#include "editor.h"
+
 
 void property_editor_rebuild (GtkWidget *container,
                               GeglNode  *node)

Modified: trunk/bin/gegl-tree-editor.h
==============================================================================
--- trunk/bin/gegl-tree-editor.h	(original)
+++ trunk/bin/gegl-tree-editor.h	Sun Feb 17 12:29:40 2008
@@ -19,9 +19,6 @@
 #ifndef GEGL_TREE_EDITOR_H
 #define GEGL_TREE_EDITOR_H
 
-#include "gegl-tree-editor-action.h"
-#include <gegl.h>
-#include "gegl-store.h"
 
 GtkWidget * tree_editor_new          (GtkWidget *property_editor);
 
@@ -35,4 +32,5 @@
 void        property_editor_rebuild  (GtkWidget *container,
                                       GeglNode  *node);
 
-#endif /* TREE_EDITOR_H */
+
+#endif /* GEGL_TREE_EDITOR_H */

Modified: trunk/bin/gegl-view.c
==============================================================================
--- trunk/bin/gegl-view.c	(original)
+++ trunk/bin/gegl-view.c	Sun Feb 17 12:29:40 2008
@@ -16,13 +16,21 @@
  * Copyright (C) 2003, 2004, 2006 Ãyvind KolÃs
  */
 
+#include "config.h"
+
+#include <math.h>
+#include <babl/babl.h>
 #include <glib-object.h>
+#include <gtk/gtk.h>
+
+#include "gegl-bin-gui-types.h"
+
 #include "gegl.h"
-#include <babl/babl.h>
+
 #include "gegl-view.h"
 #include "gegl-tree-editor.h"
 #include "editor.h"
-#include <math.h>
+
 
 enum
 {
@@ -33,31 +41,8 @@
   PROP_SCALE
 };
 
-G_DEFINE_TYPE (GeglView, gegl_view, GTK_TYPE_DRAWING_AREA)
-#define GEGL_VIEW_GET_PRIVATE(obj) \
-  (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GEGL_TYPE_VIEW, GeglViewPrivate))
-
-static void      gegl_view_class_init (GeglViewClass  *klass);
-static void      gegl_view_init       (GeglView       *self);
-static void      finalize             (GObject        *gobject);
-static void      set_property         (GObject        *gobject,
-                                       guint           prop_id,
-                                       const GValue   *value,
-                                       GParamSpec     *pspec);
-static void      get_property         (GObject        *gobject,
-                                       guint           prop_id,
-                                       GValue         *value,
-                                       GParamSpec     *pspec);
-static gboolean  motion_notify_event  (GtkWidget      *widget,
-                                       GdkEventMotion *event);
-static gboolean  button_press_event   (GtkWidget      *widget,
-                                       GdkEventButton *event);
-static gboolean  expose_event         (GtkWidget      *widget,
-                                       GdkEventExpose *event);
-
 
-
-struct _GeglViewPrivate
+typedef struct _GeglViewPrivate
 {
   GeglNode      *node;
   gint           x;
@@ -78,9 +63,30 @@
 
   guint          monitor_id;
   GeglProcessor *processor;
-};
+} GeglViewPrivate;
+
 
+G_DEFINE_TYPE (GeglView, gegl_view, GTK_TYPE_DRAWING_AREA)
+#define GEGL_VIEW_GET_PRIVATE(obj) \
+  (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GEGL_TYPE_VIEW, GeglViewPrivate))
 
+static void      gegl_view_class_init (GeglViewClass  *klass);
+static void      gegl_view_init       (GeglView       *self);
+static void      finalize             (GObject        *gobject);
+static void      set_property         (GObject        *gobject,
+                                       guint           prop_id,
+                                       const GValue   *value,
+                                       GParamSpec     *pspec);
+static void      get_property         (GObject        *gobject,
+                                       guint           prop_id,
+                                       GValue         *value,
+                                       GParamSpec     *pspec);
+static gboolean  motion_notify_event  (GtkWidget      *widget,
+                                       GdkEventMotion *event);
+static gboolean  button_press_event   (GtkWidget      *widget,
+                                       GdkEventButton *event);
+static gboolean  expose_event         (GtkWidget      *widget,
+                                       GdkEventExpose *event);
 
 
 static void

Modified: trunk/bin/gegl-view.h
==============================================================================
--- trunk/bin/gegl-view.h	(original)
+++ trunk/bin/gegl-view.h	Sun Feb 17 12:29:40 2008
@@ -19,9 +19,6 @@
 #ifndef __GEGL_VIEW_H__
 #define __GEGL_VIEW_H__
 
-#include <gtk/gtk.h>
-#include "gegl.h"
-
 G_BEGIN_DECLS
 
 #define GEGL_TYPE_VIEW            (gegl_view_get_type ())
@@ -31,9 +28,7 @@
 #define GEGL_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_VIEW))
 #define GEGL_VIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_VIEW, GeglViewClass))
 
-typedef struct _GeglView        GeglView;
 typedef struct _GeglViewClass   GeglViewClass;
-typedef struct _GeglViewPrivate GeglViewPrivate;
 
 struct _GeglView
 {

Modified: trunk/bin/gegl.c
==============================================================================
--- trunk/bin/gegl.c	(original)
+++ trunk/bin/gegl.c	Sun Feb 17 12:29:40 2008
@@ -26,6 +26,9 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+
+#include "gegl-bin-types.h"
+
 #include "gegl-options.h"
 #include "gegl-dot.h"
 
@@ -40,6 +43,7 @@
 
 #if HAVE_GTK
 #include <gtk/gtk.h>
+#include "gegl-bin-gui-types.h"
 #include "editor.h"
 #endif
 



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