[ease/sourceview: 5/5] Merge branch 'master' into sourceview
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/sourceview: 5/5] Merge branch 'master' into sourceview
- Date: Tue, 15 Jun 2010 20:04:59 +0000 (UTC)
commit db4608fb010ca0e1ac228e00132105aff9bbf59c
Merge: d2121c7 ebb8baf
Author: Nate Stedman <natesm gmail com>
Date: Tue Jun 15 16:04:30 2010 -0400
Merge branch 'master' into sourceview
Conflicts:
Makefile.am
.gitignore | 2 +
Makefile.am | 102 ++++----
autogen.sh | 2 +-
configure.ac | 1 -
po/.intltool-merge-cache | 3 -
po/de.po | 84 +++---
src/{AboutDialog.vala => ease-about-dialog.vala} | 0
src/{Actor.vala => ease-actor.vala} | 0
src/{Document.vala => ease-document.vala} | 0
src/{EditorEmbed.vala => ease-editor-embed.vala} | 0
src/{EditorWindow.vala => ease-editor-window.vala} | 0
...ntMapValue.vala => ease-element-map-value.vala} | 0
src/{ElementMap.vala => ease-element-map.vala} | 0
src/{Element.vala => ease-element.vala} | 0
src/{Enums.vala => ease-enums.vala} | 0
src/{Handle.vala => ease-handle.vala} | 0
src/{HTMLExporter.vala => ease-html-exporter.vala} | 0
src/{ImageActor.vala => ease-image-actor.vala} | 0
src/{ImageElement.vala => ease-image-element.vala} | 0
...InspectorPane.vala => ease-inspector-pane.vala} | 0
...ectorWindow.vala => ease-inspector-window.vala} | 0
src/{Inspector.vala => ease-inspector.vala} | 0
src/{JSONParser.vala => ease-json-parser.vala} | 0
src/{MainToolbar.vala => ease-main-toolbar.vala} | 0
src/{MediaElement.vala => ease-media-element.vala} | 0
src/{OpenDialog.vala => ease-open-dialog.vala} | 0
src/{PDFExporter.vala => ease-pdf-exporter.vala} | 0
src/{Player.vala => ease-player.vala} | 0
...llableEmbed.vala => ease-scrollable-embed.vala} | 0
src/{SlideActor.vala => ease-slide-actor.vala} | 0
...ttonPanel.vala => ease-slide-button-panel.vala} | 0
src/{SlideButton.vala => ease-slide-button.vala} | 0
src/{SlidePane.vala => ease-slide-pane.vala} | 0
src/{SlideSet.vala => ease-slide-set.vala} | 0
src/{Slide.vala => ease-slide.vala} | 0
src/{Temp.vala => ease-temp.vala} | 0
src/{TextActor.vala => ease-text-actor.vala} | 0
src/{TextElement.vala => ease-text-element.vala} | 0
src/{Theme.vala => ease-theme.vala} | 0
...ansitionPane.vala => ease-transition-pane.vala} | 0
src/{Transitions.vala => ease-transitions.vala} | 0
src/{UndoActions.vala => ease-undo-actions.vala} | 0
...doController.vala => ease-undo-controller.vala} | 0
src/{Utility.vala => ease-utilities.vala} | 0
src/{VideoActor.vala => ease-video-actor.vala} | 0
src/{VideoElement.vala => ease-video-element.vala} | 0
src/{WelcomeActor.vala => ease-welcome-actor.vala} | 0
...WelcomeWindow.vala => ease-welcome-window.vala} | 0
src/{ZoomSlider.vala => ease-zoom-slider.vala} | 0
src/{Main.vala => main.vala} | 0
src/source-base-group.vala | 128 ++++++++
src/source-base-view.vala | 78 +++++
src/source-expandable-group.vala | 65 ++++
src/source-group.vala | 53 ++++
src/source-item.vala | 309 ++++++++++++++++++++
src/source-list-example | Bin 0 -> 268846 bytes
src/source-list.vala | 156 ++++++++++
src/source-pane-view.vala | 67 +++++
src/source-view.vala | 49 +++
59 files changed, 1007 insertions(+), 92 deletions(-)
---
diff --cc Makefile.am
index e20a442,06d4aea..2564928
--- a/Makefile.am
+++ b/Makefile.am
@@@ -12,56 -12,50 +12,58 @@@ AM_CPPFLAGS =
$(NULL)
ease_SOURCES = \
- src/AboutDialog.vala \
- src/Actor.vala \
- src/Document.vala \
- src/EditorEmbed.vala \
- src/EditorWindow.vala \
- src/ElementMap.vala \
- src/ElementMapValue.vala \
- src/Element.vala \
- src/Enums.vala \
- src/Handle.vala \
- src/HTMLExporter.vala \
- src/ImageActor.vala \
- src/ImageElement.vala \
- src/Inspector.vala\
- src/InspectorPane.vala\
- src/InspectorWindow.vala\
- src/JSONParser.vala\
- src/MainToolbar.vala \
- src/Main.vala \
- src/MediaElement.vala \
- src/OpenDialog.vala \
- src/PDFExporter.vala \
- src/Player.vala \
- src/ScrollableEmbed.vala \
- src/SlideActor.vala \
- src/SlideButtonPanel.vala \
- src/SlideButton.vala \
- src/SlidePane.vala \
- src/SlideSet.vala \
- src/Slide.vala \
- src/SourceBaseView.vala \
- src/SourceGroup.vala \
- src/SourceItem.vala \
- src/SourceList.vala \
- src/SourcePaneView.vala \
- src/SourceView.vala \
- src/Temp.vala \
- src/TextActor.vala \
- src/TextElement.vala \
- src/Theme.vala \
- src/TransitionPane.vala \
- src/Transitions.vala \
- src/UndoActions.vala \
- src/UndoController.vala \
- src/Utility.vala \
- src/VideoActor.vala \
- src/VideoElement.vala \
- src/WelcomeActor.vala \
- src/WelcomeWindow.vala \
- src/ZoomSlider.vala \
+ src/ease-about-dialog.vala \
+ src/ease-actor.vala \
+ src/ease-document.vala \
+ src/ease-editor-embed.vala \
+ src/ease-editor-window.vala \
+ src/ease-element-map.vala \
+ src/ease-element-map-value.vala \
+ src/ease-element.vala \
+ src/ease-enums.vala \
+ src/ease-handle.vala \
+ src/ease-html-exporter.vala \
+ src/ease-image-actor.vala \
+ src/ease-image-element.vala \
+ src/ease-inspector-pane.vala \
+ src/ease-inspector.vala \
+ src/ease-inspector-window.vala \
+ src/ease-json-parser.vala \
+ src/ease-main-toolbar.vala \
+ src/ease-media-element.vala \
+ src/ease-open-dialog.vala \
+ src/ease-pdf-exporter.vala \
+ src/ease-player.vala \
+ src/ease-scrollable-embed.vala \
+ src/ease-slide-actor.vala \
+ src/ease-slide-button-panel.vala \
+ src/ease-slide-button.vala \
+ src/ease-slide-pane.vala \
+ src/ease-slide-set.vala \
+ src/ease-slide.vala \
+ src/ease-temp.vala \
+ src/ease-text-actor.vala \
+ src/ease-text-element.vala \
+ src/ease-theme.vala \
+ src/ease-transition-pane.vala \
+ src/ease-transitions.vala \
+ src/ease-undo-actions.vala \
+ src/ease-undo-controller.vala \
+ src/ease-utilities.vala \
+ src/ease-video-actor.vala \
+ src/ease-video-element.vala \
+ src/ease-welcome-actor.vala \
+ src/ease-welcome-window.vala \
+ src/ease-zoom-slider.vala \
+ src/main.vala \
++ src/source-base-group.vala \
++ src/source-base-view.vala \
++ src/source-expandable-group.vala \
++ src/source-group.vala \
++ src/source-item.vala \
++ src/source-list.vala \
++ src/source-pane-view.vala \
++ src/source-view.vala \
$(NULL)
# ease_VALAFLAGS = $(EASE_PACKAGES)
diff --cc src/source-base-group.vala
index 0000000,0000000..c49ec7a
new file mode 100644
--- /dev/null
+++ b/src/source-base-group.vala
@@@ -1,0 -1,0 +1,128 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * Abstract base class for a group in a { link Source.List}.
++ *
++ * Source.BaseGroup can contain any amount of { link Source.Item}s. Above
++ * these items, a header is shown in order to categorize a { link Source.List}.
++ */
++public abstract class Source.BaseGroup : Gtk.Alignment
++{
++ /**
++ * The group header, displayed on top of the { link Source.Item}s.
++ */
++ private Gtk.Label header;
++
++ /**
++ * The Gtk.VBox containing all { link Source.Item}s.
++ */
++ private Gtk.VBox items_box;
++
++ /**
++ * Alignment containing header. This widget should be packed in subclasses,
++ * not header itself.
++ */
++ protected Gtk.Alignment header_align;
++
++ /**
++ * Alignment containing items_box. This widget should be packed in
++ * subclasses, not items_box itself.
++ */
++ protected Gtk.Alignment items_align;
++
++ /**
++ * Format string for the group header.
++ */
++ private const string HEADER_FORMAT = "<b>%s</b>";
++
++ /**
++ * Padding between each { link Source.Item}.
++ */
++ private const int ITEM_PADDING = 2;
++
++ /**
++ * Padding to the left of all items.
++ */
++ private const int ITEMS_PADDING_LEFT = 5;
++
++ /**
++ * Padding to the right of all items.
++ */
++ private const int ITEMS_PADDING_RIGHT = 5;
++
++ /**
++ * Padding above the set of items.
++ */
++ private const int ITEMS_PADDING_TOP = 5;
++
++ /**
++ * Padding below the set of all items.
++ */
++ private const int ITEMS_PADDING_BOTTOM = 10;
++
++ /**
++ * Emitted when a child { link Source.Item} of this group is clicked.
++ *
++ * @param sender The { link Source.Item} that was clicked.
++ */
++ public signal void clicked(Item sender);
++
++ /**
++ * Base constructor for subclasses of Source.BaseGroup.
++ *
++ * @param title The header of the Source.BaseGroup.
++ */
++ public BaseGroup(string title)
++ {
++ // create subwidgets
++ items_box = new Gtk.VBox(true, ITEM_PADDING);
++ items_align = new Gtk.Alignment(0, 0, 1, 0);
++ items_align.set_padding(ITEMS_PADDING_TOP,
++ ITEMS_PADDING_BOTTOM,
++ ITEMS_PADDING_LEFT,
++ ITEMS_PADDING_RIGHT);
++ header = new Gtk.Label(HEADER_FORMAT.printf(title));
++ header.use_markup = true;
++ header_align = new Gtk.Alignment(0, 1, 0, 1);
++
++ set(0, 0, 1, 0);
++
++ // assemble contents
++ items_align.add(items_box);
++ header_align.add(header);
++ }
++
++ /**
++ * Adds a { link Source.Item} to the end of this group.
++ *
++ * @param item The { link Source.Item} to add.
++ */
++ public void add_item(Item item)
++ {
++ items_box.pack_start(item, false, false, 0);
++ item.clicked.connect((sender) => clicked(sender));
++ }
++}
++
diff --cc src/source-base-view.vala
index 0000000,0000000..ddb8133
new file mode 100644
--- /dev/null
+++ b/src/source-base-view.vala
@@@ -1,0 -1,0 +1,78 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * Abstract base for a simple implementation of a widget using
++ * { link Source.List}.
++ *
++ * Source.BaseView creates a { link Source.List} and a Gtk.Bin. These can be
++ * placed into container widgets by subclasses.
++ */
++public abstract class Source.BaseView : Gtk.Alignment
++{
++ /**
++ * The content view.
++ */
++ protected Gtk.Alignment bin;
++
++ /**
++ * The { link Source.List} for this Source.BaseView.
++ */
++ protected Source.List list;
++
++ /**
++ * The width request of this Source.BaseView's { link Source.List}.
++ */
++ public int list_width_request
++ {
++ get { return list.width_request; }
++ set { list.width_request = value; }
++ }
++
++ /**
++ * Creates the list and bin widgets. Should be called by subclass
++ * constructors.
++ */
++ public BaseView()
++ {
++ // create widgets
++ bin = new Gtk.Alignment(0, 0, 1, 1);
++ list = new Source.List(bin);
++
++ // set properties
++ set(0, 0, 1, 1);
++ }
++
++ /**
++ * Adds a { link Source.BaseGroup} subclass to this
++ * Source.BaseView's { link Source.List}.
++ *
++ * @param group The group to add.
++ */
++ public void add_group(Source.BaseGroup group)
++ {
++ list.add_group(group);
++ }
++}
++
diff --cc src/source-expandable-group.vala
index 0000000,0000000..a5b189b
new file mode 100644
--- /dev/null
+++ b/src/source-expandable-group.vala
@@@ -1,0 -1,0 +1,65 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * An expandable group in a { link Source.List}.
++ *
++ * Source.ExpandableGroup can contain any amount of { link Source.Item}s.
++ * Above these items, a header is shown in order to categorize a
++ * { link Source.List}. Unlike { link Source.Group}, which is VBox based,
++ * ExpandableGroup can be expanded and contracted.
++ */
++public class Source.ExpandableGroup : BaseGroup
++{
++ /**
++ * The Gtk.Expander containing the header and items_box.
++ */
++ private Gtk.Expander expander = new Gtk.Expander("");
++
++ /**
++ * If the ExpandableGroup's expander is expanded.
++ */
++ public bool expanded
++ {
++ get { return expander.expanded; }
++ set { expander.expanded = value; }
++ }
++
++ /**
++ * Create a new, empty, Source.ExpandableGroup.
++ *
++ * @param title The header of the Source.Group.
++ * @param expanded If the group should be expanded by default.
++ */
++ public ExpandableGroup(string title, bool expanded)
++ {
++ base(title);
++
++ expander.label_widget = header_align;
++ expander.can_focus = false;
++ expander.set_expanded(expanded);
++ expander.add(items_align);
++ add(expander);
++ }
++}
diff --cc src/source-group.vala
index 0000000,0000000..065f6f9
new file mode 100644
--- /dev/null
+++ b/src/source-group.vala
@@@ -1,0 -1,0 +1,53 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * A group in a { link Source.List}.
++ *
++ * Source.Group can contain any amount of { link Source.Item}s. Above these items,
++ * a header is shown in order to categorize a { link Source.List}.
++ */
++public class Source.Group : BaseGroup
++{
++ /**
++ * The Gtk.VBox containing the header and items_box.
++ */
++ private Gtk.VBox all_box;
++
++ /**
++ * Create a new, empty, Source.Group.
++ *
++ * @param title The header of the Source.Group.
++ */
++ public Group(string title)
++ {
++ base(title);
++
++ all_box = new Gtk.VBox(false, 0);
++ all_box.pack_start(header_align, false, false, 0);
++ all_box.pack_start(items_align, false, false, 0);
++ add(all_box);
++ }
++}
++
diff --cc src/source-item.vala
index 0000000,0000000..36cea08
new file mode 100644
--- /dev/null
+++ b/src/source-item.vala
@@@ -1,0 -1,0 +1,309 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * An individual item in a { link Source.Group}.
++ *
++ * Source.Item contains a Gtk.Button, which in turn contains an image and a
++ * label. When added to a { link Source.Group}, signals are automatically set
++ * up to manage the { link Source.View} this item is a part of.
++ */
++public class Source.Item : Gtk.HBox
++{
++ /**
++ * The Source.Item's image widget, displayed on the left.
++ */
++ private Gtk.Image image;
++
++ /**
++ * The Source.Item's label widget, displayed to the right of the image.
++ */
++ private Gtk.Label label;
++
++ /**
++ * The right label widget, which can display a number if desired.
++ */
++ private Gtk.Label right_label;
++
++ /**
++ * The alignment for the right label.
++ */
++ private Gtk.Alignment right_align;
++
++ /**
++ * A number, displayed on the righthand side of the Source.Item. If
++ * notification is 0, the label is not displayed.
++ */
++ public int notification
++ {
++ get { return notification_priv; }
++ set
++ {
++ if (value == notification_priv) return;
++
++ // if value is 0, notification_priv can't be
++ if (value == 0)
++ {
++ // therefore, the widget has been added, so remove it
++ right_align.remove(right_label);
++ }
++
++ // update the label
++ right_label.label = (selected ?
++ FORMAT_RIGHT_OLD :
++ FORMAT_RIGHT_NEW).printf(value);
++
++ // if necessary, add the label
++ if (notification_priv == 0)
++ {
++ right_align.add(right_label);
++ }
++
++ // store the value
++ notification_priv = value;
++ }
++ }
++
++ /**
++ * Private store for notification value
++ */
++ private int notification_priv = 0;
++
++ /**
++ * The Source.Item's button widget, containing the image and label.
++ */
++ private Gtk.Button button;
++
++ /**
++ * The widget this Source.Item is linked with in its { link Source.View}.
++ */
++ public Gtk.Widget widget;
++
++ /**
++ * The text displayed in the label widget.
++ */
++ private string label_text;
++
++ /**
++ * The size of lefthand side icons.
++ */
++ public const Gtk.IconSize ICON_SIZE = Gtk.IconSize.MENU;
++
++ /**
++ * The padding of the internal button elements.
++ */
++ private const int HBOX_PADDING = 2;
++
++ /**
++ * Format string for selected items.
++ */
++ private const string FORMAT_SELECTED = "<b>%s</b>";
++
++ /**
++ * Format string for deselected items.
++ */
++ private const string FORMAT_DESELECTED = "%s";
++
++ /**
++ * Format string for right notification number when new.
++ */
++ private const string FORMAT_RIGHT_NEW = "<small><b>%i</b></small>";
++
++ /**
++ * Format string for right notification number once viewed.
++ */
++ private const string FORMAT_RIGHT_OLD = "<small><b>%i</b></small>";
++
++ /**
++ * Padding to the sides of the label and image. Not used on the right of
++ * the image, as the label left padding covers this space.
++ */
++ private const int ITEM_PADDING = 5;
++
++ /**
++ * Alignment of label.
++ */
++ private const float LABEL_VERT_ALIGN = 0.6f;
++
++ /**
++ * Relief style for selected items.
++ */
++ private const Gtk.ReliefStyle RELIEF_SELECTED = Gtk.ReliefStyle.NORMAL;
++
++ /**
++ * Relief style for deselected items.
++ */
++ private const Gtk.ReliefStyle RELIEF_DESELECTED = Gtk.ReliefStyle.NONE;
++
++ /**
++ * If this Source.Item is the selected item in its { link Source.List}.
++ */
++ public bool selected
++ {
++ get { return button.relief == RELIEF_SELECTED; }
++ set
++ {
++ // don't emit any signals or change anything if it's redundant
++ if (selected == value) return;
++
++ // otherwise, go ahead
++ button.relief = value ? RELIEF_SELECTED : RELIEF_DESELECTED;
++ label.label = (value ?
++ FORMAT_SELECTED :
++ FORMAT_DESELECTED).printf(label_text);
++
++ // if "selected" is being set to true, emit a signal
++ if (value)
++ {
++ clicked(this);
++
++ // remove bold from notification text
++ right_label.label = FORMAT_RIGHT_OLD.printf(notification);
++ }
++ }
++ }
++
++ /**
++ * Emitted when the Source.Item's Gtk.Button is clicked. Generally used
++ * internally to change { link Source.List} selection.
++ *
++ * @param sender The Source.Item that emitted the signal (generally, "this").
++ */
++ public signal void clicked(Source.Item sender);
++
++ /**
++ * Creates a Source.Item with a customizable icon and text.
++ *
++ * @param text The text to display in the source item.
++ * @param img The image widget to use (note that this icon should use
++ * the Gtk.IconSize constant ICON_SIZE to fit in with other items).
++ * @param widg The widget that this Source.Item should be linked with.
++ * If null, this Source.Item will only emit the clicked signal when
++ * clicked, without any automatic UI changes.
++ */
++ public Item(string text, Gtk.Image img, Gtk.Widget? widg)
++ {
++ // set properties
++ homogeneous = false;
++ label_text = text;
++ widget = widg;
++
++ // build subwidgets
++ image = img;
++ label = new Gtk.Label(FORMAT_DESELECTED.printf(text));
++ label.use_markup = true;
++ button = new Gtk.Button();
++ button.can_focus = false;
++ selected = false;
++ var label_align = new Gtk.Alignment(0, LABEL_VERT_ALIGN, 0, 0);
++ label_align.set_padding(0, 0, ITEM_PADDING, ITEM_PADDING);
++ right_label = new Gtk.Label("");
++ right_label.use_markup = true;
++ right_align = new Gtk.Alignment(1, LABEL_VERT_ALIGN, 1, 1);
++ var image_align = new Gtk.Alignment(0.5f, 0.5f, 0, 1);
++ image_align.set_padding(0, 0, ITEM_PADDING, 0);
++
++ // build the source item
++ label_align.add(label);
++ image_align.add(image);
++ var hbox = new Gtk.HBox(false, HBOX_PADDING);
++ hbox.pack_start(image_align, false, false, 0);
++ hbox.pack_start(label_align, true, true, 0);
++ button.add(hbox);
++
++ pack_start(button, false, false, 0);
++ pack_start(new Gtk.Alignment(1, 1, 0, 0), true, true, 0);
++ pack_end(right_align, false, false, 0);
++
++ // send the clicked signal when the button is clicked
++ button.clicked.connect(() => {
++ if (!selected)
++ {
++ clicked(this);
++ }
++ });
++ }
++
++ /**
++ * Creates a Source.Item with a stock icon and customizable text.
++ *
++ * @param text The text to display in the source item.
++ * @param item The stock item to take the icon from.
++ * @param widg The widget that this Source.Item should be linked with.
++ * If null, this Source.Item will only emit the clicked signal when
++ * clicked, without any automatic UI changes.
++ */
++ public Item.from_stock_icon(string text, string item, Gtk.Widget? widg)
++ {
++ this(text, new Gtk.Image.from_stock(item, ICON_SIZE), widg);
++ }
++
++ /**
++ * Creates a Source.Item with a stock icon and customizable text.
++ *
++ * @param text The text to display in the source item.
++ * @param item The stock item to take the label from.
++ * @param img The image widget to use (note that this icon should use
++ * the Gtk.IconSize constant ICON_SIZE to fit in with other items).
++ * @param widg The widget that this Source.Item should be linked with.
++ * If null, this Source.Item will only emit the clicked signal when
++ * clicked, without any automatic UI changes.
++ */
++ public Item.from_stock_text(string item, Gtk.Image img, Gtk.Widget? widg)
++ {
++ Gtk.StockItem stock = Gtk.StockItem();
++ if (Gtk.stock_lookup(item, stock))
++ {
++ this(stock.label.replace("_", ""), img, widg);
++ }
++ }
++
++ /**
++ * Creates a Source.Item with a stock icon and text.
++ *
++ * @param item The stock item to take the icon and text from.
++ * @param widg The widget that this Source.Item should be linked with.
++ * If null, this Source.Item will only emit the clicked signal when
++ * clicked, without any automatic UI changes.
++ */
++ public Item.from_stock(string item, Gtk.Widget? widg)
++ {
++ Gtk.StockItem stock = Gtk.StockItem();
++ if (Gtk.stock_lookup(item, stock))
++ {
++ this(stock.label.replace("_", ""),
++ new Gtk.Image.from_stock(item, ICON_SIZE),
++ widg);
++ }
++ }
++
++ /**
++ * Selects this Source.Item, emitting a "clicked" signal.
++ */
++ public void select()
++ {
++ selected = true;
++ }
++}
++
diff --cc src/source-list-example
index 0000000,0000000..189ce03
new file mode 100755
--- /dev/null
+++ b/src/source-list-example
@@@ -1,0 -1,0 +1,2476 @@@
++ELF
++
++
++
++{
++z
++y
++ìÿÿHÇ 0t;@
++
++ÜÿÿH?EøH??
++HÇEø @
++HÇEðF@
++
++
++
++
++
++
++
++
++
++·ÿÿ
++
++
++
++
++
++
++
++
++
++
++
++
++U
++
++[
++[
++[
++&?
++
++
++
+++
++
++¦
++[
++Ã
++à
++Ã
++à
++Ã
++3
++&
++3
++à
++3
++&
++3
++
++
++
++
++
++
++
++
++
++
++
++?
++
++3
++Ã
++Ã
++
++
++?
++
++3
++à
++Ã
++
++
++?
++
++
++
++e
++3
++å
++
++
++
++?
++
++3
++
++
++?
++
++Ã
++
++
++
++
++
++
++
++
++
++
++
++&
++9&
++T
++T
++?&
++&
++$
++T
++T
++?&
++&
++T
++T
++
++
++
++
++X)
++^)
++3
++X)
++?/
++
++
++
++
++)
++ /
++[
++ /
++3
++
++ /
++ /
++K;
++ /
++h;
++ /
++ (
++ /
++ /
++ /
++/
++ /
++(
++ /
++
++ /
++Ã
++ /
++
++ /
++¹'
++ /
++"
++ /
++d<
++ /
++?<
++ /
++¦<
++ /
++Ç<
++ /
++è<
++ /
++ =
++ /
++*=
++ /
++K=
++ /
++l=
++ /
++?=
++ /
++®=
++ /
++Ï=
++ /
++ð=
++ /
++>
++ /
++2>
++ /
++Y>
++3
++3
++ /
++Y>
++3
++ /
++º$
++ /
++º$
++Y>
++3
++3
++ /
++º$
++3
++ /
++º$
++ü
++ü
++3
++ /
++º$
++ü
++ü
++Y>
++3
++3
++ /
++ /
++Õ2
++ /
++ /
++&
++ /
++3
++ /
++Â?
++ /
++ü
++ü
++
++ò?
++?A
++ /
++?A
++?A
++
++é:
++[
++?A
++?A
++ /
++?A
++ /
++3
++à
++Ã
++?A
++ /
++3
++Ã
++Ã
++F
++F
++×F
++ÝF
++ÝF
++[
++
++
++,
++U
++
++
++P
++P
++P
++
++
++o²
++s?
++sÅ
++tÑ
++vã
++v
++??
++x
++x)
++?k
++y5
++yÙ
++Êx
++Ìq
+++
++Í}
++Ð?
++
++Ñ?
++Ò[
++Õx
++Öx
++ס
++Úà
++|å
++|k
++ ý
++¡ý
++¢
++¥5
++¦þ
++§`
++«þ
++¬?
++¿m
++Êm
++3
++B
++Q
++Ä
++P
++¥à
++÷
++
++÷
++
++÷
++(
++Z
++(
++
++(
++Z
++(
++
++
++
++
++
++
++±
++(
++÷
++÷
++±
++(
++
++÷
++±
++
++?
++(
++
++
++
++±
++(
++&
++
++
++
++±
++÷
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++2"
++^"
++Ä
++Ä
++d"
++
++2"
++I
++Ä
++Ä
++d"
++2"
++Ä
++Ä
++
++
++
++L$
++R$
++(
++L$
++
++
++
++
++
++?/
++
++
++
++
++:
++
++
++
++
++
++)
++
++?)
++P
++?)
++(
++&
++
++?)
++?)
++®5
++?)
++Ë5
++?)
++Ì#
++?)
++?)
++?)
++})
++?)
++?#
++?)
++ü
++?)
++÷
++?)
++ü
++?)
++s#
++?)
++1
++?)
++Ç6
++?)
++è6
++?)
++ 7
++?)
++*7
++?)
++K7
++?)
++l7
++?)
++?7
++?)
++®7
++?)
++Ï7
++?)
++ð7
++?)
++8
++?)
++28
++?)
++S8
++?)
++t8
++?)
++?8
++?)
++¼8
++(
++(
++?)
++¼8
++(
++?)
++ß
++?)
++ß
++¼8
++(
++(
++?)
++ß
++(
++?)
++ß
++ñ
++ñ
++(
++?)
++ß
++ñ
++ñ
++¼8
++(
++(
++?)
++?)
++8-
++?)
++?)
++8"
++:
++?)
++(
++?)
++%:
++?)
++ñ
++ñ
++ü
++U:
++
++
++
++
++å;
++?)
++å;
++å;
++ü
++L5
++P
++å;
++å;
++?)
++å;
++?)
++(
++
++÷
++å;
++?)
++(
++÷
++÷
++
++
++,
++
++ ?
++;
++
++
++
+++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++"
++
++
++
++
++
++
++
++
++
++
++
++
++
++"
++
++
++
++
++
++
++
++
++?/
++
++
++
++
++
++
++
++
++
++=
++
++,
++
++P
++P
++P
++;
++
++
++
+++
++
++
++P
++"
++?
++"
++?
++"
++(
++?
++(
++?
++(
++?
++(
++
++
++
++
++
++
++
++
++Ü
++(
++"
++"
++
++Ü
++(
++?
++"
++
++
++Ü
++
++Ä
++(
++/
++
++
++
++Ü
++(
++Q
++
++
++
++Ü
++"
++
++
++
++
++
++
++
++
++"
++
++
++
++
++
++
++
++
++
++
++
++"
++5"
++a"
++Ä
++Ä
++g"
++5"
++L
++Ä
++Ä
++g"
++5"
++Ä
++Ä
++
++
++
++O$
++U$
++(
++O$
++
++
++
++
++
++?/
++
++
++
++
++
++
++
++
++?)
++P
++?)
++(
++Q
++
++?)
++?)
++3
++?)
++13
++?)
++Ï#
++?)
++?)
++?)
++?)
++?)
++?#
++?)
++ü
++?)
++"
++?)
++ü
++?)
++v#
++?)
++4
++?)
++-4
++?)
++N4
++?)
++o4
++?)
++?4
++?)
++±4
++?)
++Ò4
++?)
++ó4
++?)
++5
++?)
++55
++?)
++V5
++?)
++w5
++?)
++?5
++?)
++¹5
++?)
++Ú5
++?)
++û5
++?)
++"6
++(
++(
++?)
++"6
++(
++?)
++â
++?)
++â
++"6
++(
++(
++?)
++â
++(
++?)
++â
++ñ
++ñ
++(
++?)
++â
++ñ
++ñ
++"6
++(
++(
++?)
++?)
++;-
++?)
++?)
++;"
++?)
++(
++?)
++?7
++?)
++ñ
++ñ
++ü
++»7
++
++
++
++
++K9
++?)
++K9
++K9
++ü
++²2
++P
++K9
++K9
++?)
++K9
++?)
++(
++?
++"
++K9
++?)
++(
++"
++"
++,
++
++
++P
++P
++P
++
++
++o²
++s?
++sÅ
++tÑ
++vã
++v
++??
++x
++x)
++?k
++y5
++yÙ
++Êx
++Ìq
+++
++Í}
++Ð?
++
++Ñ?
++Ò[
++Õx
++Öx
++ס
++ÚÊ
++|å
++|k
++ ç
++¡ç
++¢
++¥
++¦þ
++§J
++«þ
++¬o
++¿m
++Êm
++3
++B
++Q
++Ä
++P
++á
++þ
++á
++þ
++á
++(
++D
++(
++þ
++(
++D
++(
++
++
++
++
++?
++(
++á
++á
++?
++(
++þ
++á
++?
++?
++(
++î
++
++?
++(
++
++
++
++?
++á
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++ô!
++ "
++Ä
++Ä
++&"
++ô!
++
++Ä
++Ä
++&"
++ô!
++Ä
++Ä
++
++
++
++$
++$
++(
++$
++
++
++
++
++
++
++
++
++?/
++
++
++
++
++
++
++
++
++
++
++
++E)
++P
++E)
++(
++
++
++E)
++E)
++Ó2
++E)
++ð2
++E)
++?#
++E)
++E)
++E)
++?)
++E)
++[#
++E)
++ü
++E)
++á
++E)
++ü
++E)
++5#
++E)
++ó
++E)
++ì3
++E)
++4
++E)
++.4
++E)
++O4
++E)
++p4
++E)
++?4
++E)
++²4
++E)
++Ó4
++E)
++ô4
++E)
++5
++E)
++65
++E)
++W5
++E)
++x5
++E)
++?5
++E)
++º5
++E)
++á5
++(
++(
++E)
++á5
++(
++E)
++¡
++E)
++¡
++á5
++(
++(
++E)
++¡
++(
++E)
++¡
++ñ
++ñ
++(
++E)
++¡
++ñ
++ñ
++á5
++(
++(
++E)
++E)
++ú,
++E)
++E)
++ú!
++E)
++(
++E)
++J7
++E)
++ñ
++ñ
++ü
++z7
++
++
++
++
++9
++
++9
++E)
++
++9
++
++9
++ü
++q2
++P
++
++9
++
++9
++E)
++
++9
++E)
++(
++þ
++á
++
++9
++E)
++(
++á
++á
++,
++
++P
++P
++P
++"
++"W
++&
++
++'ñ
++(þ
++
++
++
+++
++
++i
++P
++?
++£
++?
++£
++?
++(
++é
++(
++£
++(
++é
++(
++
++
++
++
++
++
++
++
++
++
++
++
++@
++
++(
++?
++?
++
++
++@
++
++(
++£
++?
++
++
++@
++
++
++
++(
++(
++?
++
++
++
++@
++
++(
++µ
++
++
++
++@
++
++?
++
++
++
++
++
++
++
++"
++"
++
++
++
++
++
++
++
++
++±#
++Ý#
++
++
++ã#
++±#
++È
++
++
++ã#
++±#
++
++
++
++
++?&
++¢&
++(
++?&
++?/
++
++
++
++
++
++)
++ä+
++P
++ä+
++(
++µ
++
++ä+
++ä+
++8
++ä+
++,8
++ä+
++&
++ä+
++ä+
++ä+
++Þ+
++ä+
++Á%
++ä+
++ü
++ä+
++?
++ä+
++ü
++ä+
++]%
++ä+
++°
++ä+
++(9
++ä+
++I9
++ä+
++j9
++ä+
++?9
++ä+
++¬9
++ä+
++Í9
++ä+
++î9
++ä+
++:
++ä+
++0:
++ä+
++Q:
++ä+
++r:
++ä+
++?:
++ä+
++´:
++ä+
++Õ:
++ä+
++ö:
++ä+
++;
++(
++(
++ä+
++;
++(
++ä+
++^"
++ä+
++^"
++;
++(
++(
++ä+
++^"
++(
++ä+
++^"
++ñ
++ñ
++(
++ä+
++^"
++ñ
++ñ
++;
++(
++(
++ä+
++ä+
++?/
++ä+
++ä+
++·#
++ä+
++(
++ä+
++?<
++ä+
++ñ
++ñ
++ü
++¶<
++F>
++ä+
++F>
++F>
++ü
++7
++P
++F>
++F>
++ä+
++F>
++ä+
++(
++£
++?
++F>
++ä+
++(
++?
++?
++
++G
++,
++
++
++
++
++
++
++P
++P
++P
++&?
++&³
++*P
+++³
++
++
+++
++
++¹
++P
++Ö
++ó
++Ö
++ó
++Ö
++(
++9
++(
++ó
++(
++9
++(
++
++
++
++
++?
++(
++Ö
++Ö
++?
++(
++ó
++Ö
++?
++x
++(
++ã
++
++?
++(
++
++
++
++?
++Ö
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++é!
++"
++¹
++¹
++"
++é!
++
++¹
++¹
++"
++é!
++¹
++¹
++
++
++
++S$
++Y$
++(
++S$
++
++
++
++
++
++
++
++*
++
++?/
++
++
++
++
++
++
++
++
++
++
++
++
++*
++P
++
++*
++(
++
++
++
++*
++
++*
++?3
++
++*
++µ3
++
++*
++Ó#
++
++*
++
++*
++
++*
++*
++
++*
++P#
++
++*
++ü
++
++*
++Ö
++
++*
++ü
++
++*
++*#
++
++*
++è
++
++*
++±4
++
++*
++Ò4
++
++*
++ó4
++
++*
++5
++
++*
++55
++
++*
++V5
++
++*
++w5
++
++*
++?5
++
++*
++¹5
++
++*
++Ú5
++
++*
++û5
++
++*
++6
++
++*
++=6
++
++*
++^6
++
++*
++6
++
++*
++¦6
++(
++(
++
++*
++¦6
++(
++
++*
++?
++
++*
++?
++¦6
++(
++(
++
++*
++?
++(
++
++*
++?
++ñ
++ñ
++(
++
++*
++?
++ñ
++ñ
++¦6
++(
++(
++
++*
++
++*
++¿-
++
++*
++
++*
++ï!
++
++*
++(
++
++*
++8
++
++*
++ñ
++ñ
++ü
++?8
++*
++
++
++
++
++Ï9
++
++*
++Ï9
++Ï9
++ü
++63
++P
++Ï9
++Ï9
++
++*
++Ï9
++
++*
++(
++ó
++Ö
++Ï9
++
++*
++(
++Ö
++Ö
++*
++*
++*
++*
++*
++,
++
++P
++P
++P
++
++
++o²
++s?
++sº
++tÆ
++vØ
++võ
++?x
++x
++x
++?`
++y*
++yÎ
++Êx
++Ìf
+++
++Ír
++Ð~
++
++Ñ?
++Ò[
++Õx
++Öx
++×?
++Ú¿
++|Ú
++|`
++ Ü
++¡Ü
++¢þ
++¥
++¦þ
++§?
++«þ
++¬d
++¿m
++Êm
++3
++B
++Q¢
++¹
++P
++Ö
++ó
++Ö
++ó
++Ö
++(
++9
++(
++ó
++(
++9
++(
++
++
++
++
++?
++(
++Ö
++Ö
++?
++(
++ó
++Ö
++?
++x
++(
++ã
++
++?
++(
++
++
++
++?
++Ö
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++é!
++"
++¹
++¹
++"
++é!
++
++¹
++¹
++"
++é!
++¹
++¹
++
++>L
++O
++I
++
++
++%&
+++&
++(
++%&
++
++
++
++
++
++
++
++
++?/
++
++
++
++
++
++
++
++
++
++
++
++\+
++P
++\+
++(
++
++
++\+
++\+
++ê4
++\+
++5
++\+
++¥%
++\+
++\+
++\+
++V+
++\+
++r%
++\+
++ü
++\+
++Ö
++\+
++ü
++\+
++L%
++\+
++è
++\+
++6
++\+
++$6
++\+
++E6
++\+
++f6
++\+
++?6
++\+
++¨6
++\+
++É6
++\+
++ê6
++\+
++7
++\+
++,7
++\+
++M7
++\+
++n7
++\+
++?7
++\+
++°7
++\+
++Ñ7
++\+
++ø7
++(
++(
++\+
++ø7
++(
++\+
++?
++\+
++?
++ø7
++(
++(
++\+
++?
++(
++\+
++?
++ñ
++ñ
++(
++\+
++?
++ñ
++ñ
++ø7
++(
++(
++\+
++\+
++/
++\+
++\+
++ï!
++\+
++(
++\+
++a9
++\+
++ñ
++ñ
++ü
++?9
++
++
++
++
++!;
++\+
++!;
++!;
++ü
++?4
++P
++!;
++!;
++\+
++!;
++\+
++(
++ó
++Ö
++!;
++\+
++(
++Ö
++Ö
++
++,
++
++P
++P
++P
++
++
++o²
++s?
++sº
++tÆ
++vØ
++võ
++?x
++x
++x
++?`
++y*
++yÎ
++Êx
++Ìf
+++
++Ír
++Ð~
++
++Ñ?
++Ò[
++Õx
++Öx
++×?
++Ú¿
++|Ú
++|`
++ Ü
++¡Ü
++¢þ
++¥
++¦þ
++§?
++«þ
++¬d
++¿m
++Êm
++3
++B
++Q¢
++¹
++P
++Ö
++ó
++Ö
++ó
++Ö
++(
++9
++(
++ó
++(
++9
++(
++
++
++
++
++?
++(
++Ö
++Ö
++?
++(
++ó
++Ö
++?
++x
++(
++ã
++
++?
++(
++
++
++
++?
++Ö
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++é!
++"
++¹
++¹
++"
++é!
++
++¹
++¹
++"
++é!
++¹
++¹
++
++
++
++$
++ $
++(
++$
++
++
++
++
++
++
++
++
++?/
++
++
++
++
++
++
++
++
++
++
++
++:)
++P
++:)
++(
++
++
++:)
++:)
++È2
++:)
++å2
++:)
++?#
++:)
++:)
++:)
++4)
++:)
++P#
++:)
++ü
++:)
++Ö
++:)
++ü
++:)
++*#
++:)
++è
++:)
++á3
++:)
++4
++:)
++#4
++:)
++D4
++:)
++e4
++:)
++?4
++:)
++§4
++:)
++È4
++:)
++é4
++5
++:)
++
++5
++:)
+++5
++:)
++L5
++:)
++m5
++:)
++?5
++:)
++¯5
++:)
++Ö5
++(
++(
++:)
++Ö5
++(
++:)
++?
++:)
++?
++Ö5
++(
++(
++:)
++?
++(
++:)
++?
++ñ
++ñ
++(
++:)
++?
++ñ
++ñ
++Ö5
++(
++(
++:)
++:)
++ï,
++:)
++:)
++ï!
++:)
++(
++:)
++?7
++:)
++ñ
++ñ
++ü
++o7
++
++
++
++
++ÿ8
++:)
++ÿ8
++ÿ8
++ü
++f2
++P
++ÿ8
++ÿ8
++:)
++ÿ8
++:)
++(
++ó
++Ö
++ÿ8
++:)
++(
++Ö
++Ö
++,
++P
++u@
++u@
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++&
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++u@
++
diff --cc src/source-list.vala
index 0000000,0000000..098e1b8
new file mode 100644
--- /dev/null
+++ b/src/source-list.vala
@@@ -1,0 -1,0 +1,156 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * A widget for switching between multiple data sources.
++ *
++ * Source.List contains { link Source.Group}s, which in turn contain
++ * { link Source.Item}s. Each Source.Item is linked to a Gtk.Widget, which
++ * is displayed in the Source.List's linked Gtk.Bin when clicked.
++ *
++ * For a simple Source.List next to bin implementation, use { link Source.View}.
++ */
++public class Source.List : Gtk.Alignment
++{
++ /**
++ * The child of this widget, provides scrollbars if necessary.
++ */
++ private Gtk.ScrolledWindow scroll;
++
++ /**
++ * Gtk.VBox to contain this Source.List's { link Source.Group}s.
++ */
++ private Gtk.VBox box;
++
++ /**
++ * The bin used by this widget's { link Source.Item}s to display their
++ * linked widgets.
++ */
++ private Gtk.Bin bin;
++
++ /**
++ * The currently selected { link Source.Item}.
++ */
++ private Source.Item selected;
++
++ /**
++ * The Gtk.ShadowType of the scrolled window.
++ */
++ private const Gtk.ShadowType SHADOW = Gtk.ShadowType.NONE;
++
++ /**
++ * The behaviour of the horizontal scroll bar.
++ */
++ private const Gtk.PolicyType H_POLICY = Gtk.PolicyType.NEVER;
++
++ /**
++ * The behaviour of the vertical scroll bar.
++ */
++ private const Gtk.PolicyType V_POLICY = Gtk.PolicyType.AUTOMATIC;
++
++ /**
++ * Padding around the Source.List
++ */
++ public const int PADDING = 5;
++
++ /**
++ * Padding between groups.
++ */
++ public const int GROUP_PADDING = 5;
++
++ /**
++ * Emitted when a { link Source.Item} in this Source.List is clicked.
++ *
++ * @param sender The Source.Item that was clicked.
++ */
++ public signal void clicked(Source.Item sender);
++
++ /**
++ * Creates a Source.List and links it to a Gtk.Bin
++ *
++ * @param linked_bin The Gtk.Bin to link this Source.View with.
++ */
++ public List(Gtk.Bin linked_bin)
++ {
++ // create widgets
++ scroll = new Gtk.ScrolledWindow(null, null);
++ box = new Gtk.VBox(false, GROUP_PADDING);
++ var viewport = new Gtk.Viewport(null, null);
++
++ // set properties
++ bin = linked_bin;
++ scroll.shadow_type = SHADOW;
++ viewport.shadow_type = SHADOW;
++ scroll.hscrollbar_policy = H_POLICY;
++ scroll.vscrollbar_policy = V_POLICY;
++ set(0, 0, 1, 1);
++ set_padding(PADDING, PADDING, PADDING, PADDING);
++
++ // assemble
++ viewport.add(box);
++ scroll.add(viewport);
++ add(scroll);
++ }
++
++ /**
++ * Adds a group to the { link Source.List}, automatically setting up click
++ * signals.
++ *
++ * @param group The group to add.
++ */
++ public void add_group(Source.BaseGroup group)
++ {
++ box.pack_start(group, false, false, 0);
++
++ group.clicked.connect((sender) => {
++ // deselect the old selected widget, if any
++ if (selected != null && selected != sender)
++ {
++ selected.selected = false;
++ }
++
++ if (sender.widget != null)
++ {
++ // remove the bin's old child, if any
++ var child = bin.get_child();
++ if (child != null)
++ {
++ bin.remove(child);
++ }
++
++ // add the new child
++ bin.add(sender.widget);
++ bin.show_all();
++ }
++
++ // select the sender
++ sender.selected = true;
++ selected = sender;
++
++ // emit a clicked event
++ clicked(sender);
++ });
++ }
++}
++
diff --cc src/source-pane-view.vala
index 0000000,0000000..2572b87
new file mode 100644
--- /dev/null
+++ b/src/source-pane-view.vala
@@@ -1,0 -1,0 +1,67 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * An implementation of { link Source.BaseView} with a Gtk.HPaned
++ *
++ * Source.View consists of a { link Source.List}, a separator, and a Gtk.Bin
++ * packed into a Gtk.HBox.
++ */
++public class Source.PaneView : BaseView
++{
++ /**
++ * Creates an empty Source.View. Add groups with add_group().
++ *
++ * @param with_separator If true, a Gtk.Separator is included to the right
++ * of the drag handle.
++ */
++ public PaneView(bool with_separator)
++ {
++ // create base widgets
++ base();
++
++ // create pane widgets and build the view
++ var hpane = new Gtk.HPaned();
++ hpane.pack1(list, false, false);
++
++ // if a separator is requested, build an hbox with it and the bin
++ if (with_separator)
++ {
++ var hbox = new Gtk.HBox(false, 0);
++ hbox.pack_start(new Gtk.VSeparator(), false, false, 0);
++ hbox.pack_start(bin, true, true, 0);
++ hpane.pack2(hbox, true, false);
++ }
++
++ // otherwise, just pack the bin in
++ else
++ {
++ hpane.pack2(bin, true, false);
++ }
++
++ // add the hpaned to the view
++ add(hpane);
++ }
++}
++
diff --cc src/source-view.vala
index 0000000,0000000..14bc6bb
new file mode 100644
--- /dev/null
+++ b/src/source-view.vala
@@@ -1,0 -1,0 +1,49 @@@
++/*
++Copyright 2010 Nate Stedman. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification, are
++permitted provided that the following conditions are met:
++
++1. Redistributions of source code must retain the above copyright notice, this list of
++conditions and the following disclaimer.
++
++2. Redistributions in binary form must reproduce the above copyright notice, this list
++of conditions and the following disclaimer in the documentation and/or other materials
++provided with the distribution.
++
++THIS SOFTWARE IS PROVIDED BY NATE STEDMAN ``AS IS'' AND ANY EXPRESS OR IMPLIED
++WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NATE STEDMAN OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++/**
++ * A simple implementation of a widget using { link Source.List}.
++ *
++ * Source.View consists of a { link Source.List}, a separator, and a Gtk.Bin
++ * packed into a Gtk.HBox.
++ */
++public class Source.View : BaseView
++{
++ /**
++ * Creates an empty Source.View. Add groups with add_group().
++ */
++ public View()
++ {
++ // create the bin and list widgets
++ base();
++
++ // create the hbox widget and build the full view
++ var hbox = new Gtk.HBox(false, 0);
++ hbox.pack_start(list, false, false, 0);
++ hbox.pack_start(new Gtk.VSeparator(), false, false, 0);
++ hbox.pack_start(bin, true, true, 0);
++ add(hbox);
++ }
++}
++
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]