diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2017-03-11 02:29:37 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@gnugeneration.com> | 2017-03-14 19:41:48 -0700 |
commit | 2373a54d2d52961a841dace71b505d2c20f5c040 (patch) | |
tree | de534cf0e4f7f1e917faf2b8fc07eb80a1749f96 /src/overlays.h | |
parent | b99f0728ec7229423cfc65d25711208f6cac1c0e (diff) |
overlays: extricate overlays from vwm internals
- Move vmon_proc_t under vwm_overlay_t.
- Privatize vwm_overlay_t.
- Update xwindow.c to dynamically create and destroy overlays.
- Cease supplying vwm_t to vwm_overlays_create(), now just
pass in the bare vwm_xserver_t.
- Update all vwm_overlay_* functions to operate on vwm_overlays_t and
vwm_overlay_t. Only vwm_overlays_create() receives the xserver,
which it then embeds within the returned vwm_overlay_t.
- Eliminate _xwin_ flavors of overlay functions, largely mechanical
rename eliminating the _xwin_ from the names during the previous
pass of switching from vwm_t & vwm_xwindow_t to vwm_overlays_t &
vwm_overlay_t parameters.
- Change vwm_overlay_compose() to store damage in supplied pointer,
the caller is expected to make use of the damage information now
because the overlay code doesn't know about the window its coordinate
space.
Diffstat (limited to 'src/overlays.h')
-rw-r--r-- | src/overlays.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/overlays.h b/src/overlays.h index 19678e5..0c00101 100644 --- a/src/overlays.h +++ b/src/overlays.h @@ -1,40 +1,25 @@ #ifndef _OVERLAYS_H #define _OVERLAYS_H -#include <X11/Xlib.h> +#include <X11/extensions/Xfixes.h> #include <X11/extensions/Xrender.h> -typedef struct _vwm_t vwm_t; -typedef struct _vwm_xwindow_t vwm_xwindow_t; +#include "xserver.h" -/* everything needed by the per-window overlay's context */ -typedef struct _vwm_overlay_t { - Pixmap text_pixmap; /* pixmap for overlayed text (kept around for XDrawText usage) */ - Picture text_picture; /* picture representation of text_pixmap */ - Picture shadow_picture; /* text shadow layer */ - Picture grapha_picture; /* graph A layer */ - Picture graphb_picture; /* graph B layer */ - Picture tmp_picture; /* 1 row worth of temporary picture space */ - Picture picture; /* overlay picture derived from the pixmap, for render compositing */ - int width; /* current width of the overlay */ - int height; /* current height of the overlay */ - int phase; /* current position within the (horizontally scrolling) graphs */ - int heirarchy_end; /* row where the process heirarchy currently ends */ - int snowflakes_cnt; /* count of snowflaked rows (reset to zero to truncate snowflakes display) */ - int gen_last_composed; /* the last composed vmon generation */ - int redraw_needed; /* if a redraw is required (like when the window is resized...) */ -} vwm_overlay_t; typedef struct _vwm_overlays_t vwm_overlays_t; +typedef struct _vwm_overlay_t vwm_overlay_t; -int vwm_overlay_xwin_composed_height(vwm_t *vwm, vwm_xwindow_t *xwin); -void vwm_overlay_xwin_reset_snowflakes(vwm_t *vwm, vwm_xwindow_t *xwin); -void vwm_overlay_xwin_create(vwm_t *vwm, vwm_xwindow_t *xwin); -void vwm_overlay_xwin_destroy(vwm_t *vwm, vwm_xwindow_t *xwin); -void vwm_overlay_xwin_compose(vwm_t *vwm, vwm_xwindow_t *xwin); -vwm_overlays_t * vwm_overlays_create(vwm_t *vwm); +vwm_overlays_t * vwm_overlays_create(vwm_xserver_t *xserver); void vwm_overlays_destroy(vwm_overlays_t *overlays); void vwm_overlays_rate_increase(vwm_overlays_t *overlays); void vwm_overlays_rate_decrease(vwm_overlays_t *overlays); int vwm_overlays_update(vwm_overlays_t *overlays, int *desired_delay); +vwm_overlay_t * vwm_overlay_create(vwm_overlays_t *overlays, int pid, int width, int height); +void vwm_overlay_destroy(vwm_overlays_t *overlays, vwm_overlay_t *overlay); +void vwm_overlay_reset_snowflakes(vwm_overlays_t *overlays, vwm_overlay_t *overlay); +int vwm_overlay_set_visible_size(vwm_overlays_t *overlays, vwm_overlay_t *overlay, int width, int height); +void vwm_overlay_compose(vwm_overlays_t *overlays, vwm_overlay_t *overlay, XserverRegion *res_damaged_region); +void vwm_overlay_render(vwm_overlays_t *overlays, vwm_overlay_t *overlay, Picture dest, int x, int y, int width, int height); + #endif |