diff --git a/include/fb.h b/include/fb.h index ddde05f..384e0c9 100644 --- a/include/fb.h +++ b/include/fb.h @@ -21,12 +21,14 @@ #include #include "neatvnc.h" +#include "common.h" struct nvnc_fb { + struct nvnc_common common; int ref; int hold_count; nvnc_fb_release_fn on_release; - void* userdata; + void* release_context; void* addr; enum nvnc_fb_flags flags; size_t size; diff --git a/include/neatvnc.h b/include/neatvnc.h index dbe8c4f..6d1e2ab 100644 --- a/include/neatvnc.h +++ b/include/neatvnc.h @@ -50,7 +50,7 @@ typedef void (*nvnc_damage_fn)(struct pixman_region16* damage, void* userdata); typedef bool (*nvnc_auth_fn)(const char* username, const char* password, void* userdata); typedef void (*nvnc_cut_text_fn)(struct nvnc*, const char* text, uint32_t len); -typedef void (*nvnc_fb_release_fn)(struct nvnc_fb*, void* userdata); +typedef void (*nvnc_fb_release_fn)(struct nvnc_fb*, void* context); extern const char nvnc_version[]; @@ -89,7 +89,7 @@ void nvnc_fb_unref(struct nvnc_fb* fb); enum nvnc_fb_flags nvnc_fb_get_flags(const struct nvnc_fb*); void nvnc_fb_set_flags(struct nvnc_fb*, enum nvnc_fb_flags); void nvnc_fb_set_release_fn(struct nvnc_fb* fb, nvnc_fb_release_fn fn, - void* userdata); + void* context); void* nvnc_fb_get_addr(const struct nvnc_fb* fb); uint16_t nvnc_fb_get_width(const struct nvnc_fb* fb); diff --git a/src/fb.c b/src/fb.c index c935a59..b27b681 100644 --- a/src/fb.c +++ b/src/fb.c @@ -112,10 +112,10 @@ void nvnc_fb_unref(struct nvnc_fb* fb) } EXPORT -void nvnc_fb_set_release_fn(struct nvnc_fb* fb, nvnc_fb_release_fn fn, void* userdata) +void nvnc_fb_set_release_fn(struct nvnc_fb* fb, nvnc_fb_release_fn fn, void* context) { fb->on_release = fn; - fb->userdata = userdata; + fb->release_context = context; } void nvnc_fb_hold(struct nvnc_fb* fb) @@ -126,5 +126,5 @@ void nvnc_fb_hold(struct nvnc_fb* fb) void nvnc_fb_release(struct nvnc_fb* fb) { if (--fb->hold_count == 0 && fb->on_release) - fb->on_release(fb, fb->userdata); + fb->on_release(fb, fb->release_context); }