2016-08-04 02:55:51 +03:00
|
|
|
/*
|
2016-08-18 02:54:25 +03:00
|
|
|
* gui/over.h - GUI: overlays
|
2016-08-04 02:55:51 +03:00
|
|
|
*
|
|
|
|
* Written 2016 by Werner Almesberger
|
|
|
|
* Copyright 2016 by Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GUI_OVER_H
|
|
|
|
#define GUI_OVER_H
|
|
|
|
|
2016-08-04 13:53:25 +03:00
|
|
|
#include <stdbool.h>
|
2016-08-07 02:46:03 +03:00
|
|
|
#include <stdint.h>
|
2016-08-04 13:53:25 +03:00
|
|
|
|
2016-08-04 02:55:51 +03:00
|
|
|
#include <cairo/cairo.h>
|
|
|
|
|
2016-08-18 02:54:25 +03:00
|
|
|
#include "gui/aoi.h"
|
2016-08-04 13:53:25 +03:00
|
|
|
|
2016-08-04 02:55:51 +03:00
|
|
|
|
2016-08-09 22:01:01 +03:00
|
|
|
struct color {
|
|
|
|
double r, g, b, alpha;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-08-07 02:46:03 +03:00
|
|
|
struct overlay_style {
|
|
|
|
const char *font;
|
|
|
|
unsigned wmin, wmax;
|
|
|
|
unsigned radius;
|
|
|
|
unsigned pad; /* in x and y direction; adjust for radius ! */
|
|
|
|
unsigned skip; /* should be list-specific */
|
2016-08-09 22:01:01 +03:00
|
|
|
struct color fg;
|
|
|
|
struct color bg;
|
|
|
|
struct color frame;
|
2016-08-07 02:46:03 +03:00
|
|
|
double width;
|
|
|
|
};
|
|
|
|
|
2016-08-04 02:55:51 +03:00
|
|
|
struct overlay;
|
|
|
|
|
|
|
|
|
2016-08-14 20:35:57 +03:00
|
|
|
void overlay_draw_all_d(struct overlay *overlays, cairo_t *cr,
|
|
|
|
unsigned x, unsigned y, int dx, int dy);
|
2016-08-07 12:08:42 +03:00
|
|
|
void overlay_draw_all(struct overlay *overlays, cairo_t *cr, int x, int y);
|
2016-08-14 20:35:57 +03:00
|
|
|
|
2016-08-07 01:14:31 +03:00
|
|
|
struct overlay *overlay_add(struct overlay **overlays, struct aoi **aois,
|
2016-08-04 13:53:25 +03:00
|
|
|
bool (*hover)(void *user, bool on), void (*click)(void *user), void *user);
|
2016-08-07 11:09:34 +03:00
|
|
|
void overlay_text_raw(struct overlay *over, const char *s);
|
2016-08-07 01:14:31 +03:00
|
|
|
void overlay_text(struct overlay *over, const char *fmt, ...);
|
2016-08-07 02:46:03 +03:00
|
|
|
void overlay_style(struct overlay *over, const struct overlay_style *style);
|
2016-08-14 19:01:35 +03:00
|
|
|
void overlay_draggable(struct overlay *over,
|
|
|
|
void (*drag)(void *user, int dx, int dy));
|
2016-08-04 02:55:51 +03:00
|
|
|
void overlay_remove(struct overlay **overlays, struct overlay *over);
|
|
|
|
void overlay_remove_all(struct overlay **overlays);
|
|
|
|
|
|
|
|
#endif /* !GUI_OVER_H */
|