From 3b6852778da4cb221baa8e3add2a9b7927aea79b Mon Sep 17 00:00:00 2001 From: "builds.sr.ht" Date: Mon, 15 May 2023 21:32:42 +0000 Subject: [PATCH] Squashed 'subprojects/d2tk/' changes from 55c66de..b07b66c b07b66c release-0.4.0 749eaf5 Fix d2tk_frontend_get_size API git-subtree-dir: subprojects/d2tk git-subtree-split: b07b66c1f98a4f3837dc7915e2f1bd36617de66b --- d2tk/frontend.h | 24 ++++++++++++------------ example/d2tk_glfw.c | 5 ++--- example/d2tk_pugl.c | 5 ++--- meson_options.txt | 2 +- src/frontend_fbdev.c | 2 +- src/frontend_glfw.c | 6 +----- src/frontend_pugl.c | 2 +- 7 files changed, 20 insertions(+), 26 deletions(-) diff --git a/d2tk/frontend.h b/d2tk/frontend.h index 3fd52ec..b486866 100644 --- a/d2tk/frontend.h +++ b/d2tk/frontend.h @@ -18,42 +18,42 @@ typedef int (*d2tk_frontend_expose_t)(void *data, d2tk_coord_t w, d2tk_coord_t h typedef struct _d2tk_frontend_t d2tk_frontend_t; D2TK_API void -d2tk_frontend_free(d2tk_frontend_t *dpugl); +d2tk_frontend_free(d2tk_frontend_t *frontend); D2TK_API int -d2tk_frontend_step(d2tk_frontend_t *dpugl); +d2tk_frontend_step(d2tk_frontend_t *frontend); D2TK_API int -d2tk_frontend_poll(d2tk_frontend_t *dpugl, double timeout); +d2tk_frontend_poll(d2tk_frontend_t *frontend, double timeout); D2TK_API int -d2tk_frontend_get_file_descriptors(d2tk_frontend_t *dpugl, int *fds, int numfds); +d2tk_frontend_get_file_descriptors(d2tk_frontend_t *frontend, int *fds, int numfds); D2TK_API void -d2tk_frontend_run(d2tk_frontend_t *dpugl, const sig_atomic_t *done); +d2tk_frontend_run(d2tk_frontend_t *frontend, const sig_atomic_t *done); D2TK_API void -d2tk_frontend_redisplay(d2tk_frontend_t *dpugl); +d2tk_frontend_redisplay(d2tk_frontend_t *frontend); D2TK_API int -d2tk_frontend_set_size(d2tk_frontend_t *dpugl, d2tk_coord_t w, d2tk_coord_t h); +d2tk_frontend_set_size(d2tk_frontend_t *frontend, d2tk_coord_t w, d2tk_coord_t h); D2TK_API int -d2tk_frontend_get_size(d2tk_frontend_t *dpugl, d2tk_coord_t *w, d2tk_coord_t *h); +d2tk_frontend_get_size(d2tk_frontend_t *frontend, d2tk_coord_t *w, d2tk_coord_t *h); D2TK_API d2tk_base_t * -d2tk_frontend_get_base(d2tk_frontend_t *dpugl); +d2tk_frontend_get_base(d2tk_frontend_t *frontend); D2TK_API int -d2tk_frontend_set_clipboard(d2tk_frontend_t *dpugl, const char *type, +d2tk_frontend_set_clipboard(d2tk_frontend_t *frontend, const char *type, const void *buf, size_t buf_len); D2TK_API const void * -d2tk_frontend_get_clipboard(d2tk_frontend_t *dpugl, const char **type, +d2tk_frontend_get_clipboard(d2tk_frontend_t *frontend, const char **type, size_t *buf_len); D2TK_API float -d2tk_frontend_get_scale(void); +d2tk_frontend_get_scale(d2tk_frontend_t *frontend); #ifdef __cplusplus } diff --git a/example/d2tk_glfw.c b/example/d2tk_glfw.c index 6215c4a..ac00213 100644 --- a/example/d2tk_glfw.c +++ b/example/d2tk_glfw.c @@ -45,9 +45,8 @@ main(int argc, char **argv) { static app_t app; - const float scale = d2tk_frontend_get_scale(); - d2tk_coord_t w = scale * 1280; - d2tk_coord_t h = scale * 720; + d2tk_coord_t w = 1280; + d2tk_coord_t h = 720; int c; while( (c = getopt(argc, argv, "w:h:")) != -1) diff --git a/example/d2tk_pugl.c b/example/d2tk_pugl.c index 08647b7..4f13b1c 100644 --- a/example/d2tk_pugl.c +++ b/example/d2tk_pugl.c @@ -43,9 +43,8 @@ main(int argc __attribute__((unused)), char **argv __attribute__((unused))) { static app_t app; - const float scale = d2tk_frontend_get_scale(); - d2tk_coord_t w = scale * 1280; - d2tk_coord_t h = scale * 720; + d2tk_coord_t w = 1280; + d2tk_coord_t h = 720; int c; while( (c = getopt(argc, argv, "w:h:")) != -1) diff --git a/meson_options.txt b/meson_options.txt index f278866..d88a6fa 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -55,4 +55,4 @@ option('use-fontconfig', value : 'disabled', yield : true) -option('version', type : 'string', value : '0.2.0') +option('version', type : 'string', value : '0.4.0') diff --git a/src/frontend_fbdev.c b/src/frontend_fbdev.c index 4b88d3b..c0a6b1c 100644 --- a/src/frontend_fbdev.c +++ b/src/frontend_fbdev.c @@ -806,7 +806,7 @@ d2tk_frontend_get_base(d2tk_frontend_t *fbdev) } D2TK_API float -d2tk_frontend_get_scale(void) +d2tk_frontend_get_scale(d2tk_frontend_t *fbdev __attribute__((unused))) { return 1.f; } diff --git a/src/frontend_glfw.c b/src/frontend_glfw.c index f738bc1..f1ba814 100644 --- a/src/frontend_glfw.c +++ b/src/frontend_glfw.c @@ -136,18 +136,14 @@ d2tk_frontend_free(d2tk_frontend_t *dglfw) } D2TK_API float -d2tk_frontend_get_scale(void) +d2tk_frontend_get_scale(d2tk_frontend_t *dglfw) { -#if 0 float xscale; float yscale; glfwGetWindowContentScale(dglfw->window, &xscale, &yscale); return xscale; -#else - return 1.f; -#endif } static void diff --git a/src/frontend_pugl.c b/src/frontend_pugl.c index f697cb6..983b8cd 100644 --- a/src/frontend_pugl.c +++ b/src/frontend_pugl.c @@ -534,7 +534,7 @@ d2tk_frontend_free(d2tk_frontend_t *dpugl) } D2TK_API float -d2tk_frontend_get_scale(void) +d2tk_frontend_get_scale(d2tk_frontend_t *dpugl __attribute__((unused))) { const char *D2TK_SCALE = getenv("D2TK_SCALE"); const float scale = D2TK_SCALE ? atof(D2TK_SCALE) : 1.f; -- 2.38.5