MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Macros | Typedefs | Functions
mh5application.c File Reference

Implementation of the MHEG5 Application Class Defines a set of Ingredient objects, which are shared within an application scope. Base class: Group Subclasses: None Status: Concrete class. More...

#include "mh5application.h"
#include "mh5object.h"
#include "mh5variable.h"
#include "mh5memory.h"
#include "mh5queue.h"
#include "mh5display.h"
#include "mh5fileorm.h"
#include "mh5storage.h"
#include "mh5gate.h"
#include "mh5debug.h"
#include "mh5misc.h"
#include "glue_queue.h"
#include "glue_main.h"
#include "fpa1_parserInvoke.h"
#include "tmcolor.h"
#include "mh5profile.h"
#include "mh5support.h"
#include "mh5control.h"
#include "glue_dsmcc.h"
#include "dsm_control.h"
#include <string.h>
#include <time.h>

Macros

#define WRITE_BUFFER_MAX   (2 * 1024)
 
#define MAX_APPS   6
 

Typedefs

typedef struct sMHEG5applStackItem MHEG5AppStackItem
 
typedef struct s_boot_data S_BOOT_DATA
 

Functions

void MHEG5applicationCarouselUnload (void *carousel, BOOLEAN isNdt)
 
void MHEG5applicationNDTcarouselAttach (void *carousel)
 
void MHEG5applicationStackClear (BOOLEAN isNdt)
 
MHEG5ApplicationMHEG5getCurrentApplication (void)
 Retrieve the current Application. More...
 
MHEG5RootMHEG5displayStackGetVisible (MHEG5DisplayStackItem *item)
 This function returns the visible at a specific display stack positon. More...
 
MHEG5DisplayStackItemMHEG5displayStackBottom (void)
 This function returns a pointer to the DisplayStackItem at the Bottom of the Stack. More...
 
MHEG5DisplayStackItemMHEG5displayStackPrev (MHEG5DisplayStackItem *item)
 This function returns a pointer to the previous item in the display stack. The input parameter is a DisplayStackItem. More...
 
MHEG5DisplayStackItemMHEG5displayStackPrevVisible (MHEG5Root *visible)
 This function returns a pointer to the previous item in the display stack. The input parameter is a Visible. More...
 
void MHEG5displayStackAdd (MHEG5Root *visible, MHEG5Bool atTop)
 This function adds a visible to the display stack. The parameter atTop defines if the Visible is added at the Top or Bottom of the display stack. More...
 
MHEG5Bool MHEG5displayStackDelete (MHEG5Root *visible)
 This function removes the reference to a visible object from the display stack. More...
 
void MHEG5displayStackToTop (MHEG5Root *visible)
 Move a Visible to the Top of the display stack. More...
 
void MHEG5displayStackToBottom (MHEG5Root *visible)
 Move a visible to the Bottom of the display stack. More...
 
void MHEG5displayStackPutBefore (MHEG5Root *target, MHEG5Root *refVisible)
 Put a Visible exactly in front of another Visible in the display stack. More...
 
void MHEG5displayStackPutBehind (MHEG5Root *target, MHEG5Root *refVisible)
 Put a Visible exactly below another Visible in the display stack. More...
 
void MHEG5applicationInit (MHEG5Application *application)
 Initialise an application object with default values. This function initialises an application object with default values. More...
 
void MHEG5applicationFree (MHEG5Application *application)
 Free off all memory associated with the specified object, including any exchanged attributes and internal data. The data holding the object itself is not freed. More...
 
void MHEG5applicationPrepare (MHEG5Application *application)
 Apply the group preparation behaviour. More...
 
void MHEG5applicationDestruct (MHEG5Application *application)
 Destruct an application object. This function destructs all parts of an application object. More...
 
void MHEG5ActivateCurrentApplication (void)
 Apply the group activation behaviour. More...
 
void MHEG5applicationDeactivate (MHEG5Application *application)
 Apply the application deactivation behaviour +Apply the CloseConnection action to all opened auxiliary connections. +Apply the Deactivation behaviour as inherited from the base class. More...
 
MHEG5ErrorCode MHEG5storePersistent (MHEG5Root *target, MHEG5GList *params)
 Implementation of the StorePersistent (StoreSucceeded, InVariables, OutFileName) action from the application class StorePersistent (StoreSucceeded, InVariables, OutFileName) Requests the MHEG-5 engine to save data in such a way that it may later be retrieved by the ReadPersistent action. More...
 
MHEG5ErrorCode MHEG5readPersistent (MHEG5Root *target, MHEG5GList *params)
 Implementation of the ReadPersistent (ReadSucceded, OutVariables, InFileName) action from the application class ReadPersistent (ReadSucceded, OutVariables, InFileName) Request the MHEG-5 engine to read data that has been saved by the StorePersistent action. More...
 
MHEG5ErrorCode MHEG5applicationLaunch (MHEG5String gname, MHEG5Int id)
 Implementation of the Launch action from the application class Activate a new application by flushing the currently active one. Add a request for the new application at the asynchronous orm. The orm calls back |MHEG5applicationRetrieved|. More...
 
MHEG5ErrorCode MHEG5applicationBootup (char *app_name, BOOLEAN single)
 Launches Boot Application according to name rules: This function will authenticate and resolve a filename to its origin and path. The origin will be of the form: CI:// or DSM://. If the origin is DSM:// then the following sequence of file loads are completed until an application is found, or all attempts fail. If the application name is blank then the first three steps are skipped, (DSM assumed) More...
 
void MHEG5applicationBootAbort (void)
 Aborts launch of Boot Application. More...
 
void MHEG5applicationClearGroupTargets (MHEG5Application *application, MHEG5Group *group)
 Clear targets of actions if they are ingredients of the given group. More...
 
void MHEG5applicationResolveTargets (MHEG5Application *application)
 Resolve unresolved targets of actions in the application. More...
 
MHEG5ErrorCode MHEG5launch (MHEG5Root *target, MHEG5GList *params)
 
MHEG5ErrorCode MHEG5spawn (MHEG5Root *target, MHEG5GList *params)
 Implementation of the Spawn action from the application class +Execute the OnSpawnCloseDown Action of the currently active Application object. +Store the GroupIdentifier of the currently active Application on the application identifier stack, if any. +Execute the effect of the Launch action. More...
 
MHEG5ErrorCode MHEG5quit (MHEG5Root *target, MHEG5GList *params)
 Implementation of the Quit action from the application class Close an application and restart the previous application. More...
 
void MHEG5quitApp (void)
 Close an application because of the Quit Application Event defined by DTG. More...
 
MHEG5ErrorCode MHEG5lockScreen (MHEG5Root *target, MHEG5GList *params)
 Implementation of the LockScreen action of the application class Freeze the display screen and prevent from reflecting changes to Visible objects. More...
 
MHEG5ErrorCode MHEG5unlockScreen (MHEG5Root *target, MHEG5GList *params)
 Impelemtation of the UnlockScreen action of the application class This action may refresh the display screen and reflect at once all changes to Visible objects. More...
 
MHEG5ErrorCode MHEG5openConnection (MHEG5Root *target, MHEG5GList *params)
 Impelemtation of the OpenConnection (OpenSucceeded, Protocol, Address, ConnectionTag) action of the application class |NOT IMPLEMENTED.|. More...
 
MHEG5ErrorCode MHEG5closeConnection (MHEG5Root *target, MHEG5GList *params)
 Impelemtation of the CloseConnection(ConnectionTag) action of the application class |NOT IMPLEMENTED.|. More...
 
MHEG5ErrorCode MHEG5getEngineSupport (MHEG5Root *target, MHEG5GList *params)
 Implementation of the GetEngineSupport action of the application class GetEngineSupport (Feature, Answer) AncillaryConnections (asks whether engine supports ancillary point to point connections. These connections deal with the actions OpenConnection and CloseConnection, and the attribute ConnectionTag in various elementary actions) ApplicationStacking (asks whether engine provides support for the Spawn action of the Application class) Cloning (asks whether engine supports the Clone action) FreeMovingCursor (asks whether engine provides support for the class CursorShape, for the events CursorEnter and CursorLeave, and for the actions GetCursorPosition, SetCursorPosition, and SetCursorShape) MultipleAudioStreams(N) (asks whether engine supports at least N simultaneous Audio streams) MultipleRTGraphicsStreams(N) (asks whether engine supports at least N simultaneous RTGraphics streams) MultipleVideoStreams(N) (asks whether engine supports at least N simultaneous Video streams) OverlappingVisibles(N) (asks whether engine supports at least N overlapping Visibles) Scaling (asks whether engine supports ScaleBitmap and ScaleVideo actions) SceneAspectRatio(W,H) (asks whether engine supports a given aspect ratio. W & H are two integers, W / H is the width/height aspect ratio.) SceneCoordinateSystem(X,Y) (asks whether engine supports a given coordinate system. X & Y are two integers defining the coordinate system.) TrickModes (asks whether engine supports trick modes for Streams) More...
 
MHEG5ErrorCode MHEG5setDesktopColour (MHEG5Root *target, MHEG5GList *params)
 Impelemtation of the SetDesktopColour action of the application class This action may refresh the display screen and reflect at once all changes to Visible objects. More...
 

Detailed Description

Implementation of the MHEG5 Application Class Defines a set of Ingredient objects, which are shared within an application scope. Base class: Group Subclasses: None Status: Concrete class.

Date
01/02/2002
Author
R.Freeman

Function Documentation

void MHEG5ActivateCurrentApplication ( void  )

Apply the group activation behaviour.

Parameters
MHEG5Application* application
Returns
void
void MHEG5applicationBootAbort ( void  )

Aborts launch of Boot Application.

Returns
void
MHEG5ErrorCode MHEG5applicationBootup ( char *  app_name,
BOOLEAN  single 
)

Launches Boot Application according to name rules: This function will authenticate and resolve a filename to its origin and path. The origin will be of the form: CI:// or DSM://. If the origin is DSM:// then the following sequence of file loads are completed until an application is found, or all attempts fail. If the application name is blank then the first three steps are skipped, (DSM assumed)

  1. application
  2. DSM://application/a
  3. DSM://application/startup
  4. DSM://a
  5. DSM://startup If application name has origin CI:// then only one attempt is made to load. Similarly when 'single' is set to TRUE.
    Parameters
    app_nameApplication boot name
    singleWhen TRUE only single attempt to load using app_name
    Returns
    Error code.
void MHEG5applicationClearGroupTargets ( MHEG5Application application,
MHEG5Group group 
)

Clear targets of actions if they are ingredients of the given group.

Parameters
applicationPointer to application object.
groupPointer to group object.
Returns
Void
void MHEG5applicationDeactivate ( MHEG5Application application)

Apply the application deactivation behaviour +Apply the CloseConnection action to all opened auxiliary connections. +Apply the Deactivation behaviour as inherited from the base class.

Parameters
MHEG5Application* application
Returns
void
void MHEG5applicationDestruct ( MHEG5Application application)

Destruct an application object. This function destructs all parts of an application object.

Parameters
MHEG5Application*application
Returns
void
void MHEG5applicationFree ( MHEG5Application application)

Free off all memory associated with the specified object, including any exchanged attributes and internal data. The data holding the object itself is not freed.

Parameters
applicationPointer to object to free.
Returns
Void
void MHEG5applicationInit ( MHEG5Application application)

Initialise an application object with default values. This function initialises an application object with default values.

Initialise an application object with default values.

Returns
MHEG5Application *
MHEG5ErrorCode MHEG5applicationLaunch ( MHEG5String  gname,
MHEG5Int  id 
)

Implementation of the Launch action from the application class Activate a new application by flushing the currently active one. Add a request for the new application at the asynchronous orm. The orm calls back |MHEG5applicationRetrieved|.

Parameters
MHEG5Stringgname
MHEG5Intid
Returns
MHEG5ErrorCode MHEG5ErrorCode
void MHEG5applicationPrepare ( MHEG5Application application)

Apply the group preparation behaviour.

Parameters
MHEG5Application*application
Returns
void
void MHEG5applicationResolveTargets ( MHEG5Application application)

Resolve unresolved targets of actions in the application.

Parameters
applicationPointer to application object.
Returns
Void
MHEG5ErrorCode MHEG5closeConnection ( MHEG5Root target,
MHEG5GList params 
)

Impelemtation of the CloseConnection(ConnectionTag) action of the application class |NOT IMPLEMENTED.|.

Parameters
MHEG5Roottarget
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode MHEG5ERR_NOTSUPPORTEDBYPROFILE
void MHEG5displayStackAdd ( MHEG5Root visible,
MHEG5Bool  atTop 
)

This function adds a visible to the display stack. The parameter atTop defines if the Visible is added at the Top or Bottom of the display stack.

Parameters
MHEG5Root*visible
MHEG5BoolatTop
Returns
void
MHEG5DisplayStackItem* MHEG5displayStackBottom ( void  )

This function returns a pointer to the DisplayStackItem at the Bottom of the Stack.

Returns
MHEG5DisplayStackItem * Pointer to the DisplayStackItem at the Bottom of the Stack 0 if there is no current application
MHEG5Bool MHEG5displayStackDelete ( MHEG5Root visible)

This function removes the reference to a visible object from the display stack.

Parameters
MHEG5Root*visible
Returns
MHEG5Bool True if item was deleted sucessfully.
MHEG5Root* MHEG5displayStackGetVisible ( MHEG5DisplayStackItem item)

This function returns the visible at a specific display stack positon.

Parameters
MHEG5DisplayStackItem*item
Returns
MHEG5Root * Pointer to a visible
MHEG5DisplayStackItem* MHEG5displayStackPrev ( MHEG5DisplayStackItem item)

This function returns a pointer to the previous item in the display stack. The input parameter is a DisplayStackItem.

Parameters
MHEG5DisplayStackItem*item
Returns
MHEG5DisplayStackItem * Pointer to the previous DisplayStackItem
MHEG5DisplayStackItem* MHEG5displayStackPrevVisible ( MHEG5Root visible)

This function returns a pointer to the previous item in the display stack. The input parameter is a Visible.

Parameters
MHEG5Root*visible
Returns
MHEG5DisplayStackItem * This function returns a pointer to the previous item in the display stack.
void MHEG5displayStackPutBefore ( MHEG5Root target,
MHEG5Root refVisible 
)

Put a Visible exactly in front of another Visible in the display stack.

Parameters
MHEG5Root*target
MHEG5Root*refVisible
Returns
void
void MHEG5displayStackPutBehind ( MHEG5Root target,
MHEG5Root refVisible 
)

Put a Visible exactly below another Visible in the display stack.

Parameters
MHEG5Root*target
MHEG5Root*refVisible
Returns
void
void MHEG5displayStackToBottom ( MHEG5Root visible)

Move a visible to the Bottom of the display stack.

Parameters
MHEG5Root*visible
Returns
void
void MHEG5displayStackToTop ( MHEG5Root visible)

Move a Visible to the Top of the display stack.

Parameters
MHEG5Root*visible
Returns
void
MHEG5Application* MHEG5getCurrentApplication ( void  )

Retrieve the current Application.

<Function description>="">

Returns
MHEG5Application * Pointer to the current application or a NULL reference when there is no current application
MHEG5ErrorCode MHEG5getEngineSupport ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the GetEngineSupport action of the application class GetEngineSupport (Feature, Answer) AncillaryConnections (asks whether engine supports ancillary point to point connections. These connections deal with the actions OpenConnection and CloseConnection, and the attribute ConnectionTag in various elementary actions) ApplicationStacking (asks whether engine provides support for the Spawn action of the Application class) Cloning (asks whether engine supports the Clone action) FreeMovingCursor (asks whether engine provides support for the class CursorShape, for the events CursorEnter and CursorLeave, and for the actions GetCursorPosition, SetCursorPosition, and SetCursorShape) MultipleAudioStreams(N) (asks whether engine supports at least N simultaneous Audio streams) MultipleRTGraphicsStreams(N) (asks whether engine supports at least N simultaneous RTGraphics streams) MultipleVideoStreams(N) (asks whether engine supports at least N simultaneous Video streams) OverlappingVisibles(N) (asks whether engine supports at least N overlapping Visibles) Scaling (asks whether engine supports ScaleBitmap and ScaleVideo actions) SceneAspectRatio(W,H) (asks whether engine supports a given aspect ratio. W & H are two integers, W / H is the width/height aspect ratio.) SceneCoordinateSystem(X,Y) (asks whether engine supports a given coordinate system. X & Y are two integers defining the coordinate system.) TrickModes (asks whether engine supports trick modes for Streams)

MHEG5PROFILE_UK1_06

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode
MHEG5ErrorCode MHEG5lockScreen ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the LockScreen action of the application class Freeze the display screen and prevent from reflecting changes to Visible objects.

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode
MHEG5ErrorCode MHEG5openConnection ( MHEG5Root target,
MHEG5GList params 
)

Impelemtation of the OpenConnection (OpenSucceeded, Protocol, Address, ConnectionTag) action of the application class |NOT IMPLEMENTED.|.

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode MHEG5ERR_NOTSUPPORTEDBYPROFILE
MHEG5ErrorCode MHEG5quit ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the Quit action from the application class Close an application and restart the previous application.

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode
void MHEG5quitApp ( void  )

Close an application because of the Quit Application Event defined by DTG.

Returns
void
MHEG5ErrorCode MHEG5readPersistent ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the ReadPersistent (ReadSucceded, OutVariables, InFileName) action from the application class ReadPersistent (ReadSucceded, OutVariables, InFileName) Request the MHEG-5 engine to read data that has been saved by the StorePersistent action.

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode
MHEG5ErrorCode MHEG5setDesktopColour ( MHEG5Root target,
MHEG5GList params 
)

Impelemtation of the SetDesktopColour action of the application class This action may refresh the display screen and reflect at once all changes to Visible objects.

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode
MHEG5ErrorCode MHEG5spawn ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the Spawn action from the application class +Execute the OnSpawnCloseDown Action of the currently active Application object. +Store the GroupIdentifier of the currently active Application on the application identifier stack, if any. +Execute the effect of the Launch action.

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode
MHEG5ErrorCode MHEG5storePersistent ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the StorePersistent (StoreSucceeded, InVariables, OutFileName) action from the application class StorePersistent (StoreSucceeded, InVariables, OutFileName) Requests the MHEG-5 engine to save data in such a way that it may later be retrieved by the ReadPersistent action.

Parameters
MHEG55Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode
MHEG5ErrorCode MHEG5unlockScreen ( MHEG5Root target,
MHEG5GList params 
)

Impelemtation of the UnlockScreen action of the application class This action may refresh the display screen and reflect at once all changes to Visible objects.

Parameters
MHEG5Root*target
MHEG5GList*params
Returns
MHEG5ErrorCode MHEG5ErrorCode