gdk: Move GdkMemoryFormat enum to gdktypes.h
authorBenjamin Otte <otte@redhat.com>
Sat, 16 Oct 2021 11:35:50 +0000 (13:35 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 16 Oct 2021 13:49:37 +0000 (15:49 +0200)
It's used in too many places now.

gdk/gdkglcontextprivate.h
gdk/gdkmemoryformatprivate.h
gdk/gdkmemorytexture.h
gdk/gdktextureprivate.h
gdk/gdktypes.h

index 6814fec0bf763138e7327d10be057e5b6a9c8b50..56fe04f903e4f8c9ec7fd75743e7c0322042646b 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "gdkglcontext.h"
 #include "gdkdrawcontextprivate.h"
-#include "gdkmemorytexture.h"
 
 G_BEGIN_DECLS
 
index 344e47fade807f206e4e03603db6831c2b72e466..bdcb2265e60f4fd7dd1b243b7573be02de7189bb 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __GDK_MEMORY_CONVERT_PRIVATE_H__
 #define __GDK_MEMORY_CONVERT_PRIVATE_H__
 
-#include "gdkmemorytexture.h"
+#include "gdktypes.h"
 
 G_BEGIN_DECLS
 
index 0c574d7addd0bca986402ab998325e71c1808bfa..8f2fb5299c44186726c4112e6e5c45dfd3b2ad3c 100644 (file)
 
 G_BEGIN_DECLS
 
-/**
- * GdkMemoryFormat:
- * @GDK_MEMORY_B8G8R8A8_PREMULTIPLIED: 4 bytes; for blue, green, red, alpha.
- *   The color values are premultiplied with the alpha value.
- * @GDK_MEMORY_A8R8G8B8_PREMULTIPLIED: 4 bytes; for alpha, red, green, blue.
- *   The color values are premultiplied with the alpha value.
- * @GDK_MEMORY_R8G8B8A8_PREMULTIPLIED: 4 bytes; for red, green, blue, alpha
- *   The color values are premultiplied with the alpha value.
- * @GDK_MEMORY_B8G8R8A8: 4 bytes; for blue, green, red, alpha.
- * @GDK_MEMORY_A8R8G8B8: 4 bytes; for alpha, red, green, blue.
- * @GDK_MEMORY_R8G8B8A8: 4 bytes; for red, green, blue, alpha.
- * @GDK_MEMORY_A8B8G8R8: 4 bytes; for alpha, blue, green, red.
- * @GDK_MEMORY_R8G8B8: 3 bytes; for red, green, blue. The data is opaque.
- * @GDK_MEMORY_B8G8R8: 3 bytes; for blue, green, red. The data is opaque.
- * @GDK_MEMORY_R16G16B16: 3 guint16 values; for red, green, blue. Since 4.6
- * @GDK_MEMORY_R16G16B16A16_PREMULTIPLIED: 4 guint16 values; for red, green,
- *   blue, alpha. The color values are premultiplied with the alpha value.
- *   Since 4.6
- * @GDK_MEMORY_R16G16B16A16: 4 guint16 values; for red, green, blue, alpha.
- *   Since 4.6
- * @GDK_MEMORY_R16G16B16_FLOAT: 3 half-float values; for red, green, blue.
- *   The data is opaque. Since 4.6
- * @GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED: 4 half-float values; for
- *   red, green, blue and alpha. The color values are premultiplied with
- *   the alpha value. Since 4.6
- * @GDK_MEMORY_R16G16B16A16_FLOAT: 4 half-float values; for red, green,
- *   blue and alpha. Since 4.6
- * @GDK_MEMORY_B32G32R32_FLOAT: 3 float values; for blue, green, red.
- *   The data is opaque. Since 4.6
- * @GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED: 4 float values; for
- *   red, green, blue and alpha. The color values are premultiplied with
- *   the alpha value. Since 4.6
- * @GDK_MEMORY_R32G32B32A32_FLOAT: 4 float values; for red, green, blue and
- *   alpha. Since 4.6
- * @GDK_MEMORY_N_FORMATS: The number of formats. This value will change as
- *   more formats get added, so do not rely on its concrete integer.
- *
- * `GdkMemoryFormat` describes a format that bytes can have in memory.
- *
- * It describes formats by listing the contents of the memory passed to it.
- * So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a
- * byte each of red, green and blue. It is not endian-dependent, so
- * CAIRO_FORMAT_ARGB32 is represented by different `GdkMemoryFormats`
- * on architectures with different endiannesses.
- *
- * Its naming is modelled after
- * [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat)
- * for details).
- */
-typedef enum {
-  GDK_MEMORY_B8G8R8A8_PREMULTIPLIED,
-  GDK_MEMORY_A8R8G8B8_PREMULTIPLIED,
-  GDK_MEMORY_R8G8B8A8_PREMULTIPLIED,
-  GDK_MEMORY_B8G8R8A8,
-  GDK_MEMORY_A8R8G8B8,
-  GDK_MEMORY_R8G8B8A8,
-  GDK_MEMORY_A8B8G8R8,
-  GDK_MEMORY_R8G8B8,
-  GDK_MEMORY_B8G8R8,
-  GDK_MEMORY_R16G16B16,
-  GDK_MEMORY_R16G16B16A16_PREMULTIPLIED,
-  GDK_MEMORY_R16G16B16A16,
-  GDK_MEMORY_R16G16B16_FLOAT,
-  GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED,
-  GDK_MEMORY_R16G16B16A16_FLOAT,
-  GDK_MEMORY_R32G32B32_FLOAT,
-  GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED,
-  GDK_MEMORY_R32G32B32A32_FLOAT,
-
-  GDK_MEMORY_N_FORMATS
-} GdkMemoryFormat;
-
 /**
  * GDK_MEMORY_DEFAULT:
  *
index a9e6ac51a272952f95482be465198b46b94f8e21..d9579f4657cf3ff92c83f15ce254d37b48a183f2 100644 (file)
@@ -3,8 +3,6 @@
 
 #include "gdktexture.h"
 
-#include "gdkmemorytexture.h"
-
 G_BEGIN_DECLS
 
 #define GDK_TEXTURE_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_TEXTURE, GdkTextureClass))
index 77059797da28394e02af492bc45f850bbcdc26a9..9fdf2c11bd75c38e64b64aed5e435a6f2134479a 100644 (file)
@@ -320,6 +320,78 @@ typedef enum
  */
 #define GDK_ACTION_ALL (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)
 
+/**
+ * GdkMemoryFormat:
+ * @GDK_MEMORY_B8G8R8A8_PREMULTIPLIED: 4 bytes; for blue, green, red, alpha.
+ *   The color values are premultiplied with the alpha value.
+ * @GDK_MEMORY_A8R8G8B8_PREMULTIPLIED: 4 bytes; for alpha, red, green, blue.
+ *   The color values are premultiplied with the alpha value.
+ * @GDK_MEMORY_R8G8B8A8_PREMULTIPLIED: 4 bytes; for red, green, blue, alpha
+ *   The color values are premultiplied with the alpha value.
+ * @GDK_MEMORY_B8G8R8A8: 4 bytes; for blue, green, red, alpha.
+ * @GDK_MEMORY_A8R8G8B8: 4 bytes; for alpha, red, green, blue.
+ * @GDK_MEMORY_R8G8B8A8: 4 bytes; for red, green, blue, alpha.
+ * @GDK_MEMORY_A8B8G8R8: 4 bytes; for alpha, blue, green, red.
+ * @GDK_MEMORY_R8G8B8: 3 bytes; for red, green, blue. The data is opaque.
+ * @GDK_MEMORY_B8G8R8: 3 bytes; for blue, green, red. The data is opaque.
+ * @GDK_MEMORY_R16G16B16: 3 guint16 values; for red, green, blue. Since 4.6
+ * @GDK_MEMORY_R16G16B16A16_PREMULTIPLIED: 4 guint16 values; for red, green,
+ *   blue, alpha. The color values are premultiplied with the alpha value.
+ *   Since 4.6
+ * @GDK_MEMORY_R16G16B16A16: 4 guint16 values; for red, green, blue, alpha.
+ *   Since 4.6
+ * @GDK_MEMORY_R16G16B16_FLOAT: 3 half-float values; for red, green, blue.
+ *   The data is opaque. Since 4.6
+ * @GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED: 4 half-float values; for
+ *   red, green, blue and alpha. The color values are premultiplied with
+ *   the alpha value. Since 4.6
+ * @GDK_MEMORY_R16G16B16A16_FLOAT: 4 half-float values; for red, green,
+ *   blue and alpha. Since 4.6
+ * @GDK_MEMORY_B32G32R32_FLOAT: 3 float values; for blue, green, red.
+ *   The data is opaque. Since 4.6
+ * @GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED: 4 float values; for
+ *   red, green, blue and alpha. The color values are premultiplied with
+ *   the alpha value. Since 4.6
+ * @GDK_MEMORY_R32G32B32A32_FLOAT: 4 float values; for red, green, blue and
+ *   alpha. Since 4.6
+ * @GDK_MEMORY_N_FORMATS: The number of formats. This value will change as
+ *   more formats get added, so do not rely on its concrete integer.
+ *
+ * `GdkMemoryFormat` describes a format that bytes can have in memory.
+ *
+ * It describes formats by listing the contents of the memory passed to it.
+ * So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a
+ * byte each of red, green and blue. It is not endian-dependent, so
+ * CAIRO_FORMAT_ARGB32 is represented by different `GdkMemoryFormats`
+ * on architectures with different endiannesses.
+ *
+ * Its naming is modelled after
+ * [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat)
+ * for details).
+ */
+typedef enum {
+  GDK_MEMORY_B8G8R8A8_PREMULTIPLIED,
+  GDK_MEMORY_A8R8G8B8_PREMULTIPLIED,
+  GDK_MEMORY_R8G8B8A8_PREMULTIPLIED,
+  GDK_MEMORY_B8G8R8A8,
+  GDK_MEMORY_A8R8G8B8,
+  GDK_MEMORY_R8G8B8A8,
+  GDK_MEMORY_A8B8G8R8,
+  GDK_MEMORY_R8G8B8,
+  GDK_MEMORY_B8G8R8,
+  GDK_MEMORY_R16G16B16,
+  GDK_MEMORY_R16G16B16A16_PREMULTIPLIED,
+  GDK_MEMORY_R16G16B16A16,
+  GDK_MEMORY_R16G16B16_FLOAT,
+  GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED,
+  GDK_MEMORY_R16G16B16A16_FLOAT,
+  GDK_MEMORY_R32G32B32_FLOAT,
+  GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED,
+  GDK_MEMORY_R32G32B32A32_FLOAT,
+
+  GDK_MEMORY_N_FORMATS
+} GdkMemoryFormat;
+
 /*
  * GDK_DECLARE_INTERNAL_TYPE:
  * @ModuleObjName: The name of the new type, in camel case (like GtkWidget)