--- Begin Message ---
Package: bisho
Version: 0.27.2+git20111122.9e68ef3d-2
Severity: important
Tags: patch
Dear Maintainer (actually myself),
I'd like to update mx to 2.0. And it breaks bisho. So I made a patch
that ports bisho to mx2.0.
Just a record here and I'll fix bisho right after mx2.0 accepted into
archive.
--
PaulLiu (劉穎駿)
E-mail: Ying-Chun Liu (PaulLiu) <[email protected]>
diff -Nru bisho-0.27.2+git20111122.9e68ef3d/debian/changelog
bisho-0.27.2+git20111122.9e68ef3d/debian/changelog
--- bisho-0.27.2+git20111122.9e68ef3d/debian/changelog 2012-09-26
14:21:09.000000000 +0800
+++ bisho-0.27.2+git20111122.9e68ef3d/debian/changelog 2016-06-14
15:24:38.000000000 +0800
@@ -1,3 +1,10 @@
+bisho (0.27.2+git20111122.9e68ef3d-3) unstable; urgency=low
+
+ * port_to_mx2.0.patch: porting to mx2.0
+ * Bump Standards-Versino to 3.9.8: nothing needs to be changed.
+
+ -- Ying-Chun Liu (PaulLiu) <[email protected]> Tue, 14 Jun 2016 15:13:34
+0800
+
bisho (0.27.2+git20111122.9e68ef3d-2) unstable; urgency=low
* debian/patches/fix_panes_linking.patch: Fix missing linking libraries.
diff -Nru bisho-0.27.2+git20111122.9e68ef3d/debian/clean
bisho-0.27.2+git20111122.9e68ef3d/debian/clean
--- bisho-0.27.2+git20111122.9e68ef3d/debian/clean 2012-03-26
17:14:26.000000000 +0800
+++ bisho-0.27.2+git20111122.9e68ef3d/debian/clean 2016-06-14
15:10:01.000000000 +0800
@@ -27,3 +27,4 @@
m4/ltversion.m4
panes/Makefile.in
bisho.1
+po/POTFILES
diff -Nru bisho-0.27.2+git20111122.9e68ef3d/debian/control
bisho-0.27.2+git20111122.9e68ef3d/debian/control
--- bisho-0.27.2+git20111122.9e68ef3d/debian/control 2012-03-26
18:25:44.000000000 +0800
+++ bisho-0.27.2+git20111122.9e68ef3d/debian/control 2016-06-14
15:13:15.000000000 +0800
@@ -6,10 +6,10 @@
intltool, libgconf2-dev (>= 2.9.2), libgnome-keyring-dev,
libgtk2.0-dev (>= 2.12), libsocialweb-dev (>= 0.25.7),
libsocialweb-client-dev (>= 0.25.7), librest-dev (>= 0.7.5),
- librest-extras-dev, libmx-dev (>= 1.1.8),
+ librest-extras-dev, libmx-dev (>= 1.99.4),
libsoup2.4-dev, pkg-config, autoconf, automake, libunique-dev,
docbook-to-man
-Standards-Version: 3.9.3
+Standards-Version: 3.9.8
Homepage: http://meego.com/
Package: bisho
diff -Nru bisho-0.27.2+git20111122.9e68ef3d/debian/patches/port_to_mx2.0.patch
bisho-0.27.2+git20111122.9e68ef3d/debian/patches/port_to_mx2.0.patch
--- bisho-0.27.2+git20111122.9e68ef3d/debian/patches/port_to_mx2.0.patch
1970-01-01 08:00:00.000000000 +0800
+++ bisho-0.27.2+git20111122.9e68ef3d/debian/patches/port_to_mx2.0.patch
2016-06-14 15:10:56.000000000 +0800
@@ -0,0 +1,1077 @@
+Index: bisho-0.27.2+git20111122.9e68ef3d/configure.ac
+===================================================================
+--- bisho-0.27.2+git20111122.9e68ef3d.orig/configure.ac
++++ bisho-0.27.2+git20111122.9e68ef3d/configure.ac
+@@ -37,7 +37,7 @@ PKG_CHECK_MODULES(DEPS, gmodule-export-2
+ rest-0.7
+ rest-extras-0.7
+ unique-1.0
+- mx-gtk-1.0)
++ mx-2.0)
+
+ AC_ARG_ENABLE([capplet],
+ [AC_HELP_STRING([--disable-capplet],
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-frame.c
+===================================================================
+--- /dev/null
++++ bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-frame.c
+@@ -0,0 +1,389 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/*
++ * Copyright 2009 Intel Corporation.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms and conditions of the GNU Lesser General Public License,
++ * version 2.1, as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * Boston, MA 02111-1307, USA.
++ *
++ */
++
++/**
++ * SECTION:mx-gtk-frame
++ * @short_description: a specially styled frame for GTK+
++ *
++ * A specially styled frame for use in GTK+ applications.
++ */
++
++
++#include "mx-gtk-frame.h"
++#include <math.h>
++
++static GdkColor mx_gtk_frame_default_border_color = { 0, 0xdddd, 0xe2e2,
0xe5e5 };
++
++static void mx_gtk_frame_buildable_init (GtkBuildableIface *iface);
++static void mx_gtk_frame_buildable_add_child (GtkBuildable *buildable,
++ GtkBuilder *builder,
++ GObject *child,
++ const gchar *type);
++
++G_DEFINE_TYPE_WITH_CODE (MxGtkFrame, mx_gtk_frame, GTK_TYPE_FRAME,
++ G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
mx_gtk_frame_buildable_init))
++
++static void
++mx_gtk_frame_dispose (GObject *object)
++{
++ G_OBJECT_CLASS (mx_gtk_frame_parent_class)->dispose (object);
++}
++
++static void
++mx_gtk_frame_finalize (GObject *object)
++{
++ G_OBJECT_CLASS (mx_gtk_frame_parent_class)->finalize (object);
++}
++
++static void
++mx_gtk_frame_update_style (MxGtkFrame *frame)
++{
++ GdkColor *border_color;
++ char *font = NULL;
++
++ gtk_widget_style_get (GTK_WIDGET (frame),
++ "border-color", &border_color,
++ "title-font", &font,
++ NULL);
++
++ if (border_color)
++ {
++ frame->border_color = *border_color;
++ gdk_color_free (border_color);
++ }
++ else
++ {
++ frame->border_color = mx_gtk_frame_default_border_color;
++ }
++
++ if (font)
++ {
++ GtkWidget *label_widget;
++
++ label_widget = gtk_frame_get_label_widget (GTK_FRAME (frame));
++
++ if (label_widget)
++ {
++ PangoFontDescription *desc;
++ desc = pango_font_description_from_string (font);
++ gtk_widget_modify_font (label_widget, desc);
++ pango_font_description_free (desc);
++ }
++ g_free (font);
++ }
++}
++
++static void
++label_changed_cb (MxGtkFrame *frame)
++{
++ char *font = NULL;
++ GtkFrame *gtk_frame = GTK_FRAME (frame);
++ GtkWidget *label_widget;
++
++ label_widget = gtk_frame_get_label_widget (gtk_frame);
++
++ if (!label_widget)
++ return;
++
++ /* ensure font is correct */
++ gtk_widget_style_get (GTK_WIDGET (frame),
++ "title-font", &font,
++ NULL);
++ if (font)
++ {
++ PangoFontDescription *desc;
++ desc = pango_font_description_from_string (font);
++ gtk_widget_modify_font (label_widget, desc);
++ pango_font_description_free (desc);
++ g_free (font);
++ }
++
++ gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 1.0);
++}
++static void
++rounded_rectangle (cairo_t * cr,
++ double x,
++ double y,
++ double w,
++ double h,
++ guint radius)
++{
++ if (radius > w / 2)
++ radius = w / 2;
++ if (radius > h / 2)
++ radius = h / 2;
++
++ cairo_move_to (cr, x + radius, y);
++ cairo_arc (cr, x + w - radius, y + radius, radius, M_PI * 1.5, M_PI * 2);
++ cairo_arc (cr, x + w - radius, y + h - radius, radius, 0, M_PI * 0.5);
++ cairo_arc (cr, x + radius, y + h - radius, radius, M_PI * 0.5, M_PI);
++ cairo_arc (cr, x + radius, y + radius, radius, M_PI, M_PI * 1.5);
++}
++
++static void
++mx_gtk_frame_paint (GtkWidget *widget,
++ GdkRectangle *area)
++{
++ MxGtkFrame *frame = MX_GTK_FRAME (widget);
++ cairo_t *cairo;
++ GtkStyle *style;
++ guint width;
++ GtkAllocation allocation;
++
++ g_return_if_fail (widget != NULL);
++ g_return_if_fail (MX_GTK_IS_FRAME (widget));
++ g_return_if_fail (area != NULL);
++
++ style = gtk_widget_get_style (widget);
++ cairo = gdk_cairo_create (gtk_widget_get_window (widget));
++ width = gtk_container_get_border_width (GTK_CONTAINER (widget));
++
++ /* clip to area */
++ gdk_cairo_rectangle (cairo, area);
++ cairo_clip (cairo);
++
++ /* initialise the background */
++ gdk_cairo_set_source_color (cairo, &style->bg[gtk_widget_get_state
(widget)]);
++ gtk_widget_get_allocation (widget, &allocation);
++ cairo_rectangle (cairo, allocation.x, allocation.y,
++ allocation.width, allocation.height);
++ cairo_fill (cairo);
++
++ /* draw border */
++ if (width != 0)
++ {
++ gdk_cairo_set_source_color (cairo, &frame->border_color);
++ cairo_set_line_width (cairo, width);
++
++ rounded_rectangle (cairo,
++ allocation.x + (width / 2),
++ allocation.y + (width / 2),
++ allocation.width - (width),
++ allocation.height - (width),
++ width);
++
++ cairo_stroke (cairo);
++ }
++
++ cairo_destroy (cairo);
++}
++
++static gboolean
++mx_gtk_frame_expose (GtkWidget *widget,
++ GdkEventExpose *event)
++{
++ GtkWidgetClass *grand_parent;
++
++ if (gtk_widget_is_drawable (widget))
++ {
++ mx_gtk_frame_paint (widget, &event->area);
++
++ grand_parent = GTK_WIDGET_CLASS (g_type_class_peek_parent
(mx_gtk_frame_parent_class));
++ grand_parent->expose_event (widget, event);
++ }
++ return FALSE;
++}
++
++static void
++mx_gtk_frame_size_request (GtkWidget *widget,
++ GtkRequisition *requisition)
++{
++ GtkFrame *frame = GTK_FRAME (widget);
++ GtkBin *bin = GTK_BIN (widget);
++ GtkRequisition child_req;
++ GtkRequisition title_req;
++ GtkWidget *label_widget;
++ guint border_width;
++ GtkStyle *style;
++ GtkWidget *child;
++
++ child_req.width = child_req.height = 0;
++ child = gtk_bin_get_child (bin);
++
++ if (child)
++ gtk_widget_size_request (child, &child_req);
++
++ title_req.width = title_req.height = 0;
++
++ label_widget = gtk_frame_get_label_widget (frame);
++
++ if (label_widget)
++ {
++ gtk_widget_size_request (label_widget, &title_req);
++ }
++
++ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
++ style = gtk_widget_get_style (widget);
++
++ requisition->width = MAX (child_req.width, title_req.width) +
++ 2 * (border_width + style->xthickness);
++ requisition->height = title_req.height + child_req.height +
++ 2 * (border_width + style->ythickness);
++}
++
++
++
++static void
++mx_gtk_frame_size_allocate (GtkWidget *widget,
++ GtkAllocation *allocation)
++{
++ GtkBin *bin = GTK_BIN (widget);
++ GtkFrame *frame = GTK_FRAME (widget);
++ GtkAllocation child_allocation, title_allocation, old_allocation = { 0, };
++ int xmargin, ymargin;
++ guint border_width;
++ GtkStyle *style;
++ GtkWidget *label_widget, *child;
++
++ gtk_widget_set_allocation (widget, allocation);
++
++ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
++ style = gtk_widget_get_style (widget);
++ xmargin = border_width + style->xthickness;
++ ymargin = border_width + style->ythickness;
++
++ title_allocation.height = title_allocation.width = 0;
++ label_widget = gtk_frame_get_label_widget (frame);
++ if (label_widget)
++ {
++ GtkRequisition title_req;
++
++ gtk_widget_get_child_requisition (label_widget, &title_req);
++
++
++ title_allocation.x = allocation->x + xmargin;
++ title_allocation.y = allocation->y + ymargin;
++ title_allocation.width = MIN (title_req.width,
++ allocation->width - 2 * xmargin);
++ title_allocation.height = title_req.height;
++ gtk_widget_size_allocate (label_widget, &title_allocation);
++
++ }
++
++ child = gtk_bin_get_child (bin);
++ if (child)
++ gtk_widget_get_allocation (child, &old_allocation);
++
++ child_allocation.x = allocation->x + xmargin;
++ child_allocation.y = allocation->y + ymargin + title_allocation.height;
++ child_allocation.width = allocation->width - 2 * xmargin;
++ child_allocation.height = allocation->height - 2 * ymargin -
title_allocation.height;
++
++ if (gtk_widget_get_mapped (widget) &&
++ (child_allocation.x != old_allocation.x ||
++ child_allocation.y != old_allocation.y ||
++ child_allocation.width != old_allocation.width ||
++ child_allocation.height != old_allocation.height))
++ {
++ gdk_window_invalidate_rect (gtk_widget_get_window (widget), allocation,
++ FALSE);
++ }
++
++ if (child && gtk_widget_get_visible (child))
++ {
++ gtk_widget_size_allocate (child, &child_allocation);
++ }
++
++
++ /* frame->child_allocation is only used inside GtkFrame paint and
++ * size_allocate, so it doesn't strictly need to be set since MxGtkFrame
++ * overrides both functions without chaining up */
++ /* frame->child_allocation = child_allocation; */
++}
++
++static void mx_gtk_frame_style_set (GtkWidget *widget,
++ GtkStyle *previous)
++{
++ MxGtkFrame *frame = MX_GTK_FRAME (widget);
++
++ mx_gtk_frame_update_style (frame);
++
++ GTK_WIDGET_CLASS (mx_gtk_frame_parent_class)->style_set (widget, previous);
++}
++
++static void
++mx_gtk_frame_class_init (MxGtkFrameClass *klass)
++{
++ GObjectClass *object_class = G_OBJECT_CLASS (klass);
++ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
++ GParamSpec *pspec;
++
++ object_class->dispose = mx_gtk_frame_dispose;
++ object_class->finalize = mx_gtk_frame_finalize;
++
++ widget_class->expose_event = mx_gtk_frame_expose;
++ widget_class->size_request = mx_gtk_frame_size_request;
++ widget_class->size_allocate = mx_gtk_frame_size_allocate;
++ widget_class->style_set = mx_gtk_frame_style_set;
++
++ pspec = g_param_spec_boxed ("border-color",
++ "Border color",
++ "Color of the outside border",
++ GDK_TYPE_COLOR,
++ G_PARAM_READABLE);
++ gtk_widget_class_install_style_property (widget_class, pspec);
++ pspec = g_param_spec_string ("title-font",
++ "Title font",
++ "Pango font description string for title text",
++ "12",
++ G_PARAM_READWRITE);
++ gtk_widget_class_install_style_property (widget_class, pspec);
++}
++
++static void
++mx_gtk_frame_buildable_add_child (GtkBuildable *buildable,
++ GtkBuilder *builder,
++ GObject *child,
++ const gchar *type)
++{
++ if (!type)
++ gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child));
++ else
++ GTK_BUILDER_WARN_INVALID_CHILD_TYPE (MX_GTK_FRAME (buildable), type);
++}
++
++static void
++mx_gtk_frame_buildable_init (GtkBuildableIface *iface)
++{
++ iface->add_child = mx_gtk_frame_buildable_add_child;
++}
++
++static void
++mx_gtk_frame_init (MxGtkFrame *self)
++{
++ g_signal_connect (self, "notify::label-widget",
++ G_CALLBACK (label_changed_cb), NULL);
++}
++
++/**
++ * mx_gtk_frame_new:
++ *
++ * Create a new specially styled frame.
++ *
++ * Returns: a newly allocated #MxGtkFrame
++ */
++GtkWidget*
++mx_gtk_frame_new (void)
++{
++ return g_object_new (MX_GTK_TYPE_FRAME,
++ "border-width", 4,
++ NULL);
++}
++
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-frame.h
+===================================================================
+--- /dev/null
++++ bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-frame.h
+@@ -0,0 +1,67 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/*
++ * Copyright 2009 Intel Corporation.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms and conditions of the GNU Lesser General Public License,
++ * version 2.1, as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * Boston, MA 02111-1307, USA.
++ *
++ */
++#ifndef _MX_GTK_FRAME
++#define _MX_GTK_FRAME
++
++#include <glib-object.h>
++#include <gtk/gtk.h>
++
++G_BEGIN_DECLS
++
++#define MX_GTK_TYPE_FRAME mx_gtk_frame_get_type ()
++
++#define MX_GTK_FRAME(obj) \
++ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MX_GTK_TYPE_FRAME, MxGtkFrame))
++
++#define MX_GTK_FRAME_CLASS(klass) \
++ (G_TYPE_CHECK_CLASS_CAST ((klass), MX_GTK_TYPE_FRAME, MxGtkFrameClass))
++
++#define MX_GTK_IS_FRAME(obj) \
++ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MX_GTK_TYPE_FRAME))
++
++#define MX_GTK_IS_FRAME_CLASS(klass) \
++ (G_TYPE_CHECK_CLASS_TYPE ((klass), MX_GTK_TYPE_FRAME))
++
++#define MX_GTK_FRAME_GET_CLASS(obj) \
++ (G_TYPE_INSTANCE_GET_CLASS ((obj), MX_GTK_TYPE_FRAME, MxGtkFrameClass))
++
++/**
++ * MxGtkFrame:
++ *
++ * The contents of this structure are private and should only be accessed
++ * through the public API.
++ */
++typedef struct {
++ /*< private >*/
++ GtkFrame parent;
++ GdkColor border_color;
++} MxGtkFrame;
++
++typedef struct {
++ GtkFrameClass parent_class;
++} MxGtkFrameClass;
++
++GType mx_gtk_frame_get_type (void);
++
++GtkWidget* mx_gtk_frame_new (void);
++
++G_END_DECLS
++
++#endif
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk.h
+===================================================================
+--- /dev/null
++++ bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk.h
+@@ -0,0 +1,35 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++
++/*
++ * mx.h: Collection of high-level actors for Clutter
++ *
++ * Copyright 2007 OpenedHand
++ * Copyright 2009 Intel Corporation.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms and conditions of the GNU Lesser General Public License,
++ * version 2.1, as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * Boston, MA 02111-1307, USA.
++ *
++ */
++
++#ifndef __MX_GTK_H__
++#define __MX_GTK_H__
++
++#define MX_H_INSIDE
++
++#include "mx-gtk-light-switch.h"
++#include "mx-gtk-frame.h"
++
++#undef MX_H_INSIDE
++
++#endif /* __MX_GTK_H__ */
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-light-switch.c
+===================================================================
+--- /dev/null
++++ bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-light-switch.c
+@@ -0,0 +1,438 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/*
++ * Copyright 2009 Intel Corporation.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms and conditions of the GNU Lesser General Public License,
++ * version 2.1, as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * Boston, MA 02111-1307, USA.
++ *
++ */
++
++/**
++ * SECTION:mx-gtk-light-switch
++ * @short_description: a toggle switch between two states
++ *
++ * A visual representation of a toggle switch that can move between two
states.
++ */
++
++#include <config.h>
++#include "mx-gtk-light-switch.h"
++
++#include <glib/gi18n-lib.h>
++
++/* We use the special gcc constructor attribute so we can avoid
++ * requiring an init function to get translations to work! This
++ * function is also in mx-utils but we also need it here
++ * because that is a separate library */
++static void __attribute__ ((constructor))
++_start (void)
++{
++ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
++ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
++}
++
++G_DEFINE_TYPE (MxGtkLightSwitch, mx_gtk_light_switch, GTK_TYPE_DRAWING_AREA)
++
++#define MX_GTK_LIGHT_SWITCH_GET_PRIVATE(o) \
++ (G_TYPE_INSTANCE_GET_PRIVATE ((o), MX_GTK_TYPE_LIGHT_SWITCH,
MxGtkLightSwitchPrivate))
++
++static gboolean mx_gtk_light_switch_configure (GtkWidget *lightswitch,
++ GdkEventConfigure *event);
++static gboolean mx_gtk_light_switch_expose (GtkWidget *lightswitch,
++ GdkEventExpose *event);
++static gboolean mx_gtk_light_switch_button_release (GtkWidget
*lightswitch,
++ GdkEventButton *event);
++static gboolean mx_gtk_light_switch_button_press (GtkWidget *lightswitch,
++ GdkEventButton *event);
++static gboolean mx_gtk_light_switch_motion_notify (GtkWidget
*lightswitch,
++ GdkEventMotion *event);
++static void mx_gtk_light_switch_size_request (GtkWidget *lightswitch,
++ GtkRequisition *req);
++
++static void mx_gtk_light_switch_style_set (GtkWidget *lightswitch,
++ GtkStyle *previous_style);
++
++enum {
++ SWITCH_FLIPPED,
++ LAST_SIGNAL
++};
++
++static guint mx_gtk_light_switch_signals[LAST_SIGNAL] = { 0 };
++
++enum {
++ PROP_0,
++ PROP_ACTIVE,
++};
++
++typedef struct _MxGtkLightSwitchPrivate MxGtkLightSwitchPrivate;
++
++struct _MxGtkLightSwitchPrivate {
++ gboolean active; /* boolean state of switch */
++ gboolean dragging; /* true if dragging switch */
++ gint x; /* the x position of the switch */
++ gint drag_start; /* position dragging started at */
++ gint drag_threshold;
++ gint switch_width;
++ gint switch_height;
++ gint trough_width;
++ gint offset; /* offset of the mouse to slider when dragging */
++};
++
++static void
++mx_gtk_light_switch_set_property (GObject *object,
++ guint prop_id,
++ const GValue *value,
++ GParamSpec *pspec)
++{
++ MxGtkLightSwitch *ls;
++
++ ls = MX_GTK_LIGHT_SWITCH (object);
++
++ switch (prop_id)
++ {
++ case PROP_ACTIVE:
++ mx_gtk_light_switch_set_active (ls, g_value_get_boolean (value));
++ break;
++ default:
++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++ }
++}
++
++static void
++mx_gtk_light_switch_get_property (GObject *object,
++ guint prop_id,
++ GValue *value,
++ GParamSpec *pspec)
++{
++ MxGtkLightSwitchPrivate *priv;
++
++ priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE (object);
++
++ switch (prop_id)
++ {
++ case PROP_ACTIVE:
++ g_value_set_boolean (value, priv->active);
++ break;
++ default:
++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
++ }
++}
++
++static void
++mx_gtk_light_switch_class_init (MxGtkLightSwitchClass *klass)
++{
++ GObjectClass *object_class;
++ GtkWidgetClass *widget_class;
++ GParamSpec *spec;
++
++ object_class = G_OBJECT_CLASS (klass);
++ widget_class = GTK_WIDGET_CLASS (klass);
++
++ object_class->set_property = mx_gtk_light_switch_set_property;
++ object_class->get_property = mx_gtk_light_switch_get_property;
++
++ widget_class->configure_event = mx_gtk_light_switch_configure;
++ widget_class->expose_event = mx_gtk_light_switch_expose;
++ widget_class->button_release_event = mx_gtk_light_switch_button_release;
++ widget_class->button_press_event = mx_gtk_light_switch_button_press;
++ widget_class->motion_notify_event = mx_gtk_light_switch_motion_notify;
++ widget_class->size_request = mx_gtk_light_switch_size_request;
++ widget_class->style_set = mx_gtk_light_switch_style_set;
++
++ spec = g_param_spec_boolean ("active",
++ "Active",
++ "Is the light switch on or not",
++ FALSE,
++ G_PARAM_READWRITE);
++ g_object_class_install_property (object_class, PROP_ACTIVE, spec);
++
++ /* MxGtkLightSwitch signals */
++ mx_gtk_light_switch_signals[SWITCH_FLIPPED] =
++ g_signal_new ("switch-flipped",
++ G_OBJECT_CLASS_TYPE (object_class),
++ G_SIGNAL_RUN_FIRST,
++ G_STRUCT_OFFSET (MxGtkLightSwitchClass, switch_flipped),
++ NULL, NULL,
++ g_cclosure_marshal_VOID__BOOLEAN,
++ G_TYPE_NONE, 1,
++ G_TYPE_BOOLEAN);
++
++ g_type_class_add_private (klass,
++ sizeof (MxGtkLightSwitchPrivate));
++}
++
++static void
++mx_gtk_light_switch_init (MxGtkLightSwitch *self)
++{
++ MxGtkLightSwitchPrivate *priv;
++
++ priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE (self);
++ priv->active = FALSE;
++ priv->x = 0;
++
++ /* add events, do initial draw/update, etc */
++ gtk_widget_add_events (GTK_WIDGET (self),
++ GDK_BUTTON_PRESS_MASK
++ | GDK_BUTTON_RELEASE_MASK
++ | GDK_POINTER_MOTION_MASK);
++}
++
++static void
++mx_gtk_light_switch_size_request (GtkWidget *lightswitch,
++ GtkRequisition *req)
++{
++ MxGtkLightSwitchPrivate *priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE
(lightswitch);
++
++ req->height = priv->switch_height;
++ req->width = priv->trough_width;
++}
++
++static void
++mx_gtk_light_switch_style_set (GtkWidget *lightswitch,
++ GtkStyle *previous_style)
++{
++ MxGtkLightSwitchPrivate *priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE
(lightswitch);
++
++ /* TODO: use style properties for these values */
++
++ /* MxToggle is 98x24, so make sure light-switch is at least this size */
++ priv->trough_width = 98;
++ priv->switch_height = 24;
++ priv->switch_width = 50;
++}
++
++static gboolean
++mx_gtk_light_switch_configure (GtkWidget *lightswitch,
++ GdkEventConfigure *event)
++{
++ MxGtkLightSwitchPrivate *priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE
(lightswitch);
++
++ if (priv->active)
++ priv->x = priv->trough_width - priv->switch_width;
++ else
++ priv->x = 0;
++
++ return FALSE;
++}
++
++static gboolean
++mx_gtk_light_switch_expose (GtkWidget *lightswitch,
++ GdkEventExpose *event)
++{
++ MxGtkLightSwitchPrivate *priv;
++ GtkStyle *style;
++ GtkStateType state_type;
++ cairo_t *cr;
++
++ cr = gdk_cairo_create (gtk_widget_get_window (lightswitch));
++
++ cairo_rectangle (cr,
++ event->area.x,
++ event->area.y,
++ event->area.width,
++ event->area.height);
++
++ cairo_clip (cr);
++
++ priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE (lightswitch);
++ style = gtk_widget_get_style (lightswitch);
++ state_type = gtk_widget_get_state (lightswitch);
++
++ /* draw the trough */
++ gtk_paint_box (style,
++ gtk_widget_get_window (lightswitch),
++ (state_type != GTK_STATE_INSENSITIVE && priv->active)
++ ? GTK_STATE_SELECTED : state_type,
++ GTK_SHADOW_IN,
++ NULL,
++ NULL,
++ "light-switch-trough",
++ 0,
++ 0,
++ (priv->trough_width),
++ priv->switch_height);
++
++
++ /* draw the switch itself */
++ if (state_type != GTK_STATE_INSENSITIVE)
++ {
++ gtk_paint_box (style,
++ gtk_widget_get_window (lightswitch),
++ gtk_widget_get_state (lightswitch),
++ GTK_SHADOW_OUT,
++ NULL,
++ NULL,
++ "light-switch-handle",
++ priv->x + style->xthickness,
++ style->ythickness,
++ priv->switch_width - style->xthickness * 2,
++ priv->switch_height - style->ythickness * 2);
++ }
++
++ cairo_destroy (cr);
++
++ return FALSE;
++}
++
++static gboolean
++mx_gtk_light_switch_motion_notify (GtkWidget *lightswitch,
++ GdkEventMotion *event)
++{
++ MxGtkLightSwitchPrivate *priv;
++
++ priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE (lightswitch);
++
++ if (ABS (event->x - priv->drag_start) < priv->drag_threshold)
++ return TRUE;
++
++ if (event->state & GDK_BUTTON1_MASK)
++ {
++ gint position = event->x - priv->offset;
++
++ if (position > (priv->trough_width - priv->switch_width))
++ priv->x = (priv->trough_width - priv->switch_width);
++ else if (position < 0)
++ priv->x = 0;
++ else
++ priv->x = position;
++
++ priv->dragging = TRUE;
++ gtk_widget_queue_draw ((GtkWidget *) lightswitch);
++ }
++
++ return TRUE;
++}
++
++/**
++ * mx_gtk_light_switch_get_active:
++ * @lightswitch: A #MxGtkLightSwitch
++ *
++ * Get the value of the "active" property
++ *
++ * Returns: #TRUE if the switch is "on"
++ */
++gboolean
++mx_gtk_light_switch_get_active (MxGtkLightSwitch *lightswitch)
++{
++ MxGtkLightSwitchPrivate *priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE
(lightswitch);
++
++ return priv->active;
++}
++
++/**
++ * mx_gtk_light_switch_set_active:
++ * @lightswitch: A #MxGtkLightSwitch
++ * @active: #TRUE to set the switch to its ON state
++ *
++ * Set the value of the "active" property
++ *
++ */
++void
++mx_gtk_light_switch_set_active (MxGtkLightSwitch *lightswitch,
++ gboolean active)
++{
++ MxGtkLightSwitchPrivate *priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE
(lightswitch);
++
++ if (priv->active == active)
++ {
++ return;
++ }
++ else
++ {
++ priv->active = active;
++ if (active == TRUE)
++ {
++ priv->x = priv->trough_width - priv->switch_width;
++ }
++ else
++ {
++ priv->x = 0;
++ }
++
++ gtk_widget_queue_draw ((GtkWidget *) lightswitch);
++
++ g_object_notify (G_OBJECT (lightswitch), "active");
++ g_signal_emit (lightswitch,
++ mx_gtk_light_switch_signals[SWITCH_FLIPPED],
++ 0,
++ priv->active);
++ }
++}
++
++static gboolean
++mx_gtk_light_switch_button_press (GtkWidget *lightswitch,
++ GdkEventButton *event)
++{
++ MxGtkLightSwitchPrivate *priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE
(lightswitch);
++
++ if (priv->active)
++ priv->offset = event->x - (priv->trough_width - priv->switch_width);
++ else
++ priv->offset = event->x;
++
++ priv->drag_start = event->x;
++
++ g_object_get (gtk_widget_get_settings (lightswitch),
++ "gtk-dnd-drag-threshold", &priv->drag_threshold,
++ NULL);
++
++ return FALSE;
++}
++
++static gboolean
++mx_gtk_light_switch_button_release (GtkWidget *lightswitch,
++ GdkEventButton *event)
++{
++ MxGtkLightSwitchPrivate *priv;
++
++ priv = MX_GTK_LIGHT_SWITCH_GET_PRIVATE (lightswitch);
++
++ /* detect whereabouts we are and "drop" into a state */
++ if (priv->dragging)
++ {
++ priv->dragging = FALSE;
++ if (priv->x + (priv->switch_width / 2) > priv->trough_width / 2)
++ {
++ mx_gtk_light_switch_set_active ((MxGtkLightSwitch *) lightswitch,
TRUE);
++ priv->x = priv->trough_width - priv->switch_width;
++ }
++ else
++ {
++ mx_gtk_light_switch_set_active ((MxGtkLightSwitch *) lightswitch,
FALSE);
++ priv->x = 0;
++ }
++ /* we always need to queue a redraw after dragging to put the slider
back
++ * in the correct place */
++ gtk_widget_queue_draw ((GtkWidget *) lightswitch);
++ }
++ else
++ {
++ mx_gtk_light_switch_set_active ((MxGtkLightSwitch *) lightswitch,
!priv->active);
++ }
++
++ return FALSE;
++}
++
++/**
++ * mx_gtk_light_switch_new:
++ *
++ * Create a #MxGtkLightSwitch
++ *
++ * Returns: a newly allocated #MxGtkLightSwitch
++ */
++GtkWidget*
++mx_gtk_light_switch_new (void)
++{
++ return g_object_new (MX_GTK_TYPE_LIGHT_SWITCH, NULL);
++}
++
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-light-switch.h
+===================================================================
+--- /dev/null
++++ bisho-0.27.2+git20111122.9e68ef3d/src/mx-gtk/mx-gtk-light-switch.h
+@@ -0,0 +1,71 @@
++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
++/*
++ * Copyright 2009 Intel Corporation.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms and conditions of the GNU Lesser General Public License,
++ * version 2.1, as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * Boston, MA 02111-1307, USA.
++ *
++ */
++#ifndef _MX_GTK_LIGHT_SWITCH
++#define _MX_GTK_LIGHT_SWITCH
++
++#include <gtk/gtk.h>
++
++G_BEGIN_DECLS
++
++#define MX_GTK_TYPE_LIGHT_SWITCH mx_gtk_light_switch_get_type ()
++
++#define MX_GTK_LIGHT_SWITCH(obj) \
++ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MX_GTK_TYPE_LIGHT_SWITCH,
MxGtkLightSwitch))
++
++#define MX_GTK_LIGHT_SWITCH_CLASS(klass) \
++ (G_TYPE_CHECK_CLASS_CAST ((klass), MX_GTK_TYPE_LIGHT_SWITCH,
MxGtkLightSwitchClass))
++
++#define MX_GTK_IS_LIGHT_SWITCH(obj) \
++ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MX_GTK_TYPE_LIGHT_SWITCH))
++
++#define MX_GTK_IS_LIGHT_SWITCH_CLASS(klass) \
++ (G_TYPE_CHECK_CLASS_TYPE ((klass), MX_GTK_TYPE_LIGHT_SWITCH))
++
++#define MX_GTK_LIGHT_SWITCH_GET_CLASS(obj) \
++ (G_TYPE_INSTANCE_GET_CLASS ((obj), MX_GTK_TYPE_LIGHT_SWITCH,
MxGtkLightSwitchClass))
++
++/**
++ * MxGtkLightSwitch:
++ *
++ * The contents of this structure are private and should only be accessed
++ * through the public API.
++ */
++typedef struct {
++ /*< private >*/
++ GtkDrawingArea parent;
++} MxGtkLightSwitch;
++
++typedef struct {
++ GtkDrawingAreaClass parent_class;
++
++ void (*switch_flipped) (MxGtkLightSwitch *lightswitch, gboolean state);
++} MxGtkLightSwitchClass;
++
++GType mx_gtk_light_switch_get_type (void);
++
++void mx_gtk_light_switch_set_active (MxGtkLightSwitch *lightswitch,
++ gboolean active);
++gboolean mx_gtk_light_switch_get_active (MxGtkLightSwitch *lightswitch);
++
++GtkWidget* mx_gtk_light_switch_new (void);
++
++G_END_DECLS
++
++#endif /* _MX_GTK_LIGHT_SWITCH */
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/mux-expanding-item.c
+===================================================================
+--- bisho-0.27.2+git20111122.9e68ef3d.orig/src/mux-expanding-item.c
++++ bisho-0.27.2+git20111122.9e68ef3d/src/mux-expanding-item.c
+@@ -17,7 +17,7 @@
+ */
+
+ #include <gtk/gtk.h>
+-#include <mx-gtk/mx-gtk.h>
++#include "mx-gtk/mx-gtk.h"
+ #include "mux-expanding-item.h"
+ #include "mux-expander.h"
+
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/mux-expanding-item.h
+===================================================================
+--- bisho-0.27.2+git20111122.9e68ef3d.orig/src/mux-expanding-item.h
++++ bisho-0.27.2+git20111122.9e68ef3d/src/mux-expanding-item.h
+@@ -20,7 +20,7 @@
+ #define __MUX_EXPANDING_ITEM_H__
+
+ #include <gtk/gtk.h>
+-#include <mx-gtk/mx-gtk.h>
++#include "mx-gtk/mx-gtk.h"
+
+ G_BEGIN_DECLS
+
+Index: bisho-0.27.2+git20111122.9e68ef3d/src/Makefile.am
+===================================================================
+--- bisho-0.27.2+git20111122.9e68ef3d.orig/src/Makefile.am
++++ bisho-0.27.2+git20111122.9e68ef3d/src/Makefile.am
+@@ -27,7 +27,7 @@ libbisho_common_la_SOURCES = \
+ mux-label.c mux-label.h
+
+ bin_PROGRAMS = bisho
+-bisho_SOURCES = main.c
++bisho_SOURCES = main.c mx-gtk/mx-gtk-frame.c mx-gtk/mx-gtk.h
mx-gtk/mx-gtk-light-switch.c mx-gtk/mx-gtk-frame.h mx-gtk/mx-gtk-light-switch.h
+ bisho_LDADD = libbisho-common.la
+
+ if ENABLE_CAPPLET
diff -Nru bisho-0.27.2+git20111122.9e68ef3d/debian/patches/series
bisho-0.27.2+git20111122.9e68ef3d/debian/patches/series
--- bisho-0.27.2+git20111122.9e68ef3d/debian/patches/series 2012-09-26
14:17:41.000000000 +0800
+++ bisho-0.27.2+git20111122.9e68ef3d/debian/patches/series 2016-06-14
15:05:36.000000000 +0800
@@ -1,2 +1,3 @@
glib_deprecated.diff
fix_panes_linking.patch
+port_to_mx2.0.patch
signature.asc
Description: OpenPGP digital signature
--- End Message ---