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

GFC::G::MainContext Class Reference

A C++ interface for the GMainContext. More...

#include <gfc/glib/main.hh>

Inheritance diagram for GFC::G::MainContext:

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

Public Member Functions

Constructors
Accessors
Methods

Static Public Member Functions


Detailed Description

A C++ interface for the GMainContext.

MainContext is an object representing a set of sources to be handled in a main loop.


Constructor & Destructor Documentation

GFC::G::MainContext::MainContext GMainContext *  context,
bool  owns_reference = true
[explicit]
 

Construct a main context from an existing GMainContext.

Parameters:
context A pointer to a GMainContext.
owns_reference Set true if the initial reference count is owned by this object.

The MainContext object takes over the ownership of the GMainContext and unreferences it when the destructor is called.


Member Function Documentation

Pointer<MainContext> GFC::G::MainContext::get_default  )  [static]
 

Gets the default main context.

Returns:
The default main context.

This is the main context used for main loop functions when a main loop is not explicitly specified.

bool GFC::G::MainContext::iteration bool  may_block  ) 
 

Runs a single iteration of the main loop.

Parameters:
may_block Whether the call may block.
Returns:
true if events were dispatched.

This involves checking to see if any event sources are ready to be processed, then if no events sources are ready and may_block is true, waiting for a source to become ready, then dispatching the highest priority events sources that are ready. Note that even when may_block is true, it is still possible for iteration() to return false, since the the wait may be interrupted for other reasons than an event source becoming ready.

bool GFC::G::MainContext::pending  )  const
 

Checks if any sources have pending events for the given context.

Returns:
true if events are pending.

virtual void GFC::G::MainContext::unref  )  [virtual]
 

Decreases the reference count of the main context by one.

When the reference count becomes zero delete is called. Remember, as with all GFC Objects you must call unref() on a dynamically allocated IOChannel, not delete. If you use a smart you don't need to call unref(), the smart pointer will do that for you. You must also call unref() on an IOChannel allocated on the stack because IOChannels don't get passed on to owner objects that manage their reference count (like widgets in a container).

Reimplemented from GFC::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