libmks/lib/mks-screen-attributes.h
Christian Hergert 9bb71b8ea8 lib: add MksScreenAttributes and mks_screen_configure()
MksScreenAttributes is an opaque type with setters so that we can
potentially extend it in the future without ABI issues.

Furthermore, this adds a configure API for both sync and async to
MksScreen.

Currently, I get NOT_SUPPORTED back from Qemu, but I think that's because
I'm not even past the bootloader/EFI stage for tests.
2023-02-09 15:39:03 -08:00

67 lines
2.7 KiB
C

/*
* mks-screen-attributes.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_ATTRIBUTES (mks_screen_attributes_get_type ())
MKS_AVAILABLE_IN_ALL
GType mks_screen_attributes_get_type (void) G_GNUC_CONST;
MKS_AVAILABLE_IN_ALL
MksScreenAttributes *mks_screen_attributes_new (void);
MKS_AVAILABLE_IN_ALL
MksScreenAttributes *mks_screen_attributes_copy (MksScreenAttributes *self);
MKS_AVAILABLE_IN_ALL
void mks_screen_attributes_free (MksScreenAttributes *self);
MKS_AVAILABLE_IN_ALL
void mks_screen_attributes_set_width_mm (MksScreenAttributes *self,
guint16 width_mm);
MKS_AVAILABLE_IN_ALL
void mks_screen_attributes_set_height_mm (MksScreenAttributes *self,
guint16 height_mm);
MKS_AVAILABLE_IN_ALL
void mks_screen_attributes_set_x_offset (MksScreenAttributes *self,
int x_offset);
MKS_AVAILABLE_IN_ALL
void mks_screen_attributes_set_y_offset (MksScreenAttributes *self,
int y_offset);
MKS_AVAILABLE_IN_ALL
void mks_screen_attributes_set_width (MksScreenAttributes *self,
guint width);
MKS_AVAILABLE_IN_ALL
void mks_screen_attributes_set_height (MksScreenAttributes *self,
guint height);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MksScreenAttributes, mks_screen_attributes_free)
G_END_DECLS