summaryrefslogtreecommitdiff
path: root/src/fb.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2021-02-16 21:51:33 -0800
committerVito Caputo <vcaputo@pengaru.com>2021-02-16 21:51:33 -0800
commit9e56788affedd6b01df6764732a4ba786f7a47f3 (patch)
tree89243765d939c4477de95435ab774f307fdb8f3c /src/fb.h
parent11b87c843e20f66bd68e02353ba4a1072e1230a6 (diff)
*fb: plumb outer fb_t down to fb_ops_t methods
None of the existing fb_ops_t implementations need this, but due to how GTK+ works, the GTK+ frontend using librototiller will likely want to wire up calling fb_flip() on the fb from behind fb_ops.
Diffstat (limited to 'src/fb.h')
-rw-r--r--src/fb.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/fb.h b/src/fb.h
index b06ecb8..3a3646a 100644
--- a/src/fb.h
+++ b/src/fb.h
@@ -31,25 +31,26 @@ typedef struct fb_page_t {
fb_fragment_t fragment;
} fb_page_t;
+typedef struct fb_t fb_t;
+
/* Supply this struct to fb_new() with the appropriate context */
typedef struct fb_ops_t {
int (*setup)(const settings_t *settings, setting_desc_t **next);
int (*init)(const settings_t *settings, void **res_context);
- void (*shutdown)(void *context);
- int (*acquire)(void *context, void *page);
- void (*release)(void *context);
- void * (*page_alloc)(void *context, fb_page_t *res_page);
- int (*page_free)(void *context, void *page);
- int (*page_flip)(void *context, void *page);
+ void (*shutdown)(fb_t *fb, void *context);
+ int (*acquire)(fb_t *fb, void *context, void *page);
+ void (*release)(fb_t *fb, void *context);
+ void * (*page_alloc)(fb_t *fb, void *context, fb_page_t *res_page);
+ int (*page_free)(fb_t *fb, void *context, void *page);
+ int (*page_flip)(fb_t *fb, void *context, void *page);
} fb_ops_t;
-typedef struct fb_t fb_t;
-
fb_page_t * fb_page_get(fb_t *fb);
void fb_page_put(fb_t *fb, fb_page_t *page);
void fb_free(fb_t *fb);
void fb_get_put_pages_count(fb_t *fb, unsigned *count);
int fb_new(const fb_ops_t *ops, settings_t *settings, int n_pages, fb_t **res_fb);
+void * fb_context(fb_t *fb);
int fb_flip(fb_t *fb);
void fb_fragment_divide(fb_fragment_t *fragment, unsigned n_fragments, fb_fragment_t fragments[]);
int fb_fragment_slice_single(const fb_fragment_t *fragment, unsigned n_fragments, unsigned num, fb_fragment_t *res_fragment);
© All Rights Reserved