From 5bebde59c93312d0cef33b7e62f37dd3bc939ce0 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 8 Mar 2017 18:31:29 -0800 Subject: overlays: encapsulate global overlays state Introduce vwm_overlays_t and create/destroy functions, use in vwm_startup() and vwm_shutdown(). Supply to methods operating on the global overlays state vwm_overlays_update(), vwm_overlays_rate_increase(), vwm_overlays_rate_decrease(). This is a fairly minimal adoption of these changes with vwm_t still being supplyed to the overlay functions. A future commit will further cleanup the interactions and cease all knowledge of vwm_t in overlays.c, but for now everything overlay-oriented still accesses the overlays_t instance via vwm_t. Instead of supplying the vwm_t to vwm_overlays_create() the bare vwm_xserver_t will be supplied, as this is the future shared component across vmon and vwm (in addition to overlays). --- src/overlays.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/overlays.h') diff --git a/src/overlays.h b/src/overlays.h index bfcf0da..19678e5 100644 --- a/src/overlays.h +++ b/src/overlays.h @@ -24,14 +24,17 @@ typedef struct _vwm_overlay_t { 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; 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); -void vwm_overlay_rate_increase(vwm_t *vwm); -void vwm_overlay_rate_decrease(vwm_t *vwm); -void vwm_overlay_update(vwm_t *vwm, int *desired_delay); +vwm_overlays_t * vwm_overlays_create(vwm_t *vwm); +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); #endif -- cgit v1.2.3