wlmaker
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
content.h File Reference
#include "container.h"
#include "popup.h"
#include "surface.h"
#include "util.h"
Include dependency graph for content.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _wlmtk_content_vmt_t
 
struct  _wlmtk_content_t
 
struct  _wlmtk_fake_content_t
 

Typedefs

typedef struct _wlmtk_content_t wlmtk_content_t
 
typedef struct _wlmtk_content_vmt_t wlmtk_content_vmt_t
 
typedef struct _wlmtk_window_t wlmtk_window_t
 
typedef struct _wlmtk_surface_t wlmtk_surface_t
 
typedef struct _wlmtk_fake_content_t wlmtk_fake_content_t
 

Functions

bool wlmtk_content_init (wlmtk_content_t *content_ptr, wlmtk_surface_t *surface_ptr, wlmtk_env_t *env_ptr)
 
void wlmtk_content_fini (wlmtk_content_t *content_ptr)
 
void wlmtk_content_set_surface (wlmtk_content_t *content_ptr, wlmtk_surface_t *surface_ptr)
 
wlmtk_content_vmt_t wlmtk_content_extend (wlmtk_content_t *content_ptr, const wlmtk_content_vmt_t *content_vmt_ptr)
 
static uint32_t wlmtk_content_request_maximized (wlmtk_content_t *content_ptr, bool maximized)
 
static uint32_t wlmtk_content_request_fullscreen (wlmtk_content_t *content_ptr, bool fullscreen)
 
static uint32_t wlmtk_content_request_size (wlmtk_content_t *content_ptr, int width, int height)
 
static void wlmtk_content_request_close (wlmtk_content_t *content_ptr)
 
static void wlmtk_content_set_activated (wlmtk_content_t *content_ptr, bool activated)
 
void wlmtk_content_set_window (wlmtk_content_t *content_ptr, wlmtk_window_t *window_ptr)
 
void wlmtk_content_get_size (wlmtk_content_t *content_ptr, int *width_ptr, int *height_ptr)
 
void wlmtk_content_commit (wlmtk_content_t *content_ptr, int width, int height, uint32_t serial)
 
wlmtk_element_twlmtk_content_element (wlmtk_content_t *content_ptr)
 
void wlmtk_content_add_popup (wlmtk_content_t *content_ptr, wlmtk_content_t *popup_content_ptr)
 
void wlmtk_content_remove_popup (wlmtk_content_t *content_ptr, wlmtk_content_t *popup_content_ptr)
 
void wlmtk_content_add_wlmtk_popup (wlmtk_content_t *content_ptr, wlmtk_popup_t *popup_ptr)
 
void wlmtk_content_remove_wlmtk_popup (wlmtk_content_t *content_ptr, wlmtk_popup_t *popup_ptr)
 
wlmtk_content_twlmtk_content_get_parent_content (wlmtk_content_t *content_ptr)
 
wlmtk_fake_content_twlmtk_fake_content_create (wlmtk_fake_surface_t *fake_surface_ptr)
 
void wlmtk_fake_content_destroy (wlmtk_fake_content_t *fake_content_ptr)
 
void wlmtk_fake_content_commit (wlmtk_fake_content_t *fake_content_ptr)
 

Variables

const bs_test_case_t wlmtk_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.

Typedef Documentation

◆ wlmtk_content_t

Forward declaration: Content state.

◆ wlmtk_content_vmt_t

Forward declaration: Content virtual method table.

◆ wlmtk_fake_content_t

Forward declaration: Fake content, for tests.

◆ wlmtk_surface_t

Forward declaration: State of a toolkit's WLR surface.

◆ wlmtk_window_t

Forward declaration: Window.

Function Documentation

◆ wlmtk_content_add_popup()

void wlmtk_content_add_popup ( wlmtk_content_t * content_ptr,
wlmtk_content_t * popup_content_ptr )

Adds a popup to the content.

Parameters
content_ptr
popup_content_ptr

◆ wlmtk_content_add_wlmtk_popup()

void wlmtk_content_add_wlmtk_popup ( wlmtk_content_t * content_ptr,
wlmtk_popup_t * popup_ptr )

Adds a popup to the content.

Parameters
content_ptr
popup_ptr

◆ wlmtk_content_commit()

void wlmtk_content_commit ( wlmtk_content_t * content_ptr,
int width,
int height,
uint32_t serial )

Commits size and serial: Calls into wlmtk_window_serial.

◆ wlmtk_content_element()

wlmtk_element_t * wlmtk_content_element ( wlmtk_content_t * content_ptr)

Returns the superclass' instance of wlmtk_element_t.

◆ wlmtk_content_extend()

wlmtk_content_vmt_t wlmtk_content_extend ( wlmtk_content_t * content_ptr,
const wlmtk_content_vmt_t * content_vmt_ptr )

Extends the content by specifying virtual methods.

Parameters
content_ptr
content_vmt_ptr
Returns
The original virtual method table.

◆ wlmtk_content_fini()

void wlmtk_content_fini ( wlmtk_content_t * content_ptr)

Un-initializes the content.

Parameters
content_ptr

◆ wlmtk_content_get_parent_content()

wlmtk_content_t * wlmtk_content_get_parent_content ( wlmtk_content_t * content_ptr)
Returns
A pointer to the parent content, or NULL if none.

◆ wlmtk_content_get_size()

void wlmtk_content_get_size ( wlmtk_content_t * content_ptr,
int * width_ptr,
int * height_ptr )

Gets size: Forwards to wlmtk_surface_get_size.

◆ wlmtk_content_init()

bool wlmtk_content_init ( wlmtk_content_t * content_ptr,
wlmtk_surface_t * surface_ptr,
wlmtk_env_t * env_ptr )

Initializes the content with the given surface.

Parameters
content_ptr
surface_ptr
env_ptr
Returns
true on success.

◆ wlmtk_content_remove_popup()

void wlmtk_content_remove_popup ( wlmtk_content_t * content_ptr,
wlmtk_content_t * popup_content_ptr )

Removes a popup from the content.

popup_content_ptr must have previously been added to content_ptr.

Parameters
content_ptr
popup_content_ptr

◆ wlmtk_content_remove_wlmtk_popup()

void wlmtk_content_remove_wlmtk_popup ( wlmtk_content_t * content_ptr,
wlmtk_popup_t * popup_ptr )

Removes a popup from the content.

popup_ptr must have previously been added to content_ptr.

Parameters
content_ptr
popup_ptr

◆ wlmtk_content_request_close()

static void wlmtk_content_request_close ( wlmtk_content_t * content_ptr)
inlinestatic

Requests close. See wlmtk_content_vmt_t::request_close.

◆ wlmtk_content_request_fullscreen()

static uint32_t wlmtk_content_request_fullscreen ( wlmtk_content_t * content_ptr,
bool fullscreen )
inlinestatic

Requests fullscreen. See wlmtk_content_vmt_t::request_fullscreen.

◆ wlmtk_content_request_maximized()

static uint32_t wlmtk_content_request_maximized ( wlmtk_content_t * content_ptr,
bool maximized )
inlinestatic

Requests maximized. See wlmtk_content_vmt_t::request_maximized.

◆ wlmtk_content_request_size()

static uint32_t wlmtk_content_request_size ( wlmtk_content_t * content_ptr,
int width,
int height )
inlinestatic

Requests new size. See wlmtk_content_vmt_t::request_size.

◆ wlmtk_content_set_activated()

static void wlmtk_content_set_activated ( wlmtk_content_t * content_ptr,
bool activated )
inlinestatic

Requests activation. See wlmtk_content_vmt_t::set_activated.

◆ wlmtk_content_set_surface()

void wlmtk_content_set_surface ( wlmtk_content_t * content_ptr,
wlmtk_surface_t * surface_ptr )

Sets or clears the content's surface.

Parameters
content_ptr
surface_ptrSurface to set for the content, or NULL.

◆ wlmtk_content_set_window()

void wlmtk_content_set_window ( wlmtk_content_t * content_ptr,
wlmtk_window_t * window_ptr )

Sets the window for the content.

Private: Should only be called by Window ctor (a friend).

Parameters
content_ptr
window_ptr

◆ wlmtk_fake_content_commit()

void wlmtk_fake_content_commit ( wlmtk_fake_content_t * fake_content_ptr)

Commits the state of last wlmtk_content_request_size call.

◆ wlmtk_fake_content_create()

wlmtk_fake_content_t * wlmtk_fake_content_create ( wlmtk_fake_surface_t * fake_surface_ptr)

Creates a fake content, for tests.

◆ wlmtk_fake_content_destroy()

void wlmtk_fake_content_destroy ( wlmtk_fake_content_t * fake_content_ptr)

Destroys the fake content.

Variable Documentation

◆ wlmtk_content_test_cases

const bs_test_case_t wlmtk_content_test_cases[]
extern

Content's unit tests.