Commit ebb51098 authored by Christian Hergert's avatar Christian Hergert
Browse files

pnl: switch to libdazzle from panel-gtk

Now that we have a dependency on libdazzle, we no longer need our vendored
panel-gtk.
parent 574f364d
_build
*.swp
*~
libpnl_headers = [
'pnl-animation.h',
'pnl-dock-bin.h',
'pnl-dock-bin-edge.h',
'pnl-dock-item.h',
'pnl-dock-manager.h',
'pnl-dock-overlay.h',
'pnl-dock-overlay-edge.h',
'pnl-dock-paned.h',
'pnl-dock-revealer.h',
'pnl-dock-stack.h',
'pnl-dock-types.h',
'pnl-dock-widget.h',
'pnl-dock-window.h',
'pnl-dock.h',
'pnl-frame-source.h',
'pnl-multi-paned.h',
'pnl-tab-strip.h',
'pnl-tab.h',
'pnl.h',
]
libpnl_header_dir = get_option('includedir') + '/gnome-builder-' + meson.project_version() + '/pnl'
libpnl_conf = configuration_data()
libpnl_conf.set('MAJOR_VERSION', MAJOR_VERSION)
libpnl_conf.set('MINOR_VERSION', MINOR_VERSION)
libpnl_conf.set('MICRO_VERSION', MICRO_VERSION)
libpnl_conf.set('VERSION', meson.project_version())
libpnl_version_h = configure_file(
input: 'pnl-version.h.in',
output: 'pnl-version.h',
configuration: libpnl_conf,
install: true,
install_dir: libpnl_header_dir,
)
install_headers(libpnl_headers,
install_dir: libpnl_header_dir,
)
libpnl_resources = gnome.compile_resources('pnl-resources',
'pnl.gresource.xml',
c_name: 'pnl',
)
libpnl_sources = [
'pnl-animation.c',
'pnl-dock-bin-edge.c',
'pnl-dock-bin-edge-private.h',
'pnl-dock-bin.c',
'pnl-dock-item.c',
'pnl-dock-manager.c',
'pnl-dock-overlay-edge.c',
'pnl-dock-overlay.c',
'pnl-dock-paned-private.h',
'pnl-dock-paned.c',
'pnl-dock-revealer.c',
'pnl-dock-stack.c',
'pnl-dock-tab-strip.c',
'pnl-dock-tab-strip.h',
'pnl-dock-transient-grab.c',
'pnl-dock-transient-grab.h',
'pnl-dock-widget.c',
'pnl-dock-window.c',
'pnl-dock.c',
'pnl-frame-source.c',
'pnl-multi-paned.c',
'pnl-tab-strip.c',
'pnl-tab.c',
'pnl-util-private.h',
'pnl-util.c',
libpnl_version_h,
]
libpnl_deps = [
dependency('gtk+-3.0'),
]
libpnl_link_args = '-Wl,--version-script=' + join_paths(meson.current_source_dir(), 'pnl.map')
libpnl = shared_library('panel-gtk', libpnl_sources + [libpnl_resources[0],libpnl_resources[1]],
dependencies: libpnl_deps,
c_args: ['-DPNL_COMPILATION'],
link_args: libpnl_link_args,
link_depends: 'pnl.map',
version: '0.0.0',
install: true,
install_dir: pkglibdir,
)
libpnl_dep = declare_dependency(
sources: libpnl_version_h,
link_with: libpnl,
include_directories: include_directories('.'),
)
if get_option('with_introspection')
libpnl_gir = gnome.generate_gir(libpnl,
sources: libpnl_sources + libpnl_headers,
nsversion: '1.0',
namespace: 'Pnl',
symbol_prefix: 'pnl',
identifier_prefix: 'Pnl',
includes: ['Gdk-3.0', 'Gio-2.0', 'Gtk-3.0'],
install: true,
install_dir_gir: pkggirdir,
install_dir_typelib: pkgtypelibdir,
extra_args: [
'--c-include=pnl.h',
'-DPNL_COMPILATION',
],
)
if get_option('with_vapi')
libpnl_vapi = gnome.generate_vapi('panel-gtk',
sources: libpnl_gir[0],
packages: ['gio-2.0', 'gtk+-3.0'],
install: true,
install_dir: pkgvapidir,
)
endif
endif
This diff is collapsed.
/* pnl-animation.h
*
* Copyright (C) 2010-2016 Christian Hergert <christian@hergert.me>
*
* This file 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.1 of the License, or (at your option)
* any later version.
*
* This file 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 General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(PNL_INSIDE) && !defined(PNL_COMPILATION)
# error "Only <pnl.h> can be included directly."
#endif
#ifndef PNL_ANIMATION_H
#define PNL_ANIMATION_H
#include <gdk/gdk.h>
G_BEGIN_DECLS
#define PNL_TYPE_ANIMATION (pnl_animation_get_type())
#define PNL_TYPE_ANIMATION_MODE (pnl_animation_mode_get_type())
G_DECLARE_FINAL_TYPE (PnlAnimation, pnl_animation, PNL, ANIMATION, GInitiallyUnowned)
typedef enum
{
PNL_ANIMATION_LINEAR,
PNL_ANIMATION_EASE_IN_QUAD,
PNL_ANIMATION_EASE_OUT_QUAD,
PNL_ANIMATION_EASE_IN_OUT_QUAD,
PNL_ANIMATION_EASE_IN_CUBIC,
PNL_ANIMATION_EASE_OUT_CUBIC,
PNL_ANIMATION_EASE_IN_OUT_CUBIC,
PNL_ANIMATION_LAST
} PnlAnimationMode;
GType pnl_animation_mode_get_type (void);
void pnl_animation_start (PnlAnimation *animation);
void pnl_animation_stop (PnlAnimation *animation);
void pnl_animation_add_property (PnlAnimation *animation,
GParamSpec *pspec,
const GValue *value);
PnlAnimation *pnl_object_animatev (gpointer object,
PnlAnimationMode mode,
guint duration_msec,
GdkFrameClock *frame_clock,
const gchar *first_property,
va_list args);
PnlAnimation* pnl_object_animate (gpointer object,
PnlAnimationMode mode,
guint duration_msec,
GdkFrameClock *frame_clock,
const gchar *first_property,
...) G_GNUC_NULL_TERMINATED;
PnlAnimation* pnl_object_animate_full (gpointer object,
PnlAnimationMode mode,
guint duration_msec,
GdkFrameClock *frame_clock,
GDestroyNotify notify,
gpointer notify_data,
const gchar *first_property,
...) G_GNUC_NULL_TERMINATED;
guint pnl_animation_calculate_duration (GdkMonitor *monitor,
gdouble from_value,
gdouble to_value);
G_END_DECLS
#endif /* PNL_ANIMATION_H */
/* pnl-dock-bin-edge-private.h
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
* 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/>.
*/
#ifndef PNL_DOCK_BIN_EDGE_PRIVATE_H
#define PNL_DOCK_BIN_EDGE_PRIVATE_H
#include "pnl-dock-bin-edge.h"
G_BEGIN_DECLS
void pnl_dock_bin_edge_set_edge (PnlDockBinEdge *self,
GtkPositionType bin_edge);
G_END_DECLS
#endif /* PNL_DOCK_BIN_EDGE_PRIVATE_H */
/* pnl-dock-bin-edge.c
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
* 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 "pnl-dock-bin.h"
#include "pnl-dock-bin-edge.h"
#include "pnl-dock-bin-edge-private.h"
#include "pnl-dock-revealer.h"
typedef struct
{
GtkPositionType edge : 3;
} PnlDockBinEdgePrivate;
G_DEFINE_TYPE_EXTENDED (PnlDockBinEdge, pnl_dock_bin_edge, PNL_TYPE_DOCK_REVEALER, 0,
G_ADD_PRIVATE (PnlDockBinEdge)
G_IMPLEMENT_INTERFACE (PNL_TYPE_DOCK_ITEM, NULL))
enum {
PROP_0,
PROP_EDGE,
N_PROPS
};
enum {
MOVE_TO_BIN_CHILD,
N_SIGNALS
};
static GParamSpec *properties [N_PROPS];
static guint signals [N_SIGNALS];
static void
pnl_dock_bin_edge_update_edge (PnlDockBinEdge *self)
{
PnlDockBinEdgePrivate *priv = pnl_dock_bin_edge_get_instance_private (self);
GtkStyleContext *style_context;
PnlDockRevealerTransitionType transition_type;
const gchar *class_name = NULL;
GtkWidget *child;
GtkOrientation orientation;
g_assert (PNL_IS_DOCK_BIN_EDGE (self));
style_context = gtk_widget_get_style_context (GTK_WIDGET (self));
gtk_style_context_remove_class (style_context, "left");
gtk_style_context_remove_class (style_context, "right");
gtk_style_context_remove_class (style_context, "top");
gtk_style_context_remove_class (style_context, "bottom");
if (priv->edge == GTK_POS_LEFT)
{
class_name = "left";
transition_type = PNL_DOCK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT;
orientation = GTK_ORIENTATION_VERTICAL;
}
else if (priv->edge == GTK_POS_RIGHT)
{
class_name = "right";
transition_type = PNL_DOCK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT;
orientation = GTK_ORIENTATION_VERTICAL;
}
else if (priv->edge == GTK_POS_TOP)
{
class_name = "top";
transition_type = PNL_DOCK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN;
orientation = GTK_ORIENTATION_HORIZONTAL;
}
else if (priv->edge == GTK_POS_BOTTOM)
{
class_name = "bottom";
transition_type = PNL_DOCK_REVEALER_TRANSITION_TYPE_SLIDE_UP;
orientation = GTK_ORIENTATION_HORIZONTAL;
}
else
{
g_assert_not_reached ();
return;
}
gtk_style_context_add_class (style_context, class_name);
pnl_dock_revealer_set_transition_type (PNL_DOCK_REVEALER (self), transition_type);
child = gtk_bin_get_child (GTK_BIN (self));
if (PNL_IS_DOCK_PANED (child))
gtk_orientable_set_orientation (GTK_ORIENTABLE (child), orientation);
}
GtkPositionType
pnl_dock_bin_edge_get_edge (PnlDockBinEdge *self)
{
PnlDockBinEdgePrivate *priv = pnl_dock_bin_edge_get_instance_private (self);
g_return_val_if_fail (PNL_IS_DOCK_BIN_EDGE (self), 0);
return priv->edge;
}
void
pnl_dock_bin_edge_set_edge (PnlDockBinEdge *self,
GtkPositionType edge)
{
PnlDockBinEdgePrivate *priv = pnl_dock_bin_edge_get_instance_private (self);
g_return_if_fail (PNL_IS_DOCK_BIN_EDGE (self));
if (edge != priv->edge)
{
priv->edge = edge;
pnl_dock_bin_edge_update_edge (self);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_EDGE]);
}
}
static void
pnl_dock_bin_edge_add (GtkContainer *container,
GtkWidget *widget)
{
GtkWidget *child;
g_assert (GTK_IS_CONTAINER (container));
g_assert (GTK_IS_WIDGET (widget));
child = gtk_bin_get_child (GTK_BIN (container));
gtk_container_add (GTK_CONTAINER (child), widget);
}
static void
pnl_dock_bin_edge_real_move_to_bin_child (PnlDockBinEdge *self)
{
GtkWidget *parent;
g_assert (PNL_IS_DOCK_BIN_EDGE (self));
parent = gtk_widget_get_parent (GTK_WIDGET (self));
if (PNL_IS_DOCK_BIN (parent))
gtk_widget_grab_focus (parent);
}
static void
pnl_dock_bin_edge_constructed (GObject *object)
{
PnlDockBinEdge *self = (PnlDockBinEdge *)object;
G_OBJECT_CLASS (pnl_dock_bin_edge_parent_class)->constructed (object);
pnl_dock_bin_edge_update_edge (self);
}
static void
pnl_dock_bin_edge_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
PnlDockBinEdge *self = PNL_DOCK_BIN_EDGE (object);
switch (prop_id)
{
case PROP_EDGE:
g_value_set_enum (value, pnl_dock_bin_edge_get_edge (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
pnl_dock_bin_edge_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
PnlDockBinEdge *self = PNL_DOCK_BIN_EDGE (object);
switch (prop_id)
{
case PROP_EDGE:
pnl_dock_bin_edge_set_edge (self, g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
pnl_dock_bin_edge_class_init (PnlDockBinEdgeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
GtkBindingSet *binding_set;
object_class->constructed = pnl_dock_bin_edge_constructed;
object_class->get_property = pnl_dock_bin_edge_get_property;
object_class->set_property = pnl_dock_bin_edge_set_property;
container_class->add = pnl_dock_bin_edge_add;
klass->move_to_bin_child = pnl_dock_bin_edge_real_move_to_bin_child;
properties [PROP_EDGE] =
g_param_spec_enum ("edge",
"Edge",
"The edge of the dock this widget is attached to",
GTK_TYPE_POSITION_TYPE,
GTK_POS_LEFT,
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_properties (object_class, N_PROPS, properties);
signals [MOVE_TO_BIN_CHILD] =
g_signal_new ("move-to-bin-child",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (PnlDockBinEdgeClass, move_to_bin_child),
NULL, NULL, NULL, G_TYPE_NONE, 0);
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "move-to-bin-child", 0);
gtk_widget_class_set_css_name (widget_class, "dockbinedge");
}
static void
pnl_dock_bin_edge_init (PnlDockBinEdge *self)
{
GtkWidget *child;
child = g_object_new (PNL_TYPE_DOCK_PANED,
"visible", TRUE,
NULL);
GTK_CONTAINER_CLASS (pnl_dock_bin_edge_parent_class)->add (GTK_CONTAINER (self), child);
pnl_dock_bin_edge_update_edge (self);
}
/* pnl-dock-bin-edge.h
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
* 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/>.
*/
#ifndef PNL_DOCK_BIN_EDGE_H
#define PNL_DOCK_BIN_EDGE_H
#include "pnl-dock-revealer.h"
G_BEGIN_DECLS
#define PNL_TYPE_DOCK_BIN_EDGE (pnl_dock_bin_edge_get_type())
G_DECLARE_DERIVABLE_TYPE (PnlDockBinEdge, pnl_dock_bin_edge, PNL, DOCK_BIN_EDGE, PnlDockRevealer)
struct _PnlDockBinEdgeClass
{
PnlDockRevealerClass parent;
void (*move_to_bin_child) (PnlDockBinEdge *self);
void (*padding1) (void);
void (*padding2) (void);
void (*padding3) (void);
void (*padding4) (void);
void (*padding5) (void);
void (*padding6) (void);
void (*padding7) (void);
void (*padding8) (void);
};
GtkPositionType pnl_dock_bin_edge_get_edge (PnlDockBinEdge *self);
G_END_DECLS
#endif /* PNL_DOCK_BIN_EDGE_H */
This diff is collapsed.
/* pnl-dock-bin-bin.h
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
* 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/>.
*/
#if !defined(PNL_INSIDE) && !defined(PNL_COMPILATION)
# error "Only <pnl.h> can be included directly."
#endif
#ifndef PNL_DOCK_BIN_BIN_H
#define PNL_DOCK_BIN_BIN_H
#include "pnl-dock-types.h"
G_BEGIN_DECLS
struct _PnlDockBinClass
{
GtkContainerClass parent;
GtkWidget *(*create_edge) (PnlDockBin *self);
void (*padding1) (void);
void (*padding2) (void);
void (*padding3) (void);
void (*padding4) (void);
void (*padding5) (void);
void (*padding6) (void);
void (*padding7) (void);
void (*padding8) (void);
};
GtkWidget *pnl_dock_bin_new (void);
GtkWidget *pnl_dock_bin_get_center_widget (PnlDockBin *self);
GtkWidget *pnl_dock_bin_get_top_edge (PnlDockBin *self);
GtkWidget *pnl_dock_bin_get_left_edge (PnlDockBin *self);
GtkWidget *pnl_dock_bin_get_bottom_edge (PnlDockBin *self);
GtkWidget *pnl_dock_bin_get_right_edge (PnlDockBin *self);
G_END_DECLS
#endif /* PNL_DOCK_BIN_BIN_H */
/* pnl-dock-item.c
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>