gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Surface Class Reference

#include <Surface.H>

Inheritance diagram for Surface:
[legend]
Collaboration diagram for Surface:
[legend]

Public Member Functions

 Surface ()
 
 Surface (int width, int height)
 
virtual ~Surface (void)
 
GtkWidget * getWidget (void)
 
cairo_surface_t * getSurface (void)
 
void setSurface (cairo_surface_t *surface_)
 
void clear ()
 
- Public Member Functions inherited from Widget
 Widget ()
 Construcotr. More...
 
 Widget (GtkWidget *w)
 
virtual ~Widget ()
 Destructor. More...
 
GtkWidget * ref (void)
 
void unref (void)
 
GtkWidget * show (void)
 
GtkWidget * hide (void)
 
bool getVisible (void)
 
GtkWidget * getWidget (void)
 
bool getSensitive (void)
 
void setSensitive (bool sens)
 
void getSize (int &width, int &height)
 
virtual void setSize (int width, int height)
 
void getLocationSize (int &x, int &y, int &width, int &height)
 
void queueDraw ()
 
GdkWindow * getWindow ()
 
void connect (const char *event, GCallback callback, gpointer data)
 
void connectAfter (const char *event, GCallback callback, gpointer data)
 
void connectExposeEventCallback (GCallback callback, void *data)
 
void connectExposeEventCallback (GtkWidget *w, GCallback callback, void *data)
 
void connectConfigureEventCallback (GCallback callback, void *data)
 
void connectConfigureEventCallback (GtkWidget *w, GCallback callback, void *data)
 
Widgetoperator<< (DragNDrop &dnd)
 
Widgetoperator>> (DragNDrop &dnd)
 

Protected Member Functions

virtual gboolean configureEvent (GdkEventConfigure *event)
 
virtual bool exposeEvent ()
 
void destroySurface (void)
 
void init (int width, int height)
 
void connectDamagedCallback (GCallback callback, void *data)
 
- Protected Member Functions inherited from Widget
virtual bool checkDropValidity (GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData)
 
virtual bool dragDataReceived (GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData, int length)
 
virtual void dragLeave (GtkWidget *w, GtkWidget *sourceWidget)
 
virtual bool dragMotion (GtkWidget *w, GtkWidget *sourceWidget, int x, int y)
 
virtual int chooseTheTargetToUse (GtkWidget *w, GtkWidget *sourceWidget, DragNDrop &dnd)
 
virtual void dragDataGet (GtkWidget *w, GtkSelectionData *selectionData, guint info)
 
virtual void dragDataDelete (GtkWidget *w)
 
virtual void dragBegin (GtkWidget *w)
 
virtual void dragEnd (GtkWidget *w)
 

Static Protected Member Functions

static gboolean configureEventStatic (GtkWidget *widget, GdkEventConfigure *event, gpointer data)
 
static gboolean exposeEventStatic (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 

Protected Attributes

cairo_surface_t * surface
 The backing surface for the drawing area. More...
 
- Protected Attributes inherited from Widget
GtkWidget * widget
 The container based widget. More...
 

Detailed Description

Examples:
CairoArrowTest.C, CairoBoxTest.C, CairoCircleTest.C, and DrawingAreaTest.C.

Definition at line 32 of file Surface.H.

Constructor & Destructor Documentation

◆ Surface() [1/2]

Surface::Surface ( )
inline

Default constructor of size 200 by 200

Definition at line 161 of file Surface.H.

Here is the call graph for this function:

◆ Surface() [2/2]

Surface::Surface ( int  width,
int  height 
)
inline

Construct a surface

Parameters
widththe width of the surface
heightthe height of the surface

Definition at line 168 of file Surface.H.

Here is the call graph for this function:

◆ ~Surface()

virtual Surface::~Surface ( void  )
inlinevirtual

Destructor

Definition at line 174 of file Surface.H.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void Surface::clear ( void  )
inline

Redraw the background to the surface removing all changes.

Definition at line 217 of file Surface.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ configureEvent()

virtual gboolean Surface::configureEvent ( GdkEventConfigure *  event)
inlineprotectedvirtual

Overload this method to handle configure-event signals in your classes.

Parameters
eventthe event which triggered this configure-event signal.
Returns
true to finish executing, false to allow other handlers to execute.

Definition at line 79 of file Surface.H.

Here is the caller graph for this function:

◆ configureEventStatic()

static gboolean Surface::configureEventStatic ( GtkWidget *  widget,
GdkEventConfigure *  event,
gpointer  data 
)
inlinestaticprotected

Create a new backing surface of the appropriate size. Also call the configureEvent method of the class instance.

Parameters
widgetThe widget receiving the event.
eventThe event which triggered the configure-event signal
dataThe instance of Surface which is associated with the widget/event
Returns
true to finish processing, false to allow other handlers to process.

Definition at line 46 of file Surface.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectDamagedCallback()

void Surface::connectDamagedCallback ( GCallback  callback,
void *  data 
)
inlineprotected

Connect a callback function for when the surface is changed.

Parameters
callbackThe callback to execute
dataThe user data to pass to the callback

Definition at line 153 of file Surface.H.

◆ destroySurface()

void Surface::destroySurface ( void  )
inlineprotected

Method to dereference and set the surface to null

Definition at line 121 of file Surface.H.

Here is the caller graph for this function:

◆ exposeEvent()

virtual bool Surface::exposeEvent ( )
inlineprotectedvirtual

allow overloading of the expose event.

Returns
true to finish processing, false to allow other handlers to process.

Definition at line 107 of file Surface.H.

Here is the caller graph for this function:

◆ exposeEventStatic()

static gboolean Surface::exposeEventStatic ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  data 
)
inlinestaticprotected

Redraw the screen from the backing surface. Calls an overloadable class method expose.

Parameters
widgetThe widget receiving the event.
eventThe event which triggered the expose-event signal
dataThe instance of Surface which is associated with the widget/event
Returns
true to finish processing, false to allow other handlers to process.

Definition at line 89 of file Surface.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSurface()

cairo_surface_t* Surface::getSurface ( void  )
inline

Get the backing surface

Returns
The backing suraface
Examples:
CairoBoxTest.C, and CairoCircleTest.C.

Definition at line 204 of file Surface.H.

Here is the caller graph for this function:

◆ getWidget()

GtkWidget* Surface::getWidget ( void  )
inline

Get the drawing area widget

Returns
The drawing area widget
Examples:
CairoArrowTest.C, CairoBoxTest.C, CairoCircleTest.C, DrawingAreaTest.C, and SelectionAreaTest.C.

Definition at line 185 of file Surface.H.

◆ init()

void Surface::init ( int  width,
int  height 
)
inlineprotected

Initialise the member variables.

Parameters
widththe width of the surface
heightthe height of the surface

Definition at line 134 of file Surface.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSurface()

void Surface::setSurface ( cairo_surface_t *  surface_)
inline

Set the backing surface

Parameters
surface_The new backing surface

Definition at line 209 of file Surface.H.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ surface

cairo_surface_t* Surface::surface
protected

The backing surface for the drawing area.

Definition at line 37 of file Surface.H.


The documentation for this class was generated from the following file:
gtkIOStream: Surface Class Reference
GTK+ IOStream  Beta