wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
xdg_toplevel.c File Reference
#include "xdg_toplevel.h"
#include <libbase/libbase.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wayland-server-protocol.h>
#include <wayland-server.h>
#include <wayland-util.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/util/box.h>
#include <wlr/version.h>
#include "config.h"
#include "server.h"
#include "tl_menu.h"
#include "toolkit/toolkit.h"
#include "xdg_popup.h"
Include dependency graph for xdg_toplevel.c:

Classes

struct  xdg_toplevel_surface_t
 

Functions

static xdg_toplevel_surface_txdg_toplevel_surface_create (struct wlr_xdg_toplevel *wlr_xdg_toplevel_ptr, wlmaker_server_t *server_ptr)
 
static void xdg_toplevel_surface_destroy (xdg_toplevel_surface_t *xdg_tl_surface_ptr)
 
static void handle_destroy (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_new_popup (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_surface_map (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_surface_unmap (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_surface_commit (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_request_maximize (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_request_fullscreen (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_request_minimize (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_request_move (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_request_resize (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_request_show_window_menu (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_set_parent (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_set_title (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_toplevel_set_app_id (struct wl_listener *listener_ptr, void *data_ptr)
 
static uint32_t content_request_maximized (wlmtk_content_t *content_ptr, bool maximized)
 
static uint32_t content_request_fullscreen (wlmtk_content_t *content_ptr, bool fullscreen)
 
static uint32_t content_request_size (wlmtk_content_t *content_ptr, int width, int height)
 
static void content_request_close (wlmtk_content_t *content_ptr)
 
static void content_set_activated (wlmtk_content_t *content_ptr, bool activated)
 
wlmtk_window_twlmtk_window_create_from_xdg_toplevel (struct wlr_xdg_toplevel *wlr_xdg_toplevel_ptr, wlmaker_server_t *server_ptr)
 

Variables

const wlmtk_content_vmt_t _xdg_toplevel_content_vmt
 

Detailed Description

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.

Function Documentation

◆ content_request_close()

void content_request_close ( wlmtk_content_t content_ptr)
static

Requests the content to close: Sends a 'close' message to the toplevel.

Parameters
content_ptr

◆ content_request_fullscreen()

uint32_t content_request_fullscreen ( wlmtk_content_t content_ptr,
bool  fullscreen 
)
static

◆ content_request_maximized()

uint32_t content_request_maximized ( wlmtk_content_t content_ptr,
bool  maximized 
)
static

Implements wlmtk_content_vmt_t::request_maximized for XDG toplevel.

◆ content_request_size()

uint32_t content_request_size ( wlmtk_content_t content_ptr,
int  width,
int  height 
)
static

Sets the dimensions of the element in pixels.

Parameters
content_ptr
widthWidth of content.
heightHeight of content.
Returns
The serial.

◆ content_set_activated()

void content_set_activated ( wlmtk_content_t content_ptr,
bool  activated 
)
static

Sets the keyboard activation status for the content.

Parameters
content_ptr
activated

◆ handle_destroy()

void handle_destroy ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the destroy signal of the wlr_xdg_surface::events.

Parameters
listener_ptr
data_ptr

◆ handle_new_popup()

void handle_new_popup ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the new_popup signal.

Parameters
listener_ptr
data_ptr

◆ handle_surface_commit()

void handle_surface_commit ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the commit signal.

Parameters
listener_ptr
data_ptrPoints to the const struct wlr_surface.

◆ handle_surface_map()

void handle_surface_map ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the map signal.

Issued when the XDG toplevel is fully configured and ready to be shown. Will add it to the current workspace.

Parameters
listener_ptr
data_ptr

◆ handle_surface_unmap()

void handle_surface_unmap ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the unmap signal. Removes it from the workspace.

Parameters
listener_ptr
data_ptr

◆ handle_toplevel_request_fullscreen()

void handle_toplevel_request_fullscreen ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_fullscreen signal.

Parameters
listener_ptr
data_ptr

◆ handle_toplevel_request_maximize()

void handle_toplevel_request_maximize ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_maximize signal.

Parameters
listener_ptr
data_ptr

◆ handle_toplevel_request_minimize()

void handle_toplevel_request_minimize ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_minimize signal.

Parameters
listener_ptr
data_ptr

◆ handle_toplevel_request_move()

void handle_toplevel_request_move ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_move signal.

Parameters
listener_ptr
data_ptr

◆ handle_toplevel_request_resize()

void handle_toplevel_request_resize ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_resize signal.

Parameters
listener_ptr
data_ptrPoints to a struct wlr_xdg_toplevel_resize_event.

◆ handle_toplevel_request_show_window_menu()

void handle_toplevel_request_show_window_menu ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_show_window_menu signal.

Parameters
listener_ptr
data_ptrstruct wlr_xdg_toplevel_show_window_menu_event.

◆ handle_toplevel_set_app_id()

void handle_toplevel_set_app_id ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the set_app_id signal.

Parameters
listener_ptr
data_ptr

◆ handle_toplevel_set_parent()

void handle_toplevel_set_parent ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the set_parent signal.

Parameters
listener_ptr
data_ptr

◆ handle_toplevel_set_title()

void handle_toplevel_set_title ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the set_title signal.

Parameters
listener_ptr
data_ptr

◆ wlmtk_window_create_from_xdg_toplevel()

wlmtk_window_t * wlmtk_window_create_from_xdg_toplevel ( struct wlr_xdg_toplevel *  wlr_xdg_toplevel_ptr,
wlmaker_server_t server_ptr 
)

Creates a toolkit window with the XDG surface as content.

Parameters
wlr_xdg_toplevel_ptr
server_ptr
Returns
The window, or NULL on error.

◆ xdg_toplevel_surface_create()

xdg_toplevel_surface_t * xdg_toplevel_surface_create ( struct wlr_xdg_toplevel *  wlr_xdg_toplevel_ptr,
wlmaker_server_t server_ptr 
)
static

◆ xdg_toplevel_surface_destroy()

void xdg_toplevel_surface_destroy ( xdg_toplevel_surface_t xdg_tl_surface_ptr)
static

Destroys the xdg_toplevel_surface_t.

Variable Documentation

◆ _xdg_toplevel_content_vmt

const wlmtk_content_vmt_t _xdg_toplevel_content_vmt
Initial value:
= {
.request_maximized = content_request_maximized,
.request_fullscreen = content_request_fullscreen,
.request_size = content_request_size,
.request_close = content_request_close,
.set_activated = content_set_activated,
}
static uint32_t content_request_fullscreen(wlmtk_content_t *content_ptr, bool fullscreen)
Definition xdg_toplevel.c:361
static void content_set_activated(wlmtk_content_t *content_ptr, bool activated)
Definition xdg_toplevel.c:416
static void content_request_close(wlmtk_content_t *content_ptr)
Definition xdg_toplevel.c:400
static uint32_t content_request_maximized(wlmtk_content_t *content_ptr, bool maximized)
Definition xdg_toplevel.c:348
static uint32_t content_request_size(wlmtk_content_t *content_ptr, int width, int height)
Definition xdg_toplevel.c:382

Virtual methods for XDG toplevel surface, for the Content superclass.