GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
GtkInterface Class Reference

#include <gtkInterface.H>

Collaboration diagram for GtkInterface:
Collaboration graph
[legend]

Public Types

enum  BorderFillOptions { BORDER_LEFT =1, BORDER_RIGHT =2, BORDER_TOP =4, BORDER_BOTTOM =8 }
 

Public Member Functions

GtkWidget * getWidget (void)
 
 GtkInterface (void)
 default constructor More...
 
 GtkInterface (int width, int height, bool resiseable=true)
 constructor specifying window size and resideable options More...
 
void init (int width=0, int height=0, bool resiseable=true)
 the initialisation of the window (common to both constructors) More...
 
 ~GtkInterface (void)
 deconstructor More...
 
GtkInterfaceoperator<< (Box &b)
 
GtkInterfaceoperator<< (Box *b)
 
GtkInterfaceoperator>> (Box &b)
 
GtkInterfaceoperator>> (Box *b)
 
GtkInterfaceoperator<< (GtkWidget *w)
 
GtkInterfaceoperator>> (GtkWidget *w)
 
GtkInterfaceoperator<< (Container *w)
 
GtkInterfaceoperator>> (Container *w)
 
GtkInterfaceoperator<< (Container &w)
 
GtkInterfaceoperator>> (Container &w)
 
void setBackgroundColour (GdkColor *colour, GtkStateType state=GTK_STATE_NORMAL)
 
void setBackgroundColour (const char *colourName, GtkStateType state=GTK_STATE_NORMAL)
 

Static Public Member Functions

static gint quit (GtkWidget *widget, GdkEvent *event, gpointer data)
 
static bool fillBorder (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 
static bool fillBannerTop (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 
static bool fillBannerMiddle (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 
static bool fillBannerBottom (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 

Public Attributes

int borderFill
 Used if the fillBorder callback is in use. More...
 
GtkWidget * win
 The window widget. More...
 

Private Member Functions

bool fillBorderImplementation (GtkWidget *widget, int borderFillVar=-1)
 

Detailed Description

Definition at line 181 of file gtkInterface.H.

Member Enumeration Documentation

Enumerator
BORDER_LEFT 
BORDER_RIGHT 
BORDER_TOP 
BORDER_BOTTOM 

Definition at line 226 of file gtkInterface.H.

Constructor & Destructor Documentation

GtkInterface::GtkInterface ( void  )
inline

default constructor

Definition at line 238 of file gtkInterface.H.

Here is the call graph for this function:

GtkInterface::GtkInterface ( int  width,
int  height,
bool  resiseable = true 
)
inline

constructor specifying window size and resideable options

Parameters
widththe width of the window
heightthe height of the window
resiseablewhether the window can be resised.

Definition at line 250 of file gtkInterface.H.

Here is the call graph for this function:

GtkInterface::~GtkInterface ( void  )
inline

deconstructor

Definition at line 273 of file gtkInterface.H.

Member Function Documentation

static bool GtkInterface::fillBannerBottom ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  data 
)
inlinestatic
Callback method to fill the boarder as if a bottom banner were present
Parameters
widgetThe widget which triggered the event
eventThe event which was triggered
dataA pointer to this instance
Returns
false to keep propagating the event

Definition at line 385 of file gtkInterface.H.

Here is the call graph for this function:

static bool GtkInterface::fillBannerMiddle ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  data 
)
inlinestatic
Callback method to fill the boarder as if a middle banner were present
Parameters
widgetThe widget which triggered the event
eventThe event which was triggered
dataA pointer to this instance
Returns
false to keep propagating the event

Definition at line 374 of file gtkInterface.H.

Here is the call graph for this function:

static bool GtkInterface::fillBannerTop ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  data 
)
inlinestatic
Callback method to fill the boarder as if a top banner were present
Parameters
widgetThe widget which triggered the event
eventThe event which was triggered
dataA pointer to this instance
Returns
false to keep propagating the event

Definition at line 363 of file gtkInterface.H.

Here is the call graph for this function:

static bool GtkInterface::fillBorder ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  data 
)
inlinestatic
Callback method to fill the boarder from the edge of the widget to the edge of this window.

this->borderFill = BORDER_LEFT|BORDER_RIGHT will fill both left and right borders The fill colour is made to be the same as the widget backround colour. The following example is for a HBox, but could also be a VBox or any other widget.

HBox.connectAfter("expose-event", G_CALLBACK(GTKWindow.fillBorder), (gpointer)&GTKWindow);
HBox.connectAfter("visibility-notify-event", G_CALLBACK(GTKWindow.fillBorder), (gpointer)&GTKWindow);

In this example, the border between the widget and the GTKWindow is filled with the widget's background colour.

Parameters
widgetThe widget which triggered the event
eventThe event which was triggered
dataA pointer to this instance
Returns
false to keep propagating the event

Definition at line 352 of file gtkInterface.H.

Here is the call graph for this function:

bool GtkInterface::fillBorderImplementation ( GtkWidget *  widget,
int  borderFillVar = -1 
)
inlineprivate

Definition at line 182 of file gtkInterface.H.

Here is the caller graph for this function:

GtkWidget* GtkInterface::getWidget ( void  )
inline
Get the window widget
Returns
the GtkWidget win

Definition at line 234 of file gtkInterface.H.

Here is the caller graph for this function:

void GtkInterface::init ( int  width = 0,
int  height = 0,
bool  resiseable = true 
)
inline

the initialisation of the window (common to both constructors)

Parameters
widththe width of the window
heightthe height of the window
resiseablewhether the window can be resised.

Definition at line 262 of file gtkInterface.H.

Here is the call graph for this function:

Here is the caller graph for this function:

GtkInterface& GtkInterface::operator<< ( Box b)
inline

Definition at line 284 of file gtkInterface.H.

Here is the caller graph for this function:

GtkInterface& GtkInterface::operator<< ( Box b)
inline

Definition at line 287 of file gtkInterface.H.

Here is the call graph for this function:

GtkInterface& GtkInterface::operator<< ( GtkWidget *  w)
inline

Definition at line 296 of file gtkInterface.H.

GtkInterface& GtkInterface::operator<< ( Container w)
inline

Definition at line 304 of file gtkInterface.H.

Here is the call graph for this function:

GtkInterface& GtkInterface::operator<< ( Container w)
inline

Definition at line 312 of file gtkInterface.H.

Here is the call graph for this function:

GtkInterface& GtkInterface::operator>> ( Box b)
inline

Definition at line 290 of file gtkInterface.H.

GtkInterface& GtkInterface::operator>> ( Box b)
inline

Definition at line 293 of file gtkInterface.H.

GtkInterface& GtkInterface::operator>> ( GtkWidget *  w)
inline

Definition at line 300 of file gtkInterface.H.

GtkInterface& GtkInterface::operator>> ( Container w)
inline

Definition at line 308 of file gtkInterface.H.

Here is the call graph for this function:

GtkInterface& GtkInterface::operator>> ( Container w)
inline

Definition at line 316 of file gtkInterface.H.

Here is the call graph for this function:

static gint GtkInterface::quit ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
)
inlinestatic

Definition at line 279 of file gtkInterface.H.

Here is the caller graph for this function:

void GtkInterface::setBackgroundColour ( GdkColor *  colour,
GtkStateType  state = GTK_STATE_NORMAL 
)
inline
set the background colour of the top window
Parameters
colourThe GdkColour to change the background to
stateThe colour for a particular state. Defaults to GTK_STATE_NORMAL

Definition at line 325 of file gtkInterface.H.

Here is the caller graph for this function:

void GtkInterface::setBackgroundColour ( const char *  colourName,
GtkStateType  state = GTK_STATE_NORMAL 
)
inline
set the background colour of the top window
Parameters
colourNameThe name of the colour to use. e.g. "white"
stateThe colour for a particular state. Defaults to GTK_STATE_NORMAL

Definition at line 333 of file gtkInterface.H.

Here is the call graph for this function:

Member Data Documentation

int GtkInterface::borderFill

Used if the fillBorder callback is in use.

Definition at line 227 of file gtkInterface.H.

GtkWidget* GtkInterface::win

The window widget.

Definition at line 229 of file gtkInterface.H.


The documentation for this class was generated from the following file: