[mutter] native: Add abstract MetaOutputNative object
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] native: Add abstract MetaOutputNative object
- Date: Fri, 12 Mar 2021 15:43:43 +0000 (UTC)
commit fd4ea67b27aed07fcab1f498fbcd879dc1876834
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Dec 17 22:31:28 2020 +0100
native: Add abstract MetaOutputNative object
MetaOutputKms is made to inherit from this, but it doesn't do anything
special yet.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
src/backends/native/meta-output-kms.c | 4 ++--
src/backends/native/meta-output-kms.h | 3 ++-
src/backends/native/meta-output-native.c | 35 ++++++++++++++++++++++++++++++++
src/backends/native/meta-output-native.h | 35 ++++++++++++++++++++++++++++++++
src/meson.build | 2 ++
5 files changed, 76 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c
index d9055bb3ff..b976c116da 100644
--- a/src/backends/native/meta-output-kms.c
+++ b/src/backends/native/meta-output-kms.c
@@ -41,12 +41,12 @@
struct _MetaOutputKms
{
- MetaOutput parent;
+ MetaOutputNative parent;
MetaKmsConnector *kms_connector;
};
-G_DEFINE_TYPE (MetaOutputKms, meta_output_kms, META_TYPE_OUTPUT)
+G_DEFINE_TYPE (MetaOutputKms, meta_output_kms, META_TYPE_OUTPUT_NATIVE)
MetaKmsConnector *
meta_output_kms_get_kms_connector (MetaOutputKms *output_kms)
diff --git a/src/backends/native/meta-output-kms.h b/src/backends/native/meta-output-kms.h
index da7b001854..f6443efa40 100644
--- a/src/backends/native/meta-output-kms.h
+++ b/src/backends/native/meta-output-kms.h
@@ -26,11 +26,12 @@
#include "backends/meta-output.h"
#include "backends/native/meta-gpu-kms.h"
#include "backends/native/meta-kms-types.h"
+#include "backends/native/meta-output-native.h"
#define META_TYPE_OUTPUT_KMS (meta_output_kms_get_type ())
G_DECLARE_FINAL_TYPE (MetaOutputKms, meta_output_kms,
META, OUTPUT_KMS,
- MetaOutput)
+ MetaOutputNative)
void meta_output_kms_set_power_save_mode (MetaOutputKms *output_kms,
uint64_t dpms_state,
diff --git a/src/backends/native/meta-output-native.c b/src/backends/native/meta-output-native.c
new file mode 100644
index 0000000000..102c815280
--- /dev/null
+++ b/src/backends/native/meta-output-native.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 Red Hat
+ *
+ * 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 of the
+ * License, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "backends/native/meta-output-native.h"
+
+G_DEFINE_ABSTRACT_TYPE (MetaOutputNative, meta_output_native,
+ META_TYPE_OUTPUT)
+
+static void
+meta_output_native_init (MetaOutputNative *output_native)
+{
+}
+
+static void
+meta_output_native_class_init (MetaOutputNativeClass *klass)
+{
+}
diff --git a/src/backends/native/meta-output-native.h b/src/backends/native/meta-output-native.h
new file mode 100644
index 0000000000..a93cbfd7f7
--- /dev/null
+++ b/src/backends/native/meta-output-native.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 Red Hat
+ *
+ * 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 of the
+ * License, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef META_OUTPUT_NATIVE_H
+#define META_OUTPUT_NATIVE_H
+
+#include "backends/meta-output.h"
+
+#define META_TYPE_OUTPUT_NATIVE (meta_output_native_get_type ())
+G_DECLARE_DERIVABLE_TYPE (MetaOutputNative, meta_output_native,
+ META, OUTPUT_NATIVE,
+ MetaOutput)
+
+struct _MetaOutputNativeClass
+{
+ MetaOutputClass parent_class;
+};
+
+#endif /* META_OUTPUT_NATIVE_H */
diff --git a/src/meson.build b/src/meson.build
index 30a0853259..705a704070 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -674,6 +674,8 @@ if have_native_backend
'backends/native/meta-monitor-manager-native.h',
'backends/native/meta-output-kms.c',
'backends/native/meta-output-kms.h',
+ 'backends/native/meta-output-native.c',
+ 'backends/native/meta-output-native.h',
'backends/native/meta-kms-connector-private.h',
'backends/native/meta-kms-connector.c',
'backends/native/meta-kms-connector.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]