parent
929feecf0f
commit
4be77c8f63
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
virtual bool getState (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) = 0;
|
||||
|
||||
virtual void del (GenListColumnConstructor *construction, Evasxx::Object &obj) = 0;
|
||||
sigc::signal <void, GenListColumnConstructor&, const Evasxx::Object&> signalDel;
|
||||
|
||||
private:
|
||||
static char *gl_label_get (const void *data, Evas_Object *obj, const char *part);
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
|
||||
/* EFLxx */
|
||||
#include <evasxx/Evasxx.h>
|
||||
#include "GenListColumnConstructor.h"
|
||||
|
||||
namespace Elmxx {
|
||||
|
||||
/* forward declarations */
|
||||
class GenList;
|
||||
class GenListDataModel;
|
||||
|
||||
class GenListItem
|
||||
{
|
||||
|
@ -46,14 +48,17 @@ public:
|
|||
|
||||
const Evasxx::Object *getEvasObject ();
|
||||
|
||||
static GenListItem *wrap (const Elm_Genlist_Item *item);
|
||||
static GenListItem *wrap (Elm_Genlist_Item &item, GenListDataModel &model);
|
||||
|
||||
static GenListItem *objectLink (const Elm_Genlist_Item *item);
|
||||
|
||||
private:
|
||||
GenListItem (const Elm_Genlist_Item *item);
|
||||
GenListItem (Elm_Genlist_Item *item);
|
||||
|
||||
void destroy (GenListColumnConstructor &construction, const Evasxx::Object &obj);
|
||||
|
||||
Elm_Genlist_Item *mItem;
|
||||
GenListDataModel *mDataModel;
|
||||
};
|
||||
|
||||
} // end namespace Elmxx
|
||||
|
|
|
@ -187,8 +187,10 @@ GenListItem *GenList::append (GenListColumnConstructor *construction, const GenL
|
|||
{
|
||||
mInternalSelList.push_back (selection);
|
||||
}
|
||||
|
||||
return GenListItem::wrap (gli);
|
||||
|
||||
GenListItem *item = GenListItem::wrap (*gli, *mModel);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
} // end namespace Elmxx
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
/* STD */
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -70,8 +71,13 @@ void GenListDataModel::gl_del(const void *data, Evas_Object *obj)
|
|||
const_cast <void*> (data));
|
||||
GenListDataModel *model = construction->mDataModel;
|
||||
Evasxx::Object *objWrap = Evasxx::Object::objectLink (obj);
|
||||
|
||||
return model->del (construction, *objWrap);
|
||||
assert (model);
|
||||
assert (objWrap);
|
||||
|
||||
cout << "+del" << endl;
|
||||
// FIXME: for some reason emit isn't working. and never returns and emit() is called infinite??
|
||||
//model->signalDel.emit (*construction, *objWrap);
|
||||
cout << "-del" << endl;
|
||||
}
|
||||
|
||||
} // end namespace Elmxx
|
||||
|
|
|
@ -4,16 +4,19 @@
|
|||
|
||||
/* Project */
|
||||
#include "../include/elementaryxx/GenListItem.h"
|
||||
#include "../include/elementaryxx/GenListDataModel.h"
|
||||
|
||||
/* STD */
|
||||
#include <cassert>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Elmxx {
|
||||
|
||||
GenListItem::GenListItem (const Elm_Genlist_Item *item) :
|
||||
mItem (const_cast <Elm_Genlist_Item*> (item))
|
||||
GenListItem::GenListItem (Elm_Genlist_Item *item) :
|
||||
mItem (item)
|
||||
{
|
||||
elm_genlist_item_data_set (mItem, this);
|
||||
//elm_genlist_item_data_set (mItem, this);
|
||||
}
|
||||
|
||||
GenListItem::~GenListItem ()
|
||||
|
@ -24,7 +27,6 @@ GenListItem::~GenListItem ()
|
|||
void GenListItem::clearSubItems ()
|
||||
{
|
||||
elm_genlist_item_subitems_clear (mItem);
|
||||
|
||||
}
|
||||
|
||||
void GenListItem::setSelected (bool selected)
|
||||
|
@ -108,16 +110,25 @@ const Evasxx::Object *GenListItem::getEvasObject ()
|
|||
return Evasxx::Object::objectLink (obj);
|
||||
}
|
||||
|
||||
GenListItem *GenListItem::wrap (const Elm_Genlist_Item *item)
|
||||
GenListItem *GenListItem::wrap (Elm_Genlist_Item &item, GenListDataModel &model)
|
||||
{
|
||||
return new GenListItem (item);
|
||||
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 item2;
|
||||
//GenListItem *item2 = static_cast <GenListItem*> (const_cast <void*> (elm_genlist_item_data_get(item)));
|
||||
//assert (item2);
|
||||
return NULL;//item2;
|
||||
}
|
||||
|
||||
void GenListItem::destroy (GenListColumnConstructor &construction, const Evasxx::Object &obj)
|
||||
{
|
||||
cout << "destroy" << endl;
|
||||
}
|
||||
|
||||
} // end namespace Elmxx
|
||||
|
|
Loading…
Reference in New Issue