wlmaker
|
#include <libbase/libbase.h>
#include <wlr/types/wlr_buffer.h>
#include <wlr/types/wlr_pointer.h>
#include <wlr/types/wlr_scene.h>
#include "cursor.h"
Go to the source code of this file.
Classes | |
struct | wlmaker_interactive_impl_t |
struct | _wlmaker_interactive_t |
Typedefs | |
typedef struct _wlmaker_interactive_t | wlmaker_interactive_t |
typedef void(* | wlmaker_interactive_callback_t) (wlmaker_interactive_t *interactive_ptr, void *data_ptr) |
Functions | |
void | wlmaker_interactive_init (wlmaker_interactive_t *interactive_ptr, const wlmaker_interactive_impl_t *impl_ptr, struct wlr_scene_buffer *wlr_scene_buffer_ptr, wlmaker_cursor_t *cursor_ptr, struct wlr_buffer *initial_wlr_buffer_ptr) |
void | wlmaker_interactive_set_texture (wlmaker_interactive_t *interactive_ptr, struct wlr_buffer *wlr_buffer_ptr) |
static bool | wlmaker_interactive_contains (const wlmaker_interactive_t *interactive_ptr, double x, double y) |
static void | wlmaker_interactive_enter (wlmaker_interactive_t *interactive_ptr) |
static void | wlmaker_interactive_focus (wlmaker_interactive_t *interactive_ptr, bool focussed) |
static void | wlmaker_interactive_leave (wlmaker_interactive_t *interactive_ptr) |
static void | wlmaker_interactive_motion (wlmaker_interactive_t *interactive_ptr, double x, double y) |
static void | wlmaker_interactive_button (wlmaker_interactive_t *interactive_ptr, double x, double y, struct wlr_pointer_button_event *wlr_pointer_button_event_ptr) |
int | wlmaker_interactive_node_cmp (const bs_avltree_node_t *node_ptr, const void *key_ptr) |
void | wlmaker_interactive_node_destroy (bs_avltree_node_t *node_ptr) |
wlmaker_interactive_t * | wlmaker_interactive_from_avlnode (bs_avltree_node_t *node_ptr) |
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.
Abstract interface for interactive elements used in wlmaker: Buttons, title bar and resize bar elements. It is used as a common interface to pass along cursor motion and button events.
typedef void(* wlmaker_interactive_callback_t) (wlmaker_interactive_t *interactive_ptr, void *data_ptr) |
Callback for when an interactive element needs to trigger an action.
typedef struct _wlmaker_interactive_t wlmaker_interactive_t |
Handle for the interactive.
|
inlinestatic |
Call when there is a button event for the interactive.
Called when a button is pressed while over the interactive. But also for any button release event (of the entire server), in order to wrap up state of clickable actions.
interactive_ptr | |
x | New cursor x pos, relative to the interactive. |
y | New cursor y pos, relative to the interactive. |
wlr_pointer_button_event_ptr |
|
inlinestatic |
Returns whether the interactive contains |x|, |y| in relative coordinates.
interactive_ptr | |
x | |
y |
|
inlinestatic |
Call when the cursor enters the interactive area.
interactive_ptr |
|
inlinestatic |
Call to specify whether the view containing the interactive is focussed.
This is used to adjust eg. the decoration style to focussed or blurred windows.
interactive_ptr | |
focussed |
wlmaker_interactive_t * wlmaker_interactive_from_avlnode | ( | bs_avltree_node_t * | node_ptr | ) |
Cast the AVL tree node to the wlmaker_interactive_t
.
node_ptr |
void wlmaker_interactive_init | ( | wlmaker_interactive_t * | interactive_ptr, |
const wlmaker_interactive_impl_t * | impl_ptr, | ||
struct wlr_scene_buffer * | wlr_scene_buffer_ptr, | ||
wlmaker_cursor_t * | cursor_ptr, | ||
struct wlr_buffer * | initial_wlr_buffer_ptr ) |
Initializes the interactive.
interactive_ptr | |
impl_ptr | |
wlr_scene_buffer_ptr | Buffer scene node to contain the button. Must outlive the interactive, not taking ownership. |
cursor_ptr | |
initial_wlr_buffer_ptr | Texture WLR buffer to initialize |wlr_scene_buffer_ptr| from. |
|
inlinestatic |
Call when the cursor leaves the interactive area.
interactive_ptr |
|
inlinestatic |
Call when the cursor moves in the interactive area.
interactive_ptr | |
x | New cursor x pos, relative to the interactive. |
y | New cursor y pos, relative to the interactive. |
int wlmaker_interactive_node_cmp | ( | const bs_avltree_node_t * | node_ptr, |
const void * | key_ptr ) |
AVL tree comparator: Compares the wlr_scene_buffer.node
pointers.
node_ptr | |
key_ptr |
void wlmaker_interactive_node_destroy | ( | bs_avltree_node_t * | node_ptr | ) |
Destroy the avl tree node, ie. the interactive at this node.
node_ptr |
void wlmaker_interactive_set_texture | ( | wlmaker_interactive_t * | interactive_ptr, |
struct wlr_buffer * | wlr_buffer_ptr ) |
Sets this interactive's texture. Also updates dimensions accordingly.
interactive_ptr | |
wlr_buffer_ptr |