2023-02-09 02:06:08 +00:00
|
|
|
/*
|
|
|
|
* mks-screen.h
|
|
|
|
*
|
|
|
|
* Copyright 2023 Christian Hergert <chergert@redhat.com>
|
|
|
|
*
|
2023-06-02 17:01:16 +00:00
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
* License, or (at your option) any later version.
|
2023-02-09 02:06:08 +00:00
|
|
|
*
|
2023-06-02 17:01:16 +00:00
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
2023-02-09 02:06:08 +00:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
2023-06-01 11:04:35 +00:00
|
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
2023-02-09 02:06:08 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-02-09 10:21:29 +00:00
|
|
|
#if !defined(MKS_INSIDE) && !defined(MKS_COMPILATION)
|
|
|
|
# error "Only <libmks.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2023-02-10 01:32:00 +00:00
|
|
|
#include <gdk/gdk.h>
|
2023-02-09 23:39:03 +00:00
|
|
|
#include <gio/gio.h>
|
2023-02-09 02:06:08 +00:00
|
|
|
|
2023-02-09 10:23:18 +00:00
|
|
|
#include "mks-types.h"
|
|
|
|
#include "mks-version-macros.h"
|
2023-02-09 02:06:08 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2023-02-09 10:23:18 +00:00
|
|
|
#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;
|
2023-02-09 02:06:08 +00:00
|
|
|
|
2023-05-23 10:24:33 +00:00
|
|
|
/**
|
|
|
|
* MksScreenKind:
|
|
|
|
* @MKS_SCREEN_KIND_TEXT: A text only screen.
|
|
|
|
* @MKS_SCREEN_KIND_GRAPHIC: A graphical screen.
|
|
|
|
*
|
|
|
|
* A screen kind.
|
|
|
|
*/
|
2023-02-09 05:58:35 +00:00
|
|
|
typedef enum _MksScreenKind
|
|
|
|
{
|
|
|
|
MKS_SCREEN_KIND_TEXT = 0,
|
|
|
|
MKS_SCREEN_KIND_GRAPHIC = 1,
|
|
|
|
} MksScreenKind;
|
|
|
|
|
2023-02-09 02:06:08 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 11:21:43 +00:00
|
|
|
GType mks_screen_get_type (void) G_GNUC_CONST;
|
2023-02-09 05:58:35 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 23:39:03 +00:00
|
|
|
MksScreenKind mks_screen_get_kind (MksScreen *self);
|
2023-02-09 05:58:35 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 23:39:03 +00:00
|
|
|
MksKeyboard *mks_screen_get_keyboard (MksScreen *self);
|
2023-02-09 05:58:35 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 23:39:03 +00:00
|
|
|
MksMouse *mks_screen_get_mouse (MksScreen *self);
|
2023-02-09 07:21:06 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-06-15 11:48:55 +00:00
|
|
|
MksTouchable *mks_screen_get_touchable (MksScreen *self);
|
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 23:39:03 +00:00
|
|
|
guint mks_screen_get_width (MksScreen *self);
|
2023-02-09 07:21:06 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 23:39:03 +00:00
|
|
|
guint mks_screen_get_height (MksScreen *self);
|
2023-02-09 07:26:35 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 23:39:03 +00:00
|
|
|
guint mks_screen_get_number (MksScreen *self);
|
2023-02-09 11:21:43 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-09 23:39:03 +00:00
|
|
|
const char *mks_screen_get_device_address (MksScreen *self);
|
|
|
|
MKS_AVAILABLE_IN_ALL
|
|
|
|
void mks_screen_configure (MksScreen *self,
|
|
|
|
MksScreenAttributes *attributes,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
MKS_AVAILABLE_IN_ALL
|
|
|
|
gboolean mks_screen_configure_finish (MksScreen *self,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
|
|
|
MKS_AVAILABLE_IN_ALL
|
|
|
|
gboolean mks_screen_configure_sync (MksScreen *self,
|
|
|
|
MksScreenAttributes *attributes,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GError **error);
|
2023-02-10 01:32:00 +00:00
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-10 18:29:29 +00:00
|
|
|
void mks_screen_attach (MksScreen *self,
|
2023-10-02 14:51:17 +00:00
|
|
|
GdkDisplay *display,
|
2023-02-10 01:32:00 +00:00
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
MKS_AVAILABLE_IN_ALL
|
|
|
|
GdkPaintable *mks_screen_attach_finish (MksScreen *self,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
|
|
|
MKS_AVAILABLE_IN_ALL
|
2023-02-10 18:29:29 +00:00
|
|
|
GdkPaintable *mks_screen_attach_sync (MksScreen *self,
|
2023-10-02 14:51:17 +00:00
|
|
|
GdkDisplay *display,
|
2023-02-10 01:32:00 +00:00
|
|
|
GCancellable *cancellable,
|
|
|
|
GError **error);
|
2023-02-09 05:58:35 +00:00
|
|
|
|
2023-02-09 10:23:18 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MksScreen, g_object_unref)
|
|
|
|
|
2023-02-09 02:06:08 +00:00
|
|
|
G_END_DECLS
|