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