emoticons!!!! woot woot!

SVN revision: 48356
This commit is contained in:
Carsten Haitzler 2010-04-27 08:06:42 +00:00
parent e571b14068
commit 88bee2cadb
45 changed files with 284 additions and 15 deletions

View File

@ -144,7 +144,47 @@ bt_spinner_up.png \
bt_spinner_down.png \
bt_spinner_hilight.png \
up.png \
down.png
down.png \
emo-angry.png \
emo-angry-shout.png \
emo-crazy-laugh.png \
emo-evil-laugh.png \
emo-evil.png \
emo-goggle-smile.png \
emo-grumpy.png \
emo-grumpy-smile.png \
emo-guilty.png \
emo-guilty-smile.png \
emo-haha.png \
emo-half-smile.png \
emo-happy-panting.png \
emo-happy.png \
emo-indifferent.png \
emo-kiss.png \
emo-knowing-grin.png \
emo-laugh.png \
emo-little-bit-sorry.png \
emo-love-lots.png \
emo-love.png \
emo-minimal-smile.png \
emo-not-happy.png \
emo-not-impressed.png \
emo-omg.png \
emo-opensmile.png \
emo-smile.png \
emo-sorry.png \
emo-squint-laugh.png \
emo-surprised.png \
emo-suspicious.png \
emo-tongue-dangling.png \
emo-tongue-poke.png \
emo-uh.png \
emo-unhappy.png \
emo-very-sorry.png \
emo-what.png \
emo-wink.png \
emo-worried.png \
emo-wtf.png
default.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \

View File

@ -5479,6 +5479,127 @@ collections {
}
///////////////////////////////////////////////////////////////////////////////
group { name: "elm/entry/emoticon/angry/default"; images.image:
"emo-angry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-angry.png"; } } } }
group { name: "elm/entry/emoticon/angry-shout/default"; images.image:
"emo-angry-shout.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-angry-shout.png"; } } } }
group { name: "elm/entry/emoticon/crazy-laugh/default"; images.image:
"emo-crazy-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-crazy-laugh.png"; } } } }
group { name: "elm/entry/emoticon/evil-laugh/default"; images.image:
"emo-evil-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-evil-laugh.png"; } } } }
group { name: "elm/entry/emoticon/evil/default"; images.image:
"emo-evil.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-evil.png"; } } } }
group { name: "elm/entry/emoticon/goggle-smile/default"; images.image:
"emo-goggle-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-goggle-smile.png"; } } } }
group { name: "elm/entry/emoticon/grumpy/default"; images.image:
"emo-grumpy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-grumpy.png"; } } } }
group { name: "elm/entry/emoticon/grumpy-smile/default"; images.image:
"emo-grumpy-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-grumpy-smile.png"; } } } }
group { name: "elm/entry/emoticon/guilty/default"; images.image:
"emo-guilty.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-guilty.png"; } } } }
group { name: "elm/entry/emoticon/guilty-smile/default"; images.image:
"emo-guilty-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-guilty-smile.png"; } } } }
group { name: "elm/entry/emoticon/haha/default"; images.image:
"emo-haha.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-haha.png"; } } } }
group { name: "elm/entry/emoticon/half-smile/default"; images.image:
"emo-half-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-half-smile.png"; } } } }
group { name: "elm/entry/emoticon/happy-panting/default"; images.image:
"emo-happy-panting.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-happy-panting.png"; } } } }
group { name: "elm/entry/emoticon/happy/default"; images.image:
"emo-happy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-happy.png"; } } } }
group { name: "elm/entry/emoticon/indifferent/default"; images.image:
"emo-indifferent.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-indifferent.png"; } } } }
group { name: "elm/entry/emoticon/kiss/default"; images.image:
"emo-kiss.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-kiss.png"; } } } }
group { name: "elm/entry/emoticon/knowing-grin/default"; images.image:
"emo-knowing-grin.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-knowing-grin.png"; } } } }
group { name: "elm/entry/emoticon/laugh/default"; images.image:
"emo-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-laugh.png"; } } } }
group { name: "elm/entry/emoticon/little-bit-sorry/default"; images.image:
"emo-little-bit-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-little-bit-sorry.png"; } } } }
group { name: "elm/entry/emoticon/love-lots/default"; images.image:
"emo-love-lots.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-love-lots.png"; } } } }
group { name: "elm/entry/emoticon/love/default"; images.image:
"emo-love.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-love.png"; } } } }
group { name: "elm/entry/emoticon/minimal-smile/default"; images.image:
"emo-minimal-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-minimal-smile.png"; } } } }
group { name: "elm/entry/emoticon/not-happy/default"; images.image:
"emo-not-happy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-not-happy.png"; } } } }
group { name: "elm/entry/emoticon/not-impressed/default"; images.image:
"emo-not-impressed.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-not-impressed.png"; } } } }
group { name: "elm/entry/emoticon/omg/default"; images.image:
"emo-omg.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-omg.png"; } } } }
group { name: "elm/entry/emoticon/opensmile/default"; images.image:
"emo-opensmile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-opensmile.png"; } } } }
group { name: "elm/entry/emoticon/smile/default"; images.image:
"emo-smile.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-smile.png"; } } } }
group { name: "elm/entry/emoticon/sorry/default"; images.image:
"emo-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-sorry.png"; } } } }
group { name: "elm/entry/emoticon/squint-laugh/default"; images.image:
"emo-squint-laugh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-squint-laugh.png"; } } } }
group { name: "elm/entry/emoticon/surprised/default"; images.image:
"emo-surprised.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-surprised.png"; } } } }
group { name: "elm/entry/emoticon/suspicious/default"; images.image:
"emo-suspicious.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-suspicious.png"; } } } }
group { name: "elm/entry/emoticon/tongue-dangling/default"; images.image:
"emo-tongue-dangling.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-tongue-dangling.png"; } } } }
group { name: "elm/entry/emoticon/tongue-poke/default"; images.image:
"emo-tongue-poke.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-tongue-poke.png"; } } } }
group { name: "elm/entry/emoticon/uh/default"; images.image:
"emo-uh.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-uh.png"; } } } }
group { name: "elm/entry/emoticon/unhappy/default"; images.image:
"emo-unhappy.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-unhappy.png"; } } } }
group { name: "elm/entry/emoticon/very-sorry/default"; images.image:
"emo-very-sorry.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-very-sorry.png"; } } } }
group { name: "elm/entry/emoticon/what/default"; images.image:
"emo-what.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-what.png"; } } } }
group { name: "elm/entry/emoticon/wink/default"; images.image:
"emo-wink.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-wink.png"; } } } }
group { name: "elm/entry/emoticon/worried/default"; images.image:
"emo-worried.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-worried.png"; } } } }
group { name: "elm/entry/emoticon/wtf/default"; images.image:
"emo-wtf.png" COMP; parts { part { name: "icon"; mouse_events: 0; description { state: "default" 0.0; max: 64 64; image.normal:
"emo-wtf.png"; } } } }
//------------------------------------------------------------
group { name: "elm/entry/base/default";
styles
{
@ -23093,5 +23214,4 @@ collections {
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -84,21 +84,21 @@ test_entry(void *data, Evas_Object *obj, void *event_info)
"<br>"
"Also you can stick in items with (relsize + ascent): "
"<item relsize=20x10 vsize=ascent href=A1></item>"
"<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>"
" (full) "
"<item relsize=20x10 vsize=full href=A2></item>"
"<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>"
" (to the left)<br>"
"Also (size + ascent): "
"<item size=120x40 vsize=ascent href=B1></item>"
"<item size=16x16 vsize=ascent href=emoticon/haha></item>"
" (full) "
"<item size=120x40 vsize=full href=B2></item>"
"<item size=16x16 vsize=full href=emoticon/happy-panting></item>"
" (before this)<br>"
"And as well (absize + ascent): "
"<item absize=80x80 vsize=ascent href=C1></item>"
"<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>"
" (full) "
"<item absize=60x60 vsize=full href=C2></item>"
"<item absize=64x64 vsize=full href=emoticon/not-impressed></item>"
" ... end."
);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

View File

@ -699,6 +699,9 @@ extern "C" {
EAPI void 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);
EAPI void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled);
EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *obj);
EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data);
EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data);
EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data);
EAPI char *elm_entry_markup_to_utf8(const char *s);
EAPI char *elm_entry_utf8_to_markup(const char *s);
/* smart callbacks called:

View File

@ -34,6 +34,7 @@ typedef struct _Mod_Api Mod_Api;
typedef struct _Widget_Data Widget_Data;
typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item;
typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider;
struct _Widget_Data
{
@ -49,6 +50,7 @@ struct _Widget_Data
Evas_Coord downx, downy;
Evas_Coord cx, cy, cw, ch;
Eina_List *items;
Eina_List *item_providers;
Mod_Api *api; // module api if supplied
Eina_Bool changed : 1;
Eina_Bool linewrap : 1;
@ -75,6 +77,12 @@ struct _Elm_Entry_Context_Menu_Item
void *data;
};
struct _Elm_Entry_Item_Provider
{
Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item);
void *data;
};
static const char *widtype = NULL;
static void _del_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
@ -161,6 +169,7 @@ _del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
Elm_Entry_Context_Menu_Item *it;
Elm_Entry_Item_Provider *ip;
if ((wd->api) && (wd->api->obj_unhook)) wd->api->obj_unhook(obj); // module - unhook
@ -180,6 +189,10 @@ _del_hook(Evas_Object *obj)
eina_stringshare_del(it->icon_group);
free(it);
}
EINA_LIST_FREE(wd->item_providers, ip)
{
free(ip);
}
free(wd);
}
@ -1161,15 +1174,20 @@ _get_item(void *data, Evas_Object *edje, const char *part, const char *item)
{
Widget_Data *wd = elm_widget_data_get(data);
Evas_Object *o;
Eina_List *l;
Elm_Entry_Item_Provider *ip;
int ok = 0;
// FIXME: this is a test! need to have a standard set of "emoticons" or
// "icons" you can inline. but first be able to set add/del callbacks from
// the app/user of entry to first provide one. if they return NULL, fall
// back to here.
EINA_LIST_FOREACH(wd->item_providers, l, ip)
{
o = ip->func(ip->data, data, item);
if (o) return o;
}
o = edje_object_add(evas_object_evas_get(data));
_elm_theme_set(o, "button", "base", elm_widget_style_get(data));
edje_object_part_text_set(o, "elm.text", item);
edje_object_signal_emit(o, "elm,state,text,visible", "elm");
if (!strncmp(item, "emoticon/", 9))
ok = _elm_theme_set(o, "entry", item, elm_widget_style_get(data));
if (!ok)
_elm_theme_set(o, "entry/emoticon", "wtf", elm_widget_style_get(data));
return o;
}
@ -1969,6 +1987,94 @@ elm_entry_context_menu_disabled_get(const Evas_Object *obj)
return !wd->context_menu;
}
/**
* This appends a custom item provider to the list for that entry
*
* This appends the given callback. The list is walked from beginning to end
* with each function called given the item href string in the text. If the
* function returns an object handle other than NULL (it should create an
* and object to do this), then this object is used to replace that item. If
* not the next provider is called until one provides an item object, or the
* default provider in entry does.
*
* @param obj The entry object
* @param func The function called to provide the item object
* @param data The data passed to @p func
*
* @ingroup Entry
*/
EAPI void
elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (!func) return;
Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
if (!ip) return;
ip->func = func;
ip->data = data;
wd->item_providers = eina_list_append(wd->item_providers, ip);
}
/**
* This prepends a custom item provider to the list for that entry
*
* This prepends the given callback. See elm_entry_item_provider_append() for
* more information
*
* @param obj The entry object
* @param func The function called to provide the item object
* @param data The data passed to @p func
*
* @ingroup Entry
*/
EAPI void
elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (!func) return;
Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
if (!ip) return;
ip->func = func;
ip->data = data;
wd->item_providers = eina_list_prepend(wd->item_providers, ip);
}
/**
* This removes a custom item provider to the list for that entry
*
* This removes the given callback. See elm_entry_item_provider_append() for
* more information
*
* @param obj The entry object
* @param func The function called to provide the item object
* @param data The data passed to @p func
*
* @ingroup Entry
*/
EAPI void
elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Eina_List *l;
Elm_Entry_Item_Provider *ip;
if (!wd) return;
if (!func) return;
EINA_LIST_FOREACH(wd->item_providers, l, ip)
{
if ((ip->func == func) && (ip->data == data))
{
wd->item_providers = eina_list_remove_list(wd->item_providers, l);
free(ip);
return;
}
}
}
/**
* This converts a markup (HTML-like) string into UTF-8.
*