2016-08-04 02:55:51 +03:00
|
|
|
/*
|
|
|
|
* gui-over.h - GUI: overlays
|
|
|
|
*
|
|
|
|
* 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-04 13:53:25 +03:00
|
|
|
#include "gui-aoi.h"
|
|
|
|
|
2016-08-04 02:55:51 +03:00
|
|
|
|
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 */
|
|
|
|
double fg[4];
|
|
|
|
double bg[4];
|
|
|
|
double frame[4];
|
|
|
|
double width;
|
|
|
|
};
|
|
|
|
|
2016-08-04 02:55:51 +03:00
|
|
|
struct overlay;
|
|
|
|
|
|
|
|
|
2016-08-05 02:35:41 +03:00
|
|
|
struct overlay *overlay_draw(struct overlay *over, cairo_t *cr, int *x, int *y);
|
2016-08-07 12:08:42 +03:00
|
|
|
void overlay_draw_all(struct overlay *overlays, cairo_t *cr, int x, int y);
|
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-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 */
|