struct wl_pointer *pointer = NULL;
struct wl_keyboard *keyboard = NULL;
struct wl_touch *touch = NULL;
+struct wl_output *output = NULL;
struct xkb_context *xkb_context = NULL;
struct xkb_keymap *keymap = NULL;
struct tizen_policy *tz_policy = NULL;
tizen_launch_appinfo_register_appid(tz_appinfo, "com.samsung.clocksetting");
tizen_launch_appinfo_set_pid(tz_appinfo, "com.samsung.clocksetting", 4077);
}
+ else if(strcmp(interface, "wl_output") == 0)
+ {
+ output = wl_registry_bind(registry, id, &wl_output_interface, 2);
+ }
}
static void
#include "DSWaylandOutput.h"
#include "DSWaylandOutputPrivate.h"
+#include "DSWaylandClient.h"
+#include "DSTizenAppinfoMgr.h"
namespace display_server
{
void DSWaylandOutputPrivate::output_bind_resource(wl_output::Resource *resource)
{
- sendWaylandOutputInfo(resource);
+ DSLOG_DBG("DSWaylandOutputPriv", "");
+ int res_w, res_h;
+
+ /* TODO: if the config of configured_output_resolution.use is set, use the congigured resolution values */
+ //if (e_config->configured_output_resolution.use)
+ //{
+ if (!getBaseResolutionFromAppinfo(resource, &res_w, &res_h)) {
+ /* TODO: Read configured resolution values */
+ }
+ //}
+ //else
+ //{
+ res_w = __outputRect.w;
+ res_h = __outputRect.h;
+ //}
+ sendWaylandOutputInfo(resource, res_w, res_h);
}
void DSWaylandOutputPrivate::output_destroy_resource(Resource *resource)
void DSWaylandOutputPrivate::sendWaylandOutputInfo(Resource *resource)
{
+ DSLOG_DBG("DSWaylandOutputPriv", "outputRect.x,y,w,h: (%d,%d,%d,%d), phyWidth,Height: (%d,%d)", __outputRect.x, __outputRect.y, __outputRect.w, __outputRect.h, __phyWidth, __phyHeight);
wl_output::send_scale(resource->handle, __scale);
wl_output::send_geometry(resource->handle, __outputRect.x, __outputRect.y, __phyWidth, __phyHeight, __subpixel, __make, __model, __transform);
wl_output::send_mode(resource->handle, mode_current | mode_preferred, __outputRect.w, __outputRect.h, __refresh);
wl_output::send_done(resource->handle);
}
+void DSWaylandOutputPrivate::sendWaylandOutputInfo(Resource *resource, int res_w, int res_h)
+{
+ DSLOG_DBG("DSWaylandOutputPriv", "resolution width,hight: (%d,%d)", res_w, res_h);
+ int w, h, phyw, phyh;
+
+ /* TODO: calculate the ratio of resolution width/height and output values and change the configured output resolution and configured physical size */
+ w = __outputRect.w;
+ h = __outputRect.h;
+ phyw = __phyWidth;
+ phyh = __phyHeight;
+
+ wl_output::send_scale(resource->handle, __scale);
+ wl_output::send_geometry(resource->handle, __outputRect.x, __outputRect.y, phyw, phyh, __subpixel, __make, __model, __transform);
+ wl_output::send_mode(resource->handle, mode_current | mode_preferred, w, h, __refresh);
+ wl_output::send_done(resource->handle);
+}
+
+bool DSWaylandOutputPrivate::getBaseResolutionFromAppinfo(Resource *resource, int *w, int *h)
+{
+ DSWaylandClient *client = DSWaylandClient::fromWlClient(resource->client());
+ DSTizenAppinfoMgr *appinfoMgr = DSTizenAppinfoMgr::getInstance();
+ pid_t pid = -1;
+ int res_w, res_h;
+ bool res = false;
+
+ pid = client->pid();
+ if (pid <= 0) {
+ return false;
+ }
+ res = appinfoMgr->getBaseOutputResolution(pid, &res_w, &res_h);
+ if (!res)
+ return false;
+
+ if (w) *w = res_w;
+ if (h) *h = res_h;
+
+ DSTizenAppinfoMgr::releaseInstance();
+ return true;
+}
+
void DSWaylandOutputPrivate::sendWaylandOutputInfo(void)
{
std::multimap<struct ::wl_client*, Resource*>::iterator iter;