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 20:44:06 +03:00
|
|
|
#include <pango/pangocairo.h>
|
|
|
|
|
2016-08-04 02:55:51 +03:00
|
|
|
|
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;
|
2016-08-18 20:46:33 +03:00
|
|
|
unsigned hmin, hmax;
|
2016-08-07 02:46:03 +03:00
|
|
|
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,
|
2016-08-21 05:57:56 +03:00
|
|
|
int x, int 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-18 20:44:06 +03:00
|
|
|
void overlay_size(const struct overlay *over, PangoContext *pango_context,
|
|
|
|
int *w, int *h);
|
|
|
|
void overlay_size_all(const struct overlay *overlays,
|
|
|
|
PangoContext *pango_context, bool dx, bool dy, int *w, int *h);
|
|
|
|
|
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-18 20:44:06 +03:00
|
|
|
|
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-21 07:24:42 +03:00
|
|
|
void overlay_icon(struct overlay *over, cairo_surface_t *icon);
|
2016-08-07 02:46:03 +03:00
|
|
|
void overlay_style(struct overlay *over, const struct overlay_style *style);
|
2016-08-18 20:44:06 +03:00
|
|
|
|
2016-08-19 09:32:41 +03:00
|
|
|
void overlay_set_related(struct overlay *over, struct overlay *related);
|
|
|
|
void overlay_set_related_all(struct overlay *overlays, struct overlay *related);
|
|
|
|
|
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 */
|