2013-04-25 22:13:00 -07:00
# ifdef HAVE_CONFIG_H
# include "elementary_config.h"
# endif
2008-10-14 01:05:30 -07:00
# include <Elementary.h>
2010-09-17 15:28:29 -07:00
# include <Elementary_Cursor.h>
2008-10-14 01:05:30 -07:00
# include "elm_priv.h"
2012-08-30 09:45:15 -07:00
# include "elm_widget_entry.h"
2008-10-14 01:05:30 -07:00
2012-11-25 22:32:53 -08:00
EAPI Eo_Op ELM_OBJ_ENTRY_BASE_ID = EO_NOOP ;
# define MY_CLASS ELM_OBJ_ENTRY_CLASS
# define MY_CLASS_NAME "elm_entry"
2010-04-12 01:12:02 -07:00
2011-05-15 09:02:03 -07:00
/* Maximum chunk size to be inserted to the entry at once
* FIXME : This size is arbitrary , should probably choose a better size .
* Possibly also find a way to set it to a low value for weak computers ,
* and to a big value for better computers . */
# define _CHUNK_SIZE 10000
2012-08-30 09:45:15 -07:00
static const char SIG_ABORTED [ ] = " aborted " ;
static const char SIG_ACTIVATED [ ] = " activated " ;
static const char SIG_ANCHOR_CLICKED [ ] = " anchor,clicked " ;
static const char SIG_ANCHOR_DOWN [ ] = " anchor,down " ;
static const char SIG_ANCHOR_HOVER_OPENED [ ] = " anchor,hover,opened " ;
static const char SIG_ANCHOR_IN [ ] = " anchor,in " ;
static const char SIG_ANCHOR_OUT [ ] = " anchor,out " ;
static const char SIG_ANCHOR_UP [ ] = " anchor,up " ;
2010-03-26 03:59:56 -07:00
static const char SIG_CHANGED [ ] = " changed " ;
2011-08-03 02:00:36 -07:00
static const char SIG_CHANGED_USER [ ] = " changed,user " ;
2010-03-26 03:59:56 -07:00
static const char SIG_CLICKED [ ] = " clicked " ;
static const char SIG_CLICKED_DOUBLE [ ] = " clicked,double " ;
2011-07-25 07:08:38 -07:00
static const char SIG_CLICKED_TRIPLE [ ] = " clicked,triple " ;
2012-08-30 09:45:15 -07:00
static const char SIG_CURSOR_CHANGED [ ] = " cursor,changed " ;
static const char SIG_CURSOR_CHANGED_MANUAL [ ] = " cursor,changed,manual " ;
2010-03-26 04:25:55 -07:00
static const char SIG_FOCUSED [ ] = " focused " ;
2012-08-30 09:45:15 -07:00
static const char SIG_LANG_CHANGED [ ] = " language,changed " ;
static const char SIG_LONGPRESSED [ ] = " longpressed " ;
2013-05-12 17:00:50 -07:00
static const char SIG_MAX_LENGTH [ ] = " maxlength,reached " ;
2012-08-30 09:45:15 -07:00
static const char SIG_PREEDIT_CHANGED [ ] = " preedit,changed " ;
static const char SIG_PRESS [ ] = " press " ;
static const char SIG_REDO_REQUEST [ ] = " redo,request " ;
static const char SIG_SELECTION_CHANGED [ ] = " selection,changed " ;
static const char SIG_SELECTION_CLEARED [ ] = " selection,cleared " ;
2010-03-26 03:59:56 -07:00
static const char SIG_SELECTION_COPY [ ] = " selection,copy " ;
static const char SIG_SELECTION_CUT [ ] = " selection,cut " ;
2012-08-30 09:45:15 -07:00
static const char SIG_SELECTION_PASTE [ ] = " selection,paste " ;
2010-03-26 03:59:56 -07:00
static const char SIG_SELECTION_START [ ] = " selection,start " ;
2013-05-06 04:42:34 -07:00
static const char SIG_TEXT_SET_DONE [ ] = " text,set,done " ;
2013-05-06 05:01:50 -07:00
static const char SIG_THEME_CHANGED [ ] = " theme,changed " ;
2011-11-14 05:55:57 -08:00
static const char SIG_UNDO_REQUEST [ ] = " undo,request " ;
2012-08-30 09:45:15 -07:00
static const char SIG_UNFOCUSED [ ] = " unfocused " ;
static const Evas_Smart_Cb_Description _smart_callbacks [ ] = {
{ SIG_ABORTED , " " } ,
{ SIG_ACTIVATED , " " } ,
{ SIG_ANCHOR_CLICKED , " " } ,
{ SIG_ANCHOR_DOWN , " " } ,
{ SIG_ANCHOR_HOVER_OPENED , " " } ,
{ SIG_ANCHOR_IN , " " } ,
{ SIG_ANCHOR_OUT , " " } ,
{ SIG_ANCHOR_UP , " " } ,
{ SIG_CHANGED , " " } ,
{ SIG_CHANGED_USER , " " } ,
{ SIG_CLICKED , " " } ,
{ SIG_CLICKED_DOUBLE , " " } ,
{ SIG_CLICKED_TRIPLE , " " } ,
{ SIG_CURSOR_CHANGED , " " } ,
{ SIG_CURSOR_CHANGED_MANUAL , " " } ,
{ SIG_FOCUSED , " " } ,
{ SIG_LANG_CHANGED , " " } ,
{ SIG_LONGPRESSED , " " } ,
2013-05-12 17:00:50 -07:00
{ SIG_MAX_LENGTH , " " } ,
2012-08-30 09:45:15 -07:00
{ SIG_PREEDIT_CHANGED , " " } ,
{ SIG_PRESS , " " } ,
{ SIG_REDO_REQUEST , " " } ,
{ SIG_SELECTION_CHANGED , " " } ,
{ SIG_SELECTION_CLEARED , " " } ,
{ SIG_SELECTION_COPY , " " } ,
{ SIG_SELECTION_CUT , " " } ,
{ SIG_SELECTION_PASTE , " " } ,
{ SIG_SELECTION_START , " " } ,
2013-05-06 04:42:34 -07:00
{ SIG_TEXT_SET_DONE , " " } ,
2013-05-06 05:01:50 -07:00
{ SIG_THEME_CHANGED , " " } ,
2012-08-30 09:45:15 -07:00
{ SIG_UNDO_REQUEST , " " } ,
{ SIG_UNFOCUSED , " " } ,
{ NULL , NULL }
} ;
static const Elm_Layout_Part_Alias_Description _content_aliases [ ] =
{
{ " icon " , " elm.swallow.icon " } ,
{ " end " , " elm.swallow.end " } ,
{ NULL , NULL }
} ;
2008-11-18 00:45:38 -08:00
static Eina_List * entries = NULL ;
2009-12-01 03:03:14 -08:00
struct _Mod_Api
{
2012-08-30 09:45:15 -07:00
void ( * obj_hook ) ( Evas_Object * obj ) ;
void ( * obj_unhook ) ( Evas_Object * obj ) ;
void ( * obj_longpress ) ( Evas_Object * obj ) ;
2009-12-01 03:03:14 -08:00
} ;
static Mod_Api *
2012-08-30 09:45:15 -07:00
_module_find ( Evas_Object * obj __UNUSED__ )
2009-12-01 03:03:14 -08:00
{
static Elm_Module * m = NULL ;
2012-08-30 09:45:15 -07:00
if ( m ) goto ok ; // already found - just use
2009-12-01 03:03:14 -08:00
if ( ! ( m = _elm_module_find_as ( " entry/api " ) ) ) return NULL ;
// get module api
m - > api = malloc ( sizeof ( Mod_Api ) ) ;
if ( ! m - > api ) return NULL ;
2012-08-30 09:45:15 -07:00
( ( Mod_Api * ) ( m - > api ) ) - > obj_hook = // called on creation
_elm_module_symbol_get ( m , " obj_hook " ) ;
( ( Mod_Api * ) ( m - > api ) ) - > obj_unhook = // called on deletion
_elm_module_symbol_get ( m , " obj_unhook " ) ;
( ( Mod_Api * ) ( m - > api ) ) - > obj_longpress = // called on long press menu
_elm_module_symbol_get ( m , " obj_longpress " ) ;
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
ok : // ok - return api
2009-12-01 03:03:14 -08:00
return m - > api ;
}
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
static char *
2012-12-05 23:28:57 -08:00
_file_load ( const char * file )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-12-05 23:28:57 -08:00
Eina_File * f ;
char * text = NULL ;
void * tmp = NULL ;
2012-08-30 09:45:15 -07:00
2012-12-05 23:28:57 -08:00
f = eina_file_open ( file , EINA_FALSE ) ;
if ( ! f ) return NULL ;
2012-08-30 09:45:15 -07:00
2012-12-06 01:02:22 -08:00
tmp = eina_file_map_all ( f , EINA_FILE_SEQUENTIAL ) ;
2012-12-05 23:28:57 -08:00
if ( ! tmp ) goto on_error ;
2012-08-30 09:45:15 -07:00
2012-12-05 23:28:57 -08:00
text = malloc ( eina_file_size_get ( f ) + 1 ) ;
if ( ! text ) goto on_error ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
2012-12-05 23:28:57 -08:00
memcpy ( text , tmp , eina_file_size_get ( f ) ) ;
text [ eina_file_size_get ( f ) ] = 0 ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
2012-12-06 01:00:18 -08:00
if ( eina_file_map_faulted ( f , tmp ) )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-12-05 23:28:57 -08:00
free ( text ) ;
text = NULL ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
2012-12-05 23:28:57 -08:00
on_error :
2012-12-06 01:02:22 -08:00
if ( tmp ) eina_file_map_free ( f , tmp ) ;
2012-12-05 23:28:57 -08:00
eina_file_close ( f ) ;
2012-08-30 09:45:15 -07:00
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
return text ;
}
static char *
2012-08-30 09:45:15 -07:00
_plain_load ( const char * file )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
char * text ;
2012-08-30 09:45:15 -07:00
text = _file_load ( file ) ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
if ( text )
{
char * text2 ;
text2 = elm_entry_utf8_to_markup ( text ) ;
free ( text ) ;
return text2 ;
}
2012-08-30 09:45:15 -07:00
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
return NULL ;
}
2012-03-06 14:51:40 -08:00
static Eina_Bool
2012-08-30 09:45:15 -07:00
_load_do ( Evas_Object * obj )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
char * text ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
if ( ! sd - > file )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2011-12-30 02:02:19 -08:00
elm_object_text_set ( obj , " " ) ;
2012-03-06 14:51:40 -08:00
return EINA_TRUE ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
2012-08-30 09:45:15 -07:00
switch ( sd - > format )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
case ELM_TEXT_FORMAT_PLAIN_UTF8 :
2012-08-30 09:45:15 -07:00
text = _plain_load ( sd - > file ) ;
break ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
case ELM_TEXT_FORMAT_MARKUP_UTF8 :
2012-08-30 09:45:15 -07:00
text = _file_load ( sd - > file ) ;
break ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
default :
2012-08-30 09:45:15 -07:00
text = NULL ;
break ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
2012-08-30 09:45:15 -07:00
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
if ( text )
{
2011-12-30 02:02:19 -08:00
elm_object_text_set ( obj , text ) ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
free ( text ) ;
2012-08-30 09:45:15 -07:00
2012-03-06 14:51:40 -08:00
return EINA_TRUE ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
else
2012-03-06 14:51:40 -08:00
{
elm_object_text_set ( obj , " " ) ;
2012-08-30 09:45:15 -07:00
2012-03-06 14:51:40 -08:00
return EINA_FALSE ;
}
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_utf8_markup_save ( const char * file ,
const char * text )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
FILE * f ;
if ( ( ! text ) | | ( ! text [ 0 ] ) )
{
ecore_file_unlink ( file ) ;
2012-08-30 09:45:15 -07:00
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
return ;
}
2012-08-30 09:45:15 -07:00
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
f = fopen ( file , " wb " ) ;
if ( ! f )
{
// FIXME: report a write error
return ;
}
2012-08-30 09:45:15 -07:00
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
fputs ( text , f ) ; // FIXME: catch error
fclose ( f ) ;
}
static void
2012-08-30 09:45:15 -07:00
_utf8_plain_save ( const char * file ,
const char * text )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
char * text2 ;
text2 = elm_entry_markup_to_utf8 ( text ) ;
if ( ! text2 )
return ;
2012-08-30 09:45:15 -07:00
_utf8_markup_save ( file , text2 ) ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
free ( text2 ) ;
}
static void
2012-08-30 09:45:15 -07:00
_save_do ( Evas_Object * obj )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
if ( ! sd - > file ) return ;
switch ( sd - > format )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
case ELM_TEXT_FORMAT_PLAIN_UTF8 :
2012-08-30 09:45:15 -07:00
_utf8_plain_save ( sd - > file , elm_object_text_get ( obj ) ) ;
break ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
case ELM_TEXT_FORMAT_MARKUP_UTF8 :
2012-08-30 09:45:15 -07:00
_utf8_markup_save ( sd - > file , elm_object_text_get ( obj ) ) ;
break ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
default :
2012-08-30 09:45:15 -07:00
break ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
}
static Eina_Bool
_delay_write ( void * data )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
_save_do ( data ) ;
sd - > delay_write = NULL ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
return ECORE_CALLBACK_CANCEL ;
}
2012-04-08 22:25:27 -07:00
static void
2012-08-30 09:45:15 -07:00
_elm_entry_guide_update ( Evas_Object * obj ,
Eina_Bool has_text )
2012-04-08 22:25:27 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
if ( ( has_text ) & & ( ! sd - > has_text ) )
edje_object_signal_emit ( sd - > entry_edje , " elm,guide,disabled " , " elm " ) ;
else if ( ( ! has_text ) & & ( sd - > has_text ) )
edje_object_signal_emit ( sd - > entry_edje , " elm,guide,enabled " , " elm " ) ;
sd - > has_text = has_text ;
2012-04-08 22:25:27 -07:00
}
2012-02-07 23:23:49 -08:00
static Elm_Entry_Markup_Filter *
2012-08-30 09:45:15 -07:00
_filter_new ( Elm_Entry_Filter_Cb func ,
void * data )
2011-02-14 00:45:26 -08:00
{
2012-02-07 23:23:49 -08:00
Elm_Entry_Markup_Filter * tf = ELM_NEW ( Elm_Entry_Markup_Filter ) ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
if ( ! tf ) return NULL ;
2011-03-14 19:01:42 -07:00
2011-02-14 00:45:26 -08:00
tf - > func = func ;
2013-05-16 02:10:13 -07:00
tf - > orig_data = data ;
2011-02-14 00:45:26 -08:00
if ( func = = elm_entry_filter_limit_size )
{
Elm_Entry_Filter_Limit_Size * lim = data , * lim2 ;
if ( ! data )
{
free ( tf ) ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
return NULL ;
}
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
lim2 = malloc ( sizeof ( Elm_Entry_Filter_Limit_Size ) ) ;
if ( ! lim2 )
{
free ( tf ) ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
return NULL ;
}
memcpy ( lim2 , lim , sizeof ( Elm_Entry_Filter_Limit_Size ) ) ;
tf - > data = lim2 ;
}
else if ( func = = elm_entry_filter_accept_set )
{
Elm_Entry_Filter_Accept_Set * as = data , * as2 ;
2011-03-14 19:01:42 -07:00
2011-02-14 00:45:26 -08:00
if ( ! data )
{
free ( tf ) ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
return NULL ;
}
as2 = malloc ( sizeof ( Elm_Entry_Filter_Accept_Set ) ) ;
if ( ! as2 )
{
free ( tf ) ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
return NULL ;
}
if ( as - > accepted )
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
as2 - > accepted = eina_stringshare_add ( as - > accepted ) ;
2011-02-14 00:45:26 -08:00
else
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
as2 - > accepted = NULL ;
2011-02-14 00:45:26 -08:00
if ( as - > rejected )
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
as2 - > rejected = eina_stringshare_add ( as - > rejected ) ;
2011-02-14 00:45:26 -08:00
else
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
as2 - > rejected = NULL ;
2011-02-14 00:45:26 -08:00
tf - > data = as2 ;
}
else
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
tf - > data = data ;
2011-02-14 00:45:26 -08:00
return tf ;
}
static void
2012-02-07 23:23:49 -08:00
_filter_free ( Elm_Entry_Markup_Filter * tf )
2011-02-14 00:45:26 -08:00
{
if ( tf - > func = = elm_entry_filter_limit_size )
{
Elm_Entry_Filter_Limit_Size * lim = tf - > data ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
if ( lim ) free ( lim ) ;
}
else if ( tf - > func = = elm_entry_filter_accept_set )
{
Elm_Entry_Filter_Accept_Set * as = tf - > data ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
if ( as )
{
if ( as - > accepted ) eina_stringshare_del ( as - > accepted ) ;
if ( as - > rejected ) eina_stringshare_del ( as - > rejected ) ;
2012-08-30 09:45:15 -07:00
2011-02-14 00:45:26 -08:00
free ( as ) ;
}
}
free ( tf ) ;
}
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
static void
2012-08-30 09:45:15 -07:00
_mirrored_set ( Evas_Object * obj ,
Eina_Bool rtl )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
edje_object_mirrored_set ( sd - > entry_edje , rtl ) ;
if ( sd - > anchor_hover . hover )
elm_widget_mirrored_set ( sd - > anchor_hover . hover , rtl ) ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
2012-08-30 09:45:15 -07:00
static const char *
_elm_entry_theme_group_get ( Evas_Object * obj )
2008-10-14 01:05:30 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
2009-09-26 11:00:51 -07:00
2012-08-30 09:45:15 -07:00
if ( sd - > editable )
{
if ( sd - > password ) return " base-password " ;
else
{
if ( sd - > single_line ) return " base-single " ;
else
{
switch ( sd - > line_wrap )
{
case ELM_WRAP_CHAR :
return " base-charwrap " ;
2011-09-29 05:02:49 -07:00
2012-08-30 09:45:15 -07:00
case ELM_WRAP_WORD :
return " base " ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
2012-08-30 09:45:15 -07:00
case ELM_WRAP_MIXED :
return " base-mixedwrap " ;
2010-02-08 19:27:11 -08:00
2012-08-30 09:45:15 -07:00
case ELM_WRAP_NONE :
default :
return " base-nowrap " ;
}
}
}
2010-10-07 05:50:00 -07:00
}
2012-08-30 09:45:15 -07:00
else
2012-02-07 23:23:49 -08:00
{
2012-08-30 09:45:15 -07:00
if ( sd - > password ) return " base-password " ;
else
{
if ( sd - > single_line ) return " base-single-noedit " ;
else
{
switch ( sd - > line_wrap )
{
case ELM_WRAP_CHAR :
return " base-noedit-charwrap " ;
2011-09-29 05:02:49 -07:00
2012-08-30 09:45:15 -07:00
case ELM_WRAP_WORD :
return " base-noedit " ;
case ELM_WRAP_MIXED :
return " base-noedit-mixedwrap " ;
case ELM_WRAP_NONE :
default :
return " base-nowrap-noedit " ;
}
}
}
}
2008-10-14 01:05:30 -07:00
}
2012-08-30 09:45:15 -07:00
/* we can't reuse layout's here, because it's on entry_edje only */
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_disable ( Eo * obj , void * _pd , va_list * list )
2011-02-08 04:08:28 -08:00
{
2012-11-25 22:32:53 -08:00
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
if ( ret ) * ret = EINA_FALSE ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( elm_object_disabled_get ( obj ) )
2012-11-02 01:15:24 -07:00
{
edje_object_signal_emit ( sd - > entry_edje , " elm,state,disabled " , " elm " ) ;
2013-04-16 01:59:02 -07:00
if ( sd - > scroll )
eo_do ( obj , elm_scrollable_interface_freeze_set ( EINA_TRUE ) ) ;
2012-11-02 01:15:24 -07:00
sd - > disabled = EINA_TRUE ;
}
2012-08-30 09:45:15 -07:00
else
2012-11-02 01:15:24 -07:00
{
edje_object_signal_emit ( sd - > entry_edje , " elm,state,enabled " , " elm " ) ;
2013-04-16 01:59:02 -07:00
if ( sd - > scroll )
eo_do ( obj , elm_scrollable_interface_freeze_set ( EINA_FALSE ) ) ;
2012-11-02 01:15:24 -07:00
sd - > disabled = EINA_FALSE ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_TRUE ;
2011-02-08 04:08:28 -08:00
}
2012-08-30 09:45:15 -07:00
/* we can't issue the layout's theming code here, cause it assumes an
* unique edje object , always */
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_theme ( Eo * obj , void * _pd , va_list * list )
2008-11-15 05:58:50 -08:00
{
2009-02-25 07:54:26 -08:00
const char * t ;
2012-11-25 22:32:53 -08:00
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
if ( ret ) * ret = EINA_FALSE ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2013-04-24 04:41:37 -07:00
Elm_Widget_Smart_Data * wd = eo_data_scope_get ( obj , ELM_OBJ_WIDGET_CLASS ) ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Eina_Bool int_ret = EINA_FALSE ;
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_wdg_theme ( & int_ret ) ) ;
2012-11-25 22:32:53 -08:00
if ( ! int_ret ) return ;
2011-09-29 05:02:49 -07:00
evas_event_freeze ( evas_object_evas_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
edje_object_mirrored_set
2012-11-25 22:32:53 -08:00
( wd - > resize_obj , elm_widget_mirrored_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
edje_object_scale_set
2012-11-25 22:32:53 -08:00
( wd - > resize_obj ,
2012-08-30 09:45:15 -07:00
elm_widget_scale_get ( obj ) * elm_config_scale_get ( ) ) ;
2011-02-08 04:08:28 -08:00
_mirrored_set ( obj , elm_widget_mirrored_get ( obj ) ) ;
2009-09-26 11:00:51 -07:00
2011-12-30 02:02:19 -08:00
t = eina_stringshare_add ( elm_object_text_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
elm_widget_theme_object_set
( obj , sd - > entry_edje , " entry " , _elm_entry_theme_group_get ( obj ) ,
elm_widget_style_get ( obj ) ) ;
2011-04-01 06:20:40 -07:00
if ( _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_TRUE ) ;
2011-12-30 02:02:19 -08:00
elm_object_text_set ( obj , t ) ;
2009-02-25 07:54:26 -08:00
eina_stringshare_del ( t ) ;
2012-08-30 09:45:15 -07:00
2010-10-07 00:44:50 -07:00
if ( elm_widget_disabled_get ( obj ) )
2012-08-30 09:45:15 -07:00
edje_object_signal_emit ( sd - > entry_edje , " elm,state,disabled " , " elm " ) ;
edje_object_part_text_input_panel_layout_set
( sd - > entry_edje , " elm.text " , sd - > input_panel_layout ) ;
2013-03-27 01:34:19 -07:00
edje_object_part_text_input_panel_layout_variation_set
( sd - > entry_edje , " elm.text " , sd - > input_panel_layout_variation ) ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_autocapital_type_set
( sd - > entry_edje , " elm.text " , sd - > autocapital_type ) ;
edje_object_part_text_prediction_allow_set
( sd - > entry_edje , " elm.text " , sd - > prediction_allow ) ;
edje_object_part_text_input_panel_enabled_set
( sd - > entry_edje , " elm.text " , sd - > input_panel_enable ) ;
edje_object_part_text_input_panel_imdata_set
( sd - > entry_edje , " elm.text " , sd - > input_panel_imdata ,
sd - > input_panel_imdata_len ) ;
edje_object_part_text_input_panel_return_key_type_set
( sd - > entry_edje , " elm.text " , sd - > input_panel_return_key_type ) ;
edje_object_part_text_input_panel_return_key_disabled_set
( sd - > entry_edje , " elm.text " , sd - > input_panel_return_key_disabled ) ;
if ( sd - > cursor_pos ! = 0 )
elm_entry_cursor_pos_set ( obj , sd - > cursor_pos ) ;
2011-03-17 01:18:16 -07:00
if ( elm_widget_focus_get ( obj ) )
2012-08-30 09:45:15 -07:00
edje_object_signal_emit ( sd - > entry_edje , " elm,action,focus " , " elm " ) ;
edje_object_message_signal_process ( sd - > entry_edje ) ;
if ( sd - > scroll )
2011-06-17 02:44:31 -07:00
{
const char * str ;
2013-03-11 06:17:53 -07:00
Eina_Bool ok = EINA_FALSE ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_mirrored_set ( elm_widget_mirrored_get ( obj ) ) ) ;
2012-08-30 09:45:15 -07:00
2013-03-11 06:17:53 -07:00
if ( sd - > single_line )
ok = elm_widget_theme_object_set
( obj , sd - > scr_edje , " scroller " , " entry_single " , elm_widget_style_get ( obj ) ) ;
if ( ! ok )
elm_widget_theme_object_set
2012-08-30 09:45:15 -07:00
( obj , sd - > scr_edje , " scroller " , " entry " , elm_widget_style_get ( obj ) ) ;
str = edje_object_data_get ( sd - > scr_edje , " focus_highlight " ) ;
2011-06-17 02:44:31 -07:00
if ( ( str ) & & ( ! strcmp ( str , " on " ) ) )
2011-07-11 21:51:39 -07:00
elm_widget_highlight_in_theme_set ( obj , EINA_TRUE ) ;
2011-06-17 02:44:31 -07:00
else
2011-07-11 21:51:39 -07:00
elm_widget_highlight_in_theme_set ( obj , EINA_FALSE ) ;
2011-06-17 02:44:31 -07:00
}
2012-08-30 09:45:15 -07:00
2013-03-11 06:17:53 -07:00
sd - > changed = EINA_TRUE ;
2012-08-30 09:45:15 -07:00
elm_layout_sizing_eval ( obj ) ;
sd - > has_text = ! sd - > has_text ;
_elm_entry_guide_update ( obj , ! sd - > has_text ) ;
2011-09-29 05:02:49 -07:00
evas_event_thaw ( evas_object_evas_get ( obj ) ) ;
evas_event_thaw_eval ( evas_object_evas_get ( obj ) ) ;
2008-11-15 05:58:50 -08:00
2012-08-30 09:45:15 -07:00
evas_object_smart_callback_call ( obj , SIG_THEME_CHANGED , NULL ) ;
2009-09-26 11:00:51 -07:00
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_TRUE ;
2009-08-26 05:51:27 -07:00
}
2011-06-17 02:44:31 -07:00
static void
2012-08-30 09:45:15 -07:00
_cursor_geometry_recalc ( Evas_Object * obj )
2011-06-17 02:44:31 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
2011-06-17 02:44:31 -07:00
evas_object_smart_callback_call ( obj , SIG_CURSOR_CHANGED , NULL ) ;
2012-08-30 09:45:15 -07:00
if ( ! sd - > deferred_recalc_job )
2011-06-17 02:44:31 -07:00
{
Evas_Coord cx , cy , cw , ch ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_geometry_get
( sd - > entry_edje , " elm.text " , & cx , & cy , & cw , & ch ) ;
if ( sd - > cur_changed )
2011-06-17 02:44:31 -07:00
{
2011-07-08 00:50:36 -07:00
elm_widget_show_region_set ( obj , cx , cy , cw , ch , EINA_FALSE ) ;
2012-08-30 09:45:15 -07:00
sd - > cur_changed = EINA_FALSE ;
2011-06-17 02:44:31 -07:00
}
}
else
2012-08-30 09:45:15 -07:00
sd - > deferred_cur = EINA_TRUE ;
2011-06-17 02:44:31 -07:00
}
2008-10-17 20:55:44 -07:00
static void
2012-08-30 09:45:15 -07:00
_deferred_recalc_job ( void * data )
2008-10-17 20:55:44 -07:00
{
2011-07-21 04:02:07 -07:00
Evas_Coord minh = - 1 , resw = - 1 , minw = - 1 , fw = 0 , fh = 0 ;
2011-04-28 10:50:26 -07:00
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
sd - > deferred_recalc_job = NULL ;
evas_object_geometry_get ( sd - > entry_edje , NULL , NULL , & resw , NULL ) ;
edje_object_size_min_restricted_calc ( sd - > entry_edje , & minw , & minh , resw , 0 ) ;
2011-12-06 07:52:05 -08:00
elm_coords_finger_size_adjust ( 1 , & minw , 1 , & minh ) ;
2012-08-30 09:45:15 -07:00
2011-04-28 08:47:01 -07:00
/* This is a hack to workaround the way min size hints are treated.
2012-08-30 09:45:15 -07:00
* If the minimum width is smaller than the restricted width , it
* means the minimum doesn ' t matter . */
2011-04-28 08:47:01 -07:00
if ( minw < = resw )
{
Evas_Coord ominw = - 1 ;
2012-08-30 09:45:15 -07:00
2011-04-28 08:47:01 -07:00
evas_object_size_hint_min_get ( data , & ominw , NULL ) ;
minw = ominw ;
}
2011-07-21 04:30:05 -07:00
2012-08-30 09:45:15 -07:00
sd - > ent_mw = minw ;
sd - > ent_mh = minh ;
2011-12-06 07:52:11 -08:00
2011-07-21 04:02:07 -07:00
elm_coords_finger_size_adjust ( 1 , & fw , 1 , & fh ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > scroll )
2011-07-21 04:02:07 -07:00
{
Evas_Coord vmw = 0 , vmh = 0 ;
2011-07-21 04:30:05 -07:00
2012-08-30 09:45:15 -07:00
edje_object_size_min_calc ( sd - > scr_edje , & vmw , & vmh ) ;
if ( sd - > single_line )
2011-07-21 04:02:07 -07:00
{
evas_object_size_hint_min_set ( data , vmw , minh + vmh ) ;
evas_object_size_hint_max_set ( data , - 1 , minh + vmh ) ;
}
else
{
evas_object_size_hint_min_set ( data , vmw , vmh ) ;
evas_object_size_hint_max_set ( data , - 1 , - 1 ) ;
}
}
2011-06-17 02:44:31 -07:00
else
2011-07-21 04:02:07 -07:00
{
2012-08-30 09:45:15 -07:00
if ( sd - > single_line )
2011-07-21 04:02:07 -07:00
{
evas_object_size_hint_min_set ( data , minw , minh ) ;
evas_object_size_hint_max_set ( data , - 1 , minh ) ;
}
else
{
evas_object_size_hint_min_set ( data , fw , minh ) ;
evas_object_size_hint_max_set ( data , - 1 , - 1 ) ;
}
}
2011-04-07 01:47:18 -07:00
2012-08-30 09:45:15 -07:00
if ( sd - > deferred_cur )
2011-04-28 10:50:26 -07:00
{
Evas_Coord cx , cy , cw , ch ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_geometry_get
( sd - > entry_edje , " elm.text " , & cx , & cy , & cw , & ch ) ;
if ( sd - > cur_changed )
2011-05-18 04:48:38 -07:00
{
2011-07-08 00:50:36 -07:00
elm_widget_show_region_set ( data , cx , cy , cw , ch , EINA_FALSE ) ;
2012-08-30 09:45:15 -07:00
sd - > cur_changed = EINA_FALSE ;
2011-05-18 04:48:38 -07:00
}
}
}
2008-10-14 01:05:30 -07:00
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_sizing_eval ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
2008-10-14 01:05:30 -07:00
{
2011-04-07 01:47:18 -07:00
Evas_Coord minw = - 1 , minh = - 1 ;
2010-03-09 03:42:53 -08:00
Evas_Coord resw , resh ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2011-06-17 02:44:31 -07:00
evas_object_geometry_get ( obj , NULL , NULL , & resw , & resh ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > line_wrap )
2008-10-17 07:40:54 -07:00
{
2012-08-30 09:45:15 -07:00
if ( ( resw = = sd - > last_w ) & & ( ! sd - > changed ) )
2012-08-20 00:35:31 -07:00
{
2012-08-30 09:45:15 -07:00
if ( sd - > scroll )
2012-08-20 00:35:31 -07:00
{
Evas_Coord vw = 0 , vh = 0 , w = 0 , h = 0 ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_content_viewport_size_get ( & vw , & vh ) ) ;
2012-08-30 09:45:15 -07:00
w = sd - > ent_mw ;
h = sd - > ent_mh ;
if ( vw > sd - > ent_mw ) w = vw ;
if ( vh > sd - > ent_mh ) h = vh ;
evas_object_resize ( sd - > entry_edje , w , h ) ;
2012-08-20 00:35:31 -07:00
return ;
}
2012-08-30 09:45:15 -07:00
2012-08-20 00:35:31 -07:00
return ;
}
2012-08-30 09:45:15 -07:00
2011-09-29 05:02:49 -07:00
evas_event_freeze ( evas_object_evas_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
sd - > changed = EINA_FALSE ;
sd - > last_w = resw ;
if ( sd - > scroll )
2011-06-17 02:44:31 -07:00
{
Evas_Coord vw = 0 , vh = 0 , vmw = 0 , vmh = 0 , w = - 1 , h = - 1 ;
2012-08-30 09:45:15 -07:00
evas_object_resize ( sd - > scr_edje , resw , resh ) ;
edje_object_size_min_calc ( sd - > scr_edje , & vmw , & vmh ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_content_viewport_size_get ( & vw , & vh ) ) ;
2012-08-30 09:45:15 -07:00
edje_object_size_min_restricted_calc
( sd - > entry_edje , & minw , & minh , vw , 0 ) ;
2011-12-06 07:52:11 -08:00
elm_coords_finger_size_adjust ( 1 , & minw , 1 , & minh ) ;
2012-08-30 09:45:15 -07:00
/* This is a hack to workaround the way min size hints
* are treated . If the minimum width is smaller than the
* restricted width , it means the minimum doesn ' t
* matter . */
2011-12-06 07:52:11 -08:00
if ( minw < = vw )
{
Evas_Coord ominw = - 1 ;
2012-08-30 09:45:15 -07:00
evas_object_size_hint_min_get ( sd - > entry_edje , & ominw , NULL ) ;
2011-12-06 07:52:11 -08:00
minw = ominw ;
}
2012-08-30 09:45:15 -07:00
sd - > ent_mw = minw ;
sd - > ent_mh = minh ;
2011-06-17 02:44:31 -07:00
if ( ( minw > 0 ) & & ( vw < minw ) ) vw = minw ;
if ( minh > vh ) vh = minh ;
2012-08-30 09:45:15 -07:00
if ( sd - > single_line ) h = vmh + minh ;
2011-06-17 02:44:31 -07:00
else h = vmh ;
2012-08-30 09:45:15 -07:00
evas_object_resize ( sd - > entry_edje , vw , vh ) ;
2011-06-17 02:44:31 -07:00
evas_object_size_hint_min_set ( obj , w , h ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > single_line )
2011-07-11 21:51:39 -07:00
evas_object_size_hint_max_set ( obj , - 1 , h ) ;
2011-06-17 02:44:31 -07:00
else
2011-07-11 21:51:39 -07:00
evas_object_size_hint_max_set ( obj , - 1 , - 1 ) ;
2011-06-17 02:44:31 -07:00
}
else
{
2012-08-30 09:45:15 -07:00
if ( sd - > deferred_recalc_job )
ecore_job_del ( sd - > deferred_recalc_job ) ;
sd - > deferred_recalc_job =
ecore_job_add ( _deferred_recalc_job , obj ) ;
2011-06-17 02:44:31 -07:00
}
2012-08-30 09:45:15 -07:00
2011-09-29 05:02:49 -07:00
evas_event_thaw ( evas_object_evas_get ( obj ) ) ;
evas_event_thaw_eval ( evas_object_evas_get ( obj ) ) ;
2008-10-17 07:40:54 -07:00
}
else
{
2012-08-30 09:45:15 -07:00
if ( ! sd - > changed ) return ;
2011-09-29 05:02:49 -07:00
evas_event_freeze ( evas_object_evas_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
sd - > changed = EINA_FALSE ;
sd - > last_w = resw ;
if ( sd - > scroll )
2011-06-17 02:44:31 -07:00
{
Evas_Coord vw = 0 , vh = 0 , vmw = 0 , vmh = 0 , w = - 1 , h = - 1 ;
2011-07-03 00:49:02 -07:00
2012-08-30 09:45:15 -07:00
edje_object_size_min_calc ( sd - > entry_edje , & minw , & minh ) ;
sd - > ent_mw = minw ;
sd - > ent_mh = minh ;
2011-06-17 02:44:31 -07:00
elm_coords_finger_size_adjust ( 1 , & minw , 1 , & minh ) ;
2011-07-03 00:49:02 -07:00
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_content_viewport_size_get ( & vw , & vh ) ) ;
2011-06-17 02:44:31 -07:00
2012-01-29 03:55:29 -08:00
if ( minw > vw ) vw = minw ;
if ( minh > vh ) vh = minh ;
2011-06-17 02:44:31 -07:00
2012-08-30 09:45:15 -07:00
evas_object_resize ( sd - > entry_edje , vw , vh ) ;
edje_object_size_min_calc ( sd - > scr_edje , & vmw , & vmh ) ;
if ( sd - > single_line ) h = vmh + minh ;
2011-06-17 02:44:31 -07:00
else h = vmh ;
2012-08-30 09:45:15 -07:00
2011-06-17 02:44:31 -07:00
evas_object_size_hint_min_set ( obj , w , h ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > single_line )
2011-07-11 21:51:39 -07:00
evas_object_size_hint_max_set ( obj , - 1 , h ) ;
2011-06-17 02:44:31 -07:00
else
2011-07-11 21:51:39 -07:00
evas_object_size_hint_max_set ( obj , - 1 , - 1 ) ;
2011-06-17 02:44:31 -07:00
}
else
{
2012-08-30 09:45:15 -07:00
edje_object_size_min_calc ( sd - > entry_edje , & minw , & minh ) ;
sd - > ent_mw = minw ;
sd - > ent_mh = minh ;
2011-06-17 02:44:31 -07:00
elm_coords_finger_size_adjust ( 1 , & minw , 1 , & minh ) ;
evas_object_size_hint_min_set ( obj , minw , minh ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > single_line )
2011-07-11 21:51:39 -07:00
evas_object_size_hint_max_set ( obj , - 1 , minh ) ;
2011-06-17 02:44:31 -07:00
else
2011-07-11 21:51:39 -07:00
evas_object_size_hint_max_set ( obj , - 1 , - 1 ) ;
2011-06-17 02:44:31 -07:00
}
2011-09-29 05:02:49 -07:00
evas_event_thaw ( evas_object_evas_get ( obj ) ) ;
evas_event_thaw_eval ( evas_object_evas_get ( obj ) ) ;
2008-10-17 07:40:54 -07:00
}
2011-05-18 04:48:38 -07:00
2012-08-30 09:45:15 -07:00
_cursor_geometry_recalc ( obj ) ;
2008-10-14 01:05:30 -07:00
}
2012-02-27 17:50:19 -08:00
static void
2012-08-30 09:45:15 -07:00
_return_key_enabled_check ( Evas_Object * obj )
2012-02-27 17:50:19 -08:00
{
Eina_Bool return_key_disabled = EINA_FALSE ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
if ( ! sd - > auto_return_key ) return ;
2012-02-27 17:50:19 -08:00
if ( elm_entry_is_empty ( obj ) = = EINA_TRUE )
return_key_disabled = EINA_TRUE ;
elm_entry_input_panel_return_key_disabled_set ( obj , return_key_disabled ) ;
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_on_focus ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
2008-10-14 01:05:30 -07:00
{
2012-11-25 22:32:53 -08:00
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
2012-08-30 09:45:15 -07:00
Evas_Object * top ;
2012-09-28 07:07:16 -07:00
Eina_Bool top_is_win ;
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_FALSE ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
top = elm_widget_top_get ( obj ) ;
2012-09-28 07:07:16 -07:00
if ( ! strcmp ( evas_object_type_get ( top ) , " elm_win " ) )
top_is_win = EINA_TRUE ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
if ( ! sd - > editable ) return ;
2008-11-16 21:58:21 -08:00
if ( elm_widget_focus_get ( obj ) )
{
2012-08-30 09:45:15 -07:00
evas_object_focus_set ( sd - > entry_edje , EINA_TRUE ) ;
edje_object_signal_emit ( sd - > entry_edje , " elm,action,focus " , " elm " ) ;
2012-09-28 07:07:16 -07:00
if ( top & & top_is_win & & sd - > input_panel_enable )
2011-10-26 22:43:08 -07:00
elm_win_keyboard_mode_set ( top , ELM_WIN_KEYBOARD_ON ) ;
2011-03-14 19:01:42 -07:00
evas_object_smart_callback_call ( obj , SIG_FOCUSED , NULL ) ;
2012-08-30 09:45:15 -07:00
_return_key_enabled_check ( obj ) ;
2008-11-16 21:58:21 -08:00
}
else
{
2012-08-30 09:45:15 -07:00
edje_object_signal_emit ( sd - > entry_edje , " elm,action,unfocus " , " elm " ) ;
evas_object_focus_set ( sd - > entry_edje , EINA_FALSE ) ;
2012-09-28 07:07:16 -07:00
if ( top & & top_is_win & & sd - > input_panel_enable )
2011-10-26 22:43:08 -07:00
elm_win_keyboard_mode_set ( top , ELM_WIN_KEYBOARD_OFF ) ;
2011-03-14 19:01:42 -07:00
evas_object_smart_callback_call ( obj , SIG_UNFOCUSED , NULL ) ;
2012-11-29 00:58:49 -08:00
if ( _elm_config - > selection_clear_enable )
{
if ( ( sd - > have_selection ) & & ( ! sd - > hoversel ) )
{
sd - > sel_mode = EINA_FALSE ;
elm_widget_scroll_hold_pop ( obj ) ;
edje_object_part_text_select_allow_set ( sd - > entry_edje , " elm.text " , EINA_FALSE ) ;
edje_object_signal_emit ( sd - > entry_edje , " elm,state,select,off " , " elm " ) ;
edje_object_part_text_select_none ( sd - > entry_edje , " elm.text " ) ;
}
}
2008-11-16 21:58:21 -08:00
}
2011-10-11 19:49:23 -07:00
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_TRUE ;
2011-08-18 21:21:36 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_translate ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
2011-08-18 21:21:36 -07:00
{
2012-11-25 22:32:53 -08:00
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
2012-08-30 09:45:15 -07:00
evas_object_smart_callback_call ( obj , SIG_LANG_CHANGED , NULL ) ;
2012-01-09 02:33:59 -08:00
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_TRUE ;
2011-08-18 21:21:36 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_on_focus_region ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
2011-10-19 07:17:14 -07:00
{
2012-11-25 22:32:53 -08:00
Evas_Coord * x = va_arg ( * list , Evas_Coord * ) ;
Evas_Coord * y = va_arg ( * list , Evas_Coord * ) ;
Evas_Coord * w = va_arg ( * list , Evas_Coord * ) ;
Evas_Coord * h = va_arg ( * list , Evas_Coord * ) ;
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2011-10-19 07:17:14 -07:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_geometry_get
( sd - > entry_edje , " elm.text " , x , y , w , h ) ;
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_TRUE ;
2010-06-15 08:04:05 -07:00
}
2010-10-22 11:29:51 -07:00
static void
2012-11-25 22:32:53 -08:00
_show_region_hook ( void * data EINA_UNUSED ,
2012-08-30 09:45:15 -07:00
Evas_Object * obj )
2010-10-22 11:29:51 -07:00
{
2012-08-30 09:45:15 -07:00
Evas_Coord x , y , w , h ;
2010-10-22 11:29:51 -07:00
2011-06-17 02:44:31 -07:00
elm_widget_show_region_get ( obj , & x , & y , & w , & h ) ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_content_region_show ( x , y , w , h ) ) ;
2011-06-17 02:44:31 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_sub_object_del ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
2011-10-11 19:49:23 -07:00
{
2012-11-25 22:32:53 -08:00
Evas_Object * sobj = va_arg ( * list , Evas_Object * ) ;
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
if ( ret ) * ret = EINA_FALSE ;
2012-08-30 09:45:15 -07:00
/* unfortunately entry doesn't follow the signal pattern
* elm , state , icon , { visible , hidden } , so we have to replicate this
* smart function */
if ( sobj = = elm_layout_content_get ( obj , " elm.swallow.icon " ) )
2011-10-11 19:49:23 -07:00
{
2012-08-30 09:45:15 -07:00
elm_layout_signal_emit ( obj , " elm,action,hide,icon " , " elm " ) ;
2011-10-11 19:49:23 -07:00
}
2012-08-30 09:45:15 -07:00
else if ( sobj = = elm_layout_content_get ( obj , " elm.swallow.end " ) )
2011-10-11 19:49:23 -07:00
{
2012-08-30 09:45:15 -07:00
elm_layout_signal_emit ( obj , " elm,action,hide,end " , " elm " ) ;
2011-10-11 19:49:23 -07:00
}
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_wdg_sub_object_del ( sobj , ret ) ) ;
2012-11-25 22:32:53 -08:00
if ( ! ret ) return ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_TRUE ;
2011-10-11 19:49:23 -07:00
}
2009-03-19 06:36:46 -07:00
static void
_hoversel_position ( Evas_Object * obj )
{
Evas_Coord cx , cy , cw , ch , x , y , mw , mh ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
elementary / entry, list, scroller, fileselector_button, config, photocam, map, pan, bg, store, priv, pager, conform, box, clock, flipselector
fixed indentation, removed white spaces.
SVN revision: 58267
2011-04-01 12:08:56 -07:00
2011-04-01 05:10:24 -07:00
cx = cy = 0 ;
cw = ch = 1 ;
2012-08-30 09:45:15 -07:00
evas_object_geometry_get ( sd - > entry_edje , & x , & y , NULL , NULL ) ;
if ( sd - > use_down )
2011-04-01 05:10:24 -07:00
{
2012-08-30 09:45:15 -07:00
cx = sd - > downx - x ;
cy = sd - > downy - y ;
2011-04-01 05:10:24 -07:00
cw = 1 ;
ch = 1 ;
}
else
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_geometry_get
( sd - > entry_edje , " elm.text " , & cx , & cy , & cw , & ch ) ;
evas_object_size_hint_min_get ( sd - > hoversel , & mw , & mh ) ;
2009-03-19 06:36:46 -07:00
if ( cw < mw )
{
2011-03-14 19:01:42 -07:00
cx + = ( cw - mw ) / 2 ;
cw = mw ;
2009-03-19 06:36:46 -07:00
}
if ( ch < mh )
{
2011-03-14 19:01:42 -07:00
cy + = ( ch - mh ) / 2 ;
ch = mh ;
2009-03-19 06:36:46 -07:00
}
2012-08-30 09:45:15 -07:00
evas_object_move ( sd - > hoversel , x + cx , y + cy ) ;
evas_object_resize ( sd - > hoversel , cw , ch ) ;
2009-03-19 06:36:46 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_hover_del_job ( void * data )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2009-03-19 06:36:46 -07:00
2012-08-30 09:45:15 -07:00
if ( sd - > hoversel )
2009-12-07 06:19:20 -08:00
{
2012-08-30 09:45:15 -07:00
evas_object_del ( sd - > hoversel ) ;
sd - > hoversel = NULL ;
2009-12-07 06:19:20 -08:00
}
2012-08-30 09:45:15 -07:00
sd - > hov_deljob = NULL ;
2009-03-19 06:36:46 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_hover_dismissed_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2010-06-23 19:54:03 -07:00
2012-08-30 09:45:15 -07:00
sd - > use_down = 0 ;
if ( sd - > hoversel ) evas_object_hide ( sd - > hoversel ) ;
if ( sd - > sel_mode )
2010-03-25 21:45:11 -07:00
{
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
{
2012-08-30 09:45:15 -07:00
if ( ! sd - > password )
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_TRUE ) ;
2011-04-01 06:20:40 -07:00
}
2010-03-25 21:45:11 -07:00
}
2009-03-20 08:08:33 -07:00
elm_widget_scroll_freeze_pop ( data ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > hov_deljob ) ecore_job_del ( sd - > hov_deljob ) ;
sd - > hov_deljob = ecore_job_add ( _hover_del_job , data ) ;
2009-03-19 06:36:46 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_hover_selected_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
sd - > sel_mode = EINA_TRUE ;
edje_object_part_text_select_none ( sd - > entry_edje , " elm.text " ) ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
{
2012-08-30 09:45:15 -07:00
if ( ! sd - > password )
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_TRUE ) ;
2011-04-01 06:20:40 -07:00
}
2012-08-30 09:45:15 -07:00
edje_object_signal_emit ( sd - > entry_edje , " elm,state,select,on " , " elm " ) ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
2011-04-21 19:29:54 -07:00
elm_widget_scroll_hold_push ( data ) ;
2009-03-19 06:36:46 -07:00
}
2012-03-05 00:26:09 -08:00
static char *
2012-08-30 09:45:15 -07:00
_item_tags_remove ( const char * str )
2012-03-05 00:26:09 -08:00
{
char * ret ;
2012-08-30 09:45:15 -07:00
Eina_Strbuf * buf ;
2012-03-05 00:26:09 -08:00
if ( ! str )
return NULL ;
2012-08-30 09:45:15 -07:00
buf = eina_strbuf_new ( ) ;
2012-03-05 00:26:09 -08:00
if ( ! buf )
return NULL ;
if ( ! eina_strbuf_append ( buf , str ) )
2012-12-21 03:03:10 -08:00
{
eina_strbuf_free ( buf ) ;
return NULL ;
}
2012-03-05 00:26:09 -08:00
while ( EINA_TRUE )
{
const char * temp = eina_strbuf_string_get ( buf ) ;
2012-08-30 09:45:15 -07:00
char * start_tag = NULL ;
char * end_tag = NULL ;
size_t sindex ;
size_t eindex ;
start_tag = strstr ( temp , " <item " ) ;
if ( ! start_tag )
start_tag = strstr ( temp , " </item " ) ;
if ( start_tag )
end_tag = strstr ( start_tag , " > " ) ;
2012-03-05 00:26:09 -08:00
else
break ;
2012-08-30 09:45:15 -07:00
if ( ! end_tag | | start_tag > end_tag )
2012-03-05 00:26:09 -08:00
break ;
2012-08-30 09:45:15 -07:00
sindex = start_tag - temp ;
eindex = end_tag - temp + 1 ;
2012-03-05 00:26:09 -08:00
if ( ! eina_strbuf_remove ( buf , sindex , eindex ) )
break ;
}
2012-08-30 09:45:15 -07:00
2012-03-05 00:26:09 -08:00
ret = eina_strbuf_string_steal ( buf ) ;
eina_strbuf_free ( buf ) ;
2012-08-30 09:45:15 -07:00
2012-03-05 00:26:09 -08:00
return ret ;
}
2011-08-03 02:00:36 -07:00
void
2012-08-30 09:45:15 -07:00
_elm_entry_entry_paste ( Evas_Object * obj ,
const char * entry )
2011-08-03 02:00:36 -07:00
{
2012-03-05 00:26:09 -08:00
char * str = NULL ;
2012-03-28 02:02:22 -07:00
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
ELM_ENTRY_DATA_GET ( obj , sd ) ;
if ( sd - > cnp_mode = = ELM_CNP_MODE_NO_IMAGE )
2012-03-05 00:26:09 -08:00
{
2012-08-30 09:45:15 -07:00
str = _item_tags_remove ( entry ) ;
2012-03-05 00:31:58 -08:00
if ( ! str ) str = strdup ( entry ) ;
2012-03-05 00:26:09 -08:00
}
else
str = strdup ( entry ) ;
2012-03-05 00:31:58 -08:00
if ( ! str ) str = ( char * ) entry ;
2012-03-05 00:26:09 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_user_insert ( sd - > entry_edje , " elm.text " , str ) ;
2012-03-05 00:31:58 -08:00
if ( str ! = entry ) free ( str ) ;
2011-08-03 02:00:36 -07:00
}
2009-03-19 06:36:46 -07:00
static void
2012-08-30 09:45:15 -07:00
_paste_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_SELECTION_PASTE , NULL ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > sel_notify_handler )
2009-03-19 06:36:46 -07:00
{
# ifdef HAVE_ELEMENTARY_X
2012-03-05 00:26:09 -08:00
Elm_Sel_Format formats = ELM_SEL_FORMAT_MARKUP ;
2012-08-30 09:45:15 -07:00
sd - > selection_asked = EINA_TRUE ;
if ( sd - > cnp_mode = = ELM_CNP_MODE_PLAINTEXT )
2012-03-05 00:26:09 -08:00
formats = ELM_SEL_FORMAT_TEXT ;
2012-08-30 09:45:15 -07:00
else if ( sd - > cnp_mode ! = ELM_CNP_MODE_NO_IMAGE )
2011-03-14 19:01:42 -07:00
formats | = ELM_SEL_FORMAT_IMAGE ;
2012-08-30 09:45:15 -07:00
elm_cnp_selection_get
( data , ELM_SEL_TYPE_CLIPBOARD , formats , NULL , NULL ) ;
2012-08-28 23:52:48 -07:00
# endif
}
else
{
# ifdef HAVE_ELEMENTARY_WAYLAND
Elm_Sel_Format formats = ELM_SEL_FORMAT_MARKUP ;
2012-08-30 23:20:58 -07:00
sd - > selection_asked = EINA_TRUE ;
if ( sd - > cnp_mode = = ELM_CNP_MODE_PLAINTEXT )
2012-08-28 23:52:48 -07:00
formats = ELM_SEL_FORMAT_TEXT ;
2012-08-30 23:20:58 -07:00
else if ( sd - > cnp_mode ! = ELM_CNP_MODE_NO_IMAGE )
2012-08-28 23:52:48 -07:00
formats | = ELM_SEL_FORMAT_IMAGE ;
elm_cnp_selection_get ( data , ELM_SEL_TYPE_CLIPBOARD , formats , NULL , NULL ) ;
2009-07-06 23:46:51 -07:00
# endif
2009-03-19 06:36:46 -07:00
}
}
static void
2012-08-30 09:45:15 -07:00
_selection_store ( Elm_Sel_Type seltype ,
Evas_Object * obj )
2009-03-19 06:36:46 -07:00
{
2010-06-05 21:09:56 -07:00
const char * sel ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
sel = edje_object_part_text_selection_get ( sd - > entry_edje , " elm.text " ) ;
if ( ( ! sel ) | | ( ! sel [ 0 ] ) ) return ; /* avoid deleting our own selection */
elm_cnp_selection_set
( obj , seltype , ELM_SEL_FORMAT_MARKUP , sel , strlen ( sel ) ) ;
2011-12-27 03:24:13 -08:00
if ( seltype = = ELM_SEL_TYPE_CLIPBOARD )
2012-08-30 09:45:15 -07:00
eina_stringshare_replace ( & sd - > cut_sel , sel ) ;
2009-03-19 06:36:46 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_cut_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2009-09-26 11:00:51 -07:00
2013-04-15 21:16:44 -07:00
evas_object_smart_callback_call ( data , SIG_SELECTION_CUT , NULL ) ;
2010-06-17 01:50:43 -07:00
/* Store it */
2012-08-30 09:45:15 -07:00
sd - > sel_mode = EINA_FALSE ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_FALSE ) ;
edje_object_signal_emit ( sd - > entry_edje , " elm,state,select,off " , " elm " ) ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
2011-04-21 19:29:54 -07:00
elm_widget_scroll_hold_pop ( data ) ;
2012-08-30 09:45:15 -07:00
_selection_store ( ELM_SEL_TYPE_CLIPBOARD , data ) ;
edje_object_part_text_user_insert ( sd - > entry_edje , " elm.text " , " " ) ;
elm_layout_sizing_eval ( data ) ;
2009-03-19 06:36:46 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_copy_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2013-04-15 21:16:44 -07:00
evas_object_smart_callback_call ( data , SIG_SELECTION_COPY , NULL ) ;
2012-08-30 09:45:15 -07:00
sd - > sel_mode = EINA_FALSE ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
{
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_FALSE ) ;
edje_object_signal_emit ( sd - > entry_edje , " elm,state,select,off " , " elm " ) ;
2011-04-01 06:20:40 -07:00
elm_widget_scroll_hold_pop ( data ) ;
}
2012-08-30 09:45:15 -07:00
_selection_store ( ELM_SEL_TYPE_CLIPBOARD , data ) ;
2009-03-19 06:36:46 -07:00
}
2009-03-22 21:55:37 -07:00
static void
2012-08-30 09:45:15 -07:00
_hover_cancel_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2009-03-22 21:55:37 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
sd - > sel_mode = EINA_FALSE ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_FALSE ) ;
edje_object_signal_emit ( sd - > entry_edje , " elm,state,select,off " , " elm " ) ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
2011-04-21 19:29:54 -07:00
elm_widget_scroll_hold_pop ( data ) ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_none ( sd - > entry_edje , " elm.text " ) ;
2009-03-22 21:55:37 -07:00
}
2009-09-02 05:48:00 -07:00
static void
2012-08-30 09:45:15 -07:00
_hover_item_clicked_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2009-09-02 05:48:00 -07:00
{
Elm_Entry_Context_Menu_Item * it = data ;
2013-02-27 04:06:05 -08:00
if ( ! it ) return ;
2012-08-30 09:45:15 -07:00
2013-02-27 04:06:05 -08:00
if ( it - > func ) it - > func ( it - > data , it - > obj , it ) ;
2009-09-02 05:48:00 -07:00
}
2011-04-01 05:10:24 -07:00
static void
2012-08-30 09:45:15 -07:00
_menu_call ( Evas_Object * obj )
2009-03-19 06:36:46 -07:00
{
2009-05-13 05:21:52 -07:00
Evas_Object * top ;
2009-09-02 05:48:00 -07:00
const Eina_List * l ;
const Elm_Entry_Context_Menu_Item * it ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
if ( ( sd - > api ) & & ( sd - > api - > obj_longpress ) )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
sd - > api - > obj_longpress ( obj ) ;
2009-03-19 06:36:46 -07:00
}
2012-08-30 09:45:15 -07:00
else if ( sd - > context_menu )
2009-03-19 06:36:46 -07:00
{
2010-01-18 02:28:00 -08:00
const char * context_menu_orientation ;
2013-02-17 06:36:00 -08:00
Eina_Bool ownersel ;
2010-02-08 19:27:11 -08:00
2013-02-17 06:36:00 -08:00
ownersel = elm_selection_selection_has_owner ( obj ) ;
if ( ! sd - > items )
{
/* prevent stupid blank hoversel */
if ( sd - > have_selection & & sd - > password ) return ;
2013-05-14 06:06:21 -07:00
if ( _elm_config - > desktop_entry & & ( ( ! sd - > editable ) | | ( ! ownersel ) ) ) return ;
2013-02-17 06:36:00 -08:00
}
2012-08-30 09:45:15 -07:00
if ( sd - > hoversel ) evas_object_del ( sd - > hoversel ) ;
2011-04-01 05:10:24 -07:00
else elm_widget_scroll_freeze_push ( obj ) ;
2012-08-30 09:45:15 -07:00
sd - > hoversel = elm_hoversel_add ( obj ) ;
2010-01-18 02:28:00 -08:00
context_menu_orientation = edje_object_data_get
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " context_menu_orientation " ) ;
2010-01-18 02:28:00 -08:00
if ( ( context_menu_orientation ) & &
( ! strcmp ( context_menu_orientation , " horizontal " ) ) )
2012-08-30 09:45:15 -07:00
elm_hoversel_horizontal_set ( sd - > hoversel , EINA_TRUE ) ;
elm_object_style_set ( sd - > hoversel , " entry " ) ;
elm_widget_sub_object_add ( obj , sd - > hoversel ) ;
elm_object_text_set ( sd - > hoversel , " Text " ) ;
2011-04-01 05:10:24 -07:00
top = elm_widget_top_get ( obj ) ;
2012-08-30 09:45:15 -07:00
if ( top ) elm_hoversel_hover_parent_set ( sd - > hoversel , top ) ;
evas_object_smart_callback_add
( sd - > hoversel , " dismissed " , _hover_dismissed_cb , obj ) ;
if ( sd - > have_selection )
2009-12-01 03:03:14 -08:00
{
2012-08-30 09:45:15 -07:00
if ( ! sd - > password )
2010-01-27 01:23:54 -08:00
{
2012-11-22 07:15:55 -08:00
elm_hoversel_item_add
( sd - > hoversel , E_ ( " Copy " ) , NULL , ELM_ICON_NONE ,
_copy_cb , obj ) ;
if ( sd - > editable )
elm_hoversel_item_add
( sd - > hoversel , E_ ( " Cut " ) , NULL , ELM_ICON_NONE ,
_cut_cb , obj ) ;
2012-08-30 09:45:15 -07:00
elm_hoversel_item_add
( sd - > hoversel , E_ ( " Cancel " ) , NULL , ELM_ICON_NONE ,
_hover_cancel_cb , obj ) ;
2010-01-27 01:23:54 -08:00
}
2009-12-01 03:03:14 -08:00
}
2011-04-01 06:35:39 -07:00
else
{
2012-08-30 09:45:15 -07:00
if ( ! sd - > sel_mode )
2011-04-01 06:35:39 -07:00
{
if ( ! _elm_config - > desktop_entry )
{
2012-08-30 09:45:15 -07:00
if ( ! sd - > password )
elm_hoversel_item_add
( sd - > hoversel , E_ ( " Select " ) , NULL , ELM_ICON_NONE ,
_hover_selected_cb , obj ) ;
2011-04-01 06:35:39 -07:00
}
2013-02-17 06:36:00 -08:00
if ( ownersel )
2011-04-01 06:35:39 -07:00
{
2012-08-30 09:45:15 -07:00
if ( sd - > editable )
elm_hoversel_item_add
( sd - > hoversel , E_ ( " Paste " ) , NULL , ELM_ICON_NONE ,
_paste_cb , obj ) ;
2011-04-01 06:35:39 -07:00
}
}
2012-11-22 07:15:55 -08:00
else
elm_hoversel_item_add
( sd - > hoversel , E_ ( " Cancel " ) , NULL , ELM_ICON_NONE ,
_hover_cancel_cb , obj ) ;
2011-04-01 06:35:39 -07:00
}
2012-08-30 09:45:15 -07:00
2012-10-01 00:36:27 -07:00
EINA_LIST_FOREACH ( sd - > items , l , it )
2009-12-01 03:03:14 -08:00
{
2012-08-30 09:45:15 -07:00
elm_hoversel_item_add ( sd - > hoversel , it - > label , it - > icon_file ,
it - > icon_type , _hover_item_clicked_cb , it ) ;
2009-12-01 03:03:14 -08:00
}
2012-08-30 09:45:15 -07:00
if ( sd - > hoversel )
2009-12-01 03:03:14 -08:00
{
2011-04-01 05:10:24 -07:00
_hoversel_position ( obj ) ;
2012-08-30 09:45:15 -07:00
evas_object_show ( sd - > hoversel ) ;
elm_hoversel_hover_begin ( sd - > hoversel ) ;
2009-12-01 03:03:14 -08:00
}
2012-08-30 09:45:15 -07:00
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
{
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_FALSE ) ;
edje_object_part_text_select_abort ( sd - > entry_edje , " elm.text " ) ;
2011-04-01 06:20:40 -07:00
}
2009-03-19 06:36:46 -07:00
}
2011-04-01 05:10:24 -07:00
}
static Eina_Bool
2012-08-30 09:45:15 -07:00
_long_press_cb ( void * data )
2011-04-01 05:10:24 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2012-03-19 09:56:28 -07:00
if ( ! _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
_menu_call ( data ) ;
sd - > longpress_timer = NULL ;
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_LONGPRESSED , NULL ) ;
2012-08-30 09:45:15 -07:00
2010-06-25 02:58:14 -07:00
return ECORE_CALLBACK_CANCEL ;
2009-03-19 06:36:46 -07:00
}
2013-04-02 10:23:20 -07:00
static void
_key_down_cb ( void * data ,
Evas * evas __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
void * event_info )
{
Evas_Event_Key_Down * ev = event_info ;
if ( ! strcmp ( ev - > keyname , " Menu " ) )
_menu_call ( data ) ;
}
2009-03-19 06:36:46 -07:00
static void
2012-08-30 09:45:15 -07:00
_mouse_down_cb ( void * data ,
Evas * evas __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
void * event_info )
2009-03-19 06:36:46 -07:00
{
Evas_Event_Mouse_Down * ev = event_info ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( sd - > disabled ) return ;
2009-03-19 06:36:46 -07:00
if ( ev - > event_flags & EVAS_EVENT_FLAG_ON_HOLD ) return ;
2012-08-30 09:45:15 -07:00
sd - > downx = ev - > canvas . x ;
sd - > downy = ev - > canvas . y ;
2011-04-01 05:10:24 -07:00
if ( ev - > button = = 1 )
{
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > longpress_timer , ecore_timer_del ) ;
2012-08-30 09:45:15 -07:00
sd - > longpress_timer = ecore_timer_add
( _elm_config - > longpress_timeout , _long_press_cb , data ) ;
2011-04-01 05:10:24 -07:00
}
2012-08-02 22:33:44 -07:00
else if ( ev - > button = = 3 )
{
if ( _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
_menu_call ( data ) ;
2012-08-02 22:33:44 -07:00
}
2009-03-19 06:36:46 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_mouse_up_cb ( void * data ,
Evas * evas __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
void * event_info )
2009-03-19 06:36:46 -07:00
{
Evas_Event_Mouse_Up * ev = event_info ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( sd - > disabled ) return ;
2011-04-01 05:10:24 -07:00
if ( ev - > button = = 1 )
{
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > longpress_timer , ecore_timer_del ) ;
2011-04-01 05:10:24 -07:00
}
2012-03-19 09:56:28 -07:00
else if ( ( ev - > button = = 3 ) & & ( ! _elm_config - > desktop_entry ) )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
sd - > use_down = 1 ;
_menu_call ( data ) ;
2009-03-19 06:36:46 -07:00
}
}
static void
2012-08-30 09:45:15 -07:00
_mouse_move_cb ( void * data ,
Evas * evas __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
void * event_info )
2009-03-19 06:36:46 -07:00
{
Evas_Event_Mouse_Move * ev = event_info ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( sd - > disabled ) return ;
if ( ! sd - > sel_mode )
2009-03-19 06:36:46 -07:00
{
2011-03-14 19:01:42 -07:00
if ( ev - > event_flags & EVAS_EVENT_FLAG_ON_HOLD )
{
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > longpress_timer , ecore_timer_del ) ;
2011-03-14 19:01:42 -07:00
}
2012-08-30 09:45:15 -07:00
else if ( sd - > longpress_timer )
2011-03-14 19:01:42 -07:00
{
Evas_Coord dx , dy ;
2012-08-30 09:45:15 -07:00
dx = sd - > downx - ev - > cur . canvas . x ;
2011-03-14 19:01:42 -07:00
dx * = dx ;
2012-08-30 09:45:15 -07:00
dy = sd - > downy - ev - > cur . canvas . y ;
2011-03-14 19:01:42 -07:00
dy * = dy ;
if ( ( dx + dy ) >
( ( _elm_config - > finger_size / 2 ) *
( _elm_config - > finger_size / 2 ) ) )
{
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > longpress_timer , ecore_timer_del ) ;
2011-03-14 19:01:42 -07:00
}
}
2009-03-19 06:36:46 -07:00
}
2012-08-30 09:45:15 -07:00
else if ( sd - > longpress_timer )
2009-03-19 06:36:46 -07:00
{
2011-03-14 19:01:42 -07:00
Evas_Coord dx , dy ;
2012-08-30 09:45:15 -07:00
dx = sd - > downx - ev - > cur . canvas . x ;
2011-03-14 19:01:42 -07:00
dx * = dx ;
2012-08-30 09:45:15 -07:00
dy = sd - > downy - ev - > cur . canvas . y ;
2011-03-14 19:01:42 -07:00
dy * = dy ;
if ( ( dx + dy ) >
( ( _elm_config - > finger_size / 2 ) *
( _elm_config - > finger_size / 2 ) ) )
{
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > longpress_timer , ecore_timer_del ) ;
2011-03-14 19:01:42 -07:00
}
2008-11-15 05:58:50 -08:00
}
}
2008-10-16 02:17:57 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_changed_handle ( void * data ,
const char * event )
2008-10-16 02:17:57 -07:00
{
2011-05-01 02:40:19 -07:00
Evas_Coord minh ;
2012-04-08 22:25:27 -07:00
const char * text ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2011-09-29 05:02:49 -07:00
evas_event_freeze ( evas_object_evas_get ( data ) ) ;
2012-08-30 09:45:15 -07:00
sd - > changed = EINA_TRUE ;
/* Reset the size hints which are no more relevant. Keep the
* height , this is a hack , but doesn ' t really matter cause we ' ll
* re - eval in a moment . */
2011-05-01 02:40:19 -07:00
evas_object_size_hint_min_get ( data , NULL , & minh ) ;
evas_object_size_hint_min_set ( data , - 1 , minh ) ;
2012-08-30 09:45:15 -07:00
elm_layout_sizing_eval ( data ) ;
if ( sd - > text ) eina_stringshare_del ( sd - > text ) ;
sd - > text = NULL ;
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > delay_write , ecore_timer_del ) ;
2011-09-29 05:02:49 -07:00
evas_event_thaw ( evas_object_evas_get ( data ) ) ;
evas_event_thaw_eval ( evas_object_evas_get ( data ) ) ;
2012-08-30 09:45:15 -07:00
if ( ( sd - > auto_save ) & & ( sd - > file ) )
sd - > delay_write = ecore_timer_add ( 2.0 , _delay_write , data ) ;
2013-01-18 22:17:05 -08:00
2012-08-30 09:45:15 -07:00
_return_key_enabled_check ( data ) ;
text = edje_object_part_text_get ( sd - > entry_edje , " elm.text " ) ;
2012-04-08 22:25:27 -07:00
if ( text )
{
if ( text [ 0 ] )
2012-08-30 09:45:15 -07:00
_elm_entry_guide_update ( data , EINA_TRUE ) ;
2012-04-08 22:25:27 -07:00
else
2012-08-30 09:45:15 -07:00
_elm_entry_guide_update ( data , EINA_FALSE ) ;
2012-04-08 22:25:27 -07:00
}
2013-01-18 22:17:05 -08:00
/* callback - this could call callbacks that delete the
* entry . . . thus . . . any access to sd after this could be
* invalid */
evas_object_smart_callback_call ( data , event , NULL ) ;
2008-10-16 02:17:57 -07:00
}
2011-06-24 01:44:39 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_changed_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-06-24 01:44:39 -07:00
{
2012-08-30 09:45:15 -07:00
_entry_changed_handle ( data , SIG_CHANGED ) ;
2011-06-24 01:44:39 -07:00
}
2011-08-03 02:00:36 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_changed_user_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-08-03 02:00:36 -07:00
{
2011-11-14 05:56:02 -08:00
Elm_Entry_Change_Info info ;
Edje_Entry_Change_Info * edje_info = ( Edje_Entry_Change_Info * )
2012-08-30 09:45:15 -07:00
edje_object_signal_callback_extra_data_get ( ) ;
2011-11-14 05:56:02 -08:00
if ( edje_info )
{
memcpy ( & info , edje_info , sizeof ( info ) ) ;
evas_object_smart_callback_call ( data , SIG_CHANGED_USER , & info ) ;
}
else
{
evas_object_smart_callback_call ( data , SIG_CHANGED_USER , NULL ) ;
}
2011-08-03 02:00:36 -07:00
}
2011-06-24 01:44:39 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_preedit_changed_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-06-24 01:44:39 -07:00
{
2012-08-30 09:45:15 -07:00
_entry_changed_handle ( data , SIG_PREEDIT_CHANGED ) ;
2011-06-24 01:44:39 -07:00
}
2011-11-14 05:55:57 -08:00
static void
2012-08-30 09:45:15 -07:00
_entry_undo_request_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-11-14 05:55:57 -08:00
{
evas_object_smart_callback_call ( data , SIG_UNDO_REQUEST , NULL ) ;
}
static void
2012-08-30 09:45:15 -07:00
_entry_redo_request_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-11-14 05:55:57 -08:00
{
evas_object_smart_callback_call ( data , SIG_REDO_REQUEST , NULL ) ;
}
2008-10-16 02:17:57 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_selection_start_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 02:17:57 -07:00
{
2009-02-25 11:50:45 -08:00
const Eina_List * l ;
Evas_Object * entry ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2012-08-02 22:43:44 -07:00
if ( ! elm_object_focus_get ( data ) ) elm_object_focus_set ( data , EINA_TRUE ) ;
2012-10-01 00:36:27 -07:00
EINA_LIST_FOREACH ( entries , l , entry )
2008-11-18 00:45:38 -08:00
{
2011-03-14 19:01:42 -07:00
if ( entry ! = data ) elm_entry_select_none ( entry ) ;
2008-11-18 00:45:38 -08:00
}
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_SELECTION_START , NULL ) ;
2010-06-21 22:12:08 -07:00
# ifdef HAVE_ELEMENTARY_X
2012-08-30 09:45:15 -07:00
if ( sd - > sel_notify_handler )
2008-11-18 22:23:08 -08:00
{
2011-03-14 19:01:42 -07:00
const char * txt = elm_entry_selection_get ( data ) ;
Evas_Object * top ;
2009-07-06 23:46:51 -07:00
2011-03-14 19:01:42 -07:00
top = elm_widget_top_get ( data ) ;
2012-01-01 04:22:16 -08:00
if ( txt & & top & & ( elm_win_xwindow_get ( top ) ) )
2012-02-27 22:17:22 -08:00
elm_cnp_selection_set ( data , ELM_SEL_TYPE_PRIMARY ,
2011-12-27 03:24:13 -08:00
ELM_SEL_FORMAT_MARKUP , txt , strlen ( txt ) ) ;
2009-07-06 23:46:51 -07:00
}
2010-06-21 22:12:08 -07:00
# endif
2008-10-16 02:17:57 -07:00
}
2011-07-24 01:17:18 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_selection_all_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-07-24 01:17:18 -07:00
{
elm_entry_select_all ( data ) ;
}
2011-07-24 01:36:42 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_selection_none_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-07-24 01:36:42 -07:00
{
elm_entry_select_none ( data ) ;
}
2008-10-16 02:17:57 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_selection_changed_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
sd - > have_selection = EINA_TRUE ;
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_SELECTION_CHANGED , NULL ) ;
2012-08-30 09:45:15 -07:00
_selection_store ( ELM_SEL_TYPE_PRIMARY , data ) ;
2008-10-16 02:17:57 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_selection_cleared_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( ! sd - > have_selection ) return ;
sd - > have_selection = EINA_FALSE ;
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_SELECTION_CLEARED , NULL ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > sel_notify_handler )
2008-11-18 22:23:08 -08:00
{
2012-08-30 09:45:15 -07:00
if ( sd - > cut_sel )
2011-03-14 19:01:42 -07:00
{
2008-12-09 22:43:21 -08:00
# ifdef HAVE_ELEMENTARY_X
2011-03-14 19:01:42 -07:00
Evas_Object * top ;
2009-07-06 23:46:51 -07:00
2011-03-14 19:01:42 -07:00
top = elm_widget_top_get ( data ) ;
if ( ( top ) & & ( elm_win_xwindow_get ( top ) ) )
2012-08-30 09:45:15 -07:00
elm_cnp_selection_set
( data , ELM_SEL_TYPE_PRIMARY , ELM_SEL_FORMAT_MARKUP ,
sd - > cut_sel , strlen ( sd - > cut_sel ) ) ;
2009-07-06 23:46:51 -07:00
# endif
2012-08-30 09:45:15 -07:00
eina_stringshare_del ( sd - > cut_sel ) ;
sd - > cut_sel = NULL ;
2011-03-14 19:01:42 -07:00
}
else
{
2008-12-09 22:43:21 -08:00
# ifdef HAVE_ELEMENTARY_X
2011-03-14 19:01:42 -07:00
Evas_Object * top ;
2009-07-06 23:46:51 -07:00
2011-03-14 19:01:42 -07:00
top = elm_widget_top_get ( data ) ;
if ( ( top ) & & ( elm_win_xwindow_get ( top ) ) )
2012-02-22 18:52:11 -08:00
elm_object_cnp_selection_clear ( data , ELM_SEL_TYPE_PRIMARY ) ;
2009-07-06 23:46:51 -07:00
# endif
2011-03-14 19:01:42 -07:00
}
2008-11-18 22:23:08 -08:00
}
2008-10-16 02:17:57 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_paste_request_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission ,
const char * source __UNUSED__ )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2012-03-29 14:24:00 -07:00
# ifdef HAVE_ELEMENTARY_X
2011-12-27 03:24:13 -08:00
Elm_Sel_Type type = ( emission [ sizeof ( " ntry,paste,request, " ) ] = = ' 1 ' ) ?
ELM_SEL_TYPE_PRIMARY : ELM_SEL_TYPE_CLIPBOARD ;
2012-03-29 14:24:00 -07:00
# endif
2012-08-30 09:45:15 -07:00
if ( ! sd - > editable ) return ;
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_SELECTION_PASTE , NULL ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > sel_notify_handler )
2008-11-18 22:23:08 -08:00
{
2008-12-09 22:43:21 -08:00
# ifdef HAVE_ELEMENTARY_X
2011-03-14 19:01:42 -07:00
Evas_Object * top ;
2009-07-06 23:46:51 -07:00
2011-03-14 19:01:42 -07:00
top = elm_widget_top_get ( data ) ;
if ( ( top ) & & ( elm_win_xwindow_get ( top ) ) )
{
2012-03-05 00:26:09 -08:00
Elm_Sel_Format formats = ELM_SEL_FORMAT_MARKUP ;
2012-08-30 09:45:15 -07:00
sd - > selection_asked = EINA_TRUE ;
if ( sd - > cnp_mode = = ELM_CNP_MODE_PLAINTEXT )
2012-03-05 00:26:09 -08:00
formats = ELM_SEL_FORMAT_TEXT ;
2012-08-30 09:45:15 -07:00
else if ( sd - > cnp_mode ! = ELM_CNP_MODE_NO_IMAGE )
2012-03-05 00:26:09 -08:00
formats | = ELM_SEL_FORMAT_IMAGE ;
2012-08-30 09:45:15 -07:00
elm_cnp_selection_get ( data , type , formats , NULL , NULL ) ;
2011-03-14 19:01:42 -07:00
}
2009-07-06 23:46:51 -07:00
# endif
2008-11-18 22:23:08 -08:00
}
2008-10-16 02:17:57 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_copy_notify_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
_copy_cb ( data , NULL , NULL ) ;
2008-10-16 02:17:57 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_cut_notify_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
_cut_cb ( data , NULL , NULL ) ;
2008-10-16 02:17:57 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_cursor_changed_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
sd - > cursor_pos = edje_object_part_text_cursor_pos_get
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
sd - > cur_changed = EINA_TRUE ;
_cursor_geometry_recalc ( data ) ;
2008-10-16 23:41:07 -07:00
}
2011-12-15 06:42:22 -08:00
static void
2012-08-30 09:45:15 -07:00
_entry_cursor_changed_manual_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-12-15 06:42:22 -08:00
{
evas_object_smart_callback_call ( data , SIG_CURSOR_CHANGED_MANUAL , NULL ) ;
}
2011-07-21 14:19:55 -07:00
static void
2012-08-30 09:45:15 -07:00
_signal_anchor_geoms_do_things_with_lol ( Elm_Entry_Smart_Data * sd ,
Elm_Entry_Anchor_Info * ei )
2011-07-21 14:19:55 -07:00
{
Evas_Textblock_Rectangle * r ;
2012-08-30 09:45:15 -07:00
const Eina_List * geoms , * l ;
2011-07-21 14:19:55 -07:00
Evas_Coord px , py , x , y ;
2012-08-30 09:45:15 -07:00
geoms = edje_object_part_text_anchor_geometry_get
( sd - > entry_edje , " elm.text " , ei - > name ) ;
2011-07-21 14:19:55 -07:00
if ( ! geoms ) return ;
2012-08-30 09:45:15 -07:00
evas_object_geometry_get ( sd - > entry_edje , & x , & y , NULL , NULL ) ;
evas_pointer_canvas_xy_get
( evas_object_evas_get ( sd - > entry_edje ) , & px , & py ) ;
2011-07-21 14:19:55 -07:00
2012-10-01 00:36:27 -07:00
EINA_LIST_FOREACH ( geoms , l , r )
2011-07-21 14:19:55 -07:00
{
if ( ( ( r - > x + x ) < = px ) & & ( ( r - > y + y ) < = py ) & &
( ( r - > x + x + r - > w ) > px ) & & ( ( r - > y + y + r - > h ) > py ) )
{
ei - > x = r - > x + x ;
ei - > y = r - > y + y ;
ei - > w = r - > w ;
ei - > h = r - > h ;
break ;
}
}
}
2008-10-16 23:41:07 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_anchor_down_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 23:41:07 -07:00
{
2011-07-21 14:19:55 -07:00
Elm_Entry_Anchor_Info ei ;
2011-07-22 21:00:49 -07:00
const char * p ;
char * p2 ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2011-07-22 21:00:49 -07:00
p = emission + sizeof ( " nchor,mouse,down, " ) ;
ei . button = strtol ( p , & p2 , 10 ) ;
2011-08-25 14:57:23 -07:00
ei . name = p2 + 1 ;
2011-07-21 14:19:55 -07:00
ei . x = ei . y = ei . w = ei . h = 0 ;
2012-08-30 09:45:15 -07:00
_signal_anchor_geoms_do_things_with_lol ( sd , & ei ) ;
2011-07-21 14:19:55 -07:00
2012-08-30 09:45:15 -07:00
if ( ! sd - > disabled )
2011-07-21 14:19:55 -07:00
evas_object_smart_callback_call ( data , SIG_ANCHOR_DOWN , & ei ) ;
2008-10-16 23:41:07 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_anchor_up_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-03-10 02:15:58 -08:00
{
2011-07-21 14:19:55 -07:00
Elm_Entry_Anchor_Info ei ;
2011-07-22 21:00:49 -07:00
const char * p ;
char * p2 ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2011-07-22 21:00:49 -07:00
p = emission + sizeof ( " nchor,mouse,up, " ) ;
ei . button = strtol ( p , & p2 , 10 ) ;
2011-08-25 14:57:23 -07:00
ei . name = p2 + 1 ;
2011-07-21 14:19:55 -07:00
ei . x = ei . y = ei . w = ei . h = 0 ;
2012-08-30 09:45:15 -07:00
_signal_anchor_geoms_do_things_with_lol ( sd , & ei ) ;
2011-07-21 14:19:55 -07:00
2012-08-30 09:45:15 -07:00
if ( ! sd - > disabled )
2011-07-21 14:19:55 -07:00
evas_object_smart_callback_call ( data , SIG_ANCHOR_UP , & ei ) ;
2011-03-10 02:15:58 -08:00
}
static void
2012-08-30 09:45:15 -07:00
_anchor_hover_del_cb ( void * data ,
Evas * e __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
{
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( sd - > anchor_hover . pop ) evas_object_del ( sd - > anchor_hover . pop ) ;
sd - > anchor_hover . pop = NULL ;
evas_object_event_callback_del_full
( sd - > anchor_hover . hover , EVAS_CALLBACK_DEL , _anchor_hover_del_cb , obj ) ;
}
static void
_anchor_hover_clicked_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
{
elm_entry_anchor_hover_end ( data ) ;
}
static void
_entry_hover_anchor_clicked_do ( Evas_Object * obj ,
Elm_Entry_Anchor_Info * info )
{
Evas_Object * hover_parent ;
Evas_Coord x , w , y , h , px , py ;
Elm_Entry_Anchor_Hover_Info ei ;
ELM_ENTRY_DATA_GET ( obj , sd ) ;
ei . anchor_info = info ;
sd - > anchor_hover . pop = elm_icon_add ( obj ) ;
evas_object_move ( sd - > anchor_hover . pop , info - > x , info - > y ) ;
evas_object_resize ( sd - > anchor_hover . pop , info - > w , info - > h ) ;
sd - > anchor_hover . hover = elm_hover_add ( obj ) ;
evas_object_event_callback_add
( sd - > anchor_hover . hover , EVAS_CALLBACK_DEL , _anchor_hover_del_cb , obj ) ;
elm_widget_mirrored_set
( sd - > anchor_hover . hover , elm_widget_mirrored_get ( obj ) ) ;
if ( sd - > anchor_hover . hover_style )
elm_object_style_set
( sd - > anchor_hover . hover , sd - > anchor_hover . hover_style ) ;
hover_parent = sd - > anchor_hover . hover_parent ;
if ( ! hover_parent ) hover_parent = obj ;
elm_hover_parent_set ( sd - > anchor_hover . hover , hover_parent ) ;
elm_hover_target_set ( sd - > anchor_hover . hover , sd - > anchor_hover . pop ) ;
ei . hover = sd - > anchor_hover . hover ;
evas_object_geometry_get ( hover_parent , & x , & y , & w , & h ) ;
ei . hover_parent . x = x ;
ei . hover_parent . y = y ;
ei . hover_parent . w = w ;
ei . hover_parent . h = h ;
px = info - > x + ( info - > w / 2 ) ;
py = info - > y + ( info - > h / 2 ) ;
ei . hover_left = 1 ;
if ( px < ( x + ( w / 3 ) ) ) ei . hover_left = 0 ;
ei . hover_right = 1 ;
if ( px > ( x + ( ( w * 2 ) / 3 ) ) ) ei . hover_right = 0 ;
ei . hover_top = 1 ;
if ( py < ( y + ( h / 3 ) ) ) ei . hover_top = 0 ;
ei . hover_bottom = 1 ;
if ( py > ( y + ( ( h * 2 ) / 3 ) ) ) ei . hover_bottom = 0 ;
/* Swap right and left because they switch sides in RTL */
if ( elm_widget_mirrored_get ( sd - > anchor_hover . hover ) )
{
Eina_Bool tmp = ei . hover_left ;
ei . hover_left = ei . hover_right ;
ei . hover_right = tmp ;
}
evas_object_smart_callback_call ( obj , SIG_ANCHOR_HOVER_OPENED , & ei ) ;
evas_object_smart_callback_add
( sd - > anchor_hover . hover , " clicked " , _anchor_hover_clicked_cb , obj ) ;
/* FIXME: Should just check if there's any callback registered to
* the smart events instead . This is used to determine if anyone
* cares about the hover or not . */
if ( ! elm_layout_content_get ( sd - > anchor_hover . hover , " middle " ) & &
! elm_layout_content_get ( sd - > anchor_hover . hover , " left " ) & &
! elm_layout_content_get ( sd - > anchor_hover . hover , " right " ) & &
! elm_layout_content_get ( sd - > anchor_hover . hover , " top " ) & &
! elm_layout_content_get ( sd - > anchor_hover . hover , " bottom " ) )
{
evas_object_del ( sd - > anchor_hover . hover ) ;
sd - > anchor_hover . hover = NULL ;
}
else
evas_object_show ( sd - > anchor_hover . hover ) ;
}
static void
_entry_anchor_clicked_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission ,
const char * source __UNUSED__ )
2008-10-16 23:41:07 -07:00
{
2008-10-24 19:11:06 -07:00
Elm_Entry_Anchor_Info ei ;
2011-07-22 21:00:49 -07:00
const char * p ;
char * p2 ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2011-07-22 21:00:49 -07:00
p = emission + sizeof ( " nchor,mouse,clicked, " ) ;
ei . button = strtol ( p , & p2 , 10 ) ;
2011-08-25 14:57:23 -07:00
ei . name = p2 + 1 ;
2011-07-21 13:54:54 -07:00
ei . x = ei . y = ei . w = ei . h = 0 ;
2011-03-14 19:01:42 -07:00
2012-08-30 09:45:15 -07:00
_signal_anchor_geoms_do_things_with_lol ( sd , & ei ) ;
2011-07-21 14:19:55 -07:00
2012-08-30 09:45:15 -07:00
if ( ! sd - > disabled )
2012-03-06 02:09:13 -08:00
{
evas_object_smart_callback_call ( data , SIG_ANCHOR_CLICKED , & ei ) ;
2012-08-30 09:45:15 -07:00
_entry_hover_anchor_clicked_do ( data , & ei ) ;
2012-03-06 02:09:13 -08:00
}
2008-10-16 23:41:07 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_anchor_move_signal_cb ( void * data __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 23:41:07 -07:00
{
}
static void
2012-08-30 09:45:15 -07:00
_entry_anchor_in_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 23:41:07 -07:00
{
2011-07-21 14:19:55 -07:00
Elm_Entry_Anchor_Info ei ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2011-07-22 02:08:58 -07:00
ei . name = emission + sizeof ( " nchor,mouse,in, " ) ;
2011-07-21 14:19:55 -07:00
ei . button = 0 ;
ei . x = ei . y = ei . w = ei . h = 0 ;
2012-08-30 09:45:15 -07:00
_signal_anchor_geoms_do_things_with_lol ( sd , & ei ) ;
2011-07-21 14:19:55 -07:00
2012-08-30 09:45:15 -07:00
if ( ! sd - > disabled )
2011-07-21 14:19:55 -07:00
evas_object_smart_callback_call ( data , SIG_ANCHOR_IN , & ei ) ;
2008-10-16 23:41:07 -07:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_anchor_out_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-16 23:41:07 -07:00
{
2011-07-21 14:19:55 -07:00
Elm_Entry_Anchor_Info ei ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2011-07-22 02:08:58 -07:00
ei . name = emission + sizeof ( " nchor,mouse,out, " ) ;
2011-07-21 14:19:55 -07:00
ei . button = 0 ;
ei . x = ei . y = ei . w = ei . h = 0 ;
2012-08-30 09:45:15 -07:00
_signal_anchor_geoms_do_things_with_lol ( sd , & ei ) ;
2011-07-21 14:19:55 -07:00
2012-08-30 09:45:15 -07:00
if ( ! sd - > disabled )
2011-07-21 14:19:55 -07:00
evas_object_smart_callback_call ( data , SIG_ANCHOR_OUT , & ei ) ;
2008-10-16 02:17:57 -07:00
}
2008-10-22 01:58:56 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_key_enter_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2008-10-22 01:58:56 -07:00
{
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_ACTIVATED , NULL ) ;
2008-10-22 01:58:56 -07:00
}
2012-08-14 03:47:26 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_key_escape_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2012-08-14 03:47:26 -07:00
{
evas_object_smart_callback_call ( data , SIG_ABORTED , NULL ) ;
}
2009-12-01 03:03:14 -08:00
static void
2012-08-30 09:45:15 -07:00
_entry_mouse_down_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2009-12-01 03:03:14 -08:00
{
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_PRESS , NULL ) ;
2009-12-01 03:03:14 -08:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_mouse_clicked_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2009-12-01 03:03:14 -08:00
{
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_CLICKED , NULL ) ;
2009-12-01 03:03:14 -08:00
}
static void
2012-08-30 09:45:15 -07:00
_entry_mouse_double_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2009-12-01 03:03:14 -08:00
{
2010-03-26 03:59:56 -07:00
evas_object_smart_callback_call ( data , SIG_CLICKED_DOUBLE , NULL ) ;
2009-12-01 03:03:14 -08:00
}
2011-07-25 07:08:38 -07:00
static void
2012-08-30 09:45:15 -07:00
_entry_mouse_triple_signal_cb ( void * data ,
Evas_Object * obj __UNUSED__ ,
const char * emission __UNUSED__ ,
const char * source __UNUSED__ )
2011-07-25 07:08:38 -07:00
{
evas_object_smart_callback_call ( data , SIG_CLICKED_TRIPLE , NULL ) ;
}
2008-12-09 22:33:24 -08:00
# ifdef HAVE_ELEMENTARY_X
2010-06-25 02:58:14 -07:00
static Eina_Bool
2012-08-30 09:45:15 -07:00
_event_selection_notify ( void * data ,
int type __UNUSED__ ,
void * event )
2008-11-18 22:23:08 -08:00
{
Ecore_X_Event_Selection_Notify * ev = event ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( ( ! sd - > selection_asked ) & & ( ! sd - > drag_selection_asked ) )
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
return ECORE_CALLBACK_PASS_ON ;
2010-06-22 18:28:57 -07:00
2008-11-18 22:23:08 -08:00
if ( ( ev - > selection = = ECORE_X_SELECTION_CLIPBOARD ) | |
( ev - > selection = = ECORE_X_SELECTION_PRIMARY ) )
{
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
Ecore_X_Selection_Data_Text * text_data ;
text_data = ev - > data ;
if ( text_data - > data . content = = ECORE_X_SELECTION_CONTENT_TEXT )
{
if ( text_data - > text )
{
char * txt = _elm_util_text_to_mkup ( text_data - > text ) ;
if ( txt )
{
elm_entry_entry_insert ( data , txt ) ;
free ( txt ) ;
}
}
}
2012-08-30 09:45:15 -07:00
sd - > selection_asked = EINA_FALSE ;
2008-11-18 22:23:08 -08:00
}
2010-09-06 23:56:16 -07:00
else if ( ev - > selection = = ECORE_X_SELECTION_XDND )
{
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
Ecore_X_Selection_Data_Text * text_data ;
text_data = ev - > data ;
if ( text_data - > data . content = = ECORE_X_SELECTION_CONTENT_TEXT )
{
if ( text_data - > text )
{
char * txt = _elm_util_text_to_mkup ( text_data - > text ) ;
if ( txt )
{
/* Massive FIXME: this should be at the drag point */
elm_entry_entry_insert ( data , txt ) ;
free ( txt ) ;
}
}
}
2012-08-30 09:45:15 -07:00
sd - > drag_selection_asked = EINA_FALSE ;
2010-09-06 23:56:16 -07:00
ecore_x_dnd_send_finished ( ) ;
}
2012-08-30 09:45:15 -07:00
2010-06-25 02:58:14 -07:00
return ECORE_CALLBACK_PASS_ON ;
2008-11-18 22:23:08 -08:00
}
2009-07-06 23:46:51 -07:00
2010-06-25 02:58:14 -07:00
static Eina_Bool
2012-08-30 09:45:15 -07:00
_event_selection_clear ( void * data __UNUSED__ ,
int type __UNUSED__ ,
void * event __UNUSED__ )
2008-11-18 22:23:08 -08:00
{
elementary / entry, list, scroller, fileselector_button, config, photocam, map, pan, bg, store, priv, pager, conform, box, clock, flipselector
fixed indentation, removed white spaces.
SVN revision: 58267
2011-04-01 12:08:56 -07:00
Ecore_X_Event_Selection_Clear * ev = event ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( ! sd - > have_selection ) return ECORE_CALLBACK_PASS_ON ;
elementary / entry, list, scroller, fileselector_button, config, photocam, map, pan, bg, store, priv, pager, conform, box, clock, flipselector
fixed indentation, removed white spaces.
SVN revision: 58267
2011-04-01 12:08:56 -07:00
if ( ( ev - > selection = = ECORE_X_SELECTION_CLIPBOARD ) | |
( ev - > selection = = ECORE_X_SELECTION_PRIMARY ) )
{
elm_entry_select_none ( data ) ;
}
2012-08-30 09:45:15 -07:00
2010-06-25 02:58:14 -07:00
return ECORE_CALLBACK_PASS_ON ;
2008-11-18 22:23:08 -08:00
}
2010-09-06 23:56:16 -07:00
static Eina_Bool
2012-08-30 09:45:15 -07:00
_drag_drop_cb ( void * data __UNUSED__ ,
Evas_Object * obj ,
Elm_Selection_Data * drop )
2010-09-06 23:56:16 -07:00
{
Eina_Bool rv ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
edje_object_part_text_cursor_copy
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN , /*->*/ EDJE_CURSOR_USER ) ;
rv = edje_object_part_text_cursor_coord_set
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN , drop - > x , drop - > y ) ;
if ( ! rv ) WRN ( " Warning: Failed to position cursor: paste anyway " ) ;
2010-09-06 23:56:16 -07:00
elm_entry_entry_insert ( obj , drop - > data ) ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_copy
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_USER , /*->*/ EDJE_CURSOR_MAIN ) ;
2010-09-06 23:56:16 -07:00
return EINA_TRUE ;
}
2012-08-30 09:45:15 -07:00
2008-12-09 22:33:24 -08:00
# endif
2008-11-18 22:23:08 -08:00
2010-04-26 07:59:01 -07:00
static Evas_Object *
2012-08-30 09:45:15 -07:00
_item_get ( void * data ,
Evas_Object * edje __UNUSED__ ,
const char * part __UNUSED__ ,
const char * item )
2010-04-26 07:59:01 -07:00
{
2010-04-27 01:06:42 -07:00
Eina_List * l ;
2012-08-30 09:45:15 -07:00
Evas_Object * o ;
2010-04-27 01:06:42 -07:00
Elm_Entry_Item_Provider * ip ;
2010-04-26 07:59:01 -07:00
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2012-10-01 00:36:27 -07:00
EINA_LIST_FOREACH ( sd - > item_providers , l , ip )
2010-04-27 01:06:42 -07:00
{
o = ip - > func ( ip - > data , data , item ) ;
if ( o ) return o ;
}
2010-12-02 00:25:36 -08:00
if ( ! strncmp ( item , " file:// " , 7 ) )
{
2010-12-06 21:04:45 -08:00
const char * fname = item + 7 ;
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
2010-12-02 00:25:36 -08:00
o = evas_object_image_filled_add ( evas_object_evas_get ( data ) ) ;
evas_object_image_file_set ( o , fname , NULL ) ;
if ( evas_object_image_load_error_get ( o ) = = EVAS_LOAD_ERROR_NONE )
{
evas_object_show ( o ) ;
}
else
{
evas_object_del ( o ) ;
o = edje_object_add ( evas_object_evas_get ( data ) ) ;
2012-08-30 09:45:15 -07:00
elm_widget_theme_object_set
( data , o , " entry/emoticon " , " wtf " ,
elm_widget_style_get ( data ) ) ;
2010-12-02 00:25:36 -08:00
}
return o ;
}
2012-08-30 09:45:15 -07:00
2010-04-26 07:59:01 -07:00
o = edje_object_add ( evas_object_evas_get ( data ) ) ;
2012-08-30 09:45:15 -07:00
if ( ! elm_widget_theme_object_set
( data , o , " entry " , item , elm_widget_style_get ( data ) ) )
elm_widget_theme_object_set
( data , o , " entry/emoticon " , " wtf " , elm_widget_style_get ( data ) ) ;
2010-04-26 07:59:01 -07:00
return o ;
}
2010-04-12 01:12:02 -07:00
2012-02-07 23:23:49 -08:00
static void
2012-08-30 09:45:15 -07:00
_markup_filter_cb ( void * data ,
Evas_Object * edje __UNUSED__ ,
const char * part __UNUSED__ ,
char * * text )
2012-02-07 23:23:49 -08:00
{
Eina_List * l ;
Elm_Entry_Markup_Filter * tf ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2012-10-01 00:36:27 -07:00
EINA_LIST_FOREACH ( sd - > markup_filters , l , tf )
2012-02-07 23:23:49 -08:00
{
tf - > func ( tf - > data , data , text ) ;
if ( ! * text )
break ;
}
}
2011-05-15 09:02:03 -07:00
/* This function is used to insert text by chunks in jobs */
static Eina_Bool
_text_append_idler ( void * data )
{
int start ;
char backup ;
2012-08-30 09:45:15 -07:00
Evas_Object * obj = ( Evas_Object * ) data ;
ELM_ENTRY_DATA_GET ( obj , sd ) ;
2011-09-29 05:02:49 -07:00
evas_event_freeze ( evas_object_evas_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > text ) eina_stringshare_del ( sd - > text ) ;
sd - > text = NULL ;
sd - > changed = EINA_TRUE ;
2011-05-15 09:02:03 -07:00
2012-08-30 09:45:15 -07:00
start = sd - > append_text_position ;
if ( ( start + _CHUNK_SIZE ) < sd - > append_text_len )
2011-05-15 09:02:03 -07:00
{
2011-08-22 07:20:02 -07:00
int pos = start ;
int tag_start , esc_start ;
tag_start = esc_start = - 1 ;
/* Find proper markup cut place */
while ( pos - start < _CHUNK_SIZE )
{
int prev_pos = pos ;
Eina_Unicode tmp =
2013-01-21 18:00:55 -08:00
eina_unicode_utf8_next_get ( sd - > append_text_left , & pos ) ;
2012-08-30 09:45:15 -07:00
2011-08-22 07:20:02 -07:00
if ( esc_start = = - 1 )
{
if ( tmp = = ' < ' )
2012-08-30 09:45:15 -07:00
tag_start = prev_pos ;
2011-08-22 07:20:02 -07:00
else if ( tmp = = ' > ' )
2012-08-30 09:45:15 -07:00
tag_start = - 1 ;
2011-08-22 07:20:02 -07:00
}
2011-09-22 04:31:22 -07:00
if ( tag_start = = - 1 )
2011-08-22 07:20:02 -07:00
{
if ( tmp = = ' & ' )
2012-08-30 09:45:15 -07:00
esc_start = prev_pos ;
2011-08-22 07:20:02 -07:00
else if ( tmp = = ' ; ' )
2012-08-30 09:45:15 -07:00
esc_start = - 1 ;
2011-08-22 07:20:02 -07:00
}
}
if ( tag_start > = 0 )
{
2012-08-30 09:45:15 -07:00
sd - > append_text_position = tag_start ;
2011-08-22 07:20:02 -07:00
}
else if ( esc_start > = 0 )
{
2012-08-30 09:45:15 -07:00
sd - > append_text_position = esc_start ;
2011-08-22 07:20:02 -07:00
}
else
{
2012-08-30 09:45:15 -07:00
sd - > append_text_position = pos ;
2011-08-22 07:20:02 -07:00
}
2011-05-15 09:02:03 -07:00
}
else
{
2012-08-30 09:45:15 -07:00
sd - > append_text_position = sd - > append_text_len ;
2011-05-15 09:02:03 -07:00
}
2012-08-30 09:45:15 -07:00
backup = sd - > append_text_left [ sd - > append_text_position ] ;
sd - > append_text_left [ sd - > append_text_position ] = ' \0 ' ;
2011-05-15 09:02:03 -07:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_append
( sd - > entry_edje , " elm.text " , sd - > append_text_left + start ) ;
2011-05-15 09:02:03 -07:00
2012-08-30 09:45:15 -07:00
sd - > append_text_left [ sd - > append_text_position ] = backup ;
2011-05-15 09:02:03 -07:00
2011-09-29 05:02:49 -07:00
evas_event_thaw ( evas_object_evas_get ( obj ) ) ;
evas_event_thaw_eval ( evas_object_evas_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
_elm_entry_guide_update ( obj , EINA_TRUE ) ;
2011-05-15 09:02:03 -07:00
/* If there's still more to go, renew the idler, else, cleanup */
2012-08-30 09:45:15 -07:00
if ( sd - > append_text_position < sd - > append_text_len )
2011-05-15 09:02:03 -07:00
{
return ECORE_CALLBACK_RENEW ;
}
else
{
2012-08-30 09:45:15 -07:00
free ( sd - > append_text_left ) ;
sd - > append_text_left = NULL ;
sd - > append_text_idler = NULL ;
2013-05-06 04:42:34 -07:00
evas_object_smart_callback_call ( obj , SIG_TEXT_SET_DONE , NULL ) ;
2011-05-15 09:02:03 -07:00
return ECORE_CALLBACK_CANCEL ;
}
}
2011-06-14 02:50:05 -07:00
static void
2012-08-30 09:45:15 -07:00
_chars_add_till_limit ( Evas_Object * obj ,
char * * text ,
int can_add ,
Length_Unit unit )
2011-06-14 02:50:05 -07:00
{
2011-09-24 19:56:54 -07:00
int i = 0 , current_len = 0 ;
char * new_text ;
if ( ! * text ) return ;
2011-06-14 02:50:05 -07:00
if ( unit > = LENGTH_UNIT_LAST ) return ;
2013-01-07 03:37:53 -08:00
if ( strstr ( * text , " <preedit " ) ) return ;
2012-08-30 09:45:15 -07:00
2011-09-24 19:56:54 -07:00
new_text = * text ;
current_len = strlen ( * text ) ;
2011-06-14 02:50:05 -07:00
while ( * new_text )
{
2011-11-15 00:26:02 -08:00
int idx = 0 , unit_size = 0 ;
char * markup , * utfstr ;
2012-08-30 09:45:15 -07:00
2011-06-14 02:50:05 -07:00
if ( * new_text = = ' < ' )
{
2011-11-15 00:26:02 -08:00
while ( * ( new_text + idx ) ! = ' > ' )
2011-06-14 02:50:05 -07:00
{
2011-11-15 00:26:02 -08:00
idx + + ;
if ( ! * ( new_text + idx ) ) break ;
2011-06-14 02:50:05 -07:00
}
}
2011-11-15 00:26:02 -08:00
else if ( * new_text = = ' & ' )
2011-06-14 02:50:05 -07:00
{
2011-11-15 00:26:02 -08:00
while ( * ( new_text + idx ) ! = ' ; ' )
2011-06-14 02:50:05 -07:00
{
2011-11-15 00:26:02 -08:00
idx + + ;
if ( ! * ( new_text + idx ) ) break ;
2011-06-14 02:50:05 -07:00
}
2011-11-15 00:26:02 -08:00
}
idx = evas_string_char_next_get ( new_text , idx , NULL ) ;
markup = malloc ( idx + 1 ) ;
if ( markup )
{
strncpy ( markup , new_text , idx ) ;
markup [ idx ] = 0 ;
utfstr = elm_entry_markup_to_utf8 ( markup ) ;
if ( utfstr )
2011-06-14 02:50:05 -07:00
{
2011-11-15 00:26:02 -08:00
if ( unit = = LENGTH_UNIT_BYTE )
unit_size = strlen ( utfstr ) ;
else if ( unit = = LENGTH_UNIT_CHAR )
unit_size = evas_string_char_len_get ( utfstr ) ;
free ( utfstr ) ;
utfstr = NULL ;
2011-06-14 02:50:05 -07:00
}
2011-11-15 00:26:02 -08:00
free ( markup ) ;
markup = NULL ;
}
if ( can_add < unit_size )
{
if ( ! i )
2011-06-14 02:50:05 -07:00
{
2013-05-12 17:00:50 -07:00
evas_object_smart_callback_call ( obj , SIG_MAX_LENGTH , NULL ) ;
2011-11-15 00:26:02 -08:00
free ( * text ) ;
* text = NULL ;
return ;
2011-06-14 02:50:05 -07:00
}
2011-11-15 00:26:02 -08:00
can_add = 0 ;
2012-08-30 09:45:15 -07:00
strncpy ( new_text , new_text + idx ,
current_len - ( ( new_text + idx ) - * text ) ) ;
2011-11-15 00:26:02 -08:00
current_len - = idx ;
( * text ) [ current_len ] = 0 ;
}
else
{
new_text + = idx ;
can_add - = unit_size ;
2011-06-14 02:50:05 -07:00
}
2011-11-15 00:26:02 -08:00
i + + ;
2011-06-14 02:50:05 -07:00
}
2012-08-30 09:45:15 -07:00
2013-05-12 17:00:50 -07:00
evas_object_smart_callback_call ( obj , SIG_MAX_LENGTH , NULL ) ;
2012-08-30 09:45:15 -07:00
}
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_signal ( Eo * obj EINA_UNUSED , void * _pd EINA_UNUSED , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
const char * emission = va_arg ( * list , const char * ) ;
const char * source = va_arg ( * list , const char * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
/* always pass to both edje objs */
edje_object_signal_emit ( sd - > entry_edje , emission , source ) ;
if ( sd - > scr_edje )
edje_object_signal_emit ( sd - > scr_edje , emission , source ) ;
2011-06-14 02:50:05 -07:00
}
2011-07-04 03:40:13 -07:00
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_callback_add ( Eo * obj , void * _pd , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
const char * emission = va_arg ( * list , const char * ) ;
const char * source = va_arg ( * list , const char * ) ;
Edje_Signal_Cb func_cb = va_arg ( * list , Edje_Signal_Cb ) ;
void * data = va_arg ( * list , void * ) ;
2012-08-30 09:45:15 -07:00
Evas_Object * ro ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2013-04-24 04:41:37 -07:00
Elm_Widget_Smart_Data * wd = eo_data_scope_get ( obj , ELM_OBJ_WIDGET_CLASS ) ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
ro = wd - > resize_obj ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
wd - > resize_obj = sd - > entry_edje ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_obj_layout_signal_callback_add
2012-11-25 22:32:53 -08:00
( emission , source , func_cb , data ) ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > scr_edje )
{
2012-11-25 22:32:53 -08:00
wd - > resize_obj = sd - > scr_edje ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_obj_layout_signal_callback_add
2012-11-25 22:32:53 -08:00
( emission , source , func_cb , data ) ) ;
2012-08-30 09:45:15 -07:00
}
2012-11-25 22:32:53 -08:00
wd - > resize_obj = ro ;
2012-08-30 09:45:15 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_callback_del ( Eo * obj , void * _pd , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
const char * emission = va_arg ( * list , const char * ) ;
const char * source = va_arg ( * list , const char * ) ;
Edje_Signal_Cb func_cb = va_arg ( * list , Edje_Signal_Cb ) ;
void * * data = va_arg ( * list , void * * ) ;
2012-08-30 09:45:15 -07:00
Evas_Object * ro ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2013-04-24 04:41:37 -07:00
Elm_Widget_Smart_Data * wd = eo_data_scope_get ( obj , ELM_OBJ_WIDGET_CLASS ) ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
ro = wd - > resize_obj ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
wd - > resize_obj = sd - > entry_edje ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_obj_layout_signal_callback_del
2012-11-25 22:32:53 -08:00
( emission , source , func_cb , data ) ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > scr_edje )
{
2012-11-25 22:32:53 -08:00
wd - > resize_obj = sd - > scr_edje ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_obj_layout_signal_callback_del
2012-11-25 22:32:53 -08:00
( emission , source , func_cb , data ) ) ;
2012-08-30 09:45:15 -07:00
}
2012-11-25 22:32:53 -08:00
wd - > resize_obj = ro ;
2012-08-30 09:45:15 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_content_set ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
const char * part = va_arg ( * list , const char * ) ;
Evas_Object * content = va_arg ( * list , Evas_Object * ) ;
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
if ( ret ) * ret = EINA_FALSE ;
Eina_Bool int_ret = EINA_FALSE ;
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_obj_container_content_set ( part , content , & int_ret ) ) ;
2012-11-25 22:32:53 -08:00
if ( ! int_ret ) return ;
2012-08-30 09:45:15 -07:00
/* too bad entry does not follow the pattern
* " elm,state,{icon,end},visible " , we have to repeat ourselves */
if ( ! part | | ! strcmp ( part , " icon " ) | | ! strcmp ( part , " elm.swallow.icon " ) )
elm_entry_icon_visible_set ( obj , EINA_TRUE ) ;
if ( ! part | | ! strcmp ( part , " end " ) | | ! strcmp ( part , " elm.swallow.end " ) )
elm_entry_end_visible_set ( obj , EINA_TRUE ) ;
2012-11-25 22:32:53 -08:00
if ( ret ) * ret = EINA_TRUE ;
2012-08-30 09:45:15 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_content_unset ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
const char * part = va_arg ( * list , const char * ) ;
Evas_Object * * content = va_arg ( * list , Evas_Object * * ) ;
if ( content ) * content = NULL ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Evas_Object * int_content ;
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_obj_container_content_unset ( part , & int_content ) ) ;
2012-11-25 22:32:53 -08:00
if ( ! int_content ) return ;
2012-08-30 09:45:15 -07:00
/* too bad entry does not follow the pattern
* " elm,state,{icon,end},hidden " , we have to repeat ourselves */
if ( ! part | | ! strcmp ( part , " icon " ) | | ! strcmp ( part , " elm.swallow.icon " ) )
elm_entry_icon_visible_set ( obj , EINA_FALSE ) ;
if ( ! part | | ! strcmp ( part , " end " ) | | ! strcmp ( part , " elm.swallow.end " ) )
elm_entry_end_visible_set ( obj , EINA_FALSE ) ;
2012-11-25 22:32:53 -08:00
if ( content ) * content = int_content ;
2012-08-30 09:45:15 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_text_set ( Eo * obj , void * _pd , va_list * list )
2011-07-04 03:40:13 -07:00
{
2012-11-25 22:32:53 -08:00
const char * item = va_arg ( * list , const char * ) ;
const char * entry = va_arg ( * list , const char * ) ;
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
if ( ret ) * ret = EINA_TRUE ;
2011-07-04 03:40:13 -07:00
int len = 0 ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2011-07-04 03:40:13 -07:00
if ( ! entry ) entry = " " ;
2012-04-08 22:25:27 -07:00
if ( item )
2011-10-27 07:16:31 -07:00
{
2012-04-08 22:25:27 -07:00
if ( ! strcmp ( item , " guide " ) )
2012-08-30 09:45:15 -07:00
edje_object_part_text_set ( sd - > entry_edje , " elm.guide " , entry ) ;
2012-04-08 22:25:27 -07:00
else
2012-08-30 09:45:15 -07:00
edje_object_part_text_set ( sd - > entry_edje , item , entry ) ;
2012-11-25 22:32:53 -08:00
return ;
2011-10-27 07:16:31 -07:00
}
2012-05-21 04:28:41 -07:00
evas_event_freeze ( evas_object_evas_get ( obj ) ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > text ) eina_stringshare_del ( sd - > text ) ;
sd - > text = NULL ;
sd - > changed = EINA_TRUE ;
2011-07-04 03:40:13 -07:00
/* Clear currently pending job if there is one */
2012-08-30 09:45:15 -07:00
if ( sd - > append_text_idler )
2011-07-04 03:40:13 -07:00
{
2012-08-30 09:45:15 -07:00
ecore_idler_del ( sd - > append_text_idler ) ;
free ( sd - > append_text_left ) ;
sd - > append_text_left = NULL ;
sd - > append_text_idler = NULL ;
2011-07-04 03:40:13 -07:00
}
len = strlen ( entry ) ;
/* Split to ~_CHUNK_SIZE chunks */
if ( len > _CHUNK_SIZE )
{
2012-08-30 09:45:15 -07:00
sd - > append_text_left = ( char * ) malloc ( len + 1 ) ;
2011-07-04 03:40:13 -07:00
}
/* If we decided to use the idler */
2012-08-30 09:45:15 -07:00
if ( sd - > append_text_left )
2011-07-04 03:40:13 -07:00
{
/* Need to clear the entry first */
2012-08-30 09:45:15 -07:00
edje_object_part_text_set ( sd - > entry_edje , " elm.text " , " " ) ;
memcpy ( sd - > append_text_left , entry , len + 1 ) ;
sd - > append_text_position = 0 ;
sd - > append_text_len = len ;
sd - > append_text_idler = ecore_idler_add ( _text_append_idler , obj ) ;
2011-07-04 03:40:13 -07:00
}
else
{
2012-08-30 09:45:15 -07:00
edje_object_part_text_set ( sd - > entry_edje , " elm.text " , entry ) ;
2013-05-06 04:42:34 -07:00
evas_object_smart_callback_call ( obj , SIG_TEXT_SET_DONE , NULL ) ;
2011-07-04 03:40:13 -07:00
}
2012-08-30 09:45:15 -07:00
2012-12-06 23:12:58 -08:00
if ( len > 0 )
2012-08-30 09:45:15 -07:00
_elm_entry_guide_update ( obj , EINA_TRUE ) ;
2012-04-08 22:25:27 -07:00
else
2012-08-30 09:45:15 -07:00
_elm_entry_guide_update ( obj , EINA_FALSE ) ;
2011-09-29 05:02:49 -07:00
evas_event_thaw ( evas_object_evas_get ( obj ) ) ;
evas_event_thaw_eval ( evas_object_evas_get ( obj ) ) ;
2011-07-04 03:40:13 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_text_get ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
2011-07-04 03:40:13 -07:00
{
2012-11-25 22:32:53 -08:00
const char * item = va_arg ( * list , const char * ) ;
const char * * ret = va_arg ( * list , const char * * ) ;
2011-07-04 03:40:13 -07:00
const char * text ;
2012-11-25 22:32:53 -08:00
* ret = NULL ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( item )
{
if ( ! strcmp ( item , " default " ) ) goto proceed ;
else if ( ! strcmp ( item , " guide " ) )
2012-11-25 22:32:53 -08:00
* ret = edje_object_part_text_get ( sd - > entry_edje , " elm.guide " ) ;
2012-08-30 09:45:15 -07:00
else
2012-11-25 22:32:53 -08:00
* ret = edje_object_part_text_get ( sd - > entry_edje , item ) ;
return ;
2012-08-30 09:45:15 -07:00
}
proceed :
text = edje_object_part_text_get ( sd - > entry_edje , " elm.text " ) ;
2011-07-04 03:40:13 -07:00
if ( ! text )
{
2012-08-30 09:45:15 -07:00
ERR ( " text=NULL for edje %p, part 'elm.text' " , sd - > entry_edje ) ;
2012-11-25 22:32:53 -08:00
return ;
2011-07-04 03:40:13 -07:00
}
2011-07-28 01:18:37 -07:00
2012-08-30 09:45:15 -07:00
if ( sd - > append_text_len > 0 )
2011-07-28 01:18:37 -07:00
{
char * tmpbuf ;
size_t tlen ;
2012-08-30 09:45:15 -07:00
2012-07-05 06:32:19 -07:00
tlen = strlen ( text ) ;
2013-03-11 03:40:19 -07:00
/* FIXME: need that or we do copy unitialised data */
2013-03-11 03:19:29 -07:00
tmpbuf = calloc ( 1 , tlen + sd - > append_text_len -
2013-03-11 03:40:19 -07:00
sd - > append_text_position + 1 ) ;
2011-07-28 01:18:37 -07:00
if ( ! tmpbuf )
{
ERR ( " Failed to allocate memory for entry's text %p " , obj ) ;
2012-11-25 22:32:53 -08:00
return ;
2011-07-28 01:18:37 -07:00
}
memcpy ( tmpbuf , text , tlen ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > append_text_left )
memcpy ( tmpbuf + tlen , sd - > append_text_left
+ sd - > append_text_position , sd - > append_text_len
- sd - > append_text_position ) ;
tmpbuf [ sd - > append_text_len ] = ' \0 ' ;
eina_stringshare_replace ( & sd - > text , tmpbuf ) ;
2011-07-28 01:18:37 -07:00
free ( tmpbuf ) ;
}
else
{
2012-08-30 09:45:15 -07:00
eina_stringshare_replace ( & sd - > text , text ) ;
2011-07-28 01:18:37 -07:00
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > text ;
2011-07-04 03:40:13 -07:00
}
2012-08-18 06:52:03 -07:00
static char *
2012-12-23 06:50:56 -08:00
_access_info_cb ( void * data __UNUSED__ , Evas_Object * obj )
2012-08-18 06:52:03 -07:00
{
2012-08-30 09:45:15 -07:00
const char * txt ;
ELM_ENTRY_DATA_GET ( obj , sd ) ;
if ( sd - > password ) return NULL ;
2012-08-18 06:52:03 -07:00
2012-08-30 09:45:15 -07:00
txt = elm_widget_access_info_get ( obj ) ;
2012-08-18 06:52:03 -07:00
2013-01-22 20:07:57 -08:00
if ( ! txt ) txt = _elm_util_mkup_to_text ( elm_entry_entry_get ( obj ) ) ;
2012-08-18 06:52:03 -07:00
if ( txt ) return strdup ( txt ) ;
return NULL ;
}
static char *
2012-12-23 06:50:56 -08:00
_access_state_cb ( void * data __UNUSED__ , Evas_Object * obj )
2012-08-18 06:52:03 -07:00
{
Eina_Strbuf * buf ;
2013-01-31 02:56:18 -08:00
char * ret ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( obj , sd ) ;
2013-01-31 03:07:26 -08:00
ret = NULL ;
2012-08-18 06:52:03 -07:00
buf = eina_strbuf_new ( ) ;
if ( elm_widget_disabled_get ( obj ) )
eina_strbuf_append ( buf , " State: Disabled " ) ;
2012-08-30 09:45:15 -07:00
if ( ! sd - > editable )
2012-08-18 06:52:03 -07:00
{
if ( ! eina_strbuf_length_get ( buf ) )
eina_strbuf_append ( buf , " State: Not Editable " ) ;
else eina_strbuf_append ( buf , " , Not Editable " ) ;
}
2012-08-30 09:45:15 -07:00
if ( sd - > password )
2012-08-18 06:52:03 -07:00
{
if ( ! eina_strbuf_length_get ( buf ) )
eina_strbuf_append ( buf , " State: Password " ) ;
else eina_strbuf_append ( buf , " , Password " ) ;
}
2013-01-31 02:56:18 -08:00
if ( ! eina_strbuf_length_get ( buf ) ) goto buf_free ;
2012-08-18 06:52:03 -07:00
2013-01-31 02:56:18 -08:00
ret = eina_strbuf_string_steal ( buf ) ;
buf_free :
eina_strbuf_free ( buf ) ;
return ret ;
2012-08-18 06:52:03 -07:00
}
2012-08-30 09:45:15 -07:00
static void
_entry_selection_callbacks_unregister ( Evas_Object * obj )
{
ELM_ENTRY_DATA_GET ( obj , sd ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " selection,start " , " elm.text " ,
_entry_selection_start_signal_cb , obj ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " selection,changed " , " elm.text " ,
_entry_selection_changed_signal_cb , obj ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " entry,selection,all,request " ,
" elm.text " , _entry_selection_all_signal_cb , obj ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " entry,selection,none,request " ,
" elm.text " , _entry_selection_none_signal_cb , obj ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " selection,cleared " , " elm.text " ,
_entry_selection_cleared_signal_cb , obj ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " entry,paste,request,* " , " elm.text " ,
_entry_paste_request_signal_cb , obj ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " entry,copy,notify " , " elm.text " ,
_entry_copy_notify_signal_cb , obj ) ;
edje_object_signal_callback_del_full
( sd - > entry_edje , " entry,cut,notify " , " elm.text " ,
_entry_cut_notify_signal_cb , obj ) ;
}
static void
_entry_selection_callbacks_register ( Evas_Object * obj )
{
ELM_ENTRY_DATA_GET ( obj , sd ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " selection,start " , " elm.text " ,
_entry_selection_start_signal_cb , obj ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " selection,changed " , " elm.text " ,
_entry_selection_changed_signal_cb , obj ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " entry,selection,all,request " ,
" elm.text " , _entry_selection_all_signal_cb , obj ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " entry,selection,none,request " ,
" elm.text " , _entry_selection_none_signal_cb , obj ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " selection,cleared " , " elm.text " ,
_entry_selection_cleared_signal_cb , obj ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " entry,paste,request,* " , " elm.text " ,
_entry_paste_request_signal_cb , obj ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " entry,copy,notify " , " elm.text " ,
_entry_copy_notify_signal_cb , obj ) ;
edje_object_signal_callback_add
( sd - > entry_edje , " entry,cut,notify " , " elm.text " ,
_entry_cut_notify_signal_cb , obj ) ;
}
static void
_resize_cb ( void * data ,
Evas * e __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
{
ELM_ENTRY_DATA_GET ( data , sd ) ;
if ( sd - > line_wrap )
{
elm_layout_sizing_eval ( data ) ;
}
else if ( sd - > scroll )
{
Evas_Coord vw = 0 , vh = 0 ;
2012-11-25 22:32:53 -08:00
eo_do ( data , elm_scrollable_interface_content_viewport_size_get ( & vw , & vh ) ) ;
2012-08-30 09:45:15 -07:00
if ( vw < sd - > ent_mw ) vw = sd - > ent_mw ;
if ( vh < sd - > ent_mh ) vh = sd - > ent_mh ;
evas_object_resize ( sd - > entry_edje , vw , vh ) ;
}
if ( sd - > hoversel ) _hoversel_position ( data ) ;
}
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_add ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
2008-10-14 01:05:30 -07:00
{
2012-03-29 14:24:00 -07:00
# ifdef HAVE_ELEMENTARY_X
Evas_Object * top ;
# endif
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * priv = _pd ;
2013-04-24 04:41:37 -07:00
Elm_Widget_Smart_Data * wd = eo_data_scope_get ( obj , ELM_OBJ_WIDGET_CLASS ) ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , evas_obj_smart_add ( ) ) ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
priv - > entry_edje = wd - > resize_obj ;
2012-08-30 09:45:15 -07:00
priv - > cnp_mode = ELM_CNP_MODE_MARKUP ;
priv - > line_wrap = ELM_WRAP_WORD ;
priv - > context_menu = EINA_TRUE ;
priv - > auto_save = EINA_TRUE ;
priv - > editable = EINA_TRUE ;
2013-03-01 18:04:31 -08:00
if ( ! elm_layout_theme_set ( obj , " entry " , " base " , elm_widget_style_get ( obj ) ) )
CRITICAL ( " Failed to set layout! " ) ;
2012-08-30 09:45:15 -07:00
priv - > hit_rect = evas_object_rectangle_add ( evas_object_evas_get ( obj ) ) ;
evas_object_data_set ( priv - > hit_rect , " _elm_leaveme " , obj ) ;
evas_object_smart_member_add ( priv - > hit_rect , obj ) ;
elm_widget_sub_object_add ( obj , priv - > hit_rect ) ;
/* common scroller hit rectangle setup */
evas_object_color_set ( priv - > hit_rect , 0 , 0 , 0 , 0 ) ;
evas_object_show ( priv - > hit_rect ) ;
evas_object_repeat_events_set ( priv - > hit_rect , EINA_TRUE ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_objects_set ( priv - > entry_edje , priv - > hit_rect ) ) ;
2012-08-30 09:45:15 -07:00
edje_object_item_provider_set ( priv - > entry_edje , _item_get , obj ) ;
edje_object_text_markup_filter_callback_add
( priv - > entry_edje , " elm.text " , _markup_filter_cb , obj ) ;
2013-04-02 10:23:20 -07:00
evas_object_event_callback_add
( priv - > entry_edje , EVAS_CALLBACK_KEY_DOWN , _key_down_cb , obj ) ;
2012-08-30 09:45:15 -07:00
evas_object_event_callback_add
( priv - > entry_edje , EVAS_CALLBACK_MOUSE_DOWN , _mouse_down_cb , obj ) ;
evas_object_event_callback_add
( priv - > entry_edje , EVAS_CALLBACK_MOUSE_UP , _mouse_up_cb , obj ) ;
evas_object_event_callback_add
( priv - > entry_edje , EVAS_CALLBACK_MOUSE_MOVE , _mouse_move_cb , obj ) ;
/* this code can't go in smart_resize. sizing gets wrong */
evas_object_event_callback_add ( obj , EVAS_CALLBACK_RESIZE , _resize_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " entry,changed " , " elm.text " ,
_entry_changed_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " entry,changed,user " , " elm.text " ,
_entry_changed_user_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " preedit,changed " , " elm.text " ,
_entry_preedit_changed_signal_cb , obj ) ;
_entry_selection_callbacks_register ( obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " cursor,changed " , " elm.text " ,
_entry_cursor_changed_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " cursor,changed,manual " , " elm.text " ,
_entry_cursor_changed_manual_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " anchor,mouse,down,* " , " elm.text " ,
_entry_anchor_down_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " anchor,mouse,up,* " , " elm.text " ,
_entry_anchor_up_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " anchor,mouse,clicked,* " , " elm.text " ,
_entry_anchor_clicked_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " anchor,mouse,move,* " , " elm.text " ,
_entry_anchor_move_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " anchor,mouse,in,* " , " elm.text " ,
_entry_anchor_in_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " anchor,mouse,out,* " , " elm.text " ,
_entry_anchor_out_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " entry,key,enter " , " elm.text " ,
_entry_key_enter_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " entry,key,escape " , " elm.text " ,
_entry_key_escape_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " mouse,down,1 " , " elm.text " ,
_entry_mouse_down_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " mouse,clicked,1 " , " elm.text " ,
_entry_mouse_clicked_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " mouse,down,1,double " , " elm.text " ,
_entry_mouse_double_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " mouse,down,1,triple " , " elm.text " ,
_entry_mouse_triple_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " entry,undo,request " , " elm.text " ,
_entry_undo_request_signal_cb , obj ) ;
edje_object_signal_callback_add
( priv - > entry_edje , " entry,redo,request " , " elm.text " ,
_entry_redo_request_signal_cb , obj ) ;
elm_layout_text_set ( obj , " elm.text " , " " ) ;
elm_object_sub_cursor_set
2012-11-25 22:32:53 -08:00
( wd - > resize_obj , obj , ELM_CURSOR_XTERM ) ;
2010-09-27 21:28:14 -07:00
elm_widget_can_focus_set ( obj , EINA_TRUE ) ;
2011-04-01 06:20:40 -07:00
if ( _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( priv - > entry_edje , " elm.text " , EINA_TRUE ) ;
elm_layout_sizing_eval ( obj ) ;
2008-11-18 22:23:08 -08:00
2011-08-25 00:25:37 -07:00
elm_entry_input_panel_layout_set ( obj , ELM_INPUT_PANEL_LAYOUT_NORMAL ) ;
2012-02-02 20:51:38 -08:00
elm_entry_input_panel_enabled_set ( obj , EINA_TRUE ) ;
2012-02-13 20:54:19 -08:00
elm_entry_prediction_allow_set ( obj , EINA_TRUE ) ;
2011-08-25 00:25:37 -07:00
2012-08-30 09:45:15 -07:00
priv - > autocapital_type = edje_object_part_text_autocapital_type_get
( priv - > entry_edje , " elm.text " ) ;
2011-10-26 22:43:08 -07:00
2008-12-09 22:33:24 -08:00
# ifdef HAVE_ELEMENTARY_X
2009-05-13 05:21:52 -07:00
top = elm_widget_top_get ( obj ) ;
if ( ( top ) & & ( elm_win_xwindow_get ( top ) ) )
2008-11-18 22:23:08 -08:00
{
2012-08-30 09:45:15 -07:00
priv - > sel_notify_handler =
ecore_event_handler_add
( ECORE_X_EVENT_SELECTION_NOTIFY , _event_selection_notify , obj ) ;
priv - > sel_clear_handler =
ecore_event_handler_add
( ECORE_X_EVENT_SELECTION_CLEAR , _event_selection_clear , obj ) ;
2008-11-18 22:23:08 -08:00
}
2012-08-30 09:45:15 -07:00
elm_drop_target_add
( obj , ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_IMAGE ,
2013-02-21 05:21:08 -08:00
NULL , NULL ,
NULL , NULL ,
NULL , NULL ,
_drag_drop_cb , NULL ) ;
2013-05-13 04:18:24 -07:00
# endif
2009-07-06 23:46:51 -07:00
2008-11-18 00:45:38 -08:00
entries = eina_list_prepend ( entries , obj ) ;
2010-02-08 19:27:11 -08:00
2009-12-01 03:03:14 -08:00
// module - find module for entry
2012-08-30 09:45:15 -07:00
priv - > api = _module_find ( obj ) ;
2009-12-01 03:03:14 -08:00
// if found - hook in
2012-08-30 09:45:15 -07:00
if ( ( priv - > api ) & & ( priv - > api - > obj_hook ) ) priv - > api - > obj_hook ( obj ) ;
2010-02-08 19:27:11 -08:00
2011-02-08 04:08:28 -08:00
_mirrored_set ( obj , elm_widget_mirrored_get ( obj ) ) ;
2012-08-18 06:52:03 -07:00
// access
2012-08-30 09:45:15 -07:00
_elm_access_object_register ( obj , priv - > entry_edje ) ;
2012-08-18 06:52:03 -07:00
_elm_access_text_set
( _elm_access_object_get ( obj ) , ELM_ACCESS_TYPE , E_ ( " Entry " ) ) ;
_elm_access_callback_set
( _elm_access_object_get ( obj ) , ELM_ACCESS_INFO , _access_info_cb , NULL ) ;
_elm_access_callback_set
( _elm_access_object_get ( obj ) , ELM_ACCESS_STATE , _access_state_cb , NULL ) ;
2012-08-30 09:45:15 -07:00
}
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_del ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
2012-08-30 09:45:15 -07:00
{
Elm_Entry_Context_Menu_Item * it ;
Elm_Entry_Item_Provider * ip ;
Elm_Entry_Markup_Filter * tf ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( sd - > delay_write )
{
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > delay_write , ecore_timer_del ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > auto_save ) _save_do ( obj ) ;
}
elm_entry_anchor_hover_end ( obj ) ;
elm_entry_anchor_hover_parent_set ( obj , NULL ) ;
evas_event_freeze ( evas_object_evas_get ( obj ) ) ;
if ( sd - > file ) eina_stringshare_del ( sd - > file ) ;
if ( sd - > hov_deljob ) ecore_job_del ( sd - > hov_deljob ) ;
if ( ( sd - > api ) & & ( sd - > api - > obj_unhook ) )
sd - > api - > obj_unhook ( obj ) ; // module - unhook
entries = eina_list_remove ( entries , obj ) ;
# ifdef HAVE_ELEMENTARY_X
if ( sd - > sel_notify_handler )
ecore_event_handler_del ( sd - > sel_notify_handler ) ;
if ( sd - > sel_clear_handler )
ecore_event_handler_del ( sd - > sel_clear_handler ) ;
# endif
if ( sd - > cut_sel ) eina_stringshare_del ( sd - > cut_sel ) ;
if ( sd - > text ) eina_stringshare_del ( sd - > text ) ;
if ( sd - > deferred_recalc_job )
ecore_job_del ( sd - > deferred_recalc_job ) ;
if ( sd - > append_text_idler )
{
ecore_idler_del ( sd - > append_text_idler ) ;
free ( sd - > append_text_left ) ;
sd - > append_text_left = NULL ;
sd - > append_text_idler = NULL ;
}
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > longpress_timer , ecore_timer_del ) ;
2013-03-08 20:23:42 -08:00
EINA_LIST_FREE ( sd - > items , it )
2012-08-30 09:45:15 -07:00
{
eina_stringshare_del ( it - > label ) ;
eina_stringshare_del ( it - > icon_file ) ;
eina_stringshare_del ( it - > icon_group ) ;
free ( it ) ;
}
2013-03-08 20:23:42 -08:00
EINA_LIST_FREE ( sd - > item_providers , ip )
2012-08-30 09:45:15 -07:00
{
free ( ip ) ;
}
2013-03-08 20:23:42 -08:00
EINA_LIST_FREE ( sd - > markup_filters , tf )
2012-08-30 09:45:15 -07:00
{
_filter_free ( tf ) ;
}
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > delay_write , ecore_timer_del ) ;
ELM_FREE_FUNC ( sd - > input_panel_imdata , free ) ;
ELM_FREE_FUNC ( sd - > anchor_hover . hover_style , eina_stringshare_del ) ;
2012-08-30 09:45:15 -07:00
evas_event_thaw ( evas_object_evas_get ( obj ) ) ;
evas_event_thaw_eval ( evas_object_evas_get ( obj ) ) ;
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , evas_obj_smart_del ( ) ) ;
2012-08-30 09:45:15 -07:00
}
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_move ( Eo * obj , void * _pd , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
Evas_Coord x = va_arg ( * list , Evas_Coord ) ;
Evas_Coord y = va_arg ( * list , Evas_Coord ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , evas_obj_smart_move ( x , y ) ) ;
2012-08-30 09:45:15 -07:00
evas_object_move ( sd - > hit_rect , x , y ) ;
if ( sd - > hoversel ) _hoversel_position ( obj ) ;
}
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_resize ( Eo * obj , void * _pd , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
Evas_Coord w = va_arg ( * list , Evas_Coord ) ;
Evas_Coord h = va_arg ( * list , Evas_Coord ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , evas_obj_smart_resize ( w , h ) ) ;
2012-08-30 09:45:15 -07:00
evas_object_resize ( sd - > hit_rect , w , h ) ;
}
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_member_add ( Eo * obj , void * _pd , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
Evas_Object * member = va_arg ( * list , Evas_Object * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , evas_obj_smart_member_add ( member ) ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > hit_rect )
evas_object_raise ( sd - > hit_rect ) ;
}
static void
2012-11-25 22:32:53 -08:00
_elm_entry_smart_content_aliases_get ( Eo * obj EINA_UNUSED , void * _pd EINA_UNUSED , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
const Elm_Layout_Part_Alias_Description * * aliases = va_arg ( * list , const Elm_Layout_Part_Alias_Description * * ) ;
* aliases = _content_aliases ;
2012-08-30 09:45:15 -07:00
}
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_theme_enable ( Eo * obj EINA_UNUSED , void * _pd EINA_UNUSED , va_list * list )
2012-08-30 09:45:15 -07:00
{
2012-11-25 22:32:53 -08:00
Eina_Bool * enable = va_arg ( * list , Eina_Bool * ) ;
* enable = EINA_FALSE ;
2012-08-30 09:45:15 -07:00
}
EAPI Evas_Object *
elm_entry_add ( Evas_Object * parent )
{
EINA_SAFETY_ON_NULL_RETURN_VAL ( parent , NULL ) ;
2012-11-25 22:32:53 -08:00
Evas_Object * obj = eo_add ( MY_CLASS , parent ) ;
eo_unref ( obj ) ;
return obj ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_constructor ( Eo * obj , void * _pd EINA_UNUSED , va_list * list EINA_UNUSED )
{
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , eo_constructor ( ) ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj ,
evas_obj_type_set ( MY_CLASS_NAME ) ,
evas_obj_smart_callbacks_descriptions_set ( _smart_callbacks , NULL ) ) ;
2012-08-30 09:45:15 -07:00
2013-04-02 19:28:53 -07:00
elm_widget_sub_object_add ( eo_parent_get ( obj ) , obj ) ;
2008-10-14 01:05:30 -07:00
}
2012-05-30 05:18:48 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_text_style_user_push ( Evas_Object * obj ,
const char * style )
2012-05-30 05:18:48 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_text_style_user_push ( style ) ) ;
}
static void
_text_style_user_push ( Eo * obj , void * _pd , va_list * list )
{
const char * style = va_arg ( * list , const char * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_style_user_push ( sd - > entry_edje , " elm.text " , style ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_wdg_theme ( NULL ) ) ;
2012-05-30 05:18:48 -07:00
}
EAPI void
elm_entry_text_style_user_pop ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_text_style_user_pop ( ) ) ;
}
static void
_text_style_user_pop ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_style_user_pop ( sd - > entry_edje , " elm.text " ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_wdg_theme ( NULL ) ) ;
2012-05-30 05:18:48 -07:00
}
2012-08-30 09:45:15 -07:00
EAPI const char *
2012-05-30 05:18:48 -07:00
elm_entry_text_style_user_peek ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
const char * ret = NULL ;
eo_do ( ( Eo * ) obj , elm_obj_entry_text_style_user_peek ( & ret ) ) ;
return ret ;
}
static void
_text_style_user_peek ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
const char * * ret = va_arg ( * list , const char * * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = edje_object_part_text_style_user_peek ( sd - > entry_edje , " elm.text " ) ;
2012-05-30 05:18:48 -07:00
}
2008-10-22 01:58:56 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_single_line_set ( Evas_Object * obj ,
Eina_Bool single_line )
{
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_single_line_set ( single_line ) ) ;
}
static void
_single_line_set ( Eo * obj , void * _pd , va_list * list )
{
Eina_Bool single_line = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( sd - > single_line = = single_line ) return ;
sd - > single_line = single_line ;
sd - > line_wrap = ELM_WRAP_NONE ;
2013-02-06 21:55:49 -08:00
if ( elm_entry_cnp_mode_get ( obj ) = = ELM_CNP_MODE_MARKUP )
elm_entry_cnp_mode_set ( obj , ELM_CNP_MODE_NO_IMAGE ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_wdg_theme ( NULL ) ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > scroll )
2011-06-17 02:44:31 -07:00
{
2012-08-30 09:45:15 -07:00
if ( sd - > single_line )
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_policy_set ( ELM_SCROLLER_POLICY_OFF , ELM_SCROLLER_POLICY_OFF ) ) ;
2011-06-17 02:44:31 -07:00
else
{
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_policy_set ( sd - > policy_h , sd - > policy_v ) ) ;
2011-06-17 02:44:31 -07:00
}
2012-08-30 09:45:15 -07:00
elm_layout_sizing_eval ( obj ) ;
2011-06-17 02:44:31 -07:00
}
2008-10-22 01:58:56 -07:00
}
2010-03-25 10:27:00 -07:00
EAPI Eina_Bool
elm_entry_single_line_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_single_line_get ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_single_line_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = sd - > single_line ;
2010-03-25 10:27:00 -07:00
}
2008-10-22 01:58:56 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_password_set ( Evas_Object * obj ,
Eina_Bool password )
2008-10-22 01:58:56 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_password_set ( password ) ) ;
}
static void
_password_set ( Eo * obj , void * _pd , va_list * list )
{
Eina_Bool password = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
password = ! ! password ;
if ( sd - > password = = password ) return ;
sd - > password = password ;
2011-12-03 14:16:14 -08:00
if ( password )
{
2012-08-30 09:45:15 -07:00
sd - > single_line = EINA_TRUE ;
sd - > line_wrap = ELM_WRAP_NONE ;
2011-12-03 14:16:14 -08:00
elm_drop_target_del ( obj ) ;
2012-08-30 09:45:15 -07:00
_entry_selection_callbacks_unregister ( obj ) ;
2011-12-03 14:16:14 -08:00
}
else
{
2013-05-13 04:18:24 -07:00
# ifdef HAVE_ELEMENTARY_X
2013-02-21 05:21:08 -08:00
elm_drop_target_add ( obj , ELM_SEL_FORMAT_MARKUP ,
NULL , NULL ,
NULL , NULL ,
NULL , NULL ,
_drag_drop_cb , NULL ) ;
2013-05-13 04:18:24 -07:00
# endif
2012-08-30 09:45:15 -07:00
_entry_selection_callbacks_register ( obj ) ;
}
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_wdg_theme ( NULL ) ) ;
2008-10-22 01:58:56 -07:00
}
2010-03-25 10:27:00 -07:00
EAPI Eina_Bool
elm_entry_password_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_password_get ( & ret ) ) ;
return ret ;
}
static void
_password_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > password ;
2010-03-25 10:27:00 -07:00
}
2012-01-02 03:17:29 -08:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_entry_set ( Evas_Object * obj ,
const char * entry )
2008-10-14 01:05:30 -07:00
{
2012-10-18 17:56:03 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_layout_text_set ( NULL , entry , NULL ) ) ;
2008-10-14 01:05:30 -07:00
}
2008-10-15 02:58:44 -07:00
2012-01-02 03:17:29 -08:00
EAPI const char *
elm_entry_entry_get ( const Evas_Object * obj )
{
2012-10-18 17:56:03 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
const char * text ;
eo_do ( ( Eo * ) obj , elm_obj_layout_text_get ( NULL , & text ) ) ;
return text ;
2012-01-02 03:17:29 -08:00
}
2011-06-13 04:07:43 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_entry_append ( Evas_Object * obj ,
const char * entry )
2011-06-13 04:07:43 -07:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_entry_append ( entry ) ) ;
}
static void
_entry_append ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
const char * entry = va_arg ( * list , const char * ) ;
2011-06-13 04:07:43 -07:00
int len = 0 ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2011-06-13 04:07:43 -07:00
if ( ! entry ) entry = " " ;
2012-08-30 09:45:15 -07:00
sd - > changed = EINA_TRUE ;
2011-06-13 04:07:43 -07:00
len = strlen ( entry ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > append_text_left )
2011-06-13 04:07:43 -07:00
{
char * tmpbuf ;
2012-08-30 09:45:15 -07:00
tmpbuf = realloc ( sd - > append_text_left , sd - > append_text_len + len + 1 ) ;
2011-06-13 04:07:43 -07:00
if ( ! tmpbuf )
{
/* Do something */
return ;
}
2012-08-30 09:45:15 -07:00
sd - > append_text_left = tmpbuf ;
memcpy ( sd - > append_text_left + sd - > append_text_len , entry , len + 1 ) ;
sd - > append_text_len + = len ;
2011-06-13 04:07:43 -07:00
}
else
{
/* FIXME: Add chunked appending here (like in entry_set) */
2012-08-30 09:45:15 -07:00
edje_object_part_text_append ( sd - > entry_edje , " elm.text " , entry ) ;
2011-06-13 04:07:43 -07:00
}
}
2011-01-24 19:04:33 -08:00
EAPI Eina_Bool
elm_entry_is_empty ( const Evas_Object * obj )
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) EINA_TRUE ;
Eina_Bool ret = EINA_TRUE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_is_empty ( & ret ) ) ;
return ret ;
}
static void
_is_empty ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
2012-08-30 09:45:15 -07:00
/* FIXME: until there's support for that in textblock, we just
* check to see if the there is text or not . */
2011-01-24 19:04:33 -08:00
const Evas_Object * tb ;
Evas_Textblock_Cursor * cur ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
/* It's a hack until we get the support suggested above. We just
* create a cursor , point it to the begining , and then try to
* advance it , if it can advance , the tb is not empty , otherwise it
* is . */
tb = edje_object_part_object_get ( sd - > entry_edje , " elm.text " ) ;
/* This is actually, ok for the time being, these hackish stuff
will be removed once evas 1.0 is out */
cur = evas_object_textblock_cursor_new ( ( Evas_Object * ) tb ) ;
2011-01-24 19:04:33 -08:00
evas_textblock_cursor_pos_set ( cur , 0 ) ;
2012-11-25 22:32:53 -08:00
* ret = evas_textblock_cursor_char_next ( cur ) ;
2011-01-24 19:04:33 -08:00
evas_textblock_cursor_free ( cur ) ;
2012-11-25 22:32:53 -08:00
* ret = ! * ret ;
2011-01-24 19:04:33 -08:00
}
2012-01-24 23:35:04 -08:00
EAPI Evas_Object *
elm_entry_textblock_get ( Evas_Object * obj )
2011-11-14 05:56:06 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
Evas_Object * ret = NULL ;
eo_do ( obj , elm_obj_entry_textblock_get ( & ret ) ) ;
return ret ;
}
static void
_textblock_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Evas_Object * * ret = va_arg ( * list , Evas_Object * * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2011-11-14 05:56:06 -08:00
2012-11-25 22:32:53 -08:00
* ret = ( Evas_Object * ) edje_object_part_object_get
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " ) ;
2011-11-14 05:56:06 -08:00
}
EAPI void
2012-01-24 23:35:04 -08:00
elm_entry_calc_force ( Evas_Object * obj )
2011-11-14 05:56:06 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_calc_force ( ) ) ;
}
static void
_calc_force ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2011-11-14 05:56:06 -08:00
2012-08-30 09:45:15 -07:00
edje_object_calc_force ( sd - > entry_edje ) ;
sd - > changed = EINA_TRUE ;
elm_layout_sizing_eval ( obj ) ;
2011-11-14 05:56:06 -08:00
}
2008-10-16 02:17:57 -07:00
EAPI const char *
2009-02-25 07:54:26 -08:00
elm_entry_selection_get ( const Evas_Object * obj )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
const char * ret = NULL ;
eo_do ( ( Eo * ) obj , elm_obj_entry_selection_get ( & ret ) ) ;
return ret ;
}
static void
_selection_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
const char * * ret = va_arg ( * list , const char * * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = NULL ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
if ( ( sd - > password ) ) return ;
* ret = edje_object_part_text_selection_get ( sd - > entry_edje , " elm.text " ) ;
2008-10-16 02:17:57 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_entry_insert ( Evas_Object * obj ,
const char * entry )
2008-10-16 02:17:57 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_entry_insert ( entry ) ) ;
}
static void
_entry_insert ( Eo * obj , void * _pd , va_list * list )
{
const char * entry = va_arg ( * list , const char * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_insert ( sd - > entry_edje , " elm.text " , entry ) ;
sd - > changed = EINA_TRUE ;
elm_layout_sizing_eval ( obj ) ;
2008-10-16 02:17:57 -07:00
}
2008-10-17 07:40:54 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_line_wrap_set ( Evas_Object * obj ,
Elm_Wrap_Type wrap )
2008-10-17 07:40:54 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_line_wrap_set ( wrap ) ) ;
}
static void
_line_wrap_set ( Eo * obj , void * _pd , va_list * list )
{
Elm_Wrap_Type wrap = va_arg ( * list , Elm_Wrap_Type ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( sd - > line_wrap = = wrap ) return ;
sd - > last_w = - 1 ;
sd - > line_wrap = wrap ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_wdg_theme ( NULL ) ) ;
2008-10-24 19:11:06 -07:00
}
2011-07-05 04:29:35 -07:00
EAPI Elm_Wrap_Type
elm_entry_line_wrap_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Elm_Wrap_Type ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_line_wrap_get ( & ret ) ) ;
return ret ;
}
static void
_line_wrap_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Wrap_Type * ret = va_arg ( * list , Elm_Wrap_Type * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > line_wrap ;
2011-07-05 04:29:35 -07:00
}
2008-10-24 19:11:06 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_editable_set ( Evas_Object * obj ,
Eina_Bool editable )
2008-10-24 19:11:06 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_editable_set ( editable ) ) ;
}
static void
_editable_set ( Eo * obj , void * _pd , va_list * list )
{
Eina_Bool editable = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( sd - > editable = = editable ) return ;
sd - > editable = editable ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_wdg_theme ( NULL ) ) ;
2010-09-06 23:56:16 -07:00
2013-05-13 04:18:24 -07:00
# ifdef HAVE_ELEMENTARY_X
2010-09-06 23:56:16 -07:00
if ( editable )
2013-02-21 05:21:08 -08:00
elm_drop_target_add ( obj , ELM_SEL_FORMAT_MARKUP ,
NULL , NULL ,
NULL , NULL ,
NULL , NULL ,
_drag_drop_cb , NULL ) ;
2010-09-06 23:56:16 -07:00
else
2013-05-13 04:18:24 -07:00
# endif
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
elm_drop_target_del ( obj ) ;
2008-10-17 07:40:54 -07:00
}
2008-11-18 00:45:38 -08:00
2010-03-25 10:27:00 -07:00
EAPI Eina_Bool
elm_entry_editable_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_editable_get ( & ret ) ) ;
return ret ;
}
static void
_editable_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > editable ;
2010-03-25 10:27:00 -07:00
}
2008-11-18 00:45:38 -08:00
EAPI void
elm_entry_select_none ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_select_none ( ) ) ;
}
static void
_select_none ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( ( sd - > password ) ) return ;
if ( sd - > sel_mode )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
sd - > sel_mode = EINA_FALSE ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_FALSE ) ;
edje_object_signal_emit ( sd - > entry_edje , " elm,state,select,off " , " elm " ) ;
2009-03-19 06:36:46 -07:00
}
2012-08-30 09:45:15 -07:00
sd - > have_selection = EINA_FALSE ;
edje_object_part_text_select_none ( sd - > entry_edje , " elm.text " ) ;
2008-11-18 00:45:38 -08:00
}
EAPI void
elm_entry_select_all ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_select_all ( ) ) ;
}
static void
_select_all ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( ( sd - > password ) ) return ;
if ( sd - > sel_mode )
2009-03-19 06:36:46 -07:00
{
2012-08-30 09:45:15 -07:00
sd - > sel_mode = EINA_FALSE ;
2011-04-01 06:20:40 -07:00
if ( ! _elm_config - > desktop_entry )
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_allow_set
( sd - > entry_edje , " elm.text " , EINA_FALSE ) ;
edje_object_signal_emit ( sd - > entry_edje , " elm,state,select,off " , " elm " ) ;
2009-03-19 06:36:46 -07:00
}
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_all ( sd - > entry_edje , " elm.text " ) ;
2008-11-18 00:45:38 -08:00
}
2009-01-26 16:44:29 -08:00
2011-01-23 19:01:33 -08:00
EAPI Eina_Bool
2012-08-30 09:45:15 -07:00
elm_entry_cursor_geometry_get ( const Evas_Object * obj ,
Evas_Coord * x ,
Evas_Coord * y ,
Evas_Coord * w ,
Evas_Coord * h )
2011-01-23 19:01:33 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_cursor_geometry_get ( x , y , w , h , & ret ) ) ;
return ret ;
}
static void
_cursor_geometry_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Evas_Coord * x = va_arg ( * list , Evas_Coord * ) ;
Evas_Coord * y = va_arg ( * list , Evas_Coord * ) ;
Evas_Coord * w = va_arg ( * list , Evas_Coord * ) ;
Evas_Coord * h = va_arg ( * list , Evas_Coord * ) ;
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
if ( ret ) * ret = EINA_TRUE ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_geometry_get
( sd - > entry_edje , " elm.text " , x , y , w , h ) ;
2011-01-23 19:01:33 -08:00
}
2009-12-01 03:03:14 -08:00
EAPI Eina_Bool
elm_entry_cursor_next ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( obj , elm_obj_entry_cursor_next ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_cursor_next ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = edje_object_part_text_cursor_next
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI Eina_Bool
elm_entry_cursor_prev ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( obj , elm_obj_entry_cursor_prev ( & ret ) ) ;
return ret ;
}
static void
_cursor_prev ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = edje_object_part_text_cursor_prev
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI Eina_Bool
elm_entry_cursor_up ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( obj , elm_obj_entry_cursor_up ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_cursor_up ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = edje_object_part_text_cursor_up
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI Eina_Bool
elm_entry_cursor_down ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( obj , elm_obj_entry_cursor_down ( & ret ) ) ;
return ret ;
}
static void
_cursor_down ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = edje_object_part_text_cursor_down
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_cursor_begin_set ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_cursor_begin_set ( ) ) ;
}
static void
_cursor_begin_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_begin_set
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_cursor_end_set ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_cursor_end_set ( ) ) ;
}
static void
_cursor_end_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_end_set
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_cursor_line_begin_set ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_cursor_line_begin_set ( ) ) ;
}
static void
_cursor_line_begin_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_line_begin_set
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_cursor_line_end_set ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_cursor_line_end_set ( ) ) ;
}
static void
_cursor_line_end_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_line_end_set
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_cursor_selection_begin ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_cursor_selection_begin ( ) ) ;
}
static void
_cursor_selection_begin ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_begin ( sd - > entry_edje , " elm.text " ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_cursor_selection_end ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_cursor_selection_end ( ) ) ;
}
static void
_cursor_selection_end ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_select_extend ( sd - > entry_edje , " elm.text " ) ;
2009-12-01 03:03:14 -08:00
}
EAPI Eina_Bool
2010-03-23 20:06:00 -07:00
elm_entry_cursor_is_format_get ( const Evas_Object * obj )
2009-12-01 03:03:14 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_cursor_is_format_get ( & ret ) ) ;
return ret ;
2009-12-01 03:03:14 -08:00
}
2012-11-25 22:32:53 -08:00
static void
_cursor_is_format_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = edje_object_part_text_cursor_is_format_get
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
}
EAPI Eina_Bool
2010-03-23 20:06:00 -07:00
elm_entry_cursor_is_visible_format_get ( const Evas_Object * obj )
2009-12-01 03:03:14 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_cursor_is_visible_format_get ( & ret ) ) ;
return ret ;
}
static void
_cursor_is_visible_format_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = edje_object_part_text_cursor_is_visible_format_get
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
2012-01-02 03:43:25 -08:00
EAPI char *
2010-03-23 20:06:00 -07:00
elm_entry_cursor_content_get ( const Evas_Object * obj )
2009-12-01 03:03:14 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
char * ret = NULL ;
eo_do ( ( Eo * ) obj , elm_obj_entry_cursor_content_get ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_cursor_content_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
char * * ret = va_arg ( * list , char * * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = edje_object_part_text_cursor_content_get
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2009-12-01 03:03:14 -08:00
}
2011-02-27 02:25:45 -08:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_cursor_pos_set ( Evas_Object * obj ,
int pos )
2011-02-27 02:25:45 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_cursor_pos_set ( pos ) ) ;
}
static void
_cursor_pos_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
int pos = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
edje_object_part_text_cursor_pos_set
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN , pos ) ;
edje_object_message_signal_process ( sd - > entry_edje ) ;
2011-02-27 02:25:45 -08:00
}
EAPI int
elm_entry_cursor_pos_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) 0 ;
2012-11-25 22:32:53 -08:00
int ret = 0 ;
eo_do ( ( Eo * ) obj , elm_obj_entry_cursor_pos_get ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_cursor_pos_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
int * ret = va_arg ( * list , int * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = edje_object_part_text_cursor_pos_get
2012-08-30 09:45:15 -07:00
( sd - > entry_edje , " elm.text " , EDJE_CURSOR_MAIN ) ;
2011-02-27 02:25:45 -08:00
}
2009-12-01 03:03:14 -08:00
EAPI void
elm_entry_selection_cut ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_selection_cut ( ) ) ;
}
static void
_selection_cut ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( ( sd - > password ) ) return ;
_cut_cb ( obj , NULL , NULL ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_selection_copy ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_selection_copy ( ) ) ;
}
static void
_selection_copy ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( ( sd - > password ) ) return ;
_copy_cb ( obj , NULL , NULL ) ;
2009-12-01 03:03:14 -08:00
}
EAPI void
elm_entry_selection_paste ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_selection_paste ( ) ) ;
}
static void
_selection_paste ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( ( sd - > password ) ) return ;
_paste_cb ( obj , NULL , NULL ) ;
2009-12-01 03:03:14 -08:00
}
2009-09-02 05:48:00 -07:00
EAPI void
elm_entry_context_menu_clear ( Evas_Object * obj )
2012-11-25 22:32:53 -08:00
{
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_context_menu_clear ( ) ) ;
}
static void
_context_menu_clear ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
2009-09-02 05:48:00 -07:00
{
Elm_Entry_Context_Menu_Item * it ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2013-03-08 20:23:42 -08:00
EINA_LIST_FREE ( sd - > items , it )
2009-09-02 05:48:00 -07:00
{
eina_stringshare_del ( it - > label ) ;
eina_stringshare_del ( it - > icon_file ) ;
eina_stringshare_del ( it - > icon_group ) ;
free ( it ) ;
}
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_context_menu_item_add ( Evas_Object * obj ,
const char * label ,
const char * icon_file ,
Elm_Icon_Type icon_type ,
Evas_Smart_Cb func ,
const void * data )
2009-09-02 05:48:00 -07:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_context_menu_item_add ( label , icon_file , icon_type , func , data ) ) ;
}
static void
_context_menu_item_add ( Eo * obj , void * _pd , va_list * list )
{
const char * label = va_arg ( * list , const char * ) ;
const char * icon_file = va_arg ( * list , const char * ) ;
Elm_Icon_Type icon_type = va_arg ( * list , Elm_Icon_Type ) ;
Evas_Smart_Cb func = va_arg ( * list , Evas_Smart_Cb ) ;
const void * data = va_arg ( * list , const void * ) ;
2009-09-02 05:48:00 -07:00
Elm_Entry_Context_Menu_Item * it ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2009-09-02 05:48:00 -07:00
it = calloc ( 1 , sizeof ( Elm_Entry_Context_Menu_Item ) ) ;
if ( ! it ) return ;
2012-08-30 09:45:15 -07:00
sd - > items = eina_list_append ( sd - > items , it ) ;
2009-09-02 05:48:00 -07:00
it - > obj = obj ;
it - > label = eina_stringshare_add ( label ) ;
it - > icon_file = eina_stringshare_add ( icon_file ) ;
it - > icon_type = icon_type ;
it - > func = func ;
it - > data = ( void * ) data ;
}
2009-10-10 22:48:24 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_context_menu_disabled_set ( Evas_Object * obj ,
Eina_Bool disabled )
2009-10-10 22:48:24 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_context_menu_disabled_set ( disabled ) ) ;
}
static void
_context_menu_disabled_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool disabled = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( sd - > context_menu = = ! disabled ) return ;
sd - > context_menu = ! disabled ;
2009-10-10 22:48:24 -07:00
}
EAPI Eina_Bool
2010-03-23 20:06:00 -07:00
elm_entry_context_menu_disabled_get ( const Evas_Object * obj )
2009-10-10 22:48:24 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_context_menu_disabled_get ( & ret ) ) ;
return ret ;
}
static void
_context_menu_disabled_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = ! sd - > context_menu ;
2009-10-10 22:48:24 -07:00
}
2013-02-27 04:06:05 -08:00
EAPI const char *
elm_entry_context_menu_item_label_get ( const Elm_Entry_Context_Menu_Item * item )
{
if ( ! item ) return NULL ;
return item - > label ;
}
EAPI void
elm_entry_context_menu_item_icon_get ( const Elm_Entry_Context_Menu_Item * item ,
const char * * icon_file ,
const char * * icon_group ,
Elm_Icon_Type * icon_type )
{
if ( ! item ) return ;
if ( icon_file ) * icon_file = item - > icon_file ;
if ( icon_group ) * icon_group = item - > icon_group ;
if ( icon_type ) * icon_type = item - > icon_type ;
}
2010-04-27 01:06:42 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_item_provider_append ( Evas_Object * obj ,
Elm_Entry_Item_Provider_Cb func ,
void * data )
2010-04-27 01:06:42 -07:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_item_provider_append ( func , data ) ) ;
}
static void
_item_provider_append ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Entry_Item_Provider_Cb func = va_arg ( * list , Elm_Entry_Item_Provider_Cb ) ;
void * data = va_arg ( * list , void * ) ;
2012-08-30 09:45:15 -07:00
Elm_Entry_Item_Provider * ip ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2010-12-03 06:08:33 -08:00
EINA_SAFETY_ON_NULL_RETURN ( func ) ;
2012-08-30 09:45:15 -07:00
ip = calloc ( 1 , sizeof ( Elm_Entry_Item_Provider ) ) ;
2010-04-27 01:06:42 -07:00
if ( ! ip ) return ;
2012-08-30 09:45:15 -07:00
2010-04-27 01:06:42 -07:00
ip - > func = func ;
ip - > data = data ;
2012-08-30 09:45:15 -07:00
sd - > item_providers = eina_list_append ( sd - > item_providers , ip ) ;
2010-04-27 01:06:42 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_item_provider_prepend ( Evas_Object * obj ,
Elm_Entry_Item_Provider_Cb func ,
void * data )
2010-04-27 01:06:42 -07:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_item_provider_prepend ( func , data ) ) ;
}
static void
_item_provider_prepend ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Entry_Item_Provider_Cb func = va_arg ( * list , Elm_Entry_Item_Provider_Cb ) ;
void * data = va_arg ( * list , void * ) ;
2012-08-30 09:45:15 -07:00
Elm_Entry_Item_Provider * ip ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2010-12-03 06:08:33 -08:00
EINA_SAFETY_ON_NULL_RETURN ( func ) ;
2012-08-30 09:45:15 -07:00
ip = calloc ( 1 , sizeof ( Elm_Entry_Item_Provider ) ) ;
2010-04-27 01:06:42 -07:00
if ( ! ip ) return ;
2012-08-30 09:45:15 -07:00
2010-04-27 01:06:42 -07:00
ip - > func = func ;
ip - > data = data ;
2012-08-30 09:45:15 -07:00
sd - > item_providers = eina_list_prepend ( sd - > item_providers , ip ) ;
2010-04-27 01:06:42 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_item_provider_remove ( Evas_Object * obj ,
Elm_Entry_Item_Provider_Cb func ,
void * data )
2010-04-27 01:06:42 -07:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_item_provider_remove ( func , data ) ) ;
}
static void
_item_provider_remove ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Entry_Item_Provider_Cb func = va_arg ( * list , Elm_Entry_Item_Provider_Cb ) ;
void * data = va_arg ( * list , void * ) ;
2010-04-27 01:06:42 -07:00
Eina_List * l ;
Elm_Entry_Item_Provider * ip ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2010-12-03 06:08:33 -08:00
EINA_SAFETY_ON_NULL_RETURN ( func ) ;
2012-08-30 09:45:15 -07:00
2012-10-01 00:36:27 -07:00
EINA_LIST_FOREACH ( sd - > item_providers , l , ip )
2010-04-27 01:06:42 -07:00
{
2011-02-14 00:47:19 -08:00
if ( ( ip - > func = = func ) & & ( ( ! data ) | | ( ip - > data = = data ) ) )
2010-04-27 01:06:42 -07:00
{
2012-08-30 09:45:15 -07:00
sd - > item_providers = eina_list_remove_list ( sd - > item_providers , l ) ;
2010-04-27 01:06:42 -07:00
free ( ip ) ;
return ;
}
}
}
2012-02-07 23:23:49 -08:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_markup_filter_append ( Evas_Object * obj ,
Elm_Entry_Filter_Cb func ,
void * data )
2012-02-07 23:23:49 -08:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_markup_filter_append ( func , data ) ) ;
}
static void
_markup_filter_append ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Entry_Filter_Cb func = va_arg ( * list , Elm_Entry_Filter_Cb ) ;
void * data = va_arg ( * list , void * ) ;
2012-02-07 23:23:49 -08:00
Elm_Entry_Markup_Filter * tf ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-07 23:23:49 -08:00
EINA_SAFETY_ON_NULL_RETURN ( func ) ;
tf = _filter_new ( func , data ) ;
if ( ! tf ) return ;
2012-08-30 09:45:15 -07:00
sd - > markup_filters = eina_list_append ( sd - > markup_filters , tf ) ;
2012-02-07 23:23:49 -08:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_markup_filter_prepend ( Evas_Object * obj ,
Elm_Entry_Filter_Cb func ,
void * data )
2012-02-07 23:23:49 -08:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_markup_filter_prepend ( func , data ) ) ;
}
static void
_markup_filter_prepend ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Entry_Filter_Cb func = va_arg ( * list , Elm_Entry_Filter_Cb ) ;
void * data = va_arg ( * list , void * ) ;
2012-02-07 23:23:49 -08:00
Elm_Entry_Markup_Filter * tf ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-07 23:23:49 -08:00
EINA_SAFETY_ON_NULL_RETURN ( func ) ;
tf = _filter_new ( func , data ) ;
if ( ! tf ) return ;
2012-08-30 09:45:15 -07:00
sd - > markup_filters = eina_list_prepend ( sd - > markup_filters , tf ) ;
2012-02-07 23:23:49 -08:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_markup_filter_remove ( Evas_Object * obj ,
Elm_Entry_Filter_Cb func ,
void * data )
2012-02-07 23:23:49 -08:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_markup_filter_remove ( func , data ) ) ;
}
static void
_markup_filter_remove ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Entry_Filter_Cb func = va_arg ( * list , Elm_Entry_Filter_Cb ) ;
void * data = va_arg ( * list , void * ) ;
2012-02-07 23:23:49 -08:00
Eina_List * l ;
Elm_Entry_Markup_Filter * tf ;
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-07 23:23:49 -08:00
EINA_SAFETY_ON_NULL_RETURN ( func ) ;
2012-10-01 00:36:27 -07:00
EINA_LIST_FOREACH ( sd - > markup_filters , l , tf )
2012-02-07 23:23:49 -08:00
{
2013-05-16 02:10:13 -07:00
if ( ( tf - > func = = func ) & & ( ( ! data ) | | ( tf - > orig_data = = data ) ) )
2012-02-07 23:23:49 -08:00
{
2012-08-30 09:45:15 -07:00
sd - > markup_filters = eina_list_remove_list ( sd - > markup_filters , l ) ;
2012-02-07 23:23:49 -08:00
_filter_free ( tf ) ;
return ;
}
}
}
2009-01-26 16:44:29 -08:00
EAPI char *
elm_entry_markup_to_utf8 ( const char * s )
{
2010-12-19 22:05:59 -08:00
char * ss = _elm_util_mkup_to_text ( s ) ;
2010-03-24 22:13:59 -07:00
if ( ! ss ) ss = strdup ( " " ) ;
return ss ;
2009-01-26 16:44:29 -08:00
}
EAPI char *
elm_entry_utf8_to_markup ( const char * s )
{
2010-12-19 22:05:59 -08:00
char * ss = _elm_util_text_to_mkup ( s ) ;
2010-03-24 22:13:59 -07:00
if ( ! ss ) ss = strdup ( " " ) ;
return ss ;
2009-01-26 16:44:29 -08:00
}
2010-09-06 23:56:16 -07:00
2011-12-30 02:02:19 -08:00
static const char *
_text_get ( const Evas_Object * obj )
{
return elm_object_text_get ( obj ) ;
}
2010-10-07 05:50:00 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_filter_limit_size ( void * data ,
Evas_Object * entry ,
char * * text )
2010-10-07 05:50:00 -07:00
{
2012-08-30 09:45:15 -07:00
const char * ( * text_get ) ( const Evas_Object * ) ;
2010-10-07 05:50:00 -07:00
Elm_Entry_Filter_Limit_Size * lim = data ;
2011-09-24 21:14:17 -07:00
char * current , * utfstr ;
2010-10-07 05:50:00 -07:00
int len , newlen ;
2010-12-03 06:08:33 -08:00
EINA_SAFETY_ON_NULL_RETURN ( data ) ;
EINA_SAFETY_ON_NULL_RETURN ( entry ) ;
EINA_SAFETY_ON_NULL_RETURN ( text ) ;
2010-10-07 05:50:00 -07:00
/* hack. I don't want to copy the entire function to work with
* scrolled_entry */
2011-12-30 02:02:19 -08:00
text_get = _text_get ;
2010-10-07 05:50:00 -07:00
current = elm_entry_markup_to_utf8 ( text_get ( entry ) ) ;
2011-09-24 21:14:17 -07:00
utfstr = elm_entry_markup_to_utf8 ( * text ) ;
2010-10-07 05:50:00 -07:00
if ( lim - > max_char_count > 0 )
{
len = evas_string_char_len_get ( current ) ;
2012-04-06 01:13:41 -07:00
newlen = evas_string_char_len_get ( utfstr ) ;
if ( ( len > = lim - > max_char_count ) & & ( newlen > 0 ) )
2010-10-07 05:50:00 -07:00
{
2013-05-12 17:00:50 -07:00
evas_object_smart_callback_call ( entry , SIG_MAX_LENGTH , NULL ) ;
2010-10-07 05:50:00 -07:00
free ( * text ) ;
* text = NULL ;
2011-09-24 21:14:17 -07:00
free ( current ) ;
free ( utfstr ) ;
2010-10-07 05:50:00 -07:00
return ;
}
2011-06-14 02:50:05 -07:00
if ( ( len + newlen ) > lim - > max_char_count )
2012-08-30 09:45:15 -07:00
_chars_add_till_limit
( entry , text , ( lim - > max_char_count - len ) , LENGTH_UNIT_CHAR ) ;
2010-10-07 05:50:00 -07:00
}
2011-06-14 02:50:05 -07:00
else if ( lim - > max_byte_count > 0 )
2010-10-07 05:50:00 -07:00
{
len = strlen ( current ) ;
2012-04-06 01:13:41 -07:00
newlen = strlen ( utfstr ) ;
if ( ( len > = lim - > max_byte_count ) & & ( newlen > 0 ) )
2010-10-07 05:50:00 -07:00
{
2013-05-12 17:00:50 -07:00
evas_object_smart_callback_call ( entry , SIG_MAX_LENGTH , NULL ) ;
2010-10-07 05:50:00 -07:00
free ( * text ) ;
* text = NULL ;
2011-09-24 21:14:17 -07:00
free ( current ) ;
free ( utfstr ) ;
2010-10-07 05:50:00 -07:00
return ;
}
2011-06-14 02:50:05 -07:00
if ( ( len + newlen ) > lim - > max_byte_count )
2012-08-30 09:45:15 -07:00
_chars_add_till_limit
( entry , text , ( lim - > max_byte_count - len ) , LENGTH_UNIT_BYTE ) ;
2010-10-07 05:50:00 -07:00
}
2012-08-30 09:45:15 -07:00
2010-10-07 05:50:00 -07:00
free ( current ) ;
2011-09-24 21:14:17 -07:00
free ( utfstr ) ;
2010-10-07 05:50:00 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_filter_accept_set ( void * data ,
Evas_Object * entry __UNUSED__ ,
char * * text )
2010-10-07 05:50:00 -07:00
{
2012-08-30 09:45:15 -07:00
int read_idx , last_read_idx = 0 , read_char ;
2010-10-07 05:50:00 -07:00
Elm_Entry_Filter_Accept_Set * as = data ;
2012-08-30 09:45:15 -07:00
Eina_Bool goes_in ;
2010-10-07 05:50:00 -07:00
const char * set ;
char * insert ;
2010-12-03 06:08:33 -08:00
EINA_SAFETY_ON_NULL_RETURN ( data ) ;
EINA_SAFETY_ON_NULL_RETURN ( text ) ;
if ( ( ! as - > accepted ) & & ( ! as - > rejected ) )
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
return ;
2010-10-07 05:50:00 -07:00
if ( as - > accepted )
{
set = as - > accepted ;
goes_in = EINA_TRUE ;
}
else
{
set = as - > rejected ;
goes_in = EINA_FALSE ;
}
insert = * text ;
read_idx = evas_string_char_next_get ( * text , 0 , & read_char ) ;
while ( read_char )
{
int cmp_idx , cmp_char ;
Eina_Bool in_set = EINA_FALSE ;
2013-05-01 22:49:45 -07:00
if ( read_char = = ' < ' )
2010-10-07 05:50:00 -07:00
{
2013-05-01 22:49:45 -07:00
while ( read_char & & ( read_char ! = ' > ' ) )
read_idx = evas_string_char_next_get ( * text , read_idx , & read_char ) ;
if ( goes_in ) in_set = EINA_TRUE ;
else in_set = EINA_FALSE ;
}
else
{
if ( read_char = = ' & ' )
2010-10-07 05:50:00 -07:00
{
2013-05-01 22:49:45 -07:00
while ( read_char & & ( read_char ! = ' ; ' ) )
read_idx = evas_string_char_next_get ( * text , read_idx , & read_char ) ;
if ( ! read_char )
{
if ( goes_in ) in_set = EINA_TRUE ;
else in_set = EINA_FALSE ;
goto inserting ;
}
if ( read_char = = ' ; ' )
{
char * tag ;
2013-05-05 23:51:54 -07:00
int utf8 ;
2013-05-01 22:49:45 -07:00
tag = malloc ( read_idx - last_read_idx + 1 ) ;
if ( tag )
{
strncpy ( tag , ( * text ) + last_read_idx , read_idx - last_read_idx ) ;
2013-05-05 23:51:54 -07:00
tag [ read_idx - last_read_idx ] = 0 ;
utf8 = * ( elm_entry_markup_to_utf8 ( tag ) ) ;
2013-05-01 22:49:45 -07:00
free ( tag ) ;
2013-05-05 23:51:54 -07:00
if ( ! utf8 )
{
in_set = EINA_FALSE ;
goto inserting ;
}
read_char = utf8 ;
2013-05-01 22:49:45 -07:00
}
}
}
cmp_idx = evas_string_char_next_get ( set , 0 , & cmp_char ) ;
while ( cmp_char )
{
if ( read_char = = cmp_char )
{
in_set = EINA_TRUE ;
break ;
}
cmp_idx = evas_string_char_next_get ( set , cmp_idx , & cmp_char ) ;
2010-10-07 05:50:00 -07:00
}
}
2013-05-01 22:49:45 -07:00
inserting :
2010-10-07 05:50:00 -07:00
if ( in_set = = goes_in )
{
int size = read_idx - last_read_idx ;
const char * src = ( * text ) + last_read_idx ;
if ( src ! = insert )
elementary - entry, genlist, gengrid, image, icon, hover, frame, diskselector, index, layout, label, conform, flip, flipselector - removed white spaces
SVN revision: 58252
2011-04-01 04:32:33 -07:00
memcpy ( insert , * text + last_read_idx , size ) ;
2010-10-07 05:50:00 -07:00
insert + = size ;
}
2013-05-01 22:49:45 -07:00
if ( read_char )
{
last_read_idx = read_idx ;
read_idx = evas_string_char_next_get ( * text , read_idx , & read_char ) ;
}
2010-10-07 05:50:00 -07:00
}
* insert = 0 ;
}
2010-09-06 23:56:16 -07:00
2012-03-06 14:51:40 -08:00
EAPI Eina_Bool
2012-08-30 09:45:15 -07:00
elm_entry_file_set ( Evas_Object * obj ,
const char * file ,
Elm_Text_Format format )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( obj , elm_obj_entry_file_set ( file , format , & ret ) ) ;
return ret ;
}
static void
_file_set ( Eo * obj , void * _pd , va_list * list )
{
const char * file = va_arg ( * list , const char * ) ;
Elm_Text_Format format = va_arg ( * list , Elm_Text_Format ) ;
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
if ( ret ) * ret = EINA_FALSE ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > delay_write , ecore_timer_del ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > auto_save ) _save_do ( obj ) ;
eina_stringshare_replace ( & sd - > file , file ) ;
sd - > format = format ;
2012-11-25 22:32:53 -08:00
Eina_Bool int_ret = _load_do ( obj ) ;
if ( ret ) * ret = int_ret ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_file_get ( const Evas_Object * obj ,
const char * * file ,
Elm_Text_Format * format )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( ( Eo * ) obj , elm_obj_entry_file_get ( file , format ) ) ;
}
static void
_file_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
const char * * file = va_arg ( * list , const char * * ) ;
Elm_Text_Format * format = va_arg ( * list , Elm_Text_Format * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( file ) * file = sd - > file ;
if ( format ) * format = sd - > format ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
EAPI void
elm_entry_file_save ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_file_save ( ) ) ;
}
static void
_file_save ( Eo * obj , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2013-05-21 10:24:02 -07:00
ELM_FREE_FUNC ( sd - > delay_write , ecore_timer_del ) ;
2012-08-30 09:45:15 -07:00
_save_do ( obj ) ;
sd - > delay_write = ecore_timer_add ( 2.0 , _delay_write , obj ) ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_autosave_set ( Evas_Object * obj ,
Eina_Bool auto_save )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_autosave_set ( auto_save ) ) ;
}
static void
_autosave_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool auto_save = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
sd - > auto_save = ! ! auto_save ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
EAPI Eina_Bool
2010-11-08 08:39:07 -08:00
elm_entry_autosave_get ( const Evas_Object * obj )
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_autosave_get ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_autosave_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = sd - > auto_save ;
Remove elm_notepad
Notepad had a big issue: users couldn't access the entry, so notepad
was something near to an useless widget.
We needed to choose between wrap all entry functions or add these file
save / load and autosave features to entries.
As discussed on the emails list, we decided to go with the second
option, so we won't have an extra widget with lots of wrap functions.
Notepad was internally just an elm_entry with a scroll, so using
a scrolled entry with a file set will do the job.
I've added a test called Entry Notepad that looks like the removed
Notepad test. But we will see the improvements - you can clear the entry
or whatever you want, because the entry is the object you are creating.
If you were using elm_notepad before, just s/notepad/scrolled_entry
and almost everything should work fine. Another change was the function
file_save(obj, file, format), is now just file_save(obj), and the
file and format used are defined by file_set().
At last, some getters were added.
SVN revision: 54145
2010-11-04 04:56:15 -07:00
}
2011-01-13 15:04:25 -08:00
2012-03-05 00:31:58 -08:00
EINA_DEPRECATED EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_cnp_textonly_set ( Evas_Object * obj ,
Eina_Bool textonly )
2012-03-05 00:26:09 -08:00
{
2012-03-05 00:34:56 -08:00
Elm_Cnp_Mode cnp_mode = ELM_CNP_MODE_MARKUP ;
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-03-05 00:26:09 -08:00
if ( textonly )
cnp_mode = ELM_CNP_MODE_NO_IMAGE ;
elm_entry_cnp_mode_set ( obj , cnp_mode ) ;
}
2012-03-05 00:31:58 -08:00
EINA_DEPRECATED EAPI Eina_Bool
2012-03-05 00:26:09 -08:00
elm_entry_cnp_textonly_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-03-05 00:26:09 -08:00
return elm_entry_cnp_mode_get ( obj ) ! = ELM_CNP_MODE_MARKUP ;
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_cnp_mode_set ( Evas_Object * obj ,
Elm_Cnp_Mode cnp_mode )
2011-01-13 15:04:25 -08:00
{
2012-11-25 22:32:53 -08:00
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_cnp_mode_set ( cnp_mode ) ) ;
}
static void
_cnp_mode_set ( Eo * obj , void * _pd , va_list * list )
{
Elm_Cnp_Mode cnp_mode = va_arg ( * list , Elm_Cnp_Mode ) ;
2011-01-13 15:04:25 -08:00
Elm_Sel_Format format = ELM_SEL_FORMAT_MARKUP ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( sd - > cnp_mode = = cnp_mode ) return ;
sd - > cnp_mode = cnp_mode ;
if ( sd - > cnp_mode = = ELM_CNP_MODE_PLAINTEXT )
2012-03-05 00:26:09 -08:00
format = ELM_SEL_FORMAT_TEXT ;
2012-08-30 09:45:15 -07:00
else if ( cnp_mode = = ELM_CNP_MODE_MARKUP )
format | = ELM_SEL_FORMAT_IMAGE ;
2013-05-13 04:18:24 -07:00
# ifdef HAVE_ELEMENTARY_X
2013-02-21 05:21:08 -08:00
elm_drop_target_add ( obj , format ,
NULL , NULL ,
NULL , NULL ,
NULL , NULL ,
_drag_drop_cb , NULL ) ;
2013-05-13 04:18:24 -07:00
# endif
2011-01-13 15:04:25 -08:00
}
2012-03-05 00:34:56 -08:00
EAPI Elm_Cnp_Mode
2012-03-05 00:26:09 -08:00
elm_entry_cnp_mode_get ( const Evas_Object * obj )
2011-01-13 15:04:25 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ELM_CNP_MODE_MARKUP ;
2012-11-25 22:32:53 -08:00
Elm_Cnp_Mode ret = ELM_CNP_MODE_MARKUP ;
eo_do ( ( Eo * ) obj , elm_obj_entry_cnp_mode_get ( & ret ) ) ;
return ret ;
}
static void
_cnp_mode_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Cnp_Mode * ret = va_arg ( * list , Elm_Cnp_Mode * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > cnp_mode ;
2011-01-13 15:04:25 -08:00
}
2011-06-17 02:44:31 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_scrollable_set ( Evas_Object * obj ,
Eina_Bool scroll )
2011-06-17 02:44:31 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_scrollable_set ( scroll ) ) ;
}
static void
_scrollable_set ( Eo * obj , void * _pd , va_list * list )
{
Eina_Bool scroll = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2011-06-17 02:44:31 -07:00
scroll = ! ! scroll ;
2012-08-30 09:45:15 -07:00
if ( sd - > scroll = = scroll ) return ;
sd - > scroll = scroll ;
if ( sd - > scroll )
2011-06-17 02:44:31 -07:00
{
2012-08-30 09:45:15 -07:00
/* we now must re-theme ourselves to a scroller decoration
* and move the entry looking object to be the content of the
* scrollable view */
elm_widget_resize_object_set ( obj , NULL ) ;
elm_widget_sub_object_add ( obj , sd - > entry_edje ) ;
if ( ! sd - > scr_edje )
2011-12-05 17:07:04 -08:00
{
2012-08-30 09:45:15 -07:00
sd - > scr_edje = edje_object_add ( evas_object_evas_get ( obj ) ) ;
elm_widget_theme_object_set
( obj , sd - > scr_edje , " scroller " , " entry " ,
elm_widget_style_get ( obj ) ) ;
evas_object_size_hint_weight_set
( sd - > scr_edje , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ;
evas_object_size_hint_align_set
( sd - > scr_edje , EVAS_HINT_FILL , EVAS_HINT_FILL ) ;
evas_object_propagate_events_set ( sd - > scr_edje , EINA_TRUE ) ;
2011-12-05 17:07:04 -08:00
}
2012-08-30 09:45:15 -07:00
elm_widget_resize_object_set ( obj , sd - > scr_edje ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_objects_set ( sd - > scr_edje , sd - > hit_rect ) ) ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_bounce_allow_set ( sd - > h_bounce , sd - > v_bounce ) ) ;
2012-08-30 09:45:15 -07:00
if ( sd - > single_line )
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_policy_set ( ELM_SCROLLER_POLICY_OFF , ELM_SCROLLER_POLICY_OFF ) ) ;
2011-12-05 18:19:43 -08:00
else
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_policy_set ( sd - > policy_h , sd - > policy_v ) ) ;
eo_do ( obj , elm_scrollable_interface_content_set ( sd - > entry_edje ) ) ;
2013-01-10 06:06:50 -08:00
elm_widget_on_show_region_hook_set ( obj , _show_region_hook , NULL ) ;
2011-06-17 02:44:31 -07:00
}
else
{
2012-08-30 09:45:15 -07:00
if ( sd - > scr_edje )
2011-12-05 17:07:04 -08:00
{
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_content_set ( NULL ) ) ;
2012-08-30 09:45:15 -07:00
evas_object_hide ( sd - > scr_edje ) ;
2011-12-05 17:07:04 -08:00
}
2012-08-30 09:45:15 -07:00
elm_widget_resize_object_set ( obj , sd - > entry_edje ) ;
if ( sd - > scr_edje )
elm_widget_sub_object_add ( obj , sd - > scr_edje ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_objects_set ( sd - > entry_edje , sd - > hit_rect ) ) ;
2012-08-30 09:45:15 -07:00
2011-06-17 02:44:31 -07:00
elm_widget_on_show_region_hook_set ( obj , NULL , NULL ) ;
}
2012-08-30 09:45:15 -07:00
sd - > last_w = - 1 ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_wdg_theme ( NULL ) ) ;
2011-06-17 02:44:31 -07:00
}
EAPI Eina_Bool
elm_entry_scrollable_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_scrollable_get ( & ret ) ) ;
return ret ;
}
static void
_scrollable_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > scroll ;
2011-06-17 02:44:31 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_icon_visible_set ( Evas_Object * obj ,
Eina_Bool setting )
{
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_icon_visible_set ( setting ) ) ;
}
static void
_icon_visible_set ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
{
Eina_Bool setting = va_arg ( * list , int ) ;
2012-08-30 09:45:15 -07:00
if ( ! elm_layout_content_get ( obj , " elm.swallow.icon " ) ) return ;
2011-10-27 07:16:31 -07:00
2011-06-17 02:44:31 -07:00
if ( setting )
2012-08-30 09:45:15 -07:00
elm_layout_signal_emit ( obj , " elm,action,show,icon " , " elm " ) ;
2011-06-17 02:44:31 -07:00
else
2012-08-30 09:45:15 -07:00
elm_layout_signal_emit ( obj , " elm,action,hide,icon " , " elm " ) ;
elm_layout_sizing_eval ( obj ) ;
2011-06-17 02:44:31 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_end_visible_set ( Evas_Object * obj ,
Eina_Bool setting )
{
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_end_visible_set ( setting ) ) ;
}
static void
_end_visible_set ( Eo * obj , void * _pd EINA_UNUSED , va_list * list )
{
Eina_Bool setting = va_arg ( * list , int ) ;
2012-08-30 09:45:15 -07:00
if ( ! elm_layout_content_get ( obj , " elm.swallow.icon " ) ) return ;
2011-10-27 07:16:26 -07:00
2011-06-17 02:44:31 -07:00
if ( setting )
2012-08-30 09:45:15 -07:00
elm_layout_signal_emit ( obj , " elm,action,show,end " , " elm " ) ;
2011-06-17 02:44:31 -07:00
else
2012-08-30 09:45:15 -07:00
elm_layout_signal_emit ( obj , " elm,action,hide,end " , " elm " ) ;
elm_layout_sizing_eval ( obj ) ;
2011-06-17 02:44:31 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_scrollbar_policy_set ( Evas_Object * obj ,
Elm_Scroller_Policy h ,
Elm_Scroller_Policy v )
2011-06-17 02:44:31 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_policy_set ( h , v ) ) ;
}
static void
_scroller_policy_set ( Eo * obj , void * _pd , va_list * list )
{
Elm_Scroller_Policy h = va_arg ( * list , Elm_Scroller_Policy ) ;
Elm_Scroller_Policy v = va_arg ( * list , Elm_Scroller_Policy ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
sd - > policy_h = h ;
sd - > policy_v = v ;
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_scrollable_interface_policy_set ( sd - > policy_h , sd - > policy_v ) ) ;
2011-06-17 02:44:31 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_bounce_set ( Evas_Object * obj ,
Eina_Bool h_bounce ,
Eina_Bool v_bounce )
2011-06-17 02:44:31 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_scrollable_interface_bounce_allow_set ( h_bounce , v_bounce ) ) ;
}
static void
_bounce_set ( Eo * obj , void * _pd , va_list * list )
{
Eina_Bool h_bounce = va_arg ( * list , int ) ;
Eina_Bool v_bounce = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
sd - > h_bounce = h_bounce ;
sd - > v_bounce = v_bounce ;
2013-03-18 09:07:38 -07:00
eo_do_super ( obj , MY_CLASS , elm_scrollable_interface_bounce_allow_set ( h_bounce , v_bounce ) ) ;
2011-06-17 02:44:31 -07:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_bounce_get ( const Evas_Object * obj ,
Eina_Bool * h_bounce ,
Eina_Bool * v_bounce )
2011-06-17 02:44:31 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( ( Eo * ) obj , elm_scrollable_interface_bounce_allow_get ( h_bounce , v_bounce ) ) ;
2011-06-17 02:44:31 -07:00
}
2011-08-25 00:25:37 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_layout_set ( Evas_Object * obj ,
Elm_Input_Panel_Layout layout )
2011-08-25 00:25:37 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_layout_set ( layout ) ) ;
}
static void
_input_panel_layout_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Input_Panel_Layout layout = va_arg ( * list , Elm_Input_Panel_Layout ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2011-08-25 00:25:37 -07:00
2012-08-30 09:45:15 -07:00
sd - > input_panel_layout = layout ;
2011-08-25 00:25:37 -07:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_input_panel_layout_set
( sd - > entry_edje , " elm.text " , layout ) ;
2011-08-25 00:25:37 -07:00
}
EAPI Elm_Input_Panel_Layout
2012-02-15 03:50:06 -08:00
elm_entry_input_panel_layout_get ( const Evas_Object * obj )
2011-08-25 00:25:37 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ELM_INPUT_PANEL_LAYOUT_INVALID ;
2012-11-25 22:32:53 -08:00
Elm_Input_Panel_Layout ret = ELM_INPUT_PANEL_LAYOUT_INVALID ;
eo_do ( ( Eo * ) obj , elm_obj_entry_input_panel_layout_get ( & ret ) ) ;
return ret ;
}
static void
_input_panel_layout_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Input_Panel_Layout * ret = va_arg ( * list , Elm_Input_Panel_Layout * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2011-08-25 00:25:37 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > input_panel_layout ;
2011-08-25 00:25:37 -07:00
}
2011-10-26 22:43:08 -07:00
2013-03-27 01:34:19 -07:00
EAPI void
elm_entry_input_panel_layout_variation_set ( Evas_Object * obj ,
int variation )
{
ELM_ENTRY_CHECK ( obj ) ;
eo_do ( obj , elm_obj_entry_input_panel_layout_variation_set ( variation ) ) ;
}
static void
_input_panel_layout_variation_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
int variation = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
sd - > input_panel_layout_variation = variation ;
edje_object_part_text_input_panel_layout_variation_set
( sd - > entry_edje , " elm.text " , variation ) ;
}
EAPI int
elm_entry_input_panel_layout_variation_get ( const Evas_Object * obj )
{
ELM_ENTRY_CHECK ( obj ) 0 ;
int ret = 0 ;
eo_do ( ( Eo * ) obj , elm_obj_entry_input_panel_layout_variation_get ( & ret ) ) ;
return ret ;
}
static void
_input_panel_layout_variation_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
int * ret = va_arg ( * list , int * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = sd - > input_panel_layout_variation ;
}
2011-10-26 22:43:08 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_autocapital_type_set ( Evas_Object * obj ,
Elm_Autocapital_Type autocapital_type )
2011-10-26 22:43:08 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_autocapital_type_set ( autocapital_type ) ) ;
}
static void
_autocapital_type_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Autocapital_Type autocapital_type = va_arg ( * list , Elm_Autocapital_Type ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2011-10-26 22:43:08 -07:00
2012-08-30 09:45:15 -07:00
sd - > autocapital_type = autocapital_type ;
edje_object_part_text_autocapital_type_set
( sd - > entry_edje , " elm.text " , autocapital_type ) ;
2011-10-26 22:43:08 -07:00
}
EAPI Elm_Autocapital_Type
2012-02-15 03:50:06 -08:00
elm_entry_autocapital_type_get ( const Evas_Object * obj )
2011-10-26 22:43:08 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ELM_AUTOCAPITAL_TYPE_NONE ;
2012-11-25 22:32:53 -08:00
Elm_Autocapital_Type ret = ELM_AUTOCAPITAL_TYPE_NONE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_autocapital_type_get ( & ret ) ) ;
return ret ;
}
static void
_autocapital_type_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Autocapital_Type * ret = va_arg ( * list , Elm_Autocapital_Type * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2011-10-26 22:43:08 -07:00
2012-11-25 22:32:53 -08:00
* ret = sd - > autocapital_type ;
2011-10-26 22:43:08 -07:00
}
2012-02-13 20:54:19 -08:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_prediction_allow_set ( Evas_Object * obj ,
Eina_Bool prediction )
2012-02-13 20:54:19 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_prediction_allow_set ( prediction ) ) ;
}
static void
_prediction_allow_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool prediction = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-13 20:54:19 -08:00
2012-08-30 09:45:15 -07:00
sd - > prediction_allow = prediction ;
edje_object_part_text_prediction_allow_set
( sd - > entry_edje , " elm.text " , prediction ) ;
2012-02-13 20:54:19 -08:00
}
EAPI Eina_Bool
2012-02-15 03:50:06 -08:00
elm_entry_prediction_allow_get ( const Evas_Object * obj )
2012-02-13 20:54:19 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_TRUE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_TRUE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_prediction_allow_get ( & ret ) ) ;
return ret ;
}
static void
_prediction_allow_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-13 20:54:19 -08:00
2012-11-25 22:32:53 -08:00
* ret = sd - > prediction_allow ;
2012-02-13 20:54:19 -08:00
}
2012-02-13 03:43:58 -08:00
EAPI void
elm_entry_imf_context_reset ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_imf_context_reset ( ) ) ;
}
static void
_imf_context_reset ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-13 03:43:58 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_imf_context_reset ( sd - > entry_edje , " elm.text " ) ;
2012-02-13 03:43:58 -08:00
}
2011-10-26 22:43:08 -07:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_enabled_set ( Evas_Object * obj ,
Eina_Bool enabled )
2011-10-26 22:43:08 -07:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_enabled_set ( enabled ) ) ;
}
static void
_input_panel_enabled_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool enabled = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2011-10-26 22:43:08 -07:00
2012-08-30 09:45:15 -07:00
sd - > input_panel_enable = enabled ;
edje_object_part_text_input_panel_enabled_set
( sd - > entry_edje , " elm.text " , enabled ) ;
2011-10-26 22:43:08 -07:00
}
2012-02-02 23:32:40 -08:00
EAPI Eina_Bool
2012-02-15 03:50:06 -08:00
elm_entry_input_panel_enabled_get ( const Evas_Object * obj )
2012-02-02 23:32:40 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_TRUE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_TRUE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_input_panel_enabled_get ( & ret ) ) ;
return ret ;
}
static void
_input_panel_enabled_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-02 23:32:40 -08:00
2012-11-25 22:32:53 -08:00
* ret = sd - > input_panel_enable ;
2012-02-02 23:32:40 -08:00
}
2012-02-12 22:50:45 -08:00
EAPI void
elm_entry_input_panel_show ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_show ( ) ) ;
}
static void
_input_panel_show ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-12 22:50:45 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_input_panel_show ( sd - > entry_edje , " elm.text " ) ;
2012-02-12 22:50:45 -08:00
}
2012-02-13 03:27:14 -08:00
EAPI void
2012-02-12 22:50:45 -08:00
elm_entry_input_panel_hide ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_hide ( ) ) ;
}
static void
_input_panel_hide ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-12 22:50:45 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_input_panel_hide ( sd - > entry_edje , " elm.text " ) ;
2012-02-12 22:50:45 -08:00
}
2012-02-15 00:42:46 -08:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_language_set ( Evas_Object * obj ,
Elm_Input_Panel_Lang lang )
2012-02-15 00:42:46 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_language_set ( lang ) ) ;
}
static void
_input_panel_language_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Input_Panel_Lang lang = va_arg ( * list , Elm_Input_Panel_Lang ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
sd - > input_panel_lang = lang ;
edje_object_part_text_input_panel_language_set
( sd - > entry_edje , " elm.text " , lang ) ;
2012-02-15 00:42:46 -08:00
}
EAPI Elm_Input_Panel_Lang
elm_entry_input_panel_language_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ELM_INPUT_PANEL_LANG_AUTOMATIC ;
2012-11-25 22:32:53 -08:00
Elm_Input_Panel_Lang ret = ELM_INPUT_PANEL_LANG_AUTOMATIC ;
eo_do ( ( Eo * ) obj , elm_obj_entry_input_panel_language_get ( & ret ) ) ;
return ret ;
}
static void
_input_panel_language_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Input_Panel_Lang * ret = va_arg ( * list , Elm_Input_Panel_Lang * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-15 00:42:46 -08:00
2012-11-25 22:32:53 -08:00
* ret = sd - > input_panel_lang ;
2012-02-15 00:42:46 -08:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_imdata_set ( Evas_Object * obj ,
const void * data ,
int len )
2012-02-15 00:42:46 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_imdata_set ( data , len ) ) ;
}
static void
_input_panel_imdata_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
const void * data = va_arg ( * list , const void * ) ;
int len = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
if ( sd - > input_panel_imdata )
free ( sd - > input_panel_imdata ) ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
sd - > input_panel_imdata = calloc ( 1 , len ) ;
sd - > input_panel_imdata_len = len ;
memcpy ( sd - > input_panel_imdata , data , len ) ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_input_panel_imdata_set
( sd - > entry_edje , " elm.text " , sd - > input_panel_imdata ,
sd - > input_panel_imdata_len ) ;
2012-02-15 00:42:46 -08:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_imdata_get ( const Evas_Object * obj ,
void * data ,
int * len )
2012-02-15 00:42:46 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( ( Eo * ) obj , elm_obj_entry_input_panel_imdata_get ( data , len ) ) ;
}
static void
_input_panel_imdata_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
void * data = va_arg ( * list , void * ) ;
int * len = va_arg ( * list , int * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_input_panel_imdata_get
( sd - > entry_edje , " elm.text " , data , len ) ;
2012-02-15 00:42:46 -08:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_return_key_type_set ( Evas_Object * obj ,
Elm_Input_Panel_Return_Key_Type
return_key_type )
2012-02-15 00:42:46 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_return_key_type_set ( return_key_type ) ) ;
}
static void
_input_panel_return_key_type_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Input_Panel_Return_Key_Type return_key_type = va_arg ( * list , Elm_Input_Panel_Return_Key_Type ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
sd - > input_panel_return_key_type = return_key_type ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_input_panel_return_key_type_set
( sd - > entry_edje , " elm.text " , return_key_type ) ;
2012-02-15 00:42:46 -08:00
}
EAPI Elm_Input_Panel_Return_Key_Type
elm_entry_input_panel_return_key_type_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT ;
2012-11-25 22:32:53 -08:00
Elm_Input_Panel_Return_Key_Type ret = ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT ;
eo_do ( ( Eo * ) obj , elm_obj_entry_input_panel_return_key_type_get ( & ret ) ) ;
return ret ;
}
static void
_input_panel_return_key_type_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Elm_Input_Panel_Return_Key_Type * ret = va_arg ( * list , Elm_Input_Panel_Return_Key_Type * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-15 00:42:46 -08:00
2012-11-25 22:32:53 -08:00
* ret = sd - > input_panel_return_key_type ;
2012-02-15 00:42:46 -08:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_return_key_disabled_set ( Evas_Object * obj ,
Eina_Bool disabled )
2012-02-15 00:42:46 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_return_key_disabled_set ( disabled ) ) ;
}
static void
_input_panel_return_key_disabled_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool disabled = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
sd - > input_panel_return_key_disabled = disabled ;
2012-02-15 00:42:46 -08:00
2012-08-30 09:45:15 -07:00
edje_object_part_text_input_panel_return_key_disabled_set
( sd - > entry_edje , " elm.text " , disabled ) ;
2012-02-15 00:42:46 -08:00
}
EAPI Eina_Bool
elm_entry_input_panel_return_key_disabled_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) EINA_FALSE ;
2012-11-25 22:32:53 -08:00
Eina_Bool ret = EINA_FALSE ;
eo_do ( ( Eo * ) obj , elm_obj_entry_input_panel_return_key_disabled_get ( & ret ) ) ;
return ret ;
}
2012-02-15 00:42:46 -08:00
2012-11-25 22:32:53 -08:00
static void
_input_panel_return_key_disabled_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = sd - > input_panel_return_key_disabled ;
2012-02-15 00:42:46 -08:00
}
2012-02-13 03:43:58 -08:00
2012-02-27 17:50:19 -08:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_input_panel_return_key_autoenabled_set ( Evas_Object * obj ,
Eina_Bool enabled )
2012-02-27 17:50:19 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_input_panel_return_key_autoenabled_set ( enabled ) ) ;
}
static void
_input_panel_return_key_autoenabled_set ( Eo * obj , void * _pd , va_list * list )
{
Eina_Bool enabled = va_arg ( * list , int ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-02-27 17:50:19 -08:00
2012-08-30 09:45:15 -07:00
sd - > auto_return_key = enabled ;
_return_key_enabled_check ( obj ) ;
2012-02-27 17:50:19 -08:00
}
2012-08-30 09:45:15 -07:00
EAPI void *
2012-03-02 02:34:58 -08:00
elm_entry_imf_context_get ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
void * ret = NULL ;
eo_do ( obj , elm_obj_entry_imf_context_get ( & ret ) ) ;
return ret ;
}
static void
_imf_context_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
void * * ret = va_arg ( * list , void * * ) ;
* ret = NULL ;
Elm_Entry_Smart_Data * sd = _pd ;
if ( ! sd ) return ;
2012-03-02 02:34:58 -08:00
2012-11-25 22:32:53 -08:00
* ret = edje_object_part_text_imf_context_get ( sd - > entry_edje , " elm.text " ) ;
2012-03-02 02:34:58 -08:00
}
2012-03-06 02:09:13 -08:00
/* START - ANCHOR HOVER */
static void
2012-08-30 09:45:15 -07:00
_anchor_parent_del_cb ( void * data ,
Evas * e __UNUSED__ ,
Evas_Object * obj __UNUSED__ ,
void * event_info __UNUSED__ )
2012-03-06 02:09:13 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_DATA_GET ( data , sd ) ;
2012-03-06 02:09:13 -08:00
2012-08-30 09:45:15 -07:00
sd - > anchor_hover . hover_parent = NULL ;
2012-04-25 04:34:28 -07:00
}
2012-03-06 02:09:13 -08:00
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_anchor_hover_parent_set ( Evas_Object * obj ,
Evas_Object * parent )
2012-03-06 02:09:13 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_anchor_hover_parent_set ( parent ) ) ;
}
static void
_anchor_hover_parent_set ( Eo * obj , void * _pd , va_list * list )
{
Evas_Object * parent = va_arg ( * list , Evas_Object * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
if ( sd - > anchor_hover . hover_parent )
evas_object_event_callback_del_full
( sd - > anchor_hover . hover_parent , EVAS_CALLBACK_DEL ,
_anchor_parent_del_cb , obj ) ;
sd - > anchor_hover . hover_parent = parent ;
if ( sd - > anchor_hover . hover_parent )
evas_object_event_callback_add
( sd - > anchor_hover . hover_parent , EVAS_CALLBACK_DEL ,
_anchor_parent_del_cb , obj ) ;
2012-03-06 02:09:13 -08:00
}
EAPI Evas_Object *
elm_entry_anchor_hover_parent_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
Evas_Object * ret = NULL ;
eo_do ( ( Eo * ) obj , elm_obj_entry_anchor_hover_parent_get ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_anchor_hover_parent_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
Evas_Object * * ret = va_arg ( * list , Evas_Object * * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = sd - > anchor_hover . hover_parent ;
2012-03-06 02:09:13 -08:00
}
EAPI void
2012-08-30 09:45:15 -07:00
elm_entry_anchor_hover_style_set ( Evas_Object * obj ,
const char * style )
2012-03-06 02:09:13 -08:00
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_anchor_hover_style_set ( style ) ) ;
}
static void
_anchor_hover_style_set ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
const char * style = va_arg ( * list , const char * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
2012-08-30 09:45:15 -07:00
eina_stringshare_replace ( & sd - > anchor_hover . hover_style , style ) ;
2012-03-06 02:09:13 -08:00
}
EAPI const char *
elm_entry_anchor_hover_style_get ( const Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) NULL ;
2012-11-25 22:32:53 -08:00
const char * ret = NULL ;
eo_do ( ( Eo * ) obj , elm_obj_entry_anchor_hover_style_get ( & ret ) ) ;
return ret ;
}
2012-08-30 09:45:15 -07:00
2012-11-25 22:32:53 -08:00
static void
_anchor_hover_style_get ( Eo * obj EINA_UNUSED , void * _pd , va_list * list )
{
const char * * ret = va_arg ( * list , const char * * ) ;
Elm_Entry_Smart_Data * sd = _pd ;
* ret = sd - > anchor_hover . hover_style ;
2012-03-06 02:09:13 -08:00
}
EAPI void
elm_entry_anchor_hover_end ( Evas_Object * obj )
{
2012-08-30 09:45:15 -07:00
ELM_ENTRY_CHECK ( obj ) ;
2012-11-25 22:32:53 -08:00
eo_do ( obj , elm_obj_entry_anchor_hover_end ( ) ) ;
}
static void
_anchor_hover_end ( Eo * obj EINA_UNUSED , void * _pd , va_list * list EINA_UNUSED )
{
Elm_Entry_Smart_Data * sd = _pd ;
2012-03-06 02:09:13 -08:00
2012-08-30 09:45:15 -07:00
if ( sd - > anchor_hover . hover ) evas_object_del ( sd - > anchor_hover . hover ) ;
if ( sd - > anchor_hover . pop ) evas_object_del ( sd - > anchor_hover . pop ) ;
sd - > anchor_hover . hover = NULL ;
sd - > anchor_hover . pop = NULL ;
2012-03-06 02:09:13 -08:00
}
2013-04-16 04:05:04 -07:00
/* END - ANCHOR HOVER */
2012-03-06 02:09:13 -08:00
2012-11-25 22:32:53 -08:00
static void
_elm_entry_smart_focus_next_manager_is ( Eo * obj EINA_UNUSED , void * _pd EINA_UNUSED , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
* ret = EINA_FALSE ;
}
static void
_elm_entry_smart_focus_direction_manager_is ( Eo * obj EINA_UNUSED , void * _pd EINA_UNUSED , va_list * list )
{
Eina_Bool * ret = va_arg ( * list , Eina_Bool * ) ;
* ret = EINA_FALSE ;
}
static void
_class_constructor ( Eo_Class * klass )
{
const Eo_Op_Func_Description func_desc [ ] = {
EO_OP_FUNC ( EO_BASE_ID ( EO_BASE_SUB_ID_CONSTRUCTOR ) , _constructor ) ,
EO_OP_FUNC ( EVAS_OBJ_SMART_ID ( EVAS_OBJ_SMART_SUB_ID_ADD ) , _elm_entry_smart_add ) ,
EO_OP_FUNC ( EVAS_OBJ_SMART_ID ( EVAS_OBJ_SMART_SUB_ID_DEL ) , _elm_entry_smart_del ) ,
EO_OP_FUNC ( EVAS_OBJ_SMART_ID ( EVAS_OBJ_SMART_SUB_ID_MOVE ) , _elm_entry_smart_move ) ,
EO_OP_FUNC ( EVAS_OBJ_SMART_ID ( EVAS_OBJ_SMART_SUB_ID_RESIZE ) , _elm_entry_smart_resize ) ,
EO_OP_FUNC ( EVAS_OBJ_SMART_ID ( EVAS_OBJ_SMART_SUB_ID_MEMBER_ADD ) , _elm_entry_smart_member_add ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_ON_FOCUS ) , _elm_entry_smart_on_focus ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_DISABLE ) , _elm_entry_smart_disable ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_THEME ) , _elm_entry_smart_theme ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_TRANSLATE ) , _elm_entry_smart_translate ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_ON_FOCUS_REGION ) , _elm_entry_smart_on_focus_region ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL ) , _elm_entry_smart_sub_object_del ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS ) , _elm_entry_smart_focus_next_manager_is ) ,
EO_OP_FUNC ( ELM_WIDGET_ID ( ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS ) , _elm_entry_smart_focus_direction_manager_is ) ,
EO_OP_FUNC ( ELM_OBJ_CONTAINER_ID ( ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET ) , _elm_entry_smart_content_set ) ,
EO_OP_FUNC ( ELM_OBJ_CONTAINER_ID ( ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET ) , _elm_entry_smart_content_unset ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL ) , _elm_entry_smart_sizing_eval ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_EMIT ) , _elm_entry_smart_signal ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_ADD ) , _elm_entry_smart_callback_add ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_DEL ) , _elm_entry_smart_callback_del ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET ) , _elm_entry_smart_text_set ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET ) , _elm_entry_smart_text_get ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET ) , _elm_entry_smart_content_aliases_get ) ,
EO_OP_FUNC ( ELM_OBJ_LAYOUT_ID ( ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE ) , _elm_entry_smart_theme_enable ) ,
EO_OP_FUNC ( ELM_SCROLLABLE_INTERFACE_ID ( ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET ) , _bounce_set ) ,
EO_OP_FUNC ( ELM_SCROLLABLE_INTERFACE_ID ( ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET ) , _scroller_policy_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH ) , _text_style_user_push ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP ) , _text_style_user_pop ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK ) , _text_style_user_peek ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET ) , _single_line_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET ) , _single_line_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET ) , _password_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET ) , _password_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND ) , _entry_append ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY ) , _is_empty ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET ) , _textblock_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE ) , _calc_force ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET ) , _selection_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT ) , _entry_insert ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET ) , _line_wrap_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET ) , _line_wrap_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET ) , _editable_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET ) , _editable_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE ) , _select_none ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL ) , _select_all ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET ) , _cursor_geometry_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT ) , _cursor_next ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV ) , _cursor_prev ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP ) , _cursor_up ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN ) , _cursor_down ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET ) , _cursor_begin_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET ) , _cursor_end_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET ) , _cursor_line_begin_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET ) , _cursor_line_end_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN ) , _cursor_selection_begin ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END ) , _cursor_selection_end ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET ) , _cursor_is_format_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET ) , _cursor_is_visible_format_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET ) , _cursor_content_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET ) , _cursor_pos_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET ) , _cursor_pos_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT ) , _selection_cut ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY ) , _selection_copy ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE ) , _selection_paste ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR ) , _context_menu_clear ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD ) , _context_menu_item_add ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET ) , _context_menu_disabled_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET ) , _context_menu_disabled_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND ) , _item_provider_append ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND ) , _item_provider_prepend ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE ) , _item_provider_remove ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND ) , _markup_filter_append ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND ) , _markup_filter_prepend ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE ) , _markup_filter_remove ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_FILE_SET ) , _file_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_FILE_GET ) , _file_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE ) , _file_save ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET ) , _autosave_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET ) , _autosave_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET ) , _cnp_mode_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET ) , _cnp_mode_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET ) , _scrollable_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET ) , _scrollable_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET ) , _icon_visible_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET ) , _end_visible_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET ) , _input_panel_layout_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET ) , _input_panel_layout_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET ) , _autocapital_type_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET ) , _autocapital_type_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET ) , _prediction_allow_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET ) , _prediction_allow_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET ) , _imf_context_reset ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET ) , _input_panel_enabled_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET ) , _input_panel_enabled_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW ) , _input_panel_show ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE ) , _input_panel_hide ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET ) , _input_panel_language_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET ) , _input_panel_language_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET ) , _input_panel_imdata_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET ) , _input_panel_imdata_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET ) , _input_panel_return_key_type_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET ) , _input_panel_return_key_type_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET ) , _input_panel_return_key_disabled_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET ) , _input_panel_return_key_disabled_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET ) , _input_panel_return_key_autoenabled_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET ) , _imf_context_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET ) , _anchor_hover_parent_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET ) , _anchor_hover_parent_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET ) , _anchor_hover_style_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET ) , _anchor_hover_style_get ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END ) , _anchor_hover_end ) ,
2013-03-27 01:34:19 -07:00
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET ) , _input_panel_layout_variation_set ) ,
EO_OP_FUNC ( ELM_OBJ_ENTRY_ID ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET ) , _input_panel_layout_variation_get ) ,
2012-11-25 22:32:53 -08:00
EO_OP_FUNC_SENTINEL
} ;
eo_class_funcs_set ( klass , func_desc ) ;
2013-02-09 23:52:31 -08:00
evas_smart_legacy_type_register ( MY_CLASS_NAME , klass ) ;
2012-11-25 22:32:53 -08:00
}
static const Eo_Op_Description op_desc [ ] = {
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH , " Push the style to the top of user style stack. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP , " Remove the style in the top of user style stack. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK , " Retrieve the style on the top of user style stack. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET , " Sets the entry to single line mode. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET , " Gets whether the entry is set to be single line. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET , " Sets the entry to password mode. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET , " Gets whether the entry is set to password mode. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND , " Appends entry to the text of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY , " Gets whether the entry is empty. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET , " Returns the actual textblock object of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE , " Forces calculation of the entry size and text layouting. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET , " Gets any selected text within the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT , " Inserts the given text into the entry at the current cursor position. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET , " Set the line wrap type to use on multi-line entries. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET , " Gets the wrap mode the entry was set to use. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET , " Sets if the entry is to be editable or not. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET , " Gets whether the entry is editable or not. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE , " This drops any existing text selection within the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL , " This selects all text within the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET , " This function returns the geometry of the cursor. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT , " This moves the cursor one place to the right within the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV , " This moves the cursor one place to the left within the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP , " This moves the cursor one line up within the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN , " This moves the cursor one line down within the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET , " This moves the cursor to the beginning of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET , " This moves the cursor to the end of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET , " This moves the cursor to the beginning of the current line. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET , " This moves the cursor to the end of the current line. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN , " This begins a selection within the entry as though. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END , " This ends a selection within the entry as though. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET , " Gets whether a format node exists at the current cursor position. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET , " Gets if the current cursor position holds a visible format node. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET , " Gets the character pointed by the cursor at its current position. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET , " Sets the cursor position in the entry to the given value. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET , " Retrieves the current position of the cursor in the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT , " This executes a 'cut' action on the selected text in the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY , " This executes a 'copy' action on the selected text in the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE , " This executes a 'paste' action in the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR , " This clears and frees the items in a entry's contextual (longpress). " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD , " This adds an item to the entry's contextual menu. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET , " This disables the entry's contextual (longpress) menu. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET , " This returns whether the entry's contextual (longpress) menu is disabled. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND , " This appends a custom item provider to the list for that entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND , " This prepends a custom item provider to the list for that entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE , " This removes a custom item provider to the list for that entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND , " Append a markup filter function for text inserted in the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND , " Prepend a markup filter function for text inserted in the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE , " Remove a markup filter from the list. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_FILE_SET , " This sets the file (and implicitly loads it) for the text to display and then edit. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_FILE_GET , " Gets the file being edited by the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE , " This function writes any changes made to the file set with elm_entry_file_set(). " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET , " This sets the entry object to 'autosave' the loaded text file or not. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET , " This gets the entry object's 'autosave' status. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET , " Control pasting of text and images for the widget. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET , " Getting elm_entry text paste/drop mode. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET , " Enable or disable scrolling in entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET , " Get the scrollable state of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET , " Sets the visibility of the left-side widget of the entry,. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET , " Sets the visibility of the end widget of the entry, set by elm_object_part_content_set(ent, 'end', content). " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET , " Set the input panel layout of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET , " Get the input panel layout of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET , " Set the autocapitalization type on the immodule. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET , " Retrieve the autocapitalization type on the immodule. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET , " Set whether the entry should allow to use the text prediction. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET , " Get whether the entry should allow to use the text prediction. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET , " Reset the input method context of the entry if needed. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET , " Sets the attribute to show the input panel automatically. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET , " Retrieve the attribute to show the input panel automatically. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW , " Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE , " Hide the input panel (virtual keyboard). " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET , " Set the language mode of the input panel. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET , " Get the language mode of the input panel. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET , " Set the input panel-specific data to deliver to the input panel. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET , " Get the specific data of the current input panel. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET , " Set the 'return' key type. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET , " Get the 'return' key type. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET , " Set the return key on the input panel to be disabled. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET , " Get whether the return key on the input panel should be disabled or not. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET , " Set whether the return key on the input panel is disabled automatically when entry has no text. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET , " Returns the input method context of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET , " Set the parent of the hover popup. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET , " Get the parent of the hover popup. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET , " Set the style that the hover should use. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET , " Get the style that the hover should use. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END , " Ends the hover popup in the entry. " ) ,
2013-03-27 01:34:19 -07:00
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_SET , " Set the input panel layout variation of the entry. " ) ,
EO_OP_DESCRIPTION ( ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_VARIATION_GET , " Get the input panel layout variation of the entry. " ) ,
2012-11-25 22:32:53 -08:00
EO_OP_DESCRIPTION_SENTINEL
} ;
static const Eo_Class_Description class_desc = {
EO_VERSION ,
MY_CLASS_NAME ,
EO_CLASS_TYPE_REGULAR ,
EO_CLASS_DESCRIPTION_OPS ( & ELM_OBJ_ENTRY_BASE_ID , op_desc , ELM_OBJ_ENTRY_SUB_ID_LAST ) ,
NULL ,
sizeof ( Elm_Entry_Smart_Data ) ,
_class_constructor ,
NULL
} ;
EO_DEFINE_CLASS ( elm_obj_entry_class_get , & class_desc , ELM_OBJ_LAYOUT_CLASS , ELM_SCROLLABLE_INTERFACE , EVAS_SMART_CLICKABLE_INTERFACE , NULL ) ;