[gtk+/wip/otte/shader: 4/156] gsksl: Add gsksltypesprivate.h



commit 52a45b50950cbef4c2a125f3c927c2789711e84d
Author: Benjamin Otte <otte redhat com>
Date:   Sat Sep 16 21:33:34 2017 +0200

    gsksl: Add gsksltypesprivate.h
    
    All those types are recursively needing each other in their functions,
    so add a generic header for all those types and only include that
    header.

 gsk/gskslnode.c                |    1 +
 gsk/gskslnodeprivate.h         |    3 ++-
 gsk/gskslpreprocessor.c        |    2 ++
 gsk/gskslpreprocessorprivate.h |    5 +----
 gsk/gsksltype.c                |    3 +++
 gsk/gsksltypeprivate.h         |    4 +---
 gsk/gsksltypesprivate.h        |   28 ++++++++++++++++++++++++++++
 7 files changed, 38 insertions(+), 8 deletions(-)
---
diff --git a/gsk/gskslnode.c b/gsk/gskslnode.c
index 994e297..70602dd 100644
--- a/gsk/gskslnode.c
+++ b/gsk/gskslnode.c
@@ -21,6 +21,7 @@
 #include "gskslnodeprivate.h"
 
 #include "gskslpreprocessorprivate.h"
+#include "gsksltokenizerprivate.h"
 #include "gsksltypeprivate.h"
 
 #include <string.h>
diff --git a/gsk/gskslnodeprivate.h b/gsk/gskslnodeprivate.h
index 776f59c..9066d8f 100644
--- a/gsk/gskslnodeprivate.h
+++ b/gsk/gskslnodeprivate.h
@@ -21,9 +21,10 @@
 
 #include <glib.h>
 
+#include "gsk/gsksltypesprivate.h"
+
 G_BEGIN_DECLS
 
-typedef struct _GskSlNode GskSlNode;
 typedef struct _GskSlNodeClass GskSlNodeClass;
 
 struct _GskSlNode {
diff --git a/gsk/gskslpreprocessor.c b/gsk/gskslpreprocessor.c
index abd07a3..f0fb716 100644
--- a/gsk/gskslpreprocessor.c
+++ b/gsk/gskslpreprocessor.c
@@ -20,6 +20,8 @@
 
 #include "gskslpreprocessorprivate.h"
 
+#include "gsksltokenizerprivate.h"
+
 struct _GskSlPreprocessor
 {
   int ref_count;
diff --git a/gsk/gskslpreprocessorprivate.h b/gsk/gskslpreprocessorprivate.h
index 58e5888..a2c2adf 100644
--- a/gsk/gskslpreprocessorprivate.h
+++ b/gsk/gskslpreprocessorprivate.h
@@ -21,13 +21,10 @@
 
 #include <glib.h>
 
-#include "gskslnodeprivate.h"
-#include "gsksltokenizerprivate.h"
+#include "gsksltypesprivate.h"
 
 G_BEGIN_DECLS
 
-typedef struct _GskSlPreprocessor GskSlPreprocessor;
-
 GskSlPreprocessor *     gsk_sl_preprocessor_new                 (GBytes              *source);
 
 GskSlPreprocessor *     gsk_sl_preprocessor_ref                 (GskSlPreprocessor   *preproc);
diff --git a/gsk/gsksltype.c b/gsk/gsksltype.c
index 8958a41..5edfbc6 100644
--- a/gsk/gsksltype.c
+++ b/gsk/gsksltype.c
@@ -20,6 +20,9 @@
 
 #include "gsksltypeprivate.h"
 
+#include "gsksltokenizerprivate.h"
+#include "gskslpreprocessorprivate.h"
+
 #include <string.h>
 
 struct _GskSlType
diff --git a/gsk/gsksltypeprivate.h b/gsk/gsksltypeprivate.h
index 25f10c5..5337e38 100644
--- a/gsk/gsksltypeprivate.h
+++ b/gsk/gsksltypeprivate.h
@@ -21,7 +21,7 @@
 
 #include <glib.h>
 
-#include "gskslpreprocessorprivate.h"
+#include "gsksltypesprivate.h"
 
 G_BEGIN_DECLS
 
@@ -39,8 +39,6 @@ typedef enum {
   GSK_SL_N_BUILTIN_TYPES
 } GskSlBuiltinType;
 
-typedef struct _GskSlType GskSlType;
-
 GskSlType *             gsk_sl_type_new_parse                   (GskSlPreprocessor   *stream);
 GskSlType *             gsk_sl_type_get_builtin                 (GskSlBuiltinType     builtin);
 
diff --git a/gsk/gsksltypesprivate.h b/gsk/gsksltypesprivate.h
new file mode 100644
index 0000000..e4e0213
--- /dev/null
+++ b/gsk/gsksltypesprivate.h
@@ -0,0 +1,28 @@
+/* GSK - The GTK Scene Kit
+ * Copyright 2016  Benjamin Otte
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GSK_SL_TYPES_H__
+#define __GSK_SL_TYPES_H__
+
+#include <gsk/gsktypes.h>
+
+typedef struct _GskSlNode               GskSlNode;
+typedef struct _GskSlPreprocessor       GskSlPreprocessor;
+typedef struct _GskSlToken              GskSlToken;
+typedef struct _GskSlType               GskSlType;
+
+#endif /* __GSK_SL_TYPES_H__ */


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