2010-01-08 10:00:33 -08:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
2012-07-31 15:06:21 -07:00
|
|
|
#include "elm_widget_conform.h"
|
2012-11-25 22:32:53 -08:00
|
|
|
#include "elm_widget_layout.h"
|
|
|
|
|
|
|
|
EAPI Eo_Op ELM_OBJ_CONFORMANT_BASE_ID = EO_NOOP;
|
|
|
|
|
|
|
|
#define MY_CLASS ELM_OBJ_CONFORMANT_CLASS
|
|
|
|
|
|
|
|
#define MY_CLASS_NAME "elm_conformant"
|
2010-01-08 10:00:33 -08:00
|
|
|
|
2011-05-18 09:49:20 -07:00
|
|
|
#ifndef MIN
|
2012-05-03 15:44:36 -07:00
|
|
|
# define MIN(a, b) ((a) < (b)) ? (a) : (b)
|
2011-05-18 09:49:20 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAX
|
2012-05-03 15:44:36 -07:00
|
|
|
# define MAX(a, b) ((a) < (b)) ? (b) : (a)
|
2011-05-18 09:49:20 -07:00
|
|
|
#endif
|
|
|
|
|
2012-11-19 17:49:28 -08:00
|
|
|
static char CONFORMANT_KEY[] = "_elm_conform_key";
|
2011-04-26 23:33:34 -07:00
|
|
|
|
2012-03-29 14:24:00 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2011-05-19 03:58:16 -07:00
|
|
|
#define SUB_TYPE_COUNT 2
|
2012-08-30 09:46:52 -07:00
|
|
|
static char *sub_type[SUB_TYPE_COUNT] = { "elm_scroller", "elm_genlist" };
|
2012-03-29 14:24:00 -07:00
|
|
|
#endif
|
2011-05-19 03:58:16 -07:00
|
|
|
|
2013-01-16 03:31:40 -08:00
|
|
|
|
|
|
|
static const char INDICATOR_PART[] = "elm.swallow.indicator";
|
2013-01-21 22:42:28 -08:00
|
|
|
static const char VIRTUALKEYPAD_PART[] = "elm.swallow.virtualkeypad";
|
2013-01-16 03:31:40 -08:00
|
|
|
static const char CLIPBOARD_PART[] = "elm.swallow.clipboard";
|
|
|
|
static const char SOFTKEY_PART[] = "elm.swallow.softkey";
|
|
|
|
|
2012-11-14 02:49:22 -08:00
|
|
|
static const char SIG_VIRTUALKEYPAD_STATE_ON[] = "virtualkeypad,state,on";
|
|
|
|
static const char SIG_VIRTUALKEYPAD_STATE_OFF[] = "virtualkeypad,state,off";
|
|
|
|
static const char SIG_CLIPBOARD_STATE_ON[] = "clipboard,state,on";
|
|
|
|
static const char SIG_CLIPBOARD_STATE_OFF[] = "clipboard,state,off";
|
|
|
|
|
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|
|
|
{SIG_VIRTUALKEYPAD_STATE_ON, ""},
|
|
|
|
{SIG_VIRTUALKEYPAD_STATE_OFF, ""},
|
|
|
|
{SIG_CLIPBOARD_STATE_ON, ""},
|
|
|
|
{SIG_CLIPBOARD_STATE_OFF, ""},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
{"icon", "elm.swallow.content"},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
2012-05-02 18:19:05 -07:00
|
|
|
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
/* Example of env vars:
|
|
|
|
* ILLUME_KBD="0, 0, 800, 301"
|
2012-05-03 15:44:36 -07:00
|
|
|
* ILLUME_IND="0, 0, 800, 32"
|
|
|
|
* ILLUME_STK="0, 568, 800, 32"
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
*/
|
|
|
|
static Eina_Bool
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_part_geometry_get_from_env(const char *part,
|
|
|
|
int *sx,
|
|
|
|
int *sy,
|
|
|
|
int *sw,
|
|
|
|
int *sh)
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
{
|
|
|
|
const char delimiters[] = " ,;";
|
|
|
|
char *env_val, *token;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
int tsx, tsy, tsw;
|
|
|
|
|
|
|
|
if (!(env_val = getenv(part))) return EINA_FALSE;
|
|
|
|
|
|
|
|
/* strtok would modify env var if not copied to a buffer */
|
|
|
|
strncpy(buf, env_val, sizeof(buf));
|
2012-12-06 00:31:25 -08:00
|
|
|
buf[PATH_MAX - 1] = '\0';
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
|
|
|
|
token = strtok(buf, delimiters);
|
|
|
|
if (!token) return EINA_FALSE;
|
|
|
|
tsx = atoi(token);
|
|
|
|
|
|
|
|
token = strtok(NULL, delimiters);
|
|
|
|
if (!token) return EINA_FALSE;
|
|
|
|
tsy = atoi(token);
|
|
|
|
|
|
|
|
token = strtok(NULL, delimiters);
|
|
|
|
if (!token) return EINA_FALSE;
|
|
|
|
tsw = atoi(token);
|
|
|
|
|
|
|
|
token = strtok(NULL, delimiters);
|
|
|
|
if (!token) return EINA_FALSE;
|
|
|
|
*sh = atoi(token);
|
|
|
|
|
|
|
|
*sx = tsx;
|
|
|
|
*sy = tsy;
|
|
|
|
*sw = tsw;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2011-04-26 23:33:34 -07:00
|
|
|
static void
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_part_size_hints_set(Evas_Object *obj,
|
|
|
|
Evas_Object *sobj,
|
|
|
|
Evas_Coord sx,
|
|
|
|
Evas_Coord sy,
|
|
|
|
Evas_Coord sw,
|
|
|
|
Evas_Coord sh)
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
|
|
|
Evas_Coord cx, cy, cw, ch;
|
|
|
|
Evas_Coord part_height = 0, part_width = 0;
|
|
|
|
|
|
|
|
evas_object_geometry_get(obj, &cx, &cy, &cw, &ch);
|
|
|
|
|
|
|
|
/* Part overlapping with conformant */
|
|
|
|
if ((cx < (sx + sw)) && ((cx + cw) > sx)
|
2012-05-03 15:44:36 -07:00
|
|
|
&& (cy < (sy + sh)) && ((cy + ch) > sy))
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
|
|
|
part_height = MIN((cy + ch), (sy + sh)) - MAX(cy, sy);
|
|
|
|
part_width = MIN((cx + cw), (sx + sw)) - MAX(cx, sx);
|
|
|
|
}
|
|
|
|
|
|
|
|
evas_object_size_hint_min_set(sobj, part_width, part_height);
|
|
|
|
evas_object_size_hint_max_set(sobj, part_width, part_height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_part_sizing_eval(Evas_Object *obj,
|
|
|
|
Conformant_Part_Type part_type)
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
2012-03-29 14:24:00 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
Ecore_X_Window zone = 0;
|
2011-10-10 01:33:13 -07:00
|
|
|
Evas_Object *top;
|
2013-01-29 23:29:50 -08:00
|
|
|
Ecore_X_Window xwin;
|
2012-03-29 14:24:00 -07:00
|
|
|
#endif
|
2012-05-02 18:19:05 -07:00
|
|
|
int sx = -1, sy = -1, sw = -1, sh = -1;
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
ELM_CONFORMANT_DATA_GET(obj, sd);
|
2011-04-26 23:33:34 -07:00
|
|
|
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-03-29 14:24:00 -07:00
|
|
|
top = elm_widget_top_get(obj);
|
2011-04-26 23:33:34 -07:00
|
|
|
xwin = elm_win_xwindow_get(top);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2011-07-22 06:44:42 -07:00
|
|
|
if (xwin)
|
|
|
|
zone = ecore_x_e_illume_zone_get(xwin);
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#endif
|
2011-04-26 23:33:34 -07:00
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
if (part_type & ELM_CONFORMANT_INDICATOR_PART)
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
if ((!_conformant_part_geometry_get_from_env
|
|
|
|
("ILLUME_IND", &sx, &sy, &sw, &sh)) && (xwin))
|
2011-07-23 16:54:17 -07:00
|
|
|
{
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:44:36 -07:00
|
|
|
//No information of the indicator geometry, reset the geometry.
|
|
|
|
if (!ecore_x_e_illume_indicator_geometry_get
|
|
|
|
(zone, &sx, &sy, &sw, &sh))
|
2011-12-27 20:24:06 -08:00
|
|
|
sx = sy = sw = sh = 0;
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#else
|
2011-07-23 16:54:17 -07:00
|
|
|
;
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#endif
|
2011-07-23 16:54:17 -07:00
|
|
|
}
|
2012-11-15 02:43:26 -08:00
|
|
|
if (((sd->rot == 90) || (sd->rot == 270)) && sd->landscape_indicator)
|
|
|
|
_conformant_part_size_hints_set(obj, sd->landscape_indicator, sx, sy, sw, sh);
|
|
|
|
else if (((sd->rot == 0) || (sd->rot == 180)) && sd->portrait_indicator)
|
|
|
|
_conformant_part_size_hints_set(obj, sd->portrait_indicator, sx, sy, sw, sh);
|
2011-04-26 23:33:34 -07:00
|
|
|
}
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
if (part_type & ELM_CONFORMANT_VIRTUAL_KEYPAD_PART)
|
2011-05-19 03:58:16 -07:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
if ((!_conformant_part_geometry_get_from_env
|
|
|
|
("ILLUME_KBD", &sx, &sy, &sw, &sh)) && (xwin))
|
2011-07-23 16:54:17 -07:00
|
|
|
{
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:44:36 -07:00
|
|
|
//No information of the keyboard geometry, reset the geometry.
|
2013-01-29 23:56:46 -08:00
|
|
|
#ifdef __linux__
|
|
|
|
DBG("[KEYPAD]:pid=%d, xwin=0x%x, zone=0x%x: no env value and check window property.", getpid(), xwin, zone);
|
|
|
|
#endif
|
2013-01-29 23:29:50 -08:00
|
|
|
if (!ecore_x_e_illume_keyboard_geometry_get(xwin, &sx, &sy, &sw, &sh))
|
|
|
|
{
|
|
|
|
DBG("[KEYPAD]:no window property, check zone property.");
|
|
|
|
if (!ecore_x_e_illume_keyboard_geometry_get(zone, &sx, &sy, &sw, &sh))
|
|
|
|
{
|
|
|
|
DBG("[KEYPAD]:no zone property, reset value.");
|
|
|
|
sx = sy = sw = sh = 0;
|
|
|
|
}
|
|
|
|
}
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#else
|
2011-07-23 16:54:17 -07:00
|
|
|
;
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#endif
|
2011-07-23 16:54:17 -07:00
|
|
|
}
|
2013-01-29 23:29:50 -08:00
|
|
|
DBG("[KEYPAD]: size(%d,%d, %dx%d).", sx, sy, sw, sh);
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_part_size_hints_set
|
|
|
|
(obj, sd->virtualkeypad, sx, sy, sw, sh);
|
2011-05-19 03:58:16 -07:00
|
|
|
}
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
if (part_type & ELM_CONFORMANT_SOFTKEY_PART)
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
if ((!_conformant_part_geometry_get_from_env
|
|
|
|
("ILLUME_STK", &sx, &sy, &sw, &sh)) && (xwin))
|
2011-07-23 16:54:17 -07:00
|
|
|
{
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:44:36 -07:00
|
|
|
//No information of the softkey geometry, reset the geometry.
|
|
|
|
if (!ecore_x_e_illume_softkey_geometry_get
|
|
|
|
(zone, &sx, &sy, &sw, &sh))
|
|
|
|
sx = sy = sw = sh = 0;
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#else
|
2011-07-23 16:54:17 -07:00
|
|
|
;
|
Elementary: elm conform get illume parts size from env
For tests and documentation purposes, make possible to define
illume parts: keyboard, softkey, indicator with enviroment vars.
This way is possible to see elm_conformant behavior even without
illume.
Useful for tests and doc.
Usage examples:
ILLUME_KBD="0, 0, 240, 123"
ILLUME_IND=0,0,240,32
ILLUME_STK="0,288,240,32"
SVN revision: 61572
2011-07-21 15:03:22 -07:00
|
|
|
#endif
|
2011-07-23 16:54:17 -07:00
|
|
|
}
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_part_size_hints_set(obj, sd->softkey, sx, sy, sw, sh);
|
2011-04-26 23:33:34 -07:00
|
|
|
}
|
2012-06-05 15:27:09 -07:00
|
|
|
if (part_type & ELM_CONFORMANT_CLIPBOARD_PART)
|
2012-03-13 01:13:35 -07:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
if ((!_conformant_part_geometry_get_from_env
|
|
|
|
("ILLUME_CB", &sx, &sy, &sw, &sh)) && (xwin))
|
2012-03-13 01:13:35 -07:00
|
|
|
{
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:44:36 -07:00
|
|
|
//No information of the clipboard geometry, reset the geometry.
|
|
|
|
if (!ecore_x_e_illume_clipboard_geometry_get
|
|
|
|
(zone, &sx, &sy, &sw, &sh))
|
|
|
|
sx = sy = sw = sh = 0;
|
2012-03-13 01:13:35 -07:00
|
|
|
#else
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
}
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_part_size_hints_set(obj, sd->clipboard, sx, sy, sw, sh);
|
2012-03-13 01:13:35 -07:00
|
|
|
}
|
2011-04-26 23:33:34 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_parts_swallow(Evas_Object *obj)
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
Evas *e;
|
2013-01-16 03:27:03 -08:00
|
|
|
Elm_Widget_Smart_Data *wd;
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
ELM_CONFORMANT_DATA_GET(obj, sd);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
|
2012-05-03 15:44:36 -07:00
|
|
|
e = evas_object_evas_get(obj);
|
2012-03-28 23:26:16 -07:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
sd->scroller = NULL;
|
2012-03-13 21:00:13 -07:00
|
|
|
|
|
|
|
//Virtual Keyboard
|
2013-01-16 03:31:40 -08:00
|
|
|
if (edje_object_part_exists(wd->resize_obj, VIRTUALKEYPAD_PART))
|
2011-05-19 03:58:16 -07:00
|
|
|
{
|
2013-01-16 03:27:03 -08:00
|
|
|
if (!sd->virtualkeypad)
|
|
|
|
{
|
|
|
|
sd->virtualkeypad = evas_object_rectangle_add(e);
|
|
|
|
elm_widget_sub_object_add(obj, sd->virtualkeypad);
|
|
|
|
evas_object_size_hint_max_set(sd->virtualkeypad, -1, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2013-01-16 03:27:03 -08:00
|
|
|
evas_object_color_set(sd->virtualkeypad, 0, 0, 0, 0);
|
2013-01-16 03:31:40 -08:00
|
|
|
elm_layout_content_set(obj, VIRTUALKEYPAD_PART, sd->virtualkeypad);
|
2013-01-16 03:27:03 -08:00
|
|
|
}
|
|
|
|
else if (sd->virtualkeypad)
|
|
|
|
{
|
|
|
|
evas_object_del(sd->virtualkeypad);
|
|
|
|
sd->virtualkeypad = NULL;
|
|
|
|
}
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2012-03-13 21:00:13 -07:00
|
|
|
//Clipboard
|
2013-01-16 03:31:40 -08:00
|
|
|
if (edje_object_part_exists(wd->resize_obj, CLIPBOARD_PART))
|
2012-03-13 01:13:35 -07:00
|
|
|
{
|
2013-01-16 03:27:03 -08:00
|
|
|
if (!sd->clipboard)
|
|
|
|
{
|
|
|
|
sd->clipboard = evas_object_rectangle_add(e);
|
|
|
|
evas_object_size_hint_min_set(sd->clipboard, -1, 0);
|
|
|
|
evas_object_size_hint_max_set(sd->clipboard, -1, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_conformant_part_sizing_eval(obj, ELM_CONFORMANT_CLIPBOARD_PART);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2013-01-16 03:27:03 -08:00
|
|
|
evas_object_color_set(sd->clipboard, 0, 0, 0, 0);
|
2013-01-16 03:31:40 -08:00
|
|
|
elm_layout_content_set(obj, CLIPBOARD_PART, sd->clipboard);
|
2013-01-16 03:27:03 -08:00
|
|
|
}
|
|
|
|
else if (sd->clipboard)
|
|
|
|
{
|
|
|
|
evas_object_del(sd->clipboard);
|
|
|
|
sd->clipboard = NULL;
|
|
|
|
}
|
2012-03-13 01:13:35 -07:00
|
|
|
|
2012-03-13 21:00:13 -07:00
|
|
|
//Softkey
|
2013-01-16 03:31:40 -08:00
|
|
|
if (edje_object_part_exists(wd->resize_obj, SOFTKEY_PART))
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
2013-01-16 03:27:03 -08:00
|
|
|
if (!sd->softkey)
|
|
|
|
{
|
|
|
|
sd->softkey = evas_object_rectangle_add(e);
|
|
|
|
evas_object_size_hint_min_set(sd->softkey, -1, 0);
|
|
|
|
evas_object_size_hint_max_set(sd->softkey, -1, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_conformant_part_sizing_eval(obj, ELM_CONFORMANT_SOFTKEY_PART);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2013-01-16 03:27:03 -08:00
|
|
|
evas_object_color_set(sd->softkey, 0, 0, 0, 0);
|
2013-01-16 03:31:40 -08:00
|
|
|
elm_layout_content_set(obj, SOFTKEY_PART, sd->softkey);
|
2013-01-16 03:27:03 -08:00
|
|
|
}
|
|
|
|
else if (sd->softkey)
|
|
|
|
{
|
|
|
|
evas_object_del(sd->softkey);
|
|
|
|
sd->softkey = NULL;
|
|
|
|
}
|
2011-04-26 23:33:34 -07:00
|
|
|
}
|
|
|
|
|
2012-11-15 02:43:26 -08:00
|
|
|
static Eina_Bool
|
2012-11-19 04:52:11 -08:00
|
|
|
_port_indicator_connect_cb(void *data)
|
2012-11-15 02:43:26 -08:00
|
|
|
{
|
|
|
|
const char *indicator_serv_name;
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_CONFORMANT_DATA_GET(data, sd);
|
2012-11-19 04:52:11 -08:00
|
|
|
int rot;
|
2012-11-15 02:43:26 -08:00
|
|
|
|
2013-01-09 03:17:08 -08:00
|
|
|
if (!sd) return ECORE_CALLBACK_CANCEL;
|
|
|
|
if (sd->indmode != ELM_WIN_INDICATOR_SHOW)
|
2012-11-19 04:52:11 -08:00
|
|
|
{
|
|
|
|
sd->port_indi_timer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
2013-01-15 09:21:47 -08:00
|
|
|
rot = (intptr_t) evas_object_data_get(sd->portrait_indicator, CONFORMANT_KEY);
|
2012-11-15 02:43:26 -08:00
|
|
|
indicator_serv_name = elm_config_indicator_service_get(rot);
|
|
|
|
if (!indicator_serv_name)
|
|
|
|
{
|
|
|
|
DBG("Conformant cannot find indicator service name: Rotation=%d\n",rot);
|
2012-11-19 04:52:11 -08:00
|
|
|
sd->port_indi_timer = NULL;
|
2012-11-15 02:43:26 -08:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
2012-11-19 04:52:11 -08:00
|
|
|
if (elm_plug_connect(sd->portrait_indicator, indicator_serv_name, 0, EINA_FALSE))
|
|
|
|
{
|
|
|
|
DBG("Conformant connect to server[%s]\n", indicator_serv_name);
|
|
|
|
sd->port_indi_timer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
2012-11-15 02:43:26 -08:00
|
|
|
|
2012-11-19 04:52:11 -08:00
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_land_indicator_connect_cb(void *data)
|
|
|
|
{
|
|
|
|
const char *indicator_serv_name;
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_CONFORMANT_DATA_GET(data, sd);
|
2012-11-19 04:52:11 -08:00
|
|
|
int rot;
|
|
|
|
|
2013-01-09 03:24:11 -08:00
|
|
|
if (!sd) return ECORE_CALLBACK_CANCEL;
|
|
|
|
if (sd->indmode != ELM_WIN_INDICATOR_SHOW)
|
2012-11-15 02:43:26 -08:00
|
|
|
{
|
2012-11-19 04:52:11 -08:00
|
|
|
sd->land_indi_timer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
2013-01-15 09:21:47 -08:00
|
|
|
rot = (intptr_t) evas_object_data_get(sd->landscape_indicator, CONFORMANT_KEY);
|
2012-11-19 04:52:11 -08:00
|
|
|
indicator_serv_name = elm_config_indicator_service_get(rot);
|
|
|
|
if (!indicator_serv_name)
|
2012-11-15 02:43:26 -08:00
|
|
|
{
|
2012-11-19 04:52:11 -08:00
|
|
|
DBG("Conformant cannot find indicator service name: Rotation=%d\n",rot);
|
|
|
|
sd->land_indi_timer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
if (elm_plug_connect(sd->landscape_indicator, indicator_serv_name, 0, EINA_FALSE))
|
|
|
|
{
|
|
|
|
DBG("Conformant connect to server[%s]\n", indicator_serv_name);
|
|
|
|
sd->land_indi_timer = NULL;
|
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-19 04:52:11 -08:00
|
|
|
_land_indicator_disconnected(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2012-11-15 02:43:26 -08:00
|
|
|
{
|
|
|
|
Evas_Object *conform = data;
|
|
|
|
|
|
|
|
ELM_CONFORMANT_DATA_GET(conform, sd);
|
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
sd->land_indi_timer = ecore_timer_add(1, _land_indicator_connect_cb, conform);
|
2012-11-19 04:52:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_port_indicator_disconnected(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
Evas_Object *conform = data;
|
|
|
|
|
|
|
|
ELM_CONFORMANT_DATA_GET(conform, sd);
|
2012-11-15 02:43:26 -08:00
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
sd->port_indi_timer = ecore_timer_add(1, _port_indicator_connect_cb, conform);
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
|
|
|
|
2012-11-19 04:52:11 -08:00
|
|
|
|
2012-11-15 02:43:26 -08:00
|
|
|
static Evas_Object *
|
|
|
|
_create_portrait_indicator(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *port_indicator = NULL;
|
|
|
|
const char *port_indicator_serv_name;
|
|
|
|
|
|
|
|
ELM_CONFORMANT_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
port_indicator_serv_name = elm_config_indicator_service_get(sd->rot);
|
|
|
|
if (!port_indicator_serv_name)
|
|
|
|
{
|
|
|
|
DBG("Conformant cannot get portrait indicator service name\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
port_indicator = elm_plug_add(obj);
|
|
|
|
if (!port_indicator)
|
|
|
|
{
|
|
|
|
DBG("Conformant cannot create plug to server[%s]\n", port_indicator_serv_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!elm_plug_connect(port_indicator, port_indicator_serv_name, 0, EINA_FALSE))
|
|
|
|
{
|
|
|
|
DBG("Conformant cannot connect to server[%s]\n", port_indicator_serv_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
elm_widget_sub_object_add(obj, port_indicator);
|
2012-11-19 04:52:11 -08:00
|
|
|
evas_object_smart_callback_add(port_indicator, "image.deleted", _port_indicator_disconnected, obj);
|
2012-11-15 02:43:26 -08:00
|
|
|
|
|
|
|
evas_object_size_hint_min_set(port_indicator, -1, 0);
|
|
|
|
evas_object_size_hint_max_set(port_indicator, -1, 0);
|
|
|
|
|
|
|
|
return port_indicator;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_create_landscape_indicator(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *land_indicator = NULL;
|
|
|
|
const char *land_indicator_serv_name;
|
|
|
|
|
|
|
|
ELM_CONFORMANT_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
land_indicator_serv_name = elm_config_indicator_service_get(sd->rot);
|
|
|
|
if (!land_indicator_serv_name)
|
|
|
|
{
|
|
|
|
DBG("Conformant cannot get portrait indicator service name\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
land_indicator = elm_plug_add(obj);
|
|
|
|
if (!land_indicator)
|
|
|
|
{
|
|
|
|
DBG("Conformant cannot create plug to server[%s]\n", land_indicator_serv_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!elm_plug_connect(land_indicator, land_indicator_serv_name, 0, EINA_FALSE))
|
|
|
|
{
|
|
|
|
DBG("Conformant cannot connect to server[%s]\n", land_indicator_serv_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
elm_widget_sub_object_add(obj, land_indicator);
|
2012-11-19 04:52:11 -08:00
|
|
|
evas_object_smart_callback_add(land_indicator, "image.deleted",_land_indicator_disconnected, obj);
|
2012-11-15 02:43:26 -08:00
|
|
|
|
|
|
|
evas_object_size_hint_min_set(land_indicator, -1, 0);
|
|
|
|
evas_object_size_hint_max_set(land_indicator, -1, 0);
|
|
|
|
return land_indicator;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_indicator_mode_set(Evas_Object *conformant, Elm_Win_Indicator_Mode indmode)
|
|
|
|
{
|
|
|
|
Evas_Object *old_indi = NULL;
|
2013-01-16 03:27:03 -08:00
|
|
|
Elm_Widget_Smart_Data *wd;
|
|
|
|
|
2012-11-15 02:43:26 -08:00
|
|
|
ELM_CONFORMANT_DATA_GET(conformant, sd);
|
2013-04-24 04:41:37 -07:00
|
|
|
wd = eo_data_scope_get(conformant, ELM_OBJ_WIDGET_CLASS);
|
2013-01-16 03:27:03 -08:00
|
|
|
|
2012-11-15 02:43:26 -08:00
|
|
|
sd->indmode = indmode;
|
|
|
|
|
2013-01-16 03:31:40 -08:00
|
|
|
if (!edje_object_part_exists(wd->resize_obj, INDICATOR_PART))
|
2013-01-16 03:27:03 -08:00
|
|
|
return;
|
|
|
|
|
2012-11-15 02:43:26 -08:00
|
|
|
if (indmode == ELM_WIN_INDICATOR_SHOW)
|
|
|
|
{
|
2013-01-16 03:31:40 -08:00
|
|
|
old_indi = elm_layout_content_get(conformant, INDICATOR_PART);
|
2012-11-15 02:43:26 -08:00
|
|
|
|
|
|
|
//create new indicator
|
|
|
|
if (!old_indi)
|
|
|
|
{
|
|
|
|
if ((sd->rot == 90)||(sd->rot == 270))
|
|
|
|
{
|
|
|
|
if (!sd->landscape_indicator)
|
|
|
|
sd->landscape_indicator = _create_landscape_indicator(conformant);
|
|
|
|
|
|
|
|
if (!sd->landscape_indicator) return;
|
|
|
|
|
|
|
|
evas_object_show(sd->landscape_indicator);
|
2013-01-16 03:31:40 -08:00
|
|
|
elm_layout_content_set(conformant, INDICATOR_PART, sd->landscape_indicator);
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!sd->portrait_indicator)
|
|
|
|
sd->portrait_indicator = _create_portrait_indicator(conformant);
|
|
|
|
|
|
|
|
if (!sd->portrait_indicator) return;
|
|
|
|
|
|
|
|
evas_object_show(sd->portrait_indicator);
|
2013-01-16 03:31:40 -08:00
|
|
|
elm_layout_content_set(conformant, INDICATOR_PART, sd->portrait_indicator);
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
elm_object_signal_emit(conformant, "elm,state,indicator,show", "elm");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-01-16 03:31:40 -08:00
|
|
|
old_indi = elm_layout_content_get(conformant, INDICATOR_PART);
|
2012-11-15 02:43:26 -08:00
|
|
|
if (old_indi)
|
|
|
|
{
|
|
|
|
evas_object_hide(old_indi);
|
|
|
|
}
|
|
|
|
elm_object_signal_emit(conformant, "elm,state,indicator,hide", "elm");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_indicator_opacity_set(Evas_Object *conformant, Elm_Win_Indicator_Opacity_Mode ind_o_mode)
|
|
|
|
{
|
|
|
|
ELM_CONFORMANT_DATA_GET(conformant, sd);
|
|
|
|
sd->ind_o_mode = ind_o_mode;
|
|
|
|
//TODO: opacity change
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_indicator_mode_changed(void *data,
|
2013-01-16 03:46:07 -08:00
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2012-11-15 02:43:26 -08:00
|
|
|
{
|
|
|
|
Evas_Object *conformant = data;
|
|
|
|
Evas_Object *win = obj;
|
|
|
|
|
|
|
|
Elm_Win_Indicator_Mode indmode;
|
|
|
|
Elm_Win_Indicator_Opacity_Mode ind_o_mode;
|
|
|
|
|
|
|
|
ELM_CONFORMANT_DATA_GET(conformant, sd);
|
|
|
|
|
|
|
|
indmode = elm_win_indicator_mode_get(win);
|
|
|
|
ind_o_mode = elm_win_indicator_opacity_get(win);
|
2013-03-05 22:36:36 -08:00
|
|
|
if (indmode != sd->indmode)
|
2012-11-15 02:43:26 -08:00
|
|
|
_indicator_mode_set(conformant, indmode);
|
2013-03-05 22:36:36 -08:00
|
|
|
if (ind_o_mode != sd->ind_o_mode)
|
|
|
|
_indicator_opacity_set(conformant, ind_o_mode);
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_rotation_changed(void *data,
|
2013-01-16 03:46:07 -08:00
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2012-11-15 02:43:26 -08:00
|
|
|
{
|
|
|
|
int rot = 0;
|
|
|
|
Evas_Object *win = obj;
|
|
|
|
Evas_Object *conformant = data;
|
|
|
|
Evas_Object *old_indi = NULL;
|
|
|
|
|
|
|
|
ELM_CONFORMANT_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
rot = elm_win_rotation_get(win);
|
|
|
|
|
|
|
|
if (rot == sd->rot) return;
|
|
|
|
|
|
|
|
sd->rot = rot;
|
2013-01-16 03:31:40 -08:00
|
|
|
old_indi = elm_layout_content_unset(conformant, INDICATOR_PART);
|
2012-11-15 02:43:26 -08:00
|
|
|
/* this means ELM_WIN_INDICATOR_SHOW never be set.we don't need to change indicator type*/
|
|
|
|
if (!old_indi) return;
|
2012-11-19 00:17:49 -08:00
|
|
|
evas_object_hide(old_indi);
|
2012-11-15 02:43:26 -08:00
|
|
|
|
2012-11-19 03:56:54 -08:00
|
|
|
if ((rot == 90) || (rot == 270))
|
2012-11-15 02:43:26 -08:00
|
|
|
{
|
|
|
|
if (!sd->landscape_indicator)
|
|
|
|
sd->landscape_indicator = _create_landscape_indicator(conformant);
|
|
|
|
|
|
|
|
if (!sd->landscape_indicator) return;
|
|
|
|
|
|
|
|
evas_object_show(sd->landscape_indicator);
|
2013-01-15 09:21:47 -08:00
|
|
|
evas_object_data_set(sd->landscape_indicator, CONFORMANT_KEY, (void *) (intptr_t) rot);
|
2013-01-16 03:31:40 -08:00
|
|
|
elm_layout_content_set(conformant, INDICATOR_PART, sd->landscape_indicator);
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!sd->portrait_indicator)
|
|
|
|
sd->portrait_indicator = _create_portrait_indicator(conformant);
|
|
|
|
|
|
|
|
if (!sd->portrait_indicator) return;
|
|
|
|
|
|
|
|
evas_object_show(sd->portrait_indicator);
|
2013-01-15 09:21:47 -08:00
|
|
|
evas_object_data_set(sd->portrait_indicator, CONFORMANT_KEY, (void *) (intptr_t) rot);
|
2013-01-16 03:31:40 -08:00
|
|
|
elm_layout_content_set(conformant, INDICATOR_PART, sd->portrait_indicator);
|
2012-11-15 02:43:26 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_elm_conformant_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
2010-02-04 01:08:02 -08:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
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_wdg_theme(&int_ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!int_ret) return;
|
2012-03-28 23:26:16 -07:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_parts_swallow(obj);
|
2010-02-04 01:08:02 -08:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
2012-03-28 23:26:16 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
if (ret) *ret = EINA_TRUE;
|
2010-02-04 01:08:02 -08:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
// unused now - but meant to be for making sure the focused widget is always
|
|
|
|
// visible when the vkbd comes and goes by moving the conformant obj (and thus
|
|
|
|
// its children) to show the focused widget (and if focus changes follow)
|
|
|
|
/*
|
|
|
|
static Evas_Object *
|
|
|
|
_focus_object_get(const Evas_Object *obj)
|
|
|
|
{
|
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
|
|
|
Evas_Object *win, *foc;
|
|
|
|
|
|
|
|
win = elm_widget_top_get(obj);
|
|
|
|
if (!win) return NULL;
|
|
|
|
foc = elm_widget_top_get(win);
|
2012-05-03 15:44:36 -07: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
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
static void
|
|
|
|
_focus_object_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
|
|
|
{
|
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
|
|
|
evas_object_geometry_get(obj, x, y, w, h);
|
2012-05-03 15:44:36 -07: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
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
static void
|
|
|
|
_focus_change_del(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
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
|
|
|
// called from toplevel when the focused window shanges
|
2012-05-03 15:44:36 -07:00
|
|
|
}
|
2010-02-04 22:14:50 -08:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
static void
|
|
|
|
_autoscroll_move(Evas_Object *obj)
|
|
|
|
{
|
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
|
|
|
// move conformant edje by delta to show focused widget
|
2012-05-03 15:44:36 -07:00
|
|
|
}
|
2010-02-04 22:14:50 -08:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
static void
|
|
|
|
_autoscroll_mode_enable(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
// called when autoscroll mode should be on - content area smaller than
|
|
|
|
// its min size
|
|
|
|
// 1. get focused object
|
|
|
|
// 2. if not in visible conformant area calculate delta needed to
|
|
|
|
// get it in
|
|
|
|
// 3. store delta and call _autoscroll_move() which either asanimates
|
|
|
|
// or jumps right there
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_autoscroll_mode_disable(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
// called when autoscroll mode should be off - set delta to 0 and
|
|
|
|
// call _autoscroll_move()
|
|
|
|
}
|
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-02-04 22:14:50 -08:00
|
|
|
|
2011-04-26 23:33:34 -07:00
|
|
|
static void
|
2012-05-03 15:44:36 -07:00
|
|
|
_move_resize_cb(void *data __UNUSED__,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2011-04-26 23:33:34 -07:00
|
|
|
{
|
|
|
|
Conformant_Part_Type part_type;
|
2011-05-19 03:58:16 -07:00
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
part_type = (ELM_CONFORMANT_INDICATOR_PART |
|
|
|
|
ELM_CONFORMANT_SOFTKEY_PART |
|
|
|
|
ELM_CONFORMANT_VIRTUAL_KEYPAD_PART |
|
|
|
|
ELM_CONFORMANT_CLIPBOARD_PART);
|
2011-11-21 22:37:30 -08:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
_conformant_part_sizing_eval(obj, part_type);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
2011-11-21 22:37:30 -08:00
|
|
|
static void
|
|
|
|
_show_region_job(void *data)
|
|
|
|
{
|
|
|
|
Evas_Object *focus_obj;
|
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
ELM_CONFORMANT_DATA_GET(data, sd);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
|
|
|
focus_obj = elm_widget_focused_object_get(data);
|
2011-05-19 03:58:16 -07:00
|
|
|
if (focus_obj)
|
|
|
|
{
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
|
|
|
|
elm_widget_show_region_get(focus_obj, &x, &y, &w, &h);
|
|
|
|
|
2012-11-19 04:52:11 -08:00
|
|
|
|
2011-05-19 03:58:16 -07:00
|
|
|
if (h < _elm_config->finger_size)
|
|
|
|
h = _elm_config->finger_size;
|
|
|
|
|
2011-07-08 00:50:36 -07:00
|
|
|
elm_widget_show_region_set(focus_obj, x, y, w, h, EINA_TRUE);
|
2011-05-19 03:58:16 -07:00
|
|
|
}
|
2011-11-21 22:37:30 -08:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
sd->show_region_job = NULL;
|
2011-05-19 03:58:16 -07:00
|
|
|
}
|
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
// showing the focused/important region.
|
2012-05-02 10:01:59 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
static void
|
2012-05-03 15:44:36 -07:00
|
|
|
_on_content_resize(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
2012-06-05 15:27:09 -07:00
|
|
|
ELM_CONFORMANT_DATA_GET(data, sd);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
if ((sd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) &&
|
|
|
|
(sd->clipboard_state == ECORE_X_ILLUME_CLIPBOARD_STATE_OFF))
|
|
|
|
return;
|
2012-05-03 15:44:36 -07:00
|
|
|
|
|
|
|
if (sd->show_region_job) ecore_job_del(sd->show_region_job);
|
|
|
|
sd->show_region_job = ecore_job_add(_show_region_job, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
static void
|
|
|
|
_autoscroll_objects_update(void *data)
|
2011-05-19 03:58:16 -07:00
|
|
|
{
|
2012-05-02 18:19:05 -07:00
|
|
|
int i;
|
2012-05-03 15:44:36 -07:00
|
|
|
const char *type;
|
2011-05-19 03:58:16 -07:00
|
|
|
Evas_Object *sub, *top_scroller = NULL;
|
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
ELM_CONFORMANT_DATA_GET(data, sd);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
|
|
|
sub = elm_widget_focused_object_get(data);
|
|
|
|
//Look up for top most scroller in the focus object hierarchy
|
|
|
|
//inside Conformant.
|
2011-05-19 03:58:16 -07:00
|
|
|
|
|
|
|
while (sub)
|
|
|
|
{
|
|
|
|
type = elm_widget_type_get(sub);
|
2012-11-25 22:32:53 -08:00
|
|
|
if (!strcmp(type, MY_CLASS_NAME)) break;
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2011-05-19 03:58:16 -07:00
|
|
|
for (i = 0; i < SUB_TYPE_COUNT; i++)
|
|
|
|
if (!strcmp(type, sub_type[i]))
|
|
|
|
{
|
|
|
|
top_scroller = sub;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
sub = elm_object_parent_widget_get(sub);
|
|
|
|
}
|
|
|
|
|
|
|
|
//If the scroller got changed by app, replace it.
|
2012-05-03 15:44:36 -07:00
|
|
|
if (top_scroller != sd->scroller)
|
2011-05-19 03:58:16 -07:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
if (sd->scroller)
|
|
|
|
evas_object_event_callback_del
|
|
|
|
(sd->scroller, EVAS_CALLBACK_RESIZE, _on_content_resize);
|
|
|
|
sd->scroller = top_scroller;
|
|
|
|
|
|
|
|
if (sd->scroller)
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->scroller, EVAS_CALLBACK_RESIZE, _on_content_resize, data);
|
2011-05-19 03:58:16 -07:00
|
|
|
}
|
|
|
|
}
|
2011-04-26 23:33:34 -07:00
|
|
|
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
static void
|
|
|
|
_virtualkeypad_state_change(Evas_Object *obj, Ecore_X_Event_Window_Property *ev)
|
|
|
|
{
|
|
|
|
ELM_CONFORMANT_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
Ecore_X_Window zone = ecore_x_e_illume_zone_get(ev->win);
|
|
|
|
Ecore_X_Virtual_Keyboard_State state =
|
2013-03-04 19:44:46 -08:00
|
|
|
ecore_x_e_virtual_keyboard_state_get(ev->win);
|
|
|
|
|
2013-03-04 20:34:31 -08:00
|
|
|
DBG("[KEYPAD]:window's state win=0x%x, state=%d.", ev->win, state);
|
2013-03-04 19:44:46 -08:00
|
|
|
if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN)
|
|
|
|
{
|
|
|
|
state = ecore_x_e_virtual_keyboard_state_get(zone);
|
2013-03-04 20:34:31 -08:00
|
|
|
DBG("[KEYPAD]:zone's state zone=0x%x, state=%d.", zone, state);
|
2013-03-04 19:44:46 -08:00
|
|
|
}
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
|
|
|
|
if (sd->vkb_state == state) return;
|
|
|
|
sd->vkb_state = state;
|
|
|
|
|
|
|
|
if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
|
|
|
|
{
|
2013-03-04 19:44:46 -08:00
|
|
|
DBG("[KEYPAD]:ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF");
|
2013-03-05 22:36:36 -08:00
|
|
|
_conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_NONE);
|
2012-11-14 02:49:22 -08:00
|
|
|
evas_object_smart_callback_call(obj, SIG_VIRTUALKEYPAD_STATE_OFF, NULL);
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
}
|
|
|
|
else if (state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ON)
|
|
|
|
{
|
2013-03-04 19:44:46 -08:00
|
|
|
DBG("[KEYPAD]:ECORE_X_VIRTUAL_KEYBOARD_STATE_ON");
|
|
|
|
_conformant_part_sizing_eval(obj, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_COMPRESS);
|
|
|
|
_autoscroll_objects_update(obj);
|
2012-11-14 02:49:22 -08:00
|
|
|
evas_object_smart_callback_call(obj, SIG_VIRTUALKEYPAD_STATE_ON, NULL);
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_clipboard_state_change(Evas_Object *obj, Ecore_X_Event_Window_Property *ev)
|
|
|
|
{
|
|
|
|
ELM_CONFORMANT_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
Ecore_X_Window zone = ecore_x_e_illume_zone_get(ev->win);
|
|
|
|
Ecore_X_Illume_Clipboard_State state =
|
2013-03-04 19:44:46 -08:00
|
|
|
ecore_x_e_illume_clipboard_state_get(ev->win);
|
|
|
|
|
2013-03-04 20:34:31 -08:00
|
|
|
DBG("[CLIPBOARD]:window's state win=0x%x, state=%d.", ev->win, state);
|
2013-03-04 19:44:46 -08:00
|
|
|
|
|
|
|
if (state == ECORE_X_ILLUME_CLIPBOARD_STATE_UNKNOWN)
|
|
|
|
{
|
|
|
|
state = ecore_x_e_illume_clipboard_state_get(ev->win);
|
2013-03-04 20:34:31 -08:00
|
|
|
DBG("[CLIPBOARD]:zone's state zone=0x%x, state=%d.", zone, state);
|
2013-03-04 19:44:46 -08:00
|
|
|
}
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
|
|
|
|
if (sd->clipboard_state == state) return;
|
|
|
|
sd->clipboard_state = state;
|
|
|
|
|
|
|
|
if (state == ECORE_X_ILLUME_CLIPBOARD_STATE_OFF)
|
|
|
|
{
|
|
|
|
evas_object_size_hint_min_set(sd->clipboard, -1, 0);
|
|
|
|
evas_object_size_hint_max_set(sd->clipboard, -1, 0);
|
2013-01-14 04:44:09 -08:00
|
|
|
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_NONE);
|
2012-11-14 02:49:22 -08:00
|
|
|
evas_object_smart_callback_call(obj, SIG_CLIPBOARD_STATE_OFF, NULL);
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
}
|
|
|
|
else if(state == ECORE_X_ILLUME_CLIPBOARD_STATE_ON)
|
|
|
|
{
|
2013-01-14 04:44:09 -08:00
|
|
|
elm_widget_display_mode_set(obj, EVAS_DISPLAY_MODE_COMPRESS);
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
_autoscroll_objects_update(obj);
|
2012-11-14 02:49:22 -08:00
|
|
|
evas_object_smart_callback_call(obj, SIG_CLIPBOARD_STATE_ON, NULL);
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2012-05-03 15:44:36 -07:00
|
|
|
_on_prop_change(void *data,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event)
|
2010-01-26 17:48:18 -08:00
|
|
|
{
|
2012-05-03 15:44:36 -07:00
|
|
|
Ecore_X_Event_Window_Property *ev = event;
|
|
|
|
|
2013-01-29 23:56:46 -08:00
|
|
|
int pid = 0;
|
|
|
|
|
|
|
|
#ifdef __linux__
|
|
|
|
pid = (int)getpid();
|
|
|
|
#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
|
|
|
if (ev->atom == ECORE_X_ATOM_E_ILLUME_ZONE)
|
2010-01-26 17:48:18 -08:00
|
|
|
{
|
2013-01-29 23:56:46 -08:00
|
|
|
DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_ZONE.\n", pid, ev->win);
|
2011-04-26 23:33:34 -07:00
|
|
|
Conformant_Part_Type part_type;
|
|
|
|
|
2012-06-05 15:27:09 -07:00
|
|
|
part_type = (ELM_CONFORMANT_INDICATOR_PART |
|
|
|
|
ELM_CONFORMANT_SOFTKEY_PART |
|
|
|
|
ELM_CONFORMANT_VIRTUAL_KEYPAD_PART |
|
|
|
|
ELM_CONFORMANT_CLIPBOARD_PART);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2011-04-26 23:33:34 -07:00
|
|
|
_conformant_part_sizing_eval(data, part_type);
|
2010-01-26 17:48:18 -08:00
|
|
|
}
|
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
|
|
|
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY)
|
2013-01-29 23:29:50 -08:00
|
|
|
{
|
2013-01-29 23:56:46 -08:00
|
|
|
DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY.", pid, ev->win);
|
2013-01-29 23:29:50 -08:00
|
|
|
_conformant_part_sizing_eval(data, ELM_CONFORMANT_INDICATOR_PART);
|
|
|
|
}
|
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
|
|
|
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY)
|
2013-01-29 23:29:50 -08:00
|
|
|
{
|
2013-01-29 23:56:46 -08:00
|
|
|
DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY.", pid, ev->win);
|
2013-01-29 23:29:50 -08:00
|
|
|
_conformant_part_sizing_eval(data, ELM_CONFORMANT_SOFTKEY_PART);
|
|
|
|
}
|
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
|
|
|
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY)
|
2013-01-29 23:29:50 -08:00
|
|
|
{
|
2013-01-29 23:56:46 -08:00
|
|
|
DBG("[KEYPAD]:pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY.", pid, ev->win);
|
2013-01-29 23:29:50 -08:00
|
|
|
_conformant_part_sizing_eval(data, ELM_CONFORMANT_VIRTUAL_KEYPAD_PART);
|
|
|
|
}
|
2012-03-13 01:13:35 -07:00
|
|
|
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY)
|
2013-01-29 23:29:50 -08:00
|
|
|
{
|
2013-01-29 23:56:46 -08:00
|
|
|
DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY.", pid, ev->win);
|
2013-01-29 23:29:50 -08:00
|
|
|
_conformant_part_sizing_eval(data, ELM_CONFORMANT_CLIPBOARD_PART);
|
|
|
|
}
|
2011-05-19 03:58:16 -07:00
|
|
|
else if (ev->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE)
|
2013-01-29 23:29:50 -08:00
|
|
|
{
|
2013-01-29 23:56:46 -08:00
|
|
|
DBG("[KEYPAD]:pid=%d, win=0x%x, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE.", pid, ev->win);
|
2013-01-29 23:29:50 -08:00
|
|
|
_virtualkeypad_state_change(data, ev);
|
|
|
|
}
|
2012-03-13 01:13:35 -07:00
|
|
|
else if (ev->atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE)
|
2013-01-29 23:29:50 -08:00
|
|
|
{
|
2013-01-29 23:56:46 -08:00
|
|
|
DBG("pid=%d, win=0x%x, ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE.", pid, ev->win);
|
2013-01-29 23:29:50 -08:00
|
|
|
_clipboard_state_change(data, ev);
|
|
|
|
}
|
2010-01-26 17:48:18 -08:00
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2010-01-26 17:48:18 -08:00
|
|
|
}
|
2012-05-03 15:44:36 -07:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_conformant_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
2012-05-03 15:44:36 -07:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
|
2012-05-03 15:44:36 -07:00
|
|
|
|
|
|
|
elm_widget_can_focus_set(obj, EINA_FALSE);
|
|
|
|
|
2013-03-01 18:04:31 -08:00
|
|
|
if (!elm_layout_theme_set
|
|
|
|
(obj, "conformant", "base", elm_widget_style_get(obj)))
|
|
|
|
CRITICAL("Failed to set layout!");
|
2012-05-03 15:44:36 -07:00
|
|
|
|
|
|
|
_conformant_parts_swallow(obj);
|
2012-07-17 11:45:33 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(obj, EVAS_CALLBACK_RESIZE, _move_resize_cb, obj);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(obj, EVAS_CALLBACK_MOVE, _move_resize_cb, obj);
|
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2012-05-03 15:44:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_conformant_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
2012-05-03 15:44:36 -07:00
|
|
|
{
|
2012-11-22 06:52:32 -08:00
|
|
|
Evas_Object *top;
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Conformant_Smart_Data *sd = _pd;
|
2012-05-03 15:44:36 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->prop_hdl) ecore_event_handler_del(sd->prop_hdl);
|
2011-05-19 03:58:16 -07:00
|
|
|
#endif
|
2010-01-26 17:48:18 -08:00
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
if (sd->show_region_job) ecore_job_del(sd->show_region_job);
|
2012-11-19 04:52:11 -08:00
|
|
|
if (sd->port_indi_timer) ecore_timer_del(sd->port_indi_timer);
|
|
|
|
if (sd->land_indi_timer) ecore_timer_del(sd->land_indi_timer);
|
2012-11-15 02:43:26 -08:00
|
|
|
if (sd->portrait_indicator)
|
2012-11-19 04:52:11 -08:00
|
|
|
evas_object_del(sd->portrait_indicator);
|
2012-11-15 02:43:26 -08:00
|
|
|
if (sd->landscape_indicator)
|
2012-11-19 04:52:11 -08:00
|
|
|
evas_object_del(sd->landscape_indicator);
|
2012-11-22 06:52:32 -08:00
|
|
|
top = elm_widget_top_get(obj);
|
|
|
|
evas_object_data_set(top, "\377 elm,conformant", NULL);
|
2012-05-03 15:44:36 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
|
2012-05-03 15:44:36 -07:00
|
|
|
}
|
|
|
|
|
2012-07-18 14:03:39 -07:00
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_conformant_smart_parent_set(Eo *obj, void *_pd, va_list *list)
|
2012-07-18 14:03:39 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *parent = va_arg(*list, Evas_Object *);
|
|
|
|
|
2012-07-18 14:03:39 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
Evas_Object *top = elm_widget_top_get(parent);
|
|
|
|
Ecore_X_Window xwin = elm_win_xwindow_get(parent);
|
|
|
|
|
|
|
|
if ((xwin) && (!elm_win_inlined_image_object_get(top)))
|
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Conformant_Smart_Data *sd = _pd;
|
2012-07-18 14:03:39 -07:00
|
|
|
|
|
|
|
sd->prop_hdl = ecore_event_handler_add
|
|
|
|
(ECORE_X_EVENT_WINDOW_PROPERTY, _on_prop_change, obj);
|
|
|
|
sd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
|
elementary/conformant - support state change callbacks for comformant.
"virtualkeypad,state,on",
"virtualkeypad,state,off",
"clipboard,state,on",
"clipboard,state,off"
SVN revision: 79133
2012-11-11 21:53:16 -08:00
|
|
|
sd->clipboard_state = ECORE_X_ILLUME_CLIPBOARD_STATE_OFF;
|
2012-07-18 14:03:39 -07:00
|
|
|
}
|
|
|
|
// FIXME: get kbd region prop
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:44:36 -07:00
|
|
|
static void
|
2012-11-25 22:32:53 -08:00
|
|
|
_elm_conformant_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
2012-05-03 15:44:36 -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-07-31 15:06:21 -07:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_conformant_add(Evas_Object *parent)
|
2012-07-31 15:06:21 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
|
|
|
Evas_Object *obj = eo_add(MY_CLASS, parent);
|
|
|
|
eo_unref(obj);
|
|
|
|
return obj;
|
2012-05-03 15:44:36 -07:00
|
|
|
}
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
static void
|
|
|
|
_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
2010-01-08 10:00:33 -08:00
|
|
|
{
|
2012-11-15 02:43:26 -08:00
|
|
|
Evas_Object *top;
|
2010-01-08 10:00:33 -08:00
|
|
|
|
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));
|
2010-01-08 10:00:33 -08:00
|
|
|
|
2013-04-02 19:28:53 -07:00
|
|
|
elm_widget_sub_object_add(eo_parent_get(obj), obj);
|
2012-03-02 22:12:09 -08:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
Elm_Conformant_Smart_Data *sd = _pd;
|
2012-11-15 02:43:26 -08:00
|
|
|
|
|
|
|
top = elm_widget_top_get(obj);
|
|
|
|
_on_indicator_mode_changed(obj, top, NULL);
|
|
|
|
_on_rotation_changed(obj, top, NULL);
|
|
|
|
|
|
|
|
sd->indmode = elm_win_indicator_mode_get(top);
|
|
|
|
sd->ind_o_mode = elm_win_indicator_opacity_get(top);
|
|
|
|
sd->rot = elm_win_rotation_get(top);
|
2012-11-22 06:52:32 -08:00
|
|
|
evas_object_data_set(top, "\377 elm,conformant", obj);
|
2012-11-15 02:43:26 -08:00
|
|
|
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(top, "indicator,prop,changed", _on_indicator_mode_changed, obj);
|
|
|
|
evas_object_smart_callback_add
|
|
|
|
(top, "rotation,changed", _on_rotation_changed, obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-11-15 02:43:26 -08:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
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_conformant_smart_add),
|
|
|
|
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_conformant_smart_del),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_conformant_smart_parent_set),
|
|
|
|
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_conformant_smart_theme),
|
|
|
|
|
|
|
|
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_conformant_smart_content_aliases_get),
|
|
|
|
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);
|
2010-01-08 10:00:33 -08:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
static const Eo_Op_Description op_desc[] = {
|
|
|
|
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_CONFORMANT_BASE_ID, op_desc, ELM_OBJ_CONFORMANT_SUB_ID_LAST),
|
|
|
|
NULL,
|
|
|
|
sizeof(Elm_Conformant_Smart_Data),
|
|
|
|
_class_constructor,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
EO_DEFINE_CLASS(elm_obj_conformant_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
|