Add scaffolding for GTK4 widgets
This just compiles new things, with no real implementation right now. I'm just posting because rbt won't accept multi-commit reviews from me.
Testing Done:
Compile only, really.
Reviewed at https://reviews.imfreedom.org/r/991/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk4/data/gplugin-gtk.gresource.xml Mon Oct 04 00:15:27 2021 -0500
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?> + <gresource prefix="/org/imfreedom/keep/gplugin/gplugin-gtk4/"> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk4/gplugin-gtk.h.in Mon Oct 04 00:15:27 2021 -0500
@@ -0,0 +1,34 @@
+ * Copyright (C) 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <https://www.gnu.org/licenses/>. +# ifdef GPLUGIN_GTK_COMPILATION +# error "gplugin-gtk source files should not include gplugin-gtk.h" +# endif /* GPLUGIN_GTK_COMPILATION */ +#endif /* __GI_SCANNER__ */ +#ifndef GPLUGIN_GTK_GLOBAL_HEADER_INSIDE +# define GPLUGIN_GTK_GLOBAL_HEADER_INSIDE +#endif /* GPLUGIN_GTK_GLOBAL_HEADER_INSIDE */ +@GPLUGIN_GTK_H_INCLUDES@ +#undef GPLUGIN_GTK_GLOBAL_HEADER_INSIDE +#endif /* GPLUGIN_GTK_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk4/meson.build Mon Oct 04 00:15:27 2021 -0500
@@ -0,0 +1,143 @@
+############################################################################### +############################################################################### +GTK4 = dependency('gtk4', version : '>=4.0.0') +GPLUGIN_GTK4_LIBRARY_VERSION = '0.1.0' +GPLUGIN_GTK4_SOURCES = [ +GPLUGIN_GTK4_HEADERS = [ +GPLUGIN_GTK4_PRIVATE_SOURCES = [ +GPLUGIN_GTK4_PRIVATE_HEADERS = [ +GPLUGIN_GTK4_PUBLIC_BUILT_SOURCES = [ +GPLUGIN_GTK4_PUBLIC_BUILT_HEADERS = [ +GPLUGIN_GTK4_GENERATED_TARGETS = [ +############################################################################### +############################################################################### +GPLUGIN_GTK4_H_INCLUDES = '' +foreach header : GPLUGIN_GTK4_HEADERS + GPLUGIN_GTK4_H_INCLUDES = '@0@\n#include <@1@>'.format( + GPLUGIN_GTK4_H_INCLUDES, +conf = configuration_data() +conf.set('GPLUGIN_GTK_H_INCLUDES', GPLUGIN_GTK4_H_INCLUDES) +gplugin_gtk4_h = configure_file( + input : 'gplugin-gtk.h.in', + output : 'gplugin-gtk.h', + install_dir : get_option('includedir') / 'gplugin-gtk4-1.0') +############################################################################### +############################################################################### +gplugin_gtk4_resources = gnome.compile_resources( + 'gplugin-gtk4-resources', + 'data/gplugin-gtk.gresource.xml', +############################################################################### +############################################################################### +gplugin_gtk4 = shared_library('gplugin-gtk4', + GPLUGIN_GTK4_PRIVATE_SOURCES, + GPLUGIN_GTK4_PRIVATE_HEADERS, + GPLUGIN_GTK4_PUBLIC_BUILT_SOURCES, + GPLUGIN_GTK4_PUBLIC_BUILT_HEADERS, + gplugin_gtk4_resources, + c_args : ['-DGPLUGIN_GTK_COMPILATION', '-DG_LOG_DOMAIN="GPluginGtk"'], + include_directories : toplevel_inc, + dependencies : [gplugin_dep, GTK4], + version : GPLUGIN_GTK4_LIBRARY_VERSION, +gplugin_gtk4_inc = include_directories('.') + description : 'GTK4 widgets for GPlugin', + filebase : 'gplugin-gtk4', + subdirs : 'gplugin-gtk4-1.0', + requires : [GLIB, GOBJECT, GMODULE, GTK4], +############################################################################### +############################################################################### +if get_option('introspection') + gplugin_gtk4_gir = gnome.generate_gir( + GPLUGIN_GTK4_PUBLIC_BUILT_SOURCES, + GPLUGIN_GTK4_PUBLIC_BUILT_HEADERS, + includes : [gplugin_gir[0], 'Gtk-4.0'], + namespace : 'GPluginGtk4', + symbol_prefix : 'gplugin_gtk', + identifier_prefix : 'GPluginGtk', + header : 'gplugin-gtk.h', + export_packages: ['gplugin-gtk4'], + dependencies : [gplugin_dep], + extra_args : ['--quiet', '-DGPLUGIN_GTK_COMPILATION']) + GPLUGIN_GTK4_GENERATED_TARGETS += gplugin_gtk4_gir +############################################################################### +# Library Dependency Object +############################################################################### +gplugin_gtk4_dep = declare_dependency( + include_directories: [toplevel_inc, gplugin_gtk4_inc], + link_with : [gplugin, gplugin_gtk4], + GPLUGIN_GTK4_PUBLIC_BUILT_HEADERS, + GPLUGIN_GTK4_GENERATED_TARGETS, + dependencies : [GLIB, GOBJECT, GTK4], +meson.override_dependency('gplugin-gtk4', gplugin_gtk4_dep) +############################################################################### +############################################################################### +# install the normal includes into the gplugin-gtk subdirectory + subdir : 'gplugin-gtk4-1.0/gplugin-gtk' +############################################################################### +############################################################################### --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk4/reference/gplugin-gtk4.toml.in Mon Oct 04 00:15:27 2021 -0500
@@ -0,0 +1,48 @@
+version = "@GPLUGIN_VERSION@" +browse_url = "https://keep.imfreedom.org/gplugin/gplugin/" +repository_url = "https://keep.imfreedom.org/gplugin/gplugin/" +website_url = "https://keep.imfreedom.org/gplugin/gplugin/" +authors = "GPlugin Developers" +license = "LGPL-2.1-or-later" +description = "GPlugin Gtk Library" +dependencies = [ "GLib-2.0", "GObject-2.0", "GPlugin-1.0", "Gtk-4.0" ] + [dependencies."GLib-2.0"] + description = "General-purpose, portable utility library." + docs_url = "https://docs.gtk.org/glib/" + [dependencies."GObject-2.0"] + description = "The base type system library" + docs_url = "https://docs.gtk.org/gobject/" + [dependencies."GPlugin-1.0"] + description = "Plugin library" + docs_url = "https://docs.imfreedom.org/gplugin/" + [dependencies."Gtk-4.0"] + description = "GTK Widget Toolkit" + docs_url = "https://docs.gtk.org/gtk4/" +show_index_summary = true +show_class_hierarchy = true +base_url = "https://keep.imfreedom.org/gplugin/gplugin/file/default/" +# The same order will be used when generating the index +urlmap_file = "urlmap.js" --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk4/reference/meson.build Mon Oct 04 00:15:27 2021 -0500
@@ -0,0 +1,31 @@
+ gplugin_gtk4_toml = configure_file( + input : 'gplugin-gtk4.toml.in', + output : 'gplugin-gtk4.toml', + configuration : version_conf, + install_dir : docs_dir / 'gplugin-gtk4', + gplugin_gtk4_doc = custom_target('gplugin-gtk4-doc', + input : [ gplugin_gtk4_toml, gplugin_gtk4_gir[0] ], + output : 'gplugin-gtk4', + '--add-include-path=@0@'.format(meson.project_build_root() / 'gplugin'), + '--output-dir=@OUTPUT@', + '--content-dir=@0@'.format(meson.current_source_dir()), + depends : [ gplugin_gir[0] ], + build_by_default : true, + install_dir : docs_dir, --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk4/reference/urlmap.js Mon Oct 04 00:15:27 2021 -0500
@@ -0,0 +1,11 @@
+// SPDX-FileCopyrightText: 2021 GNOME Foundation +// SPDX-License-Identifier: LGPL-2.1-or-later +// A map between namespaces and base URLs for their online documentation + [ 'GLib', 'https://docs.gtk.org/glib/' ], + [ 'GObject', 'https://docs.gtk.org/gobject/' ], + [ 'GPlugin', 'https://docs.imfreedom.org/gplugin/' ], + [ 'GModule', 'https://docs.gtk.org/gmodule/' ], + [ 'Gtk3', 'https://docs.gtk.org/gtk3/' ], --- a/meson.build Mon Oct 04 00:14:59 2021 -0500
+++ b/meson.build Mon Oct 04 00:15:27 2021 -0500
@@ -127,6 +127,7 @@
subdir('gplugin-gtk3-viewer')
@@ -143,6 +144,9 @@
doc_targets += gplugin_gtk3_doc
+ doc_targets += gplugin_gtk4_doc alias_target('doc', doc_targets)
@@ -156,7 +160,8 @@
'api reference' : get_option('doc'),
- 'gtk3 widgets' : get_option('gtk3'),
+ 'GTK3 widgets' : get_option('gtk3'), + 'GTK4 widgets' : get_option('gtk4'), 'man pages' : get_option('help2man'),
}, bool_yn : true, section : 'Miscellaneous')
--- a/meson_options.txt Mon Oct 04 00:14:59 2021 -0500
+++ b/meson_options.txt Mon Oct 04 00:15:27 2021 -0500
@@ -19,7 +19,13 @@
type : 'boolean', value : true,
- description : 'Whether or not to build the gtk3 library'
+ description : 'Whether or not to build the GTK3 library' + type : 'boolean', value : true, + description : 'Whether or not to build the GTK4 library'