PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFYApplication
Class which represents an application using the SFY or SFZ responders.
#include <SFYApplication.h.hpp>
class SFYApplication : public SFCApplication;
SFMTYPEDEFCLASS(SFYApplication)

Inheritance diagram

 Inheritance diagram of SFYApplicationClass

Collaboration diagram

 Collaboration diagram of SFYApplicationClass

Description

How to use

An SFY applet which uses the SFY responder system is required to create one instance of a user-defined application class, which is defined and implemented by inheriting from SFYApplication.

The instance of this application class inheriting from SFYApplication, is the kernel to control the SFY applet execution, which will be created first and destroyed last.

Event Handling [General Processing Flow]

  1. The highest priority event handler, if registered, will be called to handle an event dispatched from the BREW environment(BREW-defined event) first of all.
  2. The HandleRender() function will be called to redraw the full screen when the applet receives the SFEVT_APP_START or SFEVT_APP_RESUME event dispatched from the BREW environment or when a highest priority event handler ends.
  3. The HandleEvent() function will be called to perform event handling when the SFEVT_APP_START, SFEVT_APP_RESUME, SFEVT_APP_STOP, or SFEVT_APP_SUSPEND event is dispatched from the BREW environment, or the BREW-defined event is not handled by a highest priority event handler.
  4. The HandleError() function will be called to handle the fatal error such as insufficient memory when it occurs.
[Tip] Tip
The above description is the same with that of the SFCApplication class, from which the SFYApplication class inherits.
[Note] Highest Priority Event Handler

For more details, see the description of the SFCApplication::RegisterBypass function.

Hierarchical Structure

The application class is placed at the highest position in the tree structure of responders such as window, dialog, menu, control, or frame.

An application will manage windows, dialogs, and menus. A window or a dialog will manage controls. The following diagram shows this hierarchy relationship.

Figure 267. Ownership relation between application and responder classes

Ownership relation between application and responder classes
[Note] Root responder which the application class contains

The SFYApplication class contains one root(SFZRoot) as a root responder by default.

GUI(Graphical user interface) of the SFY applet is implemented by constructing the responder tree, where this root(SFZRoot) is located at the top.

All responder-related operations on this application class will be delegated to this root(SFZRoot).

* Though the SFY applet can have more than one root by constructing another new responder tree explicitly, default root(SFZRoot) is used in the applet development in almost all cases. For more details, refer to root.

SFYApplication is the abstract base class for all user-defined application classes which uses the SFY responder system.

This class contains the root bound with the distributer and the renderer as a default root responder , and provides the virtual functions below.

Virtual Functions

Table 200. Virtual function name and its default behaviour

Virtual function name Default behaviour Override
SFYApplication::HandleEvent Boot up the distributer, and furthermore boot up the renderer if event is handled *1 Optional
SFYApplication::HandleRender Redraw the device screen in white and the responder tree below the root. *1 Optional
SFCApplication::HandleError - Optional
[Note] NOTE

*1. Boot up the SFCApplication::HandleError function when fatal error such as memory insufficiency during the bootup of distributer or renderer occurs.

Make a user-defined application class

The minimum code necessary to make a user-defined application class is as follows:

Example 853. Declaration

SFMTYPEDEFCLASS(USRApplication)
class USRApplication: public SFYApplication {
    SFMSEALCOPY(USRApplication)
public:
    static SFCInvokerPtr Factory(Void);
private:
    explicit USRApplication(Void) static_throws;
    virtual ~USRApplication(Void);
};

Example 854. Implementation

// boot loader: function first executed in BREW applet
SFCApplet::FactorySPP SFCApplet::Boot(AEECLSID id, SFXAnsiStringPtr license)
{
    // here place the license code
    *license = "heap://";

    return (id == AEECLSID_USRAPPLICATION) ? (&USRApplication::Factory): (null);
}

// factory function to create instance of user-defined application class
SFCInvokerPtr USRApplication::Factory(Void)
{
    return::new USRApplication;
}

// constructor
USRApplication::USRApplication(Void) static_throws
{
    if (static_try()) {

        // here describe the initialization
    }
}

// destructor
USRApplication::~USRApplication(Void)
{
    // here describe the finalization
}
[Caution] The return statement in the constructor or destructor

In general, the return statement should not be written in the constructor and destructor with C++.

The bug has been confirmed in GCC. It is that compiler will freeze if the return statement is written in the constructor or destructor under some particular inheritance relationship.

Reference

Application Class(Basic) | SFY Responder System | Window | Dialog | Menu | Control | Frame | Responder Tree | Root Responder | Root | SFZRoot

Member

Constructor/Destructor
SFYApplication( Void )
Constructor of the SFYApplication class.
SFYApplication( SFXBaseEditorPtr editor )
Constructor of the SFYApplication class.
~SFYApplication( Void )
Destructor of the SFYApplication class.
Public Functions
Void ClearHandler( Void )
Unregister all handlers from this application.
Void ClearTracer( Void )
Unregister all rules from the tracer of this application.
SFCError Distribute( SFXEventConstRef event , BoolPtr result = null )
[Type 1] Distribute the specified event. [Type 2] Wrap and call the specified callback function which includes sending events.
SFCError Distribute( VoidPtr context , SFYDistributer::CallbackSPP spp , VoidPtr reference , BoolPtr result = null )
[Type 1] Distribute the specified event. [Type 2] Wrap and call the specified callback function which includes sending events.
SFYResponderSmp GetChildBack( Void )
Get the backmost child responder of this application, which matches the specified search condition.
SFYResponderSmp GetChildBack( Bool visible , Bool active , Bool enable , Bool focus )
Get the backmost child responder of this application, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id )
Get the backmost child responder of this application, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus )
Get the backmost child responder of this application, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index )
Get the child responder of this application at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus )
Get the child responder of this application at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id )
Get the child responder of this application at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus )
Get the child responder of this application at the specified position from the back side, which matches the specified search condition.
SInt32 GetChildCount( Void )
Get the number of child responders of this application, which match the specified search condition.
SInt32 GetChildCount( Bool visible , Bool active , Bool enable , Bool focus )
Get the number of child responders of this application, which match the specified search condition.
SInt32 GetChildCount( UInt32 id )
Get the number of child responders of this application, which match the specified search condition.
SInt32 GetChildCount( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus )
Get the number of child responders of this application, which match the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index )
Get the child responder of this application at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus )
Get the child responder of this application at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id )
Get the child responder of this application at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus )
Get the child responder of this application at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildFront( Void )
Get the foremost child responder of this application, which matches the specified search condition.
SFYResponderSmp GetChildFront( Bool visible , Bool active , Bool enable , Bool focus )
Get the foremost child responder of this application, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id )
Get the foremost child responder of this application, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus )
Get the foremost child responder of this application, which matches the specified search condition.
static
SFYDistributerPtr
GetDistributer( Void )
Get the distributer bound with this application.
static
SFXBaseEditorPtr
GetEditor( Void )
Get the text input control editor which this application contains internally.
SFXRectangle GetGlobalBound( Void )
Get the globle region of this application.
static
SFYApplicationPtr
GetInstance( Void )
Get the instance of this application.
SFXRectangle GetLocalBound( Void )
Get the local region of this application.
SFXRectangleConstRef GetRealBound( Void )
Get the real region of this application.
static
SFYRendererPtr
GetRenderer( Void )
Get the renderer bound with this application.
static
SFZRootSmpConstRef
GetRoot( Void )
Get the root responder of this application.
SFXRectangle GetSuitableBound( Void )
Get the most suitable size of the visible rectangular region of this application.
SFXRectangle GetSuitableBound( SFXRectangleConstRef param )
Get the most suitable size of the visible rectangular region of this application.
SFXRectangleConstRef GetVirtualBound( Void )
Get the virtual region of this application.
Void Invalidate( Void )
Register the specified redraw region of this application.
Void Invalidate( SFXRectangleConstRef param )
Register the specified redraw region of this application.
Void InvokeBackward( SFXEventConstRef event , Bool overload , BoolPtr result = null )
Call the handlers for the specified event from the end of handler list registered into this application[root].
Void InvokeForward( SFXEventConstRef event , Bool overload , BoolPtr result = null )
Call the handlers for the specified event from the head of the handler list registered into this application[root].
Bool IsRendererIntermissive( Void )
Check whether or not to terminate the renderer when an applet suspends.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule )
Register specified handlers into this application.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference )
Register specified handlers into this application.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length )
Register specified handlers into this application.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length )
Register specified handlers into this application.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::RuleRecConstRef rule )
Register specified rules into the tracer of this application.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload )
Register specified rules into the tracer of this application.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length )
Register specified rules into the tracer of this application.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length )
Register specified rules into the tracer of this application.
SFCError Render( Bool force = false )
Boot up the renderer for redrawing this application[root] and its descendant responders.
Void SetRealBound( SFXRectangleConstRef param )
Set the real region of this application to the specified region.
Void SetRendererIntermissive( Bool param )
Set the flag indicating whether or not to terminate the renderer when an applet suspends.
Void SetVirtualBound( SFXRectangleConstRef param )
Set the virtual region of this application to the specified region.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule )
Unregister the handler from this application which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference )
Unregister the handler from this application which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length )
Unregister the handler from this application which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length )
Unregister the handler from this application which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstRef range )
Unregister specified rules from the tracer of this application.
Void UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length )
Unregister specified rules from the tracer of this application.
static
AEECLSID
GetClassID( Void ) (inherits from SFCApplication)
Get the ClassID of this BREW applet.
Bool IsHandlingEvent( Void ) (inherits from SFCApplication)
Check whether or not an event is being processed.
Bool IsRenderable( Void ) (inherits from SFCApplication)
Check whether or not the screen can be drawn.
SFCError RegisterBypass( CallbackSPP spp , VoidPtr reference ) (inherits from SFCApplication)
Register the highest priority event handler.
Bool RenderDeviceScreen( Void ) (inherits from SFCApplication)
Redraw the device screen.
static
SFCError
Terminate( Bool idle = false ) (inherits from SFCApplication)
Terminate this application.
Void UnregisterBypass( CallbackSPP spp , VoidPtr reference ) (inherits from SFCApplication)
Unregister the highest priority event handler.
Protected Functions
SFYResponderSmp GetThis( Void )
Get the root which this application class contains by default.
Bool HandleEvent( SFXEventConstRef event )
This is a virtual function that will be called when an event dispatched from the BREW environment needs to be handled.
Bool HandleRender( SFXEventConstRef event )
This is a virtual function that will be called when the full screen needs to be redrawn.
Bool HandleError( SFXEventConstRef event , SFCError error ) (inherits from SFCApplication)
This is a virtual function that will be called when the fatal error occurs.
Bool Invoke( SFXEventConstRef event ) (inherits from SFCApplication)
This is a virtual function that will be called when an event dispatched from the BREW environment needs to be handled.

SFYApplication::SFYApplication
Constructor of the SFYApplication class.
[ protected, explicit ]
SFYApplication(Void);
[ protected, explicit ]
SFYApplication(
    SFXBaseEditorPtr editor   // text input control editor
);

Description

This constructor performs the initializations as follows:

  1. Set the flag indicating whether or not to terminate the renderer when an applet suspends to false. The saved bitmap to restore the device screen will not be released.
  2. Create the text input control editor that the SFYApplication class contains internally.
  3. Create the default root that the SFYApplication class contains internally.
  4. Initialize the distributer.
  5. Initialize the renderer.
  6. Bind the root with the distributer and the renderer.
  7. Set the root's real region to the responder space.
  8. Set the root's state to "visible" + "active" + "enable" + "focus" together.

For more details, see the internal implementation code below.

Internal Implementation

Implementation of this constructor is as follows:

// definition of SFYApplication class
class SFYApplication : public SFCApplication {

    SFMSEALCOPY(SFYApplication)

    private:
         SFYDistributer   _distributer;  // distributer
         SFYRenderer      _renderer;     // renderer
         SFZRootSmp       _root;         // root
         SFXBaseEditorPtr _editor;       // text input control editor
         Bool             _intermissive; // flag indicating whether or not to release the saved bitmap to restore the device screen at suspend time

    public:

    ...

};

// implementation of constructor of SFYApplication class
/*protected */SFYApplication::SFYApplication(Void) : _editor(null), _intermissive(false) static_throws
{
    // initialization

    if (static_try()) {

        // create the text input control editor
        if ((_editor = ::new SFXEditor) != null) {

            // initialize the root, the ditributer, and the renderer
            static_throw(Initialize());
        }
        else {

            static_throw(SFERR_NO_MEMORY);
        }
    }
}// SFYApplication::SFYApplication //

/*protected */SFYApplication::SFYApplication(SFXBaseEditorPtr editor) : _editor(null), _intermissive(false) static_throws
{
    // initialization

    if (static_try()) {
 
       // if the text input control editor is set
       if (_editor != null) {

            // initialize the root, the ditributer, and the renderer
            static_throw(Initialize());
        }
        else {

            static_throw(SFERR_INVALID_PARAM);
        }
    }
}// SFYApplication::SFYApplication //

/*private */SFCError SFYApplication::Initialize(Void)
{
    SFCError  error;

    // initialize the distributer
    if ((error = _distributer.Initialize()) == SFERR_NO_ERROR) {

        // initialize the renderer
        // * responder space will be set to the device screen
        if ((error = _renderer.Initialize() == SFERR_NO_ERROR) {

                // create the root
           if ((_root = SFZRoot::NewInstance(&error)) != null) {

                // bind the root with the distributer
                _root->SetDistributer(&_distributer);

                // bind the root with the renderer
                _root->SetRenderer(&_renderer);

                // set root's real region to the responder space(i.e., all the device screen)
                _root->SetRealBound(_root->GetSuitableBound());

                    // set the root's state to "visible" + "active" + "enable" + "focus" together
                _root->SetState(true, true, true, true);
            }
        }
    }
    return error;
}// SFYApplication::Initialize //

Reference

SFYApplication::SetRendererIntermissive | SFYResponder::SetDistributer | SFZRoot | SFYDistributer | SFYRenderer | SFXEditor | Distributer | Renderer | Responder Space | Root | Root Responder | Real Region | State


SFYApplication::~SFYApplication
Destructor of the SFYApplication class.
[ protected, pure-virtual ]
virtual ~SFYApplication(Void);

Description

SFYApplication::~SFYApplication is the destructor of the SFYApplication class. This function performs the processing below.

  1. Destroy the text input control editor that the SFYApplication class contains internally.
  2. Release the responder tree.
  3. Terminate the renderer.
  4. Terminate the distributer.

For more details, see the example code below.

Internal Implementation

Implementation of this destructor is as follows:

// definition of SFYApplication class
class SFYApplication : public SFCApplication {
    SFMSEALCOPY(SFYApplication)
    private:
         SFZRootSmp       _root;        // root
         SFYDistributer   _distributer; // distributer
         SFYRenderer      _renderer;    // renderer
         SFXBaseEditorPtr _editor;      // text input control editor

    public:

    ...

};


// implementation of destructor of SFYApplication class
/*protected virtual */SFYApplication::~SFYApplication(Void)
{

    // finalization: execute these in order below

    // destroy the text input control editor
    ::delete _editor;

    // release the responder tree
    _root.Release();

    // terminate the renderer
    _renderer.Terminate();

    // terminate the distributer
    _distributer.Terminate();

}// SFYApplication::~SFYApplication //

Reference: SFXResponderPointer::Release | SFYRenderer::Terminate | SFYDistributer::Terminate

Reference

SFZRoot | Distributer | Renderer | Root | Root Responder | Responder Tree


SFYApplication::ClearHandler
Unregister all handlers from this application.
[ public ]
Void ClearHandler(Void);

Description

This function unregisters all handlers from this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::ClearHandler | SFYApplication::RegisterHandler | SFYApplication::UnregisterHandler | SFZRoot | Handler | Root(Basic)

SFYApplication::ClearTracer
Unregister all rules from the tracer of this application.
[ public ]
Void ClearTracer(Void);

Description

This function unregisters all rules from the tracer of this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::ClearTracer | SFYApplication::RegisterTracer | SFYApplication::UnregisterTracer | SFYTracer SFZRoot | Tracer

SFYApplication::Distribute
[Type 1] Distribute the specified event. [Type 2] Wrap and call the specified callback function which includes sending events.
[ public ]
SFCError Distribute(
    SFXEventConstRef event   // event
    BoolPtr result = null    // processing result
);
[ public ]
SFCError Distribute(
    VoidPtr context                   // context(e.g., error value)
    SFYDistributer::CallbackSPP spp   // callback function
    VoidPtr reference                 // reference
    BoolPtr result = null             // processing result
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_FAILED

Description

This function has two distinct types of use cases depending on its arguments as follows:

  1. Type 1 [ in case of Distribute(SFXEventConstRef event, BoolPtr result = null) ] : Distribute an event of the distribute type to the root.
  2. Type 2 [ in case of Distribute(VoidPtr context, SFYDistributer::CallbackSPP spp, VoidPtr reference, BoolPtr result = null) ]: Wrap and call a callback function which includes sending events of the callback type in the callback outside the event loop.

For both two types, if the return value is "true", it is necessary to call the SFYApplication::Render function for redrawing the screen since the contents of some responders may be changed.

[Note] Note
For more details, see the descrption of the SFYResponder::Distribute function.
[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::Distribute | SFZRoot | Root(Basic) | Distribute Type | Callback Type | Event Loop | Event


SFYApplication::GetChildBack
Get the backmost child responder of this application, which matches the specified search condition.
[ public, const ]
SFYResponderSmp GetChildBack(Void);
[ public, const ]
SFYResponderSmp GetChildBack(
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);
[ public, const ]
SFYResponderSmp GetChildBack(
    UInt32 id   // ID
);
[ public, const ]
SFYResponderSmp GetChildBack(
    UInt32 id      // ID
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);

Return value

Backmost child responder of this application.

"null" will be returned if it does not exist.

Description

This function gets the backmost child responder of this application[root(SFZRoot)], which matches the specified search condition. If there is no child responder, "null" will be returned.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Tip] Tip

The child responders to be searched can be limited by specifying the ID and the conditions of visible, active, enable, or focus state.

[Tip] Tip

The attachment-frames are not included in the searching.

Example

SFYResponderSmp child;

get the backmost responder among all child responders
child = GetChildBack();

get the backmost responder among all child responders with ID = 128
child = GetChildBack(128);

get the backmost responder among visible child responders (not care about the enable state and focus state)
child = GetChildBack(true, true, false, false);

get the backmost responder among visible and enable child responders (not care about the focus state)
child = GetChildBack(true, true, true, false);

Reference

SFYResponder::GetChildBack | SFYApplication::GetChildFront | SFYApplication::GetChildBackward | SFZRoot | ID | State | Child Responder | Root(Basic)


SFYApplication::GetChildBackward
Get the child responder of this application at the specified position from the back side, which matches the specified search condition.
[ public, const ]
SFYResponderSmp GetChildBackward(
    SInt32 index   // order (0-based)
);
[ public, const ]
SFYResponderSmp GetChildBackward(
    SInt32 index   // order (0-based)
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);
[ public, const ]
SFYResponderSmp GetChildBackward(
    SInt32 index   // order (0-based)
    UInt32 id      // ID
);
[ public, const ]
SFYResponderSmp GetChildBackward(
    SInt32 index   // order (0-based)
    UInt32 id      // ID
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);

Return value

Child responder of this application at the specified position from the back side.

"null" will be returned if it does not exist.

Description

This function gets the child responder of this application[root(SFZRoot)] at the specified position from the back side, which matches the specified search condition. If there is no child responder, "null" will be returned.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Tip] Tip

The child responders to be searched can be limited by specifying the ID and the conditions of visible, active, enable, or focus state.

[Tip] Tip

The attachment-frames are not included in the searching.

Example

SFYResponderSmp child;

get the responder at the 3rd position among all child responders from the back side
child = GetChildBackward(2);

get the responder at the 3rd position among all child responders with ID = 128 from the back side
child = GetChildBackward(2, 128);

get the responder at the 3rd position among all visble child responders from the back side (not care about the enable state and focus state)
child = GetChildBackward(2, true, true, false, false);

get the responder at the 3rd position among all visble and enable child responders from the back side (not care about the focus state) 
child = GetChildBackward(2, true, true, true, false);

Reference

SFYResponder::GetChildBackward | SFYApplication::GetChildForward | SFYApplication::GetChildBack | SFZRoot | ID | State | Child Responder | Root(Basic)


SFYApplication::GetChildCount
Get the number of child responders of this application, which match the specified search condition.
[ public, const ]
SInt32 GetChildCount(Void);
[ public, const ]
SInt32 GetChildCount(
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);
[ public, const ]
SInt32 GetChildCount(
    UInt32 id   // ID
);
[ public, const ]
SInt32 GetChildCount(
    UInt32 id      // ID
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);

Return value

Number of child responders of this application.

Description

This function gets the number of child responders of this application[root(SFZRoot)], which match the specified search condition. If there is no child responder, 0 will be returned.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Tip] Tip

The child responders to be searched can be limited by specifying the ID and the conditions of visible, active, enable, or focus state.

[Tip] Tip

The attachment-frames are not included in the searching.

Example

SInt32 count;

get the number of all child responders
count = GetChildCount();

get the number of all child responders with ID = 128
count = GetChildCount(128);

get the number of all visible child responders (not care about the enable state and focus state)
count = GetChildCount(true, true, false, false);

get the number of all visible and enable child responders (not care about the focus state)
count = GetChildCount(true, true, true, false);

Reference

SFYResponder::GetChildCount | SFZRoot | ID | State | Child Responder | Root(Basic)


SFYApplication::GetChildForward
Get the child responder of this application at the specified position from the front side, which matches the specified search condition.
[ public, const ]
SFYResponderSmp GetChildForward(
    SInt32 index   // order (0-based)
);
[ public, const ]
SFYResponderSmp GetChildForward(
    SInt32 index   // order (0-based)
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);
[ public, const ]
SFYResponderSmp GetChildForward(
    SInt32 index   // order (0-based)
    UInt32 id      // ID
);
[ public, const ]
SFYResponderSmp GetChildForward(
    SInt32 index   // order (0-based)
    UInt32 id      // ID
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);

Return value

Child responder of this application at the specified position from the front side.

"null" will be returned if it does not exist.

Description

This function gets the child responder of this application[root(SFZRoot)] at the specified position from the front side, which matches the specified search condition. If there is no child responder, "null" will be returned.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Tip] Tip

The child responders to be searched can be limited by specifying the ID and the conditions of visible, active, enable, or focus state.

[Tip] Tip

The attachment-frames are not included in the searching.

Example

SFYResponderSmp child;

get the responder at the 3rd position among all child responders from the front side
child = GetChildForward(2);

get the responder at the 3rd position among all child responders with ID = 128 from the front side
child = GetChildForward(2, 128);

get the responder at the 3rd position among all visble child responders from the front side (not care about the enable state and focus state) 
child = GetChildForward(2, true, true, false, false);

get the responder at the 3rd position among all visble and enable child responders from the front side (not care about the focus state) 
child = GetChildForward(2, true, true, true, false);

Reference

SFYResponder::GetChildForward | SFYApplication::GetChildBackward | SFZRoot | ID | State | Child Responder | Root(Basic)


SFYApplication::GetChildFront
Get the foremost child responder of this application, which matches the specified search condition.
[ public, const ]
SFYResponderSmp GetChildFront(Void);
[ public, const ]
SFYResponderSmp GetChildFront(
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);
[ public, const ]
SFYResponderSmp GetChildFront(
    UInt32 id   // ID
);
[ public, const ]
SFYResponderSmp GetChildFront(
    UInt32 id      // ID
    Bool visible   // visible condition
    Bool active    // active condition
    Bool enable    // enable condition
    Bool focus     // focus condition
);

Return value

Foremost child responder of this application.

"null" will be returned if it does not exist.

Description

This function gets the foremost child responder of this application[root(SFZRoot)], which matches the specified search condition. If there is no child responder, "null" will be returned.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Tip] Tip

The child responders to be searched can be limited by specifying the ID and the conditions of visible, active, enable, or focus state.

[Tip] Tip

The attachment-frames are not included in the searching.

Example

SFYResponderSmp child;

get the foremost responder among all child responders
child = GetChildFront();

get the foremost responder among all child responders with ID = 128
child = GetChildFront(128);

get the foremost responder among all visible child responders (not care about the enable state and focus state)
child = GetChildFront(true, true, false, false);

get the foremost responder among all visible and enable child responders (not care about the focus state)
child = GetChildFront(true, true, true, false);

Reference

SFYResponder::GetChildFront | SFYApplication::GetChildBack | SFYApplication::GetChildForward| SFZRoot | ID | State | Child Responder | Root(Basic)


SFYApplication::GetDistributer
Get the distributer bound with this application.
[ public, static ]
SFYDistributerPtr GetDistributer(Void);

Return value

Distributer bound with this application[root(SFZRoot)].

"null" will be returned if no distributer is bound with this application[root(SFZRoot)].

Description

This function gets the distributer bound with this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::GetDistributer | Distributer | SFZRoot | Root(Basic)


SFYApplication::GetEditor
Get the text input control editor which this application contains internally.
[ public, static ]
SFXBaseEditorPtr GetEditor(Void);

Return value

Text input control editor which this application contains internally.

"null" will be returned if this application contains no text input control editor internally.

Description

This function gets the text input control editor which this application contains internally.

Reference

SFXEditor | SFZRoot | Root(Basic)


SFYApplication::GetGlobalBound
Get the globle region of this application.
[ public, const ]
SFXRectangle GetGlobalBound(Void);

Return value

Global region of this application[i.e., root]

Description

This function gets the global region of this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::GetGlobalBound | SFYApplication::GetLocalBound | SFYApplication::GetRealBound | SFZRoot | Root(Basic) | Global Region


SFYApplication::GetInstance
Get the instance of this application.
[ public, static ]
SFYApplicationPtr GetInstance(Void);

Return value

  • If succeeds: instance of this application class
  • If failed: null

Description

This function gets the instance of this application class, which exists only one per applet.

[Tip] Global variable

To access a global variable defined in an application class, call this function as in the below example.

Example

Example 855. Define and Access the Global Variable

//
//  helloworld Application class
//
SFMTYPEDEFCLASS(helloworld)
class helloworld : public SFYApplication
{
    SFMSEALCOPY(helloworld)
public:
    static SFCInvokerPtr Factory(Void);
private:
    explicit helloworld(Void) static_throws;
    virtual ~helloworld(Void);

    // define global variable "global_something_val"
    SInt32 global_something_val;
public:
    // declare GetGlobalSomethingVal() to access global variable "global_something_val"
    SInt32 GetGlobalSomethingVal() const;
};

// implement GetGlobalSomethingVal() to access global variable "global_something_val"
SInt32 helloworld::GetGlobalSomethingVal(Void) const
{
    return global_something_val;
}

// get value of global variable "global_something_val" via GetGlobalSomethingVal()
static_cast<helloworldPtr>(SFYApplication::GetInstance())->GetGlobalSomethingVal();

SFYApplication::GetLocalBound
Get the local region of this application.
[ public, const ]
SFXRectangle GetLocalBound(Void);

Return value

Local region of this application[i.e., root]

Description

This function gets the local region of this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::GetLocalBound | SFYApplication::GetGlobalBound | SFYApplication::GetVirtualBound SFZRoot | Root(Basic) | Local Region


SFYApplication::GetRealBound
Get the real region of this application.
[ public, const ]
SFXRectangleConstRef GetRealBound(Void);

Return value

Real region of this application[i.e., root]

Description

This function gets the real region of this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::GetRealBound | SFYApplication::SetRealBound | SFYApplication::GetVirtualBound | SFYApplication::GetGlobalBound | SFZRoot | Root(Basic) | Real Region


SFYApplication::GetRenderer
Get the renderer bound with this application.
[ public, static ]
SFYRendererPtr GetRenderer(Void);

Return value

Renderer bound with this application[root(SFZRoot)].

"null" will be returned if no renderer is bound with this application[root(SFZRoot)].

Description

This function gets the renderer bound with this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::GetRenderer | SFZRoot | Root(Basic) | Renderer


SFYApplication::GetRoot
Get the root responder of this application.
[ public, static ]
SFZRootSmpConstRef GetRoot(Void);

Return value

  • If succeeds: root which this application class contains by default
  • If failed: null

Description

This function gets the root(SFZRoot) which this application class contains by default.

This function is used to set the parent of a responder such as a window to the root or set handlers or dispatching rules to the root.

Example

The code to set the parent of a window to the root is as follows:

SFZWindowSmp window;

...

window->SetParent(GetRoot());

Reference

SFZRoot | SFYResponder::GetRoot | Root(Basic)


SFYApplication::GetSuitableBound
Get the most suitable size of the visible rectangular region of this application.
[ public ]
SFXRectangle GetSuitableBound(Void);
[ public ]
SFXRectangle GetSuitableBound(
    SFXRectangleConstRef param   // hint region
);

Description

This function gets the suitable size for the real region of this application[root(SFZRoot)].

If the argument is not specified, the responder space(device screen) which is set to the renderer will be returned.

If the argument is specified, only the specified rectangular region will be returned just as it is.

[Caution] Caution
In general, the argument is not specified when the SFYApplication::GetSuitableBound function is used.
[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Tip] Tip
Since the real region of the root(SFZRoot) which this application contains by default has been set in the SFYApplication::SFYApplication constructor, there is no need to use this function.

Reference

SFYResponder::GetSuitableBound | SFYApplication::SetRealBound | SFYApplication::SFYApplication | SFZRoot | Real Region | Responder Space | Renderer | Root(Basic)


SFYApplication::GetThis
Get the root which this application class contains by default.
[ protected ]
SFYResponderSmp GetThis(Void);

Return value

Root(SFZRoot) which this application class contains internally by default.

Description

This function gets the root(SFZRoot) which this application class contains as the root responder by default.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::GetThis | SFZRoot | Root(Basic) | Root Responder


SFYApplication::GetVirtualBound
Get the virtual region of this application.
[ public, const ]
SFXRectangleConstRef GetVirtualBound(Void);

Return value

Virtual region of this application[i.e., root]

Description

This function gets the virtual region of this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.

Reference

SFYResponder::GetVirtualBound | SFYApplication::SetVirtualBound | SFYApplication::GetRealBound | SFYApplication::GetLocalBound SFZRoot | Root(Basic) | Virtual Region


SFYApplication::HandleEvent
This is a virtual function that will be called when an event dispatched from the BREW environment needs to be handled.
[ protected, virtual ]
Bool HandleEvent(
    SFXEventConstRef event   // event
);

Return value

  • If the BREW-defined event is handled: true
  • Otherwise: false

Description

SFYApplication::HandleEvent is a virtual function that will be called when an event dispatched from the BREW environment(BREW-defined event) must be handled.

If the event is handled, "true" will be returned. Otherwise, "false" will be returned.

Default implementation is as follows:

  1. Boot up the distributer to distribute the event using the tracer.
  2. Boot up the renderer to redraw the screen if the event has been handled and no highest priority event handler is registered,
  3. Call the SFCApplication::HandleError function in case the fatal error such as insufficient memory during initialization of distributer or renderer occurs.

[Note] Highest Priority Event Handler

For more details, see the description of the SFCApplication::RegisterBypass function.

For more details, see the example code below.

You can override this virtual function for your own processing.

Internal Implementation

Internal implementation of this function is as follows:

// virtual function that will be called when the event dispatched from the BREW environment needs to be handled
/*protected virtual */Bool SFYApplication::HandleEvent(SFXEventConstRef event)
{
    // here describe the handling of the event dispatched from the BREW environment

    SFCError  error;
    Bool      result(false);

    // boot up the distributer to distribute the event using the tracer
    // first of all, the SFYDistributer instance bound with the root will receive the event
    // then, the event will be distributed to the responders in the responder tree according to the dispatching rules of the tracer
    // * _root is the root(SFZRoot)
    if ((error = _root->Distribute(event, &result)) == SFERR_NO_ERROR) {

        if (event.GetType() != SFEVT_APP_STOP && event.GetType() != SFEVT_APP_SUSPEND)) {  // if redrawing is necessary

            if (IsRenderable()) {  // if the screen can be redrawn (i.e., if no highest priority event handler is registered)

                 // boot up the renderer to redraw the responder tree below the root
                error = _root->Render();
            }
        }
    }
    if (error != SFERR_NO_ERROR) {

        // call HandleError() in case the fatal error such as insufficient memory during the initialization of the distributer or the renderer occurs
        if (HandleError(event, error)) {

            result = true;
        }
    }
    if ((event.GetType() == SFEVT_APP_SUSPEND) && IsRendererIntermissive()) {
        // if the back-up bitmap inside the renderer is released when an application suspends

        // terminate the renderer
        _renderer.Terminate();
    }
    return result;  // return "true" if the event has been handled, otherwise return "false"
}// SFYApplication::HandleEvent //

Reference: SFCApplication::HandleEvent | SFCApplication::IsRenderable | SFCApplication::HandleError | SFYApplication::IsRendererIntermissive | SFYResponder::Distribute | SFYResponder::Render | SFYRenderer::Initialize | SFYRenderer::Terminate | SFZRoot | Root | Tracer | Distributer | Renderer Drawing Event | Drawing Handler | Event Loop

Reference

SFCApplication::HandleEvent | SFCApplication::RegisterBypass | SFZRoot | BREW-defined event | Distributer | Tracer | Renderer


SFYApplication::HandleRender
This is a virtual function that will be called when the full screen needs to be redrawn.
[ protected, virtual ]
Bool HandleRender(
    SFXEventConstRef event   // event
);

Return value

  • If the screen has been redrawn: true
  • Otherwise: false

Description

SFYApplication::HandleRender is a virtual function that will be called when the full screen needs to be redrawn.

If the full screen is redrawn, "true" will be returned. Otherwise, "false" will be returned.

[Note] When the HandleRender() function is called

When an applet starts or resumes, or when a highest priority event handler ends, the full screen needs to be redrawn.

The SFYApplication::HandleRender function is automatically called at these times.

* The screen needs to be redrawn at the end of the highest priority event handler by calling the SFCApplication::RenderDeviceScreen function. In this case, HandleRender() will be called inside the SFCApplication::RenderDeviceScreen function.

[Note] Highest Priority Event Handler

For more details, see the description of the SFCApplication::RegisterBypass function.

For the default implementation of the SFYApplication::HandleRender function, see the example code below.

You can override this virtual function for your own processing.

Internal Implementation

Internal implementation of this function is as follows:

// virtual function that will be called when the full screen needs to be redrawn
/*protected virtual */Bool SFYApplication::HandleRender(SFXEventConstRef event)
{
    // here describe full screen redrawing
    SFCError  error;
    Bool      result(false);

    if (SFCApplication::HandleRender(event)) { // redraw the device screen

        // redraw the responder tree below the root
        // *1. if possible, redraw using the bitmap to restore the device screen
        // *2. start up the renderer by calling "Render(true)" if the bitmap to restore the device screen is not available in a timing such as receiving the SFEVT_APP_START event
        // *3. in case of "Render(true)", all visible responders' drawing handlers will be called
        error = _root->Render((event.GetType() == SFEVT_APP_START) || (_root->Recover() != SFERR_NO_ERROR));

        if (error == SFERR_NO_ERROR) {

            result = true;
        }
        else {
            // call HandleError() when fatal error such as insufficient memory during initialization of renderer
            HandleError(event, error);
        }
    }
    return result;
}// SFYApplication::HandleRender //

Reference: SFCApplication::HandleRender | SFCApplication::HandleError | SFYResponder::Render | SFYResponder::Recover | SFZRoot | Root | Renderer

Reference

SFCApplication::HandleRender | SFCApplication::HandleError | SFCApplication::RenderDeviceScreen


SFYApplication::Invalidate
Register the specified redraw region of this application.
[ public ]
Void Invalidate(Void);
[ public ]
Void Invalidate(
    SFXRectangleConstRef param   // redraw region(if not specified, real region of this application[root] will be passed)
);

Description

This function is used to register the specified redraw region when a text or an image inside this application[root(SFZRoot)] is updated. A subset rectangle of root can be specified in the argument. If nothing is specified, all real region of the root is regarded as the redraw region.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the Invalidate() function, see the description of the SFYResponder::Invalidate function.

Reference

SFYResponder::Invalidate | Real Region | SFZRoot | Root(Basic)


SFYApplication::InvokeBackward
Call the handlers for the specified event from the end of handler list registered into this application[root].
[ public ]
Void InvokeBackward(
    SFXEventConstRef event   // event
    Bool overload            // overloading condition
    BoolPtr result = null    // processing result
);

Description

This function sends the specified event of the callback type to this application[root(SFZRoot)].

The handlers are booted up in the order to be registerd into the handler list of the root.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the InvokeBackward() function, see the description of the SFYResponder::InvokeBackward function.

Reference

SFYResponder::InvokeBackward | SFYApplication::InvokeForward | SFYApplication::Distribute | Handler | Handler List | SFZRoot | Root(Basic)


SFYApplication::InvokeForward
Call the handlers for the specified event from the head of the handler list registered into this application[root].
[ public ]
Void InvokeForward(
    SFXEventConstRef event   // event
    Bool overload            // overloading condition
    BoolPtr result = null    // processing result
);

Description

This function sends the specified event of the callback type to this application[root(SFZRoot)].

The handlers are booted up in the reverse order to be registerd into the handler list of the root.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the InvokeForward() function, see the description of the SFYResponder::InvokeForward function.

Reference

SFYResponder::InvokeForward | SFYApplication::InvokeBackward | SFYApplication::Distribute | Handler | Handler List | SFZRoot | Root(Basic)


SFYApplication::IsRendererIntermissive
Check whether or not to terminate the renderer when an applet suspends.
[ public, const ]
Bool IsRendererIntermissive(Void);

Return value

  • If the renderer is terminated when an applet suspends: true
  • Otherwise: false

Description

This function checks whether or not to terminate the renderer when an applet suspends.

[Note] Note

If you want to release resources such as the saved bimap to restore the device screen by terminating the renderer when an applets suspends, specify the param argument to true.

In this case, the SFYRenderer::Terminate function will be called automatically when an applets receives the SFEVT_APP_RESUME event.

After an applets resumes, the SFYRenderer::Initialize function will be called automatically and the renderer will be initialized when redrawing is performed by calling the SFYResponder::Render function.

For more details, refer to the internal implementaion of the SFYApplication::HandleEvent function.

Reference

SFYApplication::SetRendererIntermissive | SFYApplication::HandleEvent | Renderer


SFYApplication::RegisterHandler
Register specified handlers into this application.
[ public ]
SFCError RegisterHandler(
    SFXEventRangeConstRef range        // event range
    SFYHandler::RuleRecConstRef rule   // handler rule
);
[ public ]
SFCError RegisterHandler(
    SFXEventRangeConstRef range   // event range
    SFYHandler::HandlerSPP spp    // handler function
    VoidPtr reference             // reference value
);
[ public ]
SFCError RegisterHandler(
    SFXEventRangeConstPtr range        // array of event range
    SFYHandler::RuleRecConstPtr rule   // array of handler rule
    SInt32 length                      // number of the elements of the array
);
[ public ]
SFCError RegisterHandler(
    SFXEventRangeConstPtr range          // array of event range
    SFYHandler::HandlerSPPConstPtr spp   // array of handler function
    VoidPtrConstPtr reference            // array of reference value
    SInt32 length                        // number of the elements of the array
);

Argument

range

represents the range of events which the handler will receive

rule

represents the set of handler functions and reference values

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid parameter: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function registers specified handlers into this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the RegisterHandler() function, see the description of the SFYResponder::RegisterHandler function.

Reference

SFYResponder::RegisterHandler | SFYApplication::UnregisterHandler | SFYApplication::ClearHandler | SFZRoot | Handler | Root(Basic)


SFYApplication::RegisterTracer
Register specified rules into the tracer of this application.
[ public ]
SFCError RegisterTracer(
    SFXEventRangeConstRef range       // event range
    SFYTracer::RuleRecConstRef rule   // tracer rule
);
[ public ]
SFCError RegisterTracer(
    SFXEventRangeConstRef range   // event range
    SFYTracer::OrderEnum order    // processing order
    SFYTracer::StateEnum state    // distributing condition
    Bool overload                 // overloading condition
);
[ public ]
SFCError RegisterTracer(
    SFXEventRangeConstPtr range       // array of event range
    SFYTracer::RuleRecConstPtr rule   // array of tracer rule
    SInt32 length                     // number of the elements of the array
);
[ public ]
SFCError RegisterTracer(
    SFXEventRangeConstPtr range          // array of event range
    SFYTracer::OrderEnumConstPtr order   // array of processing order
    SFYTracer::StateEnumConstPtr state   // array of distributing condition
    BoolConstPtr overload                // array of overloading condition
    SInt32 length                        // number of the elements of the array
);

Argument

range

represent the event range to which the tracer rules adjust

rule

represents the set of processing order, distributing condition, and overloading condition

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid parameter: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function registers specified rules into the tracer of this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the RegisterTracer() function, see the description of the SFYResponder::RegisterTracer function.

Reference

SFYResponder::RegisterTracer | SFYApplication::UnregisterTracer | SFYApplication::ClearTracer | SFZRoot | Root(Basic) | Tracer


SFYApplication::Render
Boot up the renderer for redrawing this application[root] and its descendant responders.
[ public ]
SFCError Render(
    Bool force = false   // forced redrawing
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If invalid state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_FAILED

Description

This function boots up the renderer for redrawing this application[root(SFZRoot)] and its descendant responders.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the Render() function, see the description of the SFYResponder::Render function.

Reference

SFYResponder::Render | SFZRoot | Renderer | Root(Basic)


SFYApplication::SetRealBound
Set the real region of this application to the specified region.
[ public ]
Void SetRealBound(
    SFXRectangleConstRef param   // value to set
);

Description

This function sets the real region of this application[root(SFZRoot)] to the specified region.

Default: device screen region obtained by calling the SFXDevice::GetScreenSize function.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note

The real region of an application is is the visible region of the root, which is represented in the relative coordinate system with the left-top of the responder space as the origin (0, 0).

In the SFYApplication::SFYApplication constructor, this region is by default set to the device screen region obtained by calling the SFXDevice::GetScreenSize function, which is the same with the responder space.

In general, since this default setting is enough, there is no need to use the SFYApplication::SetRealBound function.

For more details on the SetRealBound() function, see the description of the SFYResponder::SetRealBound function.

* In the region outside the responder space, drawing will not be performed.

Reference

SFYResponder::SetRealBound | SFYApplication::GetRealBound | SFYApplication::SetVirtualBound | SFYApplication::SFYApplication | SFXDevice::GetScreenSize | SFXRectangle | SFZRoot | Real Region | Responder Space | Root(Basic)


SFYApplication::SetRendererIntermissive
Set the flag indicating whether or not to terminate the renderer when an applet suspends.
[ public ]
Void SetRendererIntermissive(
    Bool param   // value to set
);

Description

This function sets the flag indicating whether or not to terminate the renderer when an applet suspends.

Default: false

[Note] Note

If you want to release resources such as the saved bimap to restore the device screen by terminating the renderer when an applets suspends, specify the param argument to true.

In this case, the SFYRenderer::Terminate function will be called automatically when an applets receives the SFEVT_APP_RESUME event.

After an applets resumes, the SFYRenderer::Initialize function will be called automatically and the renderer will be initialized when redrawing is performed by calling the SFYResponder::Render function.

For more details, refer to the internal implementaion of the SFYApplication::HandleEvent function.

Reference

SFYApplication::IsRendererIntermissive | SFYApplication::HandleEvent | SFYResponder::Render | SFYRenderer::Initialize | SFYRenderer::Terminate | SFYRenderer | Renderer


SFYApplication::SetVirtualBound
Set the virtual region of this application to the specified region.
[ public ]
Void SetVirtualBound(
    SFXRectangleConstRef param   // value to set
);

Description

This function sets the virtual region of this application[root(SFZRoot)] to the specified region.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note

The virtual region of an application is is that of the root.

This region is by default set to the device screen region obtained by calling the SFXDevice::GetScreenSize function, which is the same with the real region of the root.

In general, since this default setting is enough, there is no need to use the SFYApplication::SetVirtualBound function.

For more details on the SetVirtualBound() function, see the description of the SFYResponder::SetVirtualBound function.

Reference

SFYResponder::SetVirtualBound | SFYApplication::GetVirtualBound | SFYApplication::SetRealBound | SFXDevice::GetScreenSize | SFXRectangle | SFZRoot | Virtual Region | Real Region | Root(Basic)


SFYApplication::UnregisterHandler
Unregister the handler from this application which matches the specified condition.
[ public ]
Void UnregisterHandler(
    SFXEventRangeConstRef range        // event range
    SFYHandler::RuleRecConstRef rule   // handler rule
);
[ public ]
Void UnregisterHandler(
    SFXEventRangeConstRef range   // event range
    SFYHandler::HandlerSPP spp    // handler function
    VoidPtr reference             // reference value
);
[ public ]
Void UnregisterHandler(
    SFXEventRangeConstPtr range        // array of event range
    SFYHandler::RuleRecConstPtr rule   // array of handler rule
    SInt32 length                      // number of the elements of the array
);
[ public ]
Void UnregisterHandler(
    SFXEventRangeConstPtr range          // array of event range
    SFYHandler::HandlerSPPConstPtr spp   // array of handler function
    VoidPtrConstPtr reference            // array of reference value
    SInt32 length                        // number of the elements of the array
);

Argument

range

represents the range of events which the handler will receive

rule

represents the set of handler functions and reference values

Description

This function unregisters the handler registered into this application[root(SFZRoot)] which matches the specified condition.

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the UnregisterHandler() function, see the description of the SFYResponder::UnregisterHandler function.

Reference

SFYResponder::UnregisterHandler | SFYApplication::RegisterHandler | SFYApplication::ClearHandler | SFZRoot | Handler | Root(Basic)


SFYApplication::UnregisterTracer
Unregister specified rules from the tracer of this application.
[ public ]
Void UnregisterTracer(
    SFXEventRangeConstRef range   // event range
);
[ public ]
Void UnregisterTracer(
    SFXEventRangeConstPtr range   // array of event range
    SInt32 length                 // number of the elements of the array
);

Argument

range

represent the event range to which the tracer rules adjust

Description

This function unregisters specified rules registered into the tracer of this application[root(SFZRoot)].

[Note] Note
This operation is delegated to the root(SFZRoot) which this application contains by default.
[Note] Note
For more details on the UnregisterTracer() function, see the description of the SFYResponder::UnregisterTracer function.

Reference

SFYResponder::UnregisterTracer | SFYApplication::RegisterTracer | SFYApplication::ClearTracer | SFZRoot | Root(Basic) | Tracer