AC_PREREQ([2.68])
AC_INIT([ico-uxf-weston-plugin],
- [0.7.01],
+ [0.7.03],
[https://BUG-REPORT-ADDRESS])
AC_CONFIG_HEADERS([config.h])
+* Tue Aug 27 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> submit/tizen/20130823.164747@50fc72f
+- 0.7.03 release
+-- A correction with version up of weston(1.2.0->1.2.1).
+-- The implementation of the application screen acquisition interface for thumbnail indication by HomeScreen.
+
* Wed Aug 21 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/2.0alpha-wayland/20130612.174820@6b54175
+- 0.7.02 release
- Fix spec file.
-- Correct package BuildRequires fields to address build errors.
-- Corrected package group tags based on Tizen packaging guidelines.
Name: ico-uxf-weston-plugin
Summary: Weston Plugins for IVI
-Version: 0.7.02
-Release: 1.1
+Version: 0.7.03
+Release: 1.2
Group: Graphics & UI Framework/Automotive UI
License: MIT
URL: ""
Source0: %{name}-%{version}.tar.bz2
-BuildRequires: pkgconfig(weston) >= 1.2
+BuildRequires: pkgconfig(weston) >= 1.2.1
BuildRequires: pkgconfig(pixman-1)
BuildRequires: pkgconfig(xkbcommon) >= 0.0.578
BuildRequires: pkgconfig(eina)
BuildRequires: mesa-devel
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(ecore)
-Requires: weston >= 1.2
+Requires: weston >= 1.2.1
%description
Weston Plugins for IVI
%{_includedir}/%{name}/ico_window_mgr-client-protocol.h
%{_includedir}/%{name}/ico_input_mgr.h
%{_libdir}/libico-uxf-weston-plugin.so
-
<arg name="appid" type="string" summary="application Id for input switch"/>
<arg name="surfaceid" type="uint" summary="event surface Id"/>
<arg name="type" type="int" summary="event device type"/>
+ <arg name="deviceno" type="int" summary="device number"/>
<arg name="code" type="int" summary="event code"/>
<arg name="value" type="int" summary="event value"/>
</request>
<description summary="general fixed value for ico_window_mgr">
General values for ico_window_mgr.
</description>
- <entry name="nochange" value="32768" summary="no change value"/>
+ <entry name="nochange" value="0x8000" summary="no change value"/>
</enum>
<enum name="declare_manager">
<entry name="manager" value="1" summary="declare manager"/>
</enum>
- <enum name="layer_attr">
- <description summary="define layer attribute">
- Layer attribute.
- </description>
- <entry name="background" value="1" summary="background layer"/>
- <entry name="normal" value="2" summary="normal layer"/>
- <entry name="cursor" value="4" summary="cursor layer"/>
- <entry name="input" value="8" summary="input layer"/>
- </enum>
-
<enum name="visible">
<description summary="visiblity control">
Surface show/hide control define.
<entry name="raise" value="1" summary="surface raise"/>
</enum>
- <enum name="animation">
- <description summary="with animation or without animation">
- With/Without animation of surface change.
+ <enum name="flags">
+ <description summary="flags for positionsize and visible API">
+ Flags for ico_window_mgr_set_positionsize and ico_window_mgr_set_visible API.
</description>
- <entry name="noanimation" value="0" summary="without animation"/>
- <entry name="animation" value="1" summary="with animation"/>
+ <entry name="animation" value="0x0001" summary="with animation"/>
+ <entry name="no_configure" value="0x0010" summary="no configure event to client"/>
+ </enum>
+
+ <enum name="attr">
+ <description summary="flags for surface attributes">
+ Flags for surface attributes.
+ </description>
+ <entry name="fixed_aspect" value="0x0010" summary="fixed aspect rate"/>
+ <entry name="align_left" value="0x0001" summary="align left side"/>
+ <entry name="align_right" value="0x0002" summary="align right side"/>
+ <entry name="align_top" value="0x0004" summary="align top side"/>
+ <entry name="align_bottom" value="0x0008" summary="align bottom side"/>
</enum>
<enum name="animation_type">
<entry name="resize" value="8" summary="animation for resize surface"/>
</enum>
+ <enum name="map_type">
+ <description summary="map buffer type of mapped surface">
+ Buffer type of mapped surface.
+ </description>
+ <entry name="egl" value="1" summary="EGL buffer"/>
+ <entry name="shm" value="2" summary="wl_shm_buffer"/>
+ </enum>
+
<enum name="map_surface_event">
<description summary="event type of mapped surface change">
Event type of mapped surface change.
</description>
<entry name="contents" value="1" summary="change drawing contents"/>
<entry name="resize" value="2" summary="resize surface"/>
- <entry name="map" value="4" summary="map surface"/>
- <entry name="unmap" value="8" summary="unmap surface"/>
+ <entry name="map" value="4" summary="shared surface"/>
+ <entry name="unmap" value="8" summary="unshared surface"/>
+ <entry name="error" value="16" summary="error"/>
</enum>
<enum name="active">
<arg name="manager" type="int"/>
</request>
- <request name="set_layer_attr">
- <description summary="set layer attribute">
- Create layer Id and set attribute.
- </description>
- <arg name="layer" type="uint"/>
- <arg name="attribute" type="int"/>
- </request>
-
<request name="set_window_layer">
<description summary="set surface layer">
Surface belong to a layer.
<arg name="y" type="int"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
- <arg name="animation" type="int"/>
+ <arg name="flags" type="int"/>
</request>
<request name="set_visible">
<arg name="surfaceid" type="uint"/>
<arg name="visible" type="int"/>
<arg name="raise" type="int"/>
- <arg name="animation" type="int"/>
+ <arg name="flags" type="int"/>
</request>
<request name="set_animation">
<arg name="time" type="int"/>
</request>
+ <request name="set_attributes">
+ <description summary="set surface attributes">
+ Set surface attributes.
+ </description>
+ <arg name="surfaceid" type="uint"/>
+ <arg name="attributes" type="uint"/>
+ </request>
+
+ <request name="visible_animation">
+ <description summary="surface visibility control with animation">
+ Show/Hide surface with Animation.
+ </description>
+ <arg name="surfaceid" type="uint"/>
+ <arg name="visible" type="int"/>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
<request name="set_active">
<description summary="set active surface">
Set active surface.
</request>
<request name="map_surface">
- <description summary="map surfaces to shared memory">
- Map surfaces to shared memory.
+ <description summary="shared surfaces to system application">
+ Shared surfaces to system application(ex.HomeScreen).
</description>
<arg name="surfaceid" type="uint"/>
- <arg name="mapname" type="string"/>
<arg name="framerate" type="int"/>
</request>
<request name="unmap_surface">
- <description summary="unmap surfaces to shared memory">
- Unmap surfaces to shared memory.
+ <description summary="unshared surfaces">
+ Unshared surfaces.
</description>
<arg name="surfaceid" type="uint"/>
</request>
</event>
<event name="map_surface">
- <description summary="event of reply of map_surface request">
- Reply of map_surface request.
+ <description summary="event of shared surface">
+ Event of shared surface.
</description>
<arg name="event" type="int"/>
<arg name="surfaceid" type="uint"/>
+ <arg name="type" type="uint"/>
+ <arg name="target" type="uint"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="stride" type="int"/>
- <arg name="format" type="int"/>
+ <arg name="format" type="uint"/>
</event>
</interface>
[ivi-display]
displayno=1,0
+[ivi-layer]
+# default layer id
+default=1
+# layer id at the time of the system startup
+startup=101
+# input layer id
+input=101
+# cursor layer id
+cursor=102
+
[ivi-animation]
# default animation
default=fade
};
/* prototype of static function */
-/* bind input manager form manager(ex.HomeScreen) */
+ /* bind input manager form manager */
static void ico_control_bind(struct wl_client *client, void *data,
uint32_t version, uint32_t id);
-/* unbind input manager form manager(ex.HomeScreen) */
+ /* unbind input manager form manager */
static void ico_control_unbind(struct wl_resource *resource);
-/* bind input manager form input controller */
+ /* bind input manager form input controller*/
static void ico_device_bind(struct wl_client *client, void *data,
uint32_t version, uint32_t id);
-/* unbind input manager form input controller */
+ /* unbind input manager form input controller*/
static void ico_device_unbind(struct wl_resource *resource);
-/* bind input manager (form application) */
+ /* bind input manager(form application) */
static void ico_exinput_bind(struct wl_client *client, void *data,
uint32_t version, uint32_t id);
-/* unbind input manager (form application) */
+ /* unbind input manager(form application)*/
static void ico_exinput_unbind(struct wl_resource *resource);
-/* find ictl manager by device name */
+ /* find ictl manager by device name */
static struct ico_ictl_mgr *find_ictlmgr_by_device(const char *device);
-/* find ictl input switch by input Id */
+ /* find ictl input switch by input Id */
static struct ico_ictl_input *find_ictlinput_by_input(struct ico_ictl_mgr *pIctlMgr,
const int32_t input);
-/* find app manager by application Id */
+ /* find app manager by application Id */
static struct ico_app_mgr *find_app_by_appid(const char *appid);
-/* add input event to application */
+ /* add input event to application */
static void ico_mgr_add_input_app(struct wl_client *client, struct wl_resource *resource,
const char *appid, const char *device, int32_t input,
int32_t fix, int32_t keycode);
-/* delete input event to application */
+ /* delete input event to application */
static void ico_mgr_del_input_app(struct wl_client *client, struct wl_resource *resource,
const char *appid, const char *device, int32_t input);
-/* create and regist Input Controller table */
+ /* send input event from manager */
+static void ico_mgr_send_input_event(struct wl_client *client, struct wl_resource *resource,
+ const char *appid, uint32_t surfaceid, int32_t type,
+ int32_t deviceno, int32_t code, int32_t value);
+ /* create and regist Input Controller table*/
static void ico_device_configure_input(struct wl_client *client,
struct wl_resource *resource, const char *device,
int32_t type, const char *swname, int32_t input,
const char *codename, int32_t code);
-/* add input to from Input Controller table */
+ /* add input to from Input Controller table*/
static void ico_device_configure_code(struct wl_client *client,
struct wl_resource *resource, const char *device,
int32_t input, const char *codename, int32_t code);
-/* device input event */
+ /* device input event */
static void ico_device_input_event(struct wl_client *client, struct wl_resource *resource,
uint32_t time, const char *device,
int32_t input, int32_t code, int32_t state);
-/* definition of Wayland protocol */
-/* mgr interface */
+/* definition of Wayland protocol */
+/* mgr interface */
static const struct ico_input_mgr_control_interface ico_input_mgr_implementation = {
ico_mgr_add_input_app,
ico_mgr_del_input_app,
+ ico_mgr_send_input_event
};
/* Input Controller interface */
/*--------------------------------------------------------------------------*/
/**
+ * @brief ico_mgr_send_input_event: send input event from manager
+ *
+ * @param[in] client client(HomeScreen)
+ * @param[in] resource resource of request
+ * @param[in] appid target application id
+ * @param[in] surfaceid target surface id
+ * @param[in] type event device type
+ * @param[in] deviceno device number
+ * @param[in] code event code
+ * @param[in] value event value
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+ico_mgr_send_input_event(struct wl_client *client, struct wl_resource *resource,
+ const char *appid, uint32_t surfaceid, int32_t type,
+ int32_t deviceno, int32_t code, int32_t value)
+{
+ uifw_trace("ico_mgr_send_input_event: Enter(app=%s surf=%08x dev=%d code=%x value=%d)",
+ appid ? appid : "(NULL)", surfaceid, deviceno, code, value);
+
+ uifw_trace("ico_mgr_send_input_event: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief ico_device_configure_input: configure input device and input switch
* from Device Input Controller.
*
#define ICO_IVI_MAX_COORDINATE (16383) /* Maximum X or Y coordinate */
/* Fixed value */
-#define ICO_IVI_DEFAULT_LAYER (0) /* Default layerId for surface creation */
#ifndef TRUE
#define TRUE 1
#endif
struct weston_pointer_grab grab;
struct shell_surface *shsurf;
struct wl_listener shsurf_destroy_listener;
- struct weston_pointer *pointer;
+};
+
+struct shell_touch_grab {
+ struct weston_touch_grab grab;
+ struct shell_surface *shsurf;
+ struct wl_listener shsurf_destroy_listener;
+ struct weston_touch *touch;
};
struct weston_move_grab {
wl_fixed_t dx, dy;
};
+struct weston_touch_move_grab {
+ struct shell_touch_grab base;
+ wl_fixed_t dx, dy;
+};
+
struct rotate_grab {
struct shell_grab base;
struct weston_matrix rotation;
static struct desktop_shell *_ico_ivi_shell = NULL;
/* shell program path for ico-ivi */
static char *shell_exe = NULL;
-static int ico_debug_level = 3; /* Debug Level */
+#define DEFAULT_DEBUG_LEVEL 4
+static int ico_debug_level = DEFAULT_DEBUG_LEVEL; /* Debug Level */
/* debug log macros */
#define uifw_trace(fmt,...) \
static void (*shell_hook_destroy)(struct weston_surface *surface) = NULL;
static void (*shell_hook_map)(struct weston_surface *surface, int32_t *width,
int32_t *height, int32_t *sx, int32_t *sy) = NULL;
-static void (*shell_hook_change)(struct weston_surface *surface, const int to,
- const int manager) = NULL;
+static void (*shell_hook_configure)(struct weston_surface *surface) = NULL;
static void (*shell_hook_select)(struct weston_surface *surface) = NULL;
static void (*shell_hook_title)(struct weston_surface *surface, const char *title) = NULL;
static void (*shell_hook_move)(struct weston_surface *surface, int *dx, int *dy) = NULL;
wl_signal_add(&shsurf->destroy_signal,
&grab->shsurf_destroy_listener);
- grab->pointer = pointer;
-
weston_pointer_start_grab(pointer, &grab->grab);
if (shell->child.desktop_shell) {
desktop_shell_send_grab_cursor(shell->child.desktop_shell,
if (grab->shsurf)
wl_list_remove(&grab->shsurf_destroy_listener.link);
- weston_pointer_end_grab(grab->pointer);
+ weston_pointer_end_grab(grab->grab.pointer);
+}
+
+static void
+shell_touch_grab_start(struct shell_touch_grab *grab,
+ const struct weston_touch_grab_interface *interface,
+ struct shell_surface *shsurf,
+ struct weston_touch *touch)
+{
+ struct desktop_shell *shell = shsurf->shell;
+
+ grab->grab.interface = interface;
+ grab->shsurf = shsurf;
+ grab->shsurf_destroy_listener.notify = destroy_shell_grab_shsurf;
+ wl_signal_add(&shsurf->destroy_signal,
+ &grab->shsurf_destroy_listener);
+
+ grab->touch = touch;
+
+ weston_touch_start_grab(touch, &grab->grab);
+ if (shell->child.desktop_shell)
+ weston_touch_set_focus(touch->seat, shell->grab_surface);
+}
+
+static void
+shell_touch_grab_end(struct shell_touch_grab *grab)
+{
+ if (grab->shsurf)
+ wl_list_remove(&grab->shsurf_destroy_listener.link);
+
+ weston_touch_end_grab(grab->touch);
}
static void
/* get debug level for ivi debug */
section = weston_config_get_section(shell->compositor->config, "ivi-debug", NULL, NULL);
if (section) {
- weston_config_section_get_int(section, "log", &ico_debug_level, 3);
+ weston_config_section_get_int(section, "log",
+ &ico_debug_level, DEFAULT_DEBUG_LEVEL);
}
}
}
static void
+touch_move_grab_down(struct weston_touch_grab *grab, uint32_t time,
+ int touch_id, wl_fixed_t sx, wl_fixed_t sy)
+{
+}
+
+static void
+touch_move_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id)
+{
+ struct shell_touch_grab *shell_grab = container_of(grab,
+ struct shell_touch_grab,
+ grab);
+ shell_touch_grab_end(shell_grab);
+}
+
+static void
+touch_move_grab_motion(struct weston_touch_grab *grab, uint32_t time,
+ int touch_id, wl_fixed_t sx, wl_fixed_t sy)
+{
+ struct weston_touch_move_grab *move = (struct weston_touch_move_grab *) grab;
+ struct shell_surface *shsurf = move->base.shsurf;
+ struct weston_surface *es;
+ int dx = wl_fixed_to_int(grab->touch->grab_x + move->dx);
+ int dy = wl_fixed_to_int(grab->touch->grab_y + move->dy);
+
+ if (!shsurf)
+ return;
+
+ es = shsurf->surface;
+
+ weston_surface_configure(es, dx, dy,
+ es->geometry.width, es->geometry.height);
+
+ weston_compositor_schedule_repaint(es->compositor);
+}
+
+static const struct weston_touch_grab_interface touch_move_grab_interface = {
+ touch_move_grab_down,
+ touch_move_grab_up,
+ touch_move_grab_motion,
+};
+
+static int
+surface_touch_move(struct shell_surface *shsurf, struct weston_seat *seat)
+{
+ struct weston_touch_move_grab *move;
+
+ if (!shsurf)
+ return -1;
+
+ if (shsurf->type == SHELL_SURFACE_FULLSCREEN)
+ return 0;
+
+ move = malloc(sizeof *move);
+ if (!move)
+ return -1;
+
+ move->dx = wl_fixed_from_double(shsurf->surface->geometry.x) -
+ seat->touch->grab_x;
+ move->dy = wl_fixed_from_double(shsurf->surface->geometry.y) -
+ seat->touch->grab_y;
+
+ shell_touch_grab_start(&move->base, &touch_move_grab_interface, shsurf,
+ seat->touch);
+
+ return 0;
+}
+
+static void
noop_grab_focus(struct weston_pointer_grab *grab)
{
}
es = shsurf->surface;
- uifw_trace("move_grab_motion: configure %08x x/y=%d/%d w/h=%d/%d",
- (int)es, (int)dx, (int)dy, es->geometry.width, es->geometry.height);
-
/* ico-ivi-shell hook move */
if (shell_hook_move) {
(*shell_hook_move)(shsurf->surface, &dx, &dy);
struct weston_surface *surface;
surface = weston_surface_get_main_surface(seat->pointer->focus);
- if (seat->pointer->button_count == 0 ||
- seat->pointer->grab_serial != serial ||
- surface != shsurf->surface)
- return;
-
- if (surface_move(shsurf, seat) < 0)
- wl_resource_post_no_memory(resource);
+ if (seat->pointer->button_count > 0 && seat->pointer->grab_serial == serial) {
+ surface = weston_surface_get_main_surface(seat->pointer->focus);
+ if ((surface == shsurf->surface) &&
+ (surface_move(shsurf, seat) < 0))
+ wl_resource_post_no_memory(resource);
+ } else if (seat->touch->grab_serial == serial) {
+ surface = weston_surface_get_main_surface(seat->touch->focus);
+ if ((surface == shsurf->surface) &&
+ (surface_touch_move(shsurf, seat) < 0))
+ wl_resource_post_no_memory(resource);
+ }
}
struct weston_resize_grab {
wl_list_insert(&layer->surface_list, &es->layer_link);
weston_compositor_schedule_repaint(es->compositor);
}
+
+ /* if ico_window_mgr hook, call hook routine */
+ if (shell_hook_configure) {
+ (*shell_hook_configure)(es);
+ }
}
static void
struct weston_surface *focus;
struct weston_surface *main_surface;
- focus = (struct weston_surface *) seat->pointer->focus;
+ if (button == BTN_LEFT)
+ focus = (struct weston_surface *) seat->pointer->focus;
+ else
+ focus = (struct weston_surface *) seat->touch->focus;
if (!focus)
return;
if (shell_hook_map) {
(*shell_hook_map)(surface, &width, &height, &sx, &sy);
}
- if (shell_hook_change) {
- (*shell_hook_change)(surface, -1, 0); /* send event to manager */
+ if (shell_hook_configure) {
+ (*shell_hook_configure)(surface); /* send event to manager */
}
}
}
/* if ico_window_mgr hook, call hook routine */
- if (shell_hook_change) {
- (*shell_hook_change)(surface, -1, 0);
+ if (shell_hook_configure) {
+ (*shell_hook_configure)(surface);
}
}
shell->child.deathcount++;
if (shell->child.deathcount > 5) {
- weston_log("%s, giving up.\n", shell_exe);
+ weston_log("%s died, giving up.\n", shell_exe);
return;
}
weston_compositor_add_button_binding(ec, BTN_LEFT, 0,
click_to_activate_binding,
shell);
+ weston_compositor_add_button_binding(ec, BTN_TOUCH, 0,
+ click_to_activate_binding,
+ shell);
weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL,
MODIFIER_SUPER | MODIFIER_ALT,
surface_opacity_binding, NULL);
/*--------------------------------------------------------------------------*/
/**
- * @brief ico_ivi_shell_hook_change: regist hook function for change shell surface
+ * @brief ico_ivi_shell_hook_configure: regist hook function for configure shell surface
*
- * @param[in] hook_change hook function(if NULL, reset hook function)
+ * @param[in] hook_configure hook function(if NULL, reset hook function)
* @return none
*/
/*--------------------------------------------------------------------------*/
WL_EXPORT void
-ico_ivi_shell_hook_change(void (*hook_change)(struct weston_surface *surface,
- const int to, const int manager))
+ico_ivi_shell_hook_configure(void (*hook_configure)(struct weston_surface *surface))
{
- shell_hook_change = hook_change;
+ shell_hook_configure = hook_configure;
}
/*--------------------------------------------------------------------------*/
void ico_ivi_shell_hook_destroy(void (*hook_destroy)(struct weston_surface *surface));
void ico_ivi_shell_hook_map(void (*hook_map)(struct weston_surface *surface,
int32_t *width, int32_t *height, int32_t *sx, int32_t *sy));
-void ico_ivi_shell_hook_change(void (*hook_change)(struct weston_surface *surface,
- const int to, const int manager));
+void ico_ivi_shell_hook_configure(void (*hook_configure)(struct weston_surface *surface));
void ico_ivi_shell_hook_select(void (*hook_select)(struct weston_surface *surface));
void ico_ivi_shell_hook_title(void (*hook_title)(struct weston_surface *surface,
const char *title));
/* animation data */
struct animation_data {
struct animation_data *next_free; /* free data list */
- int x; /* original X coordinate */
- int y; /* original Y coordinate */
- int width; /* original width */
- int height; /* original height */
- char geometry_saved; /* need geometry restore at end */
char transform_set; /* need transform reset at end */
- char res[2]; /* (unused) */
+ char res[3]; /* (unused) */
struct weston_transform transform; /* transform matrix */
void (*end_function)(struct weston_animation *animation);
/* animation end function */
/* static valiables */
static struct weston_compositor *weston_ec; /* Weston compositor */
static char *default_animation; /* default animation name */
-static int animation_time; /* animation time(ms) */
-static int animation_fpar; /* animation frame parcent(%) */
+static int animation_fps; /* animation frame rate(frame/sec) */
+static int animation_time; /* default animation time(ms) */
static struct animation_data *free_data; /* free data list */
/* static function */
struct weston_output *output, uint32_t msecs);
/* fade animation end */
static void animation_fade_end(struct weston_animation *animation);
+ /* zoom animation */
+static void animation_zoom(struct weston_animation *animation,
+ struct weston_output *output, uint32_t msecs);
+ /* zoom animation end */
+static void animation_zoom_end(struct weston_animation *animation);
/* continue animation */
static int animation_cont(struct weston_animation *animation,
struct weston_output *output, uint32_t msecs);
* @param[in] data data
* @return result
* @retval ICO_WINDOW_MGR_ANIMATION_RET_ANIMA success
- * @retval ICO_WINDOW_MGR_ANIMATION_RET_ANIMASHOW success(force visible)
+ * @retval ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL success(no control)
* @retval ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA error(no animation)
*/
/*--------------------------------------------------------------------------*/
struct weston_output *output;
int ret;
uint32_t nowsec;
- struct timeval nowtv;
- int time;
- int name;
+ int animaid;
if (op == ICO_WINDOW_MGR_ANIMATION_NAME) {
/* convert animation name to animation type value */
uifw_trace("ico_window_animation: Type %s(%d)", (char *)data, ANIMA_SLIDE_TORIGHT);
return ANIMA_SLIDE_TORIGHT;
}
- else if (strcasecmp((char *)data, "slide.totop") == 0) {
+ else if ((strcasecmp((char *)data, "slide.totop") == 0) ||
+ (strcasecmp((char *)data, "slide") == 0)) {
uifw_trace("ico_window_animation: Type %s(%d)", (char *)data, ANIMA_SLIDE_TOTOP);
return ANIMA_SLIDE_TOTOP;
}
uifw_trace("ico_window_animation: Destroy %08x", (int)usurf);
animation_end(usurf, 0);
}
- return ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA;
+ return ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
}
+ usurf->animation.visible = ANIMA_NOCONTROL_AT_END;
+
if (op == ICO_WINDOW_MGR_ANIMATION_OPCANCEL) {
/* cancel animation */
if ((usurf->animation.state != ICO_WINDOW_MGR_ANIMATION_STATE_NONE) &&
(usurf->animation.current > 95)) {
usurf->animation.animation.frame_counter = 1;
usurf->animation.current = 0;
+ usurf->animation.ahalf = 0;
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_NONE) {
wl_list_init(&usurf->animation.animation.link);
output = container_of(weston_ec->output_list.next,
}
}
else if (((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) &&
- (op == ICO_WINDOW_MGR_ANIMATION_OPHIDE)) ||
+ ((op == ICO_WINDOW_MGR_ANIMATION_OPHIDE) ||
+ (op == ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS))) ||
((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_HIDE) &&
- (op == ICO_WINDOW_MGR_ANIMATION_OPSHOW))) {
+ ((op == ICO_WINDOW_MGR_ANIMATION_OPSHOW) ||
+ (op == ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS)))) {
/* change ...In(ex.FadeIn) to ...Out(FadeOut) or ...Out to ...In */
- gettimeofday(&nowtv, NULL);
- nowsec = (uint32_t)(((long long)nowtv.tv_sec) * 1000L +
- ((long long)nowtv.tv_usec) / 1000L);
+ nowsec = weston_compositor_get_time();
usurf->animation.current = 100 - usurf->animation.current;
- if (op == ICO_WINDOW_MGR_ANIMATION_OPHIDE) {
- time = usurf->animation.hide_time;
+ if ((op == ICO_WINDOW_MGR_ANIMATION_OPHIDE)||
+ (op == ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS)) {
+ usurf->animation.time = usurf->animation.hide_time;
}
else {
- time = usurf->animation.show_time;
+ usurf->animation.time = usurf->animation.show_time;
}
- time = (time > 0) ? time : animation_time;
- ret = ((usurf->animation.current) * time) / 100;
+ if (usurf->animation.time == 0) {
+ usurf->animation.time = animation_time;
+ }
+ ret = ((usurf->animation.current) * usurf->animation.time) / 100;
if (nowsec >= (uint32_t)ret) {
usurf->animation.starttime = nowsec - ret;
}
}
/* set animation function */
- if (op == ICO_WINDOW_MGR_ANIMATION_OPSHOW) {
+ if ((op == ICO_WINDOW_MGR_ANIMATION_OPSHOW) ||
+ (op == ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS)) {
usurf->animation.state = ICO_WINDOW_MGR_ANIMATION_STATE_SHOW;
- name = usurf->animation.show_name;
- usurf->animation.name = name;
+ animaid = usurf->animation.show_anima;
+ usurf->animation.anima = animaid;
uifw_trace("ico_window_animation: show(in) %s.%08x anima=%d",
- usurf->uclient->appid, usurf->surfaceid, name);
+ usurf->uclient->appid, usurf->surfaceid, animaid);
ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
}
- else if (op == ICO_WINDOW_MGR_ANIMATION_OPHIDE) {
+ else if ((op == ICO_WINDOW_MGR_ANIMATION_OPHIDE) ||
+ (op == ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS)) {
usurf->animation.state = ICO_WINDOW_MGR_ANIMATION_STATE_HIDE;
- name = usurf->animation.hide_name;
- usurf->animation.name = name;
+ animaid = usurf->animation.hide_anima;
+ usurf->animation.anima = animaid;
uifw_trace("ico_window_animation: hide(out) %s.%08x anima=%d",
- usurf->uclient->appid, usurf->surfaceid, name);
- ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMASHOW;
+ usurf->uclient->appid, usurf->surfaceid, animaid);
+ ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL;
+ usurf->animation.visible = ANIMA_HIDE_AT_END;
}
else if (op == ICO_WINDOW_MGR_ANIMATION_OPMOVE) {
usurf->animation.state = ICO_WINDOW_MGR_ANIMATION_STATE_MOVE;
- name = usurf->animation.move_name;
- usurf->animation.name = name;
+ animaid = usurf->animation.move_anima;
+ usurf->animation.anima = animaid;
uifw_trace("ico_window_animation: move %s.%08x anima=%d",
- usurf->uclient->appid, usurf->surfaceid, name);
- ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
+ usurf->uclient->appid, usurf->surfaceid, animaid);
+ ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL;
}
- else {
+ else if (op == ICO_WINDOW_MGR_ANIMATION_OPRESIZE) {
usurf->animation.state = ICO_WINDOW_MGR_ANIMATION_STATE_RESIZE;
- name = usurf->animation.resize_name;
- usurf->animation.name = name;
+ animaid = usurf->animation.resize_anima;
+ usurf->animation.anima = animaid;
uifw_trace("ico_window_animation: resize %s.%08x anima=%d",
- usurf->uclient->appid, usurf->surfaceid, name);
- ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
+ usurf->uclient->appid, usurf->surfaceid, animaid);
+ ret = ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL;
}
- if ((name == ANIMA_SLIDE_TOLEFT) || (name == ANIMA_SLIDE_TORIGHT) ||
- (name == ANIMA_SLIDE_TOTOP) || (name == ANIMA_SLIDE_TOBOTTOM)) {
+ else {
+ uifw_trace("ico_window_animation: Op=%d unknown", op);
+ return ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA;
+ }
+ if ((animaid == ANIMA_SLIDE_TOLEFT) || (animaid == ANIMA_SLIDE_TORIGHT) ||
+ (animaid == ANIMA_SLIDE_TOTOP) || (animaid == ANIMA_SLIDE_TOBOTTOM)) {
usurf->animation.animation.frame = animation_slide;
usurf->restrain_configure = 1;
(*usurf->animation.animation.frame)(&usurf->animation.animation, NULL, 1);
}
- else if (name == ANIMA_FADE) {
+ else if (animaid == ANIMA_FADE) {
usurf->animation.animation.frame = animation_fade;
+ usurf->restrain_configure = 1;
+ (*usurf->animation.animation.frame)(&usurf->animation.animation, NULL, 1);
+ }
+ else if (animaid == ANIMA_ZOOM) {
+ usurf->animation.animation.frame = animation_zoom;
+ usurf->restrain_configure = 1;
(*usurf->animation.animation.frame)(&usurf->animation.animation, NULL, 1);
}
else {
usurf->animation.animation.frame = NULL;
usurf->animation.state = ICO_WINDOW_MGR_ANIMATION_STATE_NONE;
usurf->restrain_configure = 0;
- usurf->animation.name = 0;
+ usurf->animation.anima = 0;
wl_list_remove(&usurf->animation.animation.link);
ret = ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA;
}
usurf->animation.type = op;
}
- if (ret == ICO_WINDOW_MGR_ANIMATION_RET_ANIMASHOW) {
- usurf->animation.visible = ANIMA_HIDE_AT_END;
- }
- else {
- usurf->animation.visible = ANIMA_NOCONTROL_AT_END;
- }
weston_compositor_schedule_repaint(weston_ec);
return ret;
}
uint32_t msecs)
{
struct uifw_win_surface *usurf;
- struct animation_data *animadata;
int par;
uint32_t nowsec;
- struct timeval nowtv;
- int time;
- gettimeofday(&nowtv, NULL);
- nowsec = (uint32_t)(((long long)nowtv.tv_sec) * 1000L +
- ((long long)nowtv.tv_usec) / 1000L);
+ nowsec = weston_compositor_get_time();
usurf = container_of(animation, struct uifw_win_surface, animation.animation);
}
memset(usurf->animation.animadata, 0, sizeof(struct animation_data));
}
- animadata = (struct animation_data *)usurf->animation.animadata;
- animadata->x = usurf->x;
- animadata->y = usurf->y;
- animadata->width = usurf->width;
- animadata->height = usurf->height;
- animadata->geometry_saved = 1;
}
else if (! usurf->animation.animadata) {
animation_end(usurf, 0);
}
switch (usurf->animation.state) {
case ICO_WINDOW_MGR_ANIMATION_STATE_SHOW:
- time = usurf->animation.show_time;
+ usurf->animation.time = usurf->animation.show_time;
break;
case ICO_WINDOW_MGR_ANIMATION_STATE_HIDE:
- time = usurf->animation.hide_time;
+ usurf->animation.time = usurf->animation.hide_time;
break;
case ICO_WINDOW_MGR_ANIMATION_STATE_MOVE:
- time = usurf->animation.move_time;
+ usurf->animation.time = usurf->animation.move_time;
break;
default:
- time = usurf->animation.resize_time;
+ usurf->animation.time = usurf->animation.resize_time;
break;
}
- time = (time > 0) ? time : animation_time;
- if (((output == NULL) && (msecs == 0)) || (nowsec >= ((uint32_t)time))) {
+ if (usurf->animation.time == 0) {
+ usurf->animation.time = animation_time;
+ }
+ if (((output == NULL) && (msecs == 0)) || (nowsec >= ((uint32_t)usurf->animation.time))) {
par = 100;
}
else {
- par = (nowsec * 100 + time / 2) / time;
+ par = (nowsec * 100 + usurf->animation.time / 2) / usurf->animation.time;
if (par < 2) par = 2;
}
if ((par >= 100) ||
- (abs(usurf->animation.current - par) >= animation_fpar)) {
+ (abs(usurf->animation.current - par) >=
+ (((1000 * 100) / animation_fps) / usurf->animation.time))) {
usurf->animation.current = par;
return 0;
}
if (animadata->end_function) {
(*animadata->end_function)(&usurf->animation.animation);
}
- if (animadata->geometry_saved > 1) {
- usurf->x = animadata->x;
- usurf->y = animadata->y;
- usurf->width = animadata->width;
- usurf->height = animadata->height;
- animadata->geometry_saved = 0;
- }
wl_list_remove(&usurf->animation.animation.link);
if (animadata->transform_set) {
wl_list_remove(&animadata->transform.link);
weston_compositor_schedule_repaint(weston_ec);
}
usurf->animation.visible = ANIMA_NOCONTROL_AT_END;
- if (usurf->animation.next_name != ICO_WINDOW_MGR_ANIMATION_NONE) {
+ if (usurf->animation.next_anima != ICO_WINDOW_MGR_ANIMATION_NONE) {
switch(usurf->animation.type) {
case ICO_WINDOW_MGR_ANIMATION_OPHIDE:
- usurf->animation.hide_name = usurf->animation.next_name;
+ case ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS:
+ usurf->animation.hide_anima = usurf->animation.next_anima;
break;
case ICO_WINDOW_MGR_ANIMATION_OPSHOW:
- usurf->animation.show_name = usurf->animation.next_name;
+ case ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS:
+ usurf->animation.show_anima = usurf->animation.next_anima;
break;
case ICO_WINDOW_MGR_ANIMATION_OPMOVE:
- usurf->animation.move_name = usurf->animation.next_name;
+ usurf->animation.move_anima = usurf->animation.next_anima;
break;
case ICO_WINDOW_MGR_ANIMATION_OPRESIZE:
- usurf->animation.resize_name = usurf->animation.next_name;
+ usurf->animation.resize_anima = usurf->animation.next_anima;
break;
default:
break;
}
- usurf->animation.next_name = ICO_WINDOW_MGR_ANIMATION_NONE;
+ usurf->animation.next_anima = ICO_WINDOW_MGR_ANIMATION_NONE;
}
if (animadata) {
usurf->animation.animadata = NULL;
struct weston_output *output, uint32_t msecs)
{
struct uifw_win_surface *usurf;
- struct animation_data *animadata;
struct weston_surface *es;
int dwidth, dheight;
int par;
return;
}
par = usurf->animation.current;
- animadata = (struct animation_data *)usurf->animation.animadata;
- uifw_trace("animation_slide: usurf=%08x count=%d %d%% name=%d state=%d",
+ uifw_trace("animation_slide: usurf=%08x count=%d %d%% anima=%d state=%d",
(int)usurf, animation->frame_counter, par,
- usurf->animation.name, usurf->animation.state);
+ usurf->animation.anima, usurf->animation.state);
es = usurf->surface;
x = usurf->x;
y = usurf->y;
- switch (usurf->animation.name) {
+ switch (usurf->animation.anima) {
case ANIMA_SLIDE_TORIGHT: /* slide in left to right */
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
/* slide in left to right */
- x = 0 - animadata->width +
- ((animadata->x + animadata->width) * par / 100);
+ x = 0 - usurf->animation.pos_width +
+ ((usurf->animation.pos_x + usurf->animation.pos_width) * par / 100);
}
else {
/* slide out right to left */
- x = 0 - animadata->width +
- ((animadata->x + animadata->width) * (100 - par) / 100);
+ x = 0 - usurf->animation.pos_width +
+ ((usurf->animation.pos_x + usurf->animation.pos_width) * (100 - par) / 100);
}
break;
case ANIMA_SLIDE_TOLEFT: /* slide in right to left */
struct weston_output, link))->width;
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
/* slide in right to left */
- x = animadata->x + (dwidth - animadata->x) * (100 - par) / 100;
+ x = usurf->animation.pos_x +
+ (dwidth - usurf->animation.pos_x) * (100 - par) / 100;
}
else {
/* slide out left to right */
- x = animadata->x + (dwidth - animadata->x) * par / 100;
+ x = usurf->animation.pos_x + (dwidth - usurf->animation.pos_x) * par / 100;
}
break;
case ANIMA_SLIDE_TOBOTTOM: /* slide in top to bottom */
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
/* slide in top to bottom */
- y = 0 - animadata->height +
- ((animadata->y + animadata->height) * par / 100);
+ y = 0 - usurf->animation.pos_height +
+ ((usurf->animation.pos_y + usurf->animation.pos_height) * par / 100);
}
else {
/* slide out bottom to top */
- y = 0 - animadata->height +
- ((animadata->y + animadata->height) * (100 - par) / 100);
+ y = 0 - usurf->animation.pos_height +
+ ((usurf->animation.pos_y + usurf->animation.pos_height) * (100 - par) / 100);
}
break;
default: /*ANIMA_SLIDE_TOTOP*/ /* slide in bottom to top */
struct weston_output, link))->height;
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
/* slide in bottom to top */
- y = animadata->y + (dheight - animadata->y) * (100 - par) / 100;
+ y = usurf->animation.pos_y +
+ (dheight - usurf->animation.pos_y) * (100 - par) / 100;
}
else {
/* slide out top to bottom */
- y = animadata->y + (dheight - animadata->y) * par / 100;
+ y = usurf->animation.pos_y + (dheight - usurf->animation.pos_y) * par / 100;
}
break;
}
}
if (par >= 100) {
/* end of animation */
- animadata->geometry_saved ++; /* restore geometry */
animation_end(usurf, 1);
uifw_trace("animation_slide: End of animation");
}
&animadata->transform.link);
}
animadata->end_function = animation_fade_end;
- }
- uifw_trace("animation_fade: usurf=%08x count=%d %d%% name=%d state=%d",
- (int)usurf, animation->frame_counter, par,
- usurf->animation.name, usurf->animation.state);
+ if ((usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS) ||
+ (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS)) {
+ ico_window_mgr_set_weston_surface(usurf,
+ usurf->animation.pos_x, usurf->animation.pos_y,
+ usurf->animation.pos_width,
+ usurf->animation.pos_height);
+ }
+ }
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
/* fade in */
- es->alpha = ((double)par) / ((double)100.0);
+ es->alpha = ((float)par) / 100.0f;
}
- else {
+ else if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_HIDE) {
/* fade out */
- es->alpha = ((double)1.0) - (((double)par) / ((double)100.0));
+ es->alpha = 1.0f - (((float)par) / 100.0f);
+ }
+ else {
+ /* fade move/resize */
+ if ((par >= 50) || (usurf->animation.ahalf)) {
+ es->alpha = ((float)(par*2 - 100)) / 100.0f;
+ if (usurf->animation.ahalf == 0) {
+ uifw_trace("animation_fade: fade move chaneg to show");
+ usurf->animation.ahalf = 1;
+ es->alpha = 0.0;
+ ico_window_mgr_set_weston_surface(usurf, usurf->x, usurf->y,
+ usurf->width, usurf->height);
+ ico_window_mgr_change_surface(usurf,
+ usurf->animation.no_configure ? -1 : 0, 1);
+ }
+ }
+ else {
+ es->alpha = 1.0f - (((float)(par*2)) / 100.0f);
+ }
}
if (es->alpha < 0.0) es->alpha = 0.0;
else if (es->alpha > 1.0) es->alpha = 1.0;
+ uifw_trace("animation_fade: usurf=%08x count=%d %d%% alpha=%1.2f anima=%d state=%d",
+ (int)usurf, animation->frame_counter, par, es->alpha,
+ usurf->animation.anima, usurf->animation.state);
+
if ((es->output) && (es->buffer_ref.buffer) &&
(es->geometry.width > 0) && (es->geometry.height > 0)) {
weston_surface_damage(es);
struct weston_surface *es;
usurf = container_of(animation, struct uifw_win_surface, animation.animation);
+ if (usurf && usurf->surface) {
+ es = usurf->surface;
+ es->alpha = 1.0;
+
+ if ((es->output) && (es->buffer_ref.buffer) &&
+ (es->geometry.width > 0) && (es->geometry.height > 0)) {
+ weston_surface_damage(es);
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief animation_zoom: zoom animation
+ *
+ * @param[in] animation weston animation table
+ * @param[in] outout weston output table
+ * @param[in] mseces current time(unused)
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+animation_zoom(struct weston_animation *animation,
+ struct weston_output *output, uint32_t msecs)
+{
+ struct uifw_win_surface *usurf;
+ struct animation_data *animadata;
+ struct weston_surface *es;
+ int par;
+ float scalex, scaley;
+ float fu, fa, fp;
+ int x, y;
+
+ usurf = container_of(animation, struct uifw_win_surface, animation.animation);
+
+ par = animation_cont(animation, output, msecs);
+ if (par > 0) {
+ /* continue animation */
+ if( par <= 100) {
+ weston_compositor_schedule_repaint(weston_ec);
+ }
+ return;
+ }
+
+ animadata = (struct animation_data *)usurf->animation.animadata;
es = usurf->surface;
- es->alpha = 1.0;
+ par = usurf->animation.current;
+ if (animation->frame_counter == 1) {
+ if (animadata->transform_set == 0) {
+ animadata->transform_set = 1;
+ weston_matrix_init(&animadata->transform.matrix);
+ wl_list_init(&animadata->transform.link);
+ wl_list_insert(&es->geometry.transformation_list,
+ &animadata->transform.link);
+ }
+ animadata->end_function = animation_zoom_end;
+
+ if ((usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS) ||
+ (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS)) {
+ ico_window_mgr_set_weston_surface(usurf,
+ usurf->animation.pos_x, usurf->animation.pos_y,
+ usurf->animation.pos_width,
+ usurf->animation.pos_height);
+ }
+ }
+
+ if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
+ /* zoom in */
+ scalex = ((float)par + 5.0f) / 105.0f;
+ scaley = scalex;
+ }
+ else if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_HIDE) {
+ /* zoom out */
+ scalex = 1.0f - (((float)par + 5.0f) / 105.0f);
+ scaley = scalex;
+ }
+ else {
+ /* zoom move/resize */
+ ico_window_mgr_set_weston_surface(usurf, usurf->x, usurf->y,
+ usurf->width, usurf->height);
+ ico_window_mgr_change_surface(usurf, usurf->animation.no_configure ? -1 : 0, 1);
+
+ fu = (float)usurf->width;
+ fa = (float)usurf->animation.pos_width;
+ fp = (100.0f - (float)par) / 100.0f;
+ scalex = (fu - (fu - fa) * fp) / fu;
+ fu = (float)usurf->height;
+ fa = (float)usurf->animation.pos_height;
+ scaley = (fu - (fu - fa) * fp) / fu;
+
+ x = (((float)usurf->animation.pos_x) - ((float)usurf->x)) * fp + (float)usurf->x
+ + (((float)usurf->width * scalex) - (float)usurf->width) / 2.0f;
+ y = (((float)usurf->animation.pos_y) - ((float)usurf->y)) * fp + (float)usurf->y
+ + (((float)usurf->height * scaley) - (float) usurf->height) / 2.0f;
+ uifw_trace("animation_zoom: usurf=%08x %d%% x=%d/%d y=%d/%d",
+ (int)usurf, par, x, usurf->x, y, usurf->y);
+ uifw_trace("animation_zoom: sx=%4.2f sy=%4.2f x=%d->%d y=%d->%d cur=%d,%d",
+ scalex, scaley, usurf->animation.pos_x, usurf->x,
+ usurf->animation.pos_y, usurf->y, x, y);
+ ico_window_mgr_set_weston_surface(usurf, x, y, usurf->width, usurf->height);
+ }
+ weston_matrix_init(&animadata->transform.matrix);
+ weston_matrix_translate(&animadata->transform.matrix,
+ -0.5f * usurf->width, -0.5f * usurf->height, 0);
+ weston_matrix_scale(&animadata->transform.matrix, scalex, scaley, 1.0f);
+ weston_matrix_translate(&animadata->transform.matrix,
+ 0.5f * usurf->width, 0.5f * usurf->height, 0);
+
+ uifw_trace("animation_zoom: usurf=%08x count=%d %d%% w=%d/%d h=%d/%d anima=%d state=%d",
+ (int)usurf, animation->frame_counter, par,
+ (int)(usurf->width * scalex), usurf->width,
+ (int)(usurf->height * scaley), usurf->height,
+ usurf->animation.anima, usurf->animation.state);
if ((es->output) && (es->buffer_ref.buffer) &&
(es->geometry.width > 0) && (es->geometry.height > 0)) {
+ weston_surface_geometry_dirty(es);
weston_surface_damage(es);
}
+ if (par >= 100) {
+ /* end of animation */
+ animation_end(usurf, 1);
+ uifw_trace("animation_zoom: End of animation");
+ }
+ else {
+ /* continue animation */
+ weston_compositor_schedule_repaint(weston_ec);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief animation_zoom_end: zoom animation end
+ *
+ * @param[in] animation weston animation table
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+animation_zoom_end(struct weston_animation *animation)
+{
+ struct uifw_win_surface *usurf;
+ struct weston_surface *es;
+
+ usurf = container_of(animation, struct uifw_win_surface, animation.animation);
+ if (usurf && usurf->surface) {
+ es = usurf->surface;
+ es->alpha = 1.0;
+
+ if ((es->output) && (es->buffer_ref.buffer) &&
+ (es->geometry.width > 0) && (es->geometry.height > 0)) {
+ weston_surface_damage(es);
+ }
+ }
}
/*--------------------------------------------------------------------------*/
weston_ec = ec;
default_animation = (char *)ico_ivi_default_animation_name();
animation_time = ico_ivi_default_animation_time();
- animation_fpar = ico_ivi_default_animation_fps();
-
- animation_fpar = ((1000 * 100) / animation_fpar) / animation_time;
+ animation_fps = ico_ivi_default_animation_fps();
ico_window_mgr_set_hook_animation(ico_window_animation);
#include <aul/aul.h>
#include <bundle.h>
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
#include <weston/compositor.h>
#include "ico_ivi_common.h"
#include "ico_ivi_shell.h"
#define INIT_SURFACE_IDS 1024 /* SurfaceId table initiale size */
#define ADD_SURFACE_IDS 512 /* SurfaceId table additional size */
#define SURCAFE_ID_MASK 0x0ffff /* SurfaceId bit mask pattern */
-#define UIFW_HASH 64 /* Hash value (2's compliment) */
-
-/* Client attribute table */
-#define MAX_CLIENT_ATTR 4
-struct uifw_client_attr {
- char appid[ICO_IVI_APPID_LENGTH]; /* ApplicationId */
- struct _uifw_client_attr_value {
- short attr;
- short res;
- int value;
- } attrs[MAX_CLIENT_ATTR];
- struct wl_list link;
+#define UIFW_HASH 64 /* Hash value (2's compliment) */
+
+/* Internal fixed value */
+ /* map buffer, buffsize bound */
+#define ICO_WINDOW_MGR_BUFBOUND 4096
+ /* show/hide animation with position */
+#define ICO_WINDOW_MGR_ANIMATION_POS 0x10000000
+
+/* wl_drm_buffer (inport from mesa-9.1.3/src/egl/wayland/wayland-drm/wayland-drm.h) */
+struct uifw_wl_buffer {
+ struct wl_resource resource;
+ int32_t width, height;
+ uint32_t busy_count;
+};
+struct uifw_drm_buffer {
+ struct uifw_wl_buffer buffer;
+ void *drm; /* struct wl_drm */
+ uint32_t format;
+ const void *driver_format;
+ int32_t offset[3];
+ int32_t stride[3];
+ void *driver_buffer;
};
-/* Manager table */
-struct uifw_manager {
- struct wl_resource *resource; /* Manager resource */
- int manager; /* Manager(=event send flag) */
- struct wl_list link; /* link to next manager */
+/* __DRIimage (inport from mesa-9.1.3/src/mesa/drivers/dri/intel/intel_regions.h) */
+struct uifw_dri_region {
+ void *bo; /**< buffer manager's buffer */
+ uint32_t refcount; /**< Reference count for region */
+ uint32_t cpp; /**< bytes per pixel */
+ uint32_t width; /**< in pixels */
+ uint32_t height; /**< in pixels */
+ uint32_t pitch; /**< in bytes */
+ char *map; /**< only non-NULL when region is actually mapped */
+ uint32_t map_refcount; /**< Reference count for mapping */
+ uint32_t tiling; /**< Which tiling mode the region is in */
+ uint32_t name; /**< Global name for the bo */
+ void *screen; /* screen */
+};
+struct uifw_dri_image {
+ struct uifw_dri_region *region;
+ int internal_format;
+ uint32_t dri_format;
+ uint32_t format;
+ uint32_t offset;
+ uint32_t strides[3];
+ uint32_t offsets[3];
+ void *planar_format; /* image_format */
+ void *data;
+};
+
+/* gl_surface_state (inport from weston-1.2.1/src/gl-renderer.c) */
+enum buffer_type {
+ BUFFER_TYPE_NULL,
+ BUFFER_TYPE_SHM,
+ BUFFER_TYPE_EGL
+};
+struct uifw_gl_surface_state {
+ GLfloat color[4];
+ struct gl_shader *shader;
+
+ GLuint textures[3];
+ int num_textures;
+ int needs_full_upload;
+ pixman_region32_t texture_damage;
+
+ void *images[3]; /* EGLImageKHR */
+ GLenum target;
+ int num_images;
+
+ struct weston_buffer_reference buffer_ref;
+ enum buffer_type buffer_type;
+ int pitch; /* in pixels */
+ int height; /* in pixels */
};
/* Multi Windiw Manager */
struct wl_list manager_list; /* Manager(ex.HomeScreen) list */
int num_manager; /* Number of managers */
struct wl_list ivi_layer_list; /* Layer management table list */
+ struct wl_list map_list; /* surface map list */
+ struct uifw_surface_map *free_maptable; /* free maped surface table list */
+ struct weston_animation map_animation[ICO_IVI_MAX_DISPLAY];
+ /* animation for map check */
struct uifw_win_surface *active_pointer_usurf; /* Active Pointer Surface */
struct uifw_win_surface *active_keyboard_usurf; /* Active Keyboard Surface */
/* function prototype */
/* get surface table from surfece id */
-static struct uifw_win_surface* find_uifw_win_surface_by_id(uint32_t surfaceid);
+static struct uifw_win_surface *find_uifw_win_surface_by_id(uint32_t surfaceid);
/* get surface table from weston surface*/
-static struct uifw_win_surface* find_uifw_win_surface_by_ws(
+static struct uifw_win_surface *find_uifw_win_surface_by_ws(
struct weston_surface *wsurf);
/* get client table from weston client */
-static struct uifw_client* find_client_from_client(struct wl_client* client);
+static struct uifw_client* find_client_from_client(struct wl_client *client);
/* assign new surface id */
static uint32_t generate_id(void);
/* bind shell client */
static void win_mgr_register_surface(
struct wl_client *client, struct wl_resource *resource,
struct weston_surface *surface, struct shell_surface *shsurf);
- /* surface destory */
+ /* surface destroy */
static void win_mgr_destroy_surface(struct weston_surface *surface);
/* map new surface */
static void win_mgr_map_surface(struct weston_surface *surface, int32_t *width,
/* send surface change event to manager */
static void win_mgr_change_surface(struct weston_surface *surface,
const int to, const int manager);
+ /* window manager surface configure */
+static void win_mgr_surface_configure(struct uifw_win_surface *usurf,
+ int x, int y, int width, int height);
+ /* shell surface configure */
+static void win_mgr_shell_configure(struct weston_surface *surface);
/* surface select */
static void win_mgr_select_surface(struct weston_surface *surface);
/* surface set title */
const uint32_t layer);
/* set surface layer */
static void win_mgr_set_layer(struct uifw_win_surface *usurf, const uint32_t layer);
- /* change weston surface */
-static void win_mgr_set_weston_surface(struct uifw_win_surface *usurf);
/* set active surface */
static void win_mgr_set_active(struct uifw_win_surface *usurf, const int target);
/* declare manager */
static void uifw_declare_manager(struct wl_client *client, struct wl_resource *resource,
int manager);
- /* create layer and set attribute */
-static void uifw_create_layer(struct wl_client *client, struct wl_resource *resource,
- uint32_t layer, int32_t attribute);
/* set window layer */
static void uifw_set_window_layer(struct wl_client *client,
struct wl_resource *resource,
/* set surface size and position */
static void uifw_set_positionsize(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid, uint32_t node, int32_t x, int32_t y,
- int32_t width, int32_t height, int32_t animation);
+ int32_t width, int32_t height, int32_t flags);
/* show/hide and raise/lower surface */
static void uifw_set_visible(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid, int32_t visible, int32_t raise,
- int32_t animation);
+ int32_t flag);
/* set surface animation */
static void uifw_set_animation(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid, int32_t type,
const char *animation, int32_t time);
+ /* set surface attributes */
+static void uifw_set_attributes(struct wl_client *client, struct wl_resource *resource,
+ uint32_t surfaceid, uint32_t attributes);
+ /* surface visibility control with animation*/
+static void uifw_visible_animation(struct wl_client *client, struct wl_resource *resource,
+ uint32_t surfaceid, int32_t visible,
+ int32_t x, int32_t y, int32_t width, int32_t height);
/* set active surface (form HomeScreen) */
static void uifw_set_active(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid, int32_t active);
/* get application surfaces */
static void uifw_get_surfaces(struct wl_client *client, struct wl_resource *resource,
const char *appid);
- /* map surface buffer to shared memory */
+ /* check and change all mapped surface */
+static void win_mgr_check_surfacemap(struct weston_animation *animation,
+ struct weston_output *output, uint32_t msecs);
+ /* check and change mapped surface */
+static void win_mgr_change_mapsurface(struct uifw_surface_map *sm, int event);
+ /* map surface to system application */
static void uifw_map_surface(struct wl_client *client, struct wl_resource *resource,
- uint32_t surfaceid, const char *mapname, int32_t framerate);
- /* unmap surface buffer */
+ uint32_t surfaceid, int32_t framerate);
+ /* unmap surface */
static void uifw_unmap_surface(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid);
/* bind manager */
static int ico_win_mgr_send_to_mgr(const int event, struct uifw_win_surface *usurf,
const int param1, const int param2, const int param3,
const int param4, const int param5);
+ /* set surface transform */
+static int win_mgr_set_scale(struct uifw_win_surface *usurf);
/* convert animation name to Id value */
static int ico_get_animation_name(const char *animation);
/* hook for animation */
/* Multi Window Manager interface */
static const struct ico_window_mgr_interface ico_window_mgr_implementation = {
uifw_declare_manager,
- uifw_create_layer,
uifw_set_window_layer,
uifw_set_positionsize,
uifw_set_visible,
uifw_set_animation,
+ uifw_set_attributes,
+ uifw_visible_animation,
uifw_set_active,
uifw_set_layer_visible,
uifw_get_surfaces,
static int _ico_ivi_debug_flag = 0; /* Debug flags */
static int _ico_ivi_debug_level = 3; /* Debug Level */
static char *_ico_ivi_animation_name = NULL; /* Default animation name */
-static int _ico_ivi_animation_time = 500; /* Default animation time */
+static int _ico_ivi_animation_time = 600; /* Default animation time */
static int _ico_ivi_animation_fps = 15; /* Animation frame rate */
+static int _ico_ivi_default_layer = 1; /* Deafult layer id at surface create*/
+static int _ico_ivi_startup_layer = 101; /* Deafult layer id at system startup*/
+static int _ico_ivi_cursor_layer = 102; /* Cursor layer id */
/* static management table */
static struct ico_win_mgr *_ico_win_mgr = NULL;
/*--------------------------------------------------------------------------*/
/**
+ * @brief ico_window_mgr_set_weston_surface: set weston surface
+ *
+ * @param[in] usurf UIFW surface
+ * @param[in] x X coordinate on screen
+ * @param[in] y Y coordinate on screen
+ * @param[in] width width
+ * @param[in] height height
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+WL_EXPORT void
+ico_window_mgr_set_weston_surface(struct uifw_win_surface *usurf,
+ int x, int y, int width, int height)
+{
+ struct weston_surface *es = usurf->surface;
+ int buf_width, buf_height;
+
+ if (es == NULL) {
+ uifw_trace("ico_window_mgr_set_weston_surface: usurf(%08x) has no surface",
+ (int)usurf);
+ return;
+ }
+
+ if (es->buffer_ref.buffer != NULL) {
+ buf_width = weston_surface_buffer_width(es);
+ buf_height = weston_surface_buffer_height(es);
+ if ((width <= 0) || (height <= 0)) {
+ width = buf_width;
+ usurf->width = buf_width;
+ height = buf_height;
+ usurf->height = buf_height;
+ }
+ if (usurf->width > buf_width) {
+ width = buf_width;
+ x += (usurf->width - buf_width)/2;
+ }
+ if (usurf->height > buf_height) {
+ height = buf_height;
+ y += (usurf->height - buf_height)/2;
+ }
+ if (usurf->visible) {
+ x += usurf->node_tbl->disp_x;
+ y += usurf->node_tbl->disp_y;
+ }
+ else {
+ x = ICO_IVI_MAX_COORDINATE+1;
+ y = ICO_IVI_MAX_COORDINATE+1;
+ }
+ if ((es->geometry.x != x) || (es->geometry.y != y) ||
+ (es->geometry.width != width) || (es->geometry.height != height)) {
+ weston_surface_damage_below(es);
+ win_mgr_surface_configure(usurf, x, y, width, height);
+ }
+ weston_surface_damage(es);
+ weston_compositor_schedule_repaint(_ico_win_mgr->compositor);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief ico_window_mgr_set_weston_surface: set weston surface
+ *
+ * @param[in] usurf UIFW surface
+ * @param[in] x X coordinate on screen
+ * @param[in] y Y coordinate on screen
+ * @param[in] width width
+ * @param[in] height height
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+WL_EXPORT void
+ico_window_mgr_change_surface(struct uifw_win_surface *usurf,
+ const int to, const int manager)
+{
+ uifw_trace("ico_window_mgr_change_surface: Enter(%08x,%d,%d)",
+ usurf->surfaceid, to, manager);
+ win_mgr_change_surface(usurf->surface, to, manager);
+ uifw_trace("ico_window_mgr_change_surface: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief find_uifw_win_surface_by_id: find UIFW surface by surface id
*
* @param[in] surfaceid UIFW surface id
* @retval NULL error(surface id dose not exist)
*/
/*--------------------------------------------------------------------------*/
-static struct uifw_win_surface*
+static struct uifw_win_surface *
find_uifw_win_surface_by_id(uint32_t surfaceid)
{
- struct uifw_win_surface* usurf;
+ struct uifw_win_surface *usurf;
usurf = _ico_win_mgr->idhash[MAKE_IDHASH(surfaceid)];
* @retval NULL error(surface dose not exist)
*/
/*--------------------------------------------------------------------------*/
-static struct uifw_win_surface*
+static struct uifw_win_surface *
find_uifw_win_surface_by_ws(struct weston_surface *wsurf)
{
- struct uifw_win_surface* usurf;
+ struct uifw_win_surface *usurf;
usurf = _ico_win_mgr->wshash[MAKE_WSHASH(wsurf)];
*/
/*--------------------------------------------------------------------------*/
static struct uifw_client*
-find_client_from_client(struct wl_client* client)
+find_client_from_client(struct wl_client *client)
{
struct uifw_client *uclient;
int j;
char procpath[128];
- uifw_trace("win_mgr_bind_client: Enter(client=%08x, sjell=%08x)",
+ uifw_trace("win_mgr_bind_client: Enter(client=%08x, shell=%08x)",
(int)client, (int)shell);
/* save shell table address */
if (pid > 0) {
uclient->pid = (int)pid;
/* get applicationId from AppCore(AUL) */
- if (aul_app_get_appid_bypid(uclient->pid, uclient->appid, ICO_IVI_APPID_LENGTH)
- == AUL_R_OK) {
- uifw_trace("win_mgr_bind_client: client=%08x pid=%d appid=<%s>",
- (int)client, uclient->pid, uclient->appid);
- }
- else {
+ memset(uclient->appid, 0, ICO_IVI_APPID_LENGTH);
+ aul_app_get_appid_bypid(uclient->pid, uclient->appid, ICO_IVI_APPID_LENGTH);
+ uifw_trace("win_mgr_bind_client: client=%08x pid=%d appid=<%s>",
+ (int)client, uclient->pid, uclient->appid);
+ if (uclient->appid[0] == 0) {
/* client dose not exist in AppCore, search Linux process table */
uifw_trace("win_mgr_bind_client: pid=%d dose not exist in AppCore(AUL)",
uclient->pid);
}
close(fd);
}
+ for (i = strlen(uclient->appid)-1; i >= 0; i--) {
+ if (uclient->appid[i] != ' ') break;
+ }
+ uclient->appid[i+1] = 0;
if (uclient->appid[0]) {
uifw_trace("win_mgr_bind_client: client=%08x pid=%d appid=<%s> from "
"Process table", (int)client, uclient->pid, uclient->appid);
usurf->node_tbl = &_ico_node_table[0]; /* set default node table (display no=0) */
wl_list_init(&usurf->ivi_layer);
wl_list_init(&usurf->animation.animation.link);
- usurf->animation.hide_name = ico_get_animation_name(ico_ivi_default_animation_name());
+ wl_list_init(&usurf->surf_map);
+ usurf->animation.hide_anima = ico_get_animation_name(ico_ivi_default_animation_name());
usurf->animation.hide_time = ico_ivi_default_animation_time();;
- usurf->animation.show_name = usurf->animation.hide_name;
+ usurf->animation.show_anima = usurf->animation.hide_anima;
usurf->animation.show_time = usurf->animation.hide_time;
- usurf->animation.move_name = usurf->animation.hide_name;
+ usurf->animation.move_anima = usurf->animation.hide_anima;
usurf->animation.move_time = usurf->animation.hide_time;
- usurf->animation.resize_name = usurf->animation.hide_name;
+ usurf->animation.resize_anima = usurf->animation.hide_anima;
usurf->animation.resize_time = usurf->animation.hide_time;
if ((_ico_win_mgr->num_manager <= 0) ||
_ico_win_mgr->wshash[hash] = usurf;
}
/* set default layer id */
- win_mgr_set_layer(usurf, ICO_IVI_DEFAULT_LAYER);
-
+ win_mgr_set_layer(usurf, (_ico_win_mgr->num_manager > 0) ? _ico_ivi_default_layer :
+ _ico_ivi_startup_layer);
uifw_trace("win_mgr_register_surface: Leave(surfaceId=%08x)", usurf->surfaceid);
}
usurf->visible);
*width = usurf->width;
*height = usurf->height;
- weston_surface_configure(surface, usurf->node_tbl->disp_x + usurf->x,
- usurf->node_tbl->disp_y + usurf->y,
- usurf->width, usurf->height);
+ win_mgr_surface_configure(usurf, usurf->node_tbl->disp_x + usurf->x,
+ usurf->node_tbl->disp_y + usurf->y,
+ usurf->width, usurf->height);
}
else {
uifw_trace("win_mgr_map_surface: HomeScreen not regist Surface, "
if (_ico_win_mgr->num_manager > 0) {
/* HomeScreen exist, coodinate set by HomeScreen */
if (usurf->visible) {
- weston_surface_configure(surface, usurf->node_tbl->disp_x + usurf->x,
- usurf->node_tbl->disp_y + usurf->y,
- usurf->width, usurf->height);
+ win_mgr_surface_configure(usurf, usurf->node_tbl->disp_x + usurf->x,
+ usurf->node_tbl->disp_y + usurf->y,
+ usurf->width, usurf->height);
}
else {
- weston_surface_configure(surface, ICO_IVI_MAX_COORDINATE+1,
- ICO_IVI_MAX_COORDINATE+1,
- usurf->width, usurf->height);
+ win_mgr_surface_configure(usurf, ICO_IVI_MAX_COORDINATE+1,
+ ICO_IVI_MAX_COORDINATE+1,
+ usurf->width, usurf->height);
}
uifw_trace("win_mgr_map_surface: Change size/position x/y=%d/%d w/h=%d/%d",
(int)surface->geometry.x, (int)surface->geometry.y,
else {
new_y = (float)es->y;
}
- new_x += es->node_tbl->disp_x;
- new_y += es->node_tbl->disp_y;
+ new_x += es->node_tbl->disp_x + es->xadd;
+ new_y += es->node_tbl->disp_y + es->yadd;
num_visible ++;
}
else {
weston_surface_set_position(es->surface, (float)new_x, (float)new_y);
weston_surface_damage(es->surface);
}
+#if 0 /* too many debug log */
uifw_trace("win_mgr_restack_ivi_layer: %08x x/y=%d/%d w/h=%d/%d",
es->surfaceid,
(int)es->surface->geometry.x, (int)es->surface->geometry.y,
es->surface->geometry.width, es->surface->geometry.height);
+#endif
}
}
}
memset(new_el, 0, sizeof(struct uifw_win_layer));
new_el->layer = layer;
- new_el->attribute = ICO_WINDOW_MGR_LAYER_ATTR_NORMAL;
new_el->visible = TRUE;
wl_list_init(&new_el->surface_list);
wl_list_init(&new_el->link);
(int)client, manager);
uclient = find_client_from_client(client);
- if (uclient) {
- uclient->manager = manager;
+ if (! uclient) {
+ uifw_trace("uifw_declare_manager: Leave(unknown client=%08x)", (int)client);
+ return;
}
+ uclient->manager = manager;
+
/* client set to manager */
_ico_win_mgr->num_manager = 0;
wl_list_for_each (mgr, &_ico_win_mgr->manager_list, link) {
/*--------------------------------------------------------------------------*/
/**
- * @brief uifw_create_layer: create layer Id and set attribute
- *
- * @param[in] client Weyland client
- * @param[in] resource resource of request
- * @param[in] layer layer id
- * @param[in] attribute layer attribute
- * @return none
- */
-/*--------------------------------------------------------------------------*/
-static void
-uifw_create_layer(struct wl_client *client, struct wl_resource *resource,
- uint32_t layer, int32_t attribute)
-{
- uifw_trace("uifw_create_layer: Enter(layer=%x,attr=%x)", layer, attribute);
- uifw_trace("uifw_create_layer: Leave");
-}
-
-/*--------------------------------------------------------------------------*/
-/**
* @brief uifw_set_window_layer: set layer id to surface
*
* @param[in] client Weyland client
if (usurf->win_layer->layer != layer) {
win_mgr_set_layer(usurf, layer);
- win_mgr_change_surface(usurf->surface, 1, 1);
+ win_mgr_change_surface(usurf->surface, -1, 1);
}
uifw_trace("uifw_set_window_layer: Leave");
}
/*--------------------------------------------------------------------------*/
/**
- * @brief win_mgr_set_weston_surface: set weston surface from UIFW surface
- *
- * @param[in] usurf UIFW surface
- * @return none
- */
-/*--------------------------------------------------------------------------*/
-static void
-win_mgr_set_weston_surface(struct uifw_win_surface *usurf)
-{
- struct weston_surface *es = usurf->surface;
- int buf_width, buf_height;
- int width;
- int height;
- int x;
- int y;
-
- if (es == NULL) {
- uifw_trace("win_mgr_set_weston_surface: usurf(%08x) has no surface", (int)usurf);
- return;
- }
-
- if (es->buffer_ref.buffer != NULL) {
- buf_width = weston_surface_buffer_width(es);
- buf_height = weston_surface_buffer_height(es);
- width = usurf->width;
- height = usurf->height;
- x = usurf->x;
- y = usurf->y;
- if ((width <= 0) || (height <= 0)) {
- width = buf_width;
- usurf->width = buf_width;
- height = buf_height;
- usurf->height = buf_height;
- }
- if (usurf->width > buf_width) {
- width = buf_width;
- x += (usurf->width - buf_width)/2;
- }
- if (usurf->height > buf_height) {
- height = buf_height;
- y += (usurf->height - buf_height)/2;
- }
- if (usurf->visible) {
- x += usurf->node_tbl->disp_x;
- y += usurf->node_tbl->disp_y;
- }
- else {
- x = ICO_IVI_MAX_COORDINATE+1;
- y = ICO_IVI_MAX_COORDINATE+1;
- }
- if ((es->geometry.x != x) || (es->geometry.y != y) ||
- (es->geometry.width != width) || (es->geometry.height != height)) {
- weston_surface_damage_below(es);
- weston_surface_configure(es, x, y, width, height);
- }
- weston_surface_damage(es);
- weston_compositor_schedule_repaint(_ico_win_mgr->compositor);
- }
-}
-
-/*--------------------------------------------------------------------------*/
-/**
* @brief uifw_set_positionsize: set surface position and size
*
* @param[in] client Weyland client
* @param[in] y Y coordinate on screen(if bigger than 16383, no change)
* @param[in] width surface width(if bigger than 16383, no change)
* @param[in] height surface height(if bigger than 16383, no change)
- * @param[in] animation with/without animation
+ * @param[in] flags with/without animation and client configure flag
* @return none
*/
/*--------------------------------------------------------------------------*/
static void
uifw_set_positionsize(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid, uint32_t node, int32_t x, int32_t y,
- int32_t width, int32_t height, int32_t animation)
+ int32_t width, int32_t height, int32_t flags)
{
struct uifw_client *uclient;
struct weston_surface *es;
- int cx, cy, cwidth, cheight;
+ int op;
+ int retanima;
- uifw_trace("uifw_set_positionsize: Enter surf=%08x node=%x x/y/w/h=%d/%d/%d/%d anim=%d",
- surfaceid, node, x, y, width, height, animation);
+ uifw_trace("uifw_set_positionsize: Enter surf=%08x node=%x x/y/w/h=%d/%d/%d/%d flag=%x",
+ surfaceid, node, x, y, width, height, flags);
if (((int)node) >= _ico_num_nodes) {
uifw_trace("uifw_set_positionsize: node=%d dose not exist(max=%d)",
node, _ico_num_nodes);
node = 0;
}
- struct uifw_win_surface* usurf = find_uifw_win_surface_by_id(surfaceid);
+ struct uifw_win_surface *usurf = find_uifw_win_surface_by_id(surfaceid);
if (usurf && (usurf->surface)) {
/* weston surface exist */
usurf->node_tbl = &_ico_node_table[node];
es = usurf->surface;
+ retanima = ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA;
/* if x,y,width,height bigger then ICO_IVI_MAX_COORDINATE, no change */
- cx = usurf->x;
- cy = usurf->y;
- cwidth = usurf->width;
- cheight = usurf->height;
- if (x > ICO_IVI_MAX_COORDINATE) x = cx;
- if (y > ICO_IVI_MAX_COORDINATE) y = cy;
- if (width > ICO_IVI_MAX_COORDINATE) width = cwidth;
- if (height > ICO_IVI_MAX_COORDINATE) height = cheight;
+ if (x > ICO_IVI_MAX_COORDINATE) x = usurf->x;
+ if (y > ICO_IVI_MAX_COORDINATE) y = usurf->y;
+ if (width > ICO_IVI_MAX_COORDINATE) width = usurf->width;
+ if (height > ICO_IVI_MAX_COORDINATE) height = usurf->height;
/* check animation */
if ((usurf->animation.restrain_configure != 0) &&
(int)es->geometry.x, (int)es->geometry.y,
(int)es->geometry.width, (int)es->geometry.height);
+ usurf->animation.pos_x = usurf->x;
+ usurf->animation.pos_y = usurf->y;
+ usurf->animation.pos_width = usurf->width;
+ usurf->animation.pos_height = usurf->height;
+ usurf->animation.no_configure = (flags & ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE) ? 1 : 0;
usurf->x = x;
usurf->y = y;
usurf->width = width;
uifw_trace("uifw_set_positionsize: Fixed Geometry, Change(Vis=%d)",
usurf->visible);
if (usurf->visible) {
- win_mgr_set_weston_surface(usurf);
+ if ((flags & ICO_WINDOW_MGR_FLAGS_ANIMATION) &&
+ (win_mgr_hook_animation != NULL)) {
+ /* with animation */
+ if ((x != (usurf->surface->geometry.x - usurf->node_tbl->disp_x)) ||
+ (y != (usurf->surface->geometry.y - usurf->node_tbl->disp_y))) {
+ op = ICO_WINDOW_MGR_ANIMATION_OPMOVE;
+ }
+ else if ((width != usurf->surface->geometry.width) ||
+ (height != usurf->surface->geometry.height)) {
+ op = ICO_WINDOW_MGR_ANIMATION_OPRESIZE;
+ }
+ else {
+ op = ICO_WINDOW_MGR_ANIMATION_OPNONE;
+ }
+ if (((op == ICO_WINDOW_MGR_ANIMATION_OPMOVE) &&
+ (usurf->animation.move_anima != ICO_WINDOW_MGR_ANIMATION_NONE)) ||
+ ((op == ICO_WINDOW_MGR_ANIMATION_OPRESIZE) &&
+ (usurf->animation.resize_anima != ICO_WINDOW_MGR_ANIMATION_NONE))) {
+ retanima = (*win_mgr_hook_animation)(op, (void *)usurf);
+ uifw_trace("uifw_set_positionsize: ret call anima = %d", retanima);
+ }
+ }
+ if ((retanima == ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA) ||
+ (retanima != ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL)) {
+ ico_window_mgr_set_weston_surface(usurf, usurf->x, usurf->y,
+ usurf->width, usurf->height);
+ }
}
}
- win_mgr_change_surface(es, 0, 1);
-
+ if ((retanima == ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA) ||
+ (retanima != ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL)) {
+ win_mgr_change_surface(es,
+ (flags & ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE) ? -1 : 0, 1);
+ }
uifw_trace("uifw_set_positionsize: Leave(OK,output=%08x)", (int)es->output);
}
else {
* @param[in] surfaceid UIFW surface id
* @param[in] visible visible(1=show/0=hide/other=no change)
* @param[in] raise raise(1=raise/0=lower/other=no change)
- * @param[in] animation with/without animation
+ * @param[in] flags with/without animation
* @return none
*/
/*--------------------------------------------------------------------------*/
static void
uifw_set_visible(struct wl_client *client, struct wl_resource *resource,
- uint32_t surfaceid, int32_t visible, int32_t raise, int32_t animation)
+ uint32_t surfaceid, int32_t visible, int32_t raise, int32_t flags)
{
- struct uifw_win_surface* usurf;
+ struct uifw_win_surface *usurf;
struct uifw_client *uclient;
int restack;
- int retanim;
+ int retanima;
- uifw_trace("uifw_set_visible: Enter(surf=%08x,%d,%d,%d)",
- surfaceid, visible, raise, animation);
+ uifw_trace("uifw_set_visible: Enter(surf=%08x,%d,%d,%x)",
+ surfaceid, visible, raise, flags);
uclient = find_client_from_client(client);
if (uclient) {
(int)usurf->surface, usurf->node_tbl->node, usurf->x, usurf->y,
usurf->width, usurf->height);
ico_ivi_shell_set_surface_type(usurf->shsurf);
- win_mgr_set_weston_surface(usurf);
+ ico_window_mgr_set_weston_surface(usurf, usurf->x, usurf->y,
+ usurf->width, usurf->height);
restack = 1; /* need damage */
- if ((animation == ICO_WINDOW_MGR_ANIMATION_ANIMATION) &&
- (usurf->animation.show_name != ICO_WINDOW_MGR_ANIMATION_NONE) &&
+ if ((flags & (ICO_WINDOW_MGR_ANIMATION_POS|ICO_WINDOW_MGR_FLAGS_ANIMATION)) &&
+ (usurf->animation.show_anima != ICO_WINDOW_MGR_ANIMATION_NONE) &&
(win_mgr_hook_animation != NULL)) {
- retanim = (*win_mgr_hook_animation)(ICO_WINDOW_MGR_ANIMATION_OPSHOW,
- (void *)usurf);
- uifw_trace("uifw_set_visible: ret call animation = %d", retanim);
+ usurf->animation.pos_x = usurf->x;
+ usurf->animation.pos_y = usurf->y;
+ usurf->animation.pos_width = usurf->width;
+ usurf->animation.pos_height = usurf->height;
+ usurf->animation.no_configure = 0;
+ retanima = (*win_mgr_hook_animation)(
+ (flags & ICO_WINDOW_MGR_ANIMATION_POS) ?
+ ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS :
+ ICO_WINDOW_MGR_ANIMATION_OPSHOW,
+ (void *)usurf);
+ uifw_trace("uifw_set_visible: ret call anima = %d", retanima);
}
}
else if ((raise != ICO_WINDOW_MGR_RAISE_LOWER) &&
/* Weston surface configure */
weston_surface_damage_below(usurf->surface);
- win_mgr_set_weston_surface(usurf);
+ ico_window_mgr_set_weston_surface(usurf, usurf->x, usurf->y,
+ usurf->width, usurf->height);
- retanim = ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
- if ((animation == ICO_WINDOW_MGR_ANIMATION_ANIMATION) &&
- (usurf->animation.hide_name != ICO_WINDOW_MGR_ANIMATION_NONE) &&
+ retanima = ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
+ if ((flags & (ICO_WINDOW_MGR_FLAGS_ANIMATION|ICO_WINDOW_MGR_ANIMATION_POS)) &&
+ (usurf->animation.hide_anima != ICO_WINDOW_MGR_ANIMATION_NONE) &&
(win_mgr_hook_animation != NULL)) {
- retanim = (*win_mgr_hook_animation)(ICO_WINDOW_MGR_ANIMATION_OPHIDE,
- (void *)usurf);
+ usurf->animation.pos_x = usurf->x;
+ usurf->animation.pos_y = usurf->y;
+ usurf->animation.pos_width = usurf->width;
+ usurf->animation.pos_height = usurf->height;
+ usurf->animation.no_configure = 0;
+ retanima = (*win_mgr_hook_animation)(
+ (flags & ICO_WINDOW_MGR_ANIMATION_POS) ?
+ ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS :
+ ICO_WINDOW_MGR_ANIMATION_OPHIDE,
+ (void *)usurf);
}
- if (retanim != ICO_WINDOW_MGR_ANIMATION_RET_ANIMASHOW) {
+ if (retanima != ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL) {
usurf->visible = 0;
uifw_trace("uifw_set_visible: Change to UnVisible");
/* change visible to unvisible, restack surface list */
restack = 1;
/* Weston surface configure */
- win_mgr_set_weston_surface(usurf);
+ ico_window_mgr_set_weston_surface(usurf, usurf->x, usurf->y,
+ usurf->width, usurf->height);
}
else {
uifw_trace("uifw_set_visible: UnVisible but animation");
uint32_t surfaceid, int32_t type, const char *animation, int32_t time)
{
int animaid;
- struct uifw_win_surface* usurf = find_uifw_win_surface_by_id(surfaceid);
+ struct uifw_win_surface *usurf = find_uifw_win_surface_by_id(surfaceid);
uifw_trace("uifw_set_transition: Enter(surf=%08x,type=%x,anim=%s,time=%d)",
surfaceid, type, animation, time);
animaid = ico_get_animation_name(animation);
uifw_trace("uifw_set_animation: Leave(OK) type=%d", animaid);
if (type & ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE) {
- if (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPHIDE) {
- usurf->animation.next_name = animaid;
+ if ((usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPHIDE) ||
+ (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS)) {
+ usurf->animation.next_anima = animaid;
}
else {
- usurf->animation.hide_name = animaid;
+ usurf->animation.hide_anima = animaid;
}
}
if (type & ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW) {
- if (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPSHOW) {
- usurf->animation.next_name = animaid;
+ if ((usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPSHOW) ||
+ (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS)) {
+ usurf->animation.next_anima = animaid;
}
else {
- usurf->animation.show_name = animaid;
+ usurf->animation.show_anima = animaid;
}
}
if (type & ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE) {
if (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPMOVE) {
- usurf->animation.next_name = animaid;
+ usurf->animation.next_anima = animaid;
}
else {
- usurf->animation.move_name = animaid;
+ usurf->animation.move_anima = animaid;
}
}
if (type & ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE) {
if (usurf->animation.type == ICO_WINDOW_MGR_ANIMATION_OPRESIZE) {
- usurf->animation.next_name = animaid;
+ usurf->animation.next_anima = animaid;
}
else {
- usurf->animation.resize_name = animaid;
+ usurf->animation.resize_anima = animaid;
}
}
}
/*--------------------------------------------------------------------------*/
/**
+ * @brief uifw_set_attributes: set surface attributes
+ *
+ * @param[in] client Weyland client
+ * @param[in] resource resource of request
+ * @param[in] surfaceid UIFW surface id
+ * @param[in] attributes surface attributes
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+uifw_set_attributes(struct wl_client *client, struct wl_resource *resource,
+ uint32_t surfaceid, uint32_t attributes)
+{
+ struct uifw_win_surface *usurf = find_uifw_win_surface_by_id(surfaceid);
+
+ uifw_trace("uifw_set_attributes: Enter(surf=%08x,attributes=%x)", surfaceid, attributes);
+
+ if (usurf) {
+ usurf->attributes = attributes;
+ if ((attributes & (ICO_WINDOW_MGR_ATTR_ALIGN_LEFT|ICO_WINDOW_MGR_ATTR_ALIGN_RIGHT)) ==
+ (ICO_WINDOW_MGR_ATTR_ALIGN_LEFT|ICO_WINDOW_MGR_ATTR_ALIGN_RIGHT)) {
+ usurf->attributes &=
+ ~(ICO_WINDOW_MGR_ATTR_ALIGN_LEFT|ICO_WINDOW_MGR_ATTR_ALIGN_RIGHT);
+ }
+ if ((attributes & (ICO_WINDOW_MGR_ATTR_ALIGN_TOP|ICO_WINDOW_MGR_ATTR_ALIGN_BOTTOM)) ==
+ (ICO_WINDOW_MGR_ATTR_ALIGN_TOP|ICO_WINDOW_MGR_ATTR_ALIGN_BOTTOM)) {
+ usurf->attributes &=
+ ~(ICO_WINDOW_MGR_ATTR_ALIGN_TOP|ICO_WINDOW_MGR_ATTR_ALIGN_BOTTOM);
+ }
+ }
+ uifw_trace("uifw_set_attributes: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief uifw_visible_animation: surface visibility control with animation
+ *
+ * @param[in] client Weyland client
+ * @param[in] resource resource of request
+ * @param[in] surfaceid surface id
+ * @param[in] visible visible(1=show/0=hide)
+ * @param[in] x X coordinate on screen(if bigger than 16383, no change)
+ * @param[in] y Y coordinate on screen(if bigger than 16383, no change)
+ * @param[in] width surface width(if bigger than 16383, no change)
+ * @param[in] height surface height(if bigger than 16383, no change)
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+uifw_visible_animation(struct wl_client *client, struct wl_resource *resource,
+ uint32_t surfaceid, int32_t visible,
+ int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ struct uifw_win_surface *usurf;
+
+ uifw_trace("uifw_visible_animation: Enter(%08x,%d,x/y=%d/%d,w/h=%d/%d)",
+ surfaceid, visible, x, y, width, height);
+
+ usurf = find_uifw_win_surface_by_id(surfaceid);
+
+ if ((! usurf) || (! usurf->surface)) {
+ uifw_trace("uifw_visible_animation: Leave(Surface Not Exist)");
+ return;
+ }
+
+ usurf->animation.pos_x = x;
+ usurf->animation.pos_y = y;
+ if (width > 0) usurf->animation.pos_width = width;
+ else usurf->animation.pos_width = 1;
+ if (height > 0) usurf->animation.pos_height = height;
+ else usurf->animation.pos_height = 1;
+ usurf->animation.no_configure = 0;
+
+ uifw_set_visible(client, resource, surfaceid, visible,
+ ICO_WINDOW_MGR_V_NOCHANGE, ICO_WINDOW_MGR_ANIMATION_POS);
+
+ uifw_trace("uifw_visible_animation: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief uifw_set_active: set active surface
*
* @param[in] client Weyland client
uifw_set_active(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid, int32_t active)
{
- struct uifw_win_surface* usurf;
+ struct uifw_win_surface *usurf;
uifw_trace("uifw_set_active: Enter(surf=%08x,active=%x)", surfaceid, active);
static void
uifw_get_surfaces(struct wl_client *client, struct wl_resource *resource, const char *appid)
{
+ struct uifw_client *uclient;
+ struct uifw_win_layer *el;
+ struct uifw_win_surface *usurf;
+ struct wl_array reply;
+ uint32_t *up;
+
uifw_trace("uifw_get_surfaces: Enter(appid=%s)", appid);
+
+ wl_array_init(&reply);
+
+ wl_list_for_each (uclient, &_ico_win_mgr->client_list, link) {
+ if (strcmp(uclient->appid, appid) == 0) break;
+ }
+ if (&uclient->link == &_ico_win_mgr->client_list) {
+ uifw_trace("uifw_get_surfaces: appid=%s dose not exist", appid);
+ }
+ else {
+ wl_list_for_each (el, &_ico_win_mgr->ivi_layer_list, link) {
+ wl_list_for_each (usurf, &el->surface_list, ivi_layer) {
+ if (usurf->uclient == uclient) {
+ uifw_trace("uifw_get_surfaces: %s surf=%08x", appid, usurf->surfaceid);
+ up = (uint32_t *)wl_array_add(&reply, sizeof(uint32_t));
+ if (up) {
+ *up = usurf->surfaceid;
+ }
+ }
+ }
+ }
+ }
+ ico_window_mgr_send_app_surfaces(resource, appid, &reply);
+
+ wl_array_release(&reply);
uifw_trace("uifw_get_surfaces: Leave");
}
/*--------------------------------------------------------------------------*/
/**
- * @brief uifw_map_surface: map surface buffer to shared memory
+ * @brief win_mgr_check_surfacemap: check and change all surface
+ *
+ * @param[in] animation weston animation table(unused)
+ * @param[in] outout weston output table
+ * @param[in] mseces current time(unused)
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+win_mgr_check_surfacemap(struct weston_animation *animation,
+ struct weston_output *output, uint32_t msecs)
+{
+ struct uifw_surface_map *sm;
+
+ wl_list_for_each(sm, &_ico_win_mgr->map_list, map_link) {
+ if (sm->usurf->surface->output == output) {
+ win_mgr_change_mapsurface(sm, 0);
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief win_mgr_change_mapsurface: check and change mapped surface
+ *
+ * @param[in] sm map surface table
+ * @param[in] event send event (if 0, send if changed)
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+win_mgr_change_mapsurface(struct uifw_surface_map *sm, int event)
+{
+ struct uifw_drm_buffer *drm_buffer;
+ struct uifw_dri_image *dri_image;
+ struct uifw_dri_region *dri_region;
+ struct uifw_gl_surface_state *gl_state;
+ struct weston_surface *es;
+ uint32_t eglname = 0;
+ int width;
+ int height;
+ int stride;
+ uint32_t format;
+
+ /* check if buffered */
+ es = sm->usurf->surface;
+ if ((es == NULL) || (es->buffer_ref.buffer == NULL) ||
+ (es->buffer_ref.buffer->width <= 0) || (es->buffer_ref.buffer->height <= 0) ||
+ (es->buffer_ref.buffer->legacy_buffer == NULL) || (es->renderer_state == NULL) ||
+ (((struct uifw_drm_buffer *)es->buffer_ref.buffer->legacy_buffer)->driver_buffer
+ == NULL)) {
+ /* surface has no buffer, error */
+ uifw_trace("win_mgr_change_mapsurface: surface(%08x) has no buffer",
+ sm->usurf->surfaceid);
+ sm->width = 0;
+ sm->height = 0;
+ sm->stride = 0;
+ sm->eglname = 0;
+ sm->format = 0;
+ if (sm->initflag) {
+ event = ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP;
+ }
+ else {
+ event = 0;
+ }
+ }
+ else {
+ gl_state = (struct uifw_gl_surface_state *)es->renderer_state;
+ if (gl_state->buffer_type == BUFFER_TYPE_SHM) {
+ event = ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR;
+ }
+ else if (gl_state->buffer_type != BUFFER_TYPE_EGL) {
+ event = 0;
+ }
+ else {
+ drm_buffer = (struct uifw_drm_buffer *)es->buffer_ref.buffer->legacy_buffer;
+ dri_image = (struct uifw_dri_image *)drm_buffer->driver_buffer;
+ dri_region = dri_image->region;
+ width = es->buffer_ref.buffer->width;
+ height = es->buffer_ref.buffer->height;
+ stride = drm_buffer->stride[0];
+ if (drm_buffer->format == 0x34325258) {
+ format = EGL_TEXTURE_RGB;
+ }
+ else if (drm_buffer->format == 0x34325241) {
+ format = EGL_TEXTURE_RGBA;
+ }
+ else {
+ /* unknown format, error */
+ format = EGL_NO_TEXTURE;
+ }
+ eglname = dri_region->name;
+
+ if ((sm->initflag == 0) && (width > 0) && (height > 0) && (stride > 0)) {
+ sm->initflag = 1;
+ event = ICO_WINDOW_MGR_MAP_SURFACE_EVENT_MAP;
+ }
+ else {
+ if ((width <= 0) || (height <= 0) || (stride <= 0)) {
+ event = 0;
+ }
+ else if (event == 0) {
+ if ((sm->width != width) || (sm->height != height) ||
+ (sm->stride != stride)) {
+ event = ICO_WINDOW_MGR_MAP_SURFACE_EVENT_RESIZE;
+ }
+ else if ((eglname != sm->eglname) || (format != sm->format)) {
+ event = ICO_WINDOW_MGR_MAP_SURFACE_EVENT_CONTENTS;
+ }
+ }
+ }
+ sm->width = width;
+ sm->height = height;
+ sm->stride = stride;
+ sm->eglname = eglname;
+ sm->format = format;
+ sm->eglname = eglname;
+ }
+ }
+
+ if (event != 0) {
+ uifw_trace("win_mgr_change_mapsurface: send MAP event(ev=%d surf=%08x name=%08x "
+ "w/h/s=%d/%d/%d format=%x",
+ event, sm->usurf->surfaceid, sm->eglname, sm->width, sm->height,
+ sm->stride, sm->format);
+ ico_window_mgr_send_map_surface(sm->uclient->mgr->resource, event,
+ sm->usurf->surfaceid, sm->type, sm->eglname,
+ sm->width, sm->height, sm->stride, sm->format);
+ if (event == ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR) {
+ /* free map table if error */
+ wl_list_remove(&sm->surf_link);
+ wl_list_remove(&sm->map_link);
+ sm->usurf = (struct uifw_win_surface *)_ico_win_mgr->free_maptable;
+ _ico_win_mgr->free_maptable = sm;
+ }
+ }
+ uifw_trace("win_mgr_change_mapsurface: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief uifw_map_surface: mapped surface buffer to system application
*
* @param[in] client Weyland client
* @param[in] resource resource of request
* @param[in] surfaceid surface id
- * @param[in] mapname shared memory map name
- * @param[in] framerate frame rate of shared memory update(frame/sec)
+ * @param[in] framerate frame rate of surface update(frame/sec)
* @return none
*/
/*--------------------------------------------------------------------------*/
static void
uifw_map_surface(struct wl_client *client, struct wl_resource *resource,
- uint32_t surfaceid, const char *mapname, int32_t framerate)
+ uint32_t surfaceid, int32_t framerate)
{
- uifw_trace("uifw_map_surface: Enter(surface=%08x,map=%s,fps=%d)",
- surfaceid, mapname, framerate);
+ struct uifw_win_surface *usurf;
+ struct weston_surface *es;
+ struct uifw_surface_map *sm;
+ struct weston_buffer *buffer;
+ struct uifw_client *uclient;
+ struct uifw_drm_buffer *drm_buffer;
+ struct uifw_gl_surface_state *gl_state;
+
+ uifw_trace("uifw_map_surface: Enter(surface=%08x,fps=%d)", surfaceid, framerate);
+
+ usurf = find_uifw_win_surface_by_id(surfaceid);
+ if (! usurf) {
+ /* surface dose not exist, error */
+ ico_window_mgr_send_map_surface(resource, ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR,
+ surfaceid, 1, 0, 0, 0, 0, 0);
+ uifw_trace("uifw_map_surface: Leave(surface=%08x dose not exist)", surfaceid);
+ return;
+ }
+ uclient = find_client_from_client(client);
+ if ((! uclient) || (! uclient->mgr)) {
+ /* client dose not exist, error */
+ ico_window_mgr_send_map_surface(resource, ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR,
+ surfaceid, 2, 0, 0, 0, 0, 0);
+ uifw_trace("uifw_map_surface: Leave(client=%08x dose not exist)", (int)client);
+ return;
+ }
+
+ es = usurf->surface;
+
+ /* check if buffered */
+ if (es == NULL) {
+ /* surface has no buffer, error */
+ ico_window_mgr_send_map_surface(resource, ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR,
+ surfaceid, 3, 0, 0, 0, 0, 0);
+ uifw_trace("uifw_map_surface: Leave(surface(%08x) has no buffer)", surfaceid);
+ return;
+ }
+
+ /* check buffer type */
+ gl_state = (struct uifw_gl_surface_state *)es->renderer_state;
+ if (gl_state) {
+ if (gl_state->buffer_type == BUFFER_TYPE_SHM) {
+ /* wl_shm_buffer not support */
+ ico_window_mgr_send_map_surface(resource, ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR,
+ surfaceid, 4, 0, 0, 0, 0, 0);
+ uifw_trace("uifw_map_surface: Leave(surface(%08x) is wl_shm_buffer, "
+ "not support)", surfaceid);
+ return;
+ }
+ }
+
+ /* create map table */
+ sm = _ico_win_mgr->free_maptable;
+ if (sm) {
+ _ico_win_mgr->free_maptable = (struct uifw_surface_map *)sm->usurf;
+ }
+ else {
+ sm = (struct uifw_surface_map *)malloc(sizeof(struct uifw_surface_map));
+ if (! sm) {
+ ico_window_mgr_send_map_surface(resource, ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR,
+ surfaceid, 5, 0, 0, 0, 0, 0);
+ uifw_trace("uifw_map_surface: Leave(malloc error)");
+ return;
+ }
+ }
+ memset(sm, 0, sizeof(struct uifw_surface_map));
+
+ wl_list_init(&sm->map_link);
+ wl_list_init(&sm->surf_link);
+ sm->usurf = usurf;
+ sm->uclient = uclient;
+ sm->type = ICO_WINDOW_MGR_MAP_TYPE_EGL;
+ sm->eglname = 0;
+ sm->framerate = framerate;
+ wl_list_insert(_ico_win_mgr->map_list.next, &sm->map_link);
+ wl_list_insert(usurf->surf_map.prev, &sm->surf_link);
+
+ buffer = es->buffer_ref.buffer;
+ if ((buffer != NULL) && (gl_state != NULL) &&
+ (gl_state->buffer_type == BUFFER_TYPE_EGL)) {
+ sm->width = buffer->width;
+ sm->height = buffer->height;
+ drm_buffer = (struct uifw_drm_buffer *)buffer->legacy_buffer;
+ if (drm_buffer != NULL) {
+ sm->stride = drm_buffer->stride[0];
+ if (drm_buffer->format == 0x34325258) {
+ sm->format = EGL_TEXTURE_RGB;
+ }
+ else if (drm_buffer->format == 0x34325241) {
+ sm->format = EGL_TEXTURE_RGBA;
+ }
+ else {
+ /* unknown format, error */
+ sm->format = EGL_NO_TEXTURE;
+ }
+ if ((sm->width > 0) && (sm->height > 0) && (sm->stride > 0) &&
+ (gl_state != NULL)) {
+ sm->initflag = 1;
+ }
+ }
+ }
+
+ /* send map event */
+ if (sm->initflag) {
+ win_mgr_change_mapsurface(sm, ICO_WINDOW_MGR_MAP_SURFACE_EVENT_MAP);
+ }
uifw_trace("uifw_map_surface: Leave");
}
/*--------------------------------------------------------------------------*/
/**
- * @brief uifw_unmap_surface: unmap surface buffer to shared memory
+ * @brief uifw_unmap_surface: unmap surface buffer
*
* @param[in] client Weyland client
* @param[in] resource resource of request
uifw_unmap_surface(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid)
{
- uifw_trace("uifw_map_surface: Enter(surface=%08x)", surfaceid);
- uifw_trace("uifw_map_surface: Leave");
+ struct uifw_win_surface *usurf;
+ struct uifw_surface_map *sm, *sm_tmp;
+ struct uifw_client *uclient;
+
+ uifw_trace("uifw_unmap_surface: Enter(surface=%08x)", surfaceid);
+
+ usurf = find_uifw_win_surface_by_id(surfaceid);
+ if (! usurf) {
+ /* surface dose not exist, error */
+ uifw_trace("uifw_unmap_surface: Leave(surface=%08x dose not exist)", surfaceid);
+ return;
+ }
+ if (client) {
+ uclient = find_client_from_client(client);
+ if ((! uclient) || (! uclient->mgr)) {
+ /* client dose not exist, error */
+ uifw_trace("uifw_unmap_surface: Leave(client=%08x dose not exist)", (int)client);
+ return;
+ }
+ }
+ else {
+ uclient = NULL;
+ wl_list_for_each(sm, &usurf->surf_map, surf_link) {
+ if (sm->uclient->mgr != NULL) {
+ uifw_trace("uifw_unmap_surface: send MAP event(ev=%d surf=%08x name=%08x "
+ "w/h/s=%d/%d/%d format=%x",
+ ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP, surfaceid,
+ sm->eglname, sm->width, sm->height, sm->stride, sm->format);
+ ico_window_mgr_send_map_surface(sm->uclient->mgr->resource,
+ ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP,
+ surfaceid, sm->type, sm->eglname, sm->width,
+ sm->height, sm->stride, sm->format);
+ }
+ }
+ }
+
+ wl_list_for_each_safe(sm, sm_tmp, &usurf->surf_map, surf_link) {
+ if (((uclient != NULL) && (sm->uclient != uclient))) continue;
+ /* send unmap event */
+ if ((uclient != NULL) && (uclient->mgr != NULL)) {
+ uifw_trace("uifw_unmap_surface: send MAP event(ev=%d surf=%08x name=%08x "
+ "w/h/s=%d/%d/%d format=%x",
+ ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP, surfaceid,
+ sm->eglname, sm->width, sm->height, sm->stride, sm->format);
+ ico_window_mgr_send_map_surface(uclient->mgr->resource,
+ ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP,
+ surfaceid, sm->type, sm->eglname, sm->width,
+ sm->height, sm->stride, sm->format);
+ }
+ wl_list_remove(&sm->surf_link);
+ wl_list_remove(&sm->map_link);
+ sm->usurf = (struct uifw_win_surface *)_ico_win_mgr->free_maptable;
+ _ico_win_mgr->free_maptable = sm;
+ }
+ uifw_trace("uifw_unmap_surface: Leave");
}
/*--------------------------------------------------------------------------*/
win_mgr_change_surface(struct weston_surface *surface, const int to, const int manager)
{
struct uifw_win_surface *usurf;
+ struct weston_surface *es;
int x;
int y;
+ int repaint = 0;
uifw_trace("win_mgr_change_surface: Enter(%08x,%d,%d)", (int)surface, to, manager);
uifw_trace("win_mgr_change_surface: Leave(Not Exist)");
return;
}
+ es = usurf->surface;
+ if (! es) {
+ uifw_trace("win_mgr_change_surface: Leave(No weston surface)");
+ return;
+ }
/* if not configure surface, set surface size */
- if (((usurf->width <= 0) || (usurf->height <= 0)) && (usurf->surface)) {
+ if ((usurf->width <= 0) || (usurf->height <= 0)) {
uifw_trace("win_mgr_change_surface: set surface x/y=%d/%d=>%d/%d w/h=%d/%d=>%d/%d",
- (int)usurf->surface->geometry.x, (int)usurf->surface->geometry.y,
- usurf->x, usurf->y, usurf->width, usurf->height,
- usurf->surface->geometry.width, usurf->surface->geometry.height);
- usurf->width = usurf->surface->geometry.width;
- usurf->height = usurf->surface->geometry.height;
+ (int)es->geometry.x, (int)es->geometry.y, usurf->x, usurf->y,
+ usurf->width, usurf->height, es->geometry.width, es->geometry.height);
+ usurf->width = es->geometry.width;
+ usurf->height = es->geometry.height;
+ win_mgr_set_scale(usurf);
if (usurf->visible) {
weston_surface_set_position(usurf->surface,
- (float)(usurf->node_tbl->disp_x + usurf->x),
- (float)(usurf->node_tbl->disp_y + usurf->y));
+ (float)(usurf->node_tbl->disp_x +
+ usurf->x + usurf->xadd),
+ (float)(usurf->node_tbl->disp_y +
+ usurf->y + usurf->yadd));
win_mgr_restack_ivi_layer(usurf);
}
else {
/* send wayland event to client */
if ((to >= 0) && (usurf->shsurf != NULL) && (manager !=0) &&
(usurf->width > 0) && (usurf->height > 0)) {
- uifw_trace("win_mgr_change_surface: SHELL_SURFACE_CONFIGURE %08x(%08x),w/h=%d/%d ",
- usurf->surfaceid, (int)usurf->surface, usurf->width, usurf->height);
- ico_ivi_shell_send_configure(usurf->surface,
- WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT,
- usurf->width, usurf->height);
+ if ((usurf->width != usurf->conf_width) ||
+ (usurf->height != usurf->conf_height)) {
+ usurf->conf_width = usurf->width;
+ usurf->conf_height = usurf->height;
+ uifw_trace("win_mgr_change_surface: SURFACE_CONFIGURE %08x(%08x),w/h=%d/%d ",
+ usurf->surfaceid, (int)es, usurf->width, usurf->height);
+ ico_ivi_shell_send_configure(es,
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT,
+ usurf->width, usurf->height);
+ }
}
if (usurf->visible) {
}
/* change geometry if request from manager */
if (manager) {
- if ((usurf->width != usurf->surface->geometry.width) ||
- (usurf->height != usurf->surface->geometry.height) ||
- (usurf->surface->geometry.x != (float)x) ||
- (usurf->surface->geometry.y != (float)y)) {
- weston_surface_configure(usurf->surface, (float)x, (float)y,
- usurf->width, usurf->height);
- weston_compositor_schedule_repaint(_ico_win_mgr->compositor);
+ if ((usurf->width != es->geometry.width) ||
+ (usurf->height != es->geometry.height) ||
+ (es->geometry.x != (float)x) || (es->geometry.y != (float)y)) {
+ win_mgr_surface_configure(usurf, (float)x, (float)y, usurf->width, usurf->height);
+ repaint ++;
}
}
}
else {
ico_win_mgr_send_to_mgr(ICO_WINDOW_MGR_WINDOW_CONFIGURE,
- usurf, (int)usurf->surface->geometry.x,
- (int)usurf->surface->geometry.y,
- usurf->surface->geometry.width,
- usurf->surface->geometry.height, 1);
+ usurf, (int)es->geometry.x, (int)es->geometry.y,
+ es->geometry.width, es->geometry.height, 1);
}
}
/* change geometry if request from client */
if (! manager) {
- if ((usurf->width != usurf->surface->geometry.width) ||
- (usurf->height != usurf->surface->geometry.height) ||
- (usurf->surface->geometry.x != (float)x) ||
- (usurf->surface->geometry.y != (float)y)) {
- weston_surface_configure(usurf->surface, (float)x, (float)y,
- usurf->width, usurf->height);
- weston_compositor_schedule_repaint(_ico_win_mgr->compositor);
+ if ((usurf->width != es->geometry.width) || (usurf->height != es->geometry.height) ||
+ (es->geometry.x != (float)x) || (es->geometry.y != (float)y)) {
+ win_mgr_surface_configure(usurf, x, y, usurf->width, usurf->height);
+ repaint ++;
}
}
+
+ if (repaint) {
+ uifw_trace("win_mgr_change_surface: repaint");
+ weston_compositor_schedule_repaint(_ico_win_mgr->compositor);
+ }
uifw_trace("win_mgr_change_surface: Leave(OK)");
}
/*--------------------------------------------------------------------------*/
/**
+ * @brief win_mgr_surface_configure: UIFW surface configure
+ *
+ * @param[in] usurf UIFW surface
+ * @param[in] x X coordinate on screen
+ * @param[in] y Y coordinate on screen
+ * @param[in] width surface width
+ * @param[in] height surface height
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+win_mgr_surface_configure(struct uifw_win_surface *usurf,
+ int x, int y, int width, int height)
+{
+ struct weston_surface *es;
+
+ es = usurf->surface;
+ if ((es != NULL) && (es->buffer_ref.buffer)) {
+ if (usurf->client_width == 0) {
+ usurf->client_width = es->geometry.width;
+ if (usurf->client_width == 0)
+ usurf->client_width = weston_surface_buffer_width(es);
+ }
+ if (usurf->client_height == 0) {
+ usurf->client_height = es->geometry.height;
+ if (usurf->client_height == 0)
+ usurf->client_height = weston_surface_buffer_height(es);
+ }
+
+ /* not set geometry width/height */
+ win_mgr_set_scale(usurf);
+ weston_surface_set_position(es, x + usurf->xadd, y + usurf->yadd);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief win_mgr_shell_configure: shell surface configure
+ *
+ * @param[in] surface Weston surface
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+win_mgr_shell_configure(struct weston_surface *surface)
+{
+ struct uifw_win_surface *usurf;
+ int buf_width;
+ int buf_height;
+
+ uifw_trace("win_mgr_shell_configure: Enter(%08x)", (int)surface);
+
+ /* Find UIFW surface */
+ usurf = find_uifw_win_surface_by_ws(surface);
+ if (! usurf) {
+ uifw_trace("win_mgr_shell_configure: Leave(Not Exist)");
+ return;
+ }
+
+ usurf->client_width = surface->geometry.width;
+ usurf->client_height = surface->geometry.height;
+ buf_width = weston_surface_buffer_width(surface);
+ buf_height = weston_surface_buffer_height(surface);
+ uifw_trace("win_mgr_shell_configure: %08x client w/h=%d/%d buf=%d/%d",
+ usurf->surfaceid,
+ usurf->client_width, usurf->client_height, buf_width, buf_height);
+ if (usurf->client_width > buf_width) usurf->client_width = buf_width;
+ if (usurf->client_height > buf_height) usurf->client_height = buf_height;
+
+ /* send event to manager */
+ win_mgr_change_surface(surface, -1, 0);
+
+ uifw_trace("win_mgr_shell_configure: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief win_mgr_select_surface: select surface by Bottun/Touch
*
* @param[in] surface Weston surface
}
uifw_trace("win_mgr_destroy_surface: Enter(%08x) %08x", (int)surface, usurf->surfaceid);
+ /* unmap surface */
+ if (&usurf->surf_map != usurf->surf_map.next) {
+ uifw_unmap_surface(NULL, NULL, usurf->surfaceid);
+ }
+
/* destroy active surface */
if (usurf == _ico_win_mgr->active_pointer_usurf) {
_ico_win_mgr->active_pointer_usurf = NULL;
_ico_win_mgr->active_keyboard_usurf = NULL;
}
- /* destory animation extenson */
+ /* destroy animation extenson */
if (win_mgr_hook_animation) {
(*win_mgr_hook_animation)(ICO_WINDOW_MGR_ANIMATION_DESTROY, (void *)usurf);
}
void *data, uint32_t version, uint32_t id)
{
struct wl_resource *add_resource;
- struct uifw_manager *nm;
+ struct uifw_manager *mgr;
struct uifw_client *uclient;
uifw_trace("bind_ico_win_mgr: Enter(client=%08x, id=%x)", (int)client, (int)id);
uclient = find_client_from_client(client);
if (! uclient) {
win_mgr_bind_client(client, NULL);
+ uclient = find_client_from_client(client);
}
/* Manager */
- nm = (struct uifw_manager *)malloc(sizeof(struct uifw_manager));
- memset(nm, 0, sizeof(struct uifw_manager));
- nm->resource = add_resource;
- wl_list_insert(&_ico_win_mgr->manager_list, &nm->link);
+ mgr = (struct uifw_manager *)malloc(sizeof(struct uifw_manager));
+ if (! mgr) {
+ uifw_error("bind_ico_win_mgr: Error, No Memory");
+ return;
+ }
+ memset(mgr, 0, sizeof(struct uifw_manager));
+ mgr->resource = add_resource;
+ if (uclient) {
+ uclient->mgr = mgr;
+ }
+ wl_list_insert(&_ico_win_mgr->manager_list, &mgr->link);
uifw_trace("bind_ico_win_mgr: Leave");
}
ico_window_mgr_send_layer_visible(mgr->resource, (uint32_t)param1, param2);
break;
- case ICO_WINDOW_MGR_MAP_SURFACE:
- uifw_trace("ico_win_mgr_send_to_mgr: Send Manager(%08x) MAP SURFACE"
- "(%08x,ev=%x,w/h/s/f=%d/%d/%d/%x)", (int)mgr->resource,
- usurf->surfaceid,
- param1, param2, param3, param4, param5);
- ico_window_mgr_send_map_surface(mgr->resource, param1, usurf->surfaceid,
- param2, param3, param4, param5);
- break;
-
default:
uifw_error("ico_win_mgr_send_to_mgr: Illegal event(%08x)", event);
break;
/*--------------------------------------------------------------------------*/
/**
+ * @brief win_mgr_set_scale: set surface transform scale
+ *
+ * @param[in] usurf UIFW surface
+ * @return chagne display
+ * @retval =1 change display
+ * @retval =0 no change
+ */
+/*--------------------------------------------------------------------------*/
+static int
+win_mgr_set_scale(struct uifw_win_surface *usurf)
+{
+ struct weston_surface *es;
+ float scalex;
+ float scaley;
+ int ret = 0;
+
+ es = usurf->surface;
+ if ((es != NULL) && (es->buffer_ref.buffer)) {
+ if (usurf->client_width == 0) usurf->client_width = es->geometry.width;
+ if (usurf->client_height == 0) usurf->client_height = es->geometry.height;
+ scalex = (float)usurf->width / (float)usurf->client_width;
+ scaley = (float)usurf->height / (float)usurf->client_height;
+ uifw_trace("win_mgr_set_scale: %08x X=%4.2f(%d/%d) Y=%4.2f(%d/%d)",
+ usurf->surfaceid, scalex, usurf->width, usurf->client_width,
+ scaley, usurf->height, usurf->client_height);
+ usurf->xadd = 0;
+ usurf->yadd = 0;
+ if (usurf->attributes & ICO_WINDOW_MGR_ATTR_FIXED_ASPECT) {
+ if (scalex > scaley) {
+ scalex = scaley;
+ if ((usurf->attributes & ICO_WINDOW_MGR_ATTR_ALIGN_LEFT) == 0) {
+ usurf->xadd = (float)usurf->width - ((float)usurf->client_width * scalex);
+ if ((usurf->attributes & ICO_WINDOW_MGR_ATTR_ALIGN_RIGHT) == 0) {
+ usurf->xadd /= 2;
+ }
+ }
+ }
+ else if (scalex < scaley) {
+ scaley = scalex;
+ if ((usurf->attributes & ICO_WINDOW_MGR_ATTR_ALIGN_TOP) == 0) {
+ usurf->yadd = (float)usurf->height - ((float)usurf->client_height * scaley);
+ if ((usurf->attributes & ICO_WINDOW_MGR_ATTR_ALIGN_BOTTOM) == 0) {
+ usurf->yadd /= 2;
+ }
+ }
+ }
+ uifw_trace("win_mgr_set_scale: %08x fixed aspect x/yadd=%d/%d",
+ usurf->surfaceid, usurf->xadd, usurf->yadd);
+ }
+ if ((scalex != usurf->scalex) || (scaley != usurf->scaley)) {
+ usurf->scalex = scalex;
+ usurf->scaley = scaley;
+ if ((scalex != 1.0f) || (scaley != 1.0f)) {
+ weston_matrix_init(&usurf->transform.matrix);
+ weston_matrix_scale(&usurf->transform.matrix, scalex, scaley, 1.0f);
+ uifw_trace("win_mgr_set_scale: change scale(%d)", usurf->set_transform);
+ if (usurf->set_transform == 0) {
+ usurf->set_transform = 1;
+ wl_list_init(&usurf->transform.link);
+ wl_list_insert(&es->geometry.transformation_list, &usurf->transform.link);
+ }
+ }
+ else if (usurf->set_transform != 0) {
+ uifw_trace("win_mgr_set_scale: reset transform");
+ usurf->set_transform = 0;
+ wl_list_remove(&usurf->transform.link);
+ }
+ weston_surface_update_transform(es);
+ weston_surface_geometry_dirty(es);
+ weston_surface_damage_below(es);
+ weston_surface_damage(es);
+ ret = 1;
+ }
+ }
+ return ret;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief ico_window_mgr_set_hook_animation: set animation hook routine
*
* @param[in] hook_animation hook routine
section = weston_config_get_section(ec->config, "ivi-animation", NULL, NULL);
if (section) {
weston_config_section_get_string(section, "default", &_ico_ivi_animation_name, NULL);
- weston_config_section_get_int(section, "time", &_ico_ivi_animation_time, 500);
+ weston_config_section_get_int(section, "time", &_ico_ivi_animation_time, 600);
weston_config_section_get_int(section, "fps", &_ico_ivi_animation_fps, 15);
}
+ if (_ico_ivi_animation_time < 100) _ico_ivi_animation_time = 600;
+ if (_ico_ivi_animation_fps < 2) _ico_ivi_animation_fps = 15;
/* get display number list */
section = weston_config_get_section(ec->config, "ivi-display", NULL, NULL);
if (section) {
+ weston_config_section_get_int(section, "default", &_ico_ivi_default_layer, 1);
+ weston_config_section_get_int(section, "startup", &_ico_ivi_startup_layer, 101);
+ weston_config_section_get_int(section, "cursor", &_ico_ivi_cursor_layer, 102);
+ }
+
+ /* get default layer id */
+ section = weston_config_get_section(ec->config, "ivi-layer", NULL, NULL);
+ if (section) {
weston_config_section_get_string(section, "displayno", &displayno, NULL);
}
wl_list_init(&_ico_win_mgr->client_list);
wl_list_init(&_ico_win_mgr->manager_list);
wl_list_init(&_ico_win_mgr->ivi_layer_list);
+ wl_list_init(&_ico_win_mgr->map_list);
+
+ _ico_win_mgr->free_maptable = NULL;
/* create display list */
if (displayno != NULL) {
}
_ico_num_nodes = 0;
wl_list_for_each(output, &ec->output_list, link) {
+ wl_list_init(&_ico_win_mgr->map_animation[_ico_num_nodes].link);
+ _ico_win_mgr->map_animation[_ico_num_nodes].frame = win_mgr_check_surfacemap;
+ wl_list_insert(output->animation_list.prev,
+ &_ico_win_mgr->map_animation[_ico_num_nodes].link);
_ico_num_nodes++;
if (_ico_num_nodes >= ICO_IVI_MAX_DISPLAY) break;
}
ico_ivi_shell_hook_create(win_mgr_register_surface);
ico_ivi_shell_hook_destroy(win_mgr_destroy_surface);
ico_ivi_shell_hook_map(win_mgr_map_surface);
- ico_ivi_shell_hook_change(win_mgr_change_surface);
+ ico_ivi_shell_hook_configure(win_mgr_shell_configure);
ico_ivi_shell_hook_select(win_mgr_select_surface);
ico_ivi_shell_hook_title(win_mgr_set_title);
ico_ivi_shell_hook_move(win_mgr_surface_move);
#ifndef _ICO_WINDOW_MGR_H_
#define _ICO_WINDOW_MGR_H_
+/* Manager management table */
+struct uifw_manager {
+ struct wl_resource *resource; /* Manager resource */
+ int manager; /* Manager(=event send flag) */
+ struct wl_list link; /* link to next manager */
+};
+
/* Cleint management table */
struct uifw_client {
struct wl_client *client; /* Wayland client */
int pid; /* ProcessId (pid) */
char appid[ICO_IVI_APPID_LENGTH]; /* ApplicationId(from AppCore AUL) */
+ struct uifw_manager *mgr; /* Manager table (if manager) */
char manager; /* Manager flag (Need send event) */
char noconfigure; /* no need configure event */
char res[2];
- struct wl_resource *resource;
struct wl_list link;
};
/* Layer management table */
struct uifw_win_layer {
uint32_t layer; /* Layer Id */
- uint16_t attribute; /* Layer attribute */
char visible; /* visibility */
- char res; /* (unused) */
+ char res[3]; /* (unused) */
struct wl_list surface_list; /* Surfacae list */
struct wl_list link; /* Link pointer for layer list */
};
+/* Surface map table */
+struct uifw_win_surface;
+struct uifw_surface_map {
+ struct uifw_win_surface *usurf; /* UIFW surface */
+ struct uifw_client *uclient; /* UIFW client */
+ uint32_t eglname; /* EGL buffer name */
+ uint32_t format; /* format */
+ uint16_t type; /* buffer type(currently only EGL buffer)*/
+ uint16_t width; /* width */
+ uint16_t height; /* height */
+ uint16_t stride; /* stride */
+ uint16_t framerate; /* update frame rate (frame/sec) */
+ char initflag; /* map event send flag(0=no/1=yes) */
+ char res; /* (unused) */
+ struct wl_list map_link; /* map list */
+ struct wl_list surf_link; /* map list from UIFW surface */
+};
+
/* UIFW surface */
struct shell_surface;
struct uifw_win_surface {
struct weston_surface *surface; /* Weston surface */
struct shell_surface *shsurf; /* Shell(IVI-Shell) surface */
struct uifw_client *uclient; /* Client */
+ struct weston_transform transform; /* transform matrix */
+ float scalex; /* surface transform scale of X */
+ float scaley; /* surface transform scale of Y */
int x; /* X-coordinate */
int y; /* Y-coordinate */
- int width; /* Width */
- int height; /* Height */
+ short xadd; /* X-coordinate delta */
+ short yadd; /* Y-coordinate delta */
+ uint16_t width; /* Width */
+ uint16_t height; /* Height */
+ uint16_t client_width; /* Widht that a client(App) required */
+ uint16_t client_height; /* Height that a client(App) required */
+ uint16_t conf_width; /* Width that notified to client */
+ uint16_t conf_height; /* Height that notified to client */
+ uint32_t attributes; /* surface attributes */
char winname[ICO_IVI_WINNAME_LENGTH];/* Window name */
char visible; /* visibility */
char raise; /* raise(top of the layer) */
char created; /* sended created event to manager */
char mapped; /* end of map */
char restrain_configure; /* restrant configure event */
- char res[3]; /* (unused) */
+ char set_transform; /* surface transform flag */
+ char res[2]; /* (unused) */
struct _uifw_win_surface_animation { /* wndow animation */
struct weston_animation animation; /* weston animation control */
uint16_t type; /* current animation type */
- uint16_t name; /* curremt animation nameId */
- uint16_t next_name; /* next animation nameId */
- uint16_t hide_name; /* animation nameId for hide */
+ uint16_t anima; /* curremt animation Id */
+ uint16_t next_anima; /* next animation Id */
+ uint16_t hide_anima; /* animation Id for hide */
uint16_t hide_time; /* animation time(ms) for hide */
- uint16_t show_name; /* animation nameId for show */
+ uint16_t show_anima; /* animation Id for show */
uint16_t show_time; /* animation time(ms) for show */
- uint16_t move_name; /* animation nameId for move */
+ uint16_t move_anima; /* animation Id for move */
uint16_t move_time; /* animation time(ms) for move */
- uint16_t resize_name; /* animation nameId for resize */
+ uint16_t resize_anima; /* animation Id for resize */
uint16_t resize_time; /* animation time(ms) for resize */
+ uint16_t time; /* current animation time(ms) */
+ uint16_t pos_x; /* start/end X-coordinate */
+ uint16_t pos_y; /* start/end Y-coordinate */
+ uint16_t pos_width; /* start/end width */
+ uint16_t pos_height; /* start/end height */
short current; /* animation current percentage */
char state; /* animation state */
char visible; /* need hide(1)/show(2) at end of animation*/
char restrain_configure; /* restrain surface resize */
+ char ahalf; /* after half */
+ char no_configure; /* no send configure to client */
char res; /* (unused) */
uint32_t starttime; /* start time(ms) */
void *animadata; /* animation data */
} animation;
struct wl_list ivi_layer; /* surface list of same layer */
+ struct wl_list surf_map; /* surface map list */
struct uifw_win_surface *next_idhash; /* UIFW SurfaceId hash list */
struct uifw_win_surface *next_wshash; /* Weston SurfaceId hash list */
};
/* return code of animation hook function*/
#define ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA -1 /* no animation */
#define ICO_WINDOW_MGR_ANIMATION_RET_ANIMA 0 /* animation */
-#define ICO_WINDOW_MGR_ANIMATION_RET_ANIMASHOW 1 /* animation with visible */
+#define ICO_WINDOW_MGR_ANIMATION_RET_ANIMANOCTL 1 /* animation but no control */
/* animation state */
#define ICO_WINDOW_MGR_ANIMATION_STATE_NONE 0 /* not animation */
/* extended(plugin) animation operation */
#define ICO_WINDOW_MGR_ANIMATION_NAME 0 /* convert animation name to Id */
-#define ICO_WINDOW_MGR_ANIMATION_DESTROY 99 /* surface destroy */
+#define ICO_WINDOW_MGR_ANIMATION_DESTROY 99 /* surface destroy */
#define ICO_WINDOW_MGR_ANIMATION_OPNONE 0 /* no animation */
#define ICO_WINDOW_MGR_ANIMATION_OPHIDE 1 /* change to hide */
#define ICO_WINDOW_MGR_ANIMATION_OPSHOW 2 /* change to show */
#define ICO_WINDOW_MGR_ANIMATION_OPMOVE 3 /* surface move */
#define ICO_WINDOW_MGR_ANIMATION_OPRESIZE 4 /* surface resize */
#define ICO_WINDOW_MGR_ANIMATION_OPCANCEL 9 /* animation cancel */
+#define ICO_WINDOW_MGR_ANIMATION_OPHIDEPOS 11 /* change to hide with position */
+#define ICO_WINDOW_MGR_ANIMATION_OPSHOWPOS 12 /* change to show with position */
/* Prototype for function */
/* surface visible control */
void ico_window_mgr_set_visible(struct uifw_win_surface *usurf, const int visible);
/* get client applicationId */
char *ico_window_mgr_get_appid(struct wl_client* client);
+ /* change weston surface */
+void ico_window_mgr_set_weston_surface(struct uifw_win_surface *usurf, int x, int y,
+ int width, int height);
+ /* surface change */
+void ico_window_mgr_change_surface(struct uifw_win_surface *usurf,
+ const int to, const int manager);
/* set window animation hook */
void ico_window_mgr_set_hook_animation(int (*hook_animation)(const int op, void *data));
/*--------------------------------------------------------------------------*/
/**
- * @brief opengl_create_window: Create OpenGL/EGL window
+ * @brief opengl_swap_buffer: Swap OpenGL/EGL buffer
*
* @param[in] display Wayland connection
* @param[in] dpy EGL display
static void
_on_destroy(Ecore_Evas *ee __UNUSED__)
{
+ fprintf(stderr, "EFL-App destory, end of test\n"); fflush(stderr);
ecore_main_loop_quit();
}
}
}
+ fprintf(stderr, "EFL-App call ecore_evas_init()\n"); fflush(stderr);
ecore_evas_init();
/* this will give you a window with an Evas canvas under the first
* engine available */
+ fprintf(stderr, "EFL-App create surace(ecore_evas_new(%d,%d))\n", width, height); fflush(stderr);
ee = ecore_evas_new(NULL, 0, 0, width, height, "frame=0");
if (!ee) goto error;
ecore_evas_callback_delete_request_set(ee, _on_destroy);
sprintf(sTitle, "EFL_Native_Application_%d", appno);
ecore_evas_title_set(ee, sTitle);
+ fprintf(stderr, "EFL-App show surace(ecore_evas_show)\n"); fflush(stderr);
ecore_evas_show(ee);
canvas = ecore_evas_get(ee);
evas_object_show(r3);
evas_object_show(img);
+ fprintf(stderr, "EFL-App event mainloop\n"); fflush(stderr);
ecore_main_loop_begin();
ecore_evas_free(ee);
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/mman.h>
#include <signal.h>
+#include <fcntl.h>
#include <linux/input.h>
#include <wayland-client.h>
#include "ico_window_mgr-client-protocol.h"
#include "test-common.h"
#define MAX_APPID 128
+#define SHM_SIZE (16*1024*1024)
+#define MAX_CON_NAME 127
+#define MAX_OUTPUT 8
struct surface_name {
struct surface_name *next;
int visible;
};
-#define MAX_CON_NAME 127
-
struct display {
struct wl_display *display;
struct wl_registry *registry;
struct ico_input_mgr_device *ico_input_device;
struct ico_exinput *ico_exinput;
struct input *input;
- struct output *output;
+ int num_output;
+ struct output *output[MAX_OUTPUT];
+#if 0 /* 2013/08/23 no need shm */
+ struct wl_shm *shm;
+ void *shm_buf;
+ struct wl_shm_pool *shm_pool;
+#endif
struct surface *surface;
struct surface_name *surface_name;
struct surface_name *bgsurface_name;
static void
window_map(void *data, struct ico_window_mgr *ico_window_mgr,
- int32_t event, uint32_t surfaceid,
- int32_t width, int32_t height, int32_t stride, int32_t format)
+ int32_t event, uint32_t surfaceid, uint32_t type, uint32_t target,
+ int32_t width, int32_t height, int32_t stride, uint32_t format)
{
- print_log("HOMESCREEN: Event[map_surface] ev=%d surf=%08x w/h/s/f=%d/%d/%d/%x",
- event, (int)surfaceid, width, height, stride, format);
+ char sevt[16];
+
+ switch (event) {
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_CONTENTS:
+ strcpy(sevt, "Contents"); break;
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_RESIZE:
+ strcpy(sevt, "Resize"); break;
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_MAP:
+ strcpy(sevt, "Map"); break;
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP:
+ strcpy(sevt, "Unmap"); break;
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR:
+ sprintf(sevt, "Error %d", target); break;
+ default:
+ sprintf(sevt, "??%d??", event); break;
+ }
+ print_log("HOMESCREEN: Event[map_surface] ev=%s(%d) surf=%08x type=%d target=%x "
+ "w/h/s/f=%d/%d/%d/%x",
+ sevt, event, (int)surfaceid, type, target, width, height, stride, format);
}
static const struct ico_window_mgr_listener window_mgr_listener = {
display->input = input;
}
else if (strcmp(interface, "wl_output") == 0) {
- output = malloc(sizeof *output);
- output->display = display;
- output->output = wl_registry_bind(display->registry, id, &wl_output_interface, 1);
- wl_output_add_listener(output->output, &output_listener, output);
- display->output = output;
-
- print_log("HOMESCREEN: created output global %p", display->output);
+ if (display->num_output < MAX_OUTPUT) {
+ output = malloc(sizeof *output);
+ output->display = display;
+ output->output = wl_registry_bind(display->registry, id, &wl_output_interface, 1);
+ wl_output_add_listener(output->output, &output_listener, output);
+ display->output[display->num_output] = output;
+
+ print_log("HOMESCREEN: created output[%d] global %p",
+ display->num_output, display->output[display->num_output]);
+ display->num_output ++;
+ }
}
else if (strcmp(interface, "wl_shell") == 0) {
display->shell =
&ico_input_mgr_device_interface, 1);
print_log("HOMESCREEN: created input_device global %p", display->ico_input_device);
}
+#if 0 /* 2013/08/23 no need shm */
+ else if (strcmp(interface, "wl_shm") == 0) {
+ display->shm = wl_registry_bind(display->registry, id,
+ &wl_shm_interface, 1);
+ print_log("HOMESCREEN: created wl_shm global %p", display->shm);
+ }
+#endif
else if (strcmp(interface, "ico_exinput") == 0) {
display->ico_exinput =
wl_registry_bind(display->registry, id, &ico_exinput_interface, 1);
y = strtol(args[2], (char **)0, 0);
if (narg >= 4) {
node = strtol(args[3], (char **)0, 0);
- if (p) {
- p->node = node;
+ if (node < 0) {
+ if (p) node = p->node;
+ else node = 0;
}
+ if (p) p->node = node;
}
else if (p) {
node = p->node;
int narg;
int surfaceid;
int anima = 0;
+ int ax = 0;
+ int ay = 0;
+ int awidth = 1;
+ int aheight = 1;
narg = pars_command(buf, args, 10);
if (narg >= 1) {
surfaceid = search_surface(display, args[0]);
if (narg >= 2) {
anima = strtol(args[1], (char **)0, 0);
+ if (anima >= 2) {
+ ax = 0;
+ ay = 0;
+ awidth = 1;
+ aheight = 1;
+ if (narg >= 3) ax = strtol(args[2], (char **)0, 0);
+ if (narg >= 4) ay = strtol(args[3], (char **)0, 0);
+ if (narg >= 5) awidth = strtol(args[4], (char **)0, 0);
+ if (narg >= 6) aheight = strtol(args[5], (char **)0, 0);
+ }
}
if (surfaceid >= 0) {
if (show) {
- print_log("HOMESCREEN: show(%s,%08x,anima=%d)", args[0], surfaceid, anima);
- ico_window_mgr_set_visible(display->ico_window_mgr, surfaceid,
- 1, ICO_WINDOW_MGR_V_NOCHANGE, anima);
+ if (anima >= 2) {
+ print_log("HOMESCREEN: show anima(%s,%08x,x/y=%d/%d,w/h=%d/%d)",
+ args[0], surfaceid, ax, ay, awidth, aheight);
+ ico_window_mgr_visible_animation(display->ico_window_mgr, surfaceid,
+ 1, ax, ay, awidth, aheight);
+ }
+ else {
+ print_log("HOMESCREEN: show(%s,%08x,anima=%d)",
+ args[0], surfaceid, anima);
+ ico_window_mgr_set_visible(display->ico_window_mgr, surfaceid,
+ 1, ICO_WINDOW_MGR_V_NOCHANGE, anima);
+ }
}
else {
- print_log("HOMESCREEN: hide(%s,%08x,anima=%d)", args[0], surfaceid, anima);
- ico_window_mgr_set_visible(display->ico_window_mgr, surfaceid,
- 0, ICO_WINDOW_MGR_V_NOCHANGE, anima);
+ if (anima >= 2) {
+ print_log("HOMESCREEN: hide anima(%s,%08x,x/y=%d/%d,w/h=%d/%d)",
+ args[0], surfaceid, ax, ay, awidth, aheight);
+ ico_window_mgr_visible_animation(display->ico_window_mgr, surfaceid,
+ 0, ax, ay, awidth, aheight);
+ }
+ else {
+ print_log("HOMESCREEN: hide(%s,%08x,anima=%d)",
+ args[0], surfaceid, anima);
+ ico_window_mgr_set_visible(display->ico_window_mgr, surfaceid,
+ 0, ICO_WINDOW_MGR_V_NOCHANGE, anima);
+ }
}
}
else {
}
}
else {
- print_log("HOMESCREEN: show command[show/hide appid anima] has no argument");
+ print_log("HOMESCREEN: show command[show/hide appid anima x y width height]"
+ " has no argument");
}
}
}
static void
+map_surface(struct display *display, char *buf, int map)
+{
+ char *args[10];
+ int narg;
+ int surfaceid;
+ int fps;
+
+ narg = pars_command(buf, args, 10);
+ if (narg >= 1) {
+ surfaceid = search_surface(display, args[0]);
+ if (surfaceid >= 0) {
+ if (narg >= 2) {
+ fps = strtol(args[1], (char **)0, 0);
+ }
+ else {
+ fps = 0;
+ }
+ if (map) {
+ print_log("HOMESCREEN: map surface(%s,%08x,%d)",
+ args[0], surfaceid, fps);
+ ico_window_mgr_map_surface(display->ico_window_mgr, surfaceid, fps);
+ }
+ else {
+ print_log("HOMESCREEN: unmap surface(%s,%08x)", args[0], surfaceid);
+ ico_window_mgr_unmap_surface(display->ico_window_mgr, surfaceid);
+ }
+ }
+ else {
+ print_log("HOMESCREEN: Unknown surface(%s) at %s command", args[0],
+ map ? "map" : "unmap");
+ }
+ }
+ else {
+ if (map) {
+ print_log("HOMESCREEN: map surface command"
+ "[map surface framerate] has no argument");
+ }
+ else {
+ print_log("HOMESCREEN: unmap surface command"
+ "[unmap surface] has no argument");
+ }
+ }
+}
+
+static void
visible_layer(struct display *display, char *buf)
{
char *args[10];
char buf[256];
int ret, fd;
int msec;
+#if 1 /* use mkostemp */
+ extern int mkostemp(char *template, int flags);
+#else /* use mkostemp */
+ long flags;
+#endif /* use mkostemp */
display = malloc(sizeof *display);
assert(display);
assert(display->display);
display->registry = wl_display_get_registry(display->display);
- wl_registry_add_listener(display->registry,
- ®istry_listener, display);
+ wl_registry_add_listener(display->registry, ®istry_listener, display);
wl_display_dispatch(display->display);
+#if 0 /* 2013/08/23 no need shm */
+ /* make wl_shm */
+ do {
+ sleep_with_wayland(display->display, 20);
+ } while(! display->shm);
+
+ strcpy(buf, "/tmp/test-homescreen-shm-XXXXXX");
+#if 1 /* use mkostemp */
+ fd = mkostemp(buf, O_CLOEXEC);
+ if (fd < 0) {
+ fprintf(stderr, "test-homescreen: can not make temp file for shm\n");
+ exit(1);
+ }
+#else /* use mkostemp */
+ fd = mkstemp(buf);
+ if (fd < 0) {
+ fprintf(stderr, "test-homescreen: can not make temp file for shm\n");
+ exit(1);
+ }
+ flags = fcntl(fd, F_GETFD);
+ if (flags == -1) {
+ fprintf(stderr, "test-homescreen: can not get file flags\n");
+ close(fd);
+ exit(1);
+ }
+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) {
+ fprintf(stderr, "test-homescreen: can not set file flags to FD_CLOEXEC\n");
+ close(fd);
+ exit(1);
+ }
+#endif /* use mkostemp */
+ unlink(buf);
+ if (ftruncate(fd, SHM_SIZE) < 0) {
+ fprintf(stderr, "test-homescreen: can not truncate temp file for shm\n");
+ close(fd);
+ exit(1);
+ }
+ display->shm_buf = mmap(NULL, SHM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (display->shm_buf == MAP_FAILED) {
+ fprintf(stderr, "test-homescreen: can not mmap temp file for shm\n");
+ close(fd);
+ exit(1);
+ }
+ display->shm_pool = wl_shm_create_pool(display->shm, fd, SHM_SIZE);
+ close(fd);
+ if (! display->shm_pool) {
+ fprintf(stderr, "test-homescreen: wayland can not make shm_pool\n");
+ exit(1);
+ }
+ print_log("HOMESCREEN: shm pool=%08x addr=%08x",
+ (int)display->shm_pool, (int)display->shm_buf);
+#endif
fd = 0;
while (1) {
raise_surface(display, &buf[5], 0);
}
else if (strncasecmp(buf, "animation", 9) == 0) {
- /* Set animation surface window*/
+ /* Set animation surface window */
animation_surface(display, &buf[9]);
}
+ else if (strncasecmp(buf, "map", 3) == 0) {
+ /* map surface */
+ map_surface(display, &buf[3], 1);
+ }
+ else if (strncasecmp(buf, "unmap", 5) == 0) {
+ /* unmap surface */
+ map_surface(display, &buf[5], 0);
+ }
else if (strncasecmp(buf, "input_add", 9) == 0) {
/* Set input switch to application */
input_add(display, &buf[9]);
# 2. Sleep 2 sec with color change
sleep 0.1
clear-surface 0x80ff4060
-sleep 15
+sleep 35
# 3. End of this Application (exit)
bye
--- /dev/null
+# Test for Weston IVI Plugin for Native Application
+# Surface Create and Exit
+#
+# 1. Create Surface
+create-surface
+# 2. Sleep 1 sec with color change
+sleep 0.5
+clear-surface 0x80ff2020
+sleep 0.5
+clear-surface 0xb020ff20
+sleep 0.5
+clear-surface 0xe02020ff
+sleep 0.5
+clear-surface 0xff808080
+sleep 0.5
+clear-surface 0x80ff2020
+sleep 0.5
+clear-surface 0xb020ff20
+sleep 0.5
+clear-surface 0xe02020ff
+sleep 0.5
+clear-surface 0xff808080
+sleep 0.5
+clear-surface 0x80ff2020
+sleep 0.5
+clear-surface 0xb020ff20
+sleep 0.5
+clear-surface 0xe02020ff
+sleep 0.5
+clear-surface 0xff808080
+sleep 0.5
+clear-surface 0x80ff2020
+sleep 0.5
+clear-surface 0xb020ff20
+sleep 0.5
+clear-surface 0xe02020ff
+sleep 0.5
+clear-surface 0xff808080
+sleep 30
+# 3. End of this Application (exit)
+bye
# Surface Create and Destory
#
# 1. Launch Application (and app create surface)
-launch ../tests/test-client < ../tests/testdata/cl_surface1.dat 2> ../tests/testlog/test-client01.log
+launch ../tests/test-client < ../tests/testdata/cl_surface1.dat 2> ../tests/testlog/test-client01.log 1>&2
waitcreate 2
show test-client
sleep 4
sleep 1
#
# 2. Launch Application and resize/move/show
-launch ../tests/test-client < ../tests/testdata/cl_surface2.dat 2> ../tests/testlog/test-client02.log
+launch ../tests/test-client < ../tests/testdata/cl_surface2.dat 2> ../tests/testlog/test-client02.log 1>&2
waitcreate 2
resize test-client 600 400
move test-client 300 100
launch ../tests/test-client < ../tests/testdata/cl_surface4.dat 2> ../tests/testlog/test-client04.log
waitcreate 2
resize test-client 200 300
-move test-client 400 250 0
+move test-client 300 350 0
#
# fade and show/hide
animation test-client fade 400
+#
show test-client 1
-sleep 0.7
+sleep 0.5
hide test-client 1
sleep 1
#
# slide.toleft and show/hide
animation test-client slide.toleft 400
show test-client 1
-sleep 0.7
-hide test-client 1
sleep 1
+hide test-client 1
+sleep 2
#
# slide.toright and show/hide
animation test-client slide.toright 400
show test-client 1
-sleep 0.7
+sleep 2
hide test-client 1
-sleep 1
+sleep 2
#
# slide.totop and show/hide
animation test-client slide.totop 400
show test-client 1
-sleep 0.7
-hide test-client 1
sleep 1
+hide test-client 1
+sleep 2
#
# slide.tobottom and show/hide
animation test-client slide.tobottom 400
show test-client 1
-sleep 0.7
-hide test-client 1
sleep 1
-#
-# zoom and show/hide
-animation test-client zoom 400
-show test-client 1
-sleep 0.7
hide test-client 1
sleep 2
#
+### zoom and show/hide
+##animation test-client zoom 400
+##show test-client 1
+##sleep 1
+##hide test-client 1
+##sleep 3
+#
# fade and move
-animation test-client fade 600
-move test-client 600 200 1
-sleep 1
-move test-client 500 300 1
+show test-client
sleep 1
+animation test-client fade 600
+move test-client 600 200 0 1
+sleep 1.5
+move test-client 500 300 0 1
+sleep 2
+#
+# slide and move
+animation test-client slide 600
+move test-client 100 50 0 1
+sleep 1.5
+move test-client 500 400 0 1
+sleep 2
+#
+# fade and resize
+animation test-client fade 600
+resize test-client 80 50 1
+sleep 1.5
+resize test-client 300 200 1
+sleep 2
+#
+# slide and resize
+animation test-client slide 600
+resize test-client 80 50 1
+sleep 1.5
+resize test-client 300 200 1
+sleep 3
#
waitdestroy 60
sleep 1
#
# 4. Launch Weston sample client
-#launch /usr/bin/wayland-flower 2> ../tests/testlog/wayland-flower.log
+#launch /usr/bin/wayland-flower 2> ../tests/testlog/wayland-flower.log 1>&2
#waitcreate 2
#move wayland-flower 200 100
#show wayland-flower
#kill wayland-flower
#sleep 1
#
-#launch /usr/bin/wayland-smoke 2> ../tests/testlog/wayland-smoke.log
+#launch /usr/bin/wayland-smoke 2> ../tests/testlog/wayland-smoke.log 1>&2
#waitcreate 2
#move wayland-smoke 100 50
#show wayland-smoke
#sleep 1
#
# 5. Set Layer
-launch ../tests/test-eflapp @1 -color=0xe02040ff > ../tests/testlog/test-eflapp1.log
+launch ../tests/test-eflapp @1 -color=0xe02040ff > ../tests/testlog/test-eflapp1.log 1>&2
waitcreate 2
layer test-eflapp@1 101
move test-eflapp@1 100 200
show test-eflapp@1
sleep 0.5
-launch ../tests/test-eflapp @2 -color=0xd020ff40 > ../tests/testlog/test-eflapp2.log
+launch ../tests/test-eflapp @2 -color=0xd020ff40 > ../tests/testlog/test-eflapp2.log 1>&2
waitcreate 2
layer test-eflapp@2 103
move test-eflapp@2 200 300
show test-eflapp@2
sleep 0.5
-launch ../tests/test-eflapp @3 -color=0xc0ff2040 > ../tests/testlog/test-eflapp3.log
+launch ../tests/test-eflapp @3 -color=0xc0ff2040 > ../tests/testlog/test-eflapp3.log 1>&2
waitcreate 2
layer test-eflapp@3 102
move test-eflapp@3 300 400
show test-eflapp@3
sleep 0.5
-launch ../tests/test-eflapp @4 -color=0xb0808080 > ../tests/testlog/test-eflapp4.log
+launch ../tests/test-eflapp @4 -color=0xb0808080 > ../tests/testlog/test-eflapp4.log 1>&2
waitcreate 2
layer test-eflapp@4 102
move test-eflapp@4 400 500
show test-eflapp@4
sleep 0.5
-launch ../tests/test-eflapp @5 -color=0xa040a060 > ../tests/testlog/test-eflapp5.log
+launch ../tests/test-eflapp @5 -color=0xa040a060 > ../tests/testlog/test-eflapp5.log 1>&2
waitcreate 2
layer test-eflapp@5 102
move test-eflapp@5 500 600
sleep 2
#
# 10. Input test
-launch ../tests/test-client @1 -color=0xe0ff2020 -postsleep=60 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client11.log
+launch ../tests/test-client @1 -color=0xe0ff2020 -postsleep=60 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client11.log 1>&2
waitcreate 2
sleep 0.3
layer test-client@1 101
event Button=Up
sleep 0.2
-launch ../tests/test-client @2 -color=0xc020ff20 -postsleep=60 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client12.log
+launch ../tests/test-client @2 -color=0xc020ff20 -postsleep=60 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client12.log 1>&2
waitcreate 2
sleep 0.3
layer test-client@2 101
event Button=Up
sleep 0.2
-launch ../tests/test-client @3 -color=0xa02020ff -postsleep=60 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client13.log
+launch ../tests/test-client @3 -color=0xa02020ff -postsleep=60 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client13.log 1>&2
waitcreate 2
sleep 0.3
layer test-client@3 101
#
# 1. Surface animation
sleep 1
-launch ../tests/test-client < ../tests/testdata/cl_surface4.dat 2> ../tests/testlog/test-client04.log
+launch ../tests/test-eflapp @1 -color=0xe02040ff 2> ../tests/testlog/test-eflapp.log 1>&2
waitcreate 2
-resize test-client 200 300
-move test-client 300 350 0
-#
-# fade and show/hide
-animation test-client fade 400
-#
-show test-client
-sleep 0.5
-hide test-client
-sleep 1
-#
-# slide.toleft and show/hide
-animation test-client slide.toleft 400
-show test-client 1
+resize test-eflapp@1 400 300
+move test-eflapp@1 300 350 0
+show test-eflapp@1
sleep 1
-hide test-client 1
-sleep 2
#
-# slide.toright and show/hide
-animation test-client slide.toright 400
-show test-client 1
+# zoom and show/hide
+animation test-eflapp@1 zoom 600
+show test-eflapp@1 1
sleep 2
-hide test-client 1
+hide test-eflapp@1 1
sleep 2
#
-# slide.totop and show/hide
-animation test-client slide.totop 400
-show test-client 1
+# zoom and move
+animation test-eflapp@1 zoom 1000
+show test-eflapp@1
sleep 1
-hide test-client 1
+move test-eflapp@1 100 50 0 1
sleep 2
+move test-eflapp@1 500 400 0 1
+#sleep 2
#
-# slide.tobottom and show/hide
-animation test-client slide.tobottom 400
-show test-client 1
-sleep 1
-hide test-client 1
+# zoom and resize
+animation test-eflapp@1 zoom 1000
+resize test-eflapp@1 80 50 1
+sleep 2
+resize test-eflapp@1 300 200 1
sleep 2
#
-### zoom and show/hide
-##animation test-client zoom 400
-##show test-client 1
-##sleep 1
-##hide test-client 1
-##sleep 3
-#
-### fade and move
-##animation test-client fade 600
-##move test-client 600 200 1
-##sleep 2
-##move test-client 500 300 1
-##sleep 3
+# zoom and positionsize
+positionsize test-eflapp@1 800 600 120 80 0 1
+sleep 2
+positionsize test-eflapp@1 200 300 80 60
+sleep 2
+positionsize test-eflapp@1 400 500 300 200 0 1
+sleep 2
#
-waitdestroy 60
+sleep 1
+kill test-eflapp@1
sleep 1
#
-kill test-client
-sleep 0.5
#
# 2. End of Test
bye
--- /dev/null
+# Test for Weston IVI Plugin for HomeScreen(SystemController)
+# Animation Test
+#
+# 1. Surface animation
+sleep 1
+launch ../tests/test-client < ../tests/testdata/cl_surface4.dat 2> ../tests/testlog/test-client04.log
+waitcreate 2
+resize test-client 200 300
+move test-client 300 350 0
+#
+# fade and show/hide
+animation test-client fade 400
+#
+show test-client 1
+sleep 0.5
+hide test-client 1
+sleep 1
+#
+# slide.toleft and show/hide
+animation test-client slide.toleft 400
+show test-client 1
+sleep 1
+hide test-client 1
+sleep 2
+#
+# slide.toright and show/hide
+animation test-client slide.toright 400
+show test-client 1
+sleep 2
+hide test-client 1
+sleep 2
+#
+# slide.totop and show/hide
+animation test-client slide.totop 400
+show test-client 1
+sleep 1
+hide test-client 1
+sleep 2
+#
+# slide.tobottom and show/hide
+animation test-client slide.tobottom 400
+show test-client 1
+sleep 1
+hide test-client 1
+sleep 2
+#
+# zoom and show/hide
+show test-client
+sleep 1
+animation test-client zoom 600
+show test-client 1
+sleep 2
+hide test-client 1
+sleep 2
+#
+# zoom and move
+animation test-client zoom 1000
+show test-client
+sleep 1
+move test-client 100 50 0 1
+sleep 2
+move test-client 500 400 0 1
+sleep 2
+#
+# zoom and resize
+resize test-client 80 50 1
+sleep 2
+resize test-client 300 200 1
+sleep 2
+#
+# slide and move
+animation test-client slide 600
+move test-client 100 50 0 1
+sleep 1.5
+move test-client 500 400 0 1
+sleep 2
+#
+# fade and resize
+animation test-client fade 600
+resize test-client 80 50 1
+sleep 1.5
+resize test-client 300 200 1
+sleep 2
+#
+# slide and resize
+animation test-client slide 600
+resize test-client 80 50 1
+sleep 1.5
+resize test-client 300 200 1
+sleep 3
+#
+#
+waitdestroy 60
+sleep 1
+#
+kill test-client
+sleep 0.5
+#
+# 2. End of Test
+bye
+
--- /dev/null
+# Test for Weston IVI Plugin for HomeScreen(SystemController)
+# Surface Map Test
+#
+#
+# 1. Surface Map/Unmap
+#
+launch ../tests/test-client < ../tests/testdata/cl_surface5.dat 2> ../tests/testlog/test-client01.log 1>&2
+waitcreate 2
+show test-client
+sleep 1
+# map surface
+map test-client 0
+#
+sleep 1
+launch ../tests/test-eflapp @1 -color=0xe02040ff 2> ../tests/testlog/test-eflapp.log 1>&2
+waitcreate 2
+move test-eflapp@1 100 150
+show test-eflapp@1
+sleep 1
+#
+# map surface
+map test-eflapp@1 15
+sleep 2
+#
+# unmap surface
+unmap test-eflapp@1
+unmap test-client
+sleep 2
+#
+sleep 2
+kill test-client
+kill test-eflapp@1
+sleep 1
+sleep 1
+#
+# 2. End of Test
+bye
+
sleep 1
resize test-client 300 200
sleep 1
-resize test-client 450 300
+resize test-client 150 100
sleep 1
-resize test-client 600 400
+kill test-client
+waitdestroy 60
sleep 1
-resize test-client 400 250
+#
+# 2. EFL client
+launch ../tests/test-eflapp @1 -color=0xe02040ff 2> ../tests/testlog/test-eflapp.log 1>&2
+waitcreate 2
+resize test-eflapp@1 150 100
+show test-eflapp@1
sleep 1
-resize test-client 200 150
+resize test-eflapp@1 300 200
sleep 1
-resize test-client 100 50
+resize test-eflapp@1 150 100
sleep 1
+kill test-eflapp@1
waitdestroy 60
sleep 1
#
-# 2. Weston sample client
-launch /usr/bin/wayland-flower 2> ../tests/testlog/wayland-flower.log
+# 3. Pure client
+launch ../tests/test-client < ../tests/testdata/cl_surface2.dat 2> ../tests/testlog/test-client2.log
waitcreate 2
-move wayland-flower 200 100
-show wayland-flower
+resize test-client 1080 128
+show test-client
sleep 1
-resize wayland-flower 500 400
-sleep 2
-kill wayland-flower
+resize test-client 1080 1020
sleep 1
-#
-launch /usr/bin/wayland-smoke 2> ../tests/testlog/wayland-smoke.log
-waitcreate 2
-move wayland-smoke 100 50
-show wayland-smoke
-sleep 0.3
-event XY=168,93
-event Button=Down
-sleep 0.1
-event XY=151,88
-event Button=Up
-sleep 1
-resize wayland-smoke 400 400
-sleep 0.3
-event XY=457,211
-event Button=Down
-sleep 0.1
-event XY=457,209
-event Button=Up
-sleep 1
-resize wayland-smoke 300 600
-sleep 0.4
-event XY=250,495
-event Button=Down
-sleep 0.2
-event XY=246,498
-event Button=Up
-sleep 0.8
-resize wayland-smoke 450 300
-sleep 0.3
-event XY=511,296
-event Button=Down
-sleep 0.1
-event XY=R508,300
-event Button=Up
-sleep 1
-kill wayland-smoke
+resize test-client 1080 128
+sleep 1
+kill test-client
+waitdestroy 60
sleep 1
#
-# 3. EFL client
-launch ../tests/test-eflapp @2 -color=0xc0ff2040 -resize 2> ../tests/testlog/test-eflapp2.log
-waitcreate 2
-layer test-eflapp@2 102
-move test-eflapp@2 20 80
-show test-eflapp@2
-sleep 0.5
-
-launch ../tests/test-eflapp @3 -color=0xb04080c0 -resize 2> ../tests/testlog/test-eflapp3.log
+# 4. EFL client
+launch ../tests/test-eflapp @1 -color=0xe02040ff 2> ../tests/testlog/test-eflapp.log 1>&2
waitcreate 2
-layer test-eflapp@3 102
-move test-eflapp@3 200 300
-show test-eflapp@3
-sleep 0.5
-resize test-eflapp@2 240 300
-sleep 2
-resize test-eflapp@2 100 100
-sleep 2
-resize test-eflapp@3 640 420
-sleep 2
-resize test-eflapp@3 720 520
-sleep 2
-resize test-eflapp@3 520 380
-sleep 2
-resize test-eflapp@2 520 380
-sleep 2
-#
-# 7. kill eflapp's
-kill test-eflapp@2
-sleep 0.5
-kill test-eflapp@3
-sleep 0.5
+resize test-eflapp@1 1080 128
+show test-eflapp@1
+sleep 1
+resize test-eflapp@1 1080 1020
+sleep 1
+resize test-eflapp@1 1080 128
+sleep 1
+kill test-eflapp@1
+waitdestroy 60
+sleep 1
#
# 9. End of Test
bye
export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
# 7 Start test-homescreen
-../tests/test-homescreen < ../tests/testdata/hs_alltest.dat 2> ../tests/testlog/test-homescreen.log
+../tests/test-homescreen < ../tests/testdata/hs_alltest.dat 2> ../tests/testlog/test-homescreen.log 1>&2
# 8 End of Test
sleep 2
--- /dev/null
+#!/bin/sh
+#
+# Weston IVI Plugin Test
+#
+# Remark: This examination premises that Weston does not run.
+
+# 1 Delete log file
+mkdir ../tests/testlog 2> /dev/null
+rm -fr ../tests/testlog/* 2> /dev/null
+
+# 2 Start Pseudo event device (for Touch Panel)
+../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log &
+sleep 1
+
+# 3 Weston/Wayland Envionment
+export QT_QPA_PLATFORM=wayland
+export ELM_ENGINE=wayland_egl
+export ECORE_EVAS_ENGINE=wayland_egl
+
+# 4 Set Environment for Test
+export WESTON_IVI_PLUGIN_DIR="../src/.libs"
+
+# 5 Start Weston
+export XDG_CONFIG_HOME="../tests"
+MOD_DIR="$PWD/../src/.libs"
+/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log &
+sleep 1
+
+# 6 Set library path
+export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
+
+# 7 Start test-homescreen
+../tests/test-homescreen < ../tests/testdata/hs_mapsurf.dat 2> ../tests/testlog/test-homescreen.log
+
+# 8 End of Test
+sleep 2
+/usr/bin/killall weston
+/usr/bin/killall test-send_event
+sleep 1
+
+# 9 Check Error
+FOUND_ERR=0
+/bin/grep "ERR>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "WRN>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Error" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+
+if [ $FOUND_ERR = 0 ] ; then
+ echo "Weston IVI Plugin Test: OK"
+else
+ echo "Weston IVI Plugin Test: ERROR"
+fi
+
#!/bin/sh
#
-# Weston IVI Plugin Test (Resize Buf test)
+# Weston IVI Plugin Test
#
# Remark: This examination premises that Weston does not run.
# 1 Delete log file
-rm -fr ../tests/testlog
-mkdir ../tests/testlog
+mkdir ../tests/testlog 2> /dev/null
+rm -fr ../tests/testlog/* 2> /dev/null
# 2 Start Pseudo event device (for Touch Panel)
../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log &
sleep 1
# 3 Weston/Wayland Envionment
-export XDG_RUNTIME_DIR=/tmp/run-root
export QT_QPA_PLATFORM=wayland
export ELM_ENGINE=wayland_egl
export ECORE_EVAS_ENGINE=wayland_egl
-#export ELM_ENGINE=wayland_shm
-#export ECORE_EVAS_ENGINE=wayland_shm
-export EVAS_FONT_DPI=72
-export ECORE_IMF_MODULE=isf
-export ELM_MODULES="ctxpopup_copypasteUI>entry/api:datetime_input_ctxpopup>datetime/api"
-export ELM_SCALE="0.7"
-export ELM_PROFILE=mobile
+export XDG_RUNTIME_DIR=/run/user/5000
# 4 Set Environment for Test
export WESTON_IVI_PLUGIN_DIR="../src/.libs"
# 5 Start Weston
export XDG_CONFIG_HOME="../tests"
MOD_DIR="$PWD/../src/.libs"
-/usr/bin/weston --backend=drm-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log &
+/usr/bin/weston --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log &
sleep 1
# 6 Set library path
export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
# 7 Start test-homescreen
-../tests/test-homescreen < ../tests/testdata/hs_resize.dat 2> ../tests/testlog/test-homescreen.log
+../tests/test-homescreen < ../tests/testdata/hs_resize.dat 2> ../tests/testlog/test-homescreen.log 1>&2
# 8 End of Test
-sleep 1
+sleep 2
/usr/bin/killall weston
/usr/bin/killall test-send_event
sleep 1
--- /dev/null
+#!/bin/sh
+#
+# Weston IVI Plugin Test
+#
+# Remark: This examination premises that Weston does not run.
+
+# 1 Delete log file
+mkdir ../tests/testlog 2> /dev/null
+rm -fr ../tests/testlog/* 2> /dev/null
+
+# 2 Start Pseudo event device (for Touch Panel)
+../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log 1>&2 &
+sleep 1
+
+# 3 Weston/Wayland Envionment
+export QT_QPA_PLATFORM=wayland
+export ELM_ENGINE=wayland_shm
+export ECORE_EVAS_ENGINE=wayland_shm
+export XDG_RUNTIME_DIR=/run/user/5000
+
+# 4 Set Environment for Test
+export WESTON_IVI_PLUGIN_DIR="../src/.libs"
+
+# 5 Start Weston
+export XDG_CONFIG_HOME="../tests"
+MOD_DIR="$PWD/../src/.libs"
+/usr/bin/weston --backend=fbdev-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log &
+sleep 1
+
+# 6 Set library path
+export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
+
+# 7 Start test-homescreen
+../tests/test-homescreen < ../tests/testdata/hs_animatest.dat 2> ../tests/testlog/test-homescreen.log
+
+# 8 End of Test
+sleep 2
+/usr/bin/killall weston
+/usr/bin/killall test-send_event
+sleep 1
+
+# 9 Check Error
+FOUND_ERR=0
+/bin/grep "ERR>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "WRN>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Error" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+
+if [ $FOUND_ERR = 0 ] ; then
+ echo "Weston IVI Plugin Test: OK"
+else
+ echo "Weston IVI Plugin Test: ERROR"
+fi
+
--- /dev/null
+#!/bin/sh
+#
+# Weston IVI Plugin Test
+#
+# Remark: This examination premises that Weston does not run.
+
+# 1 Delete log file
+mkdir ../tests/testlog 2> /dev/null
+rm -fr ../tests/testlog/* 2> /dev/null
+
+# 2 Start Pseudo event device (for Touch Panel)
+../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log 1>&2 &
+sleep 1
+
+# 3 Weston/Wayland Envionment
+export QT_QPA_PLATFORM=wayland
+#export ELM_ENGINE=wayland_egl
+#export ECORE_EVAS_ENGINE=wayland_egl
+export ELM_ENGINE=wayland_shm
+export ECORE_EVAS_ENGINE=wayland_shm
+export XDG_RUNTIME_DIR=/run/user/5000
+
+# 4 Set Environment for Test
+export WESTON_IVI_PLUGIN_DIR="../src/.libs"
+
+# 5 Start Weston
+export XDG_CONFIG_HOME="../tests"
+MOD_DIR="$PWD/../src/.libs"
+/usr/bin/weston --backend=fbdev-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log &
+sleep 1
+
+# 6 Set library path
+export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
+
+# 7 Start test-homescreen
+../tests/test-homescreen < ../tests/testdata/hs_alltest.dat 2> ../tests/testlog/test-homescreen.log 1>&2
+
+# 8 End of Test
+sleep 2
+/usr/bin/killall weston
+/usr/bin/killall test-send_event
+sleep 1
+
+# 9 Check Error
+FOUND_ERR=0
+/bin/grep "ERR>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "WRN>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Error" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+
+if [ $FOUND_ERR = 0 ] ; then
+ echo "Weston IVI Plugin Test: OK"
+else
+ echo "Weston IVI Plugin Test: ERROR"
+fi
+
--- /dev/null
+#!/bin/sh
+#
+# Weston IVI Plugin Test
+#
+# Remark: This examination premises that Weston does not run.
+
+# 1 Delete log file
+mkdir ../tests/testlog 2> /dev/null
+rm -fr ../tests/testlog/* 2> /dev/null
+
+# 2 Start Pseudo event device (for Touch Panel)
+../tests/test-send_event -d -mq=5551 2> ../tests/testlog/event_log.log &
+sleep 1
+
+# 3 Weston/Wayland Envionment
+export QT_QPA_PLATFORM=wayland
+export ELM_ENGINE=wayland_shm
+export ECORE_EVAS_ENGINE=wayland_shm
+
+# 4 Set Environment for Test
+export WESTON_IVI_PLUGIN_DIR="../src/.libs"
+
+# 5 Start Weston
+export XDG_CONFIG_HOME="../tests"
+MOD_DIR="$PWD/../src/.libs"
+/usr/bin/weston --backend=fbdev-backend.so --modules=$MOD_DIR/ico_plugin_loader.so --idle-time=0 --log=../tests/testlog/weston.log &
+sleep 1
+
+# 6 Set library path
+export LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
+
+# 7 Start test-homescreen
+../tests/test-homescreen < ../tests/testdata/hs_mapsurf.dat 2> ../tests/testlog/test-homescreen.log
+
+# 8 End of Test
+sleep 2
+/usr/bin/killall weston
+/usr/bin/killall test-send_event
+sleep 1
+
+# 9 Check Error
+FOUND_ERR=0
+/bin/grep "ERR>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "WRN>" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Error" testlog/*
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight"
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+
+if [ $FOUND_ERR = 0 ] ; then
+ echo "Weston IVI Plugin Test: OK"
+else
+ echo "Weston IVI Plugin Test: ERROR"
+fi
+
[ivi-display]
displayno=1,0
+[ivi-layer]
+# default layer id
+default=1
+# layer id at the time of the system startup
+startup=101
+# input layer id
+input=101
+# cursor layer id
+
[ivi-animation]
# default animation
default=fade
--- /dev/null
+[core]
+modules=error_but_no_problem_for_test.so
+# This is Error for Test(No Problem)
+
+#[input-method]
+#path=/no_input_method_err_but_no_problem.so
+
+[shell]
+num-workspaces=1
+shell-exe=
+
+[output]
+name=HDMI3
+#mode=1680x945
+#mode=1920x1080
+mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
+transform=90
+
+#[output]
+#name=LVDS1
+#mode=1680x1050
+#transform=90
+
+#[output]
+#name=VGA1
+#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
+#transform=90
+
+#[output]
+#name=X1
+#mode=1024x768
+#transform=flipped-270
+
+[ivi-plugin]
+modules=ico_ivi_shell.so,ico_window_mgr.so,ico_window_animation.so,ico_input_mgr.so
+
+[ivi-display]
+displayno=1,0
+
+[ivi-layer]
+# default layer id
+default=1
+# layer id at the time of the system startup
+startup=101
+# input layer id
+input=101
+# cursor layer id
+
+[ivi-animation]
+# default animation
+default=fade
+# animation time (ms)
+time=500
+# animation frame rate(frame/sec)
+fps=15
+
+[ivi-debug]
+# debug flags
+# bit.0 0=hide on surface create(for with HomeScreen)/1=show on surface create
+flag=0
+
+# 0=no debug log write(1=err/2=warn/3=info/4=debug)
+log=4
+