Mir
mir_window.h
Go to the documentation of this file.
1/*
2 * Copyright © 2017 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 2 or 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#ifndef MIR_TOOLKIT_MIR_WINDOW_H_
19#define MIR_TOOLKIT_MIR_WINDOW_H_
20
23#include <mir_toolkit/common.h>
26
27#include <stdbool.h>
28
29#ifdef __cplusplus
34extern "C" {
35#endif
36
50 int width, int height);
51
78 int width, int height,
79 MirWindow* parent,
80 MirRectangle* rect,
82
109 int width, int height,
110 MirWindow* parent,
111 MirRectangle* rect,
112 MirEdgeAttachment edge);
113
137 int width, int height,
138 MirWindow* parent);
139
157 int width, int height);
158
171 int width, int height);
172
183
195
206
217
230
240
248
267
280
291
302
315
328
338void mir_window_spec_set_min_width(MirWindowSpec* spec, unsigned min_width);
339
349void mir_window_spec_set_min_height(MirWindowSpec* spec, unsigned min_height);
350
360void mir_window_spec_set_max_width(MirWindowSpec* spec, unsigned max_width);
361
371void mir_window_spec_set_max_height(MirWindowSpec* spec, unsigned max_height);
372
385
398
408
418
439 MirWindowId* parent,
440 MirRectangle* attachment_rect,
441 MirEdgeAttachment edge);
442
452
466 MirRectangle const *rectangles,
467 size_t n_rects);
468
481 MirWindowEventCallback callback,
482 void* context);
483
492
502
527 const MirRectangle* rect,
528 MirPlacementGravity rect_gravity,
529 MirPlacementGravity window_gravity,
530 MirPlacementHints placement_hints,
531 int offset_dx,
532 int offset_dy);
533
540
556MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_connection_allocate_buffer/mir_render_surface_get_buffer_stream instead");
557
570#pragma GCC diagnostic push
571#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
573MIR_FOR_REMOVAL_IN_VERSION_1("No longer applicable, use mir_render_surface apis");
574#pragma GCC diagnostic pop
596 MirBufferStreamInfo* streams,
597 unsigned int num_streams)
598MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_add_render_surface instead");
599
606
615
627void mir_create_window(MirWindowSpec* requested_specification,
628 MirWindowCallback callback, void* context);
629
637
650 MirWindow* window,
651 MirWindowCallback callback,
652 void *context);
653
660
668
681 MirWindowEventCallback callback,
682 void* context);
683
698MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_add_render_surface during window creation/modification instead");
709
717#pragma GCC diagnostic push
718#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
719void mir_window_get_parameters(MirWindow* window, MirWindowParameters* parameters)
720MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get_xxx apis or listen to state/attribute change events instead");
721#pragma GCC diagnostic pop
722
723
730
738void mir_window_raise(MirWindow* window, MirCookie const* cookie);
739
748
758
765
772 MirWindowState state);
773
780
787
794
801
811#pragma GCC diagnostic push
812#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
813void mir_window_configure_cursor(MirWindow* window, MirCursorConfiguration const* parameters)
814MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name/mir_window_spec_set_cursor_render_surface instead");
815#pragma GCC diagnostic pop
824
831
845MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id() instead");
846void mir_window_request_window_id(MirWindow* window, MirWindowIdCallback callback, void* context);
847
855MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id_sync");
857#ifdef __cplusplus
858}
860#endif
861
862#endif /* MIR_TOOLKIT_MIR_WINDOW_H_ */
int width
Definition: client_types.h:1
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:17
char const * name
Definition: client_types.h:0
int height
Definition: client_types.h:2
#define MIR_FOR_REMOVAL_IN_VERSION_1(message)
Definition: deprecations.h:30
void mir_window_spec_set_max_aspect_ratio(MirWindowSpec *spec, unsigned width, unsigned height)
Set the maximum aspect ratio.
void mir_window_spec_set_pixel_format(MirWindowSpec *spec, MirPixelFormat format) MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_connection_allocate_buffer/mir_render_surface_get_buffer_stream instead")
Set the requested pixel format.
bool mir_window_spec_attach_to_foreign_parent(MirWindowSpec *spec, MirWindowId *parent, MirRectangle *attachment_rect, MirEdgeAttachment edge)
Request that the created window be attached to a window of a different client.
void mir_window_spec_set_type(MirWindowSpec *spec, MirWindowType type)
Update a window specification with a window type.
MirConnection * mir_window_get_connection(MirWindow *window)
Retrieve the connection.
void mir_window_spec_set_max_height(MirWindowSpec *spec, unsigned max_height)
Set the maximum height, in pixels.
void mir_window_apply_spec(MirWindow *window, MirWindowSpec *spec)
Request changes to the specification of a window.
void(* MirWindowEventCallback)(MirWindow *window, MirEvent const *event, void *context)
Callback for handling of window events.
Definition: client_types.h:120
MirWindowVisibility mir_window_get_visibility(MirWindow *window)
Query the visibility state for a window.
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:275
void mir_window_spec_set_pointer_confinement(MirWindowSpec *spec, MirPointerConfinementState state)
Attempts to set the pointer confinement spec for this window.
void mir_window_raise(MirWindow *window, MirCookie const *cookie)
Attempts to raise the window to the front.
void mir_window_spec_set_input_shape(MirWindowSpec *spec, MirRectangle const *rectangles, size_t n_rects)
Set a collection of input rectangles associated with the spec.
struct MirPersistentId MirWindowId
Definition: client_types.h:51
void mir_window_spec_set_buffer_usage(MirWindowSpec *spec, MirBufferUsage usage) MIR_FOR_REMOVAL_IN_VERSION_1("No longer applicable
MirResizeEdge
Hints for resizing a window.
Definition: common.h:413
MirWindowId * mir_window_request_window_id_sync(MirWindow *window)
MirOrientation mir_window_get_orientation(MirWindow *window)
Get the orientation of a window.
void mir_window_request_persistent_id(MirWindow *window, MirWindowIdCallback callback, void *context) MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id() instead")
Request an ID for the window that can be shared cross-process and across restarts.
bool mir_window_is_valid(MirWindow *window)
Test for a valid window.
MirWindowFocusState mir_window_get_focus_state(MirWindow *window)
Query the focus state for a window.
MirPointerConfinementState
Pointer Confinement.
Definition: common.h:470
void mir_window_spec_set_width(MirWindowSpec *spec, unsigned width)
Set the requested width, in pixels.
MirPersistentId * mir_window_request_persistent_id_sync(MirWindow *window) MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id_sync")
Request a persistent ID for a window and wait for the result.
MirOrientationMode mir_window_get_preferred_orientation(MirWindow *window)
Get the preferred orientation modes of a window.
MirWindowType mir_window_get_type(MirWindow *window)
Get the type (purpose) of a window.
void mir_window_set_state(MirWindow *window, MirWindowState state)
Change the state of a window.
MirWindowSpec * mir_create_utility_window_spec(MirConnection *connection, int width, int height)
Create a window specification for a utility window.
struct MirSurface MirWindow
Definition: client_types.h:43
void mir_window_spec_set_preferred_orientation(MirWindowSpec *spec, MirOrientationMode mode)
Set the requested preferred orientation mode.
void mir_window_set_preferred_orientation(MirWindow *window, MirOrientationMode orientation)
Request to set the preferred orientations of a window.
struct MirCookie MirCookie
Definition: event.h:82
MirWindowSpec * mir_create_dialog_window_spec(MirConnection *connection, int width, int height)
Create a window specification for a parentless dialog window.
MirWindowType
Definition: common.h:110
MirPixelFormat the EGL implementation will now set correct pixel format
Definition: mir_connection.h:350
MirShellChrome
Shell chrome.
Definition: common.h:458
void mir_create_window(MirWindowSpec *requested_specification, MirWindowCallback callback, void *context)
Create a window from a given specification.
void mir_window_spec_set_min_aspect_ratio(MirWindowSpec *spec, unsigned width, unsigned height)
Set the minimum aspect ratio.
void(* MirWindowIdCallback)(MirWindow *window, MirPersistentId *id, void *context)
Definition: client_types.h:176
void mir_window_spec_set_state(MirWindowSpec *spec, MirWindowState state)
Set the requested state.
void mir_window_spec_set_shell_chrome(MirWindowSpec *spec, MirShellChrome style)
Ask the shell to customize "chrome" for this window.
MirWindowFocusState
Definition: common.h:165
MirWindowState
Definition: common.h:142
MirWindowSpec * mir_create_menu_window_spec(MirConnection *connection, int width, int height, MirWindow *parent, MirRectangle *rect, MirEdgeAttachment edge)
Create a window specification for a menu window.
MirWindowSpec * mir_create_window_spec(MirConnection *connection)
Create a window specification.
int mir_window_get_dpi(MirWindow *window)
Query the DPI value of the window (dots per inch).
MirWindowSpec * mir_create_input_method_window_spec(MirConnection *connection, int width, int height)
Create a window specification for an input method window.
MirPlacementGravity
Reference point for aligning a surface relative to a rectangle.
Definition: common.h:318
void mir_window_spec_release(MirWindowSpec *spec)
Release the resources held by a MirWindowSpec.
void mir_window_spec_set_fullscreen_on_output(MirWindowSpec *spec, uint32_t output_id)
MirWindowSpec * mir_create_satellite_window_spec(MirConnection *connection, int width, int height, MirWindow *parent)
Create a window specification for a satellite window.
void mir_window_spec_set_event_handler(MirWindowSpec *spec, MirWindowEventCallback callback, void *context)
Set the event handler to be called when events arrive for a window.
struct MirSurfaceSpec MirWindowSpec
Definition: client_types.h:45
MirWindowSpec * mir_create_modal_dialog_window_spec(MirConnection *connection, int width, int height, MirWindow *parent)
Create a window specification for a modal dialog window.
void mir_window_spec_set_height(MirWindowSpec *spec, unsigned height)
Set the requested height, in pixels.
void mir_window_request_window_id(MirWindow *window, MirWindowIdCallback callback, void *context)
MirEdgeAttachment
Definition: common.h:305
void mir_window_release_sync(MirWindow *window)
Release the specified window like in mir_window_release(), but also wait for the operation to complet...
void use mir_render_surface apis
Definition: mir_window.h:573
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:245
MirWindowSpec * mir_create_tip_window_spec(MirConnection *connection, int width, int height, MirWindow *parent, MirRectangle *rect, MirEdgeAttachment edge)
Create a window specification for a tip window.
void mir_window_spec_set_name(MirWindowSpec *spec, char const *name)
Set the requested name.
MirPlacementHints
Positioning hints for aligning a window relative to a rectangle.
Definition: common.h:373
MirBufferStream * mir_window_get_buffer_stream(MirWindow *window) MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_add_render_surface during window creation/modification instead")
Retrieve the primary MirBufferStream associated with a window (to advance buffers,...
void mir_window_configure_cursor(MirWindow *window, MirCursorConfiguration const *parameters) MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_set_cursor_name/mir_window_spec_set_cursor_render_surface instead")
Choose the cursor state for a window: whether a cursor is shown, and which cursor if so.
void mir_window_spec_set_cursor_name(MirWindowSpec *spec, char const *name)
Set the name for the cursor from the system cursor theme.
MirWindowSpec * mir_create_normal_window_spec(MirConnection *connection, int width, int height)
Create a window specification for a normal window.
void mir_window_spec_set_width_increment(MirWindowSpec *spec, unsigned width_inc)
Set the requested width increment, in pixels.
void mir_window_spec_set_streams(MirWindowSpec *spec, MirBufferStreamInfo *streams, unsigned int num_streams) MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_spec_add_render_surface instead")
Set the streams associated with the spec.
void mir_window_release(MirWindow *window, MirWindowCallback callback, void *context)
Release the supplied window and any associated buffer.
void mir_window_spec_set_min_width(MirWindowSpec *spec, unsigned min_width)
Set the minimum width, in pixels.
void mir_window_request_user_resize(MirWindow *window, MirResizeEdge edge, MirCookie const *cookie)
Informs the window manager that the user is resizing the window.
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:186
MirWindow * mir_create_window_sync(MirWindowSpec *requested_specification)
Create a window from a given specification and wait for the result.
struct MirBufferStream MirBufferStream
Definition: client_types.h:49
MirWindowVisibility
Definition: common.h:177
void(* MirWindowCallback)(MirWindow *window, void *client_context)
Callback to be passed when calling window functions :
Definition: client_types.h:100
struct MirConnection MirConnection
Definition: client_types.h:41
void mir_window_get_parameters(MirWindow *window, MirWindowParameters *parameters) MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_get_xxx apis or listen to state/attribute change events instead")
Get a window's parameters.
void mir_window_set_event_handler(MirWindow *window, MirWindowEventCallback callback, void *context)
Set the event handler to be called when events arrive for a window.
void mir_window_spec_set_min_height(MirWindowSpec *spec, unsigned min_height)
Set the minimum height, in pixels.
void mir_window_spec_set_height_increment(MirWindowSpec *spec, unsigned height_inc)
Set the requested height increment, in pixels Defines an arithmetic progression of sizes starting wit...
MirWindowSpec * mir_create_freestyle_window_spec(MirConnection *connection, int width, int height)
Create a window specification for a freestyle window.
MirWindowSpec * mir_create_gloss_window_spec(MirConnection *connection, int width, int height)
Create a window specification for a gloss window.
void mir_window_spec_set_parent(MirWindowSpec *spec, MirWindow *parent)
Set the requested parent.
MirWindowState mir_window_get_state(MirWindow *window)
Get the current state of a window.
char const * mir_window_get_error_message(MirWindow *window)
Retrieve a text description of the error.
void mir_window_spec_set_max_width(MirWindowSpec *spec, unsigned max_width)
Set the maximum width, in pixels.
MirOrientationMode
Definition: common.h:291
void mir_window_request_user_move(MirWindow *window, MirCookie const *cookie)
Informs the window manager that the user is moving the window.
void mir_window_spec_set_placement(MirWindowSpec *spec, const MirRectangle *rect, MirPlacementGravity rect_gravity, MirPlacementGravity window_gravity, MirPlacementHints placement_hints, int offset_dx, int offset_dy)
Set the window placement on the spec.
The displacement from the top-left corner of the surface.
Definition: client_types.h:392
Definition: client_types.h:399

Copyright © 2012-2022 Canonical Ltd.
Generated on Sat 3 Dec 14:36:51 UTC 2022
This documentation is licensed under the GPL version 2 or 3.