Name: ico-uxf-weston-plugin
Summary: Weston Plugins for IVI
-Version: 0.5.04
+Version: 0.5.05
Release: 1.1
Group: System/GUI/Libraries
License: MIT
</description>
<entry name="hide" value="0" summary="surface hide"/>
<entry name="show" value="1" summary="surface show"/>
- <entry name="hide_wo_animation" value="2" summary="hide without animation"/>
- <entry name="show_wo_animation" value="3" summary="show without animation"/>
+ <entry name="hide_animation" value="2" summary="hide with animation"/>
+ <entry name="show_animation" value="3" summary="show with animation"/>
<entry name="nochange" value="9" summary="show/hide no change"/>
</enum>
<entry name="noconfigure" value="0" summary="configure event"/>
</enum>
- <enum name="animation_change">
- <description summary="animation change type">
- Set animation for surface change.
- </description>
- <entry name="visible" value="0" summary="show/hide change"/>
- <entry name="resize" value="1" summary="surface size change"/>
- <entry name="move" value="2" summary="surface position change"/>
- </enum>
-
<request name="set_user">
<arg name="pid" type="int"/>
<arg name="appid" type="string"/>
<request name="set_animation">
<arg name="surfaceid" type="uint"/>
- <arg name="change" type="int"/>
<arg name="animation" type="string"/>
+ <arg name="time" type="int"/>
</request>
<request name="set_active">
if ((ico_option_flag() & ICO_OPTION_FLAG_UNVISIBLE) && (shsurf->visible == FALSE)) {
surface->geometry.x = (float)(ICO_IVI_MAX_COORDINATE+1);
surface->geometry.y = (float)(ICO_IVI_MAX_COORDINATE+1);
+ surface->geometry.dirty = 1;
}
switch (surface_type) {
ivi_shell_surface_configure(shsurf, x, y, width, height);
}
else {
- surface->geometry.x = x;
- surface->geometry.y = y;
- surface->geometry.width = width;
- surface->geometry.height = height;
- surface->geometry.dirty = 1;
+ weston_surface_configure(surface, x, y, width, height);
}
if (surface->output) {
struct ivi_shell *shell = shsurf->shell;
int type_changed = 0;
int num_mgr;
+ int dx, dy, dw, dh;
uifw_trace("shell_surface_configure: Enter(surf=%08x out=%08x buf=%08x)",
(int)es, (int)es->output, (int)es->buffer);
/* Surface change request from App */
uifw_trace("shell_surface_configure: App request change(sx/sy=%d/%d w/h=%d/%d)",
sx, sy, es->buffer->width, es->buffer->height);
- es->geometry.width = shsurf->geometry_width;
- es->geometry.height = shsurf->geometry_height;
- es->geometry.x = shsurf->geometry_x;
- es->geometry.y = shsurf->geometry_y;
- if (es->geometry.width > es->buffer->width) {
- es->geometry.width = es->buffer->width;
- es->geometry.x = shsurf->geometry_x +
- (shsurf->geometry_width - es->geometry.width)/2;
+ dx = shsurf->geometry_x;
+ dy = shsurf->geometry_y;
+ dw = shsurf->geometry_width;
+ dh = shsurf->geometry_height;
+ if (dw > es->buffer->width) {
+ dw = es->buffer->width;
+ dx = shsurf->geometry_x + (shsurf->geometry_width - dw)/2;
}
- if (es->geometry.height > es->buffer->height) {
- es->geometry.height = es->buffer->height;
- es->geometry.y = shsurf->geometry_y +
- (shsurf->geometry_height - es->geometry.height)/2;
+ if (dh > es->buffer->height) {
+ dh = es->buffer->height;
+ dy = shsurf->geometry_y + (shsurf->geometry_height - dh)/2;
}
+ weston_surface_configure(es, dx, dy, dw, dh);
ivi_shell_surface_configure(shsurf, es->geometry.x, es->geometry.y,
es->geometry.width, es->geometry.height);
uifw_trace("shell_surface_configure: w/h=%d/%d->%d/%d x/y=%d/%d->%d/%d",
(shsurf->visible)) {
es->geometry.x = 0;
es->geometry.y = 0;
+ es->geometry.dirty = 1;
}
configure(shell, es,
es->geometry.x + to_x - from_x,
weston_surface_damage_below(es->surface);
es->surface->geometry.x = new_x;
es->surface->geometry.y = new_y;
+ es->surface->geometry.dirty = 1;
weston_surface_damage_below(es->surface);
}
}
shsurf->restrain = restrain;
if (restrain == 0) {
+ shell_surface_configure(shsurf->surface, shsurf->geometry_x, shsurf->geometry_y);
ivi_shell_restack_ivi_layer(shell_surface_get_shell(shsurf), shsurf);
}
}
/*--------------------------------------------------------------------------*/
/**
+ * @brief ivi_shell_set_active: surface active control
+ *
+ * @param[in] shsurf shell surface(if NULL, no active surface)
+ * @param[in] restrain restrain(1)/not restrain(0)
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+WL_EXPORT int
+ivi_shell_is_restrain(struct shell_surface *shsurf)
+{
+ return shsurf->restrain;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief ivi_shell_default_animation: window default animation
*
* @param[out] msec animation time(ms)
* @brief ivi_shell_set_visible: surface visible control
*
* @param[in] shsurf shell surface
- * @param[in] visible visibility(1=visible/0=unvisible)
+ * @param[in] visible visibility(1=visible/0=unvisible/-1=system default)
* @return none
*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/**
+ * @brief ivi_shell_get_positionsize: get surface position and size
+ *
+ * @param[in] shsurf shell surface
+ * @param[out] x surface upper-left X position on screen
+ * @param[out] y surface upper-left Y position on screen
+ * @param[out] width surface width
+ * @param[out] height surface height
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+WL_EXPORT void
+ivi_shell_get_positionsize(struct shell_surface *shsurf,
+ int *x, int *y, int *width, int *height)
+{
+ *x = shsurf->geometry_x;
+ *y = shsurf->geometry_y;
+ *width = shsurf->geometry_width;
+ *height = shsurf->geometry_height;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief ivi_shell_set_positionsize: set surface position and size
*
* @param[in] shsurf shell surface
void ivi_shell_set_surface_type(struct shell_surface *shsurf);
void ivi_shell_send_configure(struct shell_surface *shsurf, const int id,
const int edges, const int width, const int height);
+void ivi_shell_get_positionsize(struct shell_surface *shsurf, int *x,
+ int *y, int *width, int *height);
void ivi_shell_set_positionsize(struct shell_surface *shsurf, const int x,
const int y, const int width, const int height);
void ivi_shell_set_layer_visible(const int layer, const int visible);
void ivi_shell_set_active(struct shell_surface *shsurf, const int target);
void ivi_shell_set_client_attr(struct wl_client *client, const int attr, const int value);
void ivi_shell_restrain_configure(struct shell_surface *shsurf, const int restrain);
+int ivi_shell_is_restrain(struct shell_surface *shsurf);
const char *ivi_shell_default_animation(int *msec, int *fps);
/* Prototypr for hook routine */
int ret;
uint32_t nowsec;
struct timeval nowtv;
+ int time;
if (op == ICO_WINDOW_MGR_ANIMATION_TYPE) {
/* convert animation name to animation type value */
(usurf->animation.current > 95)) {
usurf->animation.animation.frame_counter = 1;
usurf->animation.current = 0;
- wl_list_init(&usurf->animation.animation.link);
- output = container_of(weston_ec->output_list.next,
- struct weston_output, link);
- wl_list_insert(output->animation_list.prev, &usurf->animation.animation.link);
+ 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,
+ struct weston_output, link);
+ wl_list_insert(output->animation_list.prev,
+ &usurf->animation.animation.link);
+ }
}
else if (((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_IN) &&
(op == ICO_WINDOW_MGR_ANIMATION_OPOUT)) ||
nowsec = (uint32_t)(((long long)nowtv.tv_sec) * 1000L +
((long long)nowtv.tv_usec) / 1000L);
usurf->animation.current = 100 - usurf->animation.current;
- ret = ((usurf->animation.current) * animation_time) / 100;
+ time = (usurf->animation.time > 0) ? usurf->animation.time : animation_time;
+ ret = ((usurf->animation.current) * time) / 100;
if (nowsec >= (uint32_t)ret) {
usurf->animation.starttime = nowsec - ret;
}
}
else if (usurf->animation.type == ANIMA_FADE) {
usurf->animation.animation.frame = animation_fade;
- ivi_shell_restrain_configure(usurf->shsurf, 1);
(*usurf->animation.animation.frame)(&usurf->animation.animation, NULL, 1);
}
else {
int par;
uint32_t nowsec;
struct timeval nowtv;
+ int time;
gettimeofday(&nowtv, NULL);
nowsec = (uint32_t)(((long long)nowtv.tv_sec) * 1000L +
nowsec = (uint32_t)(((long long)0x100000000L) +
((long long)nowsec) - ((long long)usurf->animation.starttime));
}
- if (((output == NULL) && (msecs == 0)) || (nowsec >= ((uint32_t)animation_time))) {
+ time = (usurf->animation.time > 0) ? usurf->animation.time : animation_time;
+ if (((output == NULL) && (msecs == 0)) || (nowsec >= ((uint32_t)time))) {
par = 100;
}
else {
- par = (nowsec * 100 + animation_time / 2) / animation_time;
+ par = (nowsec * 100 + time / 2) / time;
if (par < 2) par = 2;
}
if ((par >= 100) ||
uint32_t surfaceid, int32_t visible, int32_t raise);
/* set surface animation */
static void uifw_set_animation(struct wl_client *client, struct wl_resource *resource,
- uint32_t surfaceid, int32_t change, const char *animation);
+ uint32_t surfaceid, const char *animation, int32_t time);
/* set active surface (form HomeScreen) */
static void uifw_set_active(struct wl_client *client, struct wl_resource *resource,
uint32_t surfaceid, uint32_t target);
*height = usurf->height;
surface->geometry.x = usurf->x;
surface->geometry.y = usurf->y;
+ surface->geometry.dirty = 1;
}
else {
uifw_trace("win_mgr_map_surface: HomeScreen not regist Surface, "
/* HomeScreen exist, coodinate set by HomeScreen */
surface->geometry.x = 0;
surface->geometry.y = 0;
-
- /* change surface size, because HomeScreen change surface size */
- *width = 1;
- *height = 1;
uifw_trace("win_mgr_map_surface: Change size and position");
}
else {
int32_t x, int32_t y, int32_t width, int32_t height)
{
struct uifw_client *uclient;
+ int cx, cy, cwidth, cheight;
uifw_trace("uifw_set_positionsize: Enter res=%08x surf=%08x x/y/w/h=%d/%d/%d/%d",
(int)resource, surfaceid, x, y, width, height);
struct weston_surface *es = usurf->surface;
/* if x,y,width,height bigger then ICO_IVI_MAX_COORDINATE, no change */
- 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;
+ ivi_shell_get_positionsize(usurf->shsurf, &cx, &cy, &cwidth, &cheight);
+ 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;
/* check animation */
- if ((usurf->animation.type != ICO_WINDOW_MGR_ANIMATION_NONE) &&
- (usurf->animation.state != ICO_WINDOW_MGR_ANIMATION_STATE_NONE) &&
- (win_mgr_hook_animation != NULL) &&
+ if ((ivi_shell_is_restrain(usurf->shsurf)) &&
(x == usurf->x) && (y == usurf->y) &&
(width == usurf->width) && (height == usurf->height)) {
uifw_trace("uifw_set_positionsize: Leave(same position size at animation)");
}
if ((visible == ICO_WINDOW_MGR_VISIBLE_SHOW) ||
- (visible == ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION)) {
+ (visible == ICO_WINDOW_MGR_VISIBLE_SHOW_ANIMATION)) {
+
if ((usurf->width <= 0) || (usurf->height <= 0)) {
/* not declare surface geometry, initialize */
usurf->width = usurf->surface->geometry.width;
uifw_set_weston_surface(usurf);
ivi_shell_set_surface_type(usurf->shsurf);
- if ((visible == ICO_WINDOW_MGR_VISIBLE_SHOW) &&
+ if ((visible == ICO_WINDOW_MGR_VISIBLE_SHOW_ANIMATION) &&
(usurf->animation.type != ICO_WINDOW_MGR_ANIMATION_NONE) &&
(win_mgr_hook_animation != NULL)) {
animation = (*win_mgr_hook_animation)(ICO_WINDOW_MGR_ANIMATION_OPIN,
}
}
else if ((visible == ICO_WINDOW_MGR_VISIBLE_HIDE) ||
- (visible == ICO_WINDOW_MGR_VISIBLE_HIDE_WO_ANIMATION)) {
+ (visible == ICO_WINDOW_MGR_VISIBLE_HIDE_ANIMATION)) {
if (ivi_shell_is_visible(usurf->shsurf)) {
uifw_set_weston_surface(usurf);
animation = ICO_WINDOW_MGR_ANIMATION_RET_ANIMA;
- if ((visible == ICO_WINDOW_MGR_VISIBLE_HIDE) &&
+ if ((visible == ICO_WINDOW_MGR_VISIBLE_HIDE_ANIMATION) &&
(usurf->animation.type > 0) &&
(win_mgr_hook_animation != NULL)) {
animation = (*win_mgr_hook_animation)(ICO_WINDOW_MGR_ANIMATION_OPOUT,
ico_win_mgr_send_to_mgr(ICO_WINDOW_MGR_WINDOW_VISIBLE,
surfaceid, NULL,
(visible == ICO_WINDOW_MGR_VISIBLE_SHOW) ||
- (visible == ICO_WINDOW_MGR_VISIBLE_SHOW_WO_ANIMATION) ? 1 :
+ (visible == ICO_WINDOW_MGR_VISIBLE_SHOW_ANIMATION) ? 1 :
((visible == ICO_WINDOW_MGR_VISIBLE_HIDE) ||
- (visible == ICO_WINDOW_MGR_VISIBLE_HIDE_WO_ANIMATION) ? 0 :
+ (visible == ICO_WINDOW_MGR_VISIBLE_HIDE_ANIMATION) ? 0 :
ICO_WINDOW_MGR_VISIBLE_NOCHANGE),
raise, uclient ? 0 : 1, 0,0,0);
* @param[in] client Weyland client
* @param[in] resource resource of request
* @param[in] surfaceid UIFW surface id
- * @param[in] change change type(show/hide,reeize,move)
* @param[in] anmation animation name
+ * @param[in] time animation time(ms), if 0, default time
* @return none
*/
/*--------------------------------------------------------------------------*/
static void
uifw_set_animation(struct wl_client *client, struct wl_resource *resource,
- uint32_t surfaceid, int32_t change, const char *animation)
+ uint32_t surfaceid, const char *animation, int time)
{
struct uifw_win_surface* usurf = find_uifw_win_surface_by_id(surfaceid);
- uifw_trace("uifw_set_transition: Enter(surf=%08x, change=%d, animation=%s)",
- surfaceid, change, animation);
+ uifw_trace("uifw_set_transition: Enter(surf=%08x, animation=%s, time=%d)",
+ surfaceid, animation, time);
if (usurf) {
- if (change != ICO_WINDOW_MGR_ANIMATION_CHANGE_VISIBLE) {
- uifw_trace("uifw_set_animation: Leave(change type(%d9 not support)", change);
- }
- else {
+ if ((*animation != 0) && (*animation != ' ')) {
usurf->animation.type_next = ico_get_animation_type(animation);
uifw_trace("uifw_set_animation: Leave(OK) type=%d", usurf->animation.type_next);
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_NONE) {
usurf->animation.type = usurf->animation.type_next;
}
}
+ if (time > 0) {
+ usurf->animation.time = time;
+ }
}
else {
uifw_trace("uifw_set_animation: Leave(Surface(%08x) Not exist)", surfaceid);
struct weston_animation animation; /* animation control */
short type; /* animation type */
short type_next; /* next animation type */
+ short time; /* animation time */
short current; /* animation current percentage */
char state; /* animation state */
char visible; /* need visible(1)/hide(2) at end of animation*/
+ char res[2]; /* (unused) */
uint32_t starttime; /* start time(ms) */
} animation;
void *animadata; /* animation data */
char *args[10];
int narg;
int surfaceid;
+ int time;
narg = pars_command(buf, args, 10);
if (narg >= 2) {
surfaceid = search_surface(display, args[0]);
if (surfaceid >= 0) {
- print_log("HOMESCREEN: animation(%s,%08x,%d)", args[0], surfaceid, args[1]);
+ if (narg >= 3) {
+ time = strtol(args[2], (char **)0, 0);
+ }
+ else {
+ time = 0;
+ }
+ print_log("HOMESCREEN: animation(%s,%08x,%s,%d)",
+ args[0], surfaceid, args[1], time);
ico_window_mgr_set_animation(display->ico_window_mgr, surfaceid,
- ICO_WINDOW_MGR_ANIMATION_CHANGE_VISIBLE, args[1]);
+ args[1], time);
}
else {
print_log("HOMESCREEN: Unknown surface(%s) at animation command", args[0]);
}
else {
print_log("HOMESCREEN: animation command"
- "[animation appid animation] has no argument");
+ "[animation appid animation time] has no argument");
}
}