some more C++ wrappers for external access
SVN revision: 55099
This commit is contained in:
parent
a9fe01720e
commit
2e91be1d77
|
@ -10,6 +10,9 @@
|
|||
|
||||
#include <evasxx/Object.h>
|
||||
|
||||
/* EFL */
|
||||
#include <Edje.h>
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace Edjexx {
|
||||
|
@ -36,6 +39,11 @@ public:
|
|||
|
||||
Eflxx::CountedPtr <Evasxx::Object> getSwallow ();
|
||||
|
||||
Eflxx::CountedPtr <Evasxx::Object> getExternalObject ();
|
||||
|
||||
// TODO: wrap Param?
|
||||
bool setParam (const Edje_External_Param *param);
|
||||
|
||||
//const Evasxx::Object* getObject ( const char* name );
|
||||
|
||||
private:
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
#include "../include/edjexx/Part.h"
|
||||
#include "../include/edjexx/Object.h"
|
||||
|
||||
/* EFL */
|
||||
#include <Edje.h>
|
||||
|
||||
/* STD */
|
||||
#include <map>
|
||||
|
||||
|
@ -48,7 +45,7 @@ const std::string Part::getText() const
|
|||
|
||||
void Part::swallow( Evasxx::Object* object )
|
||||
{
|
||||
edje_object_part_swallow( _parent->obj(), _partname.c_str (), object->obj() );
|
||||
edje_object_part_swallow (_parent->obj(), _partname.c_str (), object->obj());
|
||||
}
|
||||
|
||||
void Part::unswallow( Evasxx::Object* object )
|
||||
|
@ -58,13 +55,27 @@ void Part::unswallow( Evasxx::Object* object )
|
|||
|
||||
Eflxx::CountedPtr <Evasxx::Object> Part::getSwallow()
|
||||
{
|
||||
Evas_Object *eo = edje_object_part_swallow_get( _parent->obj(), _partname.c_str () );
|
||||
Evas_Object *eo = edje_object_part_swallow_get (_parent->obj(), _partname.c_str ());
|
||||
|
||||
Evasxx::Object *ret_o = Evasxx::Object::wrap (eo);
|
||||
|
||||
return Eflxx::CountedPtr <Evasxx::Object> (ret_o);
|
||||
}
|
||||
|
||||
Eflxx::CountedPtr <Evasxx::Object> Part::getExternalObject ()
|
||||
{
|
||||
Evas_Object *eo = edje_object_part_external_object_get (_parent->obj(), _partname.c_str ());
|
||||
|
||||
Evasxx::Object *ret_o = Evasxx::Object::wrap (eo);
|
||||
|
||||
return Eflxx::CountedPtr <Evasxx::Object> (ret_o);
|
||||
}
|
||||
|
||||
bool Part::setParam (const Edje_External_Param *param)
|
||||
{
|
||||
return edje_object_part_external_param_set (_parent->obj (), _partname.c_str (), param);
|
||||
}
|
||||
|
||||
/*const Evasxx::Object* Part::getObject ( const char* name )
|
||||
{
|
||||
return Evasxx::Object::objectLink( edje_object_part_object_get( static_cast <const Evas_Object*> (_parent->obj()), name ) );
|
||||
|
|
|
@ -47,34 +47,38 @@ int main (int argc, char **argv)
|
|||
edje->setLayer (0);
|
||||
edje->show ();
|
||||
|
||||
Evas_Object *eo = edje->obj ();
|
||||
Eflxx::CountedPtr <Evasxx::Object> ext_eo (edje->getPart ("Button01")->getExternalObject ());
|
||||
Elmxx::Button *button = static_cast <Elmxx::Button*> (&(*ext_eo));
|
||||
button->setLabel ("This is a changed button");
|
||||
|
||||
// TODO: C++ wrapper
|
||||
Evas_Object *ext_eo = edje_object_part_external_object_get (eo, "Button01");
|
||||
elm_button_label_set (ext_eo, "This is a changed button");
|
||||
Eflxx::CountedPtr <Evasxx::Object> ext_eo2 (edje->getPart ("List01")->getExternalObject ());
|
||||
Elmxx::List *list = static_cast <Elmxx::List*> (&(*ext_eo2));
|
||||
assert (list->append ("1. Line", NULL, NULL));
|
||||
assert (list->append ("2. Line", NULL, NULL));
|
||||
assert (list->append ("3. Line", NULL, NULL));
|
||||
assert (list->append ("4. Line", NULL, NULL));
|
||||
list->go ();
|
||||
|
||||
ext_eo = edje_object_part_external_object_get (eo, "List01");
|
||||
assert (elm_list_item_append (ext_eo, "1. Line", NULL, NULL, NULL, NULL));
|
||||
assert (elm_list_item_append (ext_eo, "2. Line", NULL, NULL, NULL, NULL));
|
||||
assert (elm_list_item_append (ext_eo, "3. Line", NULL, NULL, NULL, NULL));
|
||||
assert (elm_list_item_append (ext_eo, "4. Line", NULL, NULL, NULL, NULL));
|
||||
elm_list_go (ext_eo);
|
||||
|
||||
ext_eo = edje_object_part_external_object_get (eo, "Progressbar01");
|
||||
elm_progressbar_label_set (ext_eo, "This is the status");
|
||||
elm_progressbar_value_set (ext_eo, 0.5);
|
||||
Eflxx::CountedPtr <Evasxx::Object> ext_eo3 (edje->getPart ("Progressbar01")->getExternalObject ());
|
||||
Elmxx::Progressbar *progressbar = static_cast <Elmxx::Progressbar*> (&(*ext_eo3));
|
||||
progressbar->setLabel ("This is the status");
|
||||
progressbar->setValue (0.5);
|
||||
|
||||
Eflxx::CountedPtr <Edjexx::Part> part (edje->getPart ("Slider01"));
|
||||
|
||||
Edje_External_Param param;
|
||||
param.type = EDJE_EXTERNAL_PARAM_TYPE_DOUBLE;
|
||||
param.name = "value";
|
||||
param.d = 5;
|
||||
edje_object_part_external_param_set (eo, "Slider01", ¶m);
|
||||
|
||||
Edje_External_Param param2;
|
||||
param2.type = EDJE_EXTERNAL_PARAM_TYPE_STRING;
|
||||
param2.name = "label";
|
||||
param2.s = "Changed Slider Value";
|
||||
edje_object_part_external_param_set (eo, "Slider01", ¶m2);
|
||||
|
||||
part->setParam (¶m);
|
||||
part->setParam (¶m2);
|
||||
|
||||
|
||||
bg->setWeightHintSize (1.0, 1.0);
|
||||
elmWin->addObjectResize (*bg);
|
||||
|
|
Loading…
Reference in New Issue