mirror of
https://gitlab.gnome.org/GNOME/libmks.git
synced 2024-10-01 03:25:45 +00:00
4d110d5791
We want to use the vfunc of the class to implement devices coming from a Qemu object on D-Bus, but we don't want to expose that in public API. Instead, we can keep the object instance and class internal but still expose the subclasses as public API. We have to do old-style class definitions to do that, but worth the ability to keep public API limited so that we can make changes later.
69 lines
2.4 KiB
C
69 lines
2.4 KiB
C
/*
|
|
* mks-screen.h
|
|
*
|
|
* Copyright 2023 Christian Hergert <chergert@redhat.com>
|
|
*
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#if !defined(MKS_INSIDE) && !defined(MKS_COMPILATION)
|
|
# error "Only <libmks.h> can be included directly."
|
|
#endif
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include "mks-types.h"
|
|
#include "mks-version-macros.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define MKS_TYPE_SCREEN (mks_screen_get_type ())
|
|
#define MKS_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MKS_TYPE_SCREEN, MksScreen))
|
|
#define MKS_SCREEN_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MKS_TYPE_SCREEN, MksScreen const))
|
|
#define MKS_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MKS_TYPE_SCREEN, MksScreenClass))
|
|
#define MKS_IS_SCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MKS_TYPE_SCREEN))
|
|
#define MKS_IS_SCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MKS_TYPE_SCREEN))
|
|
#define MKS_SCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MKS_TYPE_SCREEN, MksScreenClass))
|
|
|
|
typedef struct _MksScreenClass MksScreenClass;
|
|
|
|
typedef enum _MksScreenKind
|
|
{
|
|
MKS_SCREEN_KIND_TEXT = 0,
|
|
MKS_SCREEN_KIND_GRAPHIC = 1,
|
|
} MksScreenKind;
|
|
|
|
MKS_AVAILABLE_IN_ALL
|
|
GType mks_screen_get_type (void) G_GNUC_CONST;
|
|
MKS_AVAILABLE_IN_ALL
|
|
MksScreenKind mks_screen_get_kind (MksScreen *self);
|
|
MKS_AVAILABLE_IN_ALL
|
|
MksKeyboard *mks_screen_get_keyboard (MksScreen *self);
|
|
MKS_AVAILABLE_IN_ALL
|
|
MksMouse *mks_screen_get_mouse (MksScreen *self);
|
|
MKS_AVAILABLE_IN_ALL
|
|
guint mks_screen_get_width (MksScreen *self);
|
|
MKS_AVAILABLE_IN_ALL
|
|
guint mks_screen_get_height (MksScreen *self);
|
|
MKS_AVAILABLE_IN_ALL
|
|
guint mks_screen_get_number (MksScreen *self);
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MksScreen, g_object_unref)
|
|
|
|
G_END_DECLS
|