From 769cd86117adeb23adc6861d00bd7b2361e503ad Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Tue, 30 May 2023 00:43:07 +0200 Subject: Add cherry_window_get_position() function --- src/window.c | 7 ++++++- src/window.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/window.c b/src/window.c index eaee6c0..150d8ef 100644 --- a/src/window.c +++ b/src/window.c @@ -151,6 +151,12 @@ cherry_window_set_dimension(CherryWindow *window, int width, int height) } } +cherry_window_get_position(CherryWindow *window, int *x, int *y) +{ + CherryWidget *widget = (CherryWidget *) window; + cherry_widget_get_position(widget, x, y); +} + void cherry_window_set_position(CherryWindow *w, int x, int y) { @@ -164,7 +170,6 @@ cherry_window_set_position(CherryWindow *w, int x, int y) } void -cherry_window_set_visible(CherryWindow *w, int visible) cherry_window_set_visible(CherryWindow *window, int visible) { CherryApplication *app = cherry_application_get_running_app(); diff --git a/src/window.h b/src/window.h index b7a3081..2e1cd41 100644 --- a/src/window.h +++ b/src/window.h @@ -24,6 +24,7 @@ char *cherry_window_get_title(CherryWindow *); void cherry_window_set_title(CherryWindow *, char *); void cherry_window_get_dimension(CherryWindow *, int *, int *); void cherry_window_set_dimension(CherryWindow *, int, int); +void cherry_window_get_position(CherryWindow *, int *, int *); void cherry_window_set_position(CherryWindow *, int, int); void cherry_window_set_visible(CherryWindow *, int); void cherry_window_set_listener(CherryWindow *, int (*listener)(struct CherryWindow *, CherryEvent)); -- cgit v1.2.3