Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Hi,
I am trying to get the icon of an applet in SAS through appletinfo actor.
/actor/AppletInfo//icon

while I am able to get the name of the app, I am not able to get the image.
Does anyone know from where does the appletinfo actor picks the image for an applet in SAS?

The AppletInfoActor gets the image out of the MIF. Resources of images can be icon, thumb or image defined as follows in AEEShell.h:
#define IDR_ICON_OFFSET 1
#define IDR_IMAGE_OFFSET 2
#define IDR_THUMB_OFFSET 3
#define APPR_ICON(ai) (uint16)(((ai).wIDBase + IDR_ICON_OFFSET))
#define APPR_IMAGE(ai) (uint16)(((ai).wIDBase + IDR_IMAGE_OFFSET))
#define APPR_THUMB(ai) (uint16)(((ai).wIDBase + IDR_THUMB_OFFSET))
The commonappinfo lua library in appframe gets icons out the common app info of the application (which is a resource file). This is documented in AEEAppInfo2.htm.

The AppletInfoActor gets the image out of the MIF. Resources of images can be icon, thumb or image defined as follows in AEEShell.h:
#define IDR_ICON_OFFSET 1
#define IDR_IMAGE_OFFSET 2
#define IDR_THUMB_OFFSET 3
#define APPR_ICON(ai) (uint16)(((ai).wIDBase + IDR_ICON_OFFSET))
#define APPR_IMAGE(ai) (uint16)(((ai).wIDBase + IDR_IMAGE_OFFSET))
#define APPR_THUMB(ai) (uint16)(((ai).wIDBase + IDR_THUMB_OFFSET))
The commonappinfo lua library in appframe gets icons out the common app info of the application (which is a resource file). This is documented in AEEAppInfo2.htm.

Hi Chris,
Thanks for the information.
The problem that I have is I am able to get the images of some Brew based apps that came with the SDK (HelloWidgetApp, System Info and Native Sharing Tester). But I am not able to retrieve the image of the SAS apps.
For the SAS ones, from the CIF file, I see some definition for the resource , probably image as below.
require 'AppInfo2CIFHelper'
AppInfo2 {
class = AEECLSID_CONTACTSTRIG,
file = "appinfo.ini"

so my guess is that it should pick up the icons as defined in this .ini file.
But not sure why it doesnt pick up.
As you may be aware the ini file has the following details
appMgrIcon/iconDefinitionPath=appInfo/appMgrIcon
homescreenIcon/iconDefinitionPath=appInfo/hsIcon
And this path has the correct image also.
When I try to get the image from /actor/appletinfo//icon. I get a message that the resource doesnt exist.
Do you think I am missing some other config info?
Thanks,
Naren

Hi Chris,
Thanks for the information.
The problem that I have is I am able to get the images of some Brew based apps that came with the SDK (HelloWidgetApp, System Info and Native Sharing Tester). But I am not able to retrieve the image of the SAS apps.
For the SAS ones, from the CIF file, I see some definition for the resource , probably image as below.
require 'AppInfo2CIFHelper'
AppInfo2 {
class = AEECLSID_CONTACTSTRIG,
file = "appinfo.ini"

so my guess is that it should pick up the icons as defined in this .ini file.
But not sure why it doesnt pick up.
As you may be aware the ini file has the following details
appMgrIcon/iconDefinitionPath=appInfo/appMgrIcon
homescreenIcon/iconDefinitionPath=appInfo/hsIcon
And this path has the correct image also.
When I try to get the image from /actor/appletinfo//icon. I get a message that the resource doesnt exist.
Do you think I am missing some other config info?
Thanks,
Naren

Hi Naren,
Is this still a pending issue?
I believe there are two different things being discussed here.
1) the icons listed in appinfo2.ini are accessed through ISettings
2) the icons in the MIF are stored in the .mif file as resources and are accessed through a different API. take a look at the file AppletInfoActor.c and it accesses the MIF icons through this command...
IImage *piImage = ISHELL_LoadResImage(pMe->base.pShell, ai.pszMIF, APPR_ICON(ai));
Does your MIF file have icons stored in it?
Thanks,
Anand

Hi Naren,
Is this still a pending issue?
I believe there are two different things being discussed here.
1) the icons listed in appinfo2.ini are accessed through ISettings
2) the icons in the MIF are stored in the .mif file as resources and are accessed through a different API. take a look at the file AppletInfoActor.c and it accesses the MIF icons through this command...
IImage *piImage = ISHELL_LoadResImage(pMe->base.pShell, ai.pszMIF, APPR_ICON(ai));
Does your MIF file have icons stored in it?
Thanks,
Anand