parent
2e65e2d4d5
commit
48b1712f2b
|
@ -32,10 +32,12 @@ class Trackable : public sigc::trackable
|
|||
const char* _classname;
|
||||
};
|
||||
|
||||
class Point;
|
||||
class Size
|
||||
{
|
||||
public:
|
||||
Size( Evas_Coord dx = 0, Evas_Coord dy = 0 ) : _dx(dx), _dy(dy) {};
|
||||
//Size (Point p) : _dx (p.x ()), _dy (p.y ()) {};
|
||||
~Size() {};
|
||||
void set( Evas_Coord dx, Evas_Coord dy ) { _dx = dx; _dy = dy; };
|
||||
void width( Evas_Coord width ) { _dx = width; }
|
||||
|
@ -51,6 +53,7 @@ class Point
|
|||
{
|
||||
public:
|
||||
Point( Evas_Coord x = 0, Evas_Coord y = 0 ) : _x(x), _y(y) {};
|
||||
Point (Size s) : _x (s.width ()), _y (s.height ()) {};
|
||||
~Point() {};
|
||||
void set( Evas_Coord x, Evas_Coord y ) { _x = x; _y = y; };
|
||||
void x( Evas_Coord x ) { _x = x; };
|
||||
|
|
|
@ -21,23 +21,23 @@ private:
|
|||
int mItemNum;
|
||||
};
|
||||
|
||||
class GenListDataModel1 : public GenListDataModel
|
||||
class GenDataModel1 : public GenDataModel
|
||||
{
|
||||
public:
|
||||
GenListDataModel1 (const std::string &style) :
|
||||
GenListDataModel (style) {}
|
||||
GenDataModel1 (const std::string &style) :
|
||||
GenDataModel (style) {}
|
||||
|
||||
~GenListDataModel1 () {}
|
||||
~GenDataModel1 () {}
|
||||
|
||||
std::string getLabel (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) const
|
||||
{
|
||||
GenListColumnConstructor1 *construct1 = static_cast <GenListColumnConstructor1*> (construction);
|
||||
cout << "GenListDataModel::getLabel" << endl;
|
||||
cout << "GenDataModel::getLabel" << endl;
|
||||
|
||||
return "Item " + toString <int> (construct1->getItemNum ());
|
||||
}
|
||||
|
||||
Elmxx::Object *getIcon (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
Elmxx::Object *getContent (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
{
|
||||
Icon *ic = Icon::factory (obj);
|
||||
ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png"));
|
||||
|
@ -65,8 +65,8 @@ private:
|
|||
int mItemNum;
|
||||
};
|
||||
|
||||
static GenListDataModel1 model ("default");
|
||||
static GenListDataModel1 model2 ("default");
|
||||
static GenDataModel1 model ("default");
|
||||
static GenDataModel1 model2 ("default");
|
||||
|
||||
/*
|
||||
* Hint: 'constructList1' isn't cleaned up at exit. Normal applications should do this.
|
||||
|
@ -577,23 +577,23 @@ private:
|
|||
TestItem *mTestItem;
|
||||
};
|
||||
|
||||
class GenListDataModel3 : public GenListDataModel
|
||||
class GenDataModel3 : public GenDataModel
|
||||
{
|
||||
public:
|
||||
GenListDataModel3 (const std::string &style) :
|
||||
GenListDataModel (style) {}
|
||||
GenDataModel3 (const std::string &style) :
|
||||
GenDataModel (style) {}
|
||||
|
||||
~GenListDataModel3 () {}
|
||||
~GenDataModel3 () {}
|
||||
|
||||
std::string getLabel (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) const
|
||||
{
|
||||
GenListColumnConstructor3 *construct1 = static_cast <GenListColumnConstructor3*> (construction);
|
||||
cout << "GenListDataModel::getLabel" << endl;
|
||||
cout << "GenDataModel::getLabel" << endl;
|
||||
|
||||
return "Item mode " + toString <int> (construct1->getTestItem ()->mode);
|
||||
}
|
||||
|
||||
Elmxx::Object *getIcon (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
Elmxx::Object *getContent (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
{
|
||||
GenListColumnConstructor3 *construct1 = static_cast <GenListColumnConstructor3*> (construction);
|
||||
int mode = construct1->getTestItem ()->mode;
|
||||
|
@ -647,7 +647,7 @@ void glSelected3 (GenListColumnSelector &selection, const Evasxx::Object &obj, v
|
|||
cout << "glSelected3 mode " << selection1->getTestItem ()->mode << endl;
|
||||
}
|
||||
|
||||
static GenListDataModel3 model3 ("default");
|
||||
static GenDataModel3 model3 ("default");
|
||||
|
||||
void test_genlist3(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -747,23 +747,23 @@ static void my_gl_item_check_changed (Evasxx::Object &obj, void *event_info, Tes
|
|||
printf("item %p onoff = %i\n", tit, tit->onoff);
|
||||
}
|
||||
|
||||
class GenListDataModel4 : public GenListDataModel
|
||||
class GenDataModel4 : public GenDataModel
|
||||
{
|
||||
public:
|
||||
GenListDataModel4 (const std::string &style) :
|
||||
GenListDataModel (style) {}
|
||||
GenDataModel4 (const std::string &style) :
|
||||
GenDataModel (style) {}
|
||||
|
||||
~GenListDataModel4 () {}
|
||||
~GenDataModel4 () {}
|
||||
|
||||
std::string getLabel (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) const
|
||||
{
|
||||
GenListColumnConstructor3 *construct1 = static_cast <GenListColumnConstructor3*> (construction);
|
||||
cout << "GenListDataModel::getLabel" << endl;
|
||||
cout << "GenDataModel::getLabel" << endl;
|
||||
|
||||
return "Item mode " + toString <int> (construct1->getTestItem ()->mode);
|
||||
}
|
||||
|
||||
Elmxx::Object *getIcon (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
Elmxx::Object *getContent (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
{
|
||||
GenListColumnConstructor3 *construct1 = static_cast <GenListColumnConstructor3*> (construction);
|
||||
TestItem *tit = construct1->getTestItem ();
|
||||
|
@ -799,7 +799,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
static GenListDataModel4 model4 ("default");
|
||||
static GenDataModel4 model4 ("default");
|
||||
|
||||
void test_genlist4 (void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -930,13 +930,13 @@ static void item_longpress (Evasxx::Object &obj, void *event_info)
|
|||
cout << "longpress" << endl;
|
||||
}
|
||||
|
||||
class GenListDataModel5 : public GenListDataModel
|
||||
class GenDataModel5 : public GenDataModel
|
||||
{
|
||||
public:
|
||||
GenListDataModel5 (const std::string &style) :
|
||||
GenListDataModel (style) {}
|
||||
GenDataModel5 (const std::string &style) :
|
||||
GenDataModel (style) {}
|
||||
|
||||
~GenListDataModel5 () {}
|
||||
~GenDataModel5 () {}
|
||||
|
||||
std::string getLabel (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) const
|
||||
{
|
||||
|
@ -956,7 +956,7 @@ public:
|
|||
return buf;
|
||||
}
|
||||
|
||||
Elmxx::Object *getIcon (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
Elmxx::Object *getContent (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
{
|
||||
GenListColumnConstructor3 *construct1 = static_cast <GenListColumnConstructor3*> (construction);
|
||||
TestItem *tit = construct1->getTestItem ();
|
||||
|
@ -995,7 +995,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
static GenListDataModel5 model5 ("double_label");
|
||||
static GenDataModel5 model5 ("double_label");
|
||||
|
||||
void test_genlist5 (void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -1134,13 +1134,13 @@ static void gl4_con_req (Evasxx::Object &obj, void *event_info, GenList *gl)
|
|||
//elm_genlist_item_expanded_set(it, 0);
|
||||
}
|
||||
|
||||
class GenListDataModel6 : public GenListDataModel
|
||||
class GenDataModel6 : public GenDataModel
|
||||
{
|
||||
public:
|
||||
GenListDataModel6 (const std::string &style) :
|
||||
GenListDataModel (style) {}
|
||||
GenDataModel6 (const std::string &style) :
|
||||
GenDataModel (style) {}
|
||||
|
||||
~GenListDataModel6 () {}
|
||||
~GenDataModel6 () {}
|
||||
|
||||
std::string getLabel (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) const
|
||||
{
|
||||
|
@ -1149,7 +1149,7 @@ public:
|
|||
return "Item mode " + toString <int> (construct1->getItemNum ());
|
||||
}
|
||||
|
||||
Elmxx::Object *getIcon (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
Elmxx::Object *getContent (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
{
|
||||
GenListColumnConstructor1 *construct1 = static_cast <GenListColumnConstructor1*> (construction);
|
||||
|
||||
|
@ -1181,7 +1181,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
static GenListDataModel6 model6 ("default");
|
||||
static GenDataModel6 model6 ("default");
|
||||
|
||||
void test_genlist6(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
|
|
@ -20,24 +20,24 @@ private:
|
|||
int mItemNum;
|
||||
};
|
||||
|
||||
class GenListDataModel1 : public GenListDataModel
|
||||
class GenDataModel1 : public GenDataModel
|
||||
{
|
||||
public:
|
||||
GenListDataModel1 (const std::string &style) :
|
||||
GenListDataModel (style) {}
|
||||
GenDataModel1 (const std::string &style) :
|
||||
GenDataModel (style) {}
|
||||
|
||||
~GenListDataModel1 () {}
|
||||
~GenDataModel1 () {}
|
||||
|
||||
std::string getLabel (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part) const
|
||||
{
|
||||
GenListColumnConstructor1 *construct1 = static_cast <GenListColumnConstructor1*> (construction);
|
||||
cout << "GenListDataModel::getLabel" << endl;
|
||||
cout << "GenDataModel::getLabel" << endl;
|
||||
|
||||
//return strdup(ecore_file_file_get(data));
|
||||
return "Item " + toString <int> (construct1->getItemNum ());
|
||||
}
|
||||
|
||||
Elmxx::Object *getIcon (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
Elmxx::Object *getContent (GenListColumnConstructor *construction, Evasxx::Object &obj, const std::string &part)
|
||||
{
|
||||
Window *win = static_cast <Window*> (&obj);
|
||||
Icon *ic = Icon::factory (*win);
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
static GenListDataModel1 model ("default");
|
||||
static GenDataModel1 model ("default");
|
||||
|
||||
void test_panel (void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "GenListColumnSelector.h"
|
||||
#include "GenListColumnConstructor.h"
|
||||
#include "GenItem.h"
|
||||
#include "GenListItem.h"
|
||||
|
||||
#endif // ELEMENTARYXX_H
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace Elmxx {
|
|||
|
||||
/* forward declarations */
|
||||
class GenItem;
|
||||
class GenListItem;
|
||||
class GenListColumnConstructor;
|
||||
class GenListColumnSelector;
|
||||
|
||||
|
@ -301,17 +302,17 @@ public:
|
|||
* @return A handle to the item added or NULL if not possible
|
||||
*
|
||||
*/
|
||||
GenItem *append (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
|
||||
GenListItem *append (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 *prepend (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 *insertBefore (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);
|
||||
GenListItem *insertAfter (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
|
||||
|
||||
void del (GenItem &item);
|
||||
void del (GenListItem &item);
|
||||
|
||||
GenItem *getItemSelected () const;
|
||||
GenListItem *getItemSelected () const;
|
||||
|
||||
/*!
|
||||
* Get the item that is at the x, y canvas coords
|
||||
|
@ -333,11 +334,11 @@ public:
|
|||
* @return The item at the coordinates or NULL if none
|
||||
*
|
||||
*/
|
||||
GenItem *getItemAtXY (const Eflxx::Point &pos, int &posret) const;
|
||||
GenListItem *getItemAtXY (const Eflxx::Point &pos, int &posret) const;
|
||||
|
||||
GenItem *getItemFirst () const;
|
||||
GenListItem *getItemFirst () const;
|
||||
|
||||
GenItem *getItemLast () const;
|
||||
GenListItem *getItemLast () const;
|
||||
|
||||
// TODO: which type is event_info here instead of void*?
|
||||
sigc::signal <void, GenListColumnSelector&, const Evasxx::Object&, void*> signalSelect;
|
||||
|
@ -356,7 +357,7 @@ private:
|
|||
InsertBefore
|
||||
};
|
||||
|
||||
GenItem *insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
|
||||
GenListItem *insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenListItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection);
|
||||
|
||||
static void gl_sel (void *data, Evas_Object *obj, void *event_info);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Elmxx {
|
|||
/* forward declarations */
|
||||
class GenList;
|
||||
class GenDataModel;
|
||||
class GenItem;
|
||||
class GenListItem;
|
||||
|
||||
class GenListColumnConstructor
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ public:
|
|||
|
||||
private:
|
||||
GenDataModel *mDataModel;
|
||||
GenItem *mGenItem;
|
||||
GenListItem *mGenItem;
|
||||
};
|
||||
|
||||
} // end namespace Elmxx
|
||||
|
|
|
@ -108,27 +108,27 @@ void GenList::glSelected (GenListColumnSelector &selection, const Evasxx::Object
|
|||
|
||||
/* operations to add items */
|
||||
|
||||
GenItem *GenList::append (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
GenListItem *GenList::append (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
{
|
||||
insertInternal (construction, GenList::Append, parent, flags, selection);
|
||||
}
|
||||
|
||||
GenItem *GenList::prepend (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
GenListItem *GenList::prepend (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
{
|
||||
insertInternal (construction, GenList::Prepend, parent, flags, selection);
|
||||
}
|
||||
|
||||
GenItem *GenList::insertBefore (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
GenListItem *GenList::insertBefore (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
{
|
||||
insertInternal (construction, GenList::InsertBefore, parent, flags, selection);
|
||||
}
|
||||
|
||||
GenItem *GenList::insertAfter (GenListColumnConstructor *construction, const GenItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
GenListItem *GenList::insertAfter (GenListColumnConstructor *construction, const GenListItem *parent, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
{
|
||||
insertInternal (construction, GenList::InsertAfter, parent, flags, selection);
|
||||
}
|
||||
|
||||
GenItem *GenList::insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
GenListItem *GenList::insertInternal (GenListColumnConstructor *construction, GenList::InsertOperation op, const GenListItem *opItem, Elm_Genlist_Item_Flags flags, GenListColumnSelector *selection)
|
||||
{
|
||||
assert (mModel);
|
||||
|
||||
|
@ -217,12 +217,12 @@ GenItem *GenList::insertInternal (GenListColumnConstructor *construction, GenLis
|
|||
return item;
|
||||
}
|
||||
|
||||
void GenList::del (GenItem &item)
|
||||
void GenList::del (GenListItem &item)
|
||||
{
|
||||
elm_genlist_item_del (item.mItem);
|
||||
}
|
||||
|
||||
GenItem *GenList::getItemSelected () const
|
||||
GenListItem *GenList::getItemSelected () const
|
||||
{
|
||||
Elm_Genlist_Item *item = elm_genlist_selected_item_get (o);
|
||||
|
||||
|
@ -234,7 +234,7 @@ GenItem *GenList::getItemSelected () const
|
|||
return construction->mGenItem;
|
||||
}
|
||||
|
||||
GenItem *GenList::getItemAtXY (const Eflxx::Point &pos, int &posret) const
|
||||
GenListItem *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);
|
||||
|
||||
|
@ -246,7 +246,7 @@ GenItem *GenList::getItemAtXY (const Eflxx::Point &pos, int &posret) const
|
|||
return construction->mGenItem;
|
||||
}
|
||||
|
||||
GenItem *GenList::getItemFirst () const
|
||||
GenListItem *GenList::getItemFirst () const
|
||||
{
|
||||
Elm_Genlist_Item *item = elm_genlist_first_item_get (o);
|
||||
|
||||
|
@ -258,7 +258,7 @@ GenItem *GenList::getItemFirst () const
|
|||
return construction->mGenItem;
|
||||
}
|
||||
|
||||
GenItem *GenList::getItemLast () const
|
||||
GenListItem *GenList::getItemLast () const
|
||||
{
|
||||
Elm_Genlist_Item *item = elm_genlist_last_item_get (o);
|
||||
|
||||
|
|
Loading…
Reference in New Issue