toaruos/userspace/gui/ttk/ttk.h

51 lines
1.6 KiB
C
Raw Normal View History

2013-02-12 12:04:31 +04:00
#ifndef _TTK_H
#define _TTK_H
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <cairo.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_CACHE_H
2014-04-16 08:16:46 +04:00
#include "lib/yutani.h"
2013-02-12 12:04:31 +04:00
#include "lib/graphics.h"
#include "lib/decorations.h"
#include "lib/shmemfonts.h"
2014-04-24 08:15:12 +04:00
#include "lib/hashmap.h"
2013-02-12 12:04:31 +04:00
typedef struct ttk_window {
2014-04-16 08:16:46 +04:00
yutani_window_t * core_window;
2013-02-12 12:04:31 +04:00
gfx_context_t * core_context;
char * title;
cairo_surface_t * cairo_surface;
uint16_t width; /* internal space */
uint16_t height;
uint16_t off_x; /* decor_left_width */
uint16_t off_y; /* decor_top_height */
2015-04-05 08:19:01 +03:00
int32_t x;
int32_t y;
2013-02-12 12:04:31 +04:00
} ttk_window_t;
#define TTK_BACKGROUND_DEFAULT 204,204,204
#define TTK_DEFAULT_X 300
#define TTK_DEFAULT_Y 300
void cairo_rounded_rectangle(cairo_t * cr, double x, double y, double width, double height, double radius);
void ttk_redraw_borders(ttk_window_t * window);
2013-04-08 03:21:00 +04:00
void _ttk_draw_button(cairo_t * cr, int x, int y, int width, int height, char * title);
2015-06-19 09:25:09 +03:00
void _ttk_draw_button_hover(cairo_t * cr, int x, int y, int width, int height, char * title);
2013-04-08 03:21:00 +04:00
void _ttk_draw_button_select(cairo_t * cr, int x, int y, int width, int height, char * title);
2015-06-19 09:25:09 +03:00
void _ttk_draw_button_disabled(cairo_t * cr, int x, int y, int width, int height, char * title);
2013-02-12 12:04:31 +04:00
void _ttk_draw_menu(cairo_t * cr, int x, int y, int width);
void ttk_window_draw(ttk_window_t * window);
void ttk_initialize();
ttk_window_t * ttk_window_new(char * title, uint16_t width, uint16_t height);
void ttk_quit();
int ttk_run(ttk_window_t * window);
#endif