Exemplo n.º 1
0
EAPI void
e_widget_button_icon_set(Evas_Object *obj, Evas_Object *icon)
{
   E_Widget_Data *wd;
   int mw, mh;

   wd = e_widget_data_get(obj);
   if (wd->o_icon)
     {
	e_widget_sub_object_del(obj, wd->o_icon);
	evas_object_hide(wd->o_icon);
	edje_object_part_unswallow(wd->o_button, wd->o_icon);
	evas_object_del(wd->o_icon);
	wd->o_icon = NULL;
     }
   if (icon)
     {
	wd->o_icon = icon;
	edje_object_part_swallow(wd->o_button, "e.swallow.icon", icon);
	evas_object_pass_events_set(icon, 1);
	evas_object_show(icon);
	e_widget_sub_object_add(obj, icon);
	wd->type |= E_WIDGET_BUTTON_ICON;
     }
   else
     wd->type = ~(wd->type & E_WIDGET_BUTTON_ICON);
   _e_wid_button_state_send(wd);
   edje_object_size_min_calc(wd->o_button, &mw, &mh);
   e_widget_size_min_set(obj, mw, mh);
}
Exemplo n.º 2
0
int
elicit_cslider_theme_set(Evas_Object *o, const char *file, const char *group)
{
  Elicit_Cslider *cs;

  cs = evas_object_smart_data_get(o);

  if (cs->gui && cs->spectrum)
    edje_object_part_unswallow(cs->gui, cs->spectrum);

  if(!edje_object_file_set(cs->gui, file, group))
  {
    fprintf(stderr, "[Elicit] Error setting cslider theme (%s, %s)\n", file, group);
    return 0;
  }

  edje_object_signal_callback_add(cs->gui, "drag", "slider", cb_drag, cs);
  edje_object_signal_callback_add(cs->gui, "elicit,scroll,*", "*", cb_scroll, cs);

  if (edje_object_part_exists(cs->gui, "spectrum"))
  {
    if (!cs->spectrum)
    {
      //cs->spectrum = evas_object_gradient_add(evas_object_evas_get(o));
      //evas_object_gradient_angle_set(cs->spectrum, 270);
    }

    edje_object_part_swallow(cs->gui, "spectrum", cs->spectrum);
  }
  return 1;
}
Exemplo n.º 3
0
//Set the cover displayed on the GUI
//Remove it if cover_path == NULL
void eclair_gui_cover_set(Eclair *eclair, const char *cover_path, Evas_Bool force_cover_update)
{
   char *current_path;

   if (!eclair || !eclair->cover_owner || !eclair->cover)
      return;

   current_path = NULL;
   evas_object_image_file_get(eclair->cover, &current_path, NULL);
   if (!current_path && !cover_path)
      return;
   if (!force_cover_update && current_path && cover_path && (strcmp(current_path, cover_path) == 0))
      return;

   if (eclair->previous_cover)
   {
      Evas_Object *tmp;

      edje_object_part_unswallow(eclair->cover_owner->edje_object, eclair->cover);
      edje_object_part_unswallow(eclair->cover_owner->edje_object, eclair->previous_cover);
      tmp = eclair->previous_cover;
      eclair->previous_cover = eclair->cover;
      eclair->cover = tmp;
      edje_object_part_swallow(eclair->cover_owner->edje_object, "cover", eclair->cover);
      edje_object_part_swallow(eclair->cover_owner->edje_object, "previous_cover", eclair->previous_cover);
   }

   evas_object_image_file_set(eclair->cover, cover_path, NULL);
   //TODO: evas_object_image_reload bug? need to do two reloads to really reload the image?!
   if (current_path && cover_path && (strcmp(current_path, cover_path) == 0))
   {
      evas_object_image_reload(eclair->cover);
      evas_object_image_reload(eclair->cover);
   }
   if (cover_path)
   {
      edje_object_signal_emit(eclair->cover_owner->edje_object, "signal_cover_set", "eclair_bin");
      evas_object_show(eclair->cover);
   }
   else
   {
      edje_object_signal_emit(eclair->cover_owner->edje_object, "signal_cover_unset", "eclair_bin");
      evas_object_hide(eclair->cover);
   }
}
Exemplo n.º 4
0
void ui_shutdown_edje(ePlayer *player) {
	if (player->gui.playlist) {
		edje_object_part_unswallow(player->gui.edje,
		                           player->gui.playlist);
		evas_object_del(player->gui.playlist);
		player->gui.playlist = NULL;
	}

	if (player->gui.edje) {
		evas_object_del(player->gui.edje);
		player->gui.edje = NULL;
	}
}
Exemplo n.º 5
0
void
elicit_theme_unswallow_objs(Elicit *el)
{
  int i;

  if (!el->obj.main)
    return;

  if (el->obj.shot)
    edje_object_part_unswallow(el->obj.main, el->obj.shot);

  if (el->obj.swatch)
    edje_object_part_unswallow(el->obj.main, el->obj.swatch);

  for (i = 0; i < NUM_CSLIDERS; i++)
    if (el->obj.cslider[i])
      edje_object_part_unswallow(el->obj.main, el->obj.cslider[i]);

  for (i = 0; i < NUM_RELATED_COLORS; i++)
    if (el->obj.related)
      edje_object_part_unswallow(el->obj.main, el->obj.related[i]);
}
Exemplo n.º 6
0
static Evas_Object *
_icon_unset(Evas_Object *obj)
{
   Widget_Data *wd = elm_widget_data_get(obj);
   Evas_Object *icon;
   if (!wd) return NULL;
   if (!wd->icon) return NULL;
   icon = wd->icon;
   elm_widget_sub_object_del(obj, icon);
   evas_object_event_callback_del_full(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                       _changed_size_hints, obj);
   edje_object_part_unswallow(wd->bbl, icon);
   wd->icon = NULL;
   return icon;
}
Exemplo n.º 7
0
static Evas_Object *
_content_unset(Evas_Object *obj)
{
   Widget_Data *wd = elm_widget_data_get(obj);
   Evas_Object *content;
   if (!wd) return NULL;
   if (!wd->content) return NULL;
   content = wd->content;
   elm_widget_sub_object_del(obj, content);
   evas_object_event_callback_del_full(content,
                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                       _changed_size_hints, obj);
   edje_object_part_unswallow(wd->bbl, content);
   wd->content = NULL;
   return content;
}
Exemplo n.º 8
0
EAPI void
e_gadcon_popup_content_set(E_Gadcon_Popup *pop, Evas_Object *o)
{
   Evas_Object *old_o;

   if (!pop) return;
   E_OBJECT_CHECK(pop);
   E_OBJECT_TYPE_CHECK(pop, E_GADCON_POPUP_TYPE);

   old_o = edje_object_part_swallow_get(pop->o_bg, "e.swallow.content");
   if (old_o != o)
     {
        if (old_o)
          {
             edje_object_part_unswallow(pop->o_bg, old_o);
             evas_object_del(old_o);
          }
        edje_object_part_swallow(pop->o_bg, "e.swallow.content", o);
        evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                       _e_gadcon_popup_changed_size_hints_cb, pop);
     }

   _e_gadcon_popup_size_recalc(pop, o);
}
Exemplo n.º 9
0
void EdjePart::unswallow( EvasObject* object )
{
    edje_object_part_unswallow( _parent->obj(), object->obj() );
}
EINTERN Eina_Bool
e_mod_comp_pixmap_rotation_handler_message(Ecore_X_Event_Client_Message *ev)
{
   Ecore_X_Atom type;
   Ecore_X_Window win;
   E_Comp_Win *cw = NULL;
   Ecore_X_Damage dmg;
   Eina_Bool r;

   cw = e_mod_comp_border_client_find(ev->win);
   if (!cw)
     {
        cw = e_mod_comp_win_find(ev->win);
        E_CHECK_RETURN(cw, 0);
     }

   type = ev->message_type;
   win = ev->win;

   if (type == ATOM_CM_PIXMAP_ROTATION_BEGIN)
     {
        E_CHECK_RETURN((!cw->pixrot), 0);

        cw->pixrot = e_mod_comp_pixmap_rotation_new();
        E_CHECK_RETURN(cw->pixrot, 0);

        e_mod_comp_pixmap_rotation_state_set(cw->pixrot, 1);

        edje_object_part_unswallow(cw->shobj, cw->obj);
        _win_unredirect(cw);

        e_mod_comp_pixmap_rotation_done_send
           (win, ATOM_CM_PIXMAP_ROTATION_BEGIN_DONE);
     }
   else if (type == ATOM_CM_PIXMAP_ROTATION_END)
     {
        E_CHECK_RETURN(cw->pixrot, 0);
        e_mod_comp_effect_animating_set(cw->c, cw, EINA_FALSE);
        e_mod_comp_pixmap_rotation_handler_release(cw);
     }
   else if (type == ATOM_CM_PIXMAP_ROTATION_REQUEST)
     {
        E_CHECK_RETURN(cw->pixrot, 0);

        r = e_mod_comp_pixmap_rotation_state_get(cw->pixrot);
        E_CHECK_RETURN(r, 0);

        dmg = e_mod_comp_pixmap_rotation_damage_get(cw->pixrot);
        if (dmg) e_mod_comp_win_del_damage(cw, dmg);

        if (cw->obj)
          edje_object_part_unswallow(cw->shobj, cw->obj);
        else
          {
             E_CHECK_RETURN(cw->c, 0);
             cw->obj = evas_object_image_filled_add(cw->c->evas);
             evas_object_image_colorspace_set(cw->obj, EVAS_COLORSPACE_ARGB8888);

             if (cw->argb)
               evas_object_image_alpha_set(cw->obj, 1);
             else
               evas_object_image_alpha_set(cw->obj, 0);

             evas_object_show(cw->obj);
             evas_object_pass_events_set(cw->obj, 1);
          }

        r = e_mod_comp_pixmap_rotation_request
              (cw->pixrot, ev, cw->c->evas, cw->shobj,
              cw->obj, cw->vis, cw->w, cw->h);
        E_CHECK_RETURN(r, 0);

        e_mod_comp_update_resize(cw->up, cw->w, cw->h);
        e_mod_comp_update_add(cw->up, 0, 0, cw->w, cw->h);

        cw->native = 1;
        dmg = e_mod_comp_pixmap_rotation_damage_get(cw->pixrot);
        E_CHECK_RETURN(dmg, 0);
        e_mod_comp_win_add_damage(cw, dmg);
        e_mod_comp_pixmap_rotation_done_send
          (win, ATOM_CM_PIXMAP_ROTATION_REQUEST_DONE);
     }
   else
     return EINA_FALSE;

   return EINA_TRUE;
}