wlmaker
Loading...
Searching...
No Matches
Functions | Variables
primitives.c File Reference
#include "primitives.h"
#include <libbase/libbase.h>
Include dependency graph for primitives.c:

Functions

void wlmaker_primitives_cairo_fill (cairo_t *cairo_ptr, const wlmtk_style_fill_t *fill_ptr)
 
void wlmaker_primitives_cairo_fill_at (cairo_t *cairo_ptr, int x, int y, unsigned width, unsigned height, const wlmtk_style_fill_t *fill_ptr)
 
void wlmaker_primitives_set_bezel_color (cairo_t *cairo_ptr, bool illuminated)
 
void wlmaker_primitives_draw_bezel (cairo_t *cairo_ptr, double bezel_width, bool raised)
 
void wlmaker_primitives_draw_bezel_at (cairo_t *cairo_ptr, int x, int y, unsigned width, unsigned height, double bezel_width, bool raised)
 
void wlmaker_primitives_draw_minimize_icon (cairo_t *cairo_ptr, uint32_t color)
 
void wlmaker_primitives_draw_close_icon (cairo_t *cairo_ptr, uint32_t color)
 
void wlmaker_primitives_draw_window_title (cairo_t *cairo_ptr, const char *title_ptr, uint32_t color)
 
static void test_fill (bs_test_t *test_ptr)
 
static void test_close (bs_test_t *test_ptr)
 
static void test_minimize (bs_test_t *test_ptr)
 
static void test_window_title (bs_test_t *test_ptr)
 

Variables

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

Function Documentation

◆ test_close()

void test_close ( bs_test_t * test_ptr)
static

Verifies the looks of the "close" icon.

◆ test_fill()

void test_fill ( bs_test_t * test_ptr)
static

Verifies the fill styles

◆ test_minimize()

void test_minimize ( bs_test_t * test_ptr)
static

Verifies the looks of the "minimize" icon.

◆ test_window_title()

void test_window_title ( bs_test_t * test_ptr)
static

Verifies the looks of the window title.

◆ wlmaker_primitives_cairo_fill()

void wlmaker_primitives_cairo_fill ( cairo_t * cairo_ptr,
const wlmtk_style_fill_t * fill_ptr )

Completely fills the cairo with the specified style.

Parameters
cairo_ptrA cairo, backed by an image surface.
fill_ptr

◆ wlmaker_primitives_cairo_fill_at()

void wlmaker_primitives_cairo_fill_at ( cairo_t * cairo_ptr,
int x,
int y,
unsigned width,
unsigned height,
const wlmtk_style_fill_t * fill_ptr )

Fills the cairo with the specified style at the specified rectangle.

Parameters
cairo_ptrA cairo, backed by an image surface.
x
y
width
height
fill_ptr

◆ wlmaker_primitives_draw_bezel()

void wlmaker_primitives_draw_bezel ( cairo_t * cairo_ptr,
double bezel_width,
bool raised )

Draws a bezel into the cairo.

Parameters
cairo_ptrA cairo, backed by an image surface.
bezel_width
raisedWhether the bezel is to highlight a raised (true) or pressed (false) state.

◆ wlmaker_primitives_draw_bezel_at()

void wlmaker_primitives_draw_bezel_at ( cairo_t * cairo_ptr,
int x,
int y,
unsigned width,
unsigned height,
double bezel_width,
bool raised )

Draws a bezel into the cairo, at specified position and width/height.

Parameters
cairo_ptrA cairo, backed by an image surface.
x
y
width
height
bezel_width
raisedWhether the bezel is to highlight a raised (true) or pressed (false) state.

◆ wlmaker_primitives_draw_close_icon()

void wlmaker_primitives_draw_close_icon ( cairo_t * cairo_ptr,
uint32_t color )

Draws the "close" icon, as used in the title bar.

Parameters
cairo_ptr
color

◆ wlmaker_primitives_draw_minimize_icon()

void wlmaker_primitives_draw_minimize_icon ( cairo_t * cairo_ptr,
uint32_t color )

Draws the "minimize" icon, as used in the title bar.

Parameters
cairo_ptr
color

◆ wlmaker_primitives_draw_window_title()

void wlmaker_primitives_draw_window_title ( cairo_t * cairo_ptr,
const char * title_ptr,
uint32_t color )

Draws the window title into the cairo_t.

Parameters
cairo_ptr
title_ptrTitle string, or NULL.
colorAs an ARGB 8888 value.

◆ wlmaker_primitives_set_bezel_color()

void wlmaker_primitives_set_bezel_color ( cairo_t * cairo_ptr,
bool illuminated )

Sets the bezel color.

Note: Window Maker draws the bezel by adding 80 (0x50) to each R, G, B of the underlying title for the illuminated side; respectively by subtracting 40 (0x28) on the non-illuminated side. We are using cairo's overlaying with the respective "alpha" values below, which leads to different results.

Parameters
cairo_ptr
illuminated

Variable Documentation

◆ wlmaker_primitives_test_cases

const bs_test_case_t wlmaker_primitives_test_cases[]
Initial value:
= {
{ 1, "fill", test_fill },
{ 1, "close", test_close },
{ 1, "minimize", test_minimize },
{ 1, "window_title", test_window_title },
{ 0, NULL, NULL }
}
static const wlmtk_style_fill_t test_fill
Definition menu_item.c:246
static void test_minimize(bs_test_t *test_ptr)
Definition primitives.c:292
static void test_close(bs_test_t *test_ptr)
Definition primitives.c:274
static void test_window_title(bs_test_t *test_ptr)
Definition primitives.c:310

Unit tests.