diff options
Diffstat (limited to 'src/waffle/core')
-rw-r--r-- | src/waffle/core/wcore_config.h | 15 | ||||
-rw-r--r-- | src/waffle/core/wcore_context.h | 15 | ||||
-rw-r--r-- | src/waffle/core/wcore_display.h | 15 | ||||
-rw-r--r-- | src/waffle/core/wcore_window.h | 14 |
4 files changed, 35 insertions, 24 deletions
diff --git a/src/waffle/core/wcore_config.h b/src/waffle/core/wcore_config.h index 9c3597e..7911f56 100644 --- a/src/waffle/core/wcore_config.h +++ b/src/waffle/core/wcore_config.h @@ -40,17 +40,20 @@ struct wcore_config; union waffle_native_config; struct wcore_config { - struct waffle_config {} wfl; struct api_object api; struct wcore_config_attrs attrs; - struct wcore_display *display; }; -DEFINE_CONTAINER_CAST_FUNC(wcore_config, - struct wcore_config, - struct waffle_config, - wfl) +static inline struct waffle_config* +waffle_config(struct wcore_config *cfg) { + return (struct waffle_config*) cfg; +} + +static inline struct wcore_config* +wcore_config(struct waffle_config *cfg) { + return (struct wcore_config*) cfg; +} static inline bool wcore_config_init(struct wcore_config *self, diff --git a/src/waffle/core/wcore_context.h b/src/waffle/core/wcore_context.h index 548da50..fb67e4c 100644 --- a/src/waffle/core/wcore_context.h +++ b/src/waffle/core/wcore_context.h @@ -39,16 +39,19 @@ struct wcore_display; union waffle_native_context; struct wcore_context { - struct waffle_context {} wfl; struct api_object api; - struct wcore_display *display; }; -DEFINE_CONTAINER_CAST_FUNC(wcore_context, - struct wcore_context, - struct waffle_context, - wfl) +static inline struct waffle_context* +waffle_context(struct wcore_context *ctx) { + return (struct waffle_context*) ctx; +} + +static inline struct wcore_context* +wcore_context(struct waffle_context *ctx) { + return (struct wcore_context*) ctx; +} static inline bool wcore_context_init(struct wcore_context *self, diff --git a/src/waffle/core/wcore_display.h b/src/waffle/core/wcore_display.h index f67bf03..0b95729 100644 --- a/src/waffle/core/wcore_display.h +++ b/src/waffle/core/wcore_display.h @@ -34,16 +34,19 @@ struct wcore_platform; union waffle_native_display; struct wcore_display { - struct waffle_display {} wfl; struct api_object api; - struct wcore_platform *platform; }; -DEFINE_CONTAINER_CAST_FUNC(wcore_display, - struct wcore_display, - struct waffle_display, - wfl) +static inline struct waffle_display* +waffle_display(struct wcore_display *dpy) { + return (struct waffle_display*) dpy; +} + +static inline struct wcore_display* +wcore_display(struct waffle_display *dpy) { + return (struct wcore_display*) dpy; +} bool wcore_display_init(struct wcore_display *self, diff --git a/src/waffle/core/wcore_window.h b/src/waffle/core/wcore_window.h index fc82111..20a154b 100644 --- a/src/waffle/core/wcore_window.h +++ b/src/waffle/core/wcore_window.h @@ -32,17 +32,19 @@ struct wcore_window; union waffle_native_window; struct wcore_window { - struct waffle_window {} wfl; struct api_object api; - struct wcore_display *display; }; -DEFINE_CONTAINER_CAST_FUNC(wcore_window, - struct wcore_window, - struct waffle_window, - wfl) +static inline struct waffle_window* +waffle_window(struct wcore_window *win) { + return (struct waffle_window*) win; +} +static inline struct wcore_window* +wcore_window(struct waffle_window *win) { + return (struct wcore_window*) win; +} static inline bool wcore_window_init(struct wcore_window *self, |