예제 #1
0
static void
surface_leave(void *data,
	      struct wl_surface *wl_surface, struct wl_output *output)
{
	struct surface *surface = data;

	surface->output = NULL;

	fprintf(stderr, "test-client: got surface leave output %p\n",
		wl_output_get_user_data(output));
}
예제 #2
0
static void
surface_enter(void *data,
	      struct wl_surface *wl_surface, struct wl_output *output)
{
	struct surface *surface = data;

	surface->output = wl_output_get_user_data(output);

	fprintf(stderr, "test-client: got surface enter output %p\n",
		surface->output);
}
예제 #3
0
파일: output.c 프로젝트: ppaalanen/oring
/** Safe cast from wl_output
 *
 * \param wo The wl_output to cast from.
 * \return The corresponding struct output, or NULL.
 *
 * This is safe to call with NULL. The returned pointer is non-NULL only
 * if the wl_output really has a struct output associated.
 */
struct output *
output_from_wl_output(struct wl_output *wo)
{
	const void *impl;

	if (!wo)
		return NULL;

	impl = wl_proxy_get_listener((struct wl_proxy *)wo);
	if (impl != &output_listener)
		return NULL;

	return wl_output_get_user_data(wo);
}
예제 #4
0
파일: wl_window.c 프로젝트: mcleary/glfw
static void handleEnter(void *data,
                        struct wl_surface *surface,
                        struct wl_output *output)
{
    _GLFWwindow* window = data;
    _GLFWmonitor* monitor = wl_output_get_user_data(output);

    if (window->wl.monitorsCount + 1 > window->wl.monitorsSize)
    {
        ++window->wl.monitorsSize;
        window->wl.monitors =
            realloc(window->wl.monitors,
                    window->wl.monitorsSize * sizeof(_GLFWmonitor*));
    }

    window->wl.monitors[window->wl.monitorsCount++] = monitor;

    checkScaleChange(window);
}
예제 #5
0
파일: wl_window.c 프로젝트: mcleary/glfw
static void handleLeave(void *data,
                        struct wl_surface *surface,
                        struct wl_output *output)
{
    _GLFWwindow* window = data;
    _GLFWmonitor* monitor = wl_output_get_user_data(output);
    GLFWbool found;
    int i;

    for (i = 0, found = GLFW_FALSE; i < window->wl.monitorsCount - 1; ++i)
    {
        if (monitor == window->wl.monitors[i])
            found = GLFW_TRUE;
        if (found)
            window->wl.monitors[i] = window->wl.monitors[i + 1];
    }
    window->wl.monitors[--window->wl.monitorsCount] = NULL;

    checkScaleChange(window);
}
예제 #6
0
                                     int x,
                                     int y,
                                     int physical_width,
                                     int physical_height,
                                     int subpixel,
                                     const char* make,
                                     const char* model,
                                     int transform)
{
    printf("Output geometry: {x='%d', y='%d', "
           "ph_width='%d', ph_height='%d', subpixel='%d', "
           "make='%s', model='%s', transform='%d'}\n",
           x, y, physical_width, physical_height, subpixel,
           make, model, transform);

    NoiaCtlOutput* ctl_output = wl_output_get_user_data(output);
    ctl_output->x  = x;
    ctl_output->y  = y;
    ctl_output->pw = physical_width;
    ctl_output->ph = physical_height;
}

//------------------------------------------------------------------------------

void noia_controller_output_mode(void* data NOIA_UNUSED,
                                 struct wl_output* output,
                                 uint32_t flags,
                                 int width,
                                 int height,
                                 int refresh)
{