cross platform xinerama API proposal



Hi All,

You'll find attached a API proposal (5 fcts) for xinerama like support.
I've looked at MS support for multiple monitors and tried to 
come up with an API that could be used be the X11 and windows port 
of GDK at the same time.

This API is based on the multihead branch. A virtual screen 
is made of n monitors. The virtual screen is represented by the
unique GdkScreen of the GdkDisplay in xinerama like mode.
monitors are the physical screens.

Basically all the virtual screen functions are logically
attached to a GdkDisplay object and the unique GdkScreen for
that GdkDisplay object is the virtual screen.

Please tell me if you think the API is :
- sufficient for xinerama like support.
- appropriate.
- if the function naming is ok (feel free to suggests something
  more appropriate).
  
attached the proposed function signatures and docs.  

Cheers,

Erwann

[ I speak for myself, not for my employer. ]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Erwann Chénedé, Sun Microsystems Ireland
  Desktop Applications & Middleware Group
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

/* Virtual Screen with multiple monitors API proposal*/

/**
 * gdk_display_use_virtual_screen:
 * @display : a #GdkDisplay.
 *
 * Returns TRUE if @display is uses multiple montiors as
 * a single virtual screen (e.g. Xinerama mode under X).
 *
 * Returns: TRUE if multiple monitors are used as a single
 *          Screen.
 */
gboolean gdk_display_use_virtual_screen (GdkDisplay *display);

/**
 * gdk_display_get_num_monitors:
 * @display : a #GdkDisplay.
 *
 * Returns the number of monitors being part of the virtual screen
 *
 * Returns: number of monitors part of the virtual screen or
 *          0 if @display is not in vitrual screen mode.
 */
gint gdk_display_get_num_monitors (GdkDisplay *display);

/**
 * gdk_display_get_monitor_geometry:
 * @display : a #GdkDisplay.
 * @num_monitor : the monitor number. 
 *
 * Returns a #GdkRectangle representing the size and start
 * coordinates of the screen with respect to the virtual screen.
 * 
 * Note that the virtual screen coordinates can be retrieved via 
 * gdk_screen_get_[width|height] as the virtual screen is the only
 * GdkScreen associated with the #GdkDisplay @display.
 *
 * Returns: the size and start position of the monitor wrt to
 *	    the virtual screen.
 */
GdkRectangle *gdk_display_get_monitor_geometry (GdkDisplay *display, gint num_monitor);

/**
 * gdk_display_get_monitor_num_at_point:
 * @display : a #GdkDisplay.
 * @x : the x coordinate in the virtual screen.
 * @y : the y coordinate in the virtual screen.
 *
 * Returns the monitor number in which the point (@x,@y) is located.
 *
 * Returns: the monitor number in which the point (@x,@y) belong.
 */
gint gdk_display_get_monitor_num_at_point (GdkDisplay *display, gint x, gint y);
/**
 * gdk_display_get_monitor_num_at_window:
 * @display : a #GdkDisplay.
 * @anid : a #GdkDrawable ID.
 *
 * Returns the monitor number in which the largest area of the bounding rectangle
 * of @anid resides.
 *
 * Returns: the monitor number in which most of @anid is located.
 */
gint gdk_display_get_monitor_num_at_window (GdkDisplay *display, GdkNativeWindow anid);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]