[atkmm] Replace remaining uses of Glib::ArrayHandle<> with vector.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atkmm] Replace remaining uses of Glib::ArrayHandle<> with vector.
- Date: Fri, 17 Mar 2017 12:58:23 +0000 (UTC)
commit eba82002a38bf5d2855055eaeb0b482e98685225
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Mar 17 13:56:55 2017 +0100
Replace remaining uses of Glib::ArrayHandle<> with vector.
Using Glib::ArrayHandler<>::array_to_vector() and
Glib::ArrayHandler<>::vector_to_array() instead, and only in the
implementation instead of in the API.
atk/src/relation.ccg | 12 ++++++------
atk/src/relation.hg | 9 ++++-----
atk/src/stateset.ccg | 4 ++--
atk/src/stateset.hg | 5 ++---
atk/src/table.ccg | 8 ++++----
atk/src/table.hg | 5 ++---
6 files changed, 20 insertions(+), 23 deletions(-)
---
diff --git a/atk/src/relation.ccg b/atk/src/relation.ccg
index 9ca26fd..7139020 100644
--- a/atk/src/relation.ccg
+++ b/atk/src/relation.ccg
@@ -27,26 +27,26 @@ namespace Atk
{
//TODO: Implement this with the new GValue array thingy. See bug #74246.
-Relation::Relation(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets,
+Relation::Relation(const std::vector<Glib::RefPtr<Atk::Object>>& targets,
RelationType relationship)
:
- Glib::Object((GObject*) atk_relation_new(const_cast<AtkObject**>(targets.data()), targets.size(),
+ Glib::Object((GObject*)
atk_relation_new(const_cast<AtkObject**>(Glib::ArrayHandler<Glib::RefPtr<Atk::Object>>::vector_to_array(targets).data()),
targets.size(),
(AtkRelationType) relationship))
{}
-Glib::ArrayHandle< Glib::RefPtr<Atk::Object> > Relation::get_target()
+std::vector<Glib::RefPtr<Atk::Object>> Relation::get_target()
{
auto* const parray = atk_relation_get_target(gobj());
- return Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >
+ return Glib::ArrayHandler<Glib::RefPtr<Atk::Object>>::array_to_vector
(reinterpret_cast<AtkObject**>(parray->pdata), parray->len, Glib::OWNERSHIP_NONE);
}
-Glib::ArrayHandle< Glib::RefPtr<const Atk::Object> > Relation::get_target() const
+std::vector<Glib::RefPtr<const Atk::Object>> Relation::get_target() const
{
auto* const parray = atk_relation_get_target(const_cast<AtkRelation*>(gobj()));
- return Glib::ArrayHandle< Glib::RefPtr<const Atk::Object> >
+ return Glib::ArrayHandler<Glib::RefPtr<const Atk::Object>>::array_to_vector
(reinterpret_cast<AtkObject**>(parray->pdata), parray->len, Glib::OWNERSHIP_NONE);
}
diff --git a/atk/src/relation.hg b/atk/src/relation.hg
index 1337fc2..6ba57c2 100644
--- a/atk/src/relation.hg
+++ b/atk/src/relation.hg
@@ -22,7 +22,6 @@ _DEFS(atkmm,atk)
_PINCLUDE(glibmm/private/object_p.h)
#include <glibmm/object.h>
-#include <glibmm/arrayhandle.h>
namespace Atk
{
@@ -41,17 +40,17 @@ class Relation : public Glib::Object
_CLASS_GOBJECT(Relation, AtkRelation, ATK_RELATION, Glib::Object, GObject)
protected:
- explicit Relation(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets,
+ explicit Relation(const std::vector<Glib::RefPtr<Atk::Object>>& targets,
RelationType relationship);
public:
- _WRAP_CREATE(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets,
+ _WRAP_CREATE(const std::vector<Glib::RefPtr<Atk::Object>>& targets,
RelationType relationship = RELATION_NULL)
_WRAP_METHOD(RelationType get_relation_type() const, atk_relation_get_relation_type)
- Glib::ArrayHandle< Glib::RefPtr<Atk::Object> > get_target();
- Glib::ArrayHandle< Glib::RefPtr<const Atk::Object> > get_target() const;
+ std::vector<Glib::RefPtr<Atk::Object>> get_target();
+ std::vector<Glib::RefPtr<const Atk::Object>> get_target() const;
_IGNORE(atk_relation_get_target)
_WRAP_METHOD(void add_target(const Glib::RefPtr<Atk::Object>& target), atk_relation_add_target)
diff --git a/atk/src/stateset.ccg b/atk/src/stateset.ccg
index 411fdb1..cb84b6f 100644
--- a/atk/src/stateset.ccg
+++ b/atk/src/stateset.ccg
@@ -25,12 +25,12 @@
namespace Atk
{
-void StateSet::add_states(const Glib::ArrayHandle<StateType>& types)
+void StateSet::add_states(const std::vector<StateType>& types)
{
atk_state_set_add_states(gobj(), (AtkStateType*) types.data(), types.size());
}
-bool StateSet::contains_states(const Glib::ArrayHandle<StateType>& types) const
+bool StateSet::contains_states(const std::vector<StateType>& types) const
{
return atk_state_set_contains_states(
const_cast<AtkStateSet*>(gobj()), (AtkStateType*) types.data(), types.size());
diff --git a/atk/src/stateset.hg b/atk/src/stateset.hg
index b22578c..1e5bb87 100644
--- a/atk/src/stateset.hg
+++ b/atk/src/stateset.hg
@@ -22,7 +22,6 @@ _PINCLUDE(glibmm/private/object_p.h)
#include <glibmm/object.h>
#include <glibmm/value.h>
-#include <glibmm/arrayhandle.h>
namespace Atk
{
@@ -47,11 +46,11 @@ public:
//Note that we use Atk::StateType instead of StateType, because there is a Gtk::StateType too, and Doxygen
gets confused.
_WRAP_METHOD(bool add_state(Atk::StateType type), atk_state_set_add_state)
- void add_states(const Glib::ArrayHandle<Atk::StateType>& types);
+ void add_states(const std::vector<Atk::StateType>& types);
_IGNORE(atk_state_set_add_states)
_WRAP_METHOD(void clear_states(),atk_state_set_clear_states)
_WRAP_METHOD(bool contains_state(Atk::StateType type), atk_state_set_contains_state)
- bool contains_states(const Glib::ArrayHandle<Atk::StateType>& types) const;
+ bool contains_states(const std::vector<Atk::StateType>& types) const;
_IGNORE(atk_state_set_contains_states)
_WRAP_METHOD(bool remove_state(Atk::StateType type), atk_state_set_remove_state)
_WRAP_METHOD(Glib::RefPtr<StateSet> and_sets(const Glib::RefPtr<StateSet>& compare_set),
atk_state_set_and_sets)
diff --git a/atk/src/table.ccg b/atk/src/table.ccg
index 01ee59e..5acf8da 100644
--- a/atk/src/table.ccg
+++ b/atk/src/table.ccg
@@ -25,20 +25,20 @@
namespace Atk
{
-Glib::ArrayHandle<int> Table::get_selected_columns() const
+std::vector<int> Table::get_selected_columns() const
{
int* selected = nullptr;
const int n_selected = atk_table_get_selected_columns(const_cast<AtkTable*>(gobj()), &selected);
- return Glib::ArrayHandle<int>(selected, n_selected, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<int>::array_to_vector(selected, n_selected, Glib::OWNERSHIP_SHALLOW);
}
-Glib::ArrayHandle<int> Table::get_selected_rows() const
+std::vector<int> Table::get_selected_rows() const
{
int* selected = nullptr;
const int n_selected = atk_table_get_selected_rows(const_cast<AtkTable*>(gobj()), &selected);
- return Glib::ArrayHandle<int>(selected, n_selected, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<int>::array_to_vector(selected, n_selected, Glib::OWNERSHIP_SHALLOW);
}
} // namespace Atk
diff --git a/atk/src/table.hg b/atk/src/table.hg
index a3af06b..ae4ae19 100644
--- a/atk/src/table.hg
+++ b/atk/src/table.hg
@@ -21,7 +21,6 @@ _DEFS(atkmm,atk)
_PINCLUDE(atk/atkobject.h)
#include <glibmm/interface.h>
-#include <glibmm/arrayhandle.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
@@ -92,8 +91,8 @@ public:
_WRAP_METHOD(void set_summary(const Glib::RefPtr<Atk::Object>& accessible), atk_table_set_summary)
_IGNORE(atk_table_get_selected_columns, atk_table_get_selected_rows)
- Glib::ArrayHandle<int> get_selected_columns() const;
- Glib::ArrayHandle<int> get_selected_rows() const;
+ std::vector<int> get_selected_columns() const;
+ std::vector<int> get_selected_rows() const;
_WRAP_METHOD(bool is_column_selected(int column) const, atk_table_is_column_selected)
_WRAP_METHOD(bool is_row_selected(int row) const, atk_table_is_row_selected)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]