[gtk/wip/otte/for-master: 2/2] gdk: Move GdkMemoryFormat enum to gdktypes.h




commit 7a50ebaa3f4cbc48b7036ffb95d19a67b7110a8e
Author: Benjamin Otte <otte redhat com>
Date:   Sat Oct 16 13:35:50 2021 +0200

    gdk: Move GdkMemoryFormat enum to gdktypes.h
    
    It's used in too many places now.

 gdk/gdkglcontextprivate.h    |  1 -
 gdk/gdkmemoryformatprivate.h |  2 +-
 gdk/gdkmemorytexture.h       | 72 --------------------------------------------
 gdk/gdktextureprivate.h      |  2 --
 gdk/gdktypes.h               | 72 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 73 insertions(+), 76 deletions(-)
---
diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h
index 6814fec0bf..56fe04f903 100644
--- a/gdk/gdkglcontextprivate.h
+++ b/gdk/gdkglcontextprivate.h
@@ -23,7 +23,6 @@
 
 #include "gdkglcontext.h"
 #include "gdkdrawcontextprivate.h"
-#include "gdkmemorytexture.h"
 
 G_BEGIN_DECLS
 
diff --git a/gdk/gdkmemoryformatprivate.h b/gdk/gdkmemoryformatprivate.h
index 344e47fade..bdcb2265e6 100644
--- a/gdk/gdkmemoryformatprivate.h
+++ b/gdk/gdkmemoryformatprivate.h
@@ -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
 
diff --git a/gdk/gdkmemorytexture.h b/gdk/gdkmemorytexture.h
index 0c574d7add..8f2fb5299c 100644
--- a/gdk/gdkmemorytexture.h
+++ b/gdk/gdkmemorytexture.h
@@ -28,78 +28,6 @@
 
 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:
  *
diff --git a/gdk/gdktextureprivate.h b/gdk/gdktextureprivate.h
index a9e6ac51a2..d9579f4657 100644
--- a/gdk/gdktextureprivate.h
+++ b/gdk/gdktextureprivate.h
@@ -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))
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 77059797da..9fdf2c11bd 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -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)


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