##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 EVALUATION    14/Jan/2011  23:28:13 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\pasha\elf\googlecode\MySMSYS\Mss3\IconPack.cpp    #
#    Command line    =  D:\pasha\elf\googlecode\MySMSYS\Mss3\IconPack.cpp    #
#                       -D NEWSGOLD -D ELKA -D LANG_EN -lcN                  #
#                       D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \List\ -o D:\pasha\elf\googlecode\MySMSYS\Mss3\Relea #
#                       se_ELKA_EN\Obj\ -s9 --no_unroll --cpu_mode arm       #
#                       --endian little --cpu ARM926EJ-S --stack_align 4     #
#                       --interwork -e --fpu None --eec++ --dlib_config      #
#                       "D:\pasha\Embedded Workbench 4.0                     #
#                       Evaluation2\ARM\LIB\dl5tpainl8n.h" -I                #
#                       "D:\pasha\Embedded Workbench 4.0                     #
#                       Evaluation2\ARM\INC\" --inline_threshold=2           #
#    List file       =  D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \List\IconPack.lst                                   #
#    Object file     =  D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \Obj\IconPack.r79                                    #
#                                                                            #
#                                                                            #
##############################################################################

D:\pasha\elf\googlecode\MySMSYS\Mss3\IconPack.cpp
      1          #include "include.h"
      2          #include "File.h"
      3          #include "IconPack.h"
      4          
      5          const char *IconNames[]=
      6          {
      7            //main menu
      8            "mm_crtsms.png", //create
      9            "mm_smsnew.png", //new in sms
     10            "mm_inbox.png", //inbox
     11            "mm_sent.png",
     12            "mm_draft.png",
     13            "mm_allsms.png",
     14            "mm_others.png",
     15            
     16            //sms type
     17            "sms_innew.png",
     18            "sms_inread.png",
     19            "sms_sent.png",
     20            "sms_draft.png",
     21            //ems
     22            "ems_innew.png",
     23            "ems_inread.png",
     24            "ems_sent.png",
     25            "ems_draft.png",
     26            //headr icon
     27            //hdr menu
     28            "hdr_mmenu.png",
     29            "hdr_smsnew.png",
     30            "hdr_inbox.png",
     31            "hdr_sent.png",
     32            "hdr_draft.png",
     33            "hdr_allsms.png",
     34            "hdr_filter.png",
     35            //hdr edit_gui
     36            "hdr_ed_view.png",
     37            "hdr_ed_edit.png",
     38            "hdr_ed_adrbk.png", //addressbook
     39            
     40            //pop-up window icon
     41            "pp_incoming.png",
     42            "pp_showmsg.png",
     43            
     44            //display
     45            "dis_smsnew.png", //show in display
     46            "icon_mysmsys.png"
     47            "",""
     48          };
     49          
     50          const int DefaultIcons[]=
     51          {
     52            ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK, 
     53          #ifdef NEWSGOLD
     54          #ifdef ELKA
     55            0x5B6,0x5B5,0x5B8,0x5B2,
     56            0x5B3,0x5B4,0x5B4,0x5B4,
     57          #else
     58          #ifdef S68
     59            0x5F4,0x5F3,0x5F6,0x5F0,
     60            0x5F1,0x5F2,0x5F2,0x5F2,
     61          #else
     62            0x5E2,0x5E1,0x5E4,0x5DE,
     63            0x5DF,0x5E0,0x5E0,0x5E0,
     64          #endif
     65          #endif
     66          #endif
     67            ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK,ICON_BLANK,
     68            ICON_BLANK,ICON_BLANK,ICON_BLANK,
     69            ICON_BLANK,ICON_BLANK,
     70            ICON_BLANK,
     71            ICON_BLANK,
     72            0,0
     73          };
     74          
     75          void IconPack::LoadIconPack(void)
     76          {
     77            int max=sizeof(ICONPACK)/sizeof(int);
     78            int /*len, c, */i, *p;
     79            char folder[128], ftemp[128], *tt;
     80            strcpy(folder, main_folder);
     81            //len=strlen(folder);
     82            //c=folder[len-1];
     83            //if(c!='\\' && c!='/')
     84            //{
     85            //  folder[len]='\\';
     86            //  folder[len+1]=0;
     87            //}
     88            if(!IsDir(folder))
     89              return;
     90            strcat(folder, "Img\\");
     91            if(!IsDir(folder))
     92            {
     93              MkDir(folder);
     94              return;
     95            }
     96            p=(int *)(&this->ip);
     97            for(i=0;i<max;i++)
     98            {
     99              strcpy(ftemp, folder);
    100              if(IconNames[i])
    101              {
    102                strcat(ftemp, IconNames[i]);
    103                if(IsFileExist(ftemp))
    104                {
    105          	tt=new char[128];
    106          	strcpy(tt, ftemp);
    107          	p[i]=(int)tt;
    108                }
    109              }
    110            }
    111            InitIconPack();
    112          }
    113          
    114          void IconPack::FreeIconPack(void)
    115          {
    116            int max=sizeof(ICONPACK)/sizeof(int);
    117            int i, *p, z;
    118            p=(int *)(&this->ip);
    119            for(i=0;i<max;i++)
    120            {
    121              z=p[i];
    122              if(((unsigned int)z>>28)==0xA)
    123              {
    124                delete (void *)z;
    125              }
    126            }
    127            LoadDefaultIP();
    128          }
    129          
    130          void IconPack::LoadDefaultIP(void)
    131          {
    132            memcpy(&this->ip, DefaultIcons, sizeof(ICONPACK));
    133          }
    134          
    135          void IconPack::ZeroIconPack(void)
    136          {
    137            zeromem(&this->ip, sizeof(ICONPACK));
    138          }
    139          
    140          void IconPack::InitIconPack(void)
    141          {
    142            //TabGUI.cpp
    143            int i;
    144            extern int TABICONS[5][4];
    145            for(i=0;i<4;i++)
    146            {
    147              TABICONS[0][i]=ip.hdr_mmenu;
    148            }
    149            for(i=0;i<4;i++)
    150            {
    151              TABICONS[1][i]=ip.hdr_inbox;
    152            }
    153            for(i=0;i<4;i++)
    154            {
    155              TABICONS[2][i]=ip.hdr_sent;
    156            }
    157            for(i=0;i<4;i++)
    158            {
    159              TABICONS[3][i]=ip.hdr_draft;
    160            }
    161            for(i=0;i<4;i++)
    162            {
    163              TABICONS[4][i]=ip.hdr_filter;
    164            }
    165            
    166            //mainmenu.cpp
    167            extern int MM_ITEM_ICONS[];
    168            MM_ITEM_ICONS[0]=ip.mm_crtsms;
    169            MM_ITEM_ICONS[1]=ip.mm_smsnew; //new in sms
    170            MM_ITEM_ICONS[2]=ip.mm_inbox;
    171            MM_ITEM_ICONS[3]=ip.mm_sent;
    172            MM_ITEM_ICONS[4]=ip.mm_draft;
    173            MM_ITEM_ICONS[5]=ip.mm_others;
    174            
    175            //SmsListMenu.cpp
    176            extern int SLM_ICONS[];
    177            SLM_ICONS[0]=ip.sms_inread;
    178            SLM_ICONS[1]=ip.sms_sent;
    179            SLM_ICONS[2]=ip.sms_inread;
    180            SLM_ICONS[3]=ip.sms_innew;
    181            SLM_ICONS[4]=ip.sms_draft;
    182            SLM_ICONS[5]=ip.sms_inread;
    183          }
    184          
    185          IconPack::IconPack()
    186          {
    187            LoadDefaultIP();
    188            LoadIconPack();
    189          }
    190          
    191          IconPack::~IconPack()
    192          {
    193            FreeIconPack();
    194          }
    195          
    196          IconPack *IP=NULL;
    197          
    198          
    199          
    200          

   Maximum stack usage in bytes:

     Function                       CSTACK
     --------                       ------
     IconPack::FreeIconPack()          16
     IconPack::IconPack()               8
     IconPack::InitIconPack()           0
     IconPack::LoadDefaultIP()          4
     IconPack::LoadIconPack()         276
     IconPack::ZeroIconPack()           4
     IconPack::delete ~IconPack(IconPack *)
                                        8
     IconPack::new IconPack()           8
     IconPack::~IconPack()              4


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     IconNames                       120
     DefaultIcons                    124
     IconPack::LoadIconPack()        224
     IconPack::FreeIconPack()         60
     IconPack::LoadDefaultIP()        28
     IconPack::ZeroIconPack()         20
     IconPack::InitIconPack()        260
     IconPack::IconPack()             28
     IconPack::~IconPack()             4
     IP                                4
     ?<Initializer for IconNames>    120
     ?<Constant "ems_draft.png">      16
     ?<Constant "icon_mysmsys.png">   20
     ?<Constant "">                    1
     ?<Constant "mm_crtsms.png">      16
     ?<Constant "mm_smsnew.png">      16
     ?<Constant "mm_inbox.png">       16
     ?<Constant "mm_sent.png">        12
     ?<Constant "mm_draft.png">       16
     ?<Constant "mm_allsms.png">      16
     ?<Constant "mm_others.png">      16
     ?<Constant "sms_innew.png">      16
     ?<Constant "sms_inread.png">     16
     ?<Constant "sms_sent.png">       16
     ?<Constant "sms_draft.png">      16
     ?<Constant "ems_innew.png">      16
     ?<Constant "ems_inread.png">     16
     ?<Constant "ems_sent.png">       16
     ?<Constant "Img\\">               8
     ?<Constant "hdr_mmenu.png">      16
     ?<Constant "hdr_smsnew.png">     16
     ?<Constant "hdr_inbox.png">      16
     ?<Constant "hdr_sent.png">       16
     ?<Constant "hdr_draft.png">      16
     ?<Constant "hdr_allsms.png">     16
     ?<Constant "hdr_filter.png">     16
     ?<Constant "hdr_ed_view.png">    16
     ?<Constant "hdr_ed_edit.png">    16
     ?<Constant "hdr_ed_adrbk.png">   20
     ?<Constant "pp_incoming.png">    16
     ?<Constant "pp_showmsg.png">     16
     ?<Constant "dis_smsnew.png">     16
     IconPack::new IconPack()         40
     IconPack::delete ~IconPack(IconPack *)
                                      28
      Others                         132

 
 800 bytes in segment CODE
 601 bytes in segment DATA_C
 120 bytes in segment DATA_I
 120 bytes in segment DATA_ID
   4 bytes in segment DATA_Z
  24 bytes in segment INITTAB
 
 692 bytes of CODE  memory (+ 132 bytes shared)
 721 bytes of CONST memory
 124 bytes of DATA  memory

Errors: none
Warnings: none
