/*
 * Copyright (c) 2005 Brian Tarricone <bjt23@cornell.edu>
 *
 * Silly GDK hack to make your app thinks it has two Xinerama-enabled monitors
 * instead of a single-head setup.  It's not configurable, and isn't useful
 * for anything but test purposes.
 *
 * License is hereby granted to do whatever you wish with this file, provided
 * you leave the above copyright notice intact.  This is provided WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.
 *
 * To compile:
 * gcc -shared -o libgdk-xinerama-hack.so gdk-xinerama-hack.c \
 *     `pkg-config gdk-2.0 --cflags`
 *
 * To use:
 * LD_PRELOAD=libgdk-xinerama-hack.so app_to_run
 */

#include <gdk/gdk.h>

gint
gdk_screen_get_n_monitors(GdkScreen *screen)
{
	g_return_val_if_fail(GDK_IS_SCREEN(screen), 0);
	
	return 2;
}

void
gdk_screen_get_monitor_geometry(GdkScreen *screen,
                                gint monitor_num,
                                GdkRectangle *dest)
{
	gint w, h;
	
	g_return_if_fail(GDK_IS_SCREEN(screen) && dest && monitor_num < 2);
	
	w = gdk_screen_get_width(screen);
	h = gdk_screen_get_height(screen);
	
	dest->x = monitor_num * (w/2);
	dest->y = 0;
	dest->width = w/2;
	dest->height = h;
}
