wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
xwl_content.c File Reference
#include "xwl_content.h"
#include <inttypes.h>
#include <libbase/libbase.h>
#include <stdbool.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wayland-util.h>
#include <xcb/xproto.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/xwayland/xwayland.h>
#include "xwl_popup.h"
#include "xwl_toplevel.h"
#include "toolkit/toolkit.h"
Include dependency graph for xwl_content.c:

Classes

struct  _wlmaker_xwl_content_t
 

Functions

static void _xwl_content_handle_destroy (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_request_configure (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_associate (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_dissociate (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_set_title (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_set_parent (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_set_decorations (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_set_geometry (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_content_handle_surface_commit (struct wl_listener *listener_ptr, void *data_ptr)
 
static uint32_t _xwl_content_content_request_maximized (wlmtk_content_t *content_ptr, bool maximized)
 
static uint32_t _xwl_content_content_request_fullscreen (wlmtk_content_t *content_ptr, bool fullscreen)
 
static uint32_t _xwl_content_content_request_size (wlmtk_content_t *content_ptr, int width, int height)
 
static void _xwl_content_content_request_close (wlmtk_content_t *content_ptr)
 
static void _xwl_content_content_set_activated (wlmtk_content_t *content_ptr, bool activated)
 
static void _xwl_content_apply_decorations (wlmaker_xwl_content_t *xwl_content_ptr)
 
static void _xwl_content_adjust_absolute_pos (wlmtk_content_t *content_ptr, int *x_ptr, int *y_ptr)
 
wlmaker_xwl_content_twlmaker_xwl_content_create (struct wlr_xwayland_surface *wlr_xwayland_surface_ptr, wlmaker_xwl_t *xwl_ptr, wlmaker_server_t *server_ptr)
 
void wlmaker_xwl_content_destroy (wlmaker_xwl_content_t *xwl_content_ptr)
 
wlmtk_content_twlmtk_content_from_xwl_content (wlmaker_xwl_content_t *xwl_content_ptr)
 
wlmtk_surface_twlmtk_surface_from_xwl_content (wlmaker_xwl_content_t *xwl_content_ptr)
 
static void test_create_destroy (bs_test_t *test_ptr)
 
static void test_nested (bs_test_t *test_ptr)
 
static void fake_init_wlr_xwayland_surface (struct wlr_xwayland_surface *wlr_xwayland_surface_ptr)
 

Variables

static const wlmtk_content_vmt_t _xwl_content_content_vmt
 
const bs_test_case_t wlmaker_xwl_content_test_cases []
 

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

◆ _xwl_content_adjust_absolute_pos()

static void _xwl_content_adjust_absolute_pos ( wlmtk_content_t content_ptr,
int *  x_ptr,
int *  y_ptr 
)
static

Adjusts the absolute position by subtracting each parent's position.

Parameters
content_ptr
x_ptr
y_ptr

◆ _xwl_content_apply_decorations()

void _xwl_content_apply_decorations ( wlmaker_xwl_content_t xwl_content_ptr)
static

Sets whether this window should be server-side-decorated.

TODO(kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h): Move this into xwl_toplevel.

Parameters
xwl_content_ptr

◆ _xwl_content_content_request_close()

static void _xwl_content_content_request_close ( wlmtk_content_t content_ptr)
static

◆ _xwl_content_content_request_fullscreen()

uint32_t _xwl_content_content_request_fullscreen ( wlmtk_content_t content_ptr,
bool  fullscreen 
)
static

◆ _xwl_content_content_request_maximized()

uint32_t _xwl_content_content_request_maximized ( wlmtk_content_t content_ptr,
bool  maximized 
)
static

◆ _xwl_content_content_request_size()

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

◆ _xwl_content_content_set_activated()

void _xwl_content_content_set_activated ( wlmtk_content_t content_ptr,
bool  activated 
)
static

◆ _xwl_content_handle_associate()

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

Handler for the associate event of struct wlr_xwayland_surface.

The associate event is triggered once an X11 window becomes associated with the surface. Understanding this is a moment the surface can be mapped.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_destroy()

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

Handler for the destroy event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_dissociate()

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

Handler for the dissociate event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_request_configure()

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

Handler for the request_configure event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_set_decorations()

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

Handler for the set_decorations event of struct wlr_xwayland_surface.

Applies server-side decoration, if the X11 window is supposed to have decorations.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_set_geometry()

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

Handler for the set_geometry event of struct wlr_xwayland_surface.

Called from wlroots/xwayland/xwm.c, whenever the geometry (position or dimensions) of the window (precisely: the xwayland_surface) changes.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_set_parent()

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

Handler for the set_parent event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_set_title()

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

Handler for the set_title event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_content_handle_surface_commit()

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

Surface commit handler: Pass on the current serial.

◆ fake_init_wlr_xwayland_surface()

void fake_init_wlr_xwayland_surface ( struct wlr_xwayland_surface *  wlr_xwayland_surface_ptr)
static

Fake-initializes the wlr_xwayland_surface_ptr.

◆ test_create_destroy()

void test_create_destroy ( bs_test_t *  test_ptr)
static

Tests setup and teardown.

◆ test_nested()

void test_nested ( bs_test_t *  test_ptr)
static

Tests nesting of XWayland contents, ie. parenting.

◆ wlmaker_xwl_content_create()

wlmaker_xwl_content_t * wlmaker_xwl_content_create ( struct wlr_xwayland_surface *  wlr_xwayland_surface_ptr,
wlmaker_xwl_t xwl_ptr,
wlmaker_server_t server_ptr 
)

Creates an XWayland window. Technically, window content.

Parameters
wlr_xwayland_surface_ptr
xwl_ptr
server_ptr
Returns
Pointer to a wlmaker_xwl_content_t.

◆ wlmaker_xwl_content_destroy()

void wlmaker_xwl_content_destroy ( wlmaker_xwl_content_t xwl_content_ptr)

Destroys the XWayland window (content).

Parameters
xwl_content_ptr

◆ wlmtk_content_from_xwl_content()

wlmtk_content_t * wlmtk_content_from_xwl_content ( wlmaker_xwl_content_t xwl_content_ptr)

Gets the wlmtk_content_t for the XWL content.

◆ wlmtk_surface_from_xwl_content()

wlmtk_surface_t * wlmtk_surface_from_xwl_content ( wlmaker_xwl_content_t xwl_content_ptr)

Gets the wlmtk_surface_t. Only valid if associated.

Variable Documentation

◆ _xwl_content_content_vmt

const wlmtk_content_vmt_t _xwl_content_content_vmt
static
Initial value:
= {
}
static uint32_t _xwl_content_content_request_fullscreen(wlmtk_content_t *content_ptr, bool fullscreen)
Definition xwl_content.c:610
static void _xwl_content_content_set_activated(wlmtk_content_t *content_ptr, bool activated)
Definition xwl_content.c:652
static uint32_t _xwl_content_content_request_size(wlmtk_content_t *content_ptr, int width, int height)
Definition xwl_content.c:627
static uint32_t _xwl_content_content_request_maximized(wlmtk_content_t *content_ptr, bool maximized)
Definition xwl_content.c:593
static void _xwl_content_content_request_close(wlmtk_content_t *content_ptr)
Definition xwl_content.c:642

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

◆ wlmaker_xwl_content_test_cases

const bs_test_case_t wlmaker_xwl_content_test_cases[]
Initial value:
= {
{ 1, "create_destroy", test_create_destroy },
{ 1, "nested", test_nested },
{ 0, NULL, NULL },
}
static void test_create_destroy(bs_test_t *test_ptr)
Definition xwl_content.c:734
static void test_nested(bs_test_t *test_ptr)
Definition xwl_content.c:749

Unit tests for XWL content.