qemu-block
[Top][All Lists]
Advanced

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

[Qemu-block] [RFC PATCH 15/15] ui/console: Add "ui/pixelformat.h" to dec


From: Philippe Mathieu-Daudé
Subject: [Qemu-block] [RFC PATCH 15/15] ui/console: Add "ui/pixelformat.h" to declare PixelFormat
Date: Fri, 11 Jan 2019 15:08:57 +0100

PixelFormat is used by "ui/console.h" and by "ui/qemu-pixman.h".

Create the new header "ui/pixelformat.h" to declare this structure,
and remove the forward declaration from "qemu/typedefs.h".

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
RFC because "ui/console.h" has on license, so I added a default one.
---
 include/qemu/typedefs.h  |  1 -
 include/ui/console.h     | 11 +----------
 include/ui/pixelformat.h | 31 +++++++++++++++++++++++++++++++
 include/ui/qemu-pixman.h |  2 ++
 4 files changed, 34 insertions(+), 11 deletions(-)
 create mode 100644 include/ui/pixelformat.h

diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index af0dc6e065..b0f33aa065 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -67,7 +67,6 @@ typedef struct PCIExpressHost PCIExpressHost;
 typedef struct PCIHostDeviceAddress PCIHostDeviceAddress;
 typedef struct PCIHostState PCIHostState;
 typedef struct PCMachineState PCMachineState;
-typedef struct PixelFormat PixelFormat;
 typedef struct PostcopyDiscardState PostcopyDiscardState;
 typedef struct Property Property;
 typedef struct PropertyInfo PropertyInfo;
diff --git a/include/ui/console.h b/include/ui/console.h
index aa9f975544..4fa2fa5c47 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -2,6 +2,7 @@
 #define CONSOLE_H
 
 #include "ui/qemu-pixman.h"
+#include "ui/pixelformat.h"
 #include "qom/object.h"
 #include "qemu/notify.h"
 #include "qemu/error-report.h"
@@ -121,16 +122,6 @@ struct QemuConsoleClass {
 
 #define QEMU_ALLOCATED_FLAG     0x01
 
-struct PixelFormat {
-    uint8_t bits_per_pixel;
-    uint8_t bytes_per_pixel;
-    uint8_t depth; /* color depth in bits */
-    uint32_t rmask, gmask, bmask, amask;
-    uint8_t rshift, gshift, bshift, ashift;
-    uint8_t rmax, gmax, bmax, amax;
-    uint8_t rbits, gbits, bbits, abits;
-};
-
 typedef struct DisplaySurface {
     pixman_format_code_t format;
     pixman_image_t *image;
diff --git a/include/ui/pixelformat.h b/include/ui/pixelformat.h
new file mode 100644
index 0000000000..585097531f
--- /dev/null
+++ b/include/ui/pixelformat.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2019 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef QEMU_PIXELFORMAT_H
+#define QEMU_PIXELFORMAT_H
+
+typedef struct PixelFormat {
+    uint8_t bits_per_pixel;
+    uint8_t bytes_per_pixel;
+    uint8_t depth; /* color depth in bits */
+    uint32_t rmask, gmask, bmask, amask;
+    uint8_t rshift, gshift, bshift, ashift;
+    uint8_t rmax, gmax, bmax, amax;
+    uint8_t rbits, gbits, bbits, abits;
+} PixelFormat;
+
+#endif
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index b7c82d17fc..999a4aa770 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -16,6 +16,8 @@
 #pragma GCC diagnostic pop
 #endif
 
+#include "ui/pixelformat.h"
+
 /*
  * pixman image formats are defined to be native endian,
  * that means host byte order on qemu.  So we go define
-- 
2.17.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]