VkDoubleBuffer(3x) VkDoubleBuffer(3x)
VkDoubleBuffer - Abstract class supports classes that draw doublebuffered
graphics
VkComponent : VkCallbackObject
#include <Vk/VkDoubleBuffer.h>
PUBLIC PROTOCOL SUMMARY
Constructor/Destructor
VkDoubleBuffer(const char* name, Widget parent);
virtual void ~VkDoubleBuffer(void);
Switching Buffers [Toc] [Back]
virtual void update(void);
PROTECTED PROTOCOL SUMMARY [Toc] [Back] Resizing and Refreshing the Canvas
virtual void resize(void);
virtual void draw(void) = 0;
Protected Data Members [Toc] [Back]
Pixmap _canvas;
Dimension _width;
Dimension _height;
This class provides support for classes that need to display double
buffered graphics. The public interface allows applications to
drive animations by calling the update() member function at the
desired interval. The VkDoubleBuffer class calls derived classes'
draw() member function when the derived class needs to draw a new
frame. Derived classes do not need to worry about handling window
damage, as the VkDoubleBuffer class takes care of this
automatically.
Derived classes must define the draw member function. This member
function is expected to display some Xlib text or Xlib graphics by
drawing to the _canvas member, which is a Drawable. The derived
Page 1
VkDoubleBuffer(3x) VkDoubleBuffer(3x)
class is always drawing to the back buffer, although derived classes
do not need to be aware of this.
Derived classes that need to know when the window has been resized
can override the virtual function resize() to be notified.
FUNCTION DESCRIPTIONS [Toc] [Back] resize()
virtual void resize(void);
Called when the object's drawable area changes size. The new size
can be accessed in the _width and _height members.
draw()
virtual void draw(void) = 0;
This pure virtual function must be defined by derived classes. The
function is expected to use Xlib calls to display graphics in the
_canvas Drawable.
VkDoubleBuffer() [Toc] [Back]
VkDoubleBuffer(const char* name, Widget parent);
Initialize the VkDoubleBuffer class and create various widgets and
Pixmaps used to support the double buffering.
~VkDoubleBuffer()
virtual void ~VkDoubleBuffer(void);
Destroys the pixmaps and graphics contexts used by this class.
update()
virtual void update(void);
Displays the current back buffer of the double-buffered display and
requests the derived class to redraw a new back buffer.
DATA MEMBER DESCRIPTIONS [Toc] [Back] _canvas
Pixmap _canvas;
Derived classes always draw to this Drawable. The VkDoubleBuffer
class copies the contents of this Pixmap as needed.
Page 2
VkDoubleBuffer(3x) VkDoubleBuffer(3x)
_width
Dimension _width;
The current width of the available drawing area.
_height
Dimension _height;
The current height of the available drawing area.
INHERITED MEMBER FUNCTIONS [Toc] [Back] Inherited from VkComponent
installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
setDefaultResources(), getResources(), callCallbacks(),
VkComponent(), manage(), unmanage(), baseWidget(), okToQuit(),
_name, _baseWidget, _w, deleteCallback
Inherited from VkCallbackObject [Toc] [Back]
callCallbacks(), addCallback(), removeCallback(),
removeAllCallbacks()
KNOWN DERIVED CLASSES [Toc] [Back] VkMeter, VkPie
CLASSES USED BY THIS CLASS
VkApp
VkComponent, VkApp
ViewKit Programmer's Guide
The X Window System, DEC Press, Bob Sheifler and Jim Gettys
The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
The OSF/Motif Programmers Reference, Prentice Hall, OSF
PPPPaaaaggggeeee 3333 [ Back ]
|