Verified Commit 8f51085d authored by Zander Brown's avatar Zander Brown
Browse files

setup introspection

We really don't need this but its another "lint" to check nothing silly is going on

Might also allow for some simple tests
parent 050c7c56
#!/bin/sh
# Wrapper for tests with use introspection data
ABS_BUILDDIR='@BUILD_DIR@'
export GI_TYPELIB_PATH="${ABS_BUILDDIR}:$GI_TYPELIB_PATH"
export LD_LIBRARY_PATH="${ABS_BUILDDIR}:${ABS_BUILDDIR}/glade:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="${ABS_BUILDDIR}:$PKG_CONFIG_PATH"
exec "$@"
......@@ -70,3 +70,11 @@ subdir('po')
subdir('doc')
meson.add_install_script('build-aux/meson/postinstall.py')
configure_file(
input: 'gi.in',
output: 'gi',
configuration: {
'BUILD_DIR': join_paths(meson.current_build_dir(), 'src')
}
)
option('gtop', type: 'boolean',
option('gtop',
type: 'boolean',
value: true,
description: 'Use libgtop to track children')
description: 'Use libgtop to track children, you probably DO want this')
option('gtk_doc',
type: 'boolean', value: false,
description: 'Whether to generate the API reference')
\ No newline at end of file
type: 'boolean',
value: false,
description: 'Whether to generate the API reference, you probably don\'t want this')
option('gir',
type: 'boolean',
value: false,
description: 'Whether to generate GIR, you probably don\'t want this')
option('vapi',
type: 'boolean',
value: false,
description: 'Whether to generate VAPI, you probably don\'t want this')
......@@ -106,7 +106,7 @@ kgx_application_get_property (GObject *object,
g_value_set_enum (value, self->theme);
break;
case PROP_FONT:
g_value_take_boxed (value, kgx_application_get_system_font (self));
g_value_take_boxed (value, kgx_application_get_font (self));
break;
case PROP_FONT_SCALE:
g_value_set_double (value, self->scale);
......@@ -517,7 +517,7 @@ kgx_application_remove_watch (KgxApplication *self,
#endif
/**
* kgx_application_get_system_font:
* kgx_application_get_font:
* @self: the #KgxApplication
*
* Creates a #PangoFontDescription for the system monospace font.
......@@ -525,7 +525,7 @@ kgx_application_remove_watch (KgxApplication *self,
* Returns: (transfer full): a new #PangoFontDescription
*/
PangoFontDescription *
kgx_application_get_system_font (KgxApplication *self)
kgx_application_get_font (KgxApplication *self)
{
// Taken from gnome-terminal
g_autofree char *font = NULL;
......
......@@ -88,6 +88,6 @@ void kgx_application_add_watch (KgxApplication *self,
void kgx_application_remove_watch (KgxApplication *self,
GPid pid);
#endif
PangoFontDescription *kgx_application_get_system_font (KgxApplication *self);
PangoFontDescription *kgx_application_get_font (KgxApplication *self);
G_END_DECLS
......@@ -171,7 +171,7 @@ kgx_process_get_exec (KgxProcess *self)
*
* Get the list of running processes
*
* Returns: (element-type Kgx.Process): List of processes free with g_ptr_array_unref()
* Returns: (transfer full) (element-type Kgx.Process): List of processes free with g_ptr_array_unref()
*/
GPtrArray *
kgx_process_get_list (void)
......
......@@ -141,6 +141,7 @@ kgx_search_box_class_init (KgxSearchBoxClass *klass)
/**
* KgxSearchBox::changed:
* @self: the #KgxSearchBox
* @search: The current contents of the #GtkSearchEntry
*
* Proxy to #GtkSearchEntry::search-changed but with the current search
......
/* kgx.h
*
* Copyright 2019 Zander Brown
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "kgx-config.h"
#include "kgx-application.h"
#include "kgx-window.h"
#include "kgx-terminal.h"
#include "kgx-search-box.h"
#include "kgx-enums.h"
#include "kgx-process.h"
#include "fp-vte-util.h"
......@@ -17,9 +17,7 @@
*/
#include <glib/gi18n.h>
#include "kgx-config.h"
#include "kgx-application.h"
#include <kgx.h>
int
main (int argc,
......
kgx_sources = [
'kgx-application.c',
'kgx-application.h',
'fp-vte-util.c',
'fp-vte-util.h',
'kgx-terminal.c',
'kgx-terminal.h',
'kgx-search-box.c',
'kgx-search-box.h',
'kgx-window.c',
'kgx-window.h',
'kgx-process.h',
]
kgx_deps = [
......@@ -47,6 +53,49 @@ kgx_dep = declare_dependency (sources: kgx_sources,
link_with: kgx_lib,
dependencies: kgx_deps)
if get_option('gir')
kgx_gir = gnome.generate_gir(
kgx_lib,
sources: kgx_sources,
header: 'kgx.h',
nsversion: '1.0',
namespace: 'Kgx',
symbol_prefix: 'kgx',
identifier_prefix: 'Kgx',
includes: [
'GObject-2.0',
'Gio-2.0',
'Atk-1.0',
'Gdk-3.0',
'Gtk-3.0',
'Pango-1.0',
'Vte-2.91',
],
dependencies: [kgx_dep],
install: false,
build_by_default: true,
# This is bad but we aren't generating a public GIR
extra_args: '--accept-unprefixed',
)
if get_option('vapi')
kgx_vala_dep = gnome.generate_vapi('Kgx-1.0',
sources: kgx_gir[0],
packages: [
'gio-2.0',
'atk',
'gtk+-3.0',
'pango',
'vte-2.91',
],
install: false,
)
endif
else
if get_option('vapi')
error('Can\'t generate VAPI without GIR')
endif
endif
executable('kgx', 'main.c',
dependencies: kgx_dep,
install: true,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment