1
/* aosd -- OSD with transparency, cairo, and pango.
3
* Copyright (C) 2006 Evan Martin <martine@danga.com>
5
* With further development by Giacomo Lozito <james@develia.org>
6
* - added real transparency with X Composite Extension
7
* - added mouse event handling on OSD window
8
* - added/changed some other stuff
14
#include <X11/Xutil.h>
16
#include <cairo/cairo.h>
18
#include <limits.h> /* INT_MAX */
19
#include <sys/time.h> /* timeval */
21
/* global object type */
22
typedef struct _Aosd Aosd;
24
#define AOSD_COORD_CENTER INT_MAX
26
/* minimal struct to handle mouse events */
29
// relative coordinates
34
// whether we should send the event further
37
// button being pressed
43
/* various callbacks */
44
typedef void (*AosdRenderer)(Aosd* aosd, cairo_t* cr, void* user_data);
45
typedef void (*AosdMouseEventCb)(Aosd* aosd, AosdMouseEvent* event,
50
TRANSPARENCY_NONE = 0,
52
TRANSPARENCY_COMPOSITE
55
/* object (de)allocators */
57
void aosd_destroy(Aosd* aosd);
59
/* object inspectors */
60
void aosd_get_name(Aosd* aosd, XClassHint* result);
61
AosdTransparency aosd_get_transparency(Aosd* aosd);
62
void aosd_get_geometry(Aosd* aosd, int* x, int* y, int* width, int* height);
64
/* object configurators */
65
void aosd_set_name(Aosd* aosd, XClassHint* name);
66
void aosd_set_transparency(Aosd* aosd, AosdTransparency mode);
67
void aosd_set_geometry(Aosd* aosd, int x, int y, int width, int height);
68
void aosd_set_renderer(Aosd* aosd, AosdRenderer renderer, void* user_data,
69
void (*user_data_d)(void*));
70
void aosd_set_mouse_event_cb(Aosd* aosd, AosdMouseEventCb cb, void* user_data);
72
/* manual object manipulators */
73
void aosd_render(Aosd* aosd);
74
void aosd_show(Aosd* aosd);
75
void aosd_hide(Aosd* aosd);
77
/* automatic object manipulators */
78
void aosd_main_iterations(Aosd* aosd);
79
void aosd_main_until(Aosd* aosd, struct timeval* until);
80
void aosd_flash(Aosd* aosd, int fade_ms, int total_display_ms);
82
#endif /* __AOSD_H__ */
84
/* vim: set ts=2 sw=2 et : */