Render window close button

This commit is contained in:
Johan Malm 2020-06-29 19:27:59 +01:00
parent 40e862f3ac
commit baca410560
17 changed files with 177 additions and 50 deletions

View file

@ -1,7 +1,7 @@
#ifndef LABWC_H
#define LABWC_H
#define _POSIX_C_SOURCE 200112L
#define _POSIX_C_SOURCE 200809L
#include <getopt.h>
#include <stdbool.h>
#include <stdlib.h>
@ -93,7 +93,8 @@ struct output {
enum view_type { LAB_XDG_SHELL_VIEW, LAB_XWAYLAND_VIEW };
enum deco_part {
LAB_DECO_PART_TITLE = 0,
LAB_DECO_ICON_CLOSE = 0,
LAB_DECO_PART_TITLE,
LAB_DECO_PART_TOP,
LAB_DECO_PART_RIGHT,
LAB_DECO_PART_BOTTOM,

View file

@ -1,12 +1,20 @@
/*
* Theme engine for labwc - trying to be consistent with openbox
*
* Copyright Johan Malm 2020
*/
#ifndef THEME_H
#define THEME_H
#include <stdio.h>
#include <wlr/render/wlr_renderer.h>
struct theme {
float window_active_title_bg_color[4];
float window_active_handle_bg_color[4];
float window_inactive_title_bg_color[4];
struct wlr_texture *xbm_close;
};
extern struct theme theme;

25
include/theme/xbm/parse.h Normal file
View file

@ -0,0 +1,25 @@
/*
* Parse xbm token to create pixmap
*
* Copyright Johan Malm 2020
*/
#ifndef PARSE_H
#define PARSE_H
#include <stdint.h>
#include "theme/xbm/tokenize.h"
struct pixmap {
uint32_t *data;
int width;
int height;
};
/**
* xbm_create_pixmap - parse xbm tokens and create pixmap
* @tokens: token vector
*/
struct pixmap xbm_create_pixmap(struct token *tokens);
#endif /* PARSE_H */

View file

@ -1,7 +1,11 @@
#ifndef XBM_H
#define XBM_H
/*
* XBM file tokenizer
*
* Copyright Johan Malm 2020
*/
#include <cairo.h>
#ifndef TOKENIZE_H
#define TOKENIZE_H
enum token_type {
TOKEN_NONE = 0,
@ -18,12 +22,6 @@ struct token {
enum token_type type;
};
/**
* xbm_create_bitmap - parse xbm tokens and create pixmap
* @tokens: token vector
*/
cairo_surface_t *xbm_create_bitmap(struct token *tokens);
/**
* tokenize - tokenize xbm file
* @buffer: buffer containing xbm file
@ -38,4 +36,4 @@ struct token *xbm_tokenize(char *buffer);
*/
char *xbm_read_file(const char *filename);
#endif /* XBM_H */
#endif /* TOKENIZE_H */

14
include/theme/xbm/xbm.h Normal file
View file

@ -0,0 +1,14 @@
#ifndef XBM_H
#define XBM_H
#include <wlr/render/wlr_renderer.h>
#include "theme.h"
#include "theme/xbm/parse.h"
/**
* xbm_load - load theme xbm files into global theme struct
*/
void xbm_load(struct wlr_renderer *renderer);
#endif /* XBM_H */