XView Programming Reference

Xview Programming Reference

XView (X Window-System-based Visual Integrated Environment for Workstations) is a user-interface toolkit to support interactive, graphics-based applications running under the X Window System. This toolkit, developed by Sun Microsystems, Inc., is derived from earlier toolkits for the SunView windowing system. With over 2000 SunView applications in the workstation market, there are many programmers already familiar with the SunView application programmer's interface (API). XView has many...

Sending and Reading Client Messages

Xv_send_message() is used to send client messages to other windows. The form for this function is xv_send_message(window, addressee, msg_type, format, data, len) This function sends the message encoded in data to the addressee window. If the addressee parameter is an X window, then the message is sent to that window. Otherwise, the addressee may be either PointerWindow or InputFocus to correspond to the window under which the pointer happens to be lying or the window which happens to have the...

Rendering graphics

The preferred form of rendering graphics from an XView application is to use Xlib graphics calls. Volume One, Xlib Programming Manual, has a complete discussion of Xlib graphics programming. Throughout this book, you will find examples of drawing into canvases using Xlib graphics routines. Appendix F, Example Programs, has several longer programs that demonstrate Xlib graphics. The XView graphics model, which is available, is almost identical to the SunView model for graphics and is provided...

The colorlogoc Program

Using the basic principles discussed so far, we present Example 21-1 to demonstrate the creation and initialization of a colormap segment for an XView canvas. Pixel values are extracted from the colormap segment and set into a GC's foreground. Xlib calls are then used to render various items in the same four basic colors we've been using. Example 21-1. The color_logo. c program * This program demonstrates the combined use of the XView color * model API and Xlib graphics calls. The program uses...