|
wlmaker
|
#include <libbase/libbase.h>#include <stdbool.h>#include <stdint.h>#include <wayland-server-core.h>#include "element.h"#include "menu.h"#include "style.h"#include "util.h"#include "workspace.h"

Go to the source code of this file.
Classes | |
| struct | wlmtk_window_events_t |
Typedefs | |
| typedef struct _wlmtk_window_t | wlmtk_window_t |
Enumerations | |
| enum | wlmtk_window_property_t { WLMTK_WINDOW_PROPERTY_RESIZABLE = UINT32_C(1) << 0 , WLMTK_WINDOW_PROPERTY_ICONIFIABLE = UINT32_C(1) << 1 , WLMTK_WINDOW_PROPERTY_CLOSABLE = UINT32_C(1) << 2 , WLMTK_WINDOW_PROPERTY_RIGHTCLICK = UINT32_C(1) << 3 } |
Variables | |
| const bs_test_case_t | wlmtk_window_test_cases [] |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| typedef struct _wlmtk_window_t wlmtk_window_t |
Forward declaration: Window.
Window properties.
| Enumerator | |
|---|---|
| WLMTK_WINDOW_PROPERTY_RESIZABLE | Can be resized. Server-side decorations will show resize-bar. |
| WLMTK_WINDOW_PROPERTY_ICONIFIABLE | Can be iconified. Server-side decorations include icnonify button. |
| WLMTK_WINDOW_PROPERTY_CLOSABLE | Can be closed. Server-side decorations include close button. |
| WLMTK_WINDOW_PROPERTY_RIGHTCLICK | Kludge: a window that closes on right-click-release. The window's element must pointer_grab. TODO(kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h): This should be... better. |
| bs_dllist_node_t * wlmtk_dlnode_from_window | ( | wlmtk_window_t * | window_ptr | ) |
| wlmtk_window_t * wlmtk_test_window_create | ( | wlmtk_element_t * | content_element_ptr | ) |
Creates a window, with default styles, for testing.
| content_element_ptr |
| void wlmtk_window_commit_fullscreen | ( | wlmtk_window_t * | window_ptr, |
| bool | fullscreen | ||
| ) |
Commits the window as fullscreen: Client has comitted the surface in fullscreen state.
| window_ptr | |
| fullscreen |
| void wlmtk_window_commit_maximized | ( | wlmtk_window_t * | window_ptr, |
| bool | maximized | ||
| ) |
Commits the maximized mode for the window.
The call is idempotent: Once the window is committed, further calls with the same maximized value will return straight away.
| window_ptr | |
| maximized |
| void wlmtk_window_commit_size | ( | wlmtk_window_t * | window_ptr, |
| int | width, | ||
| int | height | ||
| ) |
Sets the window's committed size. Should be called when the content size is changed, eg. on surface commit.
| window_ptr | |
| width | |
| height |
| wlmtk_window_t * wlmtk_window_create | ( | wlmtk_element_t * | content_element_ptr, |
| const wlmtk_window_style_t * | style_ptr, | ||
| const wlmtk_menu_style_t * | menu_style_ptr | ||
| ) |
Creates a window.
| content_element_ptr | |
| style_ptr | |
| menu_style_ptr |
| void wlmtk_window_destroy | ( | wlmtk_window_t * | window_ptr | ) |
Destroys the window.
| window_ptr |
| wlmtk_element_t * wlmtk_window_element | ( | wlmtk_window_t * | window_ptr | ) |
Returns the element for adding the window into a container.
| window_ptr |
| wlmtk_window_events_t * wlmtk_window_events | ( | wlmtk_window_t * | window_ptr | ) |
Gets the set of events available to a window, for binding listeners.
| window_ptr |
| wlmtk_window_t * wlmtk_window_from_dlnode | ( | bs_dllist_node_t * | dlnode_ptr | ) |
| wlmtk_window_t * wlmtk_window_from_element | ( | wlmtk_element_t * | element_ptr | ) |
Returns the window, where element_ptr is wlmtk_window_element.
| element_ptr |
| struct wlr_box wlmtk_window_get_bounding_box | ( | wlmtk_window_t * | window_ptr | ) |
Returns the bounding box for the window.
| window_ptr |
| const wlmtk_util_client_t * wlmtk_window_get_client_ptr | ( | wlmtk_window_t * | window_ptr | ) |
Returns a pointer to wlmtk_window_t::client.
| window_ptr |
window_ptr is destroyed. | uint32_t wlmtk_window_get_resize_edges | ( | wlmtk_window_t * | window_ptr | ) |
| struct wlr_box wlmtk_window_get_size | ( | wlmtk_window_t * | window_ptr | ) |
Returns the window's (committed) size. That may be different than the dimensions of the window's wlmtk_window_t::content_element_ptr.
| window_ptr |
width and height will be used. | const char * wlmtk_window_get_title | ( | wlmtk_window_t * | window_ptr | ) |
Returns the title of the window.
| window_ptr |
| struct wlr_output * wlmtk_window_get_wlr_output | ( | wlmtk_window_t * | window_ptr | ) |
Gets the struct wlr_output that the window prefers, or is on.
| window_ptr |
| wlmtk_workspace_t * wlmtk_window_get_workspace | ( | wlmtk_window_t * | window_ptr | ) |
| bool wlmtk_window_is_activated | ( | wlmtk_window_t * | window_ptr | ) |
| bool wlmtk_window_is_fullscreen | ( | wlmtk_window_t * | window_ptr | ) |
| bool wlmtk_window_is_maximized | ( | wlmtk_window_t * | window_ptr | ) |
| bool wlmtk_window_is_shaded | ( | wlmtk_window_t * | window_ptr | ) |
| wlmtk_menu_t * wlmtk_window_menu | ( | wlmtk_window_t * | window_ptr | ) |
Returns a pointer to the window menu's state.
| window_ptr |
| void wlmtk_window_menu_set_enabled | ( | wlmtk_window_t * | window_ptr, |
| bool | enabled | ||
| ) |
En-/Disables the window menu.
| window_ptr | |
| enabled |
| void wlmtk_window_position_changed | ( | wlmtk_window_t * | window_ptr | ) |
Helper: Indicates that the position has changed.
| void wlmtk_window_request_close | ( | wlmtk_window_t * | window_ptr | ) |
Requests to close the window.
| window_ptr |
| void wlmtk_window_request_fullscreen | ( | wlmtk_window_t * | window_ptr, |
| bool | fullscreen | ||
| ) |
Requests the window to be fullscreen (or end fullscreen).
| window_ptr | |
| fullscreen |
| void wlmtk_window_request_maximized | ( | wlmtk_window_t * | window_ptr, |
| bool | maximized | ||
| ) |
Requests the window to be maximized (or end maximized).
Guarantees to emit a wlmtk_window_events_t::request_maximized signal, either with the provided maximized value, or with what the compositor deems acceptable.
| window_ptr | |
| maximized |
| void wlmtk_window_request_minimize | ( | wlmtk_window_t * | window_ptr | ) |
Requests to minimize (iconify) the window.
| window_ptr |
| void wlmtk_window_request_shaded | ( | wlmtk_window_t * | window_ptr, |
| bool | shaded | ||
| ) |
Requests the window to be shaded (rolled up) or not.
| window_ptr | |
| shaded |
| void wlmtk_window_request_size | ( | wlmtk_window_t * | window_ptr, |
| const struct wlr_box * | box_ptr | ||
| ) |
Requests the window's size to be updated.
| window_ptr | |
| box_ptr | Only the width and height are considered. |
| void wlmtk_window_set_activated | ( | wlmtk_window_t * | window_ptr, |
| bool | activated | ||
| ) |
Sets the window as activated, depending on the argument's value.
An activated window will have keyboard focus and would have distinct decorations to indicate state.
| window_ptr | |
| activated |
| void wlmtk_window_set_client | ( | wlmtk_window_t * | window_ptr, |
| const wlmtk_util_client_t * | client_ptr | ||
| ) |
Sets client information for the window.
| window_ptr | |
| client_ptr | The client's information will be copied into wlmtk_window_t::client, and does not need to outlive this call. |
| void wlmtk_window_set_properties | ( | wlmtk_window_t * | window_ptr, |
| uint32_t | properties | ||
| ) |
| void wlmtk_window_set_resize_edges | ( | wlmtk_window_t * | window_ptr, |
| uint32_t | edges | ||
| ) |
Sets the resizing edges. Keeps the opposite edges firm when resizing.
| window_ptr | |
| edges |
| void wlmtk_window_set_server_side_decorated | ( | wlmtk_window_t * | window_ptr, |
| bool | decorated | ||
| ) |
Sets whether to have server-side decorations for this window.
| window_ptr | |
| decorated |
| bool wlmtk_window_set_title | ( | wlmtk_window_t * | window_ptr, |
| const char * | title_ptr | ||
| ) |
Sets the title for the window.
If title_ptr is NULL, a generic name is set.
| window_ptr | |
| title_ptr | May be NULL. |
| void wlmtk_window_set_wlr_output | ( | wlmtk_window_t * | window_ptr, |
| struct wlr_output * | wlr_output_ptr | ||
| ) |
Sets the WLR output for the window. Used for fullscreen requests.
| window_ptr | |
| wlr_output_ptr | Output to consider when requesting a window as fullscreen. Can be NULL to indicate no preference. |
| void wlmtk_window_set_workspace | ( | wlmtk_window_t * | window_ptr, |
| wlmtk_workspace_t * | workspace_ptr | ||
| ) |
Sets wlmtk_window_t::workspace_ptr.
Protected method, to be called only from wlmtk_workspace_t.
| window_ptr | |
| workspace_ptr |
|
extern |
Window unit test cases.