From 0aaaf0ba46e763943999838024bf7633ee02c42f Mon Sep 17 00:00:00 2001 From: Andreas Volz Date: Sun, 2 May 2010 20:41:38 +0000 Subject: [PATCH] start of genlist wrapper SVN revision: 48565 --- elementaryxx/include/elementaryxx/GenList.h | 118 ++++++++++++++++++ elementaryxx/include/elementaryxx/Makefile.am | 3 +- elementaryxx/src/GenList.cpp | 113 +++++++++++++++++ elementaryxx/src/Makefile.am | 3 +- 4 files changed, 235 insertions(+), 2 deletions(-) create mode 100644 elementaryxx/include/elementaryxx/GenList.h create mode 100644 elementaryxx/src/GenList.cpp diff --git a/elementaryxx/include/elementaryxx/GenList.h b/elementaryxx/include/elementaryxx/GenList.h new file mode 100644 index 0000000..ef3fd01 --- /dev/null +++ b/elementaryxx/include/elementaryxx/GenList.h @@ -0,0 +1,118 @@ +#ifndef ELMXX_GEN_LIST_H +#define ELMXX_GEN_LIST_H + +/* STL */ +#include + +/* EFL */ +#include + +/* ELFxx */ +#include "Object.h" + +namespace Elmxx { + +/*! + * smart callbacks called: + + */ +class GenList : public Object +{ +public: + static GenList *factory (Evasxx::Object &parent); + + void clear (); + + void setMultiSelect (bool multi); + + bool getMultiSelect (); + + void setHorizontalMode (Elm_List_Mode mode); + + Elm_List_Mode getHorizontalMode (); + + void setAlwaysSelectMode (bool alwaysSelect); + + bool getAlwaysSelectMode (); + + void setNoSelectMode (bool noSelect); + + bool getNoSelectMode (); + + void setCompressMode (bool compress); + + bool getCompressMode (); + + void setBounce (bool hBounce, bool vBounce); + + void getBounce (bool &hBounceOut, bool &vBounceOut); + + void setHomogeneous (bool homogeneous); + + bool getHomogeneous (); + + void setBlockCount (int n); + + int getBlockCound (); + + +private: + GenList (); // forbid standard constructor + GenList (const GenList&); // forbid copy constructor + GenList (Evasxx::Object &parent); // private construction -> use factory () + ~GenList (); // forbid direct delete -> use Object::destroy() +}; + +#if 0 + + + /* operations to add items */ + EAPI Elm_Genlist_Item *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); + EAPI Elm_Genlist_Item *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *parent, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); + EAPI Elm_Genlist_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *before, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); + EAPI Elm_Genlist_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Genlist_Item *after, Elm_Genlist_Item_Flags flags, Evas_Smart_Cb func, const void *func_data); + /* operations to retrieve existing items */ + EAPI Elm_Genlist_Item *elm_genlist_selected_item_get(const Evas_Object *obj); + EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj); + EAPI Eina_List *elm_genlist_realized_items_get(const Evas_Object *obj); + EAPI Elm_Genlist_Item *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret); + EAPI Elm_Genlist_Item *elm_genlist_first_item_get(const Evas_Object *obj); + EAPI Elm_Genlist_Item *elm_genlist_last_item_get(const Evas_Object *obj); + /* available item styles: + * default + * default_style - The text part is a textblock + * double_label + * icon_top_text_bottom + */ + + /* Genlist Item operation */ + EAPI Elm_Genlist_Item *elm_genlist_item_next_get(const Elm_Genlist_Item *item); + EAPI Elm_Genlist_Item *elm_genlist_item_prev_get(const Elm_Genlist_Item *item); + EAPI Evas_Object *elm_genlist_item_genlist_get(const Elm_Genlist_Item *item); + EAPI Elm_Genlist_Item *elm_genlist_item_parent_get(const Elm_Genlist_Item *it); + EAPI void elm_genlist_item_subitems_clear(Elm_Genlist_Item *item); + EAPI void elm_genlist_item_selected_set(Elm_Genlist_Item *item, Eina_Bool selected); + EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Genlist_Item *item); + EAPI void elm_genlist_item_expanded_set(Elm_Genlist_Item *item, Eina_Bool expanded); + EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Genlist_Item *item); + EAPI void elm_genlist_item_disabled_set(Elm_Genlist_Item *item, Eina_Bool disabled); + EAPI Eina_Bool elm_genlist_item_disabled_get(const Elm_Genlist_Item *item); + EAPI void elm_genlist_item_display_only_set(Elm_Genlist_Item *it, Eina_Bool display_only); + EAPI Eina_Bool elm_genlist_item_display_only_get(const Elm_Genlist_Item *it); + EAPI void elm_genlist_item_show(Elm_Genlist_Item *item); + EAPI void elm_genlist_item_bring_in(Elm_Genlist_Item *item); + EAPI void elm_genlist_item_top_show(Elm_Genlist_Item *item); + EAPI void elm_genlist_item_top_bring_in(Elm_Genlist_Item *item); + EAPI void elm_genlist_item_middle_show(Elm_Genlist_Item *it); + EAPI void elm_genlist_item_middle_bring_in(Elm_Genlist_Item *it); + EAPI void elm_genlist_item_del(Elm_Genlist_Item *item); + EAPI const void *elm_genlist_item_data_get(const Elm_Genlist_Item *item); + EAPI void elm_genlist_item_data_set(Elm_Genlist_Item *it, const void *data); + EAPI const Evas_Object *elm_genlist_item_object_get(const Elm_Genlist_Item *it); + EAPI void elm_genlist_item_update(Elm_Genlist_Item *item); + +#endif // 0 + +} // end namespace Elmxx + +#endif // ELMXX_GEN_LIST_H diff --git a/elementaryxx/include/elementaryxx/Makefile.am b/elementaryxx/include/elementaryxx/Makefile.am index f484524..6d4864d 100644 --- a/elementaryxx/include/elementaryxx/Makefile.am +++ b/elementaryxx/include/elementaryxx/Makefile.am @@ -30,7 +30,8 @@ libelementaryxx_HEADERS = \ Spinner.h \ Progressbar.h \ Panel.h \ - Separator.h + Separator.h \ + GenList.h libelementaryxxdir = \ $(pkgincludedir) diff --git a/elementaryxx/src/GenList.cpp b/elementaryxx/src/GenList.cpp new file mode 100644 index 0000000..6c4f4aa --- /dev/null +++ b/elementaryxx/src/GenList.cpp @@ -0,0 +1,113 @@ +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "../include/elementaryxx/GenList.h" + +using namespace std; + +namespace Elmxx { + +GenList::GenList (Evasxx::Object &parent) +{ + o = elm_genlist_add (parent.obj ()); + + elmInit (); +} + +GenList::~GenList () {} + +GenList *GenList::factory (Evasxx::Object &parent) +{ + return new GenList (parent); +} + +void GenList::clear () +{ + elm_genlist_clear (o); +} + +void GenList::setMultiSelect (bool multi) +{ + elm_genlist_multi_select_set (o, multi); +} + +bool GenList::getMultiSelect () +{ + return elm_genlist_multi_select_get (o); +} + +void GenList::setHorizontalMode (Elm_List_Mode mode) +{ + elm_genlist_horizontal_mode_set (o, mode); +} + +Elm_List_Mode GenList::getHorizontalMode () +{ + return elm_genlist_horizontal_mode_get (o); +} + +void GenList::setAlwaysSelectMode (bool alwaysSelect) +{ + elm_genlist_always_select_mode_set (o, alwaysSelect); +} + +bool GenList::getAlwaysSelectMode () +{ + return elm_genlist_always_select_mode_get (o); +} + +void GenList::setNoSelectMode (bool noSelect) +{ + elm_genlist_no_select_mode_set (o, noSelect); +} + +bool GenList::getNoSelectMode () +{ + return elm_genlist_no_select_mode_get (o); +} + +void GenList::setCompressMode (bool compress) +{ + elm_genlist_compress_mode_set (o, compress); +} + +bool GenList::getCompressMode () +{ + return elm_genlist_compress_mode_get (o); +} + +void GenList::setBounce (bool hBounce, bool vBounce) +{ + elm_genlist_bounce_set (o, hBounce, vBounce); +} + +void GenList::getBounce (bool &hBounceOut, bool &vBounceOut) +{ + Eina_Bool h, v; + elm_genlist_bounce_get (o, &h, &v); + hBounceOut = h; + vBounceOut = v; +} + +void GenList::setHomogeneous (bool homogeneous) +{ + elm_genlist_homogeneous_set (o, homogeneous); +} + +bool GenList::getHomogeneous () +{ + return elm_genlist_homogeneous_get (o); +} + +void GenList::setBlockCount (int n) +{ + elm_genlist_block_count_set (o, n); +} + +int GenList::getBlockCound () +{ + return elm_genlist_block_count_get (o); +} + +} // end namespace Elmxx diff --git a/elementaryxx/src/Makefile.am b/elementaryxx/src/Makefile.am index 848bf35..3f53268 100644 --- a/elementaryxx/src/Makefile.am +++ b/elementaryxx/src/Makefile.am @@ -46,5 +46,6 @@ libelementaryxx_la_SOURCES = \ Spinner.cpp \ Progressbar.cpp \ Panel.cpp \ - Separator.cpp + Separator.cpp \ + GenList.cpp