GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::G::Boxed Class Reference

A generic base class for GTK+ boxed objects. More...

#include <gfc/glib/boxed.hh>

Inheritance diagram for GFC::G::Boxed:

GFC::Object GFC::Trackable GFC::G::Value List of all members.

Public Member Functions

Static Public Member Functions

Templates

Protected Member Functions

Constructors
Methods

Protected Attributes


Detailed Description

A generic base class for GTK+ boxed objects.

The Boxed class handles the GTK+ memory allocation for boxed objects, saving you the trouble and initializes the underlying GTK+ structure where appropriate. Boxed is derived from Object so its derived classes can be managed by the GFC smart pointer, Pointer<>. Boxed is an implementation class so you wont need to use it unless you are deriving a new boxed object type. Some examples of boxed objects are Gdk::Color, G::Value, Gtk::TreeIter and Gtk::TreePath.

A Boxed object is a small object that is frequently copied and freed by GTK+. What it means to copy a Boxed object depends on each individual object. Sometimes a copied object will be a deep copy (an exact duplicate) and at other times it will be a shallow copy (merely reference counted).


Constructor & Destructor Documentation

GFC::G::Boxed::Boxed GType  boxed_type  )  [explicit, protected]
 

Construct a new boxed type.

Parameters:
boxed_type The GType value for the boxed object.

Creates an empty wrapper for the boxed object type boxed_type. Objects calling this constructor must call copy() to copy a boxed object to the wrapper.

GFC::G::Boxed::Boxed GType  boxed_type,
void *  boxed
[protected]
 

Construct a new boxed type.

Parameters:
boxed_type The GType value for the boxed object.
boxed A generic pointer to a GTK+ boxed object.

This constructor is used by Boxed::wrap for wrapping boxed objects that must not be freed.

GFC::G::Boxed::Boxed GType  boxed_type,
void *  boxed,
bool  copy
[protected]
 

Construct a new boxed type.

Parameters:
boxed_type The GType value for the boxed object.
boxed A generic pointer to a GTK+ boxed object.
copy Set true if a copy of boxed should be used.

If copy is true boxed is copied. If false boxed is assumed to be a valid copy of a boxed object that must be freed.


Member Function Documentation

void GFC::G::Boxed::copy const void *  boxed  )  [protected]
 

Copy the GTK+ boxed object to this C++ wrapper.

Parameters:
boxed A generic pointer to the GTK+ boxed object to copy.

boxed must be a valid boxed objrect and have the same GType as the calling object. The previous object, if any, is freed appropriately.

void GFC::G::Boxed::copy const Boxed src  )  [protected]
 

Make a copy of the boxed object src.

Parameters:
src The Boxed object.

template<typename T>
T* GFC::G::Boxed::wrap GType  boxed_type,
void *  boxed,
bool  copy
[static]
 

Generic C++ wrapper function for GTK+ boxed objects.

Parameters:
boxed_type The GType value of the boxed object.
boxed A generic pointer to a GTK+ boxed object.
copy Set true if a copy of boxed should be used.

This version wraps GTK+ boxed objects that must be freed. If copy is true a copy of the boxed object is made. If copy is false the C++ wrapper takes over ownership of the boxed object and frees it appropriately.

template<typename T>
T* GFC::G::Boxed::wrap GType  boxed_type,
void *  boxed
[static]
 

Generic C++ wrapper function for GTK+ boxed objects.

Parameters:
boxed_type The GType value of the boxed object.
boxed A generic pointer to a GTK+ boxed object.

This version wraps GTK+ boxed objects that must not be freed. This is a temporary C++ wrapper and doesn't take over ownership of the boxed object.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:04:57 2004 for GFC-Core by doxygen 1.3.8