Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Applet class

Applet classes implement IApplet and are identified, dynamically discovered, and instantiated using a unique Applet ID (see Unique IDs (UID)). Applet classes are also known as applets or applications in Brew MP. These are IShell-dependent classes; they can only be instantiated inside BREW Shell. IShell_StartApplet() or related APIs are used to start an applet and IShell_CloseApplet() or related APIs are used to delete or terminate a running applet.

The applet class is declared via the Applet primitive in the CIF. See IShell and IEnv and Application information in CIF and MIF for more information.

The following is an example of declaring an applet in CIF:

Applet {
  appletid = AEECLSID_MyApplet,
  resbaseid = 20,
  applethostid = 0,
  privs = { AEEPRIVID_UDP_NET_URGENT, AEEPRIVID_FS_FULL_READ },
  type = 0, 
  flags = 0,
  newfunc = MyApplet_New,
}

  • MyApplet_New is the constructor of the applet class written in C/C++ code, and is invoked when the applet is started by IShell_StartApplet() using AEECLSID_MyApplet.
  • applethostid = 0 indicates that the applet class is started in the kernel process.
  • newfunc is explicitly specified in the CIF for MOD1 files. For MOD files, the constructor is set up by helper files such as AEEModGen.c.

For more information on CIF, see the Resource File and Markup Reference.