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>
25 
26 #include <stdbool.h>
27 
28 #ifdef __cplusplus
29 
33 extern "C" {
34 #endif
35 
49  int width, int height);
50 
77  int width, int height,
78  MirWindow* parent,
79  MirRectangle* rect,
80  MirEdgeAttachment edge);
81 
108  int width, int height,
109  MirWindow* parent,
110  MirRectangle* rect,
111  MirEdgeAttachment edge);
112 
136  int width, int height,
137  MirWindow* parent);
138 
156  int width, int height);
157 
170  int width, int height);
171 
185 
193 
212 
224 void mir_window_spec_set_name(MirWindowSpec* spec, char const* name);
225 
235 void mir_window_spec_set_width(MirWindowSpec* spec, unsigned width);
236 
246 void mir_window_spec_set_height(MirWindowSpec* spec, unsigned height);
247 
259 void mir_window_spec_set_width_increment(MirWindowSpec* spec, unsigned width_inc);
260 
272 void mir_window_spec_set_height_increment(MirWindowSpec* spec, unsigned height_inc);
273 
283 void mir_window_spec_set_min_width(MirWindowSpec* spec, unsigned min_width);
284 
294 void mir_window_spec_set_min_height(MirWindowSpec* spec, unsigned min_height);
295 
305 void mir_window_spec_set_max_width(MirWindowSpec* spec, unsigned max_width);
306 
316 void mir_window_spec_set_max_height(MirWindowSpec* spec, unsigned max_height);
317 
329 void mir_window_spec_set_min_aspect_ratio(MirWindowSpec* spec, unsigned width, unsigned height);
330 
342 void mir_window_spec_set_max_aspect_ratio(MirWindowSpec* spec, unsigned width, unsigned height);
343 
353 
363 
384  MirWindowId* parent,
385  MirRectangle* attachment_rect,
386  MirEdgeAttachment edge);
387 
397 
411  MirRectangle const *rectangles,
412  size_t n_rects);
413 
426  MirWindowEventCallback callback,
427  void* context);
428 
437 
447 
472  const MirRectangle* rect,
473  MirPlacementGravity rect_gravity,
474  MirPlacementGravity window_gravity,
475  MirPlacementHints placement_hints,
476  int offset_dx,
477  int offset_dy);
478 
484 void mir_window_spec_set_cursor_name(MirWindowSpec* spec, char const* name);
485 
498 
511 
533  MirBufferStreamInfo* streams,
534  unsigned int num_streams);
535 
552 #pragma GCC diagnostic push
553 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
555  MirRenderSurface* render_surface,
556  int logical_width, int logical_height,
557  int displacement_x, int displacement_y)
558 __attribute__((deprecated("This function is slated for rename due to MirRenderSurface-->MirSurface transition")));
559 #pragma GCC diagnostic pop
560 
567 
575 void mir_window_apply_spec(MirWindow* window, MirWindowSpec* spec);
576 
588 void mir_create_window(MirWindowSpec* requested_specification,
589  MirWindowCallback callback, void* context);
590 
597 MirWindow* mir_create_window_sync(MirWindowSpec* requested_specification);
598 
610 void mir_window_release(
611  MirWindow* window,
612  MirWindowCallback callback,
613  void *context);
614 
620 void mir_window_release_sync(MirWindow* window);
621 
628 bool mir_window_is_valid(MirWindow* window);
629 
642  MirWindowEventCallback callback,
643  void* context);
644 
659 
669 char const* mir_window_get_error_message(MirWindow* window);
670 
677 void mir_window_get_parameters(MirWindow* window, MirWindowParameters* parameters);
678 
685 
693 void mir_window_raise(MirWindow* window, MirCookie const* cookie);
694 
701 
707 void mir_window_set_state(MirWindow* window,
708  MirWindowState state);
709 
716 
723 
730 
736 int mir_window_get_dpi(MirWindow* window);
737 
746 void mir_window_configure_cursor(MirWindow* window, MirCursorConfiguration const* parameters);
747 
756 
763 
776 void mir_window_request_persistent_id(MirWindow* window, MirWindowIdCallback callback, void* context)
777 __attribute__((deprecated("Use mir_window_request_window_id() instead")));
778 void mir_window_request_window_id(MirWindow* window, MirWindowIdCallback callback, void* context);
779 
786 MirPersistentId* mir_window_request_persistent_id_sync(MirWindow* window)
787 __attribute__((deprecated("Use mir_window_request_window_id_sync")));
789 #ifdef __cplusplus
790 }
792 #endif
793 
794 #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:42
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:48
struct MirCursorConfiguration MirCursorConfiguration
Opaque structure containing cursor parameterization.
Definition: mir_cursor_configuration.h:28
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:50
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:367
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:159
MirWindowVisibility
Definition: common.h:171
The displacement from the top-left corner of the surface.
Definition: client_types.h:380
MirPointerConfinementState
Pointer Confinement.
Definition: common.h:444
int mir_window_get_dpi(MirWindow *window)
Query the DPI value of the window (dots per inch).
MirPersistentId * mir_window_request_persistent_id_sync(MirWindow *window) __attribute__((deprecated("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.
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:269
MirWindowSpec * mir_create_window_spec(MirConnection *connection)
Create a window specification.
void mir_window_request_persistent_id(MirWindow *window, MirWindowIdCallback callback, void *context) __attribute__((deprecated("Use mir_window_request_window_id() instead")))
Request an ID for the window that can be shared cross-process and across restarts.
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:40
void(* MirWindowIdCallback)(MirWindow *window, MirPersistentId *id, void *context)
Definition: client_types.h:169
MirWindowType
Definition: common.h:107
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:81
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:239
struct MirSurfaceSpec MirWindowSpec
Definition: client_types.h:44
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:432
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)
MirConnectedCallback mir_connected_callback __attribute__((deprecated("Use MirConnectedCallback instead")))
Release a platform message.
Definition: client_types.h:85
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.
void mir_window_spec_add_render_surface(MirWindowSpec *spec, MirRenderSurface *render_surface, int logical_width, int logical_height, int displacement_x, int displacement_y) __attribute__((deprecated("This function is slated for rename due to MirRenderSurface- -> MirSurface transition")))
Set the MirWindowSpec to display content contained in a render surface.
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.
uint32_t output_id
The id of the output to place the surface in.
Definition: client_types.h:183
MirOrientationMode
Definition: common.h:285
MirWindowState
Definition: common.h:137
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.
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:312
MirEdgeAttachment
Definition: common.h:299

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Mar 27 12:06:55 UTC 2017