GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AG_DRIVERMW(3) FreeBSD Library Functions Manual AG_DRIVERMW(3)

AG_DriverMwagar multiple-window driver class

#include <agar/core.h>
#include <agar/gui.h>

AG_DriverMw is a subclass of AG_Driver(3) for "multiple-window" drivers (i.e., drivers where Agar must interface with a native window system).

AG_Driver(3) -> AG_DriverMw.

The AG_DriverMwClass structure describes a "multiple-window" graphics driver, where Agar will need to interface with an existing window manager. AG_DriverMwClass inherits from AG_DriverClass and is defined as follows:

typedef struct ag_driver_mw_class {
	struct ag_driver_class _inherit;

	/* Create / destroy window */
	int  (*openWindow)(AG_Window *win, const AG_Rect *r, int bpp,
	                   Uint flags);
	void (*closeWindow)(AG_Window *win);

	/* Set window visibility */
	int (*mapWindow)(AG_Window *win);
	int (*unmapWindow)(AG_Window *win);

	/* Configure stacking order and parenting */
	int (*raiseWindow)(AG_Window *win);
	int (*lowerWindow)(AG_Window *win);
	int (*reparentWindow)(AG_Window *win, AG_Window *winParent,
	                      int x, int y);

	/* Change and query input focus state */
	int (*getInputFocus)(AG_Window **win);
	int (*setInputFocus)(AG_Window *win);

	/* Move and resize windows */
	int  (*moveWindow)(AG_Window *win, int x, int y);
	int  (*resizeWindow)(AG_Window *win, Uint w, Uint h);
	int  (*moveResizeWindow)(AG_Window *win, AG_SizeAlloc *a);
	void (*preResizeCallback)(AG_Window *win);
	void (*postResizeCallback)(AG_Window *win, AG_SizeAlloc *a);

	/* Configure window parameters */
	int  (*setBorderWidth)(AG_Window *win, Uint w);
	int  (*setWindowCaption)(AG_Window *win, const char *s);
	void (*setTransientFor)(AG_Window *win, AG_Window *winParent);
	int  (*setOpacity)(AG_Window *win, float opacity);
	void (*tweakAlignment)(AG_Window *win, AG_SizeAlloc *a);
        void (*setWindowMinSize)(AG_Window *win, int w, int h);
        void (*setWindowMaxSize)(AG_Window *win, int w, int h);
} AG_DriverMwClass;

The () operation opens a new "native" window corresponding to an AG_Window(3) that is in the process of being created, returning 0 on success or -1 on failure. The r argument specifies the preferred location and geometry of the window, in pixels. bpp specifies a preferred depth in bits per pixels. The following flags are recognized:

AG_DRIVER_MW_ANYPOS
Ignore the coordinates in r and let the underlying window system select some default coordinates.

() and () make a window visible or invisible, returning 0 on success and -1 on failure.

() and () respectively raise and lower the window, returning 0 on success and -1 on failure. The () function arranges for the window to become a child of winParent, moving it to parent-relative coordinates x, y. The function should return 0 on success or -1 on failure.

The () operation retrieves a pointer to the window currently holding focus, returning 0 on success. If the focus is external to the Agar application, it should return -1. () gives focus to the specified window, returning 0 on success or -1 on failure.

The (), () and () operations respectively move, resize or move+resize a window to specified coordinates and geometry, returning 0 on success or -1 on failure.

The () operation is invoked prior to a window resize, and () is invoked following a window resize (the new window geometry is passed as the a argument).

() configures a window border size in pixels, returning 0 on success or -1 if the operation is unsupported or an error has occurred.

() sets the associated window caption text, if supported by the window system. The string passed to the function may contain characters in UTF-8 encoding. The function should return 0 on success or -1 on failure.

() passes a hint to the window manager that the window should be marked as "transient" for the specified window winParent. This operation is optional and window manager specific.

() passes a window opacity argument (ranging from 0.0 to 1.0) to the underlying window manager.

The optional () operation allows the driver to override or alter the effect of the window alignment request (set by AG_WindowSetPosition(3) or AG_WindowSetGeometryAligned(3)), such that underlying WM-specific items (desktop panels and such) can be taken into consideration (by default, the display boundaries are used). This routine should set the x and y members of a, in function of w and h.

The optional () and () operations set a minimum and a maximum window size in pixels.

AG_Driver(3), AG_DriverSw(3), AG_InitGraphics(3), AG_Intro(3)

The AG_DriverMw class first appeared in Agar 1.4.0.

February 18, 2023 Agar 1.7

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.