diff -Nru unity-7.3.2+15.10.20150521/dash/FilterBasicButton.cpp unity-7.3.2+15.10.20150522/dash/FilterBasicButton.cpp --- unity-7.3.2+15.10.20150521/dash/FilterBasicButton.cpp 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/FilterBasicButton.cpp 2015-05-22 13:20:03.000000000 +0000 @@ -188,10 +188,5 @@ graphics_engine.PopClippingRectangle(); } -std::string const& FilterBasicButton::GetLabel() const -{ - return label_; -} - } // namespace dash } // namespace unity diff -Nru unity-7.3.2+15.10.20150521/dash/FilterBasicButton.h unity-7.3.2+15.10.20150522/dash/FilterBasicButton.h --- unity-7.3.2+15.10.20150521/dash/FilterBasicButton.h 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/FilterBasicButton.h 2015-05-22 13:20:03.000000000 +0000 @@ -42,8 +42,6 @@ nux::Property scale; - std::string const& GetLabel() const; - protected: virtual long ComputeContentSize(); virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); diff -Nru unity-7.3.2+15.10.20150521/dash/FilterExpanderLabel.cpp unity-7.3.2+15.10.20150522/dash/FilterExpanderLabel.cpp --- unity-7.3.2+15.10.20150521/dash/FilterExpanderLabel.cpp 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/FilterExpanderLabel.cpp 2015-05-22 13:20:03.000000000 +0000 @@ -40,6 +40,40 @@ // font const char* const FONT_EXPANDER_LABEL = "Ubuntu 13"; // 17px = 13 +class ExpanderView : public nux::View +{ +public: + ExpanderView(NUX_FILE_LINE_DECL) + : nux::View(NUX_FILE_LINE_PARAM) + { + SetAcceptKeyNavFocusOnMouseDown(false); + SetAcceptKeyNavFocusOnMouseEnter(true); + } + +protected: + void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw) + {}; + + void DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) + { + if (GetLayout()) + GetLayout()->ProcessDraw(graphics_engine, force_draw); + } + + bool AcceptKeyNavFocus() + { + return true; + } + + nux::Area* FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type) + { + if (event_type != nux::EVENT_MOUSE_WHEEL && TestMousePointerInclusion(mouse_position, event_type)) + return this; + else + return nullptr; + } +}; + } NUX_IMPLEMENT_OBJECT_TYPE(FilterExpanderLabel); @@ -63,7 +97,6 @@ void FilterExpanderLabel::SetLabel(std::string const& label) { cairo_label_->SetText(label); - expander_view_->label = label; } void FilterExpanderLabel::UpdateScale(double scale) @@ -106,8 +139,6 @@ expander_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION); expander_view_ = new ExpanderView(NUX_TRACKER_LOCATION); - expander_view_->expanded = expanded(); - expanded.changed.connect([this] (bool expanded) { expander_view_->expanded = expanded; }); expander_view_->SetLayout(expander_layout_); top_bar_layout_->AddView(expander_view_, 1); diff -Nru unity-7.3.2+15.10.20150521/dash/FilterExpanderLabel.h unity-7.3.2+15.10.20150522/dash/FilterExpanderLabel.h --- unity-7.3.2+15.10.20150521/dash/FilterExpanderLabel.h 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/FilterExpanderLabel.h 2015-05-22 13:20:03.000000000 +0000 @@ -35,7 +35,6 @@ #include "unity-shared/IconTexture.h" #include "unity-shared/Introspectable.h" #include "unity-shared/StaticCairoText.h" -#include "unity-shared/ExpanderView.h" namespace nux { @@ -63,7 +62,7 @@ virtual void SetFilter(Filter::Ptr const& filter) = 0; virtual std::string GetFilterType() = 0; - ExpanderView* expander_view() const { return expander_view_; } + nux::View* expander_view() const { return expander_view_; } nux::Property scale; nux::Property expanded; @@ -88,7 +87,7 @@ nux::VLayout* layout_; nux::LinearLayout* top_bar_layout_; - ExpanderView* expander_view_; + nux::View* expander_view_; nux::LinearLayout* expander_layout_; nux::View* right_hand_contents_; StaticCairoText* cairo_label_; diff -Nru unity-7.3.2+15.10.20150521/debian/changelog unity-7.3.2+15.10.20150522/debian/changelog --- unity-7.3.2+15.10.20150521/debian/changelog 2015-05-22 13:28:17.000000000 +0000 +++ unity-7.3.2+15.10.20150522/debian/changelog 2015-05-22 13:28:18.000000000 +0000 @@ -1,4 +1,4 @@ -unity (7.3.2+15.10.20150521-0ubuntu1) wily; urgency=medium +unity (7.3.2+15.10.20150522-0ubuntu1) wily; urgency=medium [ CI Train Bot ] * New rebuild forced. @@ -20,14 +20,13 @@ #1441626) [ Luke Yelavich ] - * Implement filter results controls accessibility (LP: #1457071) * Implement scope bar icon accessibility (LP: #1457073) [ Marco Trevisan (TreviƱo) ] * ResultViewGrid: wait for double-click event only if the relative result needs the Preview (LP: #1447372, #1291950) - -- CI Train Bot Thu, 21 May 2015 19:35:07 +0000 + -- CI Train Bot Fri, 22 May 2015 13:21:14 +0000 unity (7.3.2+15.10.20150512-0ubuntu1) wily; urgency=medium diff -Nru unity-7.3.2+15.10.20150521/plugins/unityshell/src/unitya11y.cpp unity-7.3.2+15.10.20150522/plugins/unityshell/src/unitya11y.cpp --- unity-7.3.2+15.10.20150521/plugins/unityshell/src/unitya11y.cpp 2015-05-21 19:34:59.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unitya11y.cpp 2015-05-22 13:21:06.000000000 +0000 @@ -39,13 +39,11 @@ #include "PanelView.h" #include "DashView.h" #include "PlacesGroup.h" -#include "ExpanderView.h" #include "QuicklistView.h" #include "QuicklistMenuItem.h" #include "SwitcherView.h" #include "TextInput.h" #include "SessionButton.h" -#include "FilterBasicButton.h" #include "unity-launcher-accessible.h" #include "unity-launcher-icon-accessible.h" #include "unity-panel-view-accessible.h" @@ -55,13 +53,11 @@ #include "unity-sctext-accessible.h" #include "unity-rvgrid-accessible.h" #include "unity-places-group-accessible.h" -#include "unity-expander-view-accessible.h" #include "unity-quicklist-accessible.h" #include "unity-quicklist-menu-item-accessible.h" #include "unity-switcher-accessible.h" #include "unity-text-input-accessible.h" #include "unity-session-button-accessible.h" -#include "unity-filter-basic-button-accessible.h" using namespace unity; using namespace unity::dash; @@ -182,12 +178,6 @@ if (object->Type().IsDerivedFromType(PlacesGroup::StaticObjectType)) return unity_places_group_accessible_new(object); - if (object->Type().IsDerivedFromType(ExpanderView::StaticObjectType)) - return unity_expander_view_accessible_new(object); - - if (object->Type().IsDerivedFromType(FilterBasicButton::StaticObjectType)) - return unity_filter_basic_button_accessible_new(object); - if (object->Type().IsDerivedFromType(QuicklistView::StaticObjectType)) return unity_quicklist_accessible_new(object); diff -Nru unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-expander-view-accessible.cpp unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-expander-view-accessible.cpp --- unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-expander-view-accessible.cpp 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-expander-view-accessible.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2015 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * 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 . - * - * Authored by: Luke Yelavich - */ - -/** - * SECTION:unity-expander-view-accessible - * @Title: UnityExpanderViewAccessible - * @short_description: Implementation of the ATK interfaces for #ExpanderView - * @see_also: ExpanderView - * - * #UnityExpanderViewAccessible implements the required ATK interfaces for - * #ExpanderView, mainly exposing the text as his name, as this - * #object is mainly used as a label - * - */ - -#include -#include - -#include "unity-expander-view-accessible.h" - -#include "ExpanderView.h" -#include "StaticCairoText.h" - -DECLARE_LOGGER(logger, "unity.a11y.ExpanderView"); - -using namespace unity; - -/* GObject */ -static void unity_expander_view_accessible_class_init(UnityExpanderViewAccessibleClass* klass); -static void unity_expander_view_accessible_init(UnityExpanderViewAccessible* self); -static void unity_expander_view_accessible_dispose(GObject* object); - -/* AtkObject.h */ -static void unity_expander_view_accessible_initialize(AtkObject* accessible, - gpointer data); -static const gchar* unity_expander_view_accessible_get_name(AtkObject* obj); -static void on_focus_changed_cb(nux::Area* area, - bool has_focus, - nux::KeyNavDirection direction, - AtkObject* accessible); -static void on_expanded_changed_cb(bool is_expanded, - AtkObject* accessible); -static void on_name_changed_cb(std::string name, - AtkObject* accessible); - -G_DEFINE_TYPE(UnityExpanderViewAccessible, unity_expander_view_accessible, NUX_TYPE_VIEW_ACCESSIBLE); - - -#define UNITY_EXPANDER_VIEW_ACCESSIBLE_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE, \ - UnityExpanderViewAccessiblePrivate)) - -struct _UnityExpanderViewAccessiblePrivate -{ - gchar* name; -}; - - -static void -unity_expander_view_accessible_class_init(UnityExpanderViewAccessibleClass* klass) -{ - GObjectClass* gobject_class = G_OBJECT_CLASS(klass); - AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass); - - gobject_class->dispose = unity_expander_view_accessible_dispose; - - /* AtkObject */ - atk_class->initialize = unity_expander_view_accessible_initialize; - atk_class->get_name = unity_expander_view_accessible_get_name; - - g_type_class_add_private(gobject_class, sizeof(UnityExpanderViewAccessiblePrivate)); -} - -static void -unity_expander_view_accessible_init(UnityExpanderViewAccessible* self) -{ - UnityExpanderViewAccessiblePrivate* priv = - UNITY_EXPANDER_VIEW_ACCESSIBLE_GET_PRIVATE(self); - - self->priv = priv; - self->priv->name = NULL; -} - -static void -unity_expander_view_accessible_dispose(GObject* object) -{ - UnityExpanderViewAccessible* self = UNITY_EXPANDER_VIEW_ACCESSIBLE(object); - - if (self->priv->name != NULL) - { - g_free(self->priv->name); - self->priv->name = NULL; - } - - G_OBJECT_CLASS(unity_expander_view_accessible_parent_class)->dispose(object); -} - -AtkObject* -unity_expander_view_accessible_new(nux::Object* object) -{ - AtkObject* accessible = NULL; - - g_return_val_if_fail(dynamic_cast(object), NULL); - - accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE, NULL)); - - atk_object_initialize(accessible, object); - - return accessible; -} - -/* AtkObject.h */ -static void -unity_expander_view_accessible_initialize(AtkObject* accessible, - gpointer data) -{ - nux::Object* object = NULL; - ExpanderView* view = NULL; - - ATK_OBJECT_CLASS(unity_expander_view_accessible_parent_class)->initialize(accessible, data); - - object = (nux::Object*)data; - view = dynamic_cast(object); - - view->key_nav_focus_change.connect(sigc::bind(sigc::ptr_fun(on_focus_changed_cb), accessible)); - - view->expanded.changed.connect(sigc::bind(sigc::ptr_fun(on_expanded_changed_cb), accessible)); - view->label.changed.connect(sigc::bind(sigc::ptr_fun(on_name_changed_cb), accessible)); - - atk_object_set_role(accessible, ATK_ROLE_PANEL); -} - -static const gchar* -unity_expander_view_accessible_get_name(AtkObject* obj) -{ - g_return_val_if_fail(UNITY_IS_EXPANDER_VIEW_ACCESSIBLE(obj), NULL); - UnityExpanderViewAccessible* self = UNITY_EXPANDER_VIEW_ACCESSIBLE(obj); - - if (self->priv->name != NULL) - { - g_free(self->priv->name); - self->priv->name = NULL; - } - - self->priv->name = g_strdup(ATK_OBJECT_CLASS(unity_expander_view_accessible_parent_class)->get_name(obj)); - if (self->priv->name == NULL) - { - ExpanderView* view = NULL; - - view = dynamic_cast(nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj))); - - if (view == NULL) /* state is defunct */ - return NULL; - - if (view->expanded) - self->priv->name = g_strdup_printf(_("%s: expanded"), view->label().c_str()); - else - self->priv->name = g_strdup_printf(_("%s: collapsed"), view->label().c_str()); - } - - return self->priv->name; -} - -static void -on_focus_changed_cb(nux::Area* area, - bool has_focus, - nux::KeyNavDirection direction, - AtkObject* accessible) -{ - g_return_if_fail(UNITY_IS_EXPANDER_VIEW_ACCESSIBLE(accessible)); - - LOG_WARN(logger) << "has_focus = " << has_focus; - g_signal_emit_by_name(accessible, "focus-event", has_focus); -} - -static void -on_expanded_changed_cb(bool is_expanded, - AtkObject* accessible) -{ - g_return_if_fail(UNITY_IS_EXPANDER_VIEW_ACCESSIBLE(accessible)); - - g_object_notify(G_OBJECT(accessible), "accessible-name"); -} - -static void -on_name_changed_cb(std::string name, - AtkObject* accessible) -{ - g_return_if_fail(UNITY_IS_EXPANDER_VIEW_ACCESSIBLE(accessible)); - - g_object_notify(G_OBJECT(accessible), "accessible-name"); -} diff -Nru unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-expander-view-accessible.h unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-expander-view-accessible.h --- unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-expander-view-accessible.h 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-expander-view-accessible.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2015 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * 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 . - * - * Authored by: Luke Yelavich - */ - -#ifndef UNITY_EXPANDER_VIEW_ACCESSIBLE_H -#define UNITY_EXPANDER_VIEW_ACCESSIBLE_H - -#include - -#include -#include - -#include "nux-view-accessible.h" - -G_BEGIN_DECLS - -#define UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE (unity_expander_view_accessible_get_type ()) -#define UNITY_EXPANDER_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE, UnityExpanderViewAccessible)) -#define UNITY_EXPANDER_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE, UnityExpanderViewAccessibleClass)) -#define UNITY_IS_EXPANDER_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE)) -#define UNITY_IS_EXPANDER_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE)) -#define UNITY_EXPANDER_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_EXPANDER_VIEW_ACCESSIBLE, UnityExpanderViewAccessibleClass)) - -typedef struct _UnityExpanderViewAccessible UnityExpanderViewAccessible; -typedef struct _UnityExpanderViewAccessibleClass UnityExpanderViewAccessibleClass; -typedef struct _UnityExpanderViewAccessiblePrivate UnityExpanderViewAccessiblePrivate; - -struct _UnityExpanderViewAccessible -{ - NuxViewAccessible parent; - - /*< private >*/ - UnityExpanderViewAccessiblePrivate* priv; -}; - -struct _UnityExpanderViewAccessibleClass -{ - NuxViewAccessibleClass parent_class; -}; - -GType unity_expander_view_accessible_get_type(void); -AtkObject* unity_expander_view_accessible_new(nux::Object* object); - -G_END_DECLS - -#endif /* __UNITY_EXPANDER_VIEW_ACCESSIBLE_H__ */ diff -Nru unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-filter-basic-button-accessible.cpp unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-filter-basic-button-accessible.cpp --- unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-filter-basic-button-accessible.cpp 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-filter-basic-button-accessible.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2015 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * 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 . - * - * Authored by: Luke Yelavich - */ - -/** - * SECTION:unity-filter-basic-button_accessible - * @Title: UnityFilterBasicButtonAccessible - * @short_description: Implementation of the ATK interfaces for #unity::dash::FilterBasicButton - * - * #UnityFilterBasicButtonAccessible implements the required ATK interfaces of - * unity::dash::FilterBasicButton, exposing the common elements on each basic individual - * element (position, extents, etc) - * - */ - -#include -#include "unity-filter-basic-button-accessible.h" -#include "FilterBasicButton.h" - -#include "unitya11y.h" - -DECLARE_LOGGER(logger, "unity.a11y.UnityFilterBasicButtonAccessible"); - -using namespace unity::dash; - -/* GObject */ -static void unity_filter_basic_button_accessible_class_init(UnityFilterBasicButtonAccessibleClass* klass); -static void unity_filter_basic_button_accessible_init(UnityFilterBasicButtonAccessible* session_button_accessible); -static void unity_filter_basic_button_accessible_dispose(GObject* object); -static void unity_filter_basic_button_accessible_finalize(GObject* object); - - -/* AtkObject.h */ -static void unity_filter_basic_button_accessible_initialize(AtkObject* accessible, - gpointer data); -static AtkStateSet* unity_filter_basic_button_accessible_ref_state_set(AtkObject* obj); -static const gchar* unity_filter_basic_button_accessible_get_name(AtkObject* obj); - - -/* AtkAction */ -static void atk_action_interface_init(AtkActionIface *iface); -static gboolean unity_filter_basic_button_accessible_do_action(AtkAction *action, - gint i); -static gint unity_filter_basic_button_accessible_get_n_actions(AtkAction *action); -static const gchar* unity_filter_basic_button_accessible_get_action_name(AtkAction *action, - gint i); -static void on_layout_changed_cb(nux::View* view, - nux::Layout* layout, - AtkObject* accessible, - gboolean is_add); -static void on_focus_changed_cb(nux::Area* area, - bool has_focus, - nux::KeyNavDirection direction, - AtkObject* accessible); - -G_DEFINE_TYPE_WITH_CODE(UnityFilterBasicButtonAccessible, - unity_filter_basic_button_accessible, - NUX_TYPE_VIEW_ACCESSIBLE, - G_IMPLEMENT_INTERFACE(ATK_TYPE_ACTION, - atk_action_interface_init)) - -static void -unity_filter_basic_button_accessible_class_init(UnityFilterBasicButtonAccessibleClass* klass) -{ - GObjectClass* gobject_class = G_OBJECT_CLASS(klass); - AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass); - - gobject_class->dispose = unity_filter_basic_button_accessible_dispose; - gobject_class->finalize = unity_filter_basic_button_accessible_finalize; - - /* AtkObject */ - atk_class->initialize = unity_filter_basic_button_accessible_initialize; - atk_class->get_name = unity_filter_basic_button_accessible_get_name; - atk_class->ref_state_set = unity_filter_basic_button_accessible_ref_state_set; -} - -static void -unity_filter_basic_button_accessible_init(UnityFilterBasicButtonAccessible* session_button_accessible) -{ -} - -static void -unity_filter_basic_button_accessible_dispose(GObject* object) -{ - G_OBJECT_CLASS(unity_filter_basic_button_accessible_parent_class)->dispose(object); -} - -static void -unity_filter_basic_button_accessible_finalize(GObject* object) -{ - G_OBJECT_CLASS(unity_filter_basic_button_accessible_parent_class)->finalize(object); -} - -AtkObject* -unity_filter_basic_button_accessible_new(nux::Object* object) -{ - AtkObject* accessible = NULL; - - g_return_val_if_fail(dynamic_cast(object), NULL); - - accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_FILTER_BASIC_BUTTON_ACCESSIBLE, NULL)); - - atk_object_initialize(accessible, object); - - return accessible; -} - -/* AtkObject.h */ -static void -unity_filter_basic_button_accessible_initialize(AtkObject* accessible, - gpointer data) -{ - nux::Object* nux_object = NULL; - FilterBasicButton* button = NULL; - - ATK_OBJECT_CLASS(unity_filter_basic_button_accessible_parent_class)->initialize(accessible, data); - - accessible->role = ATK_ROLE_TOGGLE_BUTTON; - - nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible)); - - if (nux_object == NULL) /* defunct */ - return; - - button = dynamic_cast(nux_object); - - if (button == NULL) /* defunct */ - return; - - button->LayoutAdded.connect(sigc::bind(sigc::ptr_fun(on_layout_changed_cb), - accessible, TRUE)); - - button->key_nav_focus_change.connect(sigc::bind(sigc::ptr_fun(on_focus_changed_cb), accessible)); -} - -static const gchar* -unity_filter_basic_button_accessible_get_name(AtkObject* obj) -{ - const gchar* name; - - g_return_val_if_fail(UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(obj), NULL); - - name = ATK_OBJECT_CLASS(unity_filter_basic_button_accessible_parent_class)->get_name(obj); - if (name == NULL) - { - FilterBasicButton* button = NULL; - - button = dynamic_cast(nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj))); - - if (button == NULL) /* State is defunct */ - name = NULL; - else - name = button->GetLabel().c_str(); - } - - if (name == NULL) - { - LOG_WARN(logger) << "Name == NULL"; - } - - return name; -} - -static AtkStateSet* -unity_filter_basic_button_accessible_ref_state_set(AtkObject* obj) -{ - AtkStateSet* state_set = NULL; - nux::Object* nux_object = NULL; - FilterBasicButton* button = NULL; - - g_return_val_if_fail(UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(obj), NULL); - - state_set = ATK_OBJECT_CLASS(unity_filter_basic_button_accessible_parent_class)->ref_state_set(obj); - - nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj)); - - if (nux_object == NULL) /* defunct */ - return state_set; - - button = dynamic_cast(nux_object); - - atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE); - atk_state_set_add_state(state_set, ATK_STATE_ENABLED); - atk_state_set_add_state(state_set, ATK_STATE_SENSITIVE); - atk_state_set_add_state(state_set, ATK_STATE_VISIBLE); - atk_state_set_add_state(state_set, ATK_STATE_SHOWING); - - if (button->GetVisualState() == nux::ButtonVisualState::VISUAL_STATE_PRELIGHT) - { - atk_state_set_add_state(state_set, ATK_STATE_FOCUSED); - atk_state_set_add_state(state_set, ATK_STATE_SELECTED); - atk_state_set_add_state(state_set, ATK_STATE_ACTIVE); - } - - if (button->Active()) - atk_state_set_add_state(state_set, ATK_STATE_CHECKED); - - return state_set; -} - -/* AtkAction */ -static void -atk_action_interface_init(AtkActionIface *iface) -{ - iface->do_action = unity_filter_basic_button_accessible_do_action; - iface->get_n_actions = unity_filter_basic_button_accessible_get_n_actions; - iface->get_name = unity_filter_basic_button_accessible_get_action_name; -} - -static gboolean -unity_filter_basic_button_accessible_do_action(AtkAction *action, - gint i) -{ - FilterBasicButton* button = NULL; - nux::Object* nux_object = NULL; - - g_return_val_if_fail(UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(action), FALSE); - - nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(action)); - if (nux_object == NULL) - return FALSE; - - button = dynamic_cast(nux_object); - - button->Activate(); - - return TRUE; -} - -static gint -unity_filter_basic_button_accessible_get_n_actions(AtkAction *action) -{ - g_return_val_if_fail(UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(action), 0); - - return 1; -} - -static const gchar* -unity_filter_basic_button_accessible_get_action_name(AtkAction *action, - gint i) -{ - g_return_val_if_fail(UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(action), NULL); - g_return_val_if_fail(i == 0, NULL); - - return "activate"; -} - -static void -on_layout_changed_cb(nux::View* view, - nux::Layout* layout, - AtkObject* accessible, - gboolean is_add) -{ - g_return_if_fail(UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(accessible)); - - g_object_notify(G_OBJECT(accessible), "accessible-name"); -} - -static void -on_focus_changed_cb(nux::Area* area, - bool has_focus, - nux::KeyNavDirection direction, - AtkObject* accessible) -{ - g_return_if_fail(UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(accessible)); - - g_signal_emit_by_name(accessible, "focus-event", has_focus); -} diff -Nru unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-filter-basic-button-accessible.h unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-filter-basic-button-accessible.h --- unity-7.3.2+15.10.20150521/plugins/unityshell/src/unity-filter-basic-button-accessible.h 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-filter-basic-button-accessible.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2015 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * 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 . - * - * Authored by: Luke Yelavich - */ - -#ifndef UNITY_FILTER_BASIC_BUTTON_ACCESSIBLE_H -#define UNITY_FILTER_BASIC_BUTTON_ACCESSIBLE_H - -#include - -#include "nux-view-accessible.h" - -G_BEGIN_DECLS - -#define UNITY_TYPE_FILTER_BASIC_BUTTON_ACCESSIBLE (unity_filter_basic_button_accessible_get_type ()) -#define UNITY_FILTER_BASIC_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_FILTER_BASIC_BUTTON_ACCESSIBLE, UnityFilterBasicButtonAccessible)) -#define UNITY_FILTER_BASIC_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_FILTER_BASIC_BUTTON_ACCESSIBLE, UnityFilterBasicButtonAccessibleClass)) -#define UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_FILTER_BASIC_BUTTON_ACCESSIBLE)) -#define UNITY_IS_FILTER_BASIC_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_FILTER_BASIC_BUTTON_ACCESSIBLE)) -#define UNITY_FILTER_BASIC_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_FILTER_BASIC_BUTTON_ACCESSIBLE, UnityFilterBasicButtonAccessibleClass)) - -typedef struct _UnityFilterBasicButtonAccessible UnityFilterBasicButtonAccessible; -typedef struct _UnityFilterBasicButtonAccessibleClass UnityFilterBasicButtonAccessibleClass; - -struct _UnityFilterBasicButtonAccessible -{ - NuxViewAccessible parent; -}; - -struct _UnityFilterBasicButtonAccessibleClass -{ - NuxViewAccessibleClass parent_class; -}; - -GType unity_filter_basic_button_accessible_get_type(void); -AtkObject* unity_filter_basic_button_accessible_new(nux::Object* object); - -G_END_DECLS - -#endif /* __UNITY_FILTER_BASIC_BUTTON_ACCESSIBLE_H__ */ diff -Nru unity-7.3.2+15.10.20150521/unity-shared/CMakeLists.txt unity-7.3.2+15.10.20150522/unity-shared/CMakeLists.txt --- unity-7.3.2+15.10.20150521/unity-shared/CMakeLists.txt 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/CMakeLists.txt 2015-05-22 13:20:03.000000000 +0000 @@ -28,7 +28,6 @@ DeltaRestrainment.cpp DesktopApplicationManager.cpp EMConverter.cpp - ExpanderView.cpp GnomeFileManager.cpp FontSettings.cpp GraphicsUtils.cpp diff -Nru unity-7.3.2+15.10.20150521/unity-shared/ExpanderView.cpp unity-7.3.2+15.10.20150522/unity-shared/ExpanderView.cpp --- unity-7.3.2+15.10.20150521/unity-shared/ExpanderView.cpp 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/ExpanderView.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- -/* - * Copyright (C) 2015 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * 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 . - * - * Authored by: Luke Yelavich - */ - -#include - -#include "ExpanderView.h" - -namespace unity -{ - -NUX_IMPLEMENT_OBJECT_TYPE(ExpanderView); - -ExpanderView::ExpanderView(NUX_FILE_LINE_DECL) - : nux::View(NUX_FILE_LINE_PARAM) -{ - SetAcceptKeyNavFocusOnMouseDown(false); - SetAcceptKeyNavFocusOnMouseEnter(true); -} - -void ExpanderView::Draw(nux::GraphicsEngine& graphics_engine, bool force_draw) -{ -} - -void ExpanderView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) -{ - if (GetLayout()) - GetLayout()->ProcessDraw(graphics_engine, force_draw); -} - -bool ExpanderView::AcceptKeyNavFocus() -{ - return true; -} - -nux::Area* ExpanderView::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type) -{ - if (TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type)) - return this; - - return nullptr; -} - -} // namespace unity diff -Nru unity-7.3.2+15.10.20150521/unity-shared/ExpanderView.h unity-7.3.2+15.10.20150522/unity-shared/ExpanderView.h --- unity-7.3.2+15.10.20150521/unity-shared/ExpanderView.h 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/ExpanderView.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- -/* - * Copyright (C) 2015 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * 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 . - * - * Authored by: Luke Yelavich - */ - -#ifndef EXPANDERVIEW_H -#define EXPANDERVIEW_H - -#include - -namespace unity -{ - -class ExpanderView : public nux::View -{ - NUX_DECLARE_OBJECT_TYPE(ExpanderView, nux::View); -public: - ExpanderView(NUX_FILE_LINE_PROTO); - - nux::Property expanded; - nux::Property label; -protected: - void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw); - void DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw); - - bool AcceptKeyNavFocus(); - - nux::Area* FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type); -}; - -} - -#endif diff -Nru unity-7.3.2+15.10.20150521/unity-shared/SearchBar.cpp unity-7.3.2+15.10.20150522/unity-shared/SearchBar.cpp --- unity-7.3.2+15.10.20150521/unity-shared/SearchBar.cpp 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/SearchBar.cpp 2015-05-22 13:20:35.000000000 +0000 @@ -88,6 +88,45 @@ } DECLARE_LOGGER(logger, "unity.dash.searchbar"); +namespace +{ +class ExpanderView : public nux::View +{ +public: + ExpanderView(NUX_FILE_LINE_DECL) + : nux::View(NUX_FILE_LINE_PARAM) + { + SetAcceptKeyNavFocusOnMouseDown(false); + SetAcceptKeyNavFocusOnMouseEnter(true); + } + +protected: + void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw) + {} + + void DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) + { + if (GetLayout()) + GetLayout()->ProcessDraw(graphics_engine, force_draw); + } + + bool AcceptKeyNavFocus() + { + return true; + } + + nux::Area* FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type) + { + bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type); + + if (mouse_inside == false) + return nullptr; + + return this; + } +}; + +} namespace unity { @@ -195,9 +234,6 @@ filter_layout_->AddView(arrow_layout_, 0, nux::MINOR_POSITION_CENTER); expander_view_ = new ExpanderView(NUX_TRACKER_LOCATION); - expander_view_->label = filter_str; - expander_view_->expanded = showing_filters(); - showing_filters.changed.connect([this] (bool showing_filters) { expander_view_->expanded = showing_filters; }); expander_view_->SetVisible(false); expander_view_->SetLayout(filter_layout_); layout_->AddView(expander_view_, 0, nux::MINOR_POSITION_END, nux::MINOR_SIZE_FULL); diff -Nru unity-7.3.2+15.10.20150521/unity-shared/SearchBar.h unity-7.3.2+15.10.20150522/unity-shared/SearchBar.h --- unity-7.3.2+15.10.20150521/unity-shared/SearchBar.h 2015-05-21 19:34:53.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/SearchBar.h 2015-05-22 13:20:35.000000000 +0000 @@ -26,7 +26,6 @@ #include #include "unity-shared/Introspectable.h" -#include "unity-shared/ExpanderView.h" namespace nux { @@ -109,7 +108,7 @@ StaticCairoText* hint_; nux::LinearLayout* expander_layout_; IMTextEntry* pango_entry_; - ExpanderView* expander_view_; + nux::View* expander_view_; nux::HLayout* filter_layout_; StaticCairoText* show_filters_; nux::VLayout* arrow_layout_;