|
wlmaker
|
#include "titlebar_title.h"#include <cairo.h>#include <libbase/libbase.h>#include <linux/input-event-codes.h>#include <stdint.h>#include <stdlib.h>#include <wayland-server-core.h>#include <wayland-server-protocol.h>#include <wlr/interfaces/wlr_buffer.h>#include <wlr/types/wlr_output.h>#include <wlr/types/wlr_output_layout.h>#include "buffer.h"#include "gfxbuf.h"#include "input.h"#include "menu.h"#include "primitives.h"#include "style.h"#include "test.h"#include "tile.h"#include "workspace.h"
Classes | |
| struct | _wlmtk_titlebar_title_t |
Functions | |
| static void | _wlmtk_titlebar_title_element_destroy (wlmtk_element_t *element_ptr) |
| static bool | _wlmtk_titlebar_title_element_pointer_button (wlmtk_element_t *element_ptr, const wlmtk_button_event_t *button_event_ptr) |
| static bool | _wlmtk_titlebar_title_element_pointer_axis (wlmtk_element_t *element_ptr, struct wlr_pointer_axis_event *wlr_pointer_axis_event_ptr) |
| static void | title_set_activated (wlmtk_titlebar_title_t *titlebar_title_ptr, bool activated) |
| struct wlr_buffer * | title_create_buffer (bs_gfxbuf_t *gfxbuf_ptr, unsigned position, unsigned width, uint32_t text_color, const char *title_ptr, const struct wlmtk_titlebar_style *style_ptr) |
| wlmtk_titlebar_title_t * | wlmtk_titlebar_title_create (wlmtk_window_t *window_ptr) |
| void | wlmtk_titlebar_title_destroy (wlmtk_titlebar_title_t *titlebar_title_ptr) |
| bool | wlmtk_titlebar_title_redraw (wlmtk_titlebar_title_t *titlebar_title_ptr, bs_gfxbuf_t *focussed_gfxbuf_ptr, bs_gfxbuf_t *blurred_gfxbuf_ptr, int position, int width, bool activated, const char *title_ptr, const struct wlmtk_titlebar_style *style_ptr) |
| void | wlmtk_titlebar_title_set_activated (wlmtk_titlebar_title_t *titlebar_title_ptr, bool activated) |
| wlmtk_element_t * | wlmtk_titlebar_title_element (wlmtk_titlebar_title_t *titlebar_title_ptr) |
| static void | test_title (bs_test_t *test_ptr) |
| static void | test_shade (bs_test_t *test_ptr) |
Variables | |
| static const wlmtk_element_vmt_t | titlebar_title_element_vmt |
| static const bs_test_case_t | _wlmtk_titlebar_title_test_cases [] |
| const bs_test_set_t | wlmtk_titlebar_title_test_set |
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 |
Dtor.
|
static |
Handles pointer axis events: Scroll wheel up will shade, down will unshade.
| element_ptr | |
| wlr_pointer_axis_event_ptr |
|
static |
|
static |
Tests that axis actions trigger 'shade'.
|
static |
Tests title drawing.
| struct wlr_buffer * title_create_buffer | ( | bs_gfxbuf_t * | gfxbuf_ptr, |
| unsigned | position, | ||
| unsigned | width, | ||
| uint32_t | text_color, | ||
| const char * | title_ptr, | ||
| const struct wlmtk_titlebar_style * | style_ptr | ||
| ) |
Creates a WLR buffer with the title's texture, as specified.
| gfxbuf_ptr | |
| position | |
| width | |
| text_color | |
| title_ptr | |
| style_ptr |
struct wlr_buffer with the texture.
|
static |
Sets whether the title is drawn focussed (activated) or blurred.
| titlebar_title_ptr | |
| activated |
| wlmtk_titlebar_title_t * wlmtk_titlebar_title_create | ( | wlmtk_window_t * | window_ptr | ) |
Creates a title bar title.
| window_ptr |
| void wlmtk_titlebar_title_destroy | ( | wlmtk_titlebar_title_t * | titlebar_title_ptr | ) |
Destroys the titlebar title.
| titlebar_title_ptr |
| wlmtk_element_t * wlmtk_titlebar_title_element | ( | wlmtk_titlebar_title_t * | titlebar_title_ptr | ) |
Returns the superclass wlmtk_element_t for the titlebar title.
| titlebar_title_ptr |
| bool wlmtk_titlebar_title_redraw | ( | wlmtk_titlebar_title_t * | titlebar_title_ptr, |
| bs_gfxbuf_t * | focussed_gfxbuf_ptr, | ||
| bs_gfxbuf_t * | blurred_gfxbuf_ptr, | ||
| int | position, | ||
| int | width, | ||
| bool | activated, | ||
| const char * | title_ptr, | ||
| const struct wlmtk_titlebar_style * | style_ptr | ||
| ) |
Redraws the title section of the title bar.
| titlebar_title_ptr | |
| focussed_gfxbuf_ptr | Titlebar background when focussed. |
| blurred_gfxbuf_ptr | Titlebar background when blurred. |
| position | Position of title telative to titlebar. |
| width | Width of title. |
| activated | Whether the title bar should start focussed. |
| title_ptr | Title, or NULL. |
| style_ptr |
| void wlmtk_titlebar_title_set_activated | ( | wlmtk_titlebar_title_t * | titlebar_title_ptr, |
| bool | activated | ||
| ) |
Sets activation status of the titlebar's title.
| titlebar_title_ptr | |
| activated |
|
static |
Test cases
|
static |
Extension to the superclass elment's virtual method table.
| const bs_test_set_t wlmtk_titlebar_title_test_set |
Unit test cases.