Ejemplo n.º 1
0
/**
 * Module specific face initialisation.
 *
 * It is called when a new face is created.
 * Currently E_Gadget creates one when you call e_gadget_new(),
 * but doesn't let you create more faces.  I'm hoping to get
 * changed.
 *
 * @param   data the pointer you passed to e_gadget_new().
 * @param   face a pointer to your E_Gadget_Face.
 * @ingroup Emu_Module_Gadget_Group
 */
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
   E_Gadcon_Client *gcc = NULL;
   Emu_Face *emu_face;
   
   emu_face = E_NEW(Emu_Face, 1);

   if (emu_face)
     {
        Evas_Object *o;
        char buf[4096];

        o = edje_object_add(gc->evas);
        if ((!e_theme_edje_object_set(o, "base/theme/modules/emu", "modules/emu/main")) /*&& (_emu_module_edje)*/)
           edje_object_file_set(o, _emu_module_edje, "modules/emu/main");
        edje_object_signal_emit(o, "passive", "");

        gcc = e_gadcon_client_new(gc, name, id, style, o);
        gcc->data = emu_face;
        emu_face->gcc = gcc;
        emu_face->o_button = o;
        emu_face->menus = NULL;

        emu_face->name = eina_stringshare_add("Emu tester");
        snprintf(buf, sizeof(buf), "%s/bin/emu_client", e_module_dir_get(emu_module));
        emu_face->command = eina_stringshare_add(buf);
        if (emu_face->command)
          {
             emu_face->del = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _emu_cb_exe_del, emu_face);
             emu_face->add = ecore_event_handler_add(ECORE_EXE_EVENT_ADD, _emu_cb_exe_add, emu_face);
             emu_face->read = ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _emu_cb_exe_data, emu_face);
             emu_face->exe =
                ecore_exe_pipe_run(emu_face->command, ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE | ECORE_EXE_PIPE_READ_LINE_BUFFERED
                                   /*| ECORE_EXE_RESPAWN */ , emu_face);
             if (!emu_face->exe)
                e_module_dialog_show(NULL, D_("Enlightenment Emu Module - error"), D_("There is no emu."));
          }

        e_gadcon_client_util_menu_attach(gcc);
        evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _emu_face_cb_mouse_down, emu_face);
     }
   
   return gcc;
}
Ejemplo n.º 2
0
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
   Instance *inst;

   inst = E_NEW(Instance, 1);
   inst->o_toggle = edje_object_add(gc->evas);
   e_theme_edje_object_set(inst->o_toggle,
                           "base/theme/modules/conf",
                           "e/modules/conf/main");

   inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_toggle);
   inst->gcc->data = inst;

   edje_object_signal_callback_add(inst->o_toggle, "e,action,conf", "",
                                   _cb_action_conf, inst);

   instances = eina_list_append(instances, inst);
   e_gadcon_client_util_menu_attach(inst->gcc);

   return inst->gcc;
}
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
   Evas_Object *o;
   E_Gadcon_Client *gcc;
   Instance *inst;

   inst = E_NEW(Instance, 1);
   o = _theme_obj_new(gc->evas, e_module_dir_get(mod),
		      "e/modules/illume/gadget/bluetooth");
   evas_object_show(o);
   gcc = e_gadcon_client_new(gc, name, id, style, o);
   gcc->data = inst;
   inst->gcc = gcc;
   inst->obj = o;
   e_gadcon_client_util_menu_attach(gcc);

   inst->on = -1;
   inst->poller = ecore_poller_add(ECORE_POLLER_CORE, 16, _cb_poll, inst);

   return gcc;
}