示例#1
0
static void
_dialog_create_folder_ok_clicked_cb(void *data, Evas_Object *btn, void *ev)
{
   Enna_Localfiles_Priv *priv = data;
   Enna_File *file;
   Evas_Object *entry;
   const char *new_name;
   const char *new_path;
   char uri[4096];

   file = evas_object_data_get(priv->dialog, "file");
   entry = evas_object_data_get(priv->dialog, "entry");
   new_name = elm_object_text_get(entry);
   new_path = eina_stringshare_printf("%s/%s", ecore_file_dir_get(file->mrl),
                                        new_name);

   if (ecore_file_mkdir(new_name))
       {
           Enna_File *f;
           snprintf(uri, sizeof(uri), "file://%s", new_path);
           printf(" uri : %s\n", uri);
           f = enna_file_directory_add(new_name,
                                       uri,
                                       new_path,
                                       new_name,
                                       "icon/directory");
           enna_browser_file_add(priv->browser, f);
       }

   evas_object_del(priv->dialog);
}
static void
_btn_options_cb(void *data, Evas_Object *btn, void *ev)
{
   char *ptr;
   double t;
   App_Data *app = data;
   const char *lbl = elm_object_text_get(btn);

   ptr = strchr(lbl, ':');
   ptr += 2;
   t = strtod(ptr, NULL);

   if (!strncmp(lbl, "Initial", 7))
     {
        elm_button_autorepeat_initial_timeout_set(app->cursors.up, t);
        elm_button_autorepeat_initial_timeout_set(app->cursors.down, t);
        elm_button_autorepeat_initial_timeout_set(app->cursors.left, t);
        elm_button_autorepeat_initial_timeout_set(app->cursors.right, t);
     }
   else if (!strncmp(lbl, "Gap", 3))
     {
        elm_button_autorepeat_gap_timeout_set(app->cursors.up, t);
        elm_button_autorepeat_gap_timeout_set(app->cursors.down, t);
        elm_button_autorepeat_gap_timeout_set(app->cursors.left, t);
        elm_button_autorepeat_gap_timeout_set(app->cursors.right, t);
     }
}
示例#3
0
文件: browser_bar.c 项目: gzorin/e17
static void
_entry_activated_cb(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *o_layout = data;
    const char *text;

    text = elm_object_text_get(obj);
    evas_object_smart_callback_call(o_layout, "path,changed", (char*)text);
}
static void
_search_prev_cb(void *data, Evas_Object *obj, void *event_info)
{
   App_Data *ad = data;
   const char *text;

   text = elm_object_text_get(ad->search_entry);
   elm_web_text_search(ad->current_tab->web, text, EINA_FALSE, EINA_FALSE,
                       EINA_TRUE);
}
static void
_search_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
   App_Data *ad = data;
   const char *text;

   text = elm_object_text_get(obj);
   elm_web_text_search(ad->current_tab->web, text, EINA_FALSE, EINA_TRUE,
                       EINA_TRUE);
   elm_web_text_matches_unmark_all(ad->current_tab->web);
   elm_web_text_matches_mark(ad->current_tab->web, text, EINA_FALSE, EINA_TRUE,
                             0);
}
示例#6
0
/**
 * @brief Gets text bounded by start_offset and end_offset
 *
 * Use g_free() to free the returned string.
 *
 * @param text AtkText instance
 * @param start_offset start position
 * @param end_offset end position, -1 for the end of the string
 *
 * @return string containing the text from start_offset up to,
 * but not including end_offset
 */
static gchar*
eail_button_get_text(AtkText   *text,
                     gint       start_offset,
                     gint       end_offset)
{
   gchar *string = NULL;
   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));

   if (widget)
     string = (gchar *)elm_object_text_get(widget);

   return eail_get_substring(string, start_offset, end_offset);
}
示例#7
0
/**
 * @brief Gets the character at offset
 *
 * @param text AtkText instance
 * @param offset character offset
 * @returns char representing the character at offset
 */
static gunichar
eail_button_get_character_at_offset(AtkText    *text,
                                    gint        offset)
{
   gunichar character = '\0';
   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));

   if (widget)
     character = g_utf8_get_char(
         g_utf8_offset_to_pointer(elm_object_text_get(widget), offset));

   return character;
}
static void
_url_activated_cb(void *data, Evas_Object *obj, void *event_info)
{
   App_Data *ad = data;
   Tab_Data *td;
   const char *uri = eina_stringshare_ref(elm_object_text_get(obj));

   if (!ad->current_tab)
     td = tab_add(ad);
   else
     td = ad->current_tab;
   tab_uri_set(td, uri);
   eina_stringshare_del(uri);
}
示例#9
0
/**
 * @brief Gets slider name
 *
 * @param obj EailSlider instance
 * @returns accessible name
 */
static const gchar*
eail_progressbar_get_name(AtkObject *obj)
{
   const gchar *name;
   Evas_Object *widget;

   name = ATK_OBJECT_CLASS(eail_progressbar_parent_class)->get_name(obj);
   if (name) return name;

   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
   if (widget)
     name = (const gchar*)elm_object_text_get(widget);

   return name;
}
示例#10
0
static void
_bt_route(void *data, Evas_Object *obj, void *ev)
{
   Example_Data *exam_data = data;
   Evas_Object *map;
   char *address;

   map = exam_data->map;
   address = (char *)elm_object_text_get(exam_data->entry);

   exam_data->name = elm_map_name_add(map, address, 0, 0, NULL, NULL);

   evas_object_smart_callback_add(map, "name,loaded", _name_loaded, data);
   evas_object_smart_callback_add(map, "route,loaded", _route_loaded, data);
}
static void
btn_extension_click_cb(void *data, Evas_Object *btn, void *ev)
{
   const char *lbl = elm_object_text_get(btn);

   if (!strncmp(lbl, "Load", 4))
     {
        elm_theme_extension_add(NULL, "./theme_example.edj");
        elm_object_text_set(btn, "Unload extension");
     }
   else if (!strncmp(lbl, "Unload", 6))
     {
        elm_theme_extension_del(NULL, "./theme_example.edj");
        elm_object_text_set(btn, "Load extension");
     }
}
示例#12
0
/**
 * @brief Gets the text length
 *
 * @param text AtkText instance
 * @returns integer representing the text length
 */
static gint
eail_button_get_character_count(AtkText *text)
{
   gint count = 0;
   const gchar *string_text = NULL;

   Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(text));

   if (!widget) return count;

   string_text = elm_object_text_get(widget);
   if (!string_text) return count;

   count = g_utf8_strlen(string_text, -1);

   return count;
}
示例#13
0
/**
 * @brief Gets the accessible name of obj
 *
 * @param obj AtkObject instance
 *
 * @returns string representing the accessible name of obj
 */
static const gchar*
eail_button_get_name(AtkObject *obj)
{
   Evas_Object *widget;
   const char *atk_name;

   g_return_val_if_fail(EAIL_IS_BUTTON(obj), NULL);

   atk_name = ATK_OBJECT_CLASS(eail_button_parent_class)->get_name(obj);
   if (atk_name)
     return atk_name;

   widget = eail_widget_get_widget(EAIL_WIDGET(obj));
   if (!widget) return NULL;

   return elm_object_text_get(widget);
}
示例#14
0
static void
_dialog_rename_ok_clicked_cb(void *data, Evas_Object *btn, void *ev)
{
   Enna_Localfiles_Priv *priv = data;
   Enna_File *file;
   Evas_Object *entry;
   const char *new_name;
   const char *new_path;


   file = evas_object_data_get(priv->dialog, "file");
   entry = evas_object_data_get(priv->dialog, "entry");
   new_name = elm_object_text_get(entry);
   new_path = eina_stringshare_printf("%s/%s", ecore_file_dir_get(file->mrl),
                                        new_name);

   priv->new_path = new_path;

   if (priv->file_dialog)
     enna_file_free(priv->file_dialog);
   priv->file_dialog = enna_file_ref(file);

   if (file->type == ENNA_FILE_DIRECTORY)
     {
        eio_dir_move(file->mrl,
                     new_path,
                       _dir_filter_cb,
                       _dir_progress_cb,
                       _rename_done_cb,
                       _error_cb,
                       priv);
     }
   else if (file->type == ENNA_FILE_FILE)
     {
        eio_file_move(file->mrl,
                      new_path,
                      _dir_progress_cb,
                      _rename_done_cb,
                      _error_cb,
                        priv);
     }

   evas_object_del(priv->dialog);
}
示例#15
0
文件: main.c 项目: warshall/Raspi
// Button connect pressed
static void
btn_connect(void *data, Evas_Object *obj, void *event)
{

Window *a = data ;


int port = 1234 ;

// Get ip from user
    const char *address = elm_object_text_get(a->ip) ;


// Get port from user
//    int port = atoi(elm_object_text_get(a->port)) ;


// Create connection
    if (!(a->svr = ecore_con_server_connect(ECORE_CON_REMOTE_TCP, address, port, NULL)))
        {
            printf("could not connect to the server: %s, port %d.\n", address, port) ;
            exit(2);
        }


   /* set event handler for server connect */
   ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, a);
   /* set event handler for server disconnect */
   ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL, (Ecore_Event_Handler_Cb)_del, a);
   /* set event handler for receiving server data */
   ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA, (Ecore_Event_Handler_Cb)_data, a);


char welcome[] = "Connection" ;

ecore_con_server_send(a->svr, welcome, sizeof(welcome)) ;

}
static void
_forward_clicked(void *_data, Evas_Object * obj, void *event_info)
{
	(void) obj;
	(void) event_info;

	char *content;
	GHashTable *options;
	struct MessageShowViewData *view = (struct MessageShowViewData *) _data;

	evas_object_hide(view->hv);

	options = g_hash_table_new_full(g_str_hash, g_str_equal,
					NULL, common_utils_variant_unref);
	content = elm_entry_markup_to_utf8(elm_object_text_get(view->content));
	if (content) {
		g_hash_table_insert(options, "Content",
		                    g_variant_ref_sink(g_variant_new_string(content)));
		free(content);
	}

	phoneui_messages_message_new(options);
}
示例#17
0
EINA_DEPRECATED EAPI const char *
elm_scrolled_entry_entry_get(const Evas_Object *obj)
{return elm_object_text_get(obj);}
示例#18
0
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH

static Evas_Object *glb;

static void
_bt_copy_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
   Evas_Object *en = (Evas_Object*)(data);
   const char *txt = elm_object_text_get(en);

   elm_object_text_set(glb, txt);
   elm_cnp_selection_set(elm_object_parent_widget_get(en), ELM_SEL_TYPE_CLIPBOARD,
                         ELM_SEL_FORMAT_TEXT, txt, strlen(txt));
}

static void
_bt_paste_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
   Evas_Object *en = (Evas_Object*)(data);

   elm_cnp_selection_get(en, ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT,
                         NULL, NULL);
}

static void
_bt_clear_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{