Exemplo n.º 1
0
void det_page_done(void *data, Evas_Object *obj, void *event_info)
{
	char te_data[255], *task_entry;
	_Task *tsk = (_Task *)data;
	
	sprintf(te_data, "%s", (const char *)elm_entry_entry_get(entry));
	task_entry = strtok(te_data, "<");
	if(strcmp(task_entry, tsk->text)!=0) {
		sprintf(tsk->text, "%s", task_entry);
		WRITE = 1;
	}

	sprintf(te_data, "%s", (const char *)elm_entry_entry_get(note_entry));
	task_entry = strtok(te_data, "<");
	if(strcmp(task_entry, "Note") == 0) task_entry = "";
	if(strcmp(task_entry, tsk->note)!=0) {
		sprintf(tsk->note, "%s", task_entry);
		WRITE = 1;
	}
	
	if(WRITE) {
		WRITE = 0;
		update_record (tsk->no);
		Elm_Object_Item *item;
		item = (Elm_Object_Item *)elm_genlist_selected_item_get(list);
		if(item) elm_genlist_item_update(task_list[tsk->no]);
		last_rec = -1;
		item = elm_genlist_first_item_get(list);
		if(item) elm_genlist_item_selected_set(item ,1);
	}
	cat_win_del(det_page, NULL, NULL);
}
Exemplo n.º 2
0
void _connect_button_click_cb(void *data, Evas_Object *connect_button, void *ev) {
   int check = -1;
   //int autoCheck =0;
   char ip_final[16] = { 0, };

   ipEntry_1 = elm_entry_entry_get(ipEntry1);
   ipEntry_2 = elm_entry_entry_get(ipEntry2);
   ipEntry_3 = elm_entry_entry_get(ipEntry3);
   ipEntry_4 = elm_entry_entry_get(ipEntry4);

   strcpy(ip_final, ipEntry_1);
   strcat(ip_final, ".");
   strcat(ip_final, ipEntry_2);
   strcat(ip_final, ".");
   strcat(ip_final, ipEntry_3);
   strcat(ip_final, ".");
   strcat(ip_final, ipEntry_4);

   port_final = elm_entry_entry_get(portEntry);

   //dlog_print(DLOG_DEBUG, "IP", ip_final);
   //dlog_print(DLOG_DEBUG, "PORT", port_final);

   check = inputIP(&ip_final);
   initiate();

   if(check == 2){
      elm_object_text_set(connect_button, "Connected");
   }

   remote_control_cb(1);

}
Exemplo n.º 3
0
static void
_on_ok_dialog_clicked (
        void *data,
        Evas_Object *obj,
        void *event_info)
{
    const gchar *username = NULL;
    const gchar *password = NULL;

    if (main_dialog) {
        RequestType req_type = main_dialog->req_type;
        if (main_dialog->username_entry)
            username = elm_entry_entry_get (main_dialog->username_entry);
        if (main_dialog->password_entry)
            password = elm_entry_entry_get (main_dialog->password_entry);

        _close_dialog ();

        if (main_window && main_window->use_nfc_tag)
            return;

        if (!username || !password) {
            WARN ("Invalid username/password");
            return;
        }

        _trigger_dbus_request (req_type, username, password);
    }
}
/* 누르면 뿅뿅 글자가 나타나게 할 것이다! */
static void
img_clicked_0_cb(void *data, Evas_Object *obj, void *event_info)
{
	Evas_Object *entry = data;

	if(confirm_flag == READY_TO_CONFIRM)
	{
		/*if(inout_flag == INCOME)
			elm_entry_text_style_user_push(entry, "DEFAULT='font_size=40 color=#4cffba align=center'");
		else if(inout_flag == OUTGO)
			elm_entry_text_style_user_push(entry, "DEFAULT='font_size=40 color=#ffffff align=center'");*/

		elm_entry_text_style_user_push(entry, "DEFAULT='font_size=40 color=#ffffff align=center'");

		confirm_flag = DEFAULT;

		return;
	}

	if( (strdup( elm_entry_entry_get(entry)))[0] != '0' && strlen( strdup( elm_entry_entry_get(entry))) != 0)
	{
		if( strlen( strdup( elm_entry_entry_get(entry) ) ) < 8)
		{
			elm_entry_entry_append(entry, "0");
			adjust_string(entry);
		}
	}
}
Exemplo n.º 5
0
void save_bookmark(void *data, Evas_Object *obj, void *event_info)
{
	char temp[255], ty[255];

	sprintf(temp, "%s", elm_entry_entry_get(name_en));
	sprintf(ty, "%s", elm_entry_entry_get(url_en));
	add_bookmark_db(temp, ty);
	evas_object_del(add_bookmark_win);
}
Exemplo n.º 6
0
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);
	}
}
Exemplo n.º 7
0
SH_API void
entry_callback(void *data, Evas_Object *obj, void *event_info)
{
  Evas_Object *entry = data;

  if (elm_entry_entry_get(entry))
    {
      char *s;
      s = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
      printf(s);
      E_FREE(s);
    }
  elm_exit();
}
static void
_insert_contacts_add_number_callback(const char *number, void *data)
{
	char *content;
	struct MessageNewViewData *view;
	int len;

	view = (struct MessageNewViewData *)data;
	content = elm_entry_markup_to_utf8(elm_entry_entry_get(view->content_entry));
	len = phone_utils_gsm_sms_strlen(content);

	// Make space for text, number and ending null character
	content = realloc(content, len + strlen(number) + 1);
	// Add the number to the end of the content
	sprintf(content + len, "%s ", number);

	if (view->content) {
		free(view->content);
	}
	view->content = content;

	if (view->content != NULL) {
		elm_entry_entry_set(view->content_entry,
				    elm_entry_utf8_to_markup(view->content));
	}
}
Exemplo n.º 9
0
/* important notice: not sure how sms split is handled,
 * iirc at a certain point msg lens are not the same as before,
 * not 100% sure. should verify
 */
static void
frame_content_content_changed(struct MessageNewViewData *data,
			      Evas_Object * obj, void *event_info)
{

	char *content = g_strstrip(strdup(elm_entry_entry_get(data->entry)));
	int limit;		/* the limit of the sms */
	int len;		/* the number of characters in the sms */
	int size;		/* the "memory" size of the sms */
	char text[64];

	string_strip_html(content);

	//g_debug("content: %s", content);


	for (size = 0, len = 0; content[size]; len++)
		evas_common_font_utf8_get_next((unsigned char *) content,
					       &size);

	/* if it includes chars that can't be represented
	 * with 7bit encoding, this sms will be sent as ucs-2 treat
	 * it this way! */
	if (size > len)
		limit = 70;	/* ucs-2 number of chars limit */
	else
		limit = 160;	/* regular number of chars limit */


	/*FIXME: BAD BAD BAD! will cause an overflow when using a long translation!!! */
	sprintf(text, D_("%d characters left [%d]"), limit - (len % limit),
		(len / limit) + 1);
	window_text_set(data->win, "characters_left", text);
	free(content);
}
Exemplo n.º 10
0
static void
frame_number_add_add_clicked(struct MessageNewViewData *data, Evas_Object * obj,
			     void *event_info)
{
	char *number = strdup(elm_entry_entry_get(data->entry));
	string_strip_html(number);

	if (string_is_number(number)) {
		GHashTable *properties =
			g_hash_table_new(g_str_hash, g_str_equal);
		char *name = phonegui_contact_cache_lookup(number);
		if (!name || !*name)
			name = "Number";
		g_hash_table_insert(properties, strdup("name"), strdup(name));
		g_hash_table_insert(properties, strdup("number"),
				    strdup(number));
		g_ptr_array_add(data->recipients, properties);

		data->mode = MODE_RECIPIENT;
		window_frame_show(data->win, data, frame_recipient_show,
				  frame_recipient_hide);
	}

	free(number);
}
Exemplo n.º 11
0
/**
 * @brief Cuts text content from entry to clipboard
 *
 * @param text an AtkEditableText
 * @param start_pos start position of cursor
 * @param end_pos end position of cursor
 */
static void
eail_multibuttonentry_cut_text(AtkEditableText *text,
                    gint             start_pos,
                    gint             end_pos)
{
   Evas_Object *widget;
   Evas_Object *entry;
   const char *entry_text;
   char *tmp;
   GString *s;


   widget = eail_widget_get_widget(EAIL_WIDGET(text));
   if (!widget || !elm_multibuttonentry_editable_get(widget)) return;

   entry = elm_multibuttonentry_entry_get(widget);
   entry_text = elm_entry_entry_get(entry);
   tmp = eail_get_substring(entry_text, start_pos, end_pos);
   eail_clipboard_set_text(tmp);
   g_free(tmp);

   s = g_string_new(entry_text);
   s = g_string_erase(s, start_pos, end_pos - start_pos);

   elm_entry_entry_set(entry, s->str);
   g_string_free(s, TRUE);
}
Exemplo n.º 12
0
	void checkEmoticon(const string& expected)
	{
		const char* actual_ = elm_entry_entry_get(control_);
		string actual = actual_ != NULL ? actual_ : "";

		FAIL_UNLESS_EQUAL(actual, expected);
	}
static void entry_activated_cb(void *data, Evas_Object *obj, void *event_info)
{
    char *commit_str = (char *)event_info;
    const char* text = elm_entry_entry_get(obj);
    editBoxCallbackFunc(text, data);
    elm_entry_input_panel_hide(obj);
    evas_object_del(s_keypadWin);
    s_keypadWin = nullptr;
}
Exemplo n.º 14
0
void goto_url(void *data, Evas_Object *obj, void *event_info)
{
	Evas_Object *en = data;
	char url[255];

	//TODO: Add error window for exception
	sprintf(url, "%s%s", url_pre, elm_entry_entry_get(en));
	printf("%s\n", url);
	ewk_webview_object_load_url(view, url);
	evas_object_hide(url_notify);
}
Exemplo n.º 15
0
static void
_account_set_apply_cb(void *data, Evas_Object *obj, void *event_info)
{
   if (enlil_data->library)
   {
      enlil_library_netsync_account_set(enlil_data->library,
                                        elm_entry_entry_get(data));
      //enlil_library_flickr_auth_token_set(enlil_data->library, NULL);
      enlil_flickr_job_reinit_prepend(enlil_data->library);
   }
   evas_object_del(set_account.inwin);
}
Exemplo n.º 16
0
static void
on_number_ok(void *data, Evas_Object *obj, void *event_info)
{
   const char *n = elm_entry_entry_get(number_entry);
   if (number) free(number);
   if (n) number = strdup(n);
   else number = NULL;
   elm_photo_file_set(write_ph, NULL);
   elm_label_label_set(write_lb, number);
   evas_object_del(inwin2);
   inwin2 = NULL;
}
Exemplo n.º 17
0
void note_done(void *data, Evas_Object *obj, void *event_info)
{
	char tystr[255];
	//Evas_Object *en = data;
	
	Elm_Object_Item *item = (Elm_Object_Item *)elm_genlist_selected_item_get(list);
	_Task *tsk = (_Task *)elm_object_item_data_get(item);
	sprintf(tystr, "%s", elm_entry_entry_get(data));
	if (strcmp(tystr, "<br>") == 0) strcpy(tystr, "");
	strcpy(tsk->note, tystr);
	save_note(tystr, tsk->no);
	elm_genlist_item_update(item);
	cat_win_del (note_win, NULL, NULL);
}
Exemplo n.º 18
0
static void
frame_content_continue_clicked(struct MessageNewViewData *data,
			       Evas_Object * obj, void *event_info)
{
	char *content =
		g_strstrip(elm_entry_markup_to_utf8
			   (elm_entry_entry_get(data->entry)));
	if (strlen(content) == 0) {
		//TODO: display notify about sending blank message
	}
	data->mode = MODE_RECIPIENT;
	window_frame_show(data->win, data, frame_recipient_show,
			  frame_recipient_hide);
	free(content);
}
Exemplo n.º 19
0
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 ();
}
Exemplo n.º 20
0
static void
_account_set_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
   const char *s = elm_entry_entry_get(obj);

   if (strlen(s) == 11 && s[0] >= 48 && s[0] <= 57 && s[1] >= 48 && s[1] <= 57
            && s[2] >= 48 && s[2] <= 57 && s[4] >= 48 && s[4] <= 57 && s[5]
            >= 48 && s[5] <= 57 && s[6] >= 48 && s[6] <= 57 && s[8] >= 48
            && s[8] <= 57 && s[9] >= 48 && s[9] <= 57 && s[10] >= 48 && s[10]
            <= 57 && s[3] == '-' && s[7] == '-')
   {
      elm_object_disabled_set(data, EINA_FALSE);
   }
   else
      elm_object_disabled_set(data, EINA_TRUE);
}
Exemplo n.º 21
0
static void
frame_content_hide(struct MessageNewViewData *data)
{
	struct Window *win = data->win;

	// Save content
	data->content =
		g_strstrip(elm_entry_markup_to_utf8
			   (elm_entry_entry_get(data->entry)));

	// Free objects
	evas_object_del(data->bt1);
	evas_object_del(data->bt2);
	evas_object_del(data->entry);
	evas_object_del(data->sc);

	window_kbd_hide(win);
}
Exemplo n.º 22
0
/**
 * @brief Deletes text between start_pos and end_pos but not
 * including end_pos
 *
 * @param text an AtkEditableText
 * @param start_pos start position
 * @param end_pos end position
 */
static void
eail_multibuttonentry_delete_text(AtkEditableText *text,
                       gint start_pos,
                       gint end_pos)
{
   Evas_Object *widget;
   Evas_Object *entry;
   GString *s;

   widget = eail_widget_get_widget(EAIL_WIDGET(text));
   if (!widget || !elm_multibuttonentry_editable_get(widget)) return;

   entry = elm_multibuttonentry_entry_get(widget);
   s = g_string_new(elm_entry_entry_get(entry));
   s = g_string_erase(s, start_pos, end_pos-start_pos);
   elm_entry_entry_set(entry, s->str);
   g_string_free(s, TRUE);
}
Exemplo n.º 23
0
static Eina_Bool
elm_prefs_entry_value_validate(Evas_Object *obj)
{
   Ecore_Timer *timer;
   const char *val;
   regex_t *regex;
   size_t min;

   val = elm_entry_entry_get(obj);
   if (!val) return EINA_FALSE;

   regex = evas_object_data_get(obj, "accept_regex");
   if (regex)
     {
        if (regexec(regex, val, 0, NULL, 0)) goto mismatch;
     }

   regex = evas_object_data_get(obj, "deny_regex");
   if (regex)
     {
        /* we want tokens *out* of the deny language */
        if (!regexec(regex, val, 0, NULL, 0)) goto mismatch;
     }

   min = (size_t) evas_object_data_get(obj, "min_size");
   if (min)
     {
        if (strlen(val) < min) goto mismatch;
     }

   return EINA_TRUE;

mismatch:
   evas_object_color_set(obj, 255, 0, 0, 255);

   timer = evas_object_data_get(obj, "timer");
   if (timer) ecore_timer_del(timer);

   evas_object_data_set
     (obj, "timer", ecore_timer_add(BLINK_INTERVAL, _color_change_do, obj));

   return EINA_FALSE;
}
Exemplo n.º 24
0
/**
 * @brief Pastes text content from clipboard into entry
 *
 * @param text an AtkEditableText
 * @param position start position of cursor
 */
static void
eail_multibuttonentry_paste_text(AtkEditableText *text,
                                 gint position)
{
   Evas_Object *widget;
   Evas_Object *entry = NULL;
   GString *s;
   const char *tmp;

   widget = eail_widget_get_widget(EAIL_WIDGET(text));
   if (!widget || !elm_multibuttonentry_editable_get(entry))
     return;

   entry = elm_multibuttonentry_entry_get(widget);
   s = g_string_new(elm_entry_entry_get(entry));
   tmp = eail_clipboard_get_text();
   s = g_string_insert(s, position, tmp);
   elm_entry_entry_set(entry, s->str);
   g_string_free(s, TRUE);
}
Exemplo n.º 25
0
/**
 * @brief Copies text content from entry to clipboard
 *
 * @param text an AtkEditableText
 * @param start_pos start position of cursor
 * @param end_pos end position of cursor
 */
static void
eail_multibuttonentry_copy_text(AtkEditableText *text,
                     gint             start_pos,
                     gint             end_pos)
{
   Evas_Object *widget;
   Evas_Object *entry;
   const char *entry_text;
   char *tmp;


   widget = eail_widget_get_widget(EAIL_WIDGET(text));
   if (!widget) return;

   entry = elm_multibuttonentry_entry_get(widget);
   entry_text = elm_entry_entry_get(entry);
   tmp = eail_get_substring(entry_text, start_pos, end_pos);
   eail_clipboard_set_text(tmp);
   g_free(tmp);
}
Exemplo n.º 26
0
static void
on_edit(void *data, Evas_Object *obj, void *event_info)
{
   const char *text;
   char buf[256], *text2;
   int len;
   
   text = elm_entry_entry_get(sms_entry);
   if (!text) return;
   text2 = elm_entry_markup_to_utf8(text);
   if (!text2) return;
   len = strlen(text2);
   if (len > 0)
     {
        if (text2[len - 1] == '\n') text2[len - 1] = 0;
     }
   len = strlen(text2);
   free(text2);
   snprintf(buf, sizeof(buf), "%i", len);
   elm_label_label_set(write_stat, buf);
}
Exemplo n.º 27
0
/**
 * @brief Inserts text at given position
 *
 * @param text an AtkEditableText
 * @param string string to insert
 * @param length string length
 * @param [out] position at witch text is inserted.
 * After the call it points at the position after the newly inserted text.
 */
static void
eail_multibuttonentry_insert_text(AtkEditableText *text,
                       const gchar *string,
                       gint length,
                       gint *position)
{
   Evas_Object *widget;
   Evas_Object *entry;
   GString *s;

   widget = eail_widget_get_widget(EAIL_WIDGET(text));
   if (!widget || !elm_multibuttonentry_editable_get(widget))
     return;

   entry = elm_multibuttonentry_entry_get(widget);
   s = g_string_new(elm_entry_entry_get(entry));
   s = g_string_insert_len(s, *position, string, length);
   elm_entry_entry_set(entry, s->str);
   g_string_free(s, TRUE);
   *position += length;
}
Exemplo n.º 28
0
/**
 * @brief Helper function for getting multibuttonentry text
 *
 * @param text an AtkText (EailMultibutton object)
 *
 * @return string representation of multibutton entry text
 */
static const gchar*
_eail_multibuttonentry_get_entry_string(AtkText *text)
{
   const gchar *string = NULL;
   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));
   Evas_Object *entry = elm_multibuttonentry_entry_get(widget);

   if (entry)
     string = elm_entry_entry_get(entry);

   /* if entry string is empty then trying to return "guide" part*/
   if (!string || 0 == g_strcmp0(string, ""))
     {
        /* If there are some children of widget, then it means that guide
         * is not visible. So returning guide as text only if no children
         * exist */
        if (!elm_multibuttonentry_items_get(widget))
          string = elm_object_part_text_get(widget, "guide");
     }

   return string;
}
static void
delete_string(Evas_Object *entry)
{
	const char *temp;
	char *ch = NULL;
	char tempCh;
	int len;
	int i, j = 0;

	temp = elm_entry_entry_get(entry);
	if (!temp) return;
	ch = strdup(temp);

	len = strlen(ch);

	if (len > 0)
	{
		ch[len-1] = ch[len];
		elm_entry_entry_set(entry, ch);
	}
	else
		elm_entry_entry_set(entry, "");
}
Exemplo n.º 30
0
 void task_select(void *data, Evas_Object *obj, void *event_info)
{
	char tystr[2];
	char te_data[255], *task_entry;
	Elm_Object_Item *item;
	_Task *tsk=NULL;

	//for entries, get entry data and check agianst previous task text, date
	//if changed - write
	if (last_rec != -1) { //cater for initial null data
		sprintf(te_data, "%s", (const char *)elm_entry_entry_get(tk));
		task_entry = strtok(te_data, "<");
		tsk = (_Task *)elm_object_item_data_get(task_list[last_rec]);
		if (strcmp(task_entry, tsk->text) != 0) {
			sprintf(tsk->text, "%s", task_entry);
			WRITE = 1;
		}
	}
	
	if (WRITE == 1) {
		elm_genlist_item_update(task_list[last_rec]);
		update_record(tsk->no);
		WRITE = 0;
	}
	
	Evas_Object *li = data;
	item = (Elm_Object_Item *)elm_genlist_selected_item_get(li);
	tsk = (_Task *)elm_object_item_data_get(item);
	last_rec = tsk->no;
	elm_object_text_set(cat_bt, tsk->cat);
	sprintf(tystr, "%d", tsk->pr);
	elm_object_text_set(pr_bt, tystr);
	elm_object_text_set(date_bt, tsk->date);
	elm_entry_entry_set(tk, tsk->text);
	if (strcmp(tsk->text, "Task") == 0) elm_entry_select_all(tk);
}