wlmaker
|
#include "rectangle.h"
#include <libbase/libbase.h>
#include <stdbool.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wayland-util.h>
#include <wlr/types/wlr_scene.h>
#include "container.h"
#include "input.h"
#include "util.h"
Classes | |
struct | _wlmtk_rectangle_t |
Functions | |
static void | _wlmtk_rectangle_element_destroy (wlmtk_element_t *element_ptr) |
static struct wlr_scene_node * | _wlmtk_rectangle_element_create_scene_node (wlmtk_element_t *element_ptr, struct wlr_scene_tree *wlr_scene_tree_ptr) |
static bool | _wlmtk_rectangle_element_pointer_motion (wlmtk_element_t *element_ptr, wlmtk_pointer_motion_event_t *motion_event_ptr) |
static void | _wlmtk_rectangle_get_dimensions (wlmtk_element_t *element_ptr, int *x1_ptr, int *y1_ptr, int *x2_ptr, int *y2_ptr) |
static void | handle_wlr_scene_rect_node_destroy (struct wl_listener *listener_ptr, void *data_ptr) |
wlmtk_rectangle_t * | wlmtk_rectangle_create (int width, int height, uint32_t color) |
void | wlmtk_rectangle_destroy (wlmtk_rectangle_t *rectangle_ptr) |
void | wlmtk_rectangle_set_size (wlmtk_rectangle_t *rectangle_ptr, int width, int height) |
void | wlmtk_rectangle_set_color (wlmtk_rectangle_t *rectangle_ptr, uint32_t color) |
wlmtk_element_t * | wlmtk_rectangle_element (wlmtk_rectangle_t *rectangle_ptr) |
wlmtk_rectangle_t * | wlmtk_rectangle_from_element (wlmtk_element_t *element_ptr) |
static void | test_create_destroy (bs_test_t *test_ptr) |
static void | test_create_destroy_scene (bs_test_t *test_ptr) |
Variables | |
static const wlmtk_element_vmt_t | _wlmtk_rectangle_element_vmt |
const bs_test_case_t | wlmtk_rectangle_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.
|
static |
Implementation of the superclass wlmtk_element_t::create_scene_node method.
Creates a struct wlr_scene_rect
attached to wlr_scene_tree_ptr
.
element_ptr | |
wlr_scene_tree_ptr |
|
static |
Virtual dtor: Invoke the rectangle's dtor.
|
static |
Implements wlmtk_element_vmt_t::pointer_motion. Sets cursor.
|
static |
Implementation of the element's get_dimensions method: Return dimensions.
element_ptr | |
x1_ptr | 0. |
y1_ptr | 0. |
x2_ptr | Width. May be NULL. |
y2_ptr | Height. May be NULL. |
|
static |
Handles the 'destroy' callback of wlr_scene_rect_ptr->node.
Will reset the wlr_scene_rect_ptr value. Destruction of the node had been triggered (hence the callback).
listener_ptr | |
data_ptr |
|
static |
Tests setup and teardown of rectangle.
|
static |
Tests setup and teardown of rectangle, when attached to scene graph.
wlmtk_rectangle_t * wlmtk_rectangle_create | ( | int | width, |
int | height, | ||
uint32_t | color | ||
) |
Creates a rectangle. Useful for margins and borders.
width | |
height | |
color |
void wlmtk_rectangle_destroy | ( | wlmtk_rectangle_t * | rectangle_ptr | ) |
Destroys the rectangle.
rectangle_ptr |
wlmtk_element_t * wlmtk_rectangle_element | ( | wlmtk_rectangle_t * | rectangle_ptr | ) |
Returns the superclass wlmtk_element_t of the rectangle.
wlmtk_rectangle_t * wlmtk_rectangle_from_element | ( | wlmtk_element_t * | element_ptr | ) |
Gets the wlmtk_rectangle_t instance from it's element superclass.
Requires element_ptr
as pointer to wlmtk_rectangle_t::super_element.
element_ptr |
void wlmtk_rectangle_set_color | ( | wlmtk_rectangle_t * | rectangle_ptr, |
uint32_t | color | ||
) |
Sets (or updates) the color of the rectangle.
rectangle_ptr | |
color |
void wlmtk_rectangle_set_size | ( | wlmtk_rectangle_t * | rectangle_ptr, |
int | width, | ||
int | height | ||
) |
Sets (or updates) the size of the rectangle.
rectangle_ptr | |
width | |
height |
|
static |
Virtual method table of the rectangle, extending the element.
const bs_test_case_t wlmtk_rectangle_test_cases[] |
Unit tests.