wlmaker
|
#include "decorations.h"
#include <limits.h>
#include <math.h>
#include <stdint.h>
#include <libbase/libbase.h>
#include "toolkit/toolkit.h"
Functions | |
static cairo_surface_t * | create_background (unsigned width, unsigned height, const wlmtk_style_fill_t *fill_ptr) |
void | wlmaker_decorations_draw_tile (cairo_t *cairo_ptr, const wlmtk_style_fill_t *fill_ptr, bool pressed) |
bool | wlmaker_decorations_draw_tile_icon (cairo_t *cairo_ptr, const char *icon_path_ptr) |
void | wlmaker_decorations_draw_iconified (cairo_t *cairo_ptr, const wlmtk_style_fill_t *fill_ptr, uint32_t font_color, const char *title_ptr) |
bool | wlmaker_decorations_draw_clip (cairo_t *cairo_ptr, const wlmtk_style_fill_t *fill_ptr, bool pressed) |
bool | wlmaker_decorations_draw_clip_button_next (cairo_t *cairo_ptr, const wlmtk_style_fill_t *fill_ptr, bool pressed) |
bool | wlmaker_decorations_draw_clip_button_prev (cairo_t *cairo_ptr, const wlmtk_style_fill_t *fill_ptr, bool pressed) |
static void | test_tile (bs_test_t *test_ptr) |
static void | test_iconified (bs_test_t *test_ptr) |
static void | test_clip (bs_test_t *test_ptr) |
static void | test_clip_button_next (bs_test_t *test_ptr) |
static void | test_clip_button_prev (bs_test_t *test_ptr) |
Variables | |
const uint32_t | wlmaker_decorations_tile_size = 64 |
const uint32_t | wlmaker_decorations_tile_margin = 2 |
const uint32_t | wlmaker_decorations_clip_button_size = 22 |
const char * | lookup_paths [] |
const bs_test_case_t | wlmaker_decorations_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 |
Creates background cairo surface with given |width| x |height| and |fill|.
width | |
height | |
fill_ptr |
|
static |
Verifies the clip tile (excluding the buttons) is drawn as expected.
|
static |
Verifies the clip's "next" button is drawn as expected.
|
static |
Verifies the clip's "prev" button is drawn as expected.
|
static |
Verifies the title text is drawn as expected.
|
static |
Verifies the title text is drawn as expected.
bool wlmaker_decorations_draw_clip | ( | cairo_t * | cairo_ptr, |
const wlmtk_style_fill_t * | fill_ptr, | ||
bool | pressed ) |
Draws the clip's tile into |cairo_ptr|.
This includes the tile with the diagonal bezel edges facing the triangle buttons, but excludes the triangle buttons. Excludes the text.
cairo_ptr | |
fill_ptr | |
pressed |
bool wlmaker_decorations_draw_clip_button_next | ( | cairo_t * | cairo_ptr, |
const wlmtk_style_fill_t * | fill_ptr, | ||
bool | pressed ) |
Draws the north-eastern clip button ("next") onto |cairo_ptr|.
cairo_ptr | |
fill_ptr | |
pressed |
bool wlmaker_decorations_draw_clip_button_prev | ( | cairo_t * | cairo_ptr, |
const wlmtk_style_fill_t * | fill_ptr, | ||
bool | pressed ) |
Draws the south-western clip button ("prev") onto |cairo_ptr|.
cairo_ptr | |
fill_ptr | |
pressed |
void wlmaker_decorations_draw_iconified | ( | cairo_t * | cairo_ptr, |
const wlmtk_style_fill_t * | fill_ptr, | ||
uint32_t | font_color, | ||
const char * | title_ptr ) |
Draws the title of an iconified on to cairo_ptr
.
cairo_ptr | |
fill_ptr | |
font_color | |
title_ptr |
void wlmaker_decorations_draw_tile | ( | cairo_t * | cairo_ptr, |
const wlmtk_style_fill_t * | fill_ptr, | ||
bool | pressed ) |
Draws a tile into the cairo_t
.
cairo_ptr | |
fill_ptr | |
pressed |
bool wlmaker_decorations_draw_tile_icon | ( | cairo_t * | cairo_ptr, |
const char * | icon_path_ptr ) |
Loads an icon and draws it onto the pre-drawn tile at |cairo_ptr|.
cairo_ptr | |
icon_path_ptr |
const char* lookup_paths[] |
Lookup paths for icons.
const uint32_t wlmaker_decorations_clip_button_size = 22 |
Size of the clip button (length of the catheti)
const bs_test_case_t wlmaker_decorations_test_cases[] |
Unit tests.
const uint32_t wlmaker_decorations_tile_margin = 2 |
Hardcoded: Margin of the tile, defining the width of the bezel.
const uint32_t wlmaker_decorations_tile_size = 64 |
Hardcoded: Default size of tiles.