cogl: Move types definition to a common header

Avoids re-defining the types and cyclic dependencies between headers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4100>
This commit is contained in:
Bilal Elmoussaoui
2024-10-20 16:41:33 +02:00
committed by Marge Bot
parent 80316eb1d6
commit 34f4b8064f
23 changed files with 23 additions and 63 deletions

View File

@ -73,7 +73,6 @@ G_BEGIN_DECLS
#define COGL_ATLAS_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_ATLAS_TEXTURE, CoglAtlasTextureClass))
typedef struct _CoglAtlasTextureClass CoglAtlasTextureClass;
typedef struct _CoglAtlasTexture CoglAtlasTexture;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglAtlasTexture, g_object_unref)

View File

@ -41,8 +41,6 @@ typedef enum
COGL_ATLAS_DISABLE_MIGRATION = (1 << 1)
} CoglAtlasFlags;
typedef struct _CoglAtlas CoglAtlas;
#define COGL_TYPE_ATLAS (cogl_atlas_get_type ())
COGL_EXPORT

View File

@ -37,11 +37,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* We forward declare the CoglAttributeBuffer type here to avoid some circular
* dependency issues with the following headers.
*/
typedef struct _CoglAttributeBuffer CoglAttributeBuffer;
#include "cogl/cogl-context.h"
#include <glib-object.h>
@ -62,7 +57,6 @@ G_BEGIN_DECLS
#define COGL_ATTRIBUTE_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_ATTRIBUTE_BUFFER, CoglAttributeBufferClass))
typedef struct _CoglAttributeBufferClass CoglAttributeBufferClass;
typedef struct _CoglAttributeBuffer CoglAttributeBuffer;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglAttributeBuffer, g_object_unref)

View File

@ -37,11 +37,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* We forward declare the CoglAttribute type here to avoid some circular
* dependency issues with the following headers.
*/
typedef struct _CoglAttribute CoglAttribute;
#include "cogl/cogl-attribute-buffer.h"
#include "cogl/cogl-indices.h"

View File

@ -34,10 +34,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* XXX: We forward declare CoglBitmap here to allow for circular
* dependencies between some headers */
typedef struct _CoglBitmap CoglBitmap;
#include "cogl/cogl-types.h"
#include "cogl/cogl-buffer.h"
#include "cogl/cogl-context.h"

View File

@ -72,7 +72,6 @@ G_BEGIN_DECLS
#define COGL_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_BUFFER, CoglBufferClass))
typedef struct _CoglBufferClass CoglBufferClass;
typedef struct _CoglBuffer CoglBuffer;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglBuffer, g_object_unref)

View File

@ -318,8 +318,6 @@ cogl_color_init_from_hsl (CoglColor *color,
*/
#define COGL_VALUE_HOLDS_COLOR(x) (G_VALUE_HOLDS ((x), COGL_TYPE_COLOR))
typedef struct _CoglParamSpecColor CoglParamSpecColor;
/**
* CoglParamSpecColor: (skip)
* @default_value: default color value

View File

@ -36,12 +36,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* We forward declare the CoglContext type here to avoid some circular
* dependency issues with the following headers.
*/
typedef struct _CoglContext CoglContext;
typedef struct _CoglTimestampQuery CoglTimestampQuery;
#include "cogl/cogl-display.h"
#include "cogl/cogl-pipeline.h"
#include "cogl/cogl-primitive.h"

View File

@ -65,8 +65,6 @@ G_BEGIN_DECLS
* create a GLContext.
*/
typedef struct _CoglDisplay CoglDisplay;
#define COGL_TYPE_DISPLAY (cogl_display_get_type ())
COGL_EXPORT

View File

@ -49,8 +49,6 @@ G_BEGIN_DECLS
*
* Frame information.
*/
typedef struct _CoglFrameInfo CoglFrameInfo;
#define COGL_TYPE_FRAME_INFO (cogl_frame_info_get_type ())
COGL_EXPORT

View File

@ -30,8 +30,6 @@
#include "cogl/cogl-attribute-private.h"
#include "cogl/cogl-framebuffer.h"
typedef struct _CoglFramebufferBits CoglFramebufferBits;
#define COGL_TYPE_FRAMEBUFFER_DRIVER (cogl_framebuffer_driver_get_type ())
G_DECLARE_DERIVABLE_TYPE (CoglFramebufferDriver,
cogl_framebuffer_driver,

View File

@ -37,11 +37,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* We forward declare the CoglIndices type here to avoid some circular
* dependency issues with the following headers.
*/
typedef struct _CoglIndices CoglIndices;
#include "cogl/cogl-index-buffer.h"
#include <glib-object.h>

View File

@ -36,7 +36,6 @@
#include "cogl/cogl-list.h"
typedef struct _CoglNodeClass CoglNodeClass;
typedef struct _CoglNode CoglNode;
/* Pipelines and layers represent their state in a tree structure where
* some of the state relating to a given pipeline or layer may actually

View File

@ -34,11 +34,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* We forward declare the CoglPipeline type here to avoid some circular
* dependency issues with the following headers.
*/
typedef struct _CoglPipeline CoglPipeline;
#include "cogl/cogl-types.h"
#include "cogl/cogl-context.h"
#include "cogl/cogl-snippet.h"
@ -69,7 +64,6 @@ G_BEGIN_DECLS
#define COGL_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_PIPELINE, CoglPipelineClass))
typedef struct _CoglPipelineClass CoglPipelineClass;
typedef struct _CoglPipeline CoglPipeline;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglPipeline, g_object_unref)

View File

@ -38,10 +38,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* XXX: We forward declare CoglPixelBuffer here to allow for circular
* dependencies between some headers */
typedef struct _CoglPixelBuffer CoglPixelBuffer;
#include "cogl/cogl-types.h"
#include "cogl/cogl-context.h"
@ -61,7 +57,6 @@ G_BEGIN_DECLS
#define COGL_PIXEL_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_PIXEL_BUFFER, CoglPixelBufferClass))
typedef struct _CoglPixelBufferClass CoglPixelBufferClass;
typedef struct _CoglPixelBuffer CoglPixelBuffer;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglPixelBuffer, g_object_unref)

View File

@ -37,11 +37,6 @@
#error "Only <cogl/cogl.h> can be included directly."
#endif
/* We forward declare the CoglPrimitive type here to avoid some circular
* dependency issues with the following headers.
*/
typedef struct _CoglPrimitive CoglPrimitive;
#include "cogl/cogl-types.h" /* for CoglVerticesMode */
#include "cogl/cogl-attribute.h"
#include "cogl/cogl-framebuffer.h"

View File

@ -76,8 +76,6 @@ G_BEGIN_DECLS
COGL_EXPORT uint32_t
cogl_renderer_error_quark (void);
typedef struct _CoglRenderer CoglRenderer;
#define COGL_TYPE_RENDERER (cogl_renderer_get_type ())
COGL_EXPORT

View File

@ -217,8 +217,6 @@ G_BEGIN_DECLS
* cogl_pop_source ();
* ```
*/
typedef struct _CoglSnippet CoglSnippet;
#define COGL_TYPE_SNIPPET (cogl_snippet_get_type ())
COGL_EXPORT

View File

@ -55,7 +55,6 @@ G_BEGIN_DECLS
#define COGL_SUB_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_SUB_TEXTURE, CoglSubTextureClass))
typedef struct _CoglSubTextureClass CoglSubTextureClass;
typedef struct _CoglSubTexture CoglSubTexture;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglSubTexture, g_object_unref)

View File

@ -75,7 +75,6 @@
#define COGL_TEXTURE_2D_SLICED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_TEXTURE_2D_SLICED, CoglTexture2DSlicedClass))
typedef struct _CoglTexture2DSlicedClass CoglTexture2DSlicedClass;
typedef struct _CoglTexture2DSliced CoglTexture2DSliced;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglTexture2DSliced, g_object_unref)

View File

@ -62,7 +62,6 @@ G_BEGIN_DECLS
#define COGL_TEXTURE_2D_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_TEXTURE_2D, CoglTexture2DClass))
typedef struct _CoglTexture2DClass CoglTexture2DClass;
typedef struct _CoglTexture2D CoglTexture2D;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglTexture2D, g_object_unref)

View File

@ -62,7 +62,6 @@ G_BEGIN_DECLS
#define COGL_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), COGL_TYPE_TEXTURE, CoglTextureClass))
typedef struct _CoglTextureClass CoglTextureClass;
typedef struct _CoglTexture CoglTexture;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoglTexture, g_object_unref)

View File

@ -311,8 +311,31 @@ typedef enum /*< prefix=COGL_READ_PIXELS >*/
COGL_READ_PIXELS_COLOR_BUFFER = 1L << 0
} CoglReadPixelsFlags;
typedef struct _CoglAttribute CoglAttribute;
typedef struct _CoglAttributeBuffer CoglAttributeBuffer;
typedef struct _CoglAtlas CoglAtlas;
typedef struct _CoglAtlasTexture CoglAtlasTexture;
typedef struct _CoglBitmap CoglBitmap;
typedef struct _CoglBuffer CoglBuffer;
typedef struct _CoglContext CoglContext;
typedef struct _CoglDisplay CoglDisplay;
typedef struct _CoglFramebufferBits CoglFramebufferBits;
typedef struct _CoglFrameInfo CoglFrameInfo;
typedef struct _CoglIndices CoglIndices;
typedef struct _CoglNode CoglNode;
typedef struct _CoglParamSpecColor CoglParamSpecColor;
typedef struct _CoglPipeline CoglPipeline;
typedef struct _CoglPixelBuffer CoglPixelBuffer;
typedef struct _CoglPrimitive CoglPrimitive;
typedef struct _CoglRenderer CoglRenderer;
typedef struct _CoglScanout CoglScanout;
typedef struct _CoglScanoutBuffer CoglScanoutBuffer;
typedef struct _CoglSnippet CoglSnippet;
typedef struct _CoglSubTexture CoglSubTexture;
typedef struct _CoglTexture CoglTexture;
typedef struct _CoglTexture2D CoglTexture2D;
typedef struct _CoglTexture2DSliced CoglTexture2DSliced;
typedef struct _CoglTimestampQuery CoglTimestampQuery;
#define COGL_SCANOUT_ERROR (cogl_scanout_error_quark ())