From da5417def491158aaade4857274caee2229cefaa Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 16 Sep 2017 21:33:34 +0200 Subject: [PATCH] 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(-) create mode 100644 gsk/gsksltypesprivate.h diff --git a/gsk/gskslnode.c b/gsk/gskslnode.c index 994e297c0a..70602dd007 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 diff --git a/gsk/gskslnodeprivate.h b/gsk/gskslnodeprivate.h index 776f59c876..9066d8f167 100644 --- a/gsk/gskslnodeprivate.h +++ b/gsk/gskslnodeprivate.h @@ -21,9 +21,10 @@ #include +#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 abd07a397d..f0fb7164fa 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 58e5888ee0..a2c2adf42f 100644 --- a/gsk/gskslpreprocessorprivate.h +++ b/gsk/gskslpreprocessorprivate.h @@ -21,13 +21,10 @@ #include -#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 8958a412d9..5edfbc694a 100644 --- a/gsk/gsksltype.c +++ b/gsk/gsksltype.c @@ -20,6 +20,9 @@ #include "gsksltypeprivate.h" +#include "gsksltokenizerprivate.h" +#include "gskslpreprocessorprivate.h" + #include struct _GskSlType diff --git a/gsk/gsksltypeprivate.h b/gsk/gsksltypeprivate.h index 25f10c528f..5337e38aa3 100644 --- a/gsk/gsksltypeprivate.h +++ b/gsk/gsksltypeprivate.h @@ -21,7 +21,7 @@ #include -#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 0000000000..e4e02137a8 --- /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 . + */ + +#ifndef __GSK_SL_TYPES_H__ +#define __GSK_SL_TYPES_H__ + +#include + +typedef struct _GskSlNode GskSlNode; +typedef struct _GskSlPreprocessor GskSlPreprocessor; +typedef struct _GskSlToken GskSlToken; +typedef struct _GskSlType GskSlType; + +#endif /* __GSK_SL_TYPES_H__ */