follow C API

SVN revision: 64788
This commit is contained in:
Andreas Volz 2011-11-05 19:45:19 +00:00
parent cf664855f7
commit 6d22230e79
14 changed files with 335 additions and 283 deletions

View File

@ -35,11 +35,12 @@
#include "Spinner.h"
#include "Progressbar.h"
#include "Panel.h"
#include "Gen.h"
#include "GenList.h"
#include "GenListDataModel.h"
#include "GenDataModel.h"
#include "GenListColumnSelector.h"
#include "GenListColumnConstructor.h"
#include "GenListItem.h"
#include "GenItem.h"
#endif // ELEMENTARYXX_H

View File

@ -0,0 +1,43 @@
#ifndef ELMXX_GEN_H
#define ELMXX_GEN_H
/* STL */
#include <string>
/* EFL */
#include <Elementary.h>
/* ELFxx */
#include "Object.h"
namespace Elmxx {
class Gen : public Object
{
public:
virtual void clear ();
virtual void setAlwaysSelectMode (bool alwaysSelect);
virtual bool getAlwaysSelectMode ();
virtual void setNoSelectMode (bool noSelect);
virtual bool getNoSelectMode ();
virtual void setBounce (bool hBounce, bool vBounce);
virtual void getBounce (bool &hBounceOut, bool &vBounceOut);
protected:
Gen (); // allow only construction for child classes
~Gen (); // forbid direct delete -> use Object::destroy()
private:
Gen (const Gen&); // forbid copy constructor
};
} // end namespace Elmxx
#endif // ELMXX_GEN_H

View File

@ -11,29 +11,30 @@
namespace Elmxx {
/* forward declarations */
class GenList;
class Gen;
class Icon;
class Window;
class Object;
class GenListColumnConstructor;
class GenListDataModel
class GenDataModel
{
public:
friend class Gen;
friend class GenList;
GenListDataModel (const std::string &style);
virtual ~GenListDataModel () {}
GenDataModel (const std::string &style);
virtual ~GenDataModel () {}
virtual std::string getLabel (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) const = 0;
virtual Elmxx::Object *getIcon (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) = 0;
virtual Elmxx::Object *getContent (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) = 0;
virtual bool getState (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) = 0;
private:
static char *gl_label_get (void *data, Evas_Object *obj, const char *part);
static Evas_Object *gl_icon_get (void *data, Evas_Object *obj, const char *part);
static Evas_Object *gl_content_get (void *data, Evas_Object *obj, const char *part);
static Eina_Bool gl_state_get (void *data, Evas_Object *obj, const char *part);
static void gl_del (void *data, Evas_Object *obj);

View File

@ -1,5 +1,5 @@
#ifndef ELMXX_GEN_LIST_ITEM_H
#define ELMXX_GEN_LIST_ITEM_H
#ifndef ELMXX_GEN_ITEM_H
#define ELMXX_GEN_ITEM_H
/* EFL */
#include <Elementary.h>
@ -11,15 +11,16 @@
namespace Elmxx {
/* forward declarations */
class GenList;
class GenListDataModel;
class Gen;
class GenDataModel;
class GenListItem
class GenItem
{
public:
friend class Gen;
friend class GenList;
virtual ~GenListItem ();
virtual ~GenItem ();
#if 0
/* Genlist Item operation */
@ -48,20 +49,21 @@ public:
const Evasxx::Object *getEvasObject ();
static GenListItem *wrap (Elm_Genlist_Item &item, GenListDataModel &model);
static GenItem *wrap (Elm_Genlist_Item &item, GenDataModel &model);
static GenListItem *objectLink (const Elm_Genlist_Item *item);
static GenItem *objectLink (const Elm_Genlist_Item *item);
private:
GenListItem (Elm_Genlist_Item *item);
GenItem (Elm_Genlist_Item *item);
const void *getData ();
void setData (const void *data);
Elm_Genlist_Item *mItem;
GenListDataModel *mDataModel;
Elm_Gen_Item *mItem;
GenDataModel *mDataModel;
};
} // end namespace Elmxx
#endif // ELMXX_GEN_LIST_ITEM_H
#endif // ELMXX_GEN_ITEM_H

View File

@ -9,15 +9,16 @@
/* ELFxx */
#include "Object.h"
#include "GenListDataModel.h"
#include "Gen.h"
#include "GenDataModel.h"
namespace Elmxx {
/* forward declarations */
class GenListItem;
class GenItem;
class GenListColumnConstructor;
class GenListColumnSelector;
/*!
* @defgroup Genlist Genlist
*
@ -254,37 +255,23 @@ class GenListColumnSelector;
* have a specific style that overrides any theme the user or system sets up
* you can use elm_theme_overlay_add() to add such a file.
*/
class GenList : public Object
class GenList : public Gen
{
public:
static GenList *factory (Evasxx::Object &parent);
void clear ();
void setMultiSelect (bool multi);
bool getMultiSelect ();
void setHorizontalMode (Elm_List_Mode mode);
void setHorizontal (Elm_List_Mode mode);
Elm_List_Mode getHorizontalMode ();
void setAlwaysSelectMode (bool alwaysSelect);
bool getAlwaysSelectMode ();
void setNoSelectMode (bool noSelect);
bool getNoSelectMode ();
Elm_List_Mode getHorizontal ();
void setCompressMode (bool compress);
bool getCompressMode ();
void setBounce (bool hBounce, bool vBounce);
void getBounce (bool &hBounceOut, bool &vBounceOut);
void setHomogeneous (bool homogeneous);
bool getHomogeneous ();
@ -293,7 +280,7 @@ public:
int getBlockCound ();
void setDataModel (GenListDataModel &model);
void setDataModel (GenDataModel &model);
/* operations to add items */
@ -314,17 +301,17 @@ public:
* @return A handle to the item added or NULL if not possible
*
*/
GenListItem *append (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenItem *append (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenListItem *prepend (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenItem *prepend (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenListItem *insertBefore (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenItem *insertBefore (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenListItem *insertAfter (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenItem *insertAfter (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
void del (GenListItem &item);
void del (GenItem &item);
GenListItem *getItemSelected () const;
GenItem *getItemSelected () const;
/*!
* Get the item that is at the x, y canvas coords
@ -346,11 +333,11 @@ public:
* @return The item at the coordinates or NULL if none
*
*/
GenListItem *getItemAtXY (const Eflxx::Point &pos, int &posret) const;
GenItem *getItemAtXY (const Eflxx::Point &pos, int &posret) const;
GenListItem *getItemFirst () const;
GenItem *getItemFirst () const;
GenListItem *getItemLast () const;
GenItem *getItemLast () const;
// TODO: which type is event_info here instead of void*?
sigc::signal <void, GenListColumnSelector&, const Evasxx::Object&, void*> signalSelect;
@ -369,13 +356,13 @@ private:
InsertBefore
};
GenListItem *insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenListItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
GenItem *insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
static void gl_sel (void *data, Evas_Object *obj, void *event_info);
void glSelected (GenListColumnSelector &selection, const Evasxx::Object &eo, void *event_info);
GenListDataModel *mModel;
GenDataModel *mModel;
std::list <GenListColumnSelector*> mInternalSelList;
std::list <GenListColumnConstructor*> mInternalConstructList;

View File

@ -8,20 +8,20 @@ namespace Elmxx {
/* forward declarations */
class GenList;
class GenListDataModel;
class GenListItem;
class GenDataModel;
class GenItem;
class GenListColumnConstructor
{
public:
friend class GenList;
friend class GenListDataModel;
friend class GenDataModel;
GenListColumnConstructor ();
private:
GenListDataModel *mDataModel;
GenListItem *mGenListItem;
GenDataModel *mDataModel;
GenItem *mGenItem;
};
} // end namespace Elmxx

View File

@ -31,10 +31,11 @@ libelementaryxx_HEADERS = \
Panel.h \
Separator.h \
GenList.h \
GenListItem.h \
GenListDataModel.h \
GenDataModel.h \
GenListColumnConstructor.h \
GenListColumnSelector.h
GenListColumnSelector.h \
Gen.h \
GenItem.h
libelementaryxxdir = \
$(pkgincludedir)

54
elementaryxx/src/Gen.cpp Normal file
View File

@ -0,0 +1,54 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* Project */
#include "../include/elementaryxx/Gen.h"
#include "localUtil.h"
/* STD */
#include <cassert>
using namespace std;
namespace Elmxx {
void Gen::clear ()
{
elm_gen_clear (o);
}
void Gen::setAlwaysSelectMode (bool alwaysSelect)
{
elm_gen_always_select_mode_set (o, alwaysSelect);
}
bool Gen::getAlwaysSelectMode ()
{
return elm_gen_always_select_mode_get (o);
}
void Gen::setNoSelectMode (bool noSelect)
{
elm_gen_no_select_mode_set (o, noSelect);
}
bool Gen::getNoSelectMode ()
{
return elm_gen_no_select_mode_get (o);
}
void Gen::setBounce (bool hBounce, bool vBounce)
{
elm_gen_bounce_set (o, hBounce, vBounce);
}
void Gen::getBounce (bool &hBounceOut, bool &vBounceOut)
{
Eina_Bool h, v;
elm_gen_bounce_get (o, &h, &v);
hBounceOut = h;
vBounceOut = v;
}
} // end namespace Elmxx

View File

@ -1,5 +1,5 @@
/* Project */
#include "../include/elementaryxx/GenListDataModel.h"
#include "../include/elementaryxx/GenDataModel.h"
#include "../include/elementaryxx/Icon.h"
#include "../include/elementaryxx/Window.h"
#include "../include/elementaryxx/GenListColumnConstructor.h"
@ -12,26 +12,26 @@ using namespace std;
namespace Elmxx {
GenListDataModel::GenListDataModel (const std::string &style) :
GenDataModel::GenDataModel (const std::string &style) :
mStyle (style)
{
cout << "creating GenListDataModel with style = " << mStyle << endl;
cout << "creating GenDataModel with style = " << mStyle << endl;
mGLIC.item_style = mStyle.c_str ();
mGLIC.func.label_get = GenListDataModel::gl_label_get;
mGLIC.func.icon_get = GenListDataModel::gl_icon_get;
mGLIC.func.state_get = GenListDataModel::gl_state_get;
mGLIC.func.del = GenListDataModel::gl_del;
mGLIC.func.label_get = GenDataModel::gl_label_get;
mGLIC.func.content_get = GenDataModel::gl_content_get;
mGLIC.func.state_get = GenDataModel::gl_state_get;
mGLIC.func.del = GenDataModel::gl_del;
}
/* wrappers */
char *GenListDataModel::gl_label_get (void *data, Evas_Object *obj, const char *part)
char *GenDataModel::gl_label_get (void *data, Evas_Object *obj, const char *part)
{
cout << "gl_label_get" << endl;
GenListColumnConstructor *construction = static_cast <GenListColumnConstructor*> (
const_cast <void*> (data));
GenListDataModel *model = construction->mDataModel;
GenDataModel *model = construction->mDataModel;
Evasxx::Object *objWrap = Evasxx::Object::objectLink (obj);
const std::string label = model->getLabel (construction, *objWrap, part);
@ -43,33 +43,33 @@ char *GenListDataModel::gl_label_get (void *data, Evas_Object *obj, const char *
return (!label.empty ()) ? strdup (label.c_str ()) : NULL;
}
Evas_Object *GenListDataModel::gl_icon_get (void *data, Evas_Object *obj, const char *part)
Evas_Object *GenDataModel::gl_content_get (void *data, Evas_Object *obj, const char *part)
{
GenListColumnConstructor *construction = static_cast <GenListColumnConstructor*> (
const_cast <void*> (data));
GenListDataModel *model = construction->mDataModel;
GenDataModel *model = construction->mDataModel;
Evasxx::Object *objWrap = Evasxx::Object::objectLink (obj);
Object *objxx = model->getIcon (construction, *objWrap, part);
Object *objxx = model->getContent (construction, *objWrap, part);
return objxx ? objxx->obj () : NULL;
}
Eina_Bool GenListDataModel::gl_state_get (void *data, Evas_Object *obj, const char *part)
Eina_Bool GenDataModel::gl_state_get (void *data, Evas_Object *obj, const char *part)
{
GenListColumnConstructor *construction = static_cast <GenListColumnConstructor*> (
const_cast <void*> (data));
GenListDataModel *model = construction->mDataModel;
GenDataModel *model = construction->mDataModel;
Evasxx::Object *objWrap = Evasxx::Object::objectLink (obj);
return model->getState (construction, *objWrap, part);
}
void GenListDataModel::gl_del(void *data, Evas_Object *obj)
void GenDataModel::gl_del(void *data, Evas_Object *obj)
{
GenListColumnConstructor *construction = static_cast <GenListColumnConstructor*> (
const_cast <void*> (data));
GenListDataModel *model = construction->mDataModel;
GenDataModel *model = construction->mDataModel;
Evasxx::Object *objWrap = Evasxx::Object::objectLink (obj);
assert (model);
assert (objWrap);

View File

@ -0,0 +1,141 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* Project */
#include "../include/elementaryxx/GenItem.h"
#include "../include/elementaryxx/GenDataModel.h"
/* STD */
#include <iostream>
#include <cassert>
using namespace std;
namespace Elmxx {
GenItem::GenItem (Elm_Genlist_Item *item) :
mItem (item)
{
}
GenItem::~GenItem ()
{
cout << "GenItem::~GenItem" << endl;
elm_genlist_item_del (mItem);
}
void GenItem::clearSubItems ()
{
elm_genlist_item_subitems_clear (mItem);
}
void GenItem::setSelected (bool selected)
{
elm_gen_item_selected_set (mItem, selected);
}
bool GenItem::getSelected () const
{
return elm_gen_item_selected_get (mItem);
}
void GenItem::setExpanded (bool expanded)
{
elm_genlist_item_expanded_set (mItem, expanded);
}
bool GenItem::getExpanded () const
{
return elm_genlist_item_expanded_get (mItem);
}
void GenItem::setDisabled (bool disabled)
{
elm_genlist_item_disabled_set (mItem, disabled);
}
bool GenItem::getDisabled () const
{
return elm_genlist_item_disabled_get (mItem);
}
void GenItem::setDisplayOnly (bool displayOnly)
{
elm_genlist_item_display_only_set (mItem, displayOnly);
}
bool GenItem::getDisplayOnly () const
{
return elm_genlist_item_display_only_get (mItem);
}
void GenItem::show ()
{
elm_genlist_item_show (mItem);
}
void GenItem::bringIn ()
{
elm_genlist_item_bring_in (mItem);
}
void GenItem::showTop ()
{
elm_genlist_item_top_show (mItem);
}
void GenItem::bringInTop ()
{
elm_genlist_item_top_bring_in (mItem);
}
void GenItem::showMiddle ()
{
elm_genlist_item_middle_show (mItem);
}
void GenItem::bringInMiddle ()
{
elm_genlist_item_middle_bring_in (mItem);
}
void GenItem::update ()
{
elm_genlist_item_update (mItem);
}
const Evasxx::Object *GenItem::getEvasObject ()
{
const Evas_Object *obj = elm_genlist_item_object_get (mItem);
return Evasxx::Object::objectLink (obj);
}
GenItem *GenItem::wrap (Elm_Genlist_Item &item, GenDataModel &model)
{
GenItem *genItem = new GenItem (&item);
genItem->mDataModel = &model;
//model.signalDel.connect (sigc::mem_fun (genItem, &GenItem::destroy));
return genItem;
}
GenItem *GenItem::objectLink (const Elm_Genlist_Item *item)
{
//GenItem *item2 = static_cast <GenItem*> (const_cast <void*> (elm_genlist_item_data_get(item)));
//assert (item2);
return NULL;//item2;
}
const void *GenItem::getData ()
{
return elm_genlist_item_data_get (mItem);
}
void GenItem::setData (const void *data)
{
elm_genlist_item_data_set (mItem, data);
}
} // end namespace Elmxx

View File

@ -4,7 +4,7 @@
/* Project */
#include "../include/elementaryxx/GenList.h"
#include "../include/elementaryxx/GenListItem.h"
#include "../include/elementaryxx/GenItem.h"
#include "../include/elementaryxx/GenListColumnConstructor.h"
#include "../include/elementaryxx/GenListColumnSelector.h"
#include "localUtil.h"
@ -34,11 +34,6 @@ 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);
@ -49,34 +44,14 @@ bool GenList::getMultiSelect ()
return elm_genlist_multi_select_get (o);
}
void GenList::setHorizontalMode (Elm_List_Mode mode)
void GenList::setHorizontal (Elm_List_Mode mode)
{
elm_genlist_horizontal_mode_set (o, mode);
elm_genlist_horizontal_set (o, mode);
}
Elm_List_Mode GenList::getHorizontalMode ()
Elm_List_Mode GenList::getHorizontal ()
{
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);
return elm_genlist_horizontal_get (o);
}
void GenList::setCompressMode (bool compress)
@ -89,19 +64,6 @@ 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);
@ -122,7 +84,7 @@ int GenList::getBlockCound ()
return elm_genlist_block_count_get (o);
}
void GenList::setDataModel (GenListDataModel &model)
void GenList::setDataModel (GenDataModel &model)
{
mModel = &model;
}
@ -145,27 +107,27 @@ void GenList::glSelected (GenListColumnSelector &selection, const Evasxx::Object
/* operations to add items */
GenListItem *GenList::append (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
GenItem *GenList::append (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
{
insertInternal (construction, GenList::Append, parent, flags, selection);
}
GenListItem *GenList::prepend (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
GenItem *GenList::prepend (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
{
insertInternal (construction, GenList::Prepend, parent, flags, selection);
}
GenListItem *GenList::insertBefore (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
GenItem *GenList::insertBefore (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
{
insertInternal (construction, GenList::InsertBefore, parent, flags, selection);
}
GenListItem *GenList::insertAfter (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
GenItem *GenList::insertAfter (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
{
insertInternal (construction, GenList::InsertAfter, parent, flags, selection);
}
GenListItem *GenList::insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenListItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
GenItem *GenList::insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
{
assert (mModel);
@ -233,14 +195,14 @@ GenListItem *GenList::insertInternal (GenListColumnConstructor *construction, Ge
break;
}
GenListItem *item = GenListItem::wrap (*gli, *mModel);
GenItem *item = GenItem::wrap (*gli, *mModel);
construction->mGenListItem = item;
construction->mGenItem = item;
//EAPI const void *
//elm_genlist_item_data_get(const Elm_Genlist_Item *it)
// -> returns: GenListColumnConstructor *construction
// 1. add GenListItem* to construction
// 1. add GenItem* to construction
if (internalConstruction)
{
@ -254,12 +216,12 @@ GenListItem *GenList::insertInternal (GenListColumnConstructor *construction, Ge
return item;
}
void GenList::del (GenListItem &item)
void GenList::del (GenItem &item)
{
elm_genlist_item_del (item.mItem);
}
GenListItem *GenList::getItemSelected () const
GenItem *GenList::getItemSelected () const
{
Elm_Genlist_Item *item = elm_genlist_selected_item_get (o);
@ -268,10 +230,10 @@ GenListItem *GenList::getItemSelected () const
const GenListColumnConstructor *construction = static_cast <const GenListColumnConstructor*> (elm_genlist_item_data_get (item));
return construction->mGenListItem;
return construction->mGenItem;
}
GenListItem *GenList::getItemAtXY (const Eflxx::Point &pos, int &posret) const
GenItem *GenList::getItemAtXY (const Eflxx::Point &pos, int &posret) const
{
Elm_Genlist_Item *item = elm_genlist_at_xy_item_get (o, pos.x (), pos.y (), &posret);
@ -280,10 +242,10 @@ GenListItem *GenList::getItemAtXY (const Eflxx::Point &pos, int &posret) const
const GenListColumnConstructor *construction = static_cast <const GenListColumnConstructor*> (elm_genlist_item_data_get (item));
return construction->mGenListItem;
return construction->mGenItem;
}
GenListItem *GenList::getItemFirst () const
GenItem *GenList::getItemFirst () const
{
Elm_Genlist_Item *item = elm_genlist_first_item_get (o);
@ -292,10 +254,10 @@ GenListItem *GenList::getItemFirst () const
const GenListColumnConstructor *construction = static_cast <const GenListColumnConstructor*> (elm_genlist_item_data_get (item));
return construction->mGenListItem;
return construction->mGenItem;
}
GenListItem *GenList::getItemLast () const
GenItem *GenList::getItemLast () const
{
Elm_Genlist_Item *item = elm_genlist_last_item_get (o);
@ -304,7 +266,7 @@ GenListItem *GenList::getItemLast () const
const GenListColumnConstructor *construction = static_cast <const GenListColumnConstructor*> (elm_genlist_item_data_get (item));
return construction->mGenListItem;
return construction->mGenItem;
}
} // end namespace Elmxx

View File

@ -6,7 +6,7 @@ using namespace std;
namespace Elmxx {
GenListColumnConstructor::GenListColumnConstructor () :
mGenListItem (NULL)
mGenItem (NULL)
{
}

View File

@ -1,141 +0,0 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* Project */
#include "../include/elementaryxx/GenListItem.h"
#include "../include/elementaryxx/GenListDataModel.h"
/* STD */
#include <iostream>
#include <cassert>
using namespace std;
namespace Elmxx {
GenListItem::GenListItem (Elm_Genlist_Item *item) :
mItem (item)
{
}
GenListItem::~GenListItem ()
{
cout << "GenListItem::~GenListItem" << endl;
elm_genlist_item_del (mItem);
}
void GenListItem::clearSubItems ()
{
elm_genlist_item_subitems_clear (mItem);
}
void GenListItem::setSelected (bool selected)
{
elm_genlist_item_selected_set (mItem, selected);
}
bool GenListItem::getSelected () const
{
return elm_genlist_item_selected_get (mItem);
}
void GenListItem::setExpanded (bool expanded)
{
elm_genlist_item_expanded_set (mItem, expanded);
}
bool GenListItem::getExpanded () const
{
return elm_genlist_item_expanded_get (mItem);
}
void GenListItem::setDisabled (bool disabled)
{
elm_genlist_item_disabled_set (mItem, disabled);
}
bool GenListItem::getDisabled () const
{
return elm_genlist_item_disabled_get (mItem);
}
void GenListItem::setDisplayOnly (bool displayOnly)
{
elm_genlist_item_display_only_set (mItem, displayOnly);
}
bool GenListItem::getDisplayOnly () const
{
return elm_genlist_item_display_only_get (mItem);
}
void GenListItem::show ()
{
elm_genlist_item_show (mItem);
}
void GenListItem::bringIn ()
{
elm_genlist_item_bring_in (mItem);
}
void GenListItem::showTop ()
{
elm_genlist_item_top_show (mItem);
}
void GenListItem::bringInTop ()
{
elm_genlist_item_top_bring_in (mItem);
}
void GenListItem::showMiddle ()
{
elm_genlist_item_middle_show (mItem);
}
void GenListItem::bringInMiddle ()
{
elm_genlist_item_middle_bring_in (mItem);
}
void GenListItem::update ()
{
elm_genlist_item_update (mItem);
}
const Evasxx::Object *GenListItem::getEvasObject ()
{
const Evas_Object *obj = elm_genlist_item_object_get (mItem);
return Evasxx::Object::objectLink (obj);
}
GenListItem *GenListItem::wrap (Elm_Genlist_Item &item, GenListDataModel &model)
{
GenListItem *genItem = new GenListItem (&item);
genItem->mDataModel = &model;
//model.signalDel.connect (sigc::mem_fun (genItem, &GenListItem::destroy));
return genItem;
}
GenListItem *GenListItem::objectLink (const Elm_Genlist_Item *item)
{
//GenListItem *item2 = static_cast <GenListItem*> (const_cast <void*> (elm_genlist_item_data_get(item)));
//assert (item2);
return NULL;//item2;
}
const void *GenListItem::getData ()
{
return elm_genlist_item_data_get (mItem);
}
void GenListItem::setData (const void *data)
{
elm_genlist_item_data_set (mItem, data);
}
} // end namespace Elmxx

View File

@ -47,10 +47,11 @@ libelementaryxx_la_SOURCES = \
Panel.cpp \
Separator.cpp \
GenList.cpp \
GenListItem.cpp \
GenListDataModel.cpp \
GenDataModel.cpp \
GenListColumnConstructor.cpp \
GenListColumnSelector.cpp \
localUtil.cpp \
localUtil.h
localUtil.h \
Gen.cpp \
GenItem.cpp