From 10b9cde328947d038029f2496f43da75138abb3d Mon Sep 17 00:00:00 2001 From: kotontrion Date: Wed, 18 Sep 2024 20:29:21 +0200 Subject: add version constants to auth, river and wireplumber libs --- lib/auth/include/astal-auth.h | 32 ----------------- lib/auth/include/astal-auth.h.in | 38 ++++++++++++++++++++ lib/auth/include/meson.build | 17 +++++++-- lib/river/include/astal-river.h | 59 ------------------------------- lib/river/include/astal-river.h.in | 66 +++++++++++++++++++++++++++++++++++ lib/river/include/meson.build | 19 +++++++--- lib/wireplumber/include/astal-wp.h | 4 --- lib/wireplumber/include/astal-wp.h.in | 14 ++++++++ lib/wireplumber/include/meson.build | 16 +++++++-- 9 files changed, 161 insertions(+), 104 deletions(-) delete mode 100644 lib/auth/include/astal-auth.h create mode 100644 lib/auth/include/astal-auth.h.in delete mode 100644 lib/river/include/astal-river.h create mode 100644 lib/river/include/astal-river.h.in delete mode 100644 lib/wireplumber/include/astal-wp.h create mode 100644 lib/wireplumber/include/astal-wp.h.in diff --git a/lib/auth/include/astal-auth.h b/lib/auth/include/astal-auth.h deleted file mode 100644 index a3073ff..0000000 --- a/lib/auth/include/astal-auth.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ASTAL_AUTH_PAM_H -#define ASTAL_AUTH_PAM_H - -#include -#include - -G_BEGIN_DECLS - -#define ASTAL_AUTH_TYPE_PAM (astal_auth_pam_get_type()) - -G_DECLARE_FINAL_TYPE(AstalAuthPam, astal_auth_pam, ASTAL_AUTH, PAM, GObject) - -void astal_auth_pam_set_username(AstalAuthPam *self, const gchar *username); - -const gchar *astal_auth_pam_get_username(AstalAuthPam *self); - -void astal_auth_pam_set_service(AstalAuthPam *self, const gchar *service); - -const gchar *astal_auth_pam_get_service(AstalAuthPam *self); - -gboolean astal_auth_pam_start_authenticate(AstalAuthPam *self); - -void astal_auth_pam_supply_secret(AstalAuthPam *self, const gchar *secret); - -gboolean astal_auth_pam_authenticate(const gchar *password, GAsyncReadyCallback result_callback, - gpointer user_data); - -gssize astal_auth_pam_authenticate_finish(GAsyncResult *res, GError **error); - -G_END_DECLS - -#endif // !ASTAL_AUTH_PAM_H diff --git a/lib/auth/include/astal-auth.h.in b/lib/auth/include/astal-auth.h.in new file mode 100644 index 0000000..c8a0ece --- /dev/null +++ b/lib/auth/include/astal-auth.h.in @@ -0,0 +1,38 @@ +#ifndef ASTAL_AUTH_PAM_H +#define ASTAL_AUTH_PAM_H + +#include +#include + + +#define ASTAL_AUTH_MAJOR_VERSION @MAJOR_VERSION@ +#define ASTAL_AUTH_MINOR_VERSION @MINOR_VERSION@ +#define ASTAL_AUTH_MICRO_VERSION @MICRO_VERSION@ +#define ASTAL_AUTH_VERSION "@VERSION@" + +G_BEGIN_DECLS + +#define ASTAL_AUTH_TYPE_PAM (astal_auth_pam_get_type()) + +G_DECLARE_FINAL_TYPE(AstalAuthPam, astal_auth_pam, ASTAL_AUTH, PAM, GObject) + +void astal_auth_pam_set_username(AstalAuthPam *self, const gchar *username); + +const gchar *astal_auth_pam_get_username(AstalAuthPam *self); + +void astal_auth_pam_set_service(AstalAuthPam *self, const gchar *service); + +const gchar *astal_auth_pam_get_service(AstalAuthPam *self); + +gboolean astal_auth_pam_start_authenticate(AstalAuthPam *self); + +void astal_auth_pam_supply_secret(AstalAuthPam *self, const gchar *secret); + +gboolean astal_auth_pam_authenticate(const gchar *password, GAsyncReadyCallback result_callback, + gpointer user_data); + +gssize astal_auth_pam_authenticate_finish(GAsyncResult *res, GError **error); + +G_END_DECLS + +#endif // !ASTAL_AUTH_PAM_H diff --git a/lib/auth/include/meson.build b/lib/auth/include/meson.build index 0575998..9c92caf 100644 --- a/lib/auth/include/meson.build +++ b/lib/auth/include/meson.build @@ -1,4 +1,17 @@ + +config = configure_file( + input: 'astal-auth.h.in', + output: 'astal-auth.h', + configuration: { + 'VERSION': meson.project_version(), + 'MAJOR_VERSION': version_split[0], + 'MINOR_VERSION': version_split[1], + 'MICRO_VERSION': version_split[2], + }, +) + + astal_auth_inc = include_directories('.') -astal_auth_headers = files('astal-auth.h') +astal_auth_headers = config -install_headers('astal-auth.h') +install_headers(astal_auth_headers) diff --git a/lib/river/include/astal-river.h b/lib/river/include/astal-river.h deleted file mode 100644 index 6bedd94..0000000 --- a/lib/river/include/astal-river.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef ASTAL_RIVER_H -#define ASTAL_RIVER_H - -#include - -G_BEGIN_DECLS - -#define ASTAL_RIVER_TYPE_OUTPUT (astal_river_output_get_type()) - -G_DECLARE_FINAL_TYPE(AstalRiverOutput, astal_river_output, ASTAL_RIVER, OUTPUT, GObject) - -guint astal_river_output_get_id(AstalRiverOutput *self); - -gchar *astal_river_output_get_name(AstalRiverOutput *self); - -gchar *astal_river_output_get_layout_name(AstalRiverOutput *self); - -gchar *astal_river_output_get_focused_view(AstalRiverOutput *self); - -guint astal_river_output_get_focused_tags(AstalRiverOutput *self); - -guint astal_river_output_get_urgent_tags(AstalRiverOutput *self); - -guint astal_river_output_get_occupied_tags(AstalRiverOutput *self); - -#define ASTAL_RIVER_TYPE_RIVER (astal_river_river_get_type()) - -G_DECLARE_FINAL_TYPE(AstalRiverRiver, astal_river_river, ASTAL_RIVER, RIVER, GObject) - -AstalRiverRiver *astal_river_river_new(); - -AstalRiverRiver *astal_river_river_get_default(); -AstalRiverRiver *astal_river_get_default(); - -GList *astal_river_river_get_outputs(AstalRiverRiver *self); - -AstalRiverOutput *astal_river_river_get_output(AstalRiverRiver *self, gchar *name); - -gchar *astal_river_river_get_focused_view(AstalRiverRiver *self); - -gchar *astal_river_river_get_focused_output(AstalRiverRiver *self); - -gchar *astal_river_river_get_mode(AstalRiverRiver *self); - -/** - * AstalRiverCommandCallback: - * @success: a #gboolean indicating whether the command was executed successfully - * @msg: a string containing the result of the command - * - * A callback function that is called after a river command is run. - */ -typedef void (*AstalRiverCommandCallback)(gboolean success, const gchar *msg); - -void astal_river_river_run_command_async(AstalRiverRiver *self, gint length, const gchar **cmd, - AstalRiverCommandCallback callback); - -G_END_DECLS - -#endif // !ASTAL_RIVER_H diff --git a/lib/river/include/astal-river.h.in b/lib/river/include/astal-river.h.in new file mode 100644 index 0000000..d2b769c --- /dev/null +++ b/lib/river/include/astal-river.h.in @@ -0,0 +1,66 @@ +#ifndef ASTAL_RIVER_H +#define ASTAL_RIVER_H + +#include + + +#define ASTAL_RIVER_MAJOR_VERSION @MAJOR_VERSION@ +#define ASTAL_RIVER_MINOR_VERSION @MINOR_VERSION@ +#define ASTAL_RIVER_MICRO_VERSION @MICRO_VERSION@ +#define ASTAL_RIVER_VERSION "@VERSION@" + + +G_BEGIN_DECLS + +#define ASTAL_RIVER_TYPE_OUTPUT (astal_river_output_get_type()) + +G_DECLARE_FINAL_TYPE(AstalRiverOutput, astal_river_output, ASTAL_RIVER, OUTPUT, GObject) + +guint astal_river_output_get_id(AstalRiverOutput *self); + +gchar *astal_river_output_get_name(AstalRiverOutput *self); + +gchar *astal_river_output_get_layout_name(AstalRiverOutput *self); + +gchar *astal_river_output_get_focused_view(AstalRiverOutput *self); + +guint astal_river_output_get_focused_tags(AstalRiverOutput *self); + +guint astal_river_output_get_urgent_tags(AstalRiverOutput *self); + +guint astal_river_output_get_occupied_tags(AstalRiverOutput *self); + +#define ASTAL_RIVER_TYPE_RIVER (astal_river_river_get_type()) + +G_DECLARE_FINAL_TYPE(AstalRiverRiver, astal_river_river, ASTAL_RIVER, RIVER, GObject) + +AstalRiverRiver *astal_river_river_new(); + +AstalRiverRiver *astal_river_river_get_default(); +AstalRiverRiver *astal_river_get_default(); + +GList *astal_river_river_get_outputs(AstalRiverRiver *self); + +AstalRiverOutput *astal_river_river_get_output(AstalRiverRiver *self, gchar *name); + +gchar *astal_river_river_get_focused_view(AstalRiverRiver *self); + +gchar *astal_river_river_get_focused_output(AstalRiverRiver *self); + +gchar *astal_river_river_get_mode(AstalRiverRiver *self); + +/** + * AstalRiverCommandCallback: + * @success: a #gboolean indicating whether the command was executed successfully + * @msg: a string containing the result of the command + * + * A callback function that is called after a river command is run. + */ +typedef void (*AstalRiverCommandCallback)(gboolean success, const gchar *msg); + +void astal_river_river_run_command_async(AstalRiverRiver *self, gint length, const gchar **cmd, + AstalRiverCommandCallback callback); + +G_END_DECLS + +#endif // !ASTAL_RIVER_H diff --git a/lib/river/include/meson.build b/lib/river/include/meson.build index 4b08a89..d91be23 100644 --- a/lib/river/include/meson.build +++ b/lib/river/include/meson.build @@ -1,6 +1,17 @@ -astal_river_inc = include_directories('.') -astal_river_headers = files( - 'astal-river.h', + +config = configure_file( + input: 'astal-river.h.in', + output: 'astal-river.h', + configuration: { + 'VERSION': meson.project_version(), + 'MAJOR_VERSION': version_split[0], + 'MINOR_VERSION': version_split[1], + 'MICRO_VERSION': version_split[2], + }, ) -install_headers('astal-river.h') + +astal_river_inc = include_directories('.') +astal_river_headers = config + +install_headers(astal_river_headers) diff --git a/lib/wireplumber/include/astal-wp.h b/lib/wireplumber/include/astal-wp.h deleted file mode 100644 index 6c48211..0000000 --- a/lib/wireplumber/include/astal-wp.h +++ /dev/null @@ -1,4 +0,0 @@ - -#include "astal/wireplumber/audio.h" -#include "astal/wireplumber/endpoint.h" -#include "astal/wireplumber/wp.h" diff --git a/lib/wireplumber/include/astal-wp.h.in b/lib/wireplumber/include/astal-wp.h.in new file mode 100644 index 0000000..7d9d997 --- /dev/null +++ b/lib/wireplumber/include/astal-wp.h.in @@ -0,0 +1,14 @@ + +#ifndef WP_H +#define WP_H + +#include "astal/wireplumber/audio.h" +#include "astal/wireplumber/endpoint.h" +#include "astal/wireplumber/wp.h" + +#define ASTAL_WP_MAJOR_VERSION @MAJOR_VERSION@ +#define ASTAL_WP_MINOR_VERSION @MINOR_VERSION@ +#define ASTAL_WP_MICRO_VERSION @MICRO_VERSION@ +#define ASTAL_WP_VERSION "@VERSION@" + +#endif // WP_H diff --git a/lib/wireplumber/include/meson.build b/lib/wireplumber/include/meson.build index afe00eb..cae0d6e 100644 --- a/lib/wireplumber/include/meson.build +++ b/lib/wireplumber/include/meson.build @@ -1,8 +1,18 @@ -astal_wireplumber_inc = include_directories('.', 'astal/wireplumber', 'private') -astal_wireplumber_headers = files( - 'astal-wp.h', + +config = configure_file( + input: 'astal-wp.h.in', + output: 'astal-wp.h', + configuration: { + 'VERSION': meson.project_version(), + 'MAJOR_VERSION': version_split[0], + 'MINOR_VERSION': version_split[1], + 'MICRO_VERSION': version_split[2], + }, ) +astal_wireplumber_inc = include_directories('.', 'astal/wireplumber', 'private') +astal_wireplumber_headers = config + install_headers(astal_wireplumber_headers) subdir('astal/wireplumber') -- cgit v1.2.3