diff options
author | Gabriel Ivascu <ivascu.gabriel59@gmail.com> | 2017-08-02 11:56:06 +0100 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2017-08-06 09:28:38 -0500 |
commit | 2a4cec1701926a35235c92344add9a1f5fc5ea71 (patch) | |
tree | b63b873cf193da44583e68c5cea91c8c7ab652d1 /lib | |
parent | c19c101d212d7ba947af728c9993f1f8e445686d (diff) | |
download | epiphany-2a4cec1701926a35235c92344add9a1f5fc5ea71.tar.gz |
build: Turn libephysync into a shared library
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-notification-container.c | 81 | ||||
-rw-r--r-- | lib/ephy-notification-container.h | 36 | ||||
-rw-r--r-- | lib/ephy-notification.c (renamed from lib/widgets/ephy-notification.c) | 0 | ||||
-rw-r--r-- | lib/ephy-notification.h (renamed from lib/widgets/ephy-notification.h) | 0 | ||||
-rw-r--r-- | lib/meson.build | 2 | ||||
-rw-r--r-- | lib/sync/meson.build | 7 | ||||
-rw-r--r-- | lib/widgets/meson.build | 1 |
7 files changed, 124 insertions, 3 deletions
diff --git a/lib/ephy-notification-container.c b/lib/ephy-notification-container.c new file mode 100644 index 000000000..8d29dbc05 --- /dev/null +++ b/lib/ephy-notification-container.c @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* + * Copyright © 2016 Gabriel Ivascu <ivascu.gabriel59@gmail.com> + * + * This file is part of Epiphany. + * + * Epiphany 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. + * + * Epiphany 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 Epiphany. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "config.h" +#include "ephy-notification-container.h" + +struct _EphyNotificationContainer { + GtkRevealer parent_instance; + + GtkWidget *grid; +}; + +struct _EphyNotificationContainerClass { + GtkRevealerClass parent_class; +}; + +G_DEFINE_TYPE (EphyNotificationContainer, ephy_notification_container, GTK_TYPE_REVEALER); + +static EphyNotificationContainer *notification_container = NULL; + +static void +ephy_notification_container_init (EphyNotificationContainer *self) +{ + /* Globally accessible singleton */ + g_assert (notification_container == NULL); + notification_container = self; + g_object_add_weak_pointer (G_OBJECT (notification_container), + (gpointer *)¬ification_container); + + gtk_widget_set_halign (GTK_WIDGET (self), GTK_ALIGN_CENTER); + gtk_widget_set_valign (GTK_WIDGET (self), GTK_ALIGN_START); + + self->grid = gtk_grid_new (); + gtk_orientable_set_orientation (GTK_ORIENTABLE (self->grid), GTK_ORIENTATION_VERTICAL); + gtk_grid_set_row_spacing (GTK_GRID (self->grid), 6); + gtk_container_add (GTK_CONTAINER (self), self->grid); +} + +static void +ephy_notification_container_class_init (EphyNotificationContainerClass *klass) +{ +} + +EphyNotificationContainer * +ephy_notification_container_get_default (void) +{ + if (notification_container != NULL) + return notification_container; + + return g_object_new (EPHY_TYPE_NOTIFICATION_CONTAINER, + NULL); +} + +void +ephy_notification_container_add_notification (EphyNotificationContainer *self, + GtkWidget *notification) +{ + g_return_if_fail (EPHY_IS_NOTIFICATION_CONTAINER (self)); + g_return_if_fail (GTK_IS_WIDGET (notification)); + + gtk_container_add (GTK_CONTAINER (self->grid), notification); + gtk_widget_show_all (GTK_WIDGET (self)); + gtk_revealer_set_reveal_child (GTK_REVEALER (self), TRUE); +} diff --git a/lib/ephy-notification-container.h b/lib/ephy-notification-container.h new file mode 100644 index 000000000..ce7ce8376 --- /dev/null +++ b/lib/ephy-notification-container.h @@ -0,0 +1,36 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* + * Copyright © 2016 Gabriel Ivascu <ivascu.gabriel59@gmail.com> + * + * This file is part of Epiphany. + * + * Epiphany 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. + * + * Epiphany 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 Epiphany. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include <gtk/gtk.h> + +G_BEGIN_DECLS + +#define EPHY_TYPE_NOTIFICATION_CONTAINER (ephy_notification_container_get_type ()) + +G_DECLARE_FINAL_TYPE (EphyNotificationContainer, ephy_notification_container, EPHY, NOTIFICATION_CONTAINER, GtkRevealer) + +EphyNotificationContainer *ephy_notification_container_get_default (void); + +void ephy_notification_container_add_notification (EphyNotificationContainer *self, + GtkWidget *notification); + +G_END_DECLS diff --git a/lib/widgets/ephy-notification.c b/lib/ephy-notification.c index 6c808c0ca..6c808c0ca 100644 --- a/lib/widgets/ephy-notification.c +++ b/lib/ephy-notification.c diff --git a/lib/widgets/ephy-notification.h b/lib/ephy-notification.h index af08a6490..af08a6490 100644 --- a/lib/widgets/ephy-notification.h +++ b/lib/ephy-notification.h diff --git a/lib/meson.build b/lib/meson.build index d2ee3bfbf..aa1055756 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -22,6 +22,8 @@ libephymisc_sources = [ 'ephy-filters-manager.c', 'ephy-gui.c', 'ephy-langs.c', + 'ephy-notification.c', + 'ephy-notification-container.c', 'ephy-permissions-manager.c', 'ephy-profile-utils.c', 'ephy-search-engine-manager.c', diff --git a/lib/sync/meson.build b/lib/sync/meson.build index 6851b6c51..5a5b066e8 100644 --- a/lib/sync/meson.build +++ b/lib/sync/meson.build @@ -14,6 +14,7 @@ libephysync_sources = [ ] libephysync_deps = [ + ephymisc_dep, glib_dep, gmp_dep, hogweed_dep, @@ -33,10 +34,12 @@ libephysync_includes = include_directories( 'debug' ) -libephysync = static_library('ephysync', +libephysync = shared_library('ephysync', libephysync_sources, dependencies: libephysync_deps, - include_directories: libephysync_includes + include_directories: libephysync_includes, + install: true, + install_dir: pkglibdir ) ephysync_dep = declare_dependency( diff --git a/lib/widgets/meson.build b/lib/widgets/meson.build index 76ff48b7c..5669df69e 100644 --- a/lib/widgets/meson.build +++ b/lib/widgets/meson.build @@ -18,7 +18,6 @@ libephywidgets_sources = [ 'ephy-file-chooser.c', 'ephy-location-entry.c', 'ephy-middle-clickable-button.c', - 'ephy-notification.c', 'ephy-security-popover.c', 'ephy-title-box.c', 'ephy-title-widget.c', |