ttysw_output( )
Appends len number of characters from buf onto tty’s output queue; it sends them
through the terminal emulator to the TTY. It returns the number of characters ac-
cepted.
int
ttysw_output(tty, buf, len)
Tty tty;
char *buf;
int len;
window_done()
Destroys the entire hierarchy to which win belongs.
int
window_done(win)
Xv_Window win;
window_fit()
This macro causes win to fit its contents in the dimensions specified with
WIN_FIT_HEIGHT and WIN_FIT_WIDTH. It is defined as:
xv_set(win, WIN_FIT_HEIGHT, 0, WIN_FIT_WIDTH, 0, NULL)
window_fit_height()
Causes win to fit its contents in the height specified with WIN_FIT_HEIGHT. The
macro is defined as:
xv_set(win, WIN_FIT_HEIGHT, 0, NULL)
window_fit_width( )
Causes win to fit its contents in the width specified with WIN_FIT_WIDTH. The macro
is defined as:
xv_set(win, WIN_FIT_WIDTH, 0, NULL)
window_read_event()
Reads the next input event for window. In case of error, sets the global variable
errno and returns -1.
int
window_read_event(window, event)
Xv_window window;
Event *event;
win_set_kbd_focus
Assigns input focus (via XSetInputFocus()) to the passed window.
int
win_set_kbd_focus(window, xid)
Xv_Window window; /* XView window to set focus on */
XID xid; /* XID of XView window */
210 XView Reference Manual
wmgr_bottom()
This procedure is a SunView Compatibility procedure. Sets stackmode to Below in
XConfigureWindow.
void
wmgr_bottom(frame)
Frame frame;
wmgr_changelevel()
This procedure is a SunView Compatibility procedure. It sets the stackmode in XCon-
figureWindow.
void
wmgr_changelevel(window,parent,top)
Xv_Window window;
int parent;
int top;
wmgr_close()
Sets wmhints.initial_state to ICONICSTATE.
void
wmgr_close(frame)
Frame frame;
wmgr_completechangerect()
Calls XConfigureWindow with a new rect.
void
wmgr_completechangerect(window, rectnew, rectoriginal,
parentprleft, parentprtop)
Xv_window window;
Rect *rectnew, *rectoriginal;
int parentprleft, parentprtop;
wmgr_open()
Sets wmhints.initial_state to NORMALSTATE.
void
wmgr_open(frame)
Frame frame;
wmgr_refreshwindow()
Calls XConfigureWindow repeatedly.
void
wmgr_refreshwindow(window)
Xv_window window;
Procedures and Macros
Procedures and Macros 211
wmgr_top( )
Sets stackmode to Above in XConfigureWindow.
void
wmgr_top(frame)
Frame frame;
xv_col( )
Returns an integer representing the number of pixels, excluding the left margin of the
window. This may be used in conjunction with a panel’s WIN_COL_GAG.
int
xv_col(window, column)
Xv_Window window;
int column;
xv_cols()
Returns an integer representing the number of pixels, including the left margin of the
window.
int
xv_cols(window, columns)
Xv_Window window;
int columns;
xv_create()
To create any XView object, call the generic procedure xv_create. This procedure
will return a handle to some XView object. It takes as parameters the owner of the
object being created, the type of object to create, and a list of attributes. The attribute
list must terminate with a NULL. In specifying the type, you must use the name of some
XView package. That name must be in all capital letters to distinguish it from the cor-
responding data type. The package is the name of the package to which the object you
wish to create belongs.
The procedure xv_create() returns either the handle for the new object or
XV_NULL if the attempt at object creation fails.
Xv_opaque
xv_create(owner, package, attributes)
Xv_object owner;
Xv_pkg *package;
attribute-list
attributes;
xv_destroy( )
To destroy an XView object and any subframes owned by that object, use the proce-
dure xv_destroy(). It will return either
XV_ERROR or XV_OK.
int
xv_destroy(object)
Xv_object object;
212 XView Reference Manual
XV_DISPLAY_FROM_WINDOW( )
Macro to get at the handle of the display structure from a window object.
Xv_opaque
XV_DISPLAY_FROM_WINDOW(window)
Xv_Window window;
xv_error()
Is called by the XView internals in the event of an error.
char *
xv_error(object, attributes)
Xv_opaque object;
attribute-list
attributes;
xv_error_format()
This function calls a pointer to a static char * describing the XView error that has
occurred. It should be copied into your buffer if you wish to retain the value since sub-
sequent calls overwrite the contents.
char *
xv_error_format(object, avlist)
Xv_object object;
Attr_avlist avlist;
xv_find()
To find any XView object, use the procedure xv_find(). If the object is not found,
xv_find will automatically attempt to create it.
Xv_opaque
xv_find(owner, package, attributes)
Xv_object owner;
Xv_pkg *package;
attribute-list
attributes;
xv_get()
To get the value of any single attribute of any XView object, use the procedure
xv_get().
Xv_opaque
xv_get(object, attribute)
Xv_object object;
attribute-list
attributes;
The procedure returns 0 for failure. As a result, you cannot detect errors when retriev-
ing the values of attributes which might return 0 as a valid value. Note that, although
you can supply XV_NULL as the owner when you create a new object with
xv_create, you must provide the object when asking for the value of an attribute.
Procedures and Macros
Procedures and Macros 213
For example, you cannot just ask for:
xv_get(XV_NULL, XV_FONT)
to determine the default font, but you can ask for the font associated with a particular
screen, as in:
xv_get(Screen1, XV_FONT)
Some attributes require a screen or server to be supplied to xv_get(). For such attri-
butes, you should ask any window you think should be on the same screen what to
identify as its screen or server, using the attributes XV_SCREEN and XV_SERVER.
If you know your application only runs on a single screen, you can use the global val-
ues xv_default_server and xv_default_screen or you can ask the defaults
database what the server is.
xv_init()
This procedure performs many tasks including: opening the connection to the server,
initializing the Notifier, and initializing the Resource Manager database (see Chapter
17, Resources, in the XView Programming Manual). By default xv_init() opens a
connection to the server described by the DISPLAY environment variable. The server
connections may be changed using appropriate command-line attribute-value pairs.
No matter which server is used, xv_init() returns a handle to that server object.
For further information concerning use with servers, see Chapter 15, Nonvisual
Objects, in the XView Programming Manual.
int
main(argc, argv)
int argc;
char **argv:
{
/* initialization/declarations */
.
.
.
(void)xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0);
frame = xv_create(NULL, FRAME, FRAME_LABEL, "foo", 0);
}
xv_row()
Returns an integer representing the number of pixels, excluding the top margin of the
window. Used in conjunction with a panel’s WIN_ROW_GAP.
int
xv_row(window, row)
Xv_Window window
int row;
214 XView Reference Manual
Get Volume 7B: XView Reference Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.