diff --git a/src/bin/clapper-app/clapper-app-types.c b/src/bin/clapper-app/clapper-app-types.c new file mode 100644 index 00000000..568970cf --- /dev/null +++ b/src/bin/clapper-app/clapper-app-types.c @@ -0,0 +1,42 @@ +/* Clapper Application + * Copyright (C) 2024 Rafał Dzięgiel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "clapper-app-types.h" + +#include "clapper-app-headerbar.h" +#include "clapper-app-media-item-box.h" +#include "clapper-app-property-row.h" +#include "clapper-app-queue-list.h" +#include "clapper-app-queue-progression-model.h" +#include "clapper-app-window-state-buttons.h" + +/* + * clapper_app_types_init: + * + * Ensure private types that appear in UI files in order for + * GtkBuilder to be able to find them when building templates. + */ +inline void +clapper_app_types_init (void) +{ + g_type_ensure (CLAPPER_APP_TYPE_HEADERBAR); + g_type_ensure (CLAPPER_APP_TYPE_MEDIA_ITEM_BOX); + g_type_ensure (CLAPPER_APP_TYPE_PROPERTY_ROW); + g_type_ensure (CLAPPER_APP_TYPE_QUEUE_LIST); + g_type_ensure (CLAPPER_APP_TYPE_QUEUE_PROGRESSION_MODEL); + g_type_ensure (CLAPPER_APP_TYPE_WINDOW_STATE_BUTTONS); +} diff --git a/src/bin/clapper-app/clapper-app-types.h b/src/bin/clapper-app/clapper-app-types.h new file mode 100644 index 00000000..d4f79f8a --- /dev/null +++ b/src/bin/clapper-app/clapper-app-types.h @@ -0,0 +1,27 @@ +/* Clapper Application + * Copyright (C) 2024 Rafał Dzięgiel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include + +G_BEGIN_DECLS + +G_GNUC_INTERNAL +void clapper_app_types_init (void); + +G_END_DECLS diff --git a/src/bin/clapper-app/main.c b/src/bin/clapper-app/main.c index cd33040e..da3d87fa 100644 --- a/src/bin/clapper-app/main.c +++ b/src/bin/clapper-app/main.c @@ -25,6 +25,7 @@ #include #include "clapper-app-application.h" +#include "clapper-app-types.h" gint main (gint argc, gchar **argv) @@ -46,6 +47,8 @@ main (gint argc, gchar **argv) gtk_init (); adw_init (); + clapper_app_types_init (); + g_set_application_name ("Clapper"); application = clapper_app_application_new (); diff --git a/src/bin/clapper-app/meson.build b/src/bin/clapper-app/meson.build index 70e9d168..76e298a6 100644 --- a/src/bin/clapper-app/meson.build +++ b/src/bin/clapper-app/meson.build @@ -67,6 +67,7 @@ clapperapp_sources = [ 'clapper-app-queue-progression-item.c', 'clapper-app-queue-progression-model.c', 'clapper-app-queue-selection.c', + 'clapper-app-types.c', 'clapper-app-uri-dialog.c', 'clapper-app-utils.c', 'clapper-app-window.c',