コード例 #1
0
ファイル: ui.cpp プロジェクト: iamsanjeev/practice
static void
create_main_view(appdata_s *ad)
{
	Evas_Object *genlist;
	Evas_Object *circle_genlist;
	Evas_Object *btn;
	Evas_Object *nf = ad->nf;
	Elm_Object_Item *nf_it;
	Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
	Elm_Genlist_Item_Class *ttc = elm_genlist_item_class_new();
	Elm_Genlist_Item_Class *ptc = elm_genlist_item_class_new();
	item_data *id;
	int index = 0;

	/* Genlist */
	genlist = elm_genlist_add(nf);
	elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
	evas_object_smart_callback_add(genlist, "selected", gl_selected_cb, NULL);

	circle_genlist = eext_circle_object_genlist_add(genlist, ad->circle_surface);
	eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
	eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);

	/* Genlist Title Item style */
	ttc->item_style = "title";
	ttc->func.text_get = _gl_menu_title_text_get;
	ttc->func.del = _gl_menu_del;

	/* Genlist Item style */
	itc->item_style = "default";
	itc->func.text_get = _gl_menu_text_get;
	itc->func.del = _gl_menu_del;

	/* Genlist Padding Item style */
	ptc->item_style = "padding";
	ptc->func.del = _gl_menu_del;

	/* Title Items Here */
	elm_genlist_item_append(genlist, ttc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);

	/* Main Menu Items Here */
	id = (item_data *)calloc(sizeof(item_data), 1);
	id->index = index++;
	id->item = elm_genlist_item_append(genlist, itc, id, NULL, ELM_GENLIST_ITEM_NONE, index_cb, ad);
	id = (item_data *)calloc(sizeof(item_data), 1);
	id->index = index++;
	id->item = elm_genlist_item_append(genlist, itc, id, NULL, ELM_GENLIST_ITEM_NONE, index_cb, ad);

	elm_genlist_item_append(genlist, ptc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);

	elm_genlist_item_class_free(itc);
	elm_genlist_item_class_free(ttc);
	elm_genlist_item_class_free(ptc);

	/* This button is set for devices which doesn't have H/W back key. */
	btn = elm_button_add(nf);
	elm_object_style_set(btn, "naviframe/end_btn/default");
	nf_it = elm_naviframe_item_push(nf, NULL, btn, NULL, genlist, "empty");
	elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->win);
}
コード例 #2
0
Evas_Object *Add_To_Most_Visited_Sites_View::_create_history_genlist(void)
{
	BROWSER_LOGD("[%s]", __func__);
	Evas_Object *genlist = elm_genlist_add(m_conformant);
	if (!genlist) {
		BROWSER_LOGE("elm_genlist_add failed");
		return NULL;
	}
	evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);

	memset(&m_history_genlist_item_class, 0x00, sizeof(Elm_Genlist_Item_Class));
	m_history_genlist_item_class.item_style = "2text.1icon.4";
	m_history_genlist_item_class.func.text_get = __genlist_label_get_cb;
	m_history_genlist_item_class.func.content_get = __genlist_icon_get_cb;
	m_history_genlist_item_class.func.state_get = NULL;
	m_history_genlist_item_class.func.del = NULL;

	memset(&m_history_group_title_class, 0x00, sizeof(Elm_Genlist_Item_Class));
	m_history_group_title_class.item_style = "grouptitle";
	m_history_group_title_class.func.text_get = __genlist_date_label_get_cb;
	m_history_group_title_class.func.content_get = NULL;
	m_history_group_title_class.func.state_get = NULL;
	m_history_group_title_class.func.del = NULL;

	m_history_list.clear();
	m_history_date_label_list.clear();

	Eina_Bool ret = m_data_manager->get_history_db()->get_history_list(m_history_list);
	if (!ret) {
		BROWSER_LOGE("get_history_list failed");
		return NULL;
	}

	unsigned int history_count = m_history_list.size();

	Date date;
	Elm_Object_Item *it = NULL;
	for(int i = 0 ; i < history_count; i++) {
		sscanf(m_history_list[i]->date.c_str(), "%d-%d-%d", &date.year, &date.month, &date.day);
		m_history_list[i]->user_data = (void *)this;
		if (m_last_date != date) {
			m_last_date = date;
			char *labe_item = strdup(m_history_list[i]->date.c_str());
			m_history_date_label_list.push_back(labe_item);
			it = elm_genlist_item_append(genlist, &m_history_group_title_class,
						labe_item, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);

			elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
		}
		elm_genlist_item_append(genlist, &m_history_genlist_item_class,
					m_history_list[i], it, ELM_GENLIST_ITEM_NONE,
					__history_item_clicked_cb, this);
	}

	return genlist;
}
コード例 #3
0
static void
_add_entry(GHashTable *entry)
{
	Elm_Object_Item *glit;
	GVariant *val;
	int received = 0, answered = 0;

	val = g_hash_table_lookup(entry, "Direction");
	if (val) {
		const char *dir = g_variant_get_string(val, NULL);
		if (!strcmp(dir, "in")) {
			received = 1;
		}
	}
	else {
		g_warning("ignoring call without Direction field!!");
		return;
	}

	val = g_hash_table_lookup(entry, "Answered");
	if (val) {
		if (g_variant_get_boolean(val)) {
			answered = 1;
		}
	}

	glit = elm_genlist_item_append(view.list_all, &itc,
			g_hash_table_ref(entry),
			NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	val = g_variant_new_int32(GPOINTER_TO_INT(glit));
	g_hash_table_insert(entry, "_item_all", g_variant_ref_sink(val));
	if (received) {
		if (answered) {
			glit = elm_genlist_item_append(view.list_in, &itc,
					g_hash_table_ref(entry),
					NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
			val = g_variant_new_int32(GPOINTER_TO_INT(glit));
			g_hash_table_insert(entry, "_item_in", g_variant_ref_sink(val));
		}
		else {
			glit = elm_genlist_item_append(view.list_missed, &itc,
					g_hash_table_ref(entry),
					NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
			val = g_variant_new_int32(GPOINTER_TO_INT(glit));
			g_hash_table_insert(entry, "_item_missed",
					g_variant_ref_sink(val));
		}
	}
	else {
		glit = elm_genlist_item_append(view.list_out, &itc,
				g_hash_table_ref(entry),
				NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
		val = g_variant_new_int32(GPOINTER_TO_INT(glit));
		g_hash_table_insert(entry, "_item_out",
				g_variant_ref_sink(val));
	}
}
/**
 * @brief Positive test case of elm_genlist_item_expanded_depth_get()
 */
static void utc_UIFW_elm_genlist_item_expanded_depth_get_func_01(void)
{
	Elm_Object_Item *it1 = NULL, *it2 = NULL;
	int depth = 0;

	it1 = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	it2 = elm_genlist_item_append(genlist, &itc, NULL, it1, ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
	depth = elm_genlist_item_expanded_depth_get(it2);
	if (!depth) {
		tet_infoline("elm_genlist_item_expanded_depth_get() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
コード例 #5
0
ファイル: highscores.c プロジェクト: MichalJagiello/memory
void _show_hs(void *data, Evas_Object *obj, void *event_info)
{
	elm_genlist_clear(highscores_genlist);
	if(!_itc)
	{
		_itc = elm_genlist_item_class_new();
        _itc->item_style = "default";
        _itc->func.text_get = _item_label_get;
        _itc->func.content_get = NULL;
        _itc->func.state_get = NULL;
        _itc->func.del = NULL;
	}

	Eet_File *eef = eet_open(RESULTS_FILE, EET_FILE_MODE_READ);
	int game_type = (int)(uintptr_t)(data);
	int j = 0;
	for(; j < 10; ++j)
	{
		char buf[50];
		int *res;
		sprintf(buf, "%d%d", game_type, j);
			
		res = eet_read(eef, buf, NULL);
		if(res && res[0] != -1)
		{
			elm_genlist_item_append(highscores_genlist, _itc, res, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
		}
	}
		//free(res); //MEMORY LEAK?
	
	eet_close(eef);
}
コード例 #6
0
Elm_Object_Item *
contact_list_item_add(struct ContactListData *list_data,
		      GHashTable *entry, int sortin)
{
	GHashTable *other;
	Elm_Object_Item *glit;

	if (sortin) {
		/* find the correct position to insert the new one */
		glit = elm_genlist_first_item_get(list_data->list);
		while (glit) {
			other = (GHashTable *)elm_object_item_data_get(glit);
			if (phoneui_utils_contact_compare(entry, other) < 0)
				break;
			glit = elm_genlist_item_next_get(glit);
		}
		if (glit) {
			return elm_genlist_item_insert_before(list_data->list,
					&itc, g_hash_table_ref(entry), NULL, glit,
					ELM_GENLIST_ITEM_NONE, NULL, NULL);
		}
	}
	return elm_genlist_item_append(list_data->list, &itc,
				     g_hash_table_ref(entry) /*item data */ ,
				     NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
}
コード例 #7
0
ファイル: entrance_fill.c プロジェクト: Limsik/e17
///////////////// GENLIST /////////////////////////////
static void
_entrance_fill_genlist(Evas_Object *obj, Entrance_Fill *ef, Eina_List *contents, Evas_Smart_Cb func)
{
   Eina_List *l;
   Elm_Genlist_Item_Class *glc;
   void *content;

   if (!ef->glc)
     {
        glc = elm_genlist_item_class_new();
        ef->glc = glc;
     }
   else
     glc = ef->glc;
   glc->item_style = ef->item_style;
   glc->func.text_get = ef->func.text_get;
   glc->func.content_get = ef->func.content_get;
   glc->func.state_get = ef->func.state_get;
   glc->func.del = ef->func.del;


   EINA_LIST_FOREACH(contents, l, content)
      elm_genlist_item_append(obj, glc,
                              content, NULL, ELM_GENLIST_ITEM_NONE,
                              func, content);
}
コード例 #8
0
Elm_Object_Item* common_utils_add_dialogue_separator(Evas_Object* genlist, const char *separator_style)
{
	assertm_if(NULL == genlist, "NULL!!");

	static Elm_Genlist_Item_Class *separator_itc;
	separator_itc = elm_genlist_item_class_new();
	separator_itc->item_style = separator_style;
	separator_itc->func.text_get = NULL;
	separator_itc->func.content_get = NULL;
	separator_itc->func.state_get = NULL;
	separator_itc->func.del = __common_utils_separator_del;

	Elm_Object_Item* sep = elm_genlist_item_append(
					genlist,
					separator_itc,
					separator_itc,
					NULL,
					ELM_GENLIST_ITEM_GROUP,
					NULL,
					NULL);

	assertm_if(NULL == sep, "NULL!!");

	elm_genlist_item_select_mode_set(sep, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);

	return sep;
}
コード例 #9
0
static int viewer_manager_hidden_button_create(Evas_Object* genlist)
{
	__COMMON_FUNC_ENTER__;

	if(NULL != manager_object->item_sep_above_hidden_button ||
		NULL != manager_object->item_sep_below_hidden_button ||
		NULL != manager_object->item_hidden_btn) {

		__COMMON_FUNC_EXIT__;
		return FALSE;
	}

	assertm_if(NULL == genlist, "NULL!!");

	hidden_button_itc.item_style = "dialogue/bg/1icon";
	hidden_button_itc.func.text_get = NULL;
	hidden_button_itc.func.content_get = _gl_hidden_btn_content_get;
	hidden_button_itc.func.state_get = NULL;
	hidden_button_itc.func.del = NULL;

	manager_object->item_sep_above_hidden_button = common_utils_add_dialogue_separator(genlist, "dialogue/separator/20");

	manager_object->item_hidden_btn = elm_genlist_item_append(genlist, &hidden_button_itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, _hidden_button_callback, NULL);
	assertm_if(NULL == manager_object->item_hidden_btn, "NULL!!");

	common_utils_add_dialogue_separator(genlist, "dialogue/separator/end");

	__COMMON_FUNC_EXIT__;
	return TRUE;
}
コード例 #10
0
static int viewer_manager_header_create(Evas_Object* genlist)
{
	__COMMON_FUNC_ENTER__;
	Evas_Object *toggle_btn = NULL;
	manager_object->header_text = g_strdup(sc(PACKAGE, I18N_TYPE_Wi_Fi));

	header_itc_text.item_style = "dialogue/1text.1icon";
	header_itc_text.func.text_get = _gl_header_text_get;
	header_itc_text.func.content_get = _gl_header_content_get;
	header_itc_text.func.state_get = NULL;
	header_itc_text.func.del = _gl_header_del;

	common_utils_add_dialogue_separator(genlist, "dialogue/separator");

	toggle_btn = elm_check_add(genlist);
	elm_object_style_set(toggle_btn, "on&off");
	evas_object_propagate_events_set(toggle_btn, EINA_TRUE);
	elm_check_state_set(toggle_btn, EINA_FALSE);
	evas_object_show(toggle_btn);
	evas_object_ref(toggle_btn);

	assertm_if(NULL != manager_object->item_header, "ERROR!!");
	manager_object->item_header = elm_genlist_item_append(genlist, &header_itc_text, toggle_btn, NULL, ELM_GENLIST_ITEM_NONE, _gl_header_sel_cb, NULL);
	assertm_if(NULL == manager_object->item_header, "NULL!!");

	__COMMON_FUNC_EXIT__;
	return TRUE;
}
コード例 #11
0
 EINA_LIST_FOREACH(lst, itr, idesc)
   {
      if (idesc->as_trash) continue;
      elm_genlist_item_append(cont, itc, idesc, glit,
            idesc->subitems ? ELM_GENLIST_ITEM_TREE : ELM_GENLIST_ITEM_NONE,
            NULL, NULL);
   }
/**
 * @brief Negative test case of ug_init elm_genlist_item_show()
 */
static void utc_UIFW_elm_genlist_item_show_func_02(void)
{
	Elm_Object_Item *it = NULL;

	it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	elm_genlist_item_show(NULL);
	tet_result(TET_PASS);
}
/**
 * @brief Negative test case of ug_init elm_genlist_item_disabled_set()
 */
static void utc_UIFW_elm_genlist_item_disabled_set_func_02(void)
{
	Elm_Object_Item *item = NULL;

	item = elm_genlist_item_append(genlist, &itc, (void *) 0, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	elm_genlist_item_disabled_set(NULL, EINA_FALSE);

	tet_result(TET_PASS);
}
コード例 #14
0
static Elm_Object_Item* oicapp_append_separator(Evas_Object *genlist , oicappData *ad)
{
    Elm_Object_Item *item = NULL;

    item = elm_genlist_item_append(genlist , &ad->itcSeperator , NULL , NULL ,
            ELM_GENLIST_ITEM_NONE , NULL , NULL);
    elm_genlist_item_select_mode_set(item , ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);

    return item;
}
コード例 #15
0
int
main(int argc, char **argv)
{
   Evas_Object *win;

   if (!elm_init(argc, argv)) return -1;

   win = elm_win_util_standard_add("Genlist", "Genlist Basic Tutorial");
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);
   //win 400x400 px
   evas_object_resize(win, 400, 400);

   //GENLIST here
   Evas_Object *list;
   list = elm_genlist_add(win);

   Elm_Genlist_Item_Class *_itc = elm_genlist_item_class_new();
   _itc->item_style        = "default";
   _itc->func.text_get     = _genlist_text_get;
   _itc->func.content_get  = _genlist_content_get;
   _itc->func.state_get    = NULL;
   _itc->func.del          = NULL;

   Elm_Genlist_Item_Class *_itc2 = elm_genlist_item_class_new();
   _itc2->item_style        = "group_index";
   _itc2->func.text_get     = _genlist_text_get;
   _itc2->func.content_get  = _genlist_content_get;
   _itc2->func.state_get    = NULL;
   _itc2->func.del          = NULL;

   int i=0;
   for (i=0; i<20; i++)
     {
        elm_genlist_item_append(
                list,
                _itc,
                (void *)(uintptr_t) i,   // Item data
                NULL,                    // Parent item for trees, NULL if none
                ELM_GENLIST_ITEM_NONE,   // Item type; this is the common one
                _genlist_selected_cb,    // Callback on selection of the item
                _itc2                    // Data for that callback function
                );
     }

   evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, list);
   evas_object_show(list);

   evas_object_show(win);
   elm_run();
   elm_shutdown();
   return 0;
}
コード例 #16
0
static void
_append_cb(void *data, Evas_Object *o, void *event_info)
{
   Evas_Object *list = data;

   elm_genlist_item_append(list, _itc,
                           (void *)(long)nitems++, NULL,
                           ELM_GENLIST_ITEM_NONE,
                           _item_sel_cb, NULL);

}
コード例 #17
0
ファイル: gui.c プロジェクト: shr-project/e-tasks
void save_button_clicked(void *data, Evas_Object *obj, void *event_info)
{
	char te_data[255], *task_entry;
	
	//get task no
	Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list);
	if (item) {
		_Task *tsk = (_Task *)elm_object_item_data_get(item);
		
		//get data from entry
		sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk));
		task_entry = strtok(te_data, "<");
		sprintf(tsk->text, "%s", task_entry);
		
		//save data to database
		update_record(tsk->no);
		elm_genlist_item_update(task_list[tsk->no]);
	}
	else { //add a new record with this data
		time_t curtime;
		struct tm *loctime;
		char dt[6], te_data[255], *task_entry;
		int i = total_tasks;

		total_tasks ++;
		
		//get the time
		curtime = time (NULL);
		loctime = localtime (&curtime);
		strftime(dt, 6, "%d-%m", loctime);

		Task[i].no = i;
		Task[i].cb = 0;
		if (dummy_pr) Task[i].pr = dummy_pr;
		else Task[i].pr = 1;
		//get entry data
		sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk));
		task_entry = strtok(te_data, "<");
		if (strcmp(task_entry, "") !=0) strcpy(Task[i].text, task_entry);
		else strcpy(Task[i].text, "Task");
		//set current date
		if (strcmp(dummy_date, "") != 0) strcpy(Task[i].date, dummy_date);
		else strcpy(Task[i].date, dt);
		if(strcmp(sel_category, " All Tasks ")==0) strcpy(Task[i].cat, "Personal");
		else strcpy(Task[i].cat, sel_category);
		task_list[i] = elm_genlist_item_append(list, &itc1, &Task[i], NULL, ELM_GENLIST_ITEM_NONE,
							 	 	NULL, NULL);
		last_rec = -1;
		//insert record
		insert_record(i);
		elm_genlist_item_selected_set(task_list[i], 1);
	}
}
コード例 #18
0
static Eina_Bool
_page_populate(void *data)
{
   Page *page = data;
   const Page_Class *cls = page->cls;
   unsigned int count;

   page->od_to_list_item = eina_hash_pointer_new(NULL);

   for (count = 0; count < cls->populate_iteration_count; count++)
     {
        Elm_Genlist_Item *it;
        char letter;
        void *id, *od;
        const char **letter_str;

        if (!eina_iterator_next(page->iterator, &id)) goto end;
        // TODO: evaluate if we should keep a full copy or just store
        // fields of interest such as id, title, artist and album
        od = cls->data_from_itr(id);
        if (!od) goto end;

        it = elm_genlist_item_append
          (page->list, cls->item_cls, od,
           NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);

        letter_str = (const char **)(((char *)od) + cls->data_letter_offset);

        letter = toupper((*letter_str)[0]);
        if ((page->index) &&
            (isalpha(letter) && (page->last_index_letter[0] != letter)))
          {
             if ((page->first) && (!page->last_index_letter[0]))
               elm_index_item_append(page->index, "Special", page->first);

             page->last_index_letter[0] = letter;
             elm_index_item_append(page->index, page->last_index_letter, it);
          }
        if (!page->first) page->first = it;
        eina_hash_set(page->od_to_list_item, od, it);
        page->num_elements++;
     }

   return EINA_TRUE;

 end:
   if (cls->after_populate)
     cls->after_populate(page);

   page->populate = NULL;
   return EINA_FALSE;
}
コード例 #19
0
static Elm_Object_Item* _gl_append_btn(oicappData *ad , Elm_Genlist_Item_Class *itc)
{

    DBG("btn create!!");
    Elm_Object_Item *item;

    item = elm_genlist_item_append(ad->genlist , itc , ad , NULL , ELM_GENLIST_ITEM_NONE , NULL ,
            NULL);

    elm_genlist_item_select_mode_set(item , ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);

    return item;
}
コード例 #20
0
static void
_genlist_fill(Evas_Object *list)
{
    int i;

    for (i = 0; i < N_ITEMS; i++)
    {
        elm_genlist_item_append(list, _itc,
                                (void *)(long)i, NULL,
                                ELM_GENLIST_ITEM_NONE,
                                _item_sel_cb, NULL);
    }
}
コード例 #21
0
void GenlistItemBase::Append(Evas_Object *_genlist, GenlistItemBase *gparent)
{
    genlist = _genlist;
    item = elm_genlist_item_append(genlist,
                                   &item_class,
                                   this,
                                   (gparent)?gparent->item:NULL, /* parent item */
                                   flags,
                                   _item_sel_cb, /* select function */
                                   this); /* select function data */
    elm_object_item_data_set(item, this);
    itemAdded();
}
コード例 #22
0
void Browser_Settings_Website_Setting::_refresh_details_list(website_setting_item *item_info)
{
	elm_genlist_clear(m_details_genlist);

	if (item_info->geolocation) {
		m_location_item_callback_data.type = BR_MENU_LOCATION;
		m_location_item_callback_data.cp = this;
		m_location_item_callback_data.user_data = item_info;
		m_location_item_callback_data.it = elm_genlist_item_append(m_details_genlist,
			&m_1_text_1_icon_item_class, &m_location_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
			__details_item_selected_cb, &m_location_item_callback_data);
	}

	if (item_info->storage) {
		m_web_storage_item_callback_data.type = BR_MENU_WEB_STORAGE;
		m_web_storage_item_callback_data.cp = this;
		m_web_storage_item_callback_data.user_data = item_info;
		m_web_storage_item_callback_data.it = elm_genlist_item_append(m_details_genlist,
				&m_1_text_1_icon_item_class, &m_web_storage_item_callback_data, NULL, ELM_GENLIST_ITEM_NONE,
				__details_item_selected_cb, &m_web_storage_item_callback_data);
	}
}
コード例 #23
0
static int viewer_manager_bottom_create(Evas_Object* genlist)
{
	__COMMON_FUNC_ENTER__;
	assertm_if(NULL == genlist, "NULL!!");

	bottom_itc.item_style = "grouptitle.dialogue.seperator";
	bottom_itc.func.text_get = NULL;
	bottom_itc.func.content_get = NULL;
	bottom_itc.func.state_get = NULL;
	bottom_itc.func.del = NULL;

	bottom_itc_text.item_style = "dialogue/1text.1icon";
	bottom_itc_text.func.text_get = _gl_bottom_text_get;
	bottom_itc_text.func.content_get = _gl_bottom_content_get;
	bottom_itc_text.func.state_get = NULL;
	bottom_itc_text.func.del = NULL;

	bottom_itc_helper_text.item_style = "multiline/1text";
	bottom_itc_helper_text.func.text_get = _gl_bottom_helper_text_get;
	bottom_itc_helper_text.func.content_get = NULL;
	bottom_itc_helper_text.func.state_get = NULL;
	bottom_itc_helper_text.func.del = NULL;

	Elm_Object_Item* dialoguegroup = elm_genlist_item_append(genlist, &bottom_itc, NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
	assertm_if(NULL == dialoguegroup, "NULL!!");
	elm_genlist_item_select_mode_set(dialoguegroup, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);

	manager_object->item_bottom = elm_genlist_item_append(genlist, &bottom_itc_text, NULL, NULL, ELM_GENLIST_ITEM_NONE, _gl_bottom_sel_cb, NULL);
	assertm_if(NULL == manager_object->item_bottom, "NULL!!");

	elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
	manager_object->item_bottom_helper_txt = elm_genlist_item_append(genlist, &bottom_itc_helper_text, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	elm_genlist_item_select_mode_set(manager_object->item_bottom_helper_txt, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);

	__COMMON_FUNC_EXIT__;

	return TRUE;
}
コード例 #24
0
ファイル: view-main.c プロジェクト: gudbooy/tizentetheredwifi
static bool view_main_wifi_insert_found_ap(wifi_device_info_t *wifi_device)
{
	devpkr_gl_data_t *gdata = g_try_new0(devpkr_gl_data_t, 1);
	wifi_connection_state_e state;

	assertm_if(NULL == list, "list is NULL");

	if (gdata == NULL)
		return false;

	gdata->dev_info = wifi_device;
	if (gdata->dev_info == NULL) {
		g_free(gdata);
		return true;
	}

	wifi_ap_get_connection_state(wifi_device->ap, &state);

	if (WIFI_CONNECTION_STATE_ASSOCIATION == state ||
			WIFI_CONNECTION_STATE_CONFIGURATION == state) {
		gdata->connection_mode = ITEM_CONNECTION_MODE_CONNECTING;
		gdata->it = elm_genlist_item_append(list, &itc, gdata,
				NULL, ELM_GENLIST_ITEM_NONE, __gl_sel,
				gdata);
		view_main_state_set(ITEM_CONNECTION_MODE_CONNECTING);

		return true;
	}

	gdata->connection_mode = ITEM_CONNECTION_MODE_OFF;

	gdata->it = elm_genlist_item_append(list, &itc, gdata, NULL,
			ELM_GENLIST_ITEM_NONE, __gl_sel, gdata);

	return true;
}
コード例 #25
0
ファイル: test_panel.cpp プロジェクト: Limsik/e17
static void _fill_list (Evasxx::Object *obj)
{
  DIR *d;
  struct dirent *de;
  Eina_List *dirs = NULL, *l;
  char *real;

  if (!(d = opendir(getenv("HOME")))) return;
  while ((de = readdir(d)) != NULL)
  {
    char buff[PATH_MAX];

    if (de->d_name[0] == '.') continue;
    snprintf(buff, sizeof(buff), "%s/%s", getenv("HOME"), de->d_name);
    if (!ecore_file_is_dir(buff)) continue;
    real = ecore_file_realpath(buff);
    dirs = eina_list_append(dirs, real);
  }
  closedir(d);

  dirs = eina_list_sort(dirs, eina_list_count(dirs), EINA_COMPARE_CB(strcoll));
#if 0
   EINA_LIST_FOREACH(dirs, l, real)
     {
        Eina_Bool result = EINA_FALSE;

        result = _dir_has_subs(real);
        if (!result)
          elm_genlist_item_append(obj, &itc, eina_stringshare_add(real),
                                  NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
        else
          elm_genlist_item_append(obj, &itc, eina_stringshare_add(real),
                                  NULL, ELM_GENLIST_ITEM_TREE,
                                  NULL, NULL);
        free(real);
     }
コード例 #26
0
ファイル: gui.c プロジェクト: shr-project/e-tasks
void cat_dialog_add(void *data, Evas_Object *obj, void *event_info)
{
	char *ty, *ty_data;
	Evas_Object *en = data;

	//get data from entry and add to category table
	char *_cat = (char *)elm_entry_entry_get(en);
	ty = strtok(_cat, "<");
	if (strcmp(ty, "") == 0) return;
	ty_data = strdup(ty);
	add_category(ty);
	elm_genlist_item_append(cat_list, &itc2, ty_data, NULL, ELM_GENLIST_ITEM_NONE,
								  NULL, NULL);
	evas_object_del(cat_dialog);
	create_cat_hover ();
}
/**
 * @brief Positive test case of elm_genlist_item_disabled_set()
 */
static void utc_UIFW_elm_genlist_item_disabled_set_func_01(void)
{
	Elm_Object_Item *item = NULL;
	Eina_Bool ret = EINA_FALSE;

	item = elm_genlist_item_append(genlist, &itc, (void *) 0, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
	elm_genlist_item_disabled_set(item, EINA_TRUE);

	ret = elm_genlist_item_disabled_get(item);

	if (!ret) {
		tet_infoline("elm_genlist_item_disabled_set() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
コード例 #28
0
ファイル: gui.c プロジェクト: shr-project/e-tasks
void create_new_task(void *data, Evas_Object *obj, void *event_info)
{
	int i = total_tasks;
	total_tasks ++;

	if(strcmp(sel_category, "Deleted") == 0) {
		purge_tasks();
		elm_genlist_clear(list);
		return;
	}
	time_t curtime;
	struct tm *loctime;
	char dt[6];
	
	//get the time
	curtime = time (NULL);
	loctime = localtime (&curtime);
	strftime(dt, 6, "%d-%m", loctime);
	
	//get selected task if any
	Evas_Object *li = data;
	Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(li);
	if (!item) item = elm_genlist_last_item_get(list);	//insert new line at end of list

	Task[i].no = i;
	Task[i].cb = 0;
	Task[i].pr = 1;
	strcpy(Task[i].text, "Task");
	strcpy(Task[i].date, dt);
	if(strcmp(sel_category, " All Tasks ")==0) strcpy(Task[i].cat, "Personal");
	else strcpy(Task[i].cat, sel_category);
	if(item) { 
		task_list[i] = elm_genlist_item_insert_after(list, &itc1, &Task[i], NULL, item, ELM_GENLIST_ITEM_NONE,
								  NULL, NULL);
	}
	//cater for no items in list
	else task_list[i] = elm_genlist_item_append(list, &itc1, &Task[i], NULL, ELM_GENLIST_ITEM_NONE,
								  NULL, NULL);
	last_rec = -1;
	WRITE = 0;
	//insert record
	//printf("total %d\n", i);
	insert_record(i);
	elm_genlist_item_selected_set(task_list[i], 1);
}
コード例 #29
0
ファイル: view-main.c プロジェクト: gudbooy/tizentetheredwifi
static void view_main_add_group_title(void)
{
	grouptitle_itc.item_style = "groupindex";
	grouptitle_itc.func.text_get = _gl_text_title_get;
	grouptitle_itc.func.content_get = _gl_content_title_get;

	grouptitle = elm_genlist_item_append(list,
			&grouptitle_itc,
			NULL,
			NULL,
			ELM_GENLIST_ITEM_NONE,
			NULL,
			NULL);
	assertm_if(NULL == grouptitle, "NULL!!");

	elm_genlist_item_select_mode_set(grouptitle,
			ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
コード例 #30
0
static Elm_Object_Item* _gl_append_item(oicappData *ad , Elm_Genlist_Item_Class *itc ,
        const char *title , Evas_Smart_Cb sel_func)
{
    Elm_Object_Item *item;
    oicappItemData *it_data;

    it_data = calloc(1 , sizeof(oicappItemData));
    if (NULL == it_data)
    {
        DBG("calloc failed!!!!");
        return NULL;
    }
    it_data->title = title;
    it_data->ad = ad;
    item = elm_genlist_item_append(ad->genlist , itc , it_data , NULL , ELM_GENLIST_ITEM_NONE ,
            sel_func , ad);

    return item;
}