if ENABLE_IVI_SHELL
module_LTLIBRARIES += \
- $(ivi_layout) \
$(ivi_shell) \
$(hmi_controller)
-ivi_layout = ivi-layout.la
-ivi_layout_la_LDFLAGS = -module -avoid-version
-ivi_layout_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la
-ivi_layout_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
-ivi_layout_la_SOURCES = \
- ivi-shell/ivi-layout-export.h \
- ivi-shell/ivi-layout-private.h \
- ivi-shell/ivi-layout.c \
- ivi-shell/ivi-layout-transition.c
-
ivi_shell = ivi-shell.la
ivi_shell_la_LDFLAGS = -module -avoid-version
ivi_shell_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la
ivi_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
ivi_shell_la_SOURCES = \
+ ivi-shell/ivi-layout-export.h \
+ ivi-shell/ivi-layout-private.h \
+ ivi-shell/ivi-layout.c \
+ ivi-shell/ivi-layout-transition.c \
ivi-shell/ivi-shell.h \
ivi-shell/ivi-shell.c \
- ivi-shell/ivi-layout-private.h \
ivi-shell/input-panel-ivi.c
nodist_ivi_shell_la_SOURCES = \
protocol/ivi-application-protocol.c \
struct ivi_layout_surface *ivisurf,
uint32_t duration);
-struct ivi_layout_interface {
- struct weston_view *(*get_weston_view)(
- struct ivi_layout_surface *surface);
-
- void (*surface_configure)(struct ivi_layout_surface *ivisurf,
- int32_t width,
- int32_t height);
-
- struct ivi_layout_surface *(*surface_create)(
- struct weston_surface *wl_surface,
- uint32_t id_surface);
-
- void (*init_with_compositor)(struct weston_compositor *ec);
-
- int32_t (*get_surface_dimension)(
- struct ivi_layout_surface *ivisurf,
- int32_t *dest_width,
- int32_t *dest_height);
-
- void (*add_surface_configured_listener)(
- struct ivi_layout_surface *ivisurf,
- struct wl_listener* listener);
-};
-
+/**
+ * methods of interaction between ivi-shell with ivi-layout
+ */
+struct weston_view *
+ivi_layout_get_weston_view(struct ivi_layout_surface *surface);
+void
+ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
+ int32_t width, int32_t height);
+struct ivi_layout_surface*
+ivi_layout_surface_create(struct weston_surface *wl_surface,
+ uint32_t id_surface);
+void
+ivi_layout_init_with_compositor(struct weston_compositor *ec);
+int32_t
+ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf,
+ int32_t *dest_width, int32_t *dest_height);
+void
+ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
+ struct wl_listener* listener);
#endif
return 0;
}
-/***called from ivi-shell**/
-static struct weston_view *
+/**
+ * methods of interaction between ivi-shell with ivi-layout
+ */
+struct weston_view *
ivi_layout_get_weston_view(struct ivi_layout_surface *surface)
{
struct weston_view *tmpview = NULL;
return tmpview;
}
-static void
+void
ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
int32_t width, int32_t height)
{
}
}
-WL_EXPORT int32_t
+int32_t
ivi_layout_surface_set_content_observer(struct ivi_layout_surface *ivisurf,
ivi_controller_surface_content_callback callback,
void* userdata)
return ret;
}
-static struct ivi_layout_surface*
+struct ivi_layout_surface*
ivi_layout_surface_create(struct weston_surface *wl_surface,
uint32_t id_surface)
{
return ivisurf;
}
-static void
+void
ivi_layout_init_with_compositor(struct weston_compositor *ec)
{
struct ivi_layout *layout = get_instance();
}
-static void
+void
ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
struct wl_listener* listener)
{
wl_signal_add(&ivisurf->configured, listener);
}
-WL_EXPORT struct ivi_layout_interface ivi_layout_interface = {
- .get_weston_view = ivi_layout_get_weston_view,
- .surface_configure = ivi_layout_surface_configure,
- .surface_create = ivi_layout_surface_create,
- .init_with_compositor = ivi_layout_init_with_compositor,
- .get_surface_dimension = ivi_layout_surface_get_dimension,
- .add_surface_configured_listener = ivi_layout_surface_add_configured_listener
-};
#include "ivi-shell.h"
#include "ivi-application-server-protocol.h"
+#include "ivi-layout-export.h"
#include "ivi-layout-private.h"
#include "../shared/os-compatibility.h"
int32_t dest_width = 0;
int32_t dest_height = 0;
- shell_surf->shell->ivi_layout->get_surface_dimension(layout_surf,
- &dest_width, &dest_height);
+
+ ivi_layout_surface_get_dimension(layout_surf,
+ &dest_width, &dest_height);
if (shell_surf->resource)
ivi_surface_send_configure(shell_surf->resource,
if (surface->width == 0 || surface->height == 0 || ivisurf == NULL)
return;
- view = ivisurf->shell->ivi_layout->get_weston_view(ivisurf->layout_surface);
+ view = ivi_layout_get_weston_view(ivisurf->layout_surface);
+
if (view == NULL)
return;
view->geometry.y + to_y - from_y);
weston_view_update_transform(view);
- ivisurf->shell->ivi_layout->surface_configure(ivisurf->layout_surface,
- surface->width, surface->height);
+ ivi_layout_surface_configure(ivisurf->layout_surface,
+ surface->width, surface->height);
}
}
resource, IVI_APPLICATION_ERROR_ROLE) < 0)
return;
- layout_surface = shell->ivi_layout->surface_create(weston_surface,
- id_surface);
+ layout_surface = ivi_layout_surface_create(weston_surface, id_surface);
/* check if id_ivi is already used for wl_surface*/
if (layout_surface == NULL){
ivisurf->height = 0;
ivisurf->layout_surface = layout_surface;
ivisurf->configured_listener.notify = surface_configure_notify;
- ivisurf->shell->ivi_layout->add_surface_configured_listener(layout_surface,
- &ivisurf->configured_listener);
-
+ ivi_layout_surface_add_configured_listener(layout_surface,
+ &ivisurf->configured_listener);
/*
* The following code relies on wl_surface destruction triggering
* immediateweston_surface destruction
shsurf = get_ivi_shell_surface(surface);
if (shsurf && shsurf->layout_surface) {
- view = shsurf->shell->ivi_layout->get_weston_view(shsurf->layout_surface);
+ view = ivi_layout_get_weston_view(shsurf->layout_surface);
if (view)
return view;
}
int *argc, char *argv[])
{
struct ivi_shell *shell;
- char ivi_layout_path[PATH_MAX];
- void *module;
struct ivi_shell_setting setting = { };
shell = zalloc(sizeof *shell);
if (ivi_shell_setting_create(&setting, compositor) != 0)
return -1;
- /*
- * load module:ivi-layout
- * ivi_layout_interface is referred by ivi-shell to use ivi-layout.
- * The reason why the following code is written newly without
- * using weston_load_module is it doesn't open library with
- * RTLD_GLOBAL option.
- */
- snprintf(ivi_layout_path, sizeof ivi_layout_path,
- "%s/%s", MODULEDIR, "ivi-layout.so");
- module = dlopen(ivi_layout_path, RTLD_NOW | RTLD_NOLOAD);
- if (module) {
- weston_log("ivi-shell: Module '%s' already loaded\n",
- ivi_layout_path);
- dlclose(module);
- return -1;
- }
-
- weston_log("ivi-shell: Loading module '%s'\n", ivi_layout_path);
- module = dlopen(ivi_layout_path, RTLD_NOW | RTLD_GLOBAL);
- if (!module) {
- weston_log("ivi-shell: Failed to load module: %s\n", dlerror());
- return -1;
- }
-
- shell->ivi_layout = dlsym(module,"ivi_layout_interface");
- if (!shell->ivi_layout){
- weston_log("ivi-shell: couldn't find ivi_layout_interface in '%s'\n", ivi_layout_path);
- free(setting.ivi_module);
- dlclose(module);
- return -1;
- }
+ ivi_layout_init_with_compositor(compositor);
- shell->ivi_layout->init_with_compositor(compositor);
/* Call module_init of ivi-modules which are defined in weston.ini */
if (ivi_load_modules(compositor, setting.ivi_module, argc, argv) < 0) {
free(setting.ivi_module);
- dlclose(module);
return -1;
}
struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */
- struct ivi_layout_interface *ivi_layout;
-
struct wl_listener show_input_panel_listener;
struct wl_listener hide_input_panel_listener;
struct wl_listener update_input_panel_listener;