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 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
30 
34 extern "C" {
35 #endif
36 
50  int width, int height);
51 
78  int width, int height,
79  MirWindow* parent,
80  MirRectangle* rect,
81  MirEdgeAttachment edge);
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 
186 
194 
213 
225 void mir_window_spec_set_name(MirWindowSpec* spec, char const* name);
226 
236 void mir_window_spec_set_width(MirWindowSpec* spec, unsigned width);
237 
247 void mir_window_spec_set_height(MirWindowSpec* spec, unsigned height);
248 
260 void mir_window_spec_set_width_increment(MirWindowSpec* spec, unsigned width_inc);
261 
273 void mir_window_spec_set_height_increment(MirWindowSpec* spec, unsigned height_inc);
274 
284 void mir_window_spec_set_min_width(MirWindowSpec* spec, unsigned min_width);
285 
295 void mir_window_spec_set_min_height(MirWindowSpec* spec, unsigned min_height);
296 
306 void mir_window_spec_set_max_width(MirWindowSpec* spec, unsigned max_width);
307 
317 void mir_window_spec_set_max_height(MirWindowSpec* spec, unsigned max_height);
318 
330 void mir_window_spec_set_min_aspect_ratio(MirWindowSpec* spec, unsigned width, unsigned height);
331 
343 void mir_window_spec_set_max_aspect_ratio(MirWindowSpec* spec, unsigned width, unsigned height);
344 
354 
364 
385  MirWindowId* parent,
386  MirRectangle* attachment_rect,
387  MirEdgeAttachment edge);
388 
398 
412  MirRectangle const *rectangles,
413  size_t n_rects);
414 
427  MirWindowEventCallback callback,
428  void* context);
429 
438 
448 
473  const MirRectangle* rect,
474  MirPlacementGravity rect_gravity,
475  MirPlacementGravity window_gravity,
476  MirPlacementHints placement_hints,
477  int offset_dx,
478  int offset_dy);
479 
485 void mir_window_spec_set_cursor_name(MirWindowSpec* spec, char const* name);
486 
499 
512 
534  MirBufferStreamInfo* streams,
535  unsigned int num_streams);
536 
553 #pragma GCC diagnostic push
554 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
556  MirRenderSurface* render_surface,
557  int logical_width, int logical_height,
558  int displacement_x, int displacement_y)
559 MIR_FOR_REMOVAL_IN_VERSION_1("This function is slated for rename due to MirRenderSurface-->MirSurface transition");
560 #pragma GCC diagnostic pop
561 
568 
576 void mir_window_apply_spec(MirWindow* window, MirWindowSpec* spec);
577 
589 void mir_create_window(MirWindowSpec* requested_specification,
590  MirWindowCallback callback, void* context);
591 
598 MirWindow* mir_create_window_sync(MirWindowSpec* requested_specification);
599 
611 void mir_window_release(
612  MirWindow* window,
613  MirWindowCallback callback,
614  void *context);
615 
621 void mir_window_release_sync(MirWindow* window);
622 
629 bool mir_window_is_valid(MirWindow* window);
630 
643  MirWindowEventCallback callback,
644  void* context);
645 
660 
670 char const* mir_window_get_error_message(MirWindow* window);
671 
678 void mir_window_get_parameters(MirWindow* window, MirWindowParameters* parameters);
679 
686 
694 void mir_window_raise(MirWindow* window, MirCookie const* cookie);
695 
702 
708 void mir_window_set_state(MirWindow* window,
709  MirWindowState state);
710 
717 
724 
731 
737 int mir_window_get_dpi(MirWindow* window);
738 
747 void mir_window_configure_cursor(MirWindow* window, MirCursorConfiguration const* parameters);
748 
757 
764 
777 void mir_window_request_persistent_id(MirWindow* window, MirWindowIdCallback callback, void* context)
778 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id() instead");
779 void mir_window_request_window_id(MirWindow* window, MirWindowIdCallback callback, void* context);
780 
787 MirPersistentId* mir_window_request_persistent_id_sync(MirWindow* window)
788 MIR_FOR_REMOVAL_IN_VERSION_1("Use mir_window_request_window_id_sync");
790 #ifdef __cplusplus
791 }
793 #endif
794 
795 #endif /* MIR_TOOLKIT_MIR_WINDOW_H_ */
void mir_window_spec_set_pixel_format(MirWindowSpec *spec, MirPixelFormat format)
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_width(MirWindowSpec *spec, unsigned min_width)
Set the minimum width, in pixels.
struct MirSurface MirWindow
Definition: client_types.h:43
void mir_window_get_parameters(MirWindow *window, MirWindowParameters *parameters)
Get a window&#39;s parameters.
void mir_create_window(MirWindowSpec *requested_specification, MirWindowCallback callback, void *context)
Create a window from a given specification.
struct MirBufferStream MirBufferStream
Definition: client_types.h:49
struct MirCursorConfiguration MirCursorConfiguration
Opaque structure containing cursor parameterization.
Definition: mir_cursor_configuration.h:29
void mir_window_spec_set_max_aspect_ratio(MirWindowSpec *spec, unsigned width, unsigned height)
Set the maximum aspect ratio.
struct MirPersistentId MirWindowId
Definition: client_types.h:51
void mir_window_spec_set_min_height(MirWindowSpec *spec, unsigned min_height)
Set the minimum height, in pixels.
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_width_increment(MirWindowSpec *spec, unsigned width_inc)
Set the requested width increment, in pixels.
MirPlacementHints
Positioning hints for aligning a window relative to a rectangle.
Definition: common.h:369
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.
void mir_window_spec_set_width(MirWindowSpec *spec, unsigned width)
Set the requested width, in pixels.
void mir_window_spec_set_cursor_name(MirWindowSpec *spec, char const *name)
Set the name for the cursor from the system cursor theme.
MirWindowType mir_window_get_type(MirWindow *window)
Get the type (purpose) of a window.
MirWindowFocusState
Definition: common.h:161
#define MIR_FOR_REMOVAL_IN_VERSION_1(message)
Definition: deprecations.h:30
MirWindowVisibility
Definition: common.h:173
The displacement from the top-left corner of the surface.
Definition: client_types.h:380
MirPointerConfinementState
Pointer Confinement.
Definition: common.h:446
int mir_window_get_dpi(MirWindow *window)
Query the DPI value of the window (dots per inch).
MirOrientationMode mir_window_get_preferred_orientation(MirWindow *window)
Get the preferred orientation modes of a window.
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.
void mir_window_spec_set_max_width(MirWindowSpec *spec, unsigned max_width)
Set the maximum width, in pixels.
unsigned int height
Definition: mir_image.h:27
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.
MirWindowState mir_window_get_state(MirWindow *window)
Get the current state of a window.
void mir_window_spec_set_fullscreen_on_output(MirWindowSpec *spec, uint32_t output_id)
void mir_window_request_window_id(MirWindow *window, MirWindowIdCallback callback, void *context)
MirBufferStream * mir_window_get_buffer_stream(MirWindow *window)
Retrieve the primary MirBufferStream associated with a window (to advance buffers, obtain EGLNativeWindow, etc...)
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:271
MirWindowSpec * mir_create_window_spec(MirConnection *connection)
Create a window specification.
void(* MirWindowCallback)(MirWindow *window, void *client_context)
Callback to be passed when calling window functions :
Definition: client_types.h:93
void mir_window_spec_set_max_height(MirWindowSpec *spec, unsigned max_height)
Set the maximum height, in pixels.
void mir_window_raise(MirWindow *window, MirCookie const *cookie)
Attempts to raise the window to the front.
MirWindowSpec * mir_create_normal_window_spec(MirConnection *connection, int width, int height)
Create a window specification for a normal window.
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.
MirWindow * mir_create_window_sync(MirWindowSpec *requested_specification)
Create a window from a given specification and wait for the result.
unsigned int width
Definition: mir_image.h:26
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.
void mir_window_spec_set_height(MirWindowSpec *spec, unsigned height)
Set the requested height, in pixels.
MirWindowSpec * mir_create_input_method_window_spec(MirConnection *connection, int width, int height)
Create a window specification for an input method window.
void mir_window_apply_spec(MirWindow *window, MirWindowSpec *spec)
Request changes to the specification of a 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.
void mir_window_spec_set_type(MirWindowSpec *spec, MirWindowType type)
Update a window specification with a window type.
struct MirConnection MirConnection
Definition: client_types.h:41
void(* MirWindowIdCallback)(MirWindow *window, MirPersistentId *id, void *context)
Definition: client_types.h:169
MirWindowType
Definition: common.h:109
void mir_window_spec_set_pointer_confinement(MirWindowSpec *spec, MirPointerConfinementState state)
Attempts to set the pointer confinement spec for this window.
bool mir_window_is_valid(MirWindow *window)
Test for a valid window.
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...
struct MirCookie MirCookie
Definition: event.h:82
void mir_window_spec_set_state(MirWindowSpec *spec, MirWindowState state)
Set the requested state.
MirBufferUsage
MirBufferUsage specifies how a surface can and will be used.
Definition: client_types.h:178
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.
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:241
struct MirSurfaceSpec MirWindowSpec
Definition: client_types.h:45
MirWindowSpec * mir_create_dialog_window_spec(MirConnection *connection, int width, int height)
Create a window specification for a parentless dialog window.
MirOrientation mir_window_get_orientation(MirWindow *window)
Get the orientation of a window.
MirWindowFocusState mir_window_get_focus_state(MirWindow *window)
Query the focus state for a window.
void mir_window_spec_release(MirWindowSpec *spec)
Release the resources held by a MirWindowSpec.
void mir_window_set_preferred_orientation(MirWindow *window, MirOrientationMode orientation)
Request to set the preferred orientations of a window.
void mir_window_spec_set_min_aspect_ratio(MirWindowSpec *spec, unsigned width, unsigned height)
Set the minimum aspect ratio.
MirShellChrome
Shell chrome.
Definition: common.h:434
void mir_window_configure_cursor(MirWindow *window, MirCursorConfiguration const *parameters)
Choose the cursor state for a window: whether a cursor is shown, and which cursor if so...
void mir_window_spec_set_preferred_orientation(MirWindowSpec *spec, MirOrientationMode mode)
Set the requested preferred orientation mode.
void mir_window_spec_set_buffer_usage(MirWindowSpec *spec, MirBufferUsage usage)
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(* MirWindowEventCallback)(MirWindow *window, MirEvent const *event, void *context)
Callback for handling of window events.
Definition: client_types.h:113
char const * name
Definition: client_types.h:170
MirWindowId * mir_window_request_window_id_sync(MirWindow *window)
void mir_window_release(MirWindow *window, MirWindowCallback callback, void *context)
Release the supplied window and any associated buffer.
Definition: client_types.h:387
void mir_window_spec_set_parent(MirWindowSpec *spec, MirWindow *parent)
Set the requested parent.
MirWindowVisibility mir_window_get_visibility(MirWindow *window)
Query the visibility state for a window.
void mir_window_spec_set_shell_chrome(MirWindowSpec *spec, MirShellChrome style)
Ask the shell to customize "chrome" for this 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.
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:183
void mir_window_spec_add_render_surface(MirWindowSpec *spec, MirRenderSurface *render_surface, int logical_width, int logical_height, int displacement_x, int displacement_y) MIR_FOR_REMOVAL_IN_VERSION_1("This function is slated for rename due to MirRenderSurface- -> MirSurface transition")
Set the MirWindowSpec to display content contained in a render surface.
MirOrientationMode
Definition: common.h:287
MirWindowState
Definition: common.h:139
void mir_window_spec_set_streams(MirWindowSpec *spec, MirBufferStreamInfo *streams, unsigned int num_streams)
char const * mir_window_get_error_message(MirWindow *window)
Retrieve a text description of the error.
void mir_window_spec_set_name(MirWindowSpec *spec, char const *name)
Set the requested name.
struct MirRenderSurface MirRenderSurface
Definition: client_types.h:57
void mir_window_set_state(MirWindow *window, MirWindowState state)
Change the state of a window.
MirWindowParameters is the structure of minimum required information that you must provide to Mir in ...
Definition: client_types.h:188
MirPlacementGravity
Reference point for aligning a surface relative to a rectangle.
Definition: common.h:314
MirEdgeAttachment
Definition: common.h:301

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Jun 5 11:07:25 UTC 2017