Commit ccbcc18a authored by Felipe Borges's avatar Felipe Borges 👣

build, examples: Build the example application

gtk-frdp-viewer will be the test bed for the development of this
library.
parent 0efd2228
/* gtk-frdp-viewer.c
*
* Copyright (C) 2018 Felipe Borges <felipeborges@gnome.org>
*
* 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 <gtk-frdp.h>
static void
on_activate (GtkApplication *app)
{
GtkWindow *window;
g_assert (GTK_IS_APPLICATION (app));
/* Get the current window or create one if necessary. */
window = gtk_application_get_active_window (app);
if (window == NULL)
window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
"application", app,
"default-width", 600,
"default-height", 300,
NULL);
gtk_window_present (window);
}
int
main (int argc,
char *argv[])
{
g_autoptr(GtkApplication) app = NULL;
int ret;
app = gtk_application_new ("org.gnome.GtkFrdpViewer", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
ret = g_application_run (G_APPLICATION (app), argc, argv);
return ret;
}
example_application_sources = [
'gtk-frdp-viewer.c',
]
example_application = executable('gtk-frdp-viewer', example_application_sources,
dependencies: gtk_frdp_dep,
)
......@@ -15,5 +15,6 @@ add_project_arguments([
], language: 'c')
subdir('src')
subdir('examples')
......@@ -19,6 +19,7 @@
#ifndef GTK_FRDP_H
#define GTK_FRDP_H
#include <gtk/gtk.h>
#include <glib.h>
G_BEGIN_DECLS
......
......@@ -30,6 +30,7 @@ configure_file(
gtk_frdp_deps = [
dependency('freerdp', version: '>= 1.1'),
dependency('gio-2.0', version: '>= 2.50'),
dependency('gtk+-3.0'),
]
gtk_frdp_lib = shared_library('gtk-frdp-' + api_version,
......@@ -38,6 +39,13 @@ gtk_frdp_lib = shared_library('gtk-frdp-' + api_version,
install: true,
)
gtk_frdp_dep = declare_dependency(
sources: gtk_frdp_headers,
dependencies: gtk_frdp_deps,
link_with: gtk_frdp_lib,
include_directories: include_directories('.'),
)
install_headers(gtk_frdp_headers, subdir: 'gtk-frdp')
pkg = import('pkgconfig')
......
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