EAPI_MAIN int
elm_main(int argc, char *argv[])
{
   Evas_Object *win, *box, *btn;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   elm_theme_overlay_add(NULL, "./theme_example.edj");

   win = elm_win_util_standard_add("theme", "Theme example");
   elm_win_autodel_set(win, EINA_TRUE);

   box = elm_box_add(win);
   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, box);
   evas_object_show(box);

   btn = elm_button_add(win);
   elm_object_text_set(btn, "Button 1");
   elm_box_pack_end(box, btn);
   evas_object_show(btn);
   evas_object_smart_callback_add(btn, "clicked", _btn_clicked_cb, NULL);

   btn = elm_button_add(win);
   elm_object_text_set(btn, "Button 2");
   elm_box_pack_end(box, btn);
   evas_object_show(btn);
   evas_object_smart_callback_add(btn, "clicked", _btn_clicked_cb, NULL);

   btn = elm_button_add(win);
   elm_object_text_set(btn, "Button 3");
   elm_box_pack_end(box, btn);
   evas_object_show(btn);
   evas_object_smart_callback_add(btn, "clicked", _btn_clicked_cb, NULL);

   btn = elm_button_add(win);
   elm_object_text_set(btn, "Button 4");
   elm_box_pack_end(box, btn);
   evas_object_show(btn);
   evas_object_smart_callback_add(btn, "clicked", _btn_clicked_cb, NULL);

   evas_object_resize(win, 300, 320);
   evas_object_show(win);

   elm_run();

   return 0;
}
示例#2
0
/* externally accessible functions */
EAPI Evas_Object *
e_widget_table_add(Evas *evas, int homogenous)
{
   Evas_Object *obj, *o;
   E_Widget_Data *wd;

   obj = e_widget_add(evas);

   e_widget_del_hook_set(obj, _e_wid_del_hook);
   wd = calloc(1, sizeof(E_Widget_Data));
   e_widget_data_set(obj, wd);

   o = e_table_add(evas);
   wd->o_table = o;
   e_table_homogenous_set(o, homogenous);
   evas_object_show(o);
   e_widget_sub_object_add(obj, o);
   e_widget_resize_object_set(obj, o);

   return obj;
}
示例#3
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o,*src;

   for (i = 0; i < OBNUM; i++)
     {
	o = evas_object_image_add(evas);
	evas_object_image_file_set(o, build_path("image.png"), NULL);
	evas_object_image_fill_set(o, 0, 0, 120, 160);
	evas_object_resize(o, 120, 160);
	evas_object_filter_set(o, EVAS_FILTER_BLUR);
	evas_object_filter_param_int_set(o, "radius", 5);
	evas_object_layer_set(o,1);
	evas_object_show(o);
	src = o;
	o_images[i] = src;
     }

   done = 0;
}
示例#4
0
文件: bookstore.c 项目: GeeXboX/enna
static void
bs_service_set_bg (const char *bg)
{
    if (bg)
    {
        Evas_Object *old;

        old = mod->service_bg;
        mod->service_bg = elm_layout_add(mod->o_layout);
        elm_layout_file_set(mod->service_bg, enna_config_theme_get(), bg);
        elm_layout_content_set(mod->o_layout,
                            "service.bg.swallow", mod->service_bg);
        evas_object_show(mod->service_bg);
        evas_object_del(old);
    }
    else
    {
        evas_object_hide(mod->service_bg);
        elm_layout_file_set(mod->o_layout, "service.bg.swallow", NULL);
    }
}
示例#5
0
文件: madpdf.c 项目: avm/madpdf
static void display_hint(double scroll_amount)
{
    if(!scroll_hint) {
        Ewl_Embed *emb = ewl_embed_widget_find(pdfwidget);
        scroll_hint = evas_object_line_add(emb->canvas);
        evas_object_color_set(scroll_hint, 0, 200, 0, 255);
    }

    int y_coord = round(scroll_amount);
    if(y_coord < 0) {
        y_coord += CURRENT_H(scrollpane);
    }
    evas_object_line_xy_set(scroll_hint,
            0, y_coord, CURRENT_W(scrollpane), y_coord);
    evas_object_show(scroll_hint);

    if(hint_timer) { // previously set, did not fire
        ecore_timer_del(hint_timer);
    }
    hint_timer = ecore_timer_add(2.0, hide_hint, NULL);
}
示例#6
0
/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o;
   srnd();
   for (i = 0; i < OBNUM; i++)
     {
	int r, g, b, a;

	o = evas_object_rectangle_add(evas);
	o_images[i] = o;
        a = 256 - (1 << ((rnd() % 8) + 1));
        if (a < 128) a = 128;
	r = ((rnd()&0xff) * a) / 255;
	g = ((rnd()&0xff) * a) / 255;
	b = ((rnd()&0xff) * a) / 255;
	evas_object_color_set(o, r, g, b, a);
	evas_object_show(o);
     }
   done = 0;
}
示例#7
0
文件: theme.c 项目: Limsik/e17
void
theme_init(const char *theme)
{
   Evas_Object *o;
   char buf[4096];

   if (!theme) theme = "default";
   o = edje_object_add(evas);
   if ((theme) &&
       (theme[0] != '/') &&
       (!!strncmp(theme, "./", 2)) &&
	(!!strncmp(theme, "../", 3)))
     snprintf(buf, sizeof(buf), "%s/%s.edj", eina_prefix_data_get(pfx), theme);
   else
     snprintf(buf, sizeof(buf), "%s", theme);
   o = exquisite_object_add (evas, buf);
   evas_object_move(o, 0, 0);
   evas_object_resize(o, scr_w, scr_h);
   evas_object_show(o);
   o_bg = o;
}
示例#8
0
/**
 * Creates a new entry widget
 *
 * @param evas the evas where to add the new entry widget
 * @param text_location the location where to store the text of the entry.
 * @param func DOCUMENT ME!
 * @param data  DOCUMENT ME!
 * @param data2 DOCUMENT ME!
 * The current value will be used to initialize the entry
 * @return Returns the new entry widget
 */
EAPI Evas_Object
*e_widget_entry_add(Evas *evas, char **text_location, void (*func) (void *data, void *data2), void *data, void *data2)
{
   Evas_Object *obj, *o;
   E_Widget_Data *wd;
   Evas_Coord minw, minh;

   obj = e_widget_add(evas);

   e_widget_del_hook_set(obj, _e_wid_del_hook);
   e_widget_focus_hook_set(obj, _e_wid_focus_hook);
   e_widget_disable_hook_set(obj, _e_wid_disable_hook);

   wd = calloc(1, sizeof(E_Widget_Data));
   e_widget_data_set(obj, wd);
   wd->text_location = text_location;

   o = e_entry_add(evas);
   wd->o_entry = o;
   evas_object_show(o);
   e_widget_sub_object_add(obj, o);
   e_widget_resize_object_set(obj, o);
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_wid_focus_steal, obj);
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _e_wid_in, obj);
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _e_wid_out, obj);
   evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_wid_keydown, obj);

   if ((text_location) && (*text_location))
     e_entry_text_set(o, *text_location);

   e_entry_size_min_get(o, &minw, &minh);
   e_widget_size_min_set(obj, minw, minh);

   wd->func = func;
   wd->data = data;
   wd->data2 = data2;
   evas_object_smart_callback_add(o, "changed", _e_wid_changed_cb, obj);

   return obj;
}
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;
   char buf[PATH_MAX];

   inst = E_NEW(Instance, 1);

   inst->ci = _tclock_config_item_get(id);
   if (!inst->ci->id) inst->ci->id = eina_stringshare_add(id);

   o = edje_object_add(gc->evas);
   snprintf(buf, sizeof(buf), "%s/tclock.edj", tclock_config->mod_dir);
   if (!e_theme_edje_object_set(o, "base/theme/modules/tclock", 
                                "modules/tclock/main"))
     edje_object_file_set(o, buf, "modules/tclock/main");
   evas_object_show(o);

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

   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
                                  _tclock_cb_mouse_down, inst);
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN,
                                  _tclock_cb_mouse_in, inst);
   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT,
                                  _tclock_cb_mouse_out, inst);

   tclock_config->instances =
     eina_list_append(tclock_config->instances, inst);

   _tclock_cb_check(inst);
   if (!check_timer)
     check_timer = ecore_timer_add(1.0, _tclock_cb_check, NULL);
   return gcc;
}
示例#10
0
int
enna_mediaplayer_play(Enna_Playlist *enna_playlist)
{
    mp->cur_playlist = enna_playlist;

    switch (mp->play_state)
    {
    case STOPPED:
    {
      Enna_File *item;
        item = eina_list_nth(enna_playlist->playlist,
                             enna_playlist->selected);
        emotion_object_play_set(mp->player, EINA_FALSE);
        if (item && item->uri)
            emotion_object_file_set(mp->player, item->mrl);
        emotion_object_play_set(mp->player, EINA_TRUE);
        if (item && item->type == ENNA_FILE_FILM)
        {
            evas_object_show(mp->player);
            evas_object_hide(enna->layout);
        }
        mp->play_state = PLAYING;
        ecore_event_add(ENNA_EVENT_MEDIAPLAYER_START, NULL, NULL, NULL);
        break;
    }
    case PLAYING:
        enna_mediaplayer_pause();
        break;
    case PAUSE:
        emotion_object_play_set(mp->player, EINA_TRUE);
        mp->play_state = PLAYING;
        ecore_event_add(ENNA_EVENT_MEDIAPLAYER_UNPAUSE,
                        NULL, NULL, NULL);
        break;
    default:
        break;
    }

    return 0;
}
示例#11
0
EAPI int
e_widget_preview_thumb_set(Evas_Object *obj, const char *file, const char *key, int w, int h)
{
   E_Widget_Data *wd;

   wd = e_widget_data_get(obj);
   if (wd->img)
     {
        e_widget_sub_object_del(obj, wd->img);
        evas_object_del(wd->img);
     }

   wd->img = e_thumb_icon_add(evas_object_evas_get(obj));
   e_widget_sub_object_add(obj, wd->img);
   if (eina_str_has_extension(file, "edj"))
     {
        if (key)
          e_thumb_icon_file_set(wd->img, file, key);
        else
        /* FIXME: There is probably a quicker way of doing this. */
        if (edje_file_group_exists(file, "icon"))
          e_thumb_icon_file_set(wd->img, file, "icon");
        else if (edje_file_group_exists(file, "e/desktop/background"))
          e_thumb_icon_file_set(wd->img, file, "e/desktop/background");
        else if (edje_file_group_exists(file, "e/init/splash"))
          e_thumb_icon_file_set(wd->img, file, "e/init/splash");
     }
   else
     e_thumb_icon_file_set(wd->img, file, NULL);
   evas_object_smart_callback_add(wd->img, "e_thumb_gen", _e_wid_preview_thumb_gen, wd);
   e_thumb_icon_size_set(wd->img, w, h);
   e_thumb_icon_begin(wd->img);

   edje_object_part_swallow(wd->o_frame, "e.swallow.content", wd->img);
   evas_object_show(wd->img);

   e_widget_change(obj);

   return 1;
}
示例#12
0
void socket_fill_item_cb(void *data, Evas_Object *obj, void *event_info)
{
	elm_list_item_selected_set(event_info, EINA_FALSE);
	notification_data* notify_info=(notification_data*)data;
	layout_view_data2 *datas = calloc(1, sizeof(layout_view_data2));
	Evas_Object* lists=notify_info->status;

	datas->navi = evas_object_data_get(lists, "view_data");

	datas->name = notify_info->name;
	datas->layout = ui_utils_layout_add(datas->navi, _layout_view_destroy2, datas);

	if(!datas->layout)
	{
		free(datas);
		return ;
	}


	Evas_Object* list= elm_list_add(datas->layout);

	notification_data *notification_list = NULL;
	int size=0;
	//
	notification_list=socket_component_list_get(&size);

	for(int i=0;i<size;i++){

		notification_list[i].status=lists;
		elm_list_item_append(list,notification_list[i].name,NULL,NULL,_tab_view_layout_fill_cb2depth,&notification_list[i]);
	}


	evas_object_hide(elm_object_part_content_unset(datas->layout, "elm.swallow.content"));
	elm_object_part_content_set(datas->layout, "elm.swallow.content", list);
	evas_object_show(list);


	datas->navi_item = elm_naviframe_item_push(datas->navi, datas->name, NULL, NULL,datas->layout , NULL);
}
示例#13
0
void create_buttons() {

	
	container_outer = edje_object_add(evas);
	edje_object_file_set(container_outer, default_theme, "widgets/scrollframe");
	evas_object_move(container_outer, 0, 0);
	edje_object_signal_emit(container_outer, "hbar", "hide");
	evas_object_resize(container_outer, barwidth - 19, container_height);
	evas_object_show(container_outer);

	edje_object_signal_callback_add(container_outer, "drag*", "vbar_bar", _scrolldrag, NULL);
	
	container = esmart_container_new(evas);
	edje_object_part_swallow(container_outer, "item", container);
	esmart_container_direction_set(container, CONTAINER_DIRECTION_VERTICAL);
	
	get_theme_list();

#define ADD_BUTTON(A, B, C)\
	A = edje_object_add(evas);\
	edje_object_file_set(A, default_theme, "widgets/button");\
	evas_object_resize(A, 120, 24);\
	edje_object_part_text_set(A, "label", C);\
	evas_object_show(A);
	
	ADD_BUTTON(b_default, 40, "Default Theme");
	evas_object_move(b_default, 5, container_height + 10);
	edje_object_signal_callback_add(b_default, "click", "", _preview_theme, NULL);
	 
	ADD_BUTTON(b_apply, 60, "Apply");
	evas_object_move(b_apply, 5, container_height + 40);
	edje_object_signal_callback_add(b_apply, "click", "", _set_theme, NULL);
	
	ADD_BUTTON(b_exit, 80, "Exit");
	evas_object_move(b_exit, 5, container_height + 60);
	edje_object_signal_callback_add(b_exit, "click", "", _ethemes_exit, NULL);
	

#undef ADD_BUTTON
}
static void
_btn_clicked(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *win = data;
    Evas_Object *ctxpopup;
    Evas_Coord x,y;

    ctxpopup = elm_ctxpopup_add(win);

    elm_object_style_set(ctxpopup, "1text.1icon");
    elm_object_signal_emit(ctxpopup, "elm,action,focus", "elm");
    item_new(ctxpopup, "Text List1", "home");
    item_new(ctxpopup, "Text List2", "file");
    item_new(ctxpopup, "Text List3", "delete");

    switch (dir) {
        case 0:
            elm_ctxpopup_direction_priority_set(ctxpopup,
                                                ELM_CTXPOPUP_DIRECTION_UP, 0, 0, 0);
            break;
        case 1:
            elm_ctxpopup_direction_priority_set(ctxpopup,
                                                ELM_CTXPOPUP_DIRECTION_DOWN, 0, 0, 0);
            break;
        case 2:
            elm_ctxpopup_direction_priority_set(ctxpopup,
                                                ELM_CTXPOPUP_DIRECTION_LEFT, 0, 0, 0);
            break;
        case 3:
            elm_ctxpopup_direction_priority_set(ctxpopup,
                                                ELM_CTXPOPUP_DIRECTION_RIGHT, 0, 0, 0);
            break;
    }

    evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
    evas_object_move(ctxpopup, x, y);
    evas_object_show(ctxpopup);
    eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, _ctxpopup_back_key_cb, NULL);
}
/* Reset */
static int app_reset(bundle *b, void *data)
{
	struct appdata *ad = data;
	int removenoti = -1;
	char *opt = NULL;

	dev_name = bundle_get_val(b, "device_name");
	if (dev_name == NULL)
		return 0;

	if (syspopup_has_popup(b)) {
		syspopup_reset(b);
	} else {
		syspopup_create(b, &handler, ad->win_main, ad);
		evas_object_show(ad->win_main);

		/* Start Main UI */
		usbotg_unmount_start((void *)ad);
	}

	return 0;
}
示例#16
0
static Evas_Object*
create_main_box(interface *intf, Evas_Object *parent)
{
    /* Create a content box to display the content and the mini player */
    intf->main_box = elm_box_add(parent);
    elm_box_horizontal_set(intf->main_box, EINA_FALSE);

    /* Main View Naviframe */
    intf->nf_content = elm_naviframe_add(intf->main_box);

    /* Put the naviframe at the top of the content_box */
    evas_object_size_hint_weight_set(intf->nf_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(intf->nf_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_box_pack_end(intf->main_box, intf->nf_content);

    /* Library scan progress */
    intf->scan_progress = elm_progressbar_add(intf->main_box);
    elm_progressbar_unit_format_set(intf->scan_progress, "Scanning... %.0f%%");
    elm_progressbar_horizontal_set(intf->scan_progress, EINA_TRUE);
    evas_object_size_hint_weight_set(intf->scan_progress, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
    evas_object_size_hint_align_set(intf->scan_progress, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_hide(intf->scan_progress);

    /* Mini Player creation */
    intf->mini_player_layout = elm_layout_add(intf->main_box);
    intf->p_mini_player = audio_player_create(intf, application_get_playback_service(intf->p_app), intf->mini_player_layout);
    evas_object_hide(intf->mini_player_layout);

    evas_object_size_hint_weight_set(intf->mini_player_layout, EVAS_HINT_FILL, 0.1);
    evas_object_size_hint_align_set(intf->mini_player_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);

    /* */
    evas_object_show(intf->nf_content);

    /* Ask the global box to recalculate her current children display */
    elm_box_recalculate(intf->main_box);

    return intf->main_box;
}
示例#17
0
/* Checkbox: render() */
static Etk_Bool _checkbox_render(Etk_Tree_Model *model, Etk_Tree_Row *row, Etk_Geometry geometry, void *cell_data, Evas_Object *cell_objects[ETK_TREE_MAX_OBJECTS_PER_MODEL], Evas *evas)
{
   Etk_Bool *checked;
   int w, h;

   if (!(checked = cell_data) || !cell_objects[0])
      return ETK_FALSE;

   if (*checked)
      edje_object_signal_emit(cell_objects[0], "etk,state,on", "etk");
   else
      edje_object_signal_emit(cell_objects[0], "etk,state,off", "etk");
   edje_object_message_signal_process(cell_objects[0]);

   evas_object_data_set(cell_objects[0], "_Etk_Tree_Model_Checkbox::Row", row);
   edje_object_size_min_get(cell_objects[0], &w, &h);
   evas_object_move(cell_objects[0], geometry.x, geometry.y + ((geometry.h - h) / 2));
   evas_object_resize(cell_objects[0], w, h);
   evas_object_show(cell_objects[0]);

   return ETK_FALSE;
}
示例#18
0
/* Updates the selection of the editable object */
static void
_e_editable_selection_update(Evas_Object *editable)
{
   E_Editable_Smart_Data *sd;
   const Evas_Object *text_obj;
   Evas_Coord tx, ty;
   Evas_Coord cx, cy;
   Evas_Coord sx, sy, sw, sh;
   int start_pos, end_pos;

   if ((!editable) || (!(sd = evas_object_smart_data_get(editable))))
     return;
   if (!(text_obj = edje_object_part_object_get(sd->text_object, "e.text.text")))
     return;

   if ((sd->cursor_pos == sd->selection_pos) || (!sd->selection_visible))
     evas_object_hide(sd->selection_object);
   else
     {
        evas_object_geometry_get(text_obj, &tx, &ty, NULL, NULL);
        start_pos = (sd->cursor_pos <= sd->selection_pos) ?
          sd->cursor_pos : sd->selection_pos;
        end_pos = (sd->cursor_pos >= sd->selection_pos) ?
          sd->cursor_pos : sd->selection_pos;

        _e_editable_char_geometry_get_from_pos(editable, start_pos,
                                               &cx, &cy, NULL, NULL);
        sx = tx + cx;
        sy = ty + cy;

        _e_editable_char_geometry_get_from_pos(editable, end_pos,
                                               &cx, NULL, NULL, &sh);
        sw = tx + cx - sx;

        evas_object_move(sd->selection_object, sx, sy);
        evas_object_resize(sd->selection_object, sw, sh);
        evas_object_show(sd->selection_object);
     }
}
示例#19
0
文件: shelm_macros.c 项目: Limsik/e17
SH_API Evas_Object *
create_button(Evas_Object *parent, const char *button_icon, const char *label)
{
  Evas_Object *button;

  button = elm_button_add(parent);

  if (button_icon)
    {
      Evas_Object *icon;
      icon = elm_icon_add(parent);

      elm_image_file_set(icon, button_icon, NULL);
      evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
      evas_object_show(icon);
      elm_object_part_content_set(button, NULL, icon);
    }

  elm_object_text_set(button, label);

  return button;
}
示例#20
0
void
theme_init(const char *theme)
{
   Evas_Object *o;
   char buf[4096];
   
   if (!theme) theme = "default";
   o = edje_object_add(evas);
   if ((theme) && 
       (theme[0] != '/') && 
       (!!strncmp(theme, "./", 2)) &&
	(!!strncmp(theme, "../", 3)))
     snprintf(buf, sizeof(buf), THEMES"/%s.edj", theme);
   else
     snprintf(buf, sizeof(buf), "%s", theme);
   edje_object_file_set(o, buf, "exquisite/theme");
   evas_object_move(o, 0, 0);
   evas_object_resize(o, scr_w, scr_h);
   edje_object_signal_callback_add(o, "exquisite", "done", _theme_cb_exit_done, NULL);
   evas_object_show(o);
   o_bg = o;
}
示例#21
0
static void
frame_ussd_show(struct UssdViewData *data)
{
	struct Window *win = data->win;
	window_layout_set(win, USSD_FILE, "ussd");
	window_text_set(win, "mode", D_("Data:"));
	window_text_set(win, "message", data->message);

	data->bt_close = elm_button_add(window_evas_object_get(win));
	elm_button_label_set(data->bt_close, D_("Close"));
	evas_object_smart_callback_add(data->bt_close, "clicked",
				       frame_ussd_close_clicked, data);
	window_swallow(win, "button_close", data->bt_close);
	evas_object_show(data->bt_close);

	/*
	 * data->keypad = elm_keypad_add(window_evas_object_get(win));
	 * evas_object_smart_callback_add(data->keypad, "clicked", frame_ussd_keypad_clicked, data);
	 * window_swallow(win, "keypad", data->keypad);
	 * evas_object_show(data->keypad);
	 */
}
示例#22
0
static void
_emotion_aspect_borders_apply(Evas_Object *obj, Smart_Data *sd, int w, int h, int iw, int ih)
{
   int x, y;

   evas_object_geometry_get(obj, &x, &y, NULL, NULL);

   /* applying calculated borders */
   if (sd->crop.l == 0 && sd->crop.r == 0 &&
       sd->crop.t == 0 && sd->crop.b == 0)
     {
	Evas_Object *old_clipper;
	if (sd->crop.clipper)
	  {
	     old_clipper = evas_object_clip_get(sd->crop.clipper);
	     evas_object_clip_unset(sd->obj);
	     evas_object_clip_set(sd->obj, old_clipper);
	     evas_object_del(sd->crop.clipper);
	     sd->crop.clipper = NULL;
	  }
     }
   else
     {
	if (!sd->crop.clipper)
	  {
	     Evas_Object *old_clipper;
	     sd->crop.clipper = evas_object_rectangle_add(
		evas_object_evas_get(obj));
	     evas_object_color_set(sd->crop.clipper, 255, 255, 255, 255);
	     evas_object_smart_member_add(sd->crop.clipper, obj);
	     old_clipper = evas_object_clip_get(sd->obj);
	     evas_object_clip_set(sd->obj, sd->crop.clipper);
	     evas_object_clip_set(sd->crop.clipper, old_clipper);
	     if (evas_object_visible_get(sd->obj))
	       evas_object_show(sd->crop.clipper);
	  }
     }
   _clipper_position_size_update(obj, x, y, w, h, iw, ih);
}
示例#23
0
/* Progressbar: render() */
static Etk_Bool _progress_bar_render(Etk_Tree_Model *model, Etk_Tree_Row *row, Etk_Geometry geometry, void *cell_data, Evas_Object *cell_objects[ETK_TREE_MAX_OBJECTS_PER_MODEL], Evas *evas)
{
   Etk_Tree_Model_Progressbar_Data *pbar_data;
   int w, h;

   if (!(pbar_data = cell_data) || !cell_objects[0])
      return ETK_FALSE;

   edje_object_part_text_set(cell_objects[0], "etk.text.text", pbar_data->text ? pbar_data->text : "");

   evas_object_data_set(cell_objects[0], "_Etk_Tree_Model_Progressbar::Row", row);
   edje_object_size_min_get(cell_objects[0], &w, &h);
   evas_object_move(cell_objects[0], geometry.x, geometry.y + ((geometry.h - h) / 2));
   evas_object_resize(cell_objects[0], w > geometry.w ? w : geometry.w, h);

   edje_object_part_drag_value_set(cell_objects[0], "etk.dragable.filler", 0.0, 0.0);
   edje_object_part_drag_size_set(cell_objects[0], "etk.dragable.filler", pbar_data->fraction, 0.0);

   evas_object_show(cell_objects[0]);

   return ETK_FALSE;
}
示例#24
0
ActivityWidgetsView::ActivityWidgetsView(Evas *_e, Evas_Object *_parent):
        ActivityView(_e, _parent, "calaos/page/widgets")
{
        clipper = evas_object_rectangle_add(evas);
        evas_object_color_set(clipper, 0, 0, 0, 0);
        evas_object_show(clipper);

        Swallow(clipper, "widgets.swallow", true);

        //Create a temporary dir for modules
        if (ecore_file_is_dir("/tmp/calaos_widgets"))
                ecore_file_recursive_rm("/tmp/calaos_widgets");

        ecore_file_mkpath("/tmp/calaos_widgets");

        //add search paths for modules
        ModuleManager::Instance().addPath(PACKAGE_LIB_DIR "/calaos/widgets");
        ModuleManager::Instance().addPath("/usr/lib/calaos/widgets");
        ModuleManager::Instance().SearchModules();

        LoadWidgets();
}
示例#25
0
EAPI void
e_widget_frametable_object_append_full(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h)
{
   E_Widget_Data *wd = e_widget_data_get(obj);
   Evas_Coord mw = 0, mh = 0;

   e_table_pack(wd->o_table, sobj, col, row, colspan, rowspan);
   e_table_pack_options_set(sobj,
                            fill_w, fill_h,
                            expand_w, expand_h,
                            align_x, align_y,
                            min_w, min_h,
                            max_w, max_h
                            );
   e_table_size_min_get(wd->o_table, &mw, &mh);
   edje_extern_object_min_size_set(wd->o_table, mw, mh);
   edje_object_part_swallow(wd->o_frame, "e.swallow.content", wd->o_table);
   edje_object_size_min_calc(wd->o_frame, &mw, &mh);
   e_widget_size_min_set(obj, mw, mh);
   e_widget_sub_object_add(obj, sobj);
   evas_object_show(sobj);
}
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;
}
示例#27
0
static void
_smart_slider_smart_add(Evas_Object *o)
{
	Evas *e = evas_object_evas_get(o);
	EVAS_SMART_DATA_ALLOC(o, smart_slider_t);

	_smart_slider_parent_sc->add(o);

	priv->theme = edje_object_add(e);
	edje_object_file_set(priv->theme, SYNTHPOD_DATA_DIR"/synthpod.edj",
		"/synthpod/smart_slider/theme"); //TODO
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _mouse_in, priv);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _mouse_out, priv);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, priv);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _mouse_up, priv);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, priv);
	evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel, priv);
	evas_object_show(priv->theme);
	evas_object_smart_member_add(priv->theme, o);

	_smart_slider_smart_init(o);
}
示例#28
0
EAPI void
e_widget_table_object_align_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h, double ax, double ay)
{
   E_Widget_Data *wd;
   Evas_Coord mw = 0, mh = 0;

   wd = e_widget_data_get(obj);

   e_table_pack(wd->o_table, sobj, col, row, colspan, rowspan);
   e_widget_size_min_get(sobj, &mw, &mh);
   e_table_pack_options_set(sobj,
                            fill_w, fill_h, /* fill */
                            expand_w, expand_h, /* expand */
                            ax, ay, /* align */
                            mw, mh, /* min */
                            99999, 99999 /* max */
                            );
   e_table_size_min_get(wd->o_table, &mw, &mh);
   e_widget_size_min_set(obj, mw, mh);
   e_widget_sub_object_add(obj, sobj);
   evas_object_show(sobj);
}
/**
 * Create a color selector dialog.
 *
 * @param c compositor to display on
 * @param color color to initialize to (or NULL for black).
 * @param alpha_enabled if set, uses alpha and let user edit it.
 */
E_Color_Dialog *
e_color_dialog_new(E_Comp *c, const E_Color *color, Eina_Bool alpha_enabled)
{
   E_Color_Dialog *dia;
   Evas_Object *o;
   Evas_Coord mw, mh;

   dia = E_OBJECT_ALLOC(E_Color_Dialog, E_COLOR_DIALOG_TYPE, _e_color_dialog_free);
   if (!dia) return NULL;
   dia->dia = e_dialog_new(c, "E", "_color_dialog");
   e_dialog_title_set(dia->dia, _("Color Selector"));

   dia->color = calloc(1, sizeof(E_Color));
   dia->initial = calloc(1, sizeof(E_Color));

   if (color)
     e_color_copy(color, dia->color);

   if ((!color) || (!alpha_enabled))
     dia->color->a = 255;

   e_color_copy(dia->color, dia->initial);

   o = e_widget_csel_add(dia->dia->win->evas, dia->color, alpha_enabled);
   evas_object_show(o);
   e_widget_size_min_get(o, &mw, &mh);
   e_dialog_content_set(dia->dia, o, mw, mh);
   e_widget_on_change_hook_set(o, _e_color_dialog_cb_csel_change, dia);

   /* buttons at the bottom */
   e_dialog_button_add(dia->dia, _("Select"), NULL, _e_color_dialog_button1_click, dia);
   e_dialog_button_add(dia->dia, _("Cancel"), NULL, _e_color_dialog_button2_click, dia);
   e_win_centered_set(dia->dia->win, 1);

   dia->dia->data = dia;
   e_object_del_attach_func_set(E_OBJECT(dia->dia), _e_color_dialog_dia_del);

   return dia;
}
            void WebViewImpl::draw(cocos2d::Renderer *renderer, cocos2d::Mat4 const &transform, int flags) {
                if (flags & cocos2d::Node::FLAGS_TRANSFORM_DIRTY) {
                    auto directorInstance = cocos2d::Director::getInstance();
                    auto glView = directorInstance->getOpenGLView();
                    auto frameSize = glView->getFrameSize();

                    auto winSize = directorInstance->getWinSize();

                    auto leftBottom = this->_webView->convertToWorldSpace(cocos2d::Point::ZERO);
                    auto rightTop = this->_webView->convertToWorldSpace(cocos2d::Point(this->_webView->getContentSize().width,this->_webView->getContentSize().height));

                    auto uiLeft = frameSize.width / 2 + (leftBottom.x - winSize.width / 2 ) * glView->getScaleX();
                    auto uiTop = frameSize.height /2 - (rightTop.y - winSize.height / 2) * glView->getScaleY();

                    Evas_Coord width = (rightTop.x - leftBottom.x) * glView->getScaleX();
                    Evas_Coord height = (rightTop.y - leftBottom.y) * glView->getScaleY();

                    evas_object_resize(_ewkView, width, height);
                    evas_object_move(_ewkView, uiLeft, uiTop);
                    evas_object_show(_ewkView);
                }
            }