PopulateRes.c 170 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
 *
 * Filename:
 * ---------
 *  PopulateRes.c
 *
 * Project:
 * --------
 *  MAUI
 *
 * Description:
 * ------------
 *  Populate Resource Engine
 *
 * Author:
 * -------
 * -------
 *                      
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

#define _POPULATE_RES_C

 /****************************************************************************
* Include Files                                                                
*****************************************************************************/
#include "MMI_features.h"
#include "GlobalMenuItems.h"
#include "ResCompressConfig.h"
#include "custdatares.h"
#include "CustDataProts.h"
#include "custmenures.h"
#include "FontDCL.h"

#if defined(__FOTA_ENABLE__) || defined(__CARD_DOWNLOAD__) || defined(__ZIMAGE_SUPPORT__) || defined(__FAST_LOGO__)
#include "lcd_sw_rnd.h"
#include "ABMLoader.h"
#include "gui_resource_type.h"
#endif /* defined(__FOTA_ENABLE__) || defined(__CARD_DOWNLOAD__) || defined(__ZIMAGE_SUPPORT__) || defined(__FAST_LOGO__) */

    #include "MMIDataType.h"
    #include "mmi_res_range_def.h"
    #include "GlobalResDef.h"
    
#ifdef DEVELOPER_BUILD_FIRST_PASS
/***************************************************************************** 
*
* FIRST_PASS is for Resgen on PC
*
*****************************************************************************/
#include "CustResDef.h"
#include "SettingDefs.h"
#include "WriteResUtil.h"
#include "LegacyResPopService.h"
#include "ResgenLogCAPI.h"
#include "ExternalCMDManagerCAPI.h"
#ifdef __CAT_SUPPORT__
    #include "ResgenCatUtilCAPI.h"
#endif //__CAT_SUPPORT__

/***************************************************************************** 
* Define
*****************************************************************************/
#define  OUTPUT_IMAGE_ID_FILENAME      CUST_IMG_PATH_ROOT"\\\\images_file_list.ini"
/* 101205 audio resource Calvin Satrt */
#define  OUTPUT_AUDIO_ID_FILENAME      CUST_ADO_PATH"\\\\audio_file_list.ini"
/* 101205 audio resource Calvin End */
#define  OUTPUT_BINARY_ID_FILENAME      CUST_BINARY_PATH"\\\\binary_file_list.ini"
#define  OUTPUT_MENUTREE_ID_FILENAME   "..\\..\\Customer\\CustResource\\CustMenuTreeID_Out.c"

#define OUTPUT_DATA_FILENAME        "..\\..\\Customer\\CustResource\\CustImgDataHW.h"
#define OUTPUT_DATA_FILENAME_EXT    "..\\..\\Customer\\CustResource\\CustImgDataHWExt.h"
#define AUDIO_OUTPUT_DATA_FILENAME      "..\\..\\Customer\\CustResource\\CustAdoDataHW.h"
#define AUDIO_OUTPUT_DATA_FILENAME_EXT  "..\\..\\Customer\\CustResource\\CustAdoDataHWExt.h"
#define FONT_OUTPUT_DATA_FILENAME		"..\\..\\Customer\\CustResource\\CustFontDataHW.h"


#define RESPOP_TAG "POPULATERES"

#define RESPOP_LOG_D(format, args...) RES_LOG_D((RESPOP_TAG), (format) , ##args)
#define RESPOP_LOG_V(format, args...) RES_LOG_V((RESPOP_TAG), (format) , ##args)
#define RESPOP_LOG_W(format, args...) RES_LOG_W((RESPOP_TAG), (format) , ##args)
#define RESPOP_LOG_E(format, args...) RES_LOG_E((RESPOP_TAG), (format) , ##args)

#ifdef __MMI_RESOURCE_ENFB_SUPPORT__
#define ENFB_IMAGE_DATA_FILENAME    "..\\..\\Customer\\CustResource\\CustENFBImgData"  //100206 ENFB support
#endif

#ifdef __MMI_FONT_THIRD_ROM_SUPPORT__
#define ENFB_FONT_DATA_FILENAME    "..\\..\\Customer\\CustResource\\CustENFBFontData"
#endif
/***************************************************************************** 
* Local Variable
*****************************************************************************/
/* for generate String list file in first pass */
FILE *StringListFile = NULL;
FILE *OutputImgIDFile = NULL;

/* 101205 audio resource Calvin Satrt */
FILE *OutputAdoIDFile = NULL;

FILE *OutputBinaryIDFile = NULL;

/* 101205 audio resource Calvin End */
FILE *OutputMenutreeIDFile = NULL;
FILE *RepeatIDListFile = NULL;  /* 102604 Calvin added */
U16 gCurrLangIndex;

#if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE)
FILE *fpMenuResourceUsage = NULL;
FILE *fpImageResourceUsage = NULL;
FILE *fpImageResourceUsageExt = NULL;
FILE *fpAudioResourceUsage = NULL;
FILE *fpStringResourceUsage = NULL;

FILE *font_data_file = NULL;
FILE *font_data_lis = NULL;
FILE *font_data_modis_lis = NULL;
FILE *font_ttf_lis = NULL;

#define MYFOPEN(fp, filename, type) \
do                                  \
{                                   \
    fp = fopen(filename, type);     \
    if (fp == NULL)                 \
    {                               \
        fprintf(stderr, "%s cannot open\n", filename);  \
    }                               \
} while (0)

#define MYFCLOSE(fp, filename)  \
    do                          \
    {                           \
        if (fp != NULL)         \
        {                       \
            fprintf(stderr, "output %s done.\n", filename); \
            fclose(fp);         \
        }                       \
    } while (0)

#define PRTRESTITLE(fp)     \
    do                      \
    {                       \
        if (fp != NULL)     \
        {                   \
            fprintf(fp, "APP_name\tRes_base\tID\tID_name\tsize\tdata\tres_filename\n"); \
        }                   \
    } while (0)
#endif /* #if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE) */

U16 CurrMaxStringNum;
U32 CurrTotalStrLen;
U16 CurrMaxStringId = 0;
U16 CurrMaxStringIdSearch;


U8 mmi_res_zip_language[MAX_LANGUAGES+1];

/***************************************************************************** 
* Local Function
*****************************************************************************/
void PopulateGlobalData(void);
#ifdef __FOTA_ENABLE__
static void PopulateFOTAData(void);
#endif /* __FOTA_ENABLE__ */
#ifdef  __MMI_WEBCAM__
static void PopulateWebcamData(void);
#endif /*  __MMI_WEBCAM__ */

static void PopulateBootupLogoData(void);

static void PopulateBinary3DData();

#ifdef __RESGEN_INTERNAL_3D_META_RESGEN_AUTO__
static void PopulateImage3DData();
#endif //__RESGEN_INTERNAL_3D_META_RESGEN_AUTO__



/****************************************************************************
* Global Variable - Extern                                                                 
*****************************************************************************/
extern U16 CurrMaxImageId;
extern U16 CurrMaxImageNum;
extern U16 CurrMaxImageIdEXT;   /* 040805 CustPack: Calvin added */
extern U16 CurrMaxImageNumEXT;  /* 040805 CustPack: Calvin added */

extern U16 CurrMaxFontIdEXT;   /* LangPack */
extern U16 CurrMaxFontNumEXT;  /* LangPack */

/* 101205 audio resource Calvin Satrt */
extern U16 CurrMaxAudioId;
extern U16 CurrMaxAudioNum;
extern U16 CurrMaxAudioIdEXT;
extern U16 CurrMaxAudioNumEXT;

/* 101205 audio resource Calvin End */

extern U16 CurrMaxMenuItemIndex;    /* Max menu IDs */
extern U16 CurrMaxStringId;
#ifndef __POPULATE_ENGINE_
extern HWND hWnd;
#endif

/* 101806 E-NFB start */
#ifdef __MMI_RESOURCE_ENFB_SUPPORT__
extern U16 CurrMaxENFBAssociatedIDNum;
#endif
/* 101806 E-NFB end */

extern CUSTOM_IMAGE_MAP ImageIdMap[];
extern CUSTOM_IMAGE_MAP ImageIdMapEXT[];
extern CUSTOM_AUDIO_MAP AudioIdMap[];
extern CUSTOM_AUDIO_MAP AudioIdMapEXT[];
extern CUSTOM_FONT_MAP FontIdMap[];
extern CUSTOM_FONT_MAP FontIdMapEXT[];
extern CUSTOM_MENU nCustMenus[];

/* Menuitem reduce memory, move registe hilite handlers to resgen */
extern RESGEN_MENU_HILITE_HANDLER   nMenuHiliteHandlers[];
extern RESGEN_MENU_HINT_HANDLER     nMenuHintHandlers[];

const CUSTOM_STRING *gpStringRes;
const CUSTOM_STRING_MAP *gpStringMapRes;
const CUSTOM_STRMAP_SEARCH *gpStrMapSearch;
extern StringResList *gStringList;

/* __CUSTPACK_MULTIBIN Calvin BEGIN */
extern int toolFlag;    /* 040805 CustPack: Calvin added */

/* __CUSTPACK_MULTIBIN Calvin END */

#ifdef __MMI_RESOURCE_ENFB_SUPPORT__
extern FILE *enfb_img_data_file;//100206 ENFB support
#endif

#ifdef __MMI_FONT_THIRD_ROM_SUPPORT__
extern FILE *enfb_font_data_file;
#endif

/****************************************************************************
* Global Function - Extern                                                                 
*****************************************************************************/

/* Populate without compile option */
extern void PopulateNFBProgressImg(void);
//extern void PopulateMainMenuRes(void);
extern void PopulateIdleMenuRes(void);
extern void PopulatePbResData(void);
extern void PopulateCmResData(void);
extern void populateSettingMenu(void);
extern void populateFunAndGamesMenu(void);
extern void PopulateJavaRes(void);
extern void PopulateResData(void);
extern void PopulateSimDetectionMenuRes(void);
extern void PopulateSSCRes(void);

extern void PopulateOrganizerRes(void);
//#ifdef __MMI_INDICAL__
//extern void PopulateIndianCalendarRes(void);
//#endif
//#ifdef __MMI_HIJRI_CALENDAR__
//extern void PopulateHijriCalendarRes(void);
//#endif
//#ifdef __MMI_AZAAN_ALARM__
//extern void PopulateAzaanAlarmRes(void);
//#endif
extern void PopulateExtraRes(void);
extern void PopulateSATRes(void);
extern void PopulateResourcesCal(void);
extern void PopulateScreenSaverRes(void);
extern void PopulateCommonScreensResData(void);
extern void PopulateWapRes(void);
extern void PopulateMmiapiRes(void);

/* Populate with compile option */

#if 0
#if defined(__MMI_FACTORY_MODE__)
/* under construction !*/
#endif 
#endif 


#if defined(__MMI_AB_REPEATER__)
extern void populateABRepeaterMenu(void);
#endif 

#if defined(__MMI_FILE_MANAGER__) && defined(__PLUTO_MMI_PACKAGE__)
extern void PopulateFileMgrServiceResource(void);
#endif 

#if defined(__MMI_MY_FAVORITE__old)
extern void PopulateMyFavoriteRes(void);
#endif 

#if defined(__MMI_BARCODEREADER__)
extern void PopulateBarcodeReaderRes(void);
#endif 

#if defined(__MMI_BCR__)
extern void PopulateBCRRes(void);
#endif 

//#if defined(__MMI_A2DP_SUPPORT__)
//extern void PopulateAVBTRes(void);
//#endif

#if defined(__MMI_AVATAR__)
extern void PopulateAvatarRes(void);
#endif

#if defined(__MMI_VIDEO_PLAYER__)
extern void PopulateVdoPlyRes(void);
#endif 
#if defined(__MMI_STREAMING__)
//extern void PopulateStreamingRes(void);
#endif 

#if defined(__MMI_CAMCORDER__)
//extern void PopulateCamcorderRes(void);
#endif

#if defined(__MMI_VIDEO_EDITOR__)
extern void PopulateVdoEdtRes(void);
#endif

//#if defined(__MMI_FM_RADIO__)
//extern void PopulateFMRadioRes(void);
//#endif 

//#if defined(__MMI_FM_RADIO_SCHEDULE_REC__)
//extern void PopulateFMScheduleRecRes(void);
//#endif 

//#if defined(__MMI_PROV_MESSAGE_SUPPORT__)
//extern void PopulateProvBoxUIRes(void);
//#endif




#if defined(__MMI_SLIDESHOW__)
extern void PopulateSlideShowRes(void);
#endif





#ifdef __MMI_IRDA_SUPPORT__
extern void PopulateExtDevIrDARes(void);
#endif 


//#ifdef __MMI_RMGR__
//extern void PopulateRightsMgrRes(void);
//#endif

//#ifdef __DRM_SUPPORT__
//extern void PopulateDRMRes(void);
//#endif

#ifdef __MMI_VOIP__
extern void VoIPResourceData(void);
#endif /* __MMI_VOIP__ */

extern void srv_ucm_resource_data(void);



#if defined(__FOTA_ENABLE__)
extern void PopulateDMMenuList(void);
#endif 


#if defined(__MMI_MOBILE_SERVICE__)
/* under construction !*/
#endif

#if defined(__MMI_CUSTOMER_SERVICE__)
/* under construction !*/
#endif

#if defined(__MMI_MAPBAR_GIS__) || defined(__MMI_SUNAVI_GIS__) || defined(__MMI_MIGO_GIS__)
extern void PopulateGISRes(void);    
#endif 


#ifdef __CERTMAN_SUPPORT__
extern void PopulateCertManRes(void);
#endif /*__CERTMAN_SUPPORT__*/

#if defined(__MMI_EM_MISC_SOFTWARE_TRACER__)	
/* under construction !*/
#endif  

#if defined(__MMI_VECTOR_FONT_SUPPORT__)
extern void PopulateFontResource(void);
#endif

#if defined(__MMI_MEDIA_PLAYER__)
//extern void PopulateMediaPlayerRes(void);
#endif

#ifdef __PLST_SERVICE_DB_SUPPORT__
//extern void PopulateSrvPlstRes(void);
#endif
#ifdef __QQIM_SUPPORT__
extern void PopulateQQRes(void);    
#endif

#ifdef __QQMOVIE_SUPPORT__
extern void PopulateQQMovieRes(void);    
#endif

#if defined(__UCWEB6__)
extern void PopulateUCWEBRes(void);    
#endif 

#if defined(__A8BOX_SUPPORT__)
extern void PopulateA8BoxRes(void);    
#endif 

#if defined(__MMI_VUI_HOMESCREEN__)
extern void PopulateVFHSRes(void);
#endif 

#if defined(__MMI_VUI_ENGINE__)
extern void PopulateVCPRes(void);
#endif 

#if 0
/* under construction !*/
#endif 

#ifdef __MMI_VUI_3D_CUBE_APP__
extern void PopulateVFCubeAppRes(void);
#endif

#ifdef OPERA_BROWSER
extern void PopulateOperaRes(void);
#endif 

extern void PopulatePhoneSettingSpecialRes(void);

//////////////////////////////////////////////////////////////////////////////
// Res Population static global variables
//////////////////////////////////////////////////////////////////////////////
static FILE * java_img_data_file = NULL;
static FILE * nfb_img_data_file = NULL;


/*****************************************************************************
 * FUNCTION
 *  ToolPopulateInitial
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void ToolPopulateInitial(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    int i = 0, j;
    unsigned char a[4];
    char cmd[512];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    //ClearHWIMageFile();
#ifndef __POPULATE_ENGINE_
    SendMessage(hWnd, WM_CLEARFILES, (WPARAM) 0, (LPARAM) 0);
#endif 
    /* 101806 E-NFB start */
#ifdef __MMI_RESOURCE_ENFB_SUPPORT__
    CurrMaxENFBAssociatedIDNum = 0;
#endif
    /* 101806 E-NFB end */

    CurrMaxImageId = 0;
    CurrMaxImageNum = 0;
    CurrMaxImageIdEXT = 0;  /* 040805 CustPack: Calvin added */
    CurrMaxImageNumEXT = 0;

    CurrMaxAudioId = 0;
    CurrMaxAudioNum = 0;
    CurrMaxAudioIdEXT = 0;
    CurrMaxAudioNumEXT = 0;

    CurrMaxFontIdEXT = 0;
    CurrMaxFontNumEXT = 0;    

    CurrMaxMenuItemIndex = MAX_MENU_ITEMS;

    /* to read from NVRAM if possible -vanita */
    gCurrLangIndex = 0;

    memset(nCustMenus, 0, sizeof(CUSTOM_MENU) * MAX_MENU_ITEMS);
    /* init nParentId with an impossible value */
    for (i = 0; i < MAX_MENU_ITEMS; i++)
    {
        nCustMenus[i].nParentId = MAX_MENU_ITEMS;            
    }

    for (i = 0; i < MAX_IMAGE_IDS_SIZE; i++)
    {
        ImageIdMap[i].nImageNum = -1;
        ImageIdMapEXT[i].nImageNum = -1;    /* 040805 CustPack: Calvin added */
    }

    for (i = 0; i < MAX_AUDIO_IDS_SIZE; i++)
    {
        AudioIdMap[i].nAudioNum = -1;
        AudioIdMapEXT[i].nAudioNum = -1;
    }


    for (i = 0; i < MAX_FONT_IDS_SIZE; i++)
    {
        FontIdMapEXT[i].nFontNum = -1;
    }    
}

/* 101205 audio resource Calvin End */


/*****************************************************************************
 * FUNCTION
 *  ToolPopulateDone
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void ToolPopulateDone(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /*  for generate string list file in first pass */
    fwprintf(StringListFile, L"##number\t%d\r\n", CurrMaxStringId);
    fclose(StringListFile);
    /* 091004 MTK Calvin added to reduce populate time */
    fclose(OutputImgIDFile);
    fclose(OutputMenutreeIDFile);
    fclose(RepeatIDListFile);   /* 102604 MTK Calvin added */
    /* MTK Calvin end */

#if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE)
    MYFCLOSE(fpMenuResourceUsage, MMI_RG_MENU_USAGE_FILE);
    MYFCLOSE(fpImageResourceUsage, MMI_RG_IMAGE_USAGE_FILE);
    MYFCLOSE(fpImageResourceUsageExt, MMI_RG_IMAGE_CONVERTED_INFO_FILE);
    MYFCLOSE(fpAudioResourceUsage, MMI_RG_AUDIO_USAGE_FILE);
    MYFCLOSE(fpStringResourceUsage, MMI_RG_STRING_USAGE_FILE);
#endif /* #if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE) */
}

/* __CUSTPACK_MULTIBIN Calvin End */

#define TYPE__(A) A##_MENU
#define TYPE_(A)  TYPE__(A)
#define TYPE(A) TYPE_(A)

/*****************************************************************************
 * FUNCTION
 *  ResPopSharedDefaultResourceInit
 * DESCRIPTION
 *  Populate Default Resource, this funciton must be invoked berfor 
 *  any resource population
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
 void ResPopSharedDefaultResourceInit(){
     /* add an empty image icon */
    ADD_APPLICATION_IMAGE(IMG_NONE, "..\\\\..\\\\Customer\\\\Images\\\\EmptyImage.bmp");

    /* 101205 audio resource Calvin Satrt */
    ADD_APPLICATION_AUDIO2(
        ADO_GLOBAL_EMPTYAUDIO,
        "..\\\\..\\\\Customer\\\\Audio\\\\EmptyAudio.mp3",
        "..\\\\..\\\\Customer\\\\Audio\\\\EmptyAudio.mp3");
    ADD_APPLICATION_AUDIO3(ADO_GLOBAL_EMPTYAUDIO_EXT, "..\\\\..\\\\Customer\\\\Audio\\\\EmptyAudio.mp3", "..\\\\..\\\\Customer\\\\Audio\\\\EmptyAudio.mp3");    /* for custpack */
    ADD_APPLICATION_AUDIO2(
        ADO_GLOBAL_NOAUDIO,
        "..\\\\..\\\\Customer\\\\Audio\\\\NoAudio.mp3",
        "..\\\\..\\\\Customer\\\\Audio\\\\NoAudio.mp3");
    ADD_APPLICATION_AUDIO2(
        ADO_GLOBAL_DEFAULT,
        "..\\\\..\\\\Customer\\\\Audio\\\\Default.mp3",
        "..\\\\..\\\\Customer\\\\Audio\\\\Default.mp3");
    /* 101205 audio resource Calvin End */

    ADD_APPLICATION_BINARY(
        BINARY_GLOBAL_NO_BINARY,
        "..\\\\..\\\\Customer\\\\Binary\\\\NoBinary.bin",
        BINARY_TYPE_VENUS_XML,
        "Empty binary data file");    
}

/*****************************************************************************
 * FUNCTION
 *  LegcayResPopController
 * DESCRIPTION
 *  Populate Resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/

void LegcayResPopController(){
	ResPopInitAll();
    
	PopulateResDataPreXML();
    PopulateResDataXML();
    PopulateResDataPostXML();
    
	ResPopDeinitAll();
}

/*****************************************************************************
 * FUNCTION
 *  PopulateResData
 * DESCRIPTION
 *  Populate Resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void PopulateResData(void)
{

   /*****************************************************************************
   * Populate Resoruce
   *****************************************************************************/
    PopulateNFBProgressImg();

    RESPOP_LOG_V("Populating Golbal Resources");
    PopulateGlobalData();
#ifdef __RESGEN_INTERNAL_3D_META_RESGEN_AUTO__
	PopulateImage3DData();
#endif //__RESGEN_INTERNAL_3D_META_RESGEN_AUTO__

    PopulateBinary3DData();

//    RESPOP_LOG_V("Populating Main Menu Resources");
//    PopulateMainMenuRes();

    RESPOP_LOG_V("Populating Idle Menu Resources");
    PopulateIdleMenuRes();

    RESPOP_LOG_V("Populating Phone Book Resources");
    PopulatePbResData();

#ifdef __PLUTO_MMI_PACKAGE__
    RESPOP_LOG_V("Populating Setting Resources");
    populateSettingMenu();
#endif

    RESPOP_LOG_V("Populating Fun & Games Resources");
    populateFunAndGamesMenu();

    RESPOP_LOG_V("Populating SIM Detect Resources");
    PopulateSimDetectionMenuRes();

    fprintf(stderr, "Populate Resource 10%%\n");

    RESPOP_LOG_V("Populating Common Screen Resources");
    PopulateCommonScreensResData();

    RESPOP_LOG_V("Populating CM Resources");
    PopulateCmResData();

    RESPOP_LOG_V("Populating SSC Resources");
    PopulateSSCRes();

#if 0 /* Moved to XML based resources */
/* under construction !*/
/* under construction !*/
#endif

    RESPOP_LOG_V("Populating Organizer Resources");
    PopulateOrganizerRes();

//#ifdef __MMI_HIJRI_CALENDAR__
//    RESPOP_LOG_V("Populating hijri calendar resources");
//    PopulateHijriCalendarRes();
//#endif

//#ifdef __MMI_AZAAN_ALARM__
//    RESPOP_LOG_V("Populating hijri calendar resources");
//    PopulateAzaanAlarmRes();
//#endif /* __MMI_AZAAN_ALARM__ */

//#ifdef __MMI_INDICAL__
//	RESPOP_LOG_V("Populating Indian Calendar Resources");
//    PopulateIndianCalendarRes();
//#endif
		

    RESPOP_LOG_V("Populating Calendar Resources");
    PopulateResourcesCal();

    fprintf(stderr, "Populate Resource 20%%\n");


#if defined(__MMI_EM_MISC_SOFTWARE_TRACER__)
/* under construction !*/
/* under construction !*/
#endif


#ifdef __CERTMAN_SUPPORT__
//	RESPOP_LOG_V("Populating CertificateManager");
//	PopulateCertManRes();
#endif /*__CERTMAN_SUPPORT__*/

#if 0   /* Cylen 0926, customize display char */
/* under construction !*/
/* under construction !*/
#endif /* 0 */ 
    RESPOP_LOG_V("Populating MMIAPI Resource");
    PopulateMmiapiRes();

//#ifdef __MMI_PROV_MESSAGE_SUPPORT__
   // PopulateProvBoxUIRes();
//#endif

#ifdef __MMI_EMAIL__
    RESPOP_LOG_V("Populating Email Resources");
    //EmailResourceData();
#endif /* __MMI_EMAIL__ */ 

#if defined(__SAT__) && defined(__PLUTO_MMI_PACKAGE__)
    RESPOP_LOG_V("Populating SAT Resources");
    PopulateSATRes();
#endif /* __SAT__ */ 

    fprintf(stderr, "Populate Resource 30%%\n");

#if 0
#ifdef __MMI_FACTORY_MODE__
/* under construction !*/
/* under construction !*/
#endif
#endif /* __MMI_FACTORY_MODE__ */ 


#ifdef __MMI_AB_REPEATER__
    RESPOP_LOG_V("Populating AB Repeater Resources");
    populateABRepeaterMenu();
#endif /* __MMI_AB_REPEATER__ */ 

#if defined(__MMI_FILE_MANAGER__) && defined(__PLUTO_MMI_PACKAGE__)
    RESPOP_LOG_V("Populating File Manager Resources");
    PopulateFileMgrServiceResource();
#endif /* __MMI_FILE_MANAGER__ */ 

    fprintf(stderr, "Populate Resource 40%%\n");

#ifdef __MMI_VIDEO_PLAYER__
    //RESPOP_LOG_V("Populating Video Player Resources");
    //PopulateVdoPlyRes();
#endif /* __MMI_VIDEO_PLAYER__ */ 

#if defined(__MMI_STREAMING__)
    //RESPOP_LOG_V("Populating Streaming Setting Resources");
    //PopulateStreamingRes();
#endif /* __MMI_STREAMING__ */ 

#ifdef __MMI_VIDEO_EDITOR__
    RESPOP_LOG_V("Populating Video Editor Resources");
    PopulateVdoEdtRes();
#endif

#if defined(__MMI_MEDIA_PLAYER__)
    //RESPOP_LOG_V("Populating Media player Resources");
    //PopulateMediaPlayerRes();
#endif

#if defined(__PLST_SERVICE_DB_SUPPORT__)
   // RESPOP_LOG_V("Populating Play list service Resources");
   // PopulateSrvPlstRes();
#endif

#ifdef __MMI_PICTURE_EDITOR_SUPPORT__
    RESPOP_LOG_V("End Populating Image Editor");
    PopulatePictureEditor();
#endif /* __MMI_PICTURE_EDITOR_SUPPORT__ */ 


    fprintf(stderr, "Populate Resource 50%%\n");

#ifdef __MMI_BARCODEREADER__
    RESPOP_LOG_V("Populating Barcode Reader Resource");
    PopulateBarcodeReaderRes();
#endif /* __MMI_BARCODEREADER__ */ 

#ifdef __MMI_BCR__
    RESPOP_LOG_V("Populating bcr Resource");
    //PopulateBCRRes();
#endif /* __MMI_BCR__ */ 

#if defined(__MMI_CAMCORDER__)
//    RESPOP_LOG_V("Populating Camcorder Resource");
//    PopulateCamcorderRes();
#endif

#ifdef __MMI_AVATAR__
    RESPOP_LOG_V("Populating Avatar Resource");
    PopulateAvatarRes();
#endif /* __MMI_AVATAR__ */

//#ifdef __MMI_A2DP_SUPPORT__
//    RESPOP_LOG_V("Populating AVBT Resource");
//    PopulateAVBTRes();
//#endif /*__MMI_A2DP_SUPPORT__*/

//#ifdef __MMI_FM_RADIO__
//    RESPOP_LOG_V("Populating FM Radio Resource");
//    PopulateFMRadioRes();
//#endif /* __MMI_FM_RADIO__ */ 

//#ifdef __MMI_FM_RADIO_SCHEDULE_REC__
//    RESPOP_LOG_V("Populating Schedule FM Radio Record Resource");
//    PopulateFMScheduleRecRes();
//#endif /* __MMI_FM_RADIO_SCHEDULE_REC__ */ 


#if defined(__MMI_SLIDESHOW__)
    RESPOP_LOG_V("Populating Slideshow Resource");
    //PopulateSlideShowRes();
#endif


#ifdef __MMI_IRDA_SUPPORT__
    RESPOP_LOG_V("Populating IRDA Resource");
    PopulateExtDevIrDARes();
#endif /* __MMI_IRDA_SUPPORT__ */ 



#if defined(WAP_SUPPORT) || defined(__MMI_MMS__)
    RESPOP_LOG_V("Populating WAP Resource");
    PopulateWapRes();
#endif /* defined(WAP_SUPPORT) || defined(__MMI_MMS__) */ 

#ifdef __MMI_VOIP__
    RESPOP_LOG_V("Populating VoIP Resources");
    VoIPResourceData();
#endif /* __MMI_VOIP__ */

    fprintf(stderr, "Populate Resource 60%%\n");
    RESPOP_LOG_V("Populating UCM Service Resources");
    srv_ucm_resource_data();


#ifndef __POPULATE_ENGINE_
    SendMessage(hWnd, WM_GENSTRFILE, (WPARAM) 0, (LPARAM) 0);
    RESPOP_LOG_V("after 1 sendmsg");

    SendMessage(hWnd, WM_GENIMGFILE, (WPARAM) 0, (LPARAM) 0);
    RESPOP_LOG_V("after 2 send msg ");

    SendMessage(hWnd, WM_GENMENUFILE, (WPARAM) 0, (LPARAM) 0);
    RESPOP_LOG_V("after 3 send msg ");
#endif /* __POPULATE_ENGINE_ */ 

#ifdef __MMI_SWFLASH__
	RESPOP_LOG_V("Populating SWFlash Resource");	
	PopulateSWFlashRes();
#endif /* __MMI_SWFLASH__ */


    //WRITE_STRING_RES_FILE;    /* Write the string resource file only for first pass */
    //WRITE_IMAGE_RES_FILE;     /* Write the image resource file only for first pass */
    //WRITE_MENU_RES_FILE;

#ifdef __FOTA_ENABLE__
    RESPOP_LOG_V("Populating FOTA Resource");	
    PopulateFOTAData();
#endif /* __FOTA_ENABLE__ */

#ifdef __CARD_DOWNLOAD__
    RESPOP_LOG_V("Populating BL Resource");	
    PopulateBLData();
#endif /* __CARD_DOWNLOAD__ */

#ifdef __MMI_WEBCAM__
    RESPOP_LOG_V("Populating Webcam Resource");	
    PopulateWebcamData();
#endif /* __MMI_WEBCAM__ */

#if defined(__ZIMAGE_SUPPORT__)
    RESPOP_LOG_V("Populating Bootup Logo Resource");	
    PopulateBootupLogoData();
#endif /* defined(__ZIMAGE_SUPPORT__) */

#if defined(__FAST_LOGO__)
    RESPOP_LOG_V("Populating Fast Logo Resource");	
    PopulateFastLogoData();
#endif /* defined(__FAST_LOGO__) */

//#ifdef __MMI_RMGR__
//    RESPOP_LOG_V("Populating Rights Manager Resources");
//    PopulateRightsMgrRes();
//#endif

//#ifdef __DRM_SUPPORT__
//    RESPOP_LOG_V("Populating DRM Task Resources");
//    PopulateDRMRes();
//#endif


#ifdef __MMI_MOBILE_SERVICE__
/* under construction !*/
/* under construction !*/
#endif/*__MMI_MOBILE_SERVICE__*/

#if defined(__MMI_CUSTOMER_SERVICE__)
/* under construction !*/
/* under construction !*/
#endif/*__MMI_CUSTOMER_SERVICE__*/

#ifdef __MMI_MY_FAVORITE__old
    RESPOP_LOG_V("Populating My Favorite Resources");
    PopulateMyFavoriteRes();
#endif /* __MMI_MY_FAVORITE__old */ 


    fprintf(stderr, "Populate Resource 80%%\n");


#if defined(__MMI_MAPBAR_GIS__) || defined(__MMI_SUNAVI_GIS__) || defined(__MMI_MIGO_GIS__)
    RESPOP_LOG_V("Populating GIS Resource");
    PopulateGISRes();
#endif 

#if defined(__MMI_VECTOR_FONT_SUPPORT__)
    RESPOP_LOG_V("Populating Vector Font Resource");
    PopulateFontResource();
#endif

#ifdef __QQIM_SUPPORT__
    RESPOP_LOG_V(("Populating QQIM Resource"));
    PopulateQQRes();
#endif

#ifdef __QQMOVIE_SUPPORT__
    RESPOP_LOG_V(("Populating QQMovie Resource"));
    PopulateQQMovieRes();
#endif

#if defined(__UCWEB6__)
    RESPOP_LOG_V("Populating UCWEB Resource");
    PopulateUCWEBRes();
#endif 

#ifdef __A8BOX_SUPPORT__
    RESPOP_LOG_V(("Populating A8BOX Resource"));
    PopulateA8boxRes();
#endif

    fprintf(stderr, "Populate Resource 90%%\n");

#ifdef __MMI_VUI_HOMESCREEN__
    RESPOP_LOG_V(("Populating VF home screen Resource"));
    PopulateVFHSRes();
#endif

#ifdef __MMI_VUI_3D_CUBE_APP__
    RESPOP_LOG_V(("Populating Venus Tst APP Resource"));
    PopulateVFCubeAppRes();
#endif

#ifdef __MMI_VUI_ENGINE__
    PopulateVCPRes();
#endif

#if 0
/* under construction !*/
/* under construction !*/
#endif

// The Res which is populated after mmi_rp_populate_resources() execution
// must be moved into PopulateResDataPostXML()
}

/*****************************************************************************
 * FUNCTION
 *  PopulateResDataPreXML
 * DESCRIPTION
 *  Control interface of legacy resource population. The resoruce population put in this file
 *  will be populated before XML resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void PopulateResDataPreXML(){
    PopulateResData();
}

/*****************************************************************************
 * FUNCTION
 *  PopulateResDataPostXML
 * DESCRIPTION
 *  Control interface of legacy resource population. The resoruce population put in this file
 *  will be populated after XML resource.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void PopulateResDataPostXML(){
    
    PopulatePhoneSettingSpecialRes();

#ifdef OPERA_BROWSER
    RESPOP_LOG_V("Populating Opera Resources");
	PopulateOperaRes();
#endif

#ifdef __MMI_DSM_NEW__
	PopulateMythroadRes();
#if defined(__HC_CALL_NEW__)
	PopulateHcCallRes();
#endif
#endif
}

/*****************************************************************************
 * FUNCTION
 *  PopulateResDataXML
 * DESCRIPTION
 *  Control interface of legacy resource population. To populae legacy reource in XML RES files
 *  such as menu and hint handler.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void PopulateResDataXML(){
    // Populate the XML resources at last to group legacy and offline resource population
    mmi_rp_populate_resources();
}

#ifdef __FOTA_ENABLE__
/*****************************************************************************
 * FUNCTION
 *  PopulateFOTAImage
 * DESCRIPTION
 *  Populate FOTA image
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void PopulateFOTAImage(char* filename_in, char* output_array)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/    
    FILE *fp;
    unsigned char *buffer;
    char filename_out[] = "..\\..\\Customer\\CustResource\\CustFOTAImgData.h";
    static int test = 0;
    int size, width, height, ret, i;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    do
    {
        /* open image test */
        fp = fopen(filename_in, "rb");
        if (fp == NULL)
        {
            fprintf(stderr, "[FOTA] %s Input file failed !!\n", filename_in);
            break;
        }
        fclose(fp);
        fp == NULL;
        
        /* decode image */
        buffer = (U8*)malloc(ABMENC_BMP_FILE_BUFFER_SIZE*sizeof(char));
        if (buffer == NULL)
        {
            fprintf(stderr, "[FOTA] allocate memory failed !!\n");
            break;
        }
        memset(buffer, 0, ABMENC_BMP_FILE_BUFFER_SIZE*sizeof(char));
        ret = ABM_load(
                filename_in,
                DRV_MAINLCD_BIT_PER_PIXEL,
                IMAGE_TYPE_DEVICE_BITMAP,
                ABM_ENC_OPTION_FLAG_AB2,
                buffer,
                &size, &width, &height, MMI_FALSE, NULL);
        if (ret != ABM_ENC_RETURN_USE_AB2)
        {
            fprintf(stderr, "[FOTA] %s ABM_Load failed !!\n", filename_in);
            break;
        }
        
        /* output image */
        if (test == 0)
        {
            fp = fopen(filename_out, "w+");
            test = 1;
        }
        else
        {
            fp = fopen(filename_out, "a");
        }
        if (fp == NULL)
        {
            fprintf(stderr, "[FOTA] %s Output file failed !!\n", filename_out);
            break;
        }
        fprintf(fp, "%s", output_array);
        fprintf(fp, "\n{");
        for (i = 0; i < size; i++)
        {
            if ((i % 16) == 0)
            {
                fprintf(fp, "\n\t");
            }
            fprintf(fp, "0x%02X, ", buffer[i]);
        }
        fprintf(fp, "\n};");
        fputs("\n", fp);
        fclose(fp);
        fp = NULL;
        
        free(buffer);
        buffer = NULL;
    } while (0);
    
    if (buffer != NULL) free(buffer);
    if (fp != NULL)     fclose(fp);
}


/*****************************************************************************
 * FUNCTION
 *  PopulateFOTAData
 * DESCRIPTION
 *  Populate FOTA data resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void PopulateFOTAData(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    #if defined(__COSMOS_MMI__)
    char filename_update_background[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_bg.pbm";
    char filename_update_fail[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_fail.pbm";
    #else
    char filename_update_background[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_bg.bmp";
    char filename_update_fail[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_fail.bmp";
    #endif
    char output_array_update_background[] = "__align(4) U8 FOTA_PBAR_IMG_DATA[] = ";
    char output_array_update_fail[] = "__align(4) U8 FOTA_FAIL_IMG_DATA[] = ";
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PopulateFOTAImage(filename_update_background, output_array_update_background);
    PopulateFOTAImage(filename_update_fail, output_array_update_fail);
}
#endif /* __FOTA_ENABLE__ */


#ifdef __CARD_DOWNLOAD__
/*****************************************************************************
 * FUNCTION
 *  PopulateFOTAImage
 * DESCRIPTION
 *  Populate FOTA image
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void PopulateBLImage(char* filename_in, char* output_array)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/    
    FILE *fp;
    unsigned char *buffer;
    char filename_out[] = "..\\..\\Customer\\CustResource\\CustBLImgData.h";
    static int test = 0;
    int size, width, height, ret, i;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    do
    {
        /* open image test */
        fp = fopen(filename_in, "rb");
        if (fp == NULL)
        {
            fprintf(stderr, "[BL] %s Input file failed !!\n", filename_in);
            break;
        }
        fclose(fp);
        fp == NULL;
        
        /* decode image */
        buffer = (U8*)malloc(ABMENC_BMP_FILE_BUFFER_SIZE*sizeof(char));
        if (buffer == NULL)
        {
            fprintf(stderr, "[BL] allocate memory failed !!\n");
            break;
        }
        memset(buffer, 0, ABMENC_BMP_FILE_BUFFER_SIZE*sizeof(char));
        ret = ABM_load(
                filename_in,
                DRV_MAINLCD_BIT_PER_PIXEL,
                IMAGE_TYPE_DEVICE_BITMAP,
                ABM_ENC_OPTION_FLAG_AB2,
                buffer,
                &size, &width, &height, MMI_FALSE, NULL);
        if (ret != ABM_ENC_RETURN_USE_AB2)
        {
            fprintf(stderr, "[BL] %s ABM_Load failed !!\n", filename_in);
            break;
        }
        
        /* output image */
        if (test == 0)
        {
            fp = fopen(filename_out, "w+");
            test = 1;
        }
        else
        {
            fp = fopen(filename_out, "a");
        }
        if (fp == NULL)
        {
            fprintf(stderr, "[BL] %s Output file failed !!\n", filename_out);
            break;
        }
        fprintf(fp, "%s", output_array);
        fprintf(fp, "\n{");
        for (i = 0; i < size; i++)
        {
            if ((i % 16) == 0)
            {
                fprintf(fp, "\n\t");
            }
            fprintf(fp, "0x%02X, ", buffer[i]);
        }
        fprintf(fp, "\n};");
        fputs("\n", fp);
        fclose(fp);
        fp = NULL;
        
        free(buffer);
        buffer = NULL;
    } while (0);
    
    if (buffer != NULL) free(buffer);
    if (fp != NULL)     fclose(fp);
}


/*****************************************************************************
 * FUNCTION
 *  PopulateBLData
 * DESCRIPTION
 *  Populate boot loader data resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void PopulateBLData(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    #if defined(__COSMOS_MMI__)
    char filename_update_background[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_bg.pbm";
    char filename_update_fail[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_fail.pbm";
    #else
    char filename_update_background[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_bg.bmp";
    char filename_update_fail[] = CUST_IMG_PATH"\\MainLCD\\Submenu\\Services\\FOTA\\FW_update_fail.bmp";
    #endif
    char output_array_update_background[] = "__align(4) U8 BL_PBAR_IMG_DATA[] = ";
    char output_array_update_fail[] = "__align(4) U8 BL_FAIL_IMG_DATA[] = ";
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PopulateBLImage(filename_update_background, output_array_update_background);
    PopulateBLImage(filename_update_fail, output_array_update_fail);
}
#endif /* __LCD_DRIVER_IN_BL__ */



#if defined(__MMI_WEBCAM__)
/*****************************************************************************
 * FUNCTION
 *  PopulateFOTAData
 * DESCRIPTION
 *  Populate FOTA data resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void PopulateWebcamData(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    FILE *fp_in = NULL, *fp_out = NULL;
    char filename_in0[] = CUST_IMG_PATH"\\MainLCD\\Active\\webcam\\webcam_jpeg_0.jpg";
    char filename_in1[] = CUST_IMG_PATH"\\MainLCD\\Active\\webcam\\webcam_jpeg_1.jpg";
    char filename_in2[] = CUST_IMG_PATH"\\MainLCD\\Active\\webcam\\webcam_jpeg_2.jpg";
    char output_name0[] = "webcam_pause_img_0";
    char output_name1[] = "webcam_pause_img_1";
    char output_name2[] = "webcam_pause_img_2";
    char filename_out[] = "..\\..\\Customer\\CustResource\\CustWebcamImgData.h";
    char buff[256];
    int count, i;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    do
    {
        fp_out = fopen(filename_out, "w");
        if (fp_out == NULL)
        {
            RESPOP_LOG_V("[WEBCAM] Output file failed !!");
            break;
        }

        for (i = 0 ; i < 3 ; i++)
        {
            int j, file_size = 0, o = 0;
            char *filename = NULL, *output_name = NULL;

            switch (i)
            {
                case 0:
                    filename = filename_in0;
                    output_name = output_name0;
                    break;
                case 1:
                    filename = filename_in1;
                    output_name = output_name1;
                    break;
                case 2:
                    filename = filename_in2;
                    output_name = output_name2;
                    break;
                default:
                    break;        
            }

            fp_in = fopen(filename, "rb");
            if (fp_in == NULL)
            {
                RESPOP_LOG_V("[WEBCAM] Input image 1 failed,\t%s !!", filename);
                break;
            }
            fprintf(fp_out, "const U8 %s[] = \n", output_name);
            fprintf(fp_out, "{\n\t");
            fseek(fp_in, 0, SEEK_END);
            file_size = ftell(fp_in);
            fseek(fp_in, 0, SEEK_SET);
            for (j = 0; j < file_size; j++)
            {
                fprintf(fp_out, "0x%02X, ", fgetc(fp_in));
                o++;
                if ((o % 16) == 0)
                {
                    fprintf(fp_out, "\n\t");
                }
            }
            fprintf(fp_out, "\n};\n");
        }
    } while (0);

    if (fp_in != NULL)  fclose(fp_in);
    if (fp_out != NULL) fclose(fp_out);
}
#endif /* defined(__MMI_WEBCAM__) */


#if defined(__ZIMAGE_SUPPORT__)
/*****************************************************************************
 * FUNCTION
 *  PopulateBootupLogoData
 * DESCRIPTION
 *  Populate boot up logo data resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void PopulateBootupLogoData(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    FILE *fp = NULL, *fp_temp = NULL;
 #if defined(__TOPWELL_SHOW_CUSTOMER_LOGO__)   
 #if defined(TOPWELL_CUST_PWR_LOGO)
    char filename_in[] = CUST_IMG_PATH"\\MainLCD\\Active\\poweronoff\\"TOPWELL_CUST_PWR_LOGO;
 #endif
 #else
    char filename_in[] = CUST_IMG_PATH"\\MainLCD\\Active\\poweronoff\\logo.BMP";
 #endif
    char filename_temp[] = "TEMPIMAGE";
    char output_name[] = "bootup_logo_img";
#ifdef __ZIMAGE_LOGO_ANIMATED_SUPPORT__	
    char filename_in_ani[4][256] =
    {
        CUST_IMG_PATH"\\MainLCD\\Active\\poweronoff\\logo1.BMP",
        CUST_IMG_PATH"\\MainLCD\\Active\\poweronoff\\logo2.BMP",
        CUST_IMG_PATH"\\MainLCD\\Active\\poweronoff\\logo3.BMP",
        CUST_IMG_PATH"\\MainLCD\\Active\\poweronoff\\logo4.BMP"
    };
    char output_name_ani[4][32] = 
    {
        "bootup_logo_img_1",
        "bootup_logo_img_2",
        "bootup_logo_img_3",
        "bootup_logo_img_4"
    };
#endif
    char filename_out[] = "..\\..\\Customer\\CustResource\\CustBootupImgData.h";
    char buff[256];
    int ret, count, i;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    do
    {
        /* decode image */
        ret = BMPLoader(filename_in, filename_temp, DRV_MAINLCD_BIT_PER_PIXEL, "", MMI_FALSE, NULL);
        if (ret == 0)
        {
            fprintf(stderr, "[BOOTUP LOGO] %s BMPLoader failed !!\n", filename_in);
            break;
        }

        /* output data */
        fp = fopen(filename_out, "w");
        if (fp == NULL)
        {
            RESPOP_LOG_V("[BOOTUP LOGO] Output file failed !!");
            break;
        }

        fp_temp = fopen(filename_temp, "rb");
        if (fp_temp == NULL)
        {
            RESPOP_LOG_V("[BOOTUP LOGO] Read raw data file failed !!");
            break;
        }

        fprintf(fp, "#if !defined(__MTK_TARGET__)\n\t#define __align(x)\n#endif\n");
        fprintf(fp, "__align(4) const U8 %s[] = \n", output_name);
        while (!feof(fp_temp))
        {
            count = fread(buff, sizeof(char), 256, fp_temp);
            if (count)
            {
                fwrite(buff, sizeof(char), count, fp);
            }
        }
        fputs("\n", fp);
    } while (0);

    if (fp_temp != NULL)     fclose(fp_temp);

#ifdef __ZIMAGE_LOGO_ANIMATED_SUPPORT__	

    for (i = 0; i < 4; i ++)
    {
        /* decode image */
        ret = BMPLoader(filename_in_ani[i], filename_temp, DRV_MAINLCD_BIT_PER_PIXEL, "", MMI_FALSE, NULL);
        if (ret == 0)
        {
            fprintf(stderr, "[BOOTUP LOGO] %s BMPLoader failed !!\n", filename_in_ani[i]);
            break;
        }

        fp_temp = fopen(filename_temp, "rb");
        if (fp_temp == NULL)
        {
            RESPOP_LOG_V("[BOOTUP LOGO] Read raw data file failed !!");
            break;
        }

        fprintf(fp, "__align(4) const U8 %s[] = \n", output_name_ani[i]);
        while (!feof(fp_temp))
        {
            count = fread(buff, sizeof(char), 256, fp_temp);
            if (count)
            {
                fwrite(buff, sizeof(char), count, fp);
            }
        }
        fputs("\n", fp);
        if (fp_temp != NULL)     
            fclose(fp_temp);
    } 
#endif


    if (fp != NULL)     fclose(fp);
}
#endif /* defined(__ZIMAGE_SUPPORT__) */


#if defined(__FAST_LOGO__)
/*****************************************************************************
 * FUNCTION
 *  PopulateFastLogoData
 * DESCRIPTION
 *  Populate fast logo data resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void PopulateFastLogoData(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    FILE *fp = NULL;
    char filename_in[] = CUST_IMG_PATH"\\MainLCD\\Active\\poweronoff\\logo.BMP";
    char filename_temp[] = "TEMPIMAGE";
    char output_name[] = "g_fast_logo_img";
    char filename_out[] = "..\\..\\Customer\\CustResource\\CustFastLogoImgData.h";
    unsigned char *buffer;
    int size, width, height, ret, i;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    do
    {
        /* open image test */
        fp = fopen(filename_in, "rb");
        if (fp == NULL)
        {
            fprintf(stderr, "[FastLogo] %s Input file failed !!\n", filename_in);
            break;
        }
        fclose(fp);
        fp == NULL;
        
        /* decode image */
        buffer = (U8*)malloc(ABMENC_BMP_FILE_BUFFER_SIZE*sizeof(char));
        if (buffer == NULL)
        {
            fprintf(stderr, "[FastLogo] allocate memory failed !!\n");
            break;
        }
        memset(buffer, 0, ABMENC_BMP_FILE_BUFFER_SIZE*sizeof(char));
        ret = ABM_load(
                filename_in,
                DRV_MAINLCD_BIT_PER_PIXEL,
                IMAGE_TYPE_DEVICE_BITMAP,
                ABM_ENC_OPTION_FLAG_AB2,
                buffer,
                &size, &width, &height, MMI_FALSE, NULL);
        if (ret != ABM_ENC_RETURN_USE_AB2)
        {
            fprintf(stderr, "[FastLogo] %s ABM_Load failed !!\n", filename_in);
            break;
        }

        /* output image */
        fp = fopen(filename_out, "w+");
        if (fp == NULL)
        {
            fprintf(stderr, "[FastLogo] %s Output file failed !!\n", filename_out);
            break;
        }

        fprintf(fp, "#if !defined(__MTK_TARGET__)\n\t#define __align(x)\n#endif\n");
        fprintf(fp, "__align(4) static const U8 %s[] = \n{", output_name);
        for (i = 0; i < size; i++)
        {
            if ((i % 16) == 0)
            {
                fprintf(fp, "\n\t");
            }
            fprintf(fp, "0x%02X, ", buffer[i]);
        }
        fprintf(fp, "\n};\n");
    } while (0);
    
    if (buffer != NULL) free(buffer);
    if (fp != NULL)     fclose(fp);
}
#endif /* defined(__FAST_LOGO__) */


#if 1

/*
 * the global images for L1-L30 use bmp image type in 128x64 project,
 * but use bmp image type in others projects.
*/
#if defined(__MMI_MAINLCD_128X64__)
    #define __IMG_EXT_NAME__	".BMP"
#else /* __MMI_MAINLCD_128X64__ */
    #define __IMG_EXT_NAME__    ".bmp"
#endif /* __MMI_MAINLCD_128X64__ */

/* define for COSMOS_SLIM */ 
#if defined(__LOW_COST_SUPPORT_COMMON__) && defined(__COSMOS_MMI_PACKAGE__)
    #define __L_NB1__  "L_NB1"
    #define __L_NB2__  "L_NB1"
    #define __L_NB3__  "L_NB1"
    #define __L_NB4__  "L_NB1"
    #define __L_NB5__  "L_NB1"
    #define __L_NB6__  "L_NB1"
    #define __L_NB7__  "L_NB1"
    #define __L_NB8__  "L_NB1"
    #define __L_NB9__  "L_NB1"
    #define __L_NB10__ "L_NB1"
    #define __L_NB11__ "L_NB1"
    #define __L_NB12__ "L_NB1"
    #define __L_NB13__ "L_NB1"
    #define __L_NB14__ "L_NB1"
    #define __L_NB15__ "L_NB1"
    #define __L_NB16__ "L_NB1"
    #define __L_NB17__ "L_NB1"
    #define __L_NB18__ "L_NB1"
    #define __L_NB19__ "L_NB1"
    #define __L_NB20__ "L_NB1"
    #define __L_NB21__ "L_NB1"
    #define __L_NB22__ "L_NB1"
    #define __L_NB23__ "L_NB1"
    #define __L_NB24__ "L_NB1"
    #define __L_NB25__ "L_NB1"
    #define __L_NB26__ "L_NB1"
    #define __L_NB27__ "L_NB1"
    #define __L_NB28__ "L_NB1"
    #define __L_NB29__ "L_NB1"
    #define __L_NB30__ "L_NB1"
#else
    #define __L_NB1__  "L_NB1"
    #define __L_NB2__  "L_NB2"
    #define __L_NB3__  "L_NB3"
    #define __L_NB4__  "L_NB4"
    #define __L_NB5__  "L_NB5"
    #define __L_NB6__  "L_NB6"
    #define __L_NB7__  "L_NB7"
    #define __L_NB8__  "L_NB8"
    #define __L_NB9__  "L_NB9"
    #define __L_NB10__ "L_NB10"
    #define __L_NB11__ "L_NB11"
    #define __L_NB12__ "L_NB12"
    #define __L_NB13__ "L_NB13"
    #define __L_NB14__ "L_NB14"    
    #define __L_NB15__ "L_NB15"
    #define __L_NB16__ "L_NB16"
    #define __L_NB17__ "L_NB17"
    #define __L_NB18__ "L_NB18"
    #define __L_NB19__ "L_NB19"
    #define __L_NB20__ "L_NB20"
    #define __L_NB21__ "L_NB21"
    #define __L_NB22__ "L_NB22"
    #define __L_NB23__ "L_NB23"
    #define __L_NB24__ "L_NB24"
    #define __L_NB25__ "L_NB25"
    #define __L_NB26__ "L_NB26"
    #define __L_NB27__ "L_NB27"
    #define __L_NB28__ "L_NB28"
    #define __L_NB29__ "L_NB29"
    #define __L_NB30__ "L_NB30"
#endif


/*****************************************************************************
 * FUNCTION
 *  PopulateGlobalData
 * DESCRIPTION
 *  Populate Global Resource
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void PopulateGlobalData()
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
	
    /* ---------------- Common Global String (start) ----------------------- */
    /* Global string listed here are shared by Pluto and Cosmos */
    ADD_APPLICATION_STRING2(STR_GLOBAL_0, "0", "Global String- 0");
    ADD_APPLICATION_STRING2(STR_GLOBAL_1, "1", "Global String- 1");
    ADD_APPLICATION_STRING2(STR_GLOBAL_2, "2", "Global String- 2");
    ADD_APPLICATION_STRING2(STR_GLOBAL_3, "3", "Global String- 3");
    ADD_APPLICATION_STRING2(STR_GLOBAL_4, "4", "Global String- 4");
    ADD_APPLICATION_STRING2(STR_GLOBAL_5, "5", "Global String- 5");
    ADD_APPLICATION_STRING2(STR_GLOBAL_6, "6", "Global String- 6");
    ADD_APPLICATION_STRING2(STR_GLOBAL_7, "7", "Global String- 7");
    ADD_APPLICATION_STRING2(STR_GLOBAL_8, "8", "Global String- 8");
    ADD_APPLICATION_STRING2(STR_GLOBAL_9, "9", "Global String- 9");
    ADD_APPLICATION_STRING2(STR_GLOBAL_10, "10", "Global String- 10");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ABORT, "Abort", "Global String- Abort");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ABORTING, "Aborting", "Global String- Aborting");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ACCEPT,"Accept","Global String- Accept");    
    ADD_APPLICATION_STRING2(STR_GLOBAL_ACCOUNTS,"Accounts",	"Accounts- configuration folder");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ACTIVATE, "Activate", "Global String- Activate");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ACTIVATED, "Activated", "Global String- Activated");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ADD, "Add", "Global String- Add");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ADDRESS, "Address", "Global String- Address");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ADVANCED, "Advanced", "Global String- Advanced");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ALARM, "Alarm", "Global String- Alarm");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ALWAYS_ASK, "Always ask", "Global String- Always ask");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AS_EMAIL, "As Email", "Global String- As Email- sub option of sending command");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AS_MULTIMEDIA_MSG, "As multimedia message", "Global String- As multimedia message- sub option of sending command");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AS_TEXT_MESSAGE, "As text message", "Global String- As text message- sub option of sending command");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ATTACHMENT, "Attachment", "Global String- Attachment");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AUTHENTICATION,"Authentication","Global String- Authentication");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AUTOMATIC,"Automatic","Global String- Automatic");
    ADD_APPLICATION_STRING2(STR_GLOBAL_BACK, "Back", "Global String- Back");
    ADD_APPLICATION_STRING2(STR_GLOBAL_BLUETOOTH, "Bluetooth", "Global String- Bluetooth");
    ADD_APPLICATION_STRING2(STR_GLOBAL_BUSY_TRY_LATER, "Busy", "STR_GLOBAL_BUSY_TRY_LATER");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CANCEL, "Cancel", "Global String- Cancel");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CANCELLING, "Cancelling", "Global String- Cancelling");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CLEAR, "Clear", "Global String- Clear");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CLOSE, "Close", "Global String- Close");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CONFIRM, "Confirm", "Global String- Confirm");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CONNECT, "Connect", "Global String- Connect");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CONNECTING, "Connecting", "Global String- Connecting");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CONTENT, "Content", "Global String- Content");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CONTINUE, "Cont.", "Global String- Cont.- use as LSK for length limit");
    ADD_APPLICATION_STRING2(STR_GLOBAL_COPY, "Copy", "Global String- Copy");
    ADD_APPLICATION_STRING2(STR_GLOBAL_COPYING, "Copying", "Global String- Copying");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CURRENTLY_NOT_AVAILABLE, "Currently not available", "Global String- the services/operations aren't workable in some situations");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CURRENTLY_NOT_AVAILABLE_IN_CALL, "Not available during the call", "Global String- the services/operations aren't workable during the call");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CUSTOM, "Custom", "Global String- Custom- user defined");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DATA_ACCOUNT, "Data account", "Global String- Data account");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DATA_ACCOUNTS, "Data accounts", "Global String- Data accounts");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DATA_CONN_SETTING, "Data connection settings", "Global String- Data connection settings");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DATE, "Date", "Global String- Date");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DEACTIVATE, "Deactivate", "Global String- Deactivate");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DEFAULT, "Default", "Global String- Default");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DELETE, "Delete", "Global String- Delete");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DELETE_ALL, "Delete All", "Global String- Delete All");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DELETED, "Deleted", "Global String- Deleted");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DELETING, "Deleting", "Global String- Deleting");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DETAILS, "Details", "Global String- Details");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DIALLED_CALLS, "Dialled call", "Global string- Dialled calls");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DIAL, "Call", "Global String- Call");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DISCARD,"Discard","Global String- Discard");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DISCONNECT, "Disconnect", "Global String- Disconnect");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DISCONNECTING, "Disconnecting", "Global String- Disconnecting");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DONE, "Done", "Global String- Done");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DOWNLOAD, "Download", "STR_GLOBAL_DOWNLOAD");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DOWNLOAD_ASK, "Download?", "STR_GLOBAL_DOWNLOAD_ASK");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DOWNLOADING, "Downloading", "STR_GLOBAL_DOWNLOADING");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DRAFTS, "Drafts", "Global String- Drafts");
  //  ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_FILE_EXISTS, "File Exists", "Global String- File Exists");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_FS_ERROR, "File Access Error", "Global String- File Access Error");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_INVALID_FORMAT, "Format Error", "Global String- Format Error");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_NON_DRM, "Not DRM File", "Global String- Not DRM File");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_PROCESSING, "DRM Processing", "Global String- DRM Processing");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_PROHIBITED, "DRM Prohibited", "Global String- DRM Prohibited");
  //  ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_RO_RECEIVED, "DRM Rights Received", "Global String- DRM Rights Received");
  //  ADD_APPLICATION_STRING2(STR_GLOBAL_DRM_SIZE_TOO_BIG, "Size Too Big", "Global String- Size Too Big");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EARPHONE_IN, "Earphone plugged in!", "Global String- String Associated with Ear Phone Plug In Popup.");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EARPHONE_OUT, "Earphone plugged Out", "Global String- Earphone plugged Out");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EDIT, "Edit", "Global String- Edit");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EDIT_BEFORE_CALL, "Edit before call", "Global String- Edit before call");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EMAIL, "Email", "Global String- Email");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EMPTY, "Empty", "Global String- Empty");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EMPTY_LIST, "<Empty>", "Global String- <Empty>");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ERROR, "Error", "Global String- Error");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EXIT, "Exit", "Global String- Exit");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FAILED, "Failed", "Global String- Failed");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FAILED_TO_SAVE, "Failed to save", "Global String- Failed to save");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FAILED_TO_SEND, "Failed to send", "Global String- Failed to send");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FAST, "Fast", "Global String- Fast");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FILE_ALREADY_EXISTS, "File already exists", "Global String- File already exists");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FILE_NOT_FOUND, "File not found", "Global string- File not found");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FILENAME, "Filename", "Global String- Filename");
 //   ADD_APPLICATION_STRING2(STR_GLOBAL_FORMAT, "Format", "Global String- Format- the type of file");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FORWARD, "Forward", "Global String- Forward- send message to other recipients");
    ADD_APPLICATION_STRING2(STR_GLOBAL_GO_TO, "Go to", "Global String- Go to- connect the URL");
    ADD_APPLICATION_STRING2(STR_GLOBAL_GPRS, "GPRS", "Global String- GPRS");
  //  ADD_APPLICATION_STRING2(STR_GLOBAL_GSM, "GSM", "Global String- GSM");
    ADD_APPLICATION_STRING2(STR_GLOBAL_HELP, "Help", "Global String- Help- show the usage tips or notes");
    ADD_APPLICATION_STRING2(STR_GLOBAL_HIGH, "High", "Global String- High");
    ADD_APPLICATION_STRING2(STR_GLOBAL_HTTP, "HTTP", "Global String- HTTP");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INBOX, "Inbox", "Global String- Inbox");
  //  ADD_APPLICATION_STRING2(STR_GLOBAL_INCOMING_CALL, "Incoming call", "Global String- Incoming call");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INPUT_METHOD, "Input Method", "Global String- Input Method");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INSERT_SIM_CARD, "Please insert a SIM card", "Gloabl String - Please insert a SIM card"); 
    ADD_APPLICATION_STRING2(STR_GLOBAL_INSTALL, "Install", "Global String- Install");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INSUFFICIENT_MEMORY, "Insufficient memory", "Global String- Insufficient memory- not enough RAM to operate");    
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID, "Invalid", "Global String- Invalid");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_DATA_ACCOUNT, "Invalid data account. Configure?", "Global String- Invalid data account. Configure?");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_EMAIL_ADDRESS, "Invalid Email address", "Global String- Invalid Email address");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_EMAIL_ADDRESSES, "Invalid Email addresses", "Global String- Invalid Email addresses");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_FILENAME, "Invalid filename", "Global String- Invalid filename");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_FORMAT, "Invalid format", "Global String- Invalid format");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_INPUT, "Invalid input", "Global String- Invalid input");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_NUMBER, "Invalid number", "Global String- Invalid number");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_NUMBERS, "Invalid numbers", "Global String- Invalid numbers");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_RECIPIENTS, "Invalid recipients", "Global String- Invalid recipients");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INVALID_URL, "Invalid URL", "Global String- Invalid URL");
    ADD_APPLICATION_STRING2(STR_GLOBAL_LIST, "List", "Global String- List");
    ADD_APPLICATION_STRING2(STR_GLOBAL_LOADING, "Loading", "Global String- Loading");
    ADD_APPLICATION_STRING2(STR_GLOBAL_LOGIN, "Login", "Global String- Login");
    ADD_APPLICATION_STRING2(STR_GLOBAL_LOGO, "Logo", "Global String- Logo");
    ADD_APPLICATION_STRING2(STR_GLOBAL_LOGOUT, "Logout", "Global String- Logout");
    ADD_APPLICATION_STRING2(STR_GLOBAL_LOW, "Low", "Global String- Low");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MANUAL, "Manual", "Global String- Manual");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MARK, "Mark", "Global String- Mark");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MARK_ALL, "Mark all", "Global String- Mark all");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MAXIMUM, "Maximum", "Global String- Maximum");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MEDIUM, "Medium", "Global String- Medium");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MEMORY_CARD, "Memory card", "Global String- Memory card");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MEMORY_FULL, "Memory full", "Global String- Memory full- indicate user not save again");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MEMORY_STATUS, "Memory status", "Global String- Memory status");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MESSAGE, "Message", "Global String- Message");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MISSED_CALLS, "Missed calls", "Global String- Missed calls");
	#ifdef MMS_SUPPORT	
    ADD_APPLICATION_STRING2(STR_GLOBAL_MMS, "MMS", "Global String- MMS");
	#endif
    ADD_APPLICATION_STRING2(STR_GLOBAL_MODE, "Mode", "Global String- Mode");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MOVE, "Move", "Global String- Move");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MOVING, "Moving", "Global String- Moving");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MULTIMEDIA_MESSAGE, "Multimedia message", "Global String- Multimedia message");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MUTE, "Mute", "Global String- Mute");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NETWORK_SETTINGS, "Network settings", "Global String- Network settings");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NO, "No", "Global String- No");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NO_MEMORY_CARD, "No Memory Card", "[Notify-No Memory Card]");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NONE, "None", "Global String- None");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NORMAL, "Normal", "Global String- Normal");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NOT_AVAILABLE, "Not Available", "Global String- Not Available");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NOT_AVAILABLE_DURING_VIDEO_CALL, "Not available during video call", "Global String- Not available during video call");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NOT_ENOUGH_MEMORY, "Not enough memory", "Global String- Not enough memory- memory is too small to save");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NOT_SUPPORT_AT_PC_SIMULATOR, "Not supported on PC simulator", "Global String- Not supported on PC simulator");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NOT_SUPPORTED, "Not supported", "Global String- Not supported");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OFF, "Off", "Global String- Off");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OK, "Ok", "Global String- OK");
    ADD_APPLICATION_STRING2(STR_GLOBAL_ON, "On", "Global String- On");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OPEN, "Open", "Global String- Open");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OPTIONS, "Option", "Global String- Options");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OUTBOX, "Outbox", "Global String- Outbox");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OVERWRITE_EXISTING_FILE, "Overwrite existing file?", "Global String- Overwrite existing file?");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PASSWORD, "Password","Global String- Password menu");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PAUSE, "Pause","Global String- Pause");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PHONE, "Phone","Global String- Phone");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PICTURE, "Picture","Global String- Picture");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PLAY, "Play","Global String- Play");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PLEASE_WAIT, "Please Wait", "Global String- Please Wait");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PLEASE_INPUT_THE_FILENAME, "Please input the filename", "Global String- Prompt user the filename is empty");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PREFERRED_STORAGE, "Preferred storage", "Global String- Preferred storage");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PREV, "Prev.", "Global String- Prev.");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PREVIEW, "Preview", "Global String- Preview");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PRINT, "Print", "Global String- Print");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PRIORITY, "Priority", "Global String- Priority");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PROXY, "Proxy", "Global String- Proxy");
    ADD_APPLICATION_STRING2(STR_GLOBAL_QUIT, "Quit", "Global String- Quit");
    ADD_APPLICATION_STRING2(STR_GLOBAL_READ, "Read", "Global String- Read");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RECEIVED, "Received", "Global String- Received");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RECEIVED_CALLS, "Received calls", "Global string- Received calls");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RECEIVING, "Receiving", "Global String- Receiving");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RECIPIENTS, "Recipients", "Global String- Recipients- recipient list name");
    ADD_APPLICATION_STRING2(STR_GLOBAL_REFRESH, "Refresh", "Global String- Refresh");
    ADD_APPLICATION_STRING2(STR_GLOBAL_REMOVE, "Remove", "Global String- Remove- delete the reference link or remove accessory from phone");
    ADD_APPLICATION_STRING2(STR_GLOBAL_REMOVED, "Removed", "Global String- Removed- remove successfully");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RENAME, "Rename", "Global String- Rename");
    ADD_APPLICATION_STRING2(STR_GLOBAL_REPLACE, "Replace", "Global String- Replace");
    ADD_APPLICATION_STRING2(STR_GLOBAL_REPLY, "Reply", "Global String- Reply");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RESEND, "Resend", "Global String- Resend");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RESET, "Reset", "Global String- Reset");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RESUME, "Resume", "Global String- Resume");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RINGTONE, "Ringtone", "Global String- Ringtone");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SAVE, "Save", "Global String- Save");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SAVE_ASK, "Save?", "Global String- Save?");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SAVE_TO_PHONEBOOK, "Save to Phonebook", "Global String- Save to Phonebook");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SAVED, "Saved", "Global String- Saved");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SAVING, "Saving", "Global String- Saving");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEARCH, "Search", "Global String- Search");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEARCHING, "Searching", "Global String- Searching");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SELECT, "Select", "Global String- Select");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEND, "Send", "Global String- Send");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEND_MESSAGE, "Send message", "Global String- Send message");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEND_MULTIMEDIA_MESSAGE, "Send multimedia message", "The option of send multimedia message");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEND_TEXT_MESSAGE, "Send text message", "The option of send text message");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SENDING, "Sending", "Global String- Sending");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SENT, "Sent", "Global String- Sent- send successfully");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SETTINGS, "Settings", "Global String- Settings");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SILENT, "Silent", "Global String- Silent");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SIM, "SIM", "Global String- SIM");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SIM_1, "SIM1", "Global String- SIM1");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SIM_2, "SIM2", "Global String- SIM2");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SIM_3, "SIM3", "Global String- SIM3");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SIM_4, "SIM4", "Global String- SIM4");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SLOW, "Slow", "Global String- Slow");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SORT_BY, "Sort by", "Global String- Sort by- include sub options");
    ADD_APPLICATION_STRING2(STR_GLOBAL_START, "Start", "Global String- Start");
    ADD_APPLICATION_STRING2(STR_GLOBAL_STOP, "Stop", "Global String- Stop");
    ADD_APPLICATION_STRING2(STR_GLOBAL_STORAGE, "Storage", "Global String- Storage");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SUBJECT, "Subject", "Global String- Subject");
    ADD_APPLICATION_STRING2(STR_GLOBAL_TEXT, "Text", "Global String- Text");
    ADD_APPLICATION_STRING2(STR_GLOBAL_TEXT_MESSAGE, "Text message", "Global String- Text message- SMS");
    ADD_APPLICATION_STRING2(STR_GLOBAL_TIME, "Time", "Global String- Time");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNAVAILABLE_IN_FLIGHT_MODE, "Unavailable in flight mode", "Global String- Unavailable in flight mode");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNAVAILABLE_SIM, "Unavailable SIM", "Global String- Unavailable SIM");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNFINISHED, "Unfinished", "Global String- Unfinished");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNMARK, "Unmark", "Global String- Unmark");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNMARK_ALL, "Unmark all", "Global String- Unmark all");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNSUPPORTED_FORMAT, "Unsupported Format", "Global String- Unsupported Format");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UPDATE, "Update", "Global String- Update");
    ADD_APPLICATION_STRING2(STR_GLOBAL_URL, "URL", "Global String- URL");
    ADD_APPLICATION_STRING2(STR_GLOBAL_USE, "Use", "Global String- Use");
    ADD_APPLICATION_STRING2(STR_GLOBAL_USE_TEMPLATE, "Use Template", "Global String- Use Template");
    ADD_APPLICATION_STRING2(STR_GLOBAL_USERNAME, "User Name", "Global String- User name menu");
    ADD_APPLICATION_STRING2(STR_GLOBAL_VIA_BLUETOOTH, "Via Bluetooth", "Global String- Via Bluetooth- sub option of sending command");
    ADD_APPLICATION_STRING2(STR_GLOBAL_VIA_INFRARED, "Via infrared", "Global String- Via infrared- sub option of sending command");
    ADD_APPLICATION_STRING2(STR_GLOBAL_VIDEO, "Video", "Global String- Video");
    ADD_APPLICATION_STRING2(STR_GLOBAL_VIEW, "View", "Global String- View");
    ADD_APPLICATION_STRING2(STR_GLOBAL_VOLUME, "Volume", "Global String- Volume");
    ADD_APPLICATION_STRING2(STR_GLOBAL_WALLPAPER, "Wallpaper", "Global String- Wallpaper");
    ADD_APPLICATION_STRING2(STR_GLOBAL_WAP, "WAP", "Global String- WAP");
    ADD_APPLICATION_STRING2(STR_GLOBAL_WIFI, "Wi-Fi", "Global String- Wi-Fi");
  //  ADD_APPLICATION_STRING2(STR_GLOBAL_YEAR, "Year", "Global String- Year");
    ADD_APPLICATION_STRING2(STR_GLOBAL_YES, "Yes", "Global String- Yes");

    ADD_APPLICATION_STRING2(STR_GLOBAL_INSERT_MEMORY_CARD, "Please insert memory card", "Global String- Please insert memory card");
    
    ADD_APPLICATION_STRING2(STR_GLOBAL_MC_REMOVED_USE_PHONE, "Memory card removed. Use phone?", "Global String- Memory card removed. Use phone?" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_MC_REMOVED, "Memory card removed", "Global String- Memory card removed" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_MC_INSERTED, "Memory card inserted", "Global String- Memory card inserted" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_OTG_REMOVED_USE_PHONE, "OTG device removed. Phone will be used.", "Global String- OTG device removed. Phone will be used." );
    ADD_APPLICATION_STRING2(STR_GLOBAL_OTG_REMOVED_USE_PHONE_QUERY, "OTG device removed. Use phone?", "Global String- OTG device removed. Use phone?" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_OTG_REMOVED, "OTG device removed", "Global String- OTG device removed" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_OTG_CONNECTED, "OTG device connected", "Global String- OTG device connected" );

    ADD_APPLICATION_STRING2(STR_GLOBAL_NOT_AVAILABLE_IN_MASS_STORAGE_MODE, "Not available in mass storage mode", "Global String- Not available in mass storage mode" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_NO_NUMBER, "No number", "Global String- No number" );

    ADD_APPLICATION_STRING2(STR_GLOBAL_SUNDAY, "Sunday", "Global String- Sunday");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MONDAY, "Monday", "Global String- Monday");
    ADD_APPLICATION_STRING2(STR_GLOBAL_TUESDAY, "Tuesday", "Global String- Tuesday");
    ADD_APPLICATION_STRING2(STR_GLOBAL_WEDNESDAY, "Wednesday", "Global String- Wednesday");
    ADD_APPLICATION_STRING2(STR_GLOBAL_THURSDAY, "Thursday", "Global String- Thursday");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FRIDAY, "Friday", "Global String- Friday");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SATURDAY, "Saturday", "Global String- Saturday");
    
    
    ADD_APPLICATION_STRING2(STR_GLOBAL_SUNDAY_SHORT, "Sun", "Global String- Sun");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MONDAY_SHORT, "Mon", "Global String- Mon");
    ADD_APPLICATION_STRING2(STR_GLOBAL_TUESDAY_SHORT, "Tue", "Global String- Tue");
    ADD_APPLICATION_STRING2(STR_GLOBAL_WEDNESDAY_SHORT, "Wed", "Global String- Wed");
    ADD_APPLICATION_STRING2(STR_GLOBAL_THURSDAY_SHORT, "Thu", "Global String- Thu");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FRIDAY_SHORT, "Fri", "Global String- Fri");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SATURDAY_SHORT, "Sat", "Global String- Sat");
    
    
    ADD_APPLICATION_STRING2(STR_GLOBAL_JANUARY_SHORT, "Jan", "Global String- Jan");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FEBRUARY_SHORT, "Feb", "Global String- Feb");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MARCH_SHORT, "Mar", "Global String- Mar");
    ADD_APPLICATION_STRING2(STR_GLOBAL_APRIL_SHORT, "Apr", "Global String- Apr");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MAY_SHORT, "May", "Global String- May");
    ADD_APPLICATION_STRING2(STR_GLOBAL_JUNE_SHORT, "Jun", "Global String- Jun");
    ADD_APPLICATION_STRING2(STR_GLOBAL_JULY_SHORT, "Jul", "Global String- Jul");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AUGEST_SHORT, "Aug", "Global String- Aug");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEPTEMBER_SHORT, "Sep", "Global String- Sep");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OCTOBER_SHORT, "Oct", "Global String- Oct");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NOVEMBER_SHORT, "Nov", "Global String- Nov");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DECEMBER_SHORT, "Dec", "Global String- Dec");
    

    ADD_APPLICATION_STRING2(STR_GLOBAL_DIAL_VIDEO_CALL, "Video call", "Global String- Video call" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_DELETE_ASK, "Delete?", "Global String- Delete ask" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_DELETE_ALL_ASK, "Delete all?", "Global String- Delete all ask" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_USE_AS, "Use as", "Global String- Use as" );
    ADD_APPLICATION_STRING2(STR_GLOBAL_STATUS, "Status", "Global String- Status" );
#if defined(__TOPWELL_HW_MARQUEET__)
    ADD_APPLICATION_STRING2(STR_ID_MEDIA_LED, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );

    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_OFF, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT1, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT2, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT3, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT4, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT5, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT6, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT7, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT8, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT9, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
    ADD_APPLICATION_STRING2(STR_ID_COLOR_LED_EFFECT10, "STR_ID_MEDIA_LED", "STR_ID_MEDIA_LED" );
#endif

#ifdef __TOPWELL_MMI_NEW_SMS_VIEW_STR_ALONE__	
	ADD_APPLICATION_STRING2(STR_GLOBAL_NEW_SMS_VIEW, "View", "New Sms View" );
#endif
#if defined(__TOPWELL_MMI_CALENDAR_SHOW_MONTH_USE_STRING_MODE3__)
    ADD_APPLICATION_STRING2(STR_GLOBAL_JANUARY, "January", "Global String- Jan");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FEBRUARY, "February", "Global String- Feb");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MARCH, "March", "Global String- Mar");
    ADD_APPLICATION_STRING2(STR_GLOBAL_APRIL, "April", "Global String- Apr");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MAY, "May", "Global String- May");
    ADD_APPLICATION_STRING2(STR_GLOBAL_JUNE, "June", "Global String- Jun");
    ADD_APPLICATION_STRING2(STR_GLOBAL_JULY, "July", "Global String- Jul");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AUGEST, "August", "Global String- Aug");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEPTEMBER, "September", "Global String- Sep");
    ADD_APPLICATION_STRING2(STR_GLOBAL_OCTOBER, "October", "Global String- Oct");
    ADD_APPLICATION_STRING2(STR_GLOBAL_NOVEMBER, "November", "Global String- Nov");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DECEMBER, "December", "Global String- Dec");
#endif

#ifdef __TOPWELL_MMI_MM_LSK_NEXT_PAGE_SUPPORT__
	ADD_APPLICATION_STRING2(STR_ID_MM_NEXT_PAGE, "Next page", "Next page" );
#endif

    /* ---------------- Common Global String ( end ) ----------------------- */

    /* ------------------- Cosmos and FTE only (Start)---------------------- */
    /*  Globla listed here are used by Cosmos and FTE only.  */
#if defined(__COSMOS_MMI__) || defined(__VENUS_UI_ENGINE__)	
    ADD_APPLICATION_STRING2(STR_GLOBAL_SUBMIT,"Submit","Accept");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UDP_PORT, "UDP port", "Global String- UDP port");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CLIPBOARD, "Clipboard", "Global String- Clipboard");

    ADD_APPLICATION_STRING2(STR_GLOBAL_ADD_TO_EXISTING_CONTACT, "Add to existing contact", "Global String- Add to existing contact");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AM, "AM", "Global String- AM");
    ADD_APPLICATION_STRING2(STR_GLOBAL_AUDIO, "Audio", "Global String- Audio");
    ADD_APPLICATION_STRING2(STR_GLOBAL_BOOKMARKS, "Bookmarks", "Global String- Bookmarks");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CHOOSE_STORAGE, "Choose storage", "Global String- Choose storage");
    ADD_APPLICATION_STRING2(STR_GLOBAL_CREATE_NEW_CONTACT, "Create new contact", "Global String- Create new contact");
    ADD_APPLICATION_STRING2(STR_GLOBAL_DAY, "Day", "Global String- Day");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EARPHONE, "Earphone", "Global String- Earphone");
    ADD_APPLICATION_STRING2(STR_GLOBAL_EXPORT, "Export", "Global String- Export");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FILENAME_ALREADY_EXISTS, "Filename already exists", "Global String- Filename already exists");
    ADD_APPLICATION_STRING2(STR_GLOBAL_FOLD, "Fold", "Global String- Fold");
    ADD_APPLICATION_STRING2(STR_GLOBAL_GO_TO_URL, "Go to URL", "Global String- Go to URL");
    ADD_APPLICATION_STRING2(STR_GLOBAL_HOME, "Home", "Global String- Home");
    ADD_APPLICATION_STRING2(STR_GLOBAL_HOUR, "Hour", "Global String- Hour");
    ADD_APPLICATION_STRING2(STR_GLOBAL_IMPORT, "Import", "Global String- Import");
    ADD_APPLICATION_STRING2(STR_GLOBAL_INSTALLING, "Installing", "Global String- Installing");
    ADD_APPLICATION_STRING2(STR_GLOBAL_LANDSCAPE, "Landscape", "Global String- Landscape");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MIN, "Min", "Global String- Min");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MORE, "More", "Global String- More");
    ADD_APPLICATION_STRING2(STR_GLOBAL_MULTIMEDIA, "Multimedia", "Global String- Multimedia");	
    ADD_APPLICATION_STRING2(STR_GLOBAL_NEXT, "Next", "Global String- Next");	
    ADD_APPLICATION_STRING2(STR_GLOBAL_PM, "PM", "Global String- PM");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PORTRAIT, "Portrait", "Global String- Portrait");
    ADD_APPLICATION_STRING2(STR_GLOBAL_PRIMARY_SIM, "Primary SIM", "Global String- Primary SIM");
    ADD_APPLICATION_STRING2(STR_GLOBAL_REFRESHING, "Refreshing", "Global String- Refreshing");
    ADD_APPLICATION_STRING2(STR_GLOBAL_REMINDER, "Reminder", "Global String- Reminder");
    ADD_APPLICATION_STRING2(STR_GLOBAL_RESTORE, "Restore", "Global String- Restore");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SEC, "Sec", "Global String- Sec");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SECONDARY_SIM, "Secondary SIM", "Global String- Secondary SIM");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SECURITY, "Security", "Global String- Security");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SELECT_ALL, "Select all", "Global String- Select all");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SET_AS, "Set as", "Global String- Set as");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SHARE, "Share", "Global String- Share");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SMS, "SMS", "Global String- SMS");
    ADD_APPLICATION_STRING2(STR_GLOBAL_SORT, "Sort", "Global String- Sort");
    ADD_APPLICATION_STRING2(STR_GLOBAL_TEMPLATE, "Template", "Global String- Template");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNNAMED, "Unnamed", "Global String- Unnamed" );	
    ADD_APPLICATION_STRING2(STR_GLOBAL_UNSELECT_ALL, "Unselect all", "Global String- Unselect all");
    ADD_APPLICATION_STRING2(STR_GLOBAL_UPLOAD, "Upload", "Global String- Upload");
    ADD_APPLICATION_STRING2(STR_GLOBAL_VIBRATION, "Vibration", "Global String- Vibration");
    ADD_APPLICATION_STRING2(STR_GLOBAL_WEEK, "WEEK", "Global String- Week");
    ADD_APPLICATION_STRING2(STR_GLOBAL_WIFI_ONLY, "Wi-Fi only", "Global String- Wi-Fi only");
#endif /*__COSMOS_MMI__ || __VENUS_UI_ENGINE__ */
    /* ---------------------- Cosmos and FTE only (end) ---------------------- */

#if defined(__TOPWELL_THEME_MULTIMEDIA_BG_ALONE__)
    ADD_APPLICATION_IMAGE2(IMG_ID_MULTIMEDIA_BG, CUST_IMG_PATH "\\\\MainLCD\\\\Multimedia\\\\Multimedia_bg.png", "Multimedia bg");
#endif
    ADD_APPLICATION_IMAGE2(IMG_GLOBAL_OK, "..\\\\..\\\\Customer\\\\Images\\\\EmptyImage.bmp", "Global Image-Ok");
    ADD_APPLICATION_IMAGE2(IMG_GLOBAL_BACK, "..\\\\..\\\\Customer\\\\Images\\\\EmptyImage.bmp", "Global Image-Back");
    ADD_APPLICATION_IMAGE2(IMG_GLOBAL_YES, "..\\\\..\\\\Customer\\\\Images\\\\EmptyImage.bmp", "Global Image-Yes");
    ADD_APPLICATION_IMAGE2(IMG_GLOBAL_NO, "..\\\\..\\\\Customer\\\\Images\\\\EmptyImage.bmp", "Global Image-No");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_OPTIONS,
        "..\\\\..\\\\Customer\\\\Images\\\\EmptyImage.bmp",
        "Global Image-Options");
{
    S32 force_type = AUTO_TYPE;

    /* force ABM to speed up 6223 + QVGA */
#if defined(__CPU_ARM7EJ_S__) && defined(__MMI_MAINLCD_240X320__)
    force_type = FORCE_ABM;
#endif
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif	
}
#if defined(__TOPWELL_MMI_POP_NEW_SMS_IMAGE__)    
    ADD_APPLICATION_IMAGE2(IMG_GLOBAL_NEW_MESSAGE, CUST_IMG_PATH "\\\\MainLCD\\\\SMS\\\\Receiving\\\\SS_NEW_MSG.gif", "Status Image");
#endif
    ADD_APPLICATION_IMAGE2(IMG_GLOBAL_CLEAR, "..\\\\..\\\\Customer\\\\Images\\\\EmptyImage.bmp", "Global Image-Clear");

    ADD_APPLICATION_IMAGE2(IMG_VICON, CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\checkbox\\\\CK_V.bmp", "Status Image");
#ifndef __MMI_ALARM_SLIM__
    #if defined(__COSMOS_MMI__)
    ADD_APPLICATION_IMAGE2(IMG_STATUS, CUST_IMG_PATH "\\\\MainLCD\\\\Alarm\\\\OA_STATU.pbm", "Status Image");
    #else
    ADD_APPLICATION_IMAGE2(IMG_STATUS, CUST_IMG_PATH "\\\\MainLCD\\\\Alarm\\\\OA_STATU.bmp", "Status Image");
    #endif
    ADD_APPLICATION_IMAGE2(IMG_TIME, CUST_IMG_PATH "\\\\MainLCD\\\\Alarm\\\\OA_TIME.bmp", "Time Image");
    ADD_APPLICATION_IMAGE2(IMG_REPEAT, CUST_IMG_PATH "\\\\MainLCD\\\\Alarm\\\\OA_REPT.bmp", "Repeat Image");
#endif
    ADD_APPLICATION_IMAGE2(
        IMG_CAL,
        CUST_IMG_PATH "\\\\MainLCD\\\\SubMenu\\\\Settings\\\\DateAndTime\\\\ST_CALEN.bmp",
        "Calendar Image");
//popup icon slim
#ifndef __MMI_POPUP_NO_SHOW_ICON__	
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_QUESTION,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_QUE"__MMI_RES_TYPE_POPUP_SCREEN__,
        "Question Mark image");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SAVE,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_SAV"__MMI_RES_TYPE_POPUP_SCREEN__,
        "saved image");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_DELETED,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_DEL"__MMI_RES_TYPE_POPUP_SCREEN__,
        "deleted image");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_WARNING,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_WARN"__MMI_RES_TYPE_POPUP_SCREEN__,
        "warning image");
#if defined(__MMI_MAINLCD_128X64__) || defined(__MMI_FTE_SUPPORT__)
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_PROGRESS,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_PRO",
        "Progress Image");
#else
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_PROGRESS,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_PRO"__MMI_RES_TYPE_POPUP_SCREEN__,
        "Progress Image");
#endif
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_ERROR,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_ERR"__MMI_RES_TYPE_POPUP_SCREEN__,
        "Error Image");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_INFO,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_INF"__MMI_RES_TYPE_POPUP_SCREEN__,
        "Info Image");
    ADD_APPLICATION_IMAGE2(
        IMG_EARPHONE_POPUP_SUBLCD,
        CUST_IMG_PATH "\\\\SUBLCD\\\\Active\\\\SB_EAR.BMP",
        "Sub LCD Image Associated with Ear Phone Plug In Popup.");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SUCCESS,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_SUC"__MMI_RES_TYPE_POPUP_SCREEN__,
        "Success Image");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_FAIL,
        CUST_IMG_PATH "\\\\MainLCD\\\\Warningpage\\\\PopUpPage\\\\PP_FAIL"__MMI_RES_TYPE_POPUP_SCREEN__,
        "Failure Image");
#endif/*__MMI_POPUP_NO_SHOW_ICON__*/

    ADD_APPLICATION_IMAGE2(IMG_GLOBAL_DEFAULT, "..\\\\..\\\\Customer\\\\Images\\\\Default.bmp", "default image");
	//CSK icon slim
#ifndef __MMI_WGUI_DISABLE_CSK__
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_CALL_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Call_CSK.bmp",
        "call CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_COMMON_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Common_CSK.bmp",
        "common CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_DIAL_PAD_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Dial_Pad_CSK.bmp",
        "dial pad CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_FORWARD_MSG_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Forward_Msg_CSK.bmp",
        "forward message CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_MARK_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Mark_CSK.bmp",
        "mark CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_NEXT_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Next_CSK.bmp",
        "next CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_OPTION_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Option_CSK.bmp",
        "option CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_REPLY_MSG_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Reply_Msg_CSK.bmp",
        "reply message CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SAVE_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Save_CSK.bmp",
        "save CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SEARCH_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\SearchWeb_CSK.bmp",
        "search CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SEND_MSG_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Send_Msg_CSK.bmp",
        "send message CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_OPTION_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Common_CSK.bmp",
        "option CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_WEB_BROWSER_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Web_Browser_CSK.bmp",
        "web browser CSK icon");

    /* Remove these CSK icon after W10.17 - Start */
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_PHB_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Phonebook_CSK.bmp",
        "phonebook CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SELECT_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Select_CSK.bmp",
        "select CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_VIEW_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\View_CSK.bmp",
        "view CSK icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_READ_MSG_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Read_Msg_CSK.bmp",
        "read message CSK icon");

    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_BOOKMARK_CSK,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\Softkey\\\\Bookmark_CSK.bmp",
        "bookmark CSK icon");
    /* Remove these CSK icon after W10.17 - End */
#endif/*__MMI_WGUI_DISABLE_CSK__*/

//icon bar icon slim
#ifdef __MMI_ICON_BAR_SUPPORT__
#ifdef __MMI_FTE_SUPPORT__
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_ADD_CONTACT,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_add_contact.png",
        "AddContact ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_ADD_CONTACT_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_add_contact_dis.png",
        "AddContact ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_ADD,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_add_new.png",
        "Add ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_ADD_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_add_new_dis.png",
        "Add ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_ATTACHMENT,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_attachment.png",
        "Attachment ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_ATTACHMENT_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_attachment_dis.png",
        "Attachment ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_BOOKMARK,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_bookmark.png",
        "Bookmark ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_BOOKMARK_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_bookmark_dis.png",
        "Bookmark ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_CALL,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_call.png",
        "Call ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_CALL_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_call_dis.png",
        "Call ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_DELETE,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_delete.png",
        "Delete ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_DELETE_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_delete_dis.png",
        "Delete ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_DETAIL,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_detail.png",
        "Detail ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_DETAIL_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_detail_dis.png",
        "Detail ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_EDIT,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_edit_data.png",
        "Edit ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_EDIT_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_edit_data_dis.png",
        "Edit ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_FORWARD_MESSAGE,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_forward_message.png",
        "Forward ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_FORWARD_MESSAGE_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_forward_message_dis.png",
        "Forward ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_MEETING,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_meeting.png",
        "Meeting ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_MEETING_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_meeting_dis.png",
        "Meeing ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_OPEN,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_open.png",
        "Open ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_OPEN_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_open_dis.png",
        "Open ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_REPLY_MESSAGE,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_reply_message.png",
        "Reply ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_REPLY_MESSAGE_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_reply_message_dis.png",
        "Reply ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_SEARCH,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_search.png",
        "Search ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_SEARCH_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_search_dis.png",
        "Search ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_SEND_MESSAGE,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_send_message.png",
        "Send ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_SEND_MESSAGE_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_send_message_dis.png",
        "Send ToolBar disabled icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_WRITE_MESSAGE,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_write_message.png",
        "Write ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_WRITE_MESSAGE_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_write_message_dis.png",
        "Write ToolBar disabled icon");
#endif /* __MMI_FTE_SUPPORT__ */
#endif/*__MMI_ICON_BAR_SUPPORT__*/

#ifdef __TOPWELL_MMI_IDLE_STYLE_T331_QVGA__
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SIM1,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\SIM1.png",
        "Global sim1 image for Gemini+");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SIM2,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\SIM2.png",
        "Global sim2 image for Gemini+");
#else
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SIM1,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\SIM1.bmp",
        "Global sim1 image for Gemini+");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SIM2,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\SIM2.bmp",
        "Global sim2 image for Gemini+");
#endif
#if (MMI_MAX_SIM_NUM >= 3)     
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SIM3,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\SIM3.bmp",
        "Global sim3 image for Gemini+");
#if (MMI_MAX_SIM_NUM == 4) 
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_SIM4,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\SIM4.bmp",
        "Global sim4 image for Gemini+");
#endif /* (MMI_MAX_SIM_NUM == 4) */
#endif /* (MMI_MAX_SIM_NUM >= 3) */


    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TABBAR_SIM1,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\TAB\\\\Tab_sim1.bmp",
        "Global tabbar sim1 image for Gemini+");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TABBAR_SIM2,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\TAB\\\\Tab_sim2.bmp",
        "Global tabbar sim2 image for Gemini+");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TABBAR_SIM3,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\TAB\\\\Tab_sim3.bmp",
        "Global tabbar sim3 image for Gemini+");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TABBAR_SIM4,
        CUST_IMG_PATH "\\\\MainLCD\\\\UIElement\\\\SIM\\\\TAB\\\\Tab_sim4.bmp",
        "Global tabbar sim4 image for Gemini+");

    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_VIDEO_CALL,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_video_call.png",
        "Video call ToolBar icon");
    ADD_APPLICATION_IMAGE2(
        IMG_GLOBAL_TOOLBAR_VIDEO_CALL_DISABLED,
        CUST_IMG_PATH "\\\\MainLCD\\\\ToolBar\\\\TB_video_call_disabled.png",
        "Video call ToolBar disabled icon");
}
#endif

static int readline(FILE* f, U8 *line, int size)
{
	char c;
	int len = 0;
	
	while (len < size && (c = fgetc(f) ) != EOF && c != '\n')
	{
		line[len] = c;
        ++len;
		line[len] = '\0';
	}
	return len;
}
#ifdef __RESGEN_INTERNAL_3D_META_RESGEN_AUTO__
static void PopulateImage3DData()
{
    FILE * fp = NULL;
    fp = fopen("temp\\mmi_rp_image_populate_with_meta.txt", "r");
    if (fp == NULL)
    {
        return;
    }
	
    U8 line[2048];
    while (!feof(fp) )
    {
        int len = readline(fp, line, 2048);
        if (len != 0)
        {
            char *name = NULL;
            int id = 0;
            int i;
            for (i = 0; i < len; ++i)
            {
                if (line[i] == ' ')
                {
                    name = line + i + 1;
                    line[i] = '\0';
                    sscanf(line, "%d", &id);
                    ADD_APPLICATION_IMAGE2(id, name, "Generated by PopulateImage3DData()");
                    break;
                }
            }
        }
    }
    
}
#endif // __RESGEN_INTERNAL_3D_META_RESGEN_AUTO__

#ifndef __RESGEN_INTERNAL_3D_META_RESGEN_AUTO__
#define RESGEN_3D_RELOC_PY_FILE     "resgen_reloc_handle.py"
#define RESGEN_3D_RELOC_POP_FILE    "temp\\mmi_rp_binary3d_populate.txt"
#else
#define RESGEN_3D_RELOC_PY_FILE     "resgen_reloc_3d_dev_meta_handle.py"
#define RESGEN_3D_RELOC_POP_FILE    "temp\\mmi_rp_binary3d_populate_with_meta.txt"
#endif //__RESGEN_INTERNAL_3D_META_RESGEN_AUTO__

static void PopulateBinary3DData()
{
    FILE * fp = NULL;

    fflush (stdout);
    if(0 != execute_ext_command("..\\..\\..\\" "tools\\python25\\python" " " RESGEN_3D_RELOC_PY_FILE))
    {
        // Use RES_LOG_PENDING_FATAL provided by Resgn log framework 
        // instead of mtk_resgen_set_error
        // mtk_resgen_set_error();
        RESPOP_LOG_E("Error!! 3D resource reloc FAIL: external python script " RESGEN_3D_RELOC_PY_FILE " return error.");
        RES_LOG_PENDING_FATAL(RESPOP_TAG, "Error!! 3D Resource relocation FAIL !!","External python script " RESGEN_3D_RELOC_PY_FILE " return error.","Please check the error message of TAG Py-RESGEN_RELOC_3D_DEV_META_HANDLE in this log file");
        fprintf(stderr, "\n** Error!! External python script " RESGEN_3D_RELOC_PY_FILE " return error. \n** Please check the error message of the TAG Py-RESGEN_RELOC_3D_DEV_META_HANDLE in resgen_mtk_resgenerator_run.log\n");
    }
    fflush (stdout);

    // 3D Binary resource are pushed to offline DB.
    // That can be read by population script (resgen_populate.py) directly
    // There is no need to handle it here now.
    

}


void ResPopImageSlimInit(){
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    int i = 0, j;
    unsigned char a[4];
    char path[] = CUST_IMG_PATH;
    char postfix[] = " 2>> .//debug//3rd_tool.log";
    char cmd[512];

    /* MTK Leo add */
    FILE *OutputImgDataFile = NULL;
    FILE *nfb_img_data_file = NULL;
    FILE *java_img_data_file = NULL;//100206 ENFB support

    /* MTK Leo end */

    //[Image][1] SLIM SUBMENU2 FILE COPY--------------------------------
    fprintf(stderr, "Start copy unzip images use copy_images.bat output 3rd_tool.txt\n");
    sprintf(cmd, "copy_images.bat ");
    j = 16;
    for (i = 0; i < strlen(path); i++)
    {
        if (!(path[i] == '\\' && path[i + 1] == '\\'))
        {
            cmd[j] = path[i];
            j++;
        }
    }
    cmd[j] = '\0';


    sprintf(cmd, "%s%s", cmd, postfix);
    execute_ext_command(cmd);
    //------------------------------------------------------------------
}

void ResPopNFBImageInit(){
    //[Image][2] NFB image population init -----------------------------
    // The output file will be CustNFBProgressImg.h CustNFBProgressImg.c
    int io_result = 0;
    FILE* nfb_img_res_file_local = NULL;
    nfb_img_res_file_local = fopen(NFB_IMAGE_RES_FILENAME, "w");
    RESPOP_LOG_V("ResPopNFBImageInit - start to write CustNFBProgressImg.c");

    if (nfb_img_res_file_local == NULL)
    {
        RESPOP_LOG_E("nfb_img_res_file_local could not open!\n");
    }
    else
    {
        RESPOP_LOG_V("ResPopNFBImageInit - write start pattern of CustNFBProgressImg.c");
        fprintf(nfb_img_res_file_local, "#include \"CustDataRes.h\" \n");
        fprintf(nfb_img_res_file_local, "#include \"CustNFBProgressImg.h\" \n");
        fprintf(nfb_img_res_file_local, "const U8* nfb_progress_images[]={\n");
        fflush(nfb_img_res_file_local);
        // Release nfb_img_res_file_local resource
        io_result = fclose(nfb_img_res_file_local);
        // nfb_img_res_file_local must be reset to NULL
        // Sinece resgen use the value to check if the NFB output file handle is available or not
        nfb_img_res_file_local = NULL;
        if(io_result !=0)
        {
            RESPOP_LOG_E("nfb_img_res_file_local close failed, err code of fcloase = %d", io_result);
        }
    }

    RESPOP_LOG_V("ResPopNFBImageInit -  start to write CustNFBProgressImg.h");
    nfb_img_data_file = fopen(NFB_IMAGE_DATA_FILENAME, "w");
    if (nfb_img_data_file == NULL)
    {
        RESPOP_LOG_E("nfb_img_data_file could not open!");
    }
    else
    {
        RESPOP_LOG_V("ResPopNFBImageInit - write start pattern of CustNFBProgressImg.h");
        fprintf(nfb_img_data_file, "#if ( !defined (__MTK_TARGET__) )\n\t#define __align(x)\n#endif\n");
        fflush(nfb_img_data_file);
        io_result = fclose(nfb_img_data_file);
        nfb_img_data_file = NULL;
        if(io_result !=0)
        {
            RESPOP_LOG_E("nfb_img_data_file close failed, err code of fcloase = %d", io_result);
        }
    }

    //------------------------------------------------------------------
}

void ResPopStringIdListInit(){
    //[String][3] String population init -------------------------------
    // Clean  CustStrList.txt
    StringListFile = fopen(CUS_STR_RES_FILENAME, "wb");
    if (StringListFile == NULL)
    {
        RESPOP_LOG_E("StringListFile could not open!");
    }
    //------------------------------------------------------------------
}


void ResPopImageIdListInit(){
    //[Image][4] Initialize images_file_list.ini -----------------------
    // Clean images_file_list.ini

    /* 091004 MTK Calvin added to reduce populate time */
    OutputImgIDFile = fopen(OUTPUT_IMAGE_ID_FILENAME, "w");
    if (OutputImgIDFile == NULL)
    {
        RESPOP_LOG_E("OutputImgIDFile could not open!");
        exit(2);
    }
    fclose(OutputImgIDFile);

    // Open and write the first line of images_file_list.ini
    OutputImgIDFile = fopen(OUTPUT_IMAGE_ID_FILENAME, "a");
    if (OutputImgIDFile == NULL)
    {
        RESPOP_LOG_E("OutputImgIDFile could not open again!");
    }
    fprintf(OutputImgIDFile, "[Image File List]\n");
    //------------------------------------------------------------------
}

void ResPopMenuIdListInit(){
    //[Menu][5] Initialize CustMenuTree output file---------------------
    // Clean CustMenuTreeID_Out.c		
    OutputMenutreeIDFile = fopen(OUTPUT_MENUTREE_ID_FILENAME, "w");
    if (OutputMenutreeIDFile == NULL)
    {
        RESPOP_LOG_E("OutputMenutreeIDFile could not open!");
    }
    fclose(OutputMenutreeIDFile);

    // Open  CustMenuTreeID_Out.c 
    // Init global veriabal OutputMenutreeIDFile
    OutputMenutreeIDFile = fopen(OUTPUT_MENUTREE_ID_FILENAME, "a");
    if (OutputMenutreeIDFile == NULL)
    {
        RESPOP_LOG_E("OutputMenutreeIDFile could not open again!");
    }
    /* MTK Calvin end */
    //------------------------------------------------------------------
}

void ResPopAudioIdListInit(){
    //[AUDIO][6] Initialize audio_file_list.ini  -----------------------
    // Clean audio_file_list.ini
    /* 101205 audio resource Calvin Satrt */
    OutputAdoIDFile = fopen(OUTPUT_AUDIO_ID_FILENAME, "w");
    if (OutputAdoIDFile == NULL)
    {
        RESPOP_LOG_E("OutputAdoIDFile could not open!");
        exit(2);
    }
    fclose(OutputAdoIDFile);

    // Open audio_file_list.ini
    // Initialize global variable OutputAdoIDFile
    OutputAdoIDFile = fopen(OUTPUT_AUDIO_ID_FILENAME, "a");
    if (OutputAdoIDFile == NULL)
    {
        RESPOP_LOG_E("OutputAdoIDFile could not open again!");
    }
    fprintf(OutputAdoIDFile, "[Audio File List]\n");
    /* 101205 audio resource Calvin End */
    //------------------------------------------------------------------
};


void ResPopBinaryIdListInit(){
    //[Binary][7] Initialize binary_file_list.ini-----------------------
    // Clean binary_file_list.ini
    OutputBinaryIDFile = fopen(OUTPUT_BINARY_ID_FILENAME, "w");
    if (OutputBinaryIDFile == NULL)
    {
        RESPOP_LOG_E("OutputBinaryIDFile could not open!");
        exit(0);
    }
    fclose(OutputBinaryIDFile);

    // Open binary_file_list.init
    // Initialize global variable OutputBinaryIDFile
    OutputBinaryIDFile = fopen(OUTPUT_BINARY_ID_FILENAME, "a");
    if (OutputBinaryIDFile == NULL)
    {
        RESPOP_LOG_E("OutputBinaryIDFile could not open again!");
    }
    fprintf(OutputBinaryIDFile, "[Binary File List]\n");
    //------------------------------------------------------------------
}

void ResPopSharedRepeadIdInit(){
    //[Shared][8] Initialize repeat_id_list.txt ------------------------		
    /* 102604 MTK Calvin added */
    // Clean repeat_id_list.txt
    // Initialize global variable RepeatIDListFile
    RepeatIDListFile = fopen(MMI_RG_REPEAT_ID_FILE, "w");
    if (RepeatIDListFile == NULL)
    {
        RESPOP_LOG_E("RepeatIDListFile could not open!");
        exit(2);
    }
    fclose(RepeatIDListFile);
    // Open repeat_id_list.txt for all resource population functions
    // Initialize global variable RepeatIDListFile
    RepeatIDListFile = fopen(MMI_RG_REPEAT_ID_FILE, "a");
    if (RepeatIDListFile == NULL)
    {
        RESPOP_LOG_E("RepeatIDListFile could not open again!");
        exit(2);
    }
    fprintf(RepeatIDListFile, "StrId\tEnum_Value\t\tString or Image\n");
    /* MTK Calvin end */
    //------------------------------------------------------------------
}

void ResPopFontObjListInit(){
    //[Font][9] Initialize font resource meta files---------------------		
    // Font log files:
    // MMI_RG_VF_OBJ_LIST_FILE				--> "vf_obj.txt"
    // MMI_RG_VF_MODIS_OBJ_LIST_FILE	--> "vf_modis_obj.txt"
    // MMI_RG_VF_TTF_LIST_FILE				--> "ttf_list.txt"

    // Clean vf_obj.txt
    font_data_lis = fopen(MMI_RG_VF_OBJ_LIST_FILE, "w");
    //fprintf(font_data_lis, "COMPOBJS += \n");
    MYFCLOSE(font_data_lis, MMI_RG_VF_OBJ_LIST_FILE);

    // Clean ttf_list.txt
    font_ttf_lis = fopen(MMI_RG_VF_TTF_LIST_FILE, "w");
    MYFCLOSE(font_ttf_lis, MMI_RG_VF_TTF_LIST_FILE);

    // Open ttf_list.txt for font population
    // initialize global variable font_ttf_lis
    font_ttf_lis = fopen(MMI_RG_VF_TTF_LIST_FILE, "a");

    // clean vf_modis_obj.txt
    font_data_lis = fopen(MMI_RG_VF_MODIS_OBJ_LIST_FILE, "w");    
    MYFCLOSE(font_data_lis, MMI_RG_VF_MODIS_OBJ_LIST_FILE);

    // open vf_modis_obj.txt
    // initialize global variable font_data_lis
    font_data_lis = fopen(MMI_RG_VF_OBJ_LIST_FILE, "a");

    // Open vf_obj.txt
    // initialize font_data_modis_lis
    font_data_modis_lis = fopen(MMI_RG_VF_MODIS_OBJ_LIST_FILE, "a");
    RESPOP_LOG_E("[FONT]vf_obj.txt open");
    //------------------------------------------------------------------
}

void ResPopMenuUsageMetaFileInit(){
#if !defined(PRODUCTION_RELEASE)
    //[Menu][10] Open Menu usage meta file (menu_resource_usage.txt)----
    // Open menu_resource_usage.txt
    // Initialize global variable fpMenuResourceUsage
    MYFOPEN(fpMenuResourceUsage, MMI_RG_MENU_USAGE_FILE, "w");
    // Print the title of menu resources
    PRTRESTITLE(fpMenuResourceUsage);
    //------------------------------------------------------------------
#endif //PRODUCTION_RELEASE
}

void ResPopImageUsageMetaFileInit(){
#if !defined(PRODUCTION_RELEASE)
    //[Image][11] Open Image usage meta file (image_resource_usage.txt)-
    // Open image_resource_usage.txt
    // Initialize global variable fpMenuResourceUsage
    MYFOPEN(fpImageResourceUsage, MMI_RG_IMAGE_USAGE_FILE, "w");
    MYFOPEN(fpImageResourceUsageExt, MMI_RG_IMAGE_CONVERTED_INFO_FILE, "w");
    // Print the title of image resources 
    PRTRESTITLE(fpImageResourceUsage);
    //------------------------------------------------------------------
#endif //PRODUCTION_RELEASE
}

void ResPopAudioUsageMetaFileInit(){
#if !defined(PRODUCTION_RELEASE)
    //[Audio][12] Open audio usage meta file (audio_resource_usage.txt)-
    // Open audio_resource_usage.txt
    // Initialize global resource fpAudioResourceUsage
    MYFOPEN(fpAudioResourceUsage, MMI_RG_AUDIO_USAGE_FILE, "w");
    // Print the title of audio resources
    PRTRESTITLE(fpAudioResourceUsage);
    //------------------------------------------------------------------
#endif //PRODUCTION_RELEASE
}

void ResPopStringUsageMetaFileInit(){
#if !defined(PRODUCTION_RELEASE)
    // [String][13] Open string usage meta file (string_resource.txt)
    // Open string_resource_usage.txt
    // Initialize global variable fpStringResourceUsage
    MYFOPEN(fpStringResourceUsage, MMI_RG_STRING_USAGE_FILE, "w");
    // Print the title of string resource
    PRTRESTITLE(fpStringResourceUsage);
    //------------------------------------------------------------------
#endif //PRODUCTION_RELEASE
}

void ResPopSharedPrintResBaseTable(){
    // [Shared][14] Print res based table (resource_base_table.txt)-----
#if !defined(PRODUCTION_RELEASE)
    /* Print resource base mapping table */
    U32 i = 0;
    FILE *fp;

    fp = fopen(MMI_RG_RES_BASE_TABLE_FILE, "w");
    if (fp != NULL)
    {
        fprintf(fp, "min\tmax\tappname\n");
        while (1)
        {
            if (strncmp(g_mmi_resource_base_table[i].appname, "END", 3) == 0)
            {
                break;
            }
            else
            {
                fprintf(fp, "%d\t%d\t%s\n",
                    g_mmi_resource_base_table[i].min,
                    g_mmi_resource_base_table[i].max,
                    g_mmi_resource_base_table[i].appname);
                i++;            
            }
        }
        fclose(fp);
    }

    fprintf(stderr, "output resource_base_table.txt done.\n");
    //------------------------------------------------------------------
#endif //PRODUCTION_RELEASE
}


// Dependendt global variable: java_img_data_file
void ResPopJavaGameDataFileInit(){
    // [Java][14] Clean Java image output file (CustGameDataHW.h)-------
    java_img_data_file = fopen(JAVA_GAME_FILENAME, "w");//100206 ENFB support
    if (java_img_data_file == NULL)
    {
        RESPOP_LOG_E("OutputAdoIDFile could not open!\n");
        exit(2);
    }
    fclose(java_img_data_file);
    //------------------------------------------------------------------
}


void ResPopStringIdListWriteHeader(){
    // [String][15] Initialize variables for string population----------
    unsigned char a[4];
    a[0] = 0xFF;
    a[1] = 0xFE;
    a[2] = 0x4E;
    a[3] = 0x00;

    // Output string list file header (unit code)
    fprintf(StringListFile, a);
    fprintf(StringListFile, "%c", a[3]);
    fwprintf(StringListFile, L"Number Of Languages\t1\r\n");
    fwprintf(StringListFile, L"Enum Value\tID\tDescription\tEnglish\r\n");
    //------------------------------------------------------------------
}

// Splitted from ClearHWIMageFile
void ResPopImageDataFileInit(){
    // [Image][16] Initialize the content of CustImgDataHW.h  ----------
    // Open and write init content of CustImgDataHW.h
    FILE * fp = fopen(OUTPUT_DATA_FILENAME, "w+");
    if (fp)
    {
        fprintf(fp, "#if ( !defined (__MTK_TARGET__) )\n\t#define __align(x)\n#endif\n");
        fclose(fp);
    }

    // Open and write init content of CustImgDataHWExt.h
    /* __CUSTPACK_MULTIBIN Calvin BEGIN */
    fp = fopen(OUTPUT_DATA_FILENAME_EXT, "w+"); /* 040805 CustPack: Calvin added */
    /* __CUSTPACK_MULTIBIN Calvin END */
    if (fp)
    {
        fprintf(fp, "#if ( !defined (__MTK_TARGET__) )\n\t#define __align(x)\n#endif\n");
#ifdef __CAT_SUPPORT__
        fprintf(fp,ResgenCATGetRegionStartStatment(MMIRESOURCE_CAT_RES_TYPE_ID_IMG));
#endif //__CAT_SUPPORT__
        fclose(fp);
    }
    //------------------------------------------------------------------
}

void ResPopAudioDataFileInit(){
    // [Audio][17] Initialize the content of CustAdoDataHW.h -----------
    // Open and write init content of CustAdoDataHW.h
    /* 101205 audio resource Calvin Satrt */
    FILE * fp = fopen(AUDIO_OUTPUT_DATA_FILENAME, "w+");
    if (fp)
    {
        fprintf(fp, "#if ( !defined (__MTK_TARGET__) )\n\t#define __align(x)\n#endif\n");
        fclose(fp);
    }
    // Open and write init content of CustAdoDataHWExt.h
    fp = fopen(AUDIO_OUTPUT_DATA_FILENAME_EXT, "w+");
    if (fp)
    {
        fprintf(fp, "#if ( !defined (__MTK_TARGET__) )\n\t#define __align(x)\n#endif\n");
#ifdef __CAT_SUPPORT__
        fprintf(fp,ResgenCATGetRegionStartStatment(MMIRESOURCE_CAT_RES_TYPE_ID_ADO));
#endif //__CAT_SUPPORT__
        fclose(fp);
    }
    /* 101205 audio resource Calvin End */
    //------------------------------------------------------------------
}

void ResPopFontDataFileInit(){
    // [Font][17] Initialize the content of CustFontDataHW.h ----------
    // Open and write init content of CustFontDataHW.h
    FILE *fp = fopen(FONT_OUTPUT_DATA_FILENAME, "w+");
    if (fp)
    {
        fprintf(fp, "#ifndef __CUSTFONTDATAHW_H__\n#define __CUSTFONTDATAHW_H__\n");
        fprintf(fp, "#if !defined(__MTK_TARGET__)\n    #define __align(x)\n#endif /* !defined(__MTK_TARGET__) */\n");
        fclose(fp);
    }
    //------------------------------------------------------------------
}

void ResPopImageENFBDataFileInit(){
    // [Image][18] Open the CustENFBImgData ----------------------------
    /* 100206 ENFB support Satrt */
#ifdef __MMI_RESOURCE_ENFB_SUPPORT__

    // Open and clean the file CustENFBImgData
    enfb_img_data_file = fopen(ENFB_IMAGE_DATA_FILENAME, "w+");

    if (enfb_img_data_file)
    {
        fclose(enfb_img_data_file);
    }
    // Open custENFBImgData
    // initialize global variable enfb_img_data_file
    enfb_img_data_file = fopen(ENFB_IMAGE_DATA_FILENAME, "ab");
#endif
    /* 100206 ENFB support End */
}

void ResPopFontENFBDataFileInit(){
#ifdef __MMI_FONT_THIRD_ROM_SUPPORT__
    enfb_font_data_file = fopen(ENFB_FONT_DATA_FILENAME, "w+");

    if (enfb_font_data_file)
    {
        fclose(enfb_font_data_file);
    }
    
    enfb_font_data_file = fopen(ENFB_FONT_DATA_FILENAME, "ab");
#endif
}


void ResPopImageCurrIndexInit(){
    // [Image][19] Init global data for image population ---------------
    /* 101205 audio resource Calvin Satrt */
    CurrMaxImageId = 0;
    CurrMaxImageNum = 0;
    /* __CUSTPACK_MULTIBIN Calvin BEGIN */
    CurrMaxImageIdEXT = 0;  /* 040805 CustPack: Calvin added */
    CurrMaxImageNumEXT = 0;
    /* __CUSTPACK_MULTIBIN Calvin END */
    //------------------------------------------------------------------
}

void ResPopFontCurrIndexInit(){ 
    // [Font][19] Init global data for font population -----------------
    CurrMaxFontIdEXT = 0;
    CurrMaxFontNumEXT = 0; 
    //------------------------------------------------------------------
}

void ResPopAudioCurrIndexInit(){ 
    // [Audio][22] Init global data for audio population ---------------
    CurrMaxAudioId = 0;
    CurrMaxAudioNum = 0;
    CurrMaxAudioIdEXT = 0;
    CurrMaxAudioNumEXT = 0;
    //------------------------------------------------------------------
}

void ResPopMenuCurrIndexInit(){
    // [Menu][23] Init global data for Menu population -----------------
    CurrMaxMenuItemIndex = MAX_MENU_ITEMS;
    /* 101205 audio resource Calvin End */
    //------------------------------------------------------------------
}


void ResPopSharedENFBCurrIndexInit(){
    // [Shared][24] Init global data for ENFB population----------------
    /* 101806 E-NFB start */
#ifdef __MMI_RESOURCE_ENFB_SUPPORT__
    CurrMaxENFBAssociatedIDNum = 0;
#endif
    /* 101806 E-NFB end */
    //------------------------------------------------------------------
}

void ResPopStringCurrIndexInit(){
    // [String][25] Init global data for string population--------------
    /* to read from NVRAM if possible -vanita */
    gCurrLangIndex = 0;
    //------------------------------------------------------------------
}


void ResPopMenuParentIdsInit(){
    // [Menu][26] Init global data for font population--------------
    int i = 0;
    memset(nCustMenus, 0, sizeof(CUSTOM_MENU) * MAX_MENU_ITEMS);
    /* init nParentId with an impossible value */
    for (i = 0; i < MAX_MENU_ITEMS; i++)
    {
        nCustMenus[i].nParentId = MAX_MENU_ITEMS;            
    }
    //------------------------------------------------------------------
}

void ResPopStingCompressInit(){
    // [String][27] Init configuration settings for string population---
    /* Resource compression support */
    int i = 0;
    memset(mmi_res_zip_language, 0, sizeof(U8)*(MAX_LANGUAGES+1));

#if defined( __MMI_RESOURCE_STR_COMPRESS__ )
    for(i = 0 ; i <=MAX_LANGUAGES; i++ ){
        mmi_res_zip_language[i] = 1;
    }
#endif //__MMI_RESOURCE_STR_COMPRESS__
    //------------------------------------------------------------------
}

void ResPopMenuHandlersInit(){
    // [Menu][28] Init global variables for Hint handler population ----		
    /* Menuitem reduce memory, move registe hilite handlers to resgen */
    memset(nMenuHiliteHandlers, 0, sizeof(RESGEN_MENU_HILITE_HANDLER) * MAX_MENU_ITEMS);
    memset(nMenuHintHandlers, 0, sizeof(RESGEN_MENU_HINT_HANDLER) * MAX_MENU_ITEMS);    
    //------------------------------------------------------------------
}

void ResPopImageIdMapInit(){
    // [Image][29] Init global variables for image population -----------		
    int i = 0;
    fprintf(stderr, "Populate Resource 0%%\n");
    // initialize ImageIdMap and ImageIdMapEXT
    for (i = 0; i < MAX_IMAGE_IDS_SIZE; i++)
    {
        ImageIdMap[i].nImageNum = -1;
        /* __CUSTPACK_MULTIBIN Calvin BEGIN */
        ImageIdMapEXT[i].nImageNum = -1;    /* 040805 CustPack: Calvin added */
        /* __CUSTPACK_MULTIBIN Calvin END */
    }
}

void ResPopFontIdMapInit(){
    // [Font][30] Init global variables for font population -----------
    // initialize FontIdMapEXT	
    int i = 0;
    for (i = 0; i < MAX_FONT_IDS_SIZE; i++)
    {
        FontIdMapEXT[i].nFontNum = -1;    /* LangPack */
    }
    //------------------------------------------------------------------
}

void ResPopAudioIdMapInit(){
    // [Audio][31] Init global variables for Audio population ----------		   
    /* 101205 audio resource Calvin Satrt */
    // init AudioIdMap and AudioIdMapEXT
    int i =0;
    for (i = 0; i < MAX_AUDIO_IDS_SIZE; i++)
    {
        AudioIdMap[i].nAudioNum = -1;
        AudioIdMapEXT[i].nAudioNum = -1;
    }
    /* 101205 audio resource Calvin End */
    //------------------------------------------------------------------
}

void ResPopInitAll(){
    //[Image][0] SLIM SUBMENU2 FILE COPY
    ResPopImageSlimInit();

    //[Image][1] NFB image population init -----------------------------
    ResPopNFBImageInit();

    //[String][2] String population init -------------------------------
    ResPopStringIdListInit();

    //[Image][3] Initialize images_file_list.ini -----------------------
    ResPopImageIdListInit();

    //[Menu][4] Initialize CustMenuTree output file---------------------
    ResPopMenuIdListInit();

    //[AUDIO][5] Initialize audio_file_list.ini  -----------------------
    ResPopAudioIdListInit();

    //[Binary][6] Initialize binary_file_list.ini-----------------------
    ResPopBinaryIdListInit();

    //[Shared][7] Initialize repeat_id_list.txt ------------------------		
    ResPopSharedRepeadIdInit();

    //[Font][8] Initialize font resource meta files---------------------		
    ResPopFontObjListInit();

    //[Menu][9] Open Menu usage meta file (menu_resource_usage.txt)----
    ResPopMenuUsageMetaFileInit();

    //[Image][10] Open Image usage meta file (image_resource_usage.txt)-
    ResPopImageUsageMetaFileInit();

    //[Audio][11] Open audio usage meta file (audio_resource_usage.txt)-
    ResPopAudioUsageMetaFileInit();

    // [String][12] Open string usage meta file (string_resource.txt)
    ResPopStringUsageMetaFileInit();

    // [Shared][13] Print res based table (resource_base_table.txt)-----
    ResPopSharedPrintResBaseTable();

    // [Java][14] Clean Java image output file (CustGameDataHW.h)-------
    ResPopJavaGameDataFileInit();

    // [String][15] Initialize variables for string population----------
    ResPopStringIdListWriteHeader();

    // [Image][16] Initialize the content of CustImgDataHW.h  ----------
    ResPopImageDataFileInit();

    // [Audio][17] Initialize the content of CustAdoDataHW.h -----------
    ResPopAudioDataFileInit();

    // [Font][18] Initialize the content of CustFontDataHW.h ----------
    ResPopFontDataFileInit();

    // [Image][19] Open the CustENFBImgData ----------------------------	
    ResPopImageENFBDataFileInit();

    ResPopFontENFBDataFileInit();

#ifndef __POPULATE_ENGINE_
    SendMessage(hWnd, WM_CLEARFILES, (WPARAM) 0, (LPARAM) 0);
#endif

    // [Image][20] Init global data for image population ---------------
    ResPopImageCurrIndexInit();

    // [Font][21] Init global data for font population -----------------
    ResPopFontCurrIndexInit();

    // [Audio][22] Init global data for audio population ---------------
    ResPopAudioCurrIndexInit();

    // [Menu][23] Init global data for Menu population -----------------
    ResPopMenuCurrIndexInit();

    // [Shared][24] Init global data for ENFB population---------------- 
    ResPopSharedENFBCurrIndexInit();

    // [String][25] Init global data for string population--------------
    ResPopStringCurrIndexInit();

    // [Menu][26] Init global data for font population--------------	
    ResPopMenuParentIdsInit();

    // [String][27] Init configuration settings for string population---
    ResPopStingCompressInit();

    // [Menu][28] Init global variables for Hint handler population ----		
    ResPopMenuHandlersInit();

    // [Image][29] Init global variables for image population -----------		 
    ResPopImageIdMapInit();

    // [Font][30] Init global variables for font population -----------
    ResPopFontIdMapInit();

    // [Audio][31] Init global variables for Audio population ----------           
    ResPopAudioIdMapInit();

    // [Shared][32] Populat default resources --------------------------
    ResPopSharedDefaultResourceInit();

}

void ResPopImageBinaryExecPostActions(){
    // [Image][Binary][34] Executed posted image/binary population -----		   
    // res img post processing
    FILE * extImgFp = NULL;
    RESPOP_LOG_V("ResPopImageBinaryExecPostActions: Start post image/binary population");
    fflush(stdout);
    ProcessResgenPngImages();
    RESPOP_LOG_V("ResPopImageBinaryExecPostActions: Fininished post image/binary population");
    fflush(stdout);
    extImgFp = fopen(OUTPUT_DATA_FILENAME_EXT, "a"); /* 040805 CustPack: Calvin added */
    if (extImgFp != NULL)
    {
    	
#ifdef __CAT_SUPPORT__
        fprintf(extImgFp,ResgenCATGetRegionEndStatment());
#endif // __CAT_SUPPORT__
        fclose(extImgFp);
    }
    // -----------------------------------------------------------------
}

void ResPopNFBImageDeinit(){
    // [Image][35] Deinit NFB imgage data file output ------------------		   
    // The output file is CustNFBProgressImg.c
    int io_result = 0;
    FILE* nfb_img_res_file_local = NULL;  // Use stack variable instaed of original gloabl variable design

    RESPOP_LOG_V("ResPopNFBImageDeinit - finishing CustNFBProgressImg.c output ...");

    // Open NFB output file 
    RESPOP_LOG_V("ResPopNFBImageDeinit - Open file: %s ", NFB_IMAGE_RES_FILENAME);
    fflush(stdout);
    nfb_img_res_file_local = fopen(NFB_IMAGE_RES_FILENAME, "a");

    // Show File desciptor value in output
    RESPOP_LOG_V("ResPopNFBImageDeinit - File descriptor of %s: 0x%x", NFB_IMAGE_RES_FILENAME, nfb_img_res_file_local);
    fflush(stdout);

    if (nfb_img_res_file_local != NULL)
    {
        extern MMI_BOOL g_mmi_res_nfb_used;

        if (g_mmi_res_nfb_used == FALSE)
        {
            RESPOP_LOG_V("ResPopNFBImageDeinit - No nfb resource declared, output NULL to resource array");
            fprintf(nfb_img_res_file_local, "NULL\n");
        }
		
        io_result = fprintf(nfb_img_res_file_local, "\n};\n");
        RESPOP_LOG_V("Write the end pattern of CustNFBProgressImg.c");
        fflush(stdout);

        if(io_result < 0)
        {
            RESPOP_LOG_E("Writting the end pattern of CustNFBProgressImg.c is failed");
            fflush(stdout);
        }

        RESPOP_LOG_V("ResPopNFBImageDeinit - Close file: %s, File descriptor: 0x%x", NFB_IMAGE_RES_FILENAME, nfb_img_res_file_local);
        fflush(stdout);
        fflush(nfb_img_res_file_local);		
        fclose(nfb_img_res_file_local);
    }else{
        RESPOP_LOG_E("FD of CustNFBProgressImg.c (nfb_img_res_file_local) can't be NULL!!");
        fflush(nfb_img_res_file_local);	
    }
    // -----------------------------------------------------------------
}

void ResPopStringIdListDeinit(){
    // [String][36] Finihsed String list file output(CustStrList.txt)---
    /*  for generate string list file in first pass */
    fwprintf(StringListFile, L"##number\t%d\r\n", CurrMaxStringId);
    fclose(StringListFile);
    // -----------------------------------------------------------------
}

void ResPopImageIdListDeinit(){
    // [Image][37] Deinit images_file_list.ini output-------------------
    /* 091004 MTK Calvin added to reduce populate time */
    fclose(OutputImgIDFile);
    // -----------------------------------------------------------------
}

void ResPopAudioIdListDeinit(){
    // [Audio][38] Deinit audio_file_list.ini output-------------------
    /* 101205 audio resource Calvin Satrt */
    fclose(OutputAdoIDFile);
    /* 101205 audio resource Calvin End */
    // -----------------------------------------------------------------
}


void ResPopBinaryIdListDeinit(){
    // [Binary][39] Deinit binary_file_list.ini output------------------
    fclose(OutputBinaryIDFile);
    // -----------------------------------------------------------------
}

void ResPopMenuUsageMetaFileDeinit(){
#if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE)
    // [Menu][40] Deinit menu_resource_usage.txt output-----------------
    MYFCLOSE(fpMenuResourceUsage, MMI_RG_MENU_USAGE_FILE);
    // -----------------------------------------------------------------
#endif // _POPULATE_RES_C && PRODUCTION_RELEASE
}

void ResPopImageUsageMetaFileDeinit(){
#if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE)
    // [Image][41] Deinit image_resource_usage.txt output---------------   
    MYFCLOSE(fpImageResourceUsage, MMI_RG_IMAGE_USAGE_FILE);
    MYFCLOSE(fpImageResourceUsageExt, MMI_RG_IMAGE_CONVERTED_INFO_FILE);
    // -----------------------------------------------------------------
#endif // _POPULATE_RES_C && PRODUCTION_RELEASE
}

void ResPopAudioUsageMetaFileDeinit(){
#if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE)
    // [Audio][42] Deinit audio_resource_usage.txt output--------------- 
    MYFCLOSE(fpAudioResourceUsage, MMI_RG_AUDIO_USAGE_FILE);
    // -----------------------------------------------------------------
#endif // _POPULATE_RES_C && PRODUCTION_RELEASE
}


void ResPopStringUsageMetaFileDeinit(){
#if defined(_POPULATE_RES_C) && !defined(PRODUCTION_RELEASE)
    // [String][43] Deinit string_resource_usage.txt output------------- 
    MYFCLOSE(fpStringResourceUsage, MMI_RG_STRING_USAGE_FILE);
    // -----------------------------------------------------------------
#endif // _POPULATE_RES_C && PRODUCTION_RELEASE
}

void ResPopMenuIdListDeinit(){
    // [Menu][44] Deinit CustMenuTreeID_Out.c output ------------------- 
    if(OutputMenutreeIDFile != NULL) fclose(OutputMenutreeIDFile);
    // -----------------------------------------------------------------
}

void ResPopSharedRepeadIdListDeinit(){
    // [Shared][45] Deinit repeat_id_list.txt output--------------------
    if(RepeatIDListFile != NULL) fclose(RepeatIDListFile);   /* 102604 MTK Calvin added */
    /* MTK Calvin end */
    // -----------------------------------------------------------------
}

void ResPopAudioDeinit(){
    // [Audio][34] Deinit CustAdoDataHwExt.h output------------------------
    FILE * extAudioFp = NULL;
    extAudioFp = fopen(AUDIO_OUTPUT_DATA_FILENAME_EXT, "a");
    if (extAudioFp != NULL)
    {
#ifdef __CAT_SUPPORT__
        fprintf(extAudioFp,ResgenCATGetRegionEndStatment());
#endif //__CAT_SUPPORT__
        fclose(extAudioFp);
    }
    // -----------------------------------------------------------------
}


void ResPopImageENFBDataFileDeinit(){
    // [Image][46] Deinit CustENFBImgData output------------------------
#ifdef __MMI_RESOURCE_ENFB_SUPPORT__
    if(enfb_img_data_file != NULL) fclose(enfb_img_data_file);//100206 ENFB support
#endif
}

void ResPopFontENFBDataFileDeinit(){
#ifdef __MMI_FONT_THIRD_ROM_SUPPORT__
    if(enfb_font_data_file != NULL) fclose(enfb_font_data_file);
#endif
}

void ResPopFontObjListDeInit(){
    // [Font][47] Deinit Font obj list output -------------------------- 
    MYFCLOSE(font_data_lis, MMI_RG_VF_OBJ_LIST_FILE);
    MYFCLOSE(font_data_modis_lis, MMI_RG_VF_MODIS_OBJ_LIST_FILE);
    MYFCLOSE(font_ttf_lis, MMI_RG_VF_TTF_LIST_FILE);
    fprintf(stderr, "Populate Resource 100%%\n");
    RESPOP_LOG_V("[FONT]font_data_lis close ");
    // -----------------------------------------------------------------
}
void ResPopFontDataFileDeInit(){
	// [Font]Deinit CustFontDataHW.h output --------------------------
	FILE *fp = fopen(FONT_OUTPUT_DATA_FILENAME, "a");
    if (fp)
    {
        fprintf(fp, "\n#define POP_FONT_FILES %d\n\n",CurrMaxFontNumEXT);
        fprintf(fp, "#endif /* __CUSTFONTDATAHW_H__ */\n");
        fclose(fp);
    }
	
	RESPOP_LOG_V("[FONT]CustFontDataHW.h deinit");
}

void ResPopDeinitAll(){
    // [Image][Binary][34] Executed posted image/binary population -----		   
    ResPopImageBinaryExecPostActions();

    // [Audio][34] Deinit CustAdoDataHwExt.h output------------------------
    ResPopAudioDeinit();

    // [Image][35] Deinit NFB imgage data file output ------------------		   
    ResPopNFBImageDeinit();

    // [String][36] Finihsed String list file output(CustStrList.txt)---
    ResPopStringIdListDeinit();

    // [Image][37] Deinit images_file_list.ini output-------------------
    ResPopImageIdListDeinit();

    // [Audio][38] Deinit audio_file_list.ini output-------------------
    ResPopAudioIdListDeinit();

    // [Binary][39] Deinit binary_file_list.ini output------------------
    ResPopBinaryIdListDeinit();

    // [Menu][40] Deinit menu_resource_usage.txt output-----------------
    ResPopMenuUsageMetaFileDeinit();

    // [Image][41] Deinit image_resource_usage.txt output---------------   
    ResPopImageUsageMetaFileDeinit();

    // [Audio][42] Deinit audio_resource_usage.txt output--------------- 
    ResPopAudioUsageMetaFileDeinit();

    // [String][43] Deinit string_resource_usage.txt output------------- 
    ResPopStringUsageMetaFileDeinit();

    // [Menu][44] Deinit CustMenuTreeID_Out.c output ------------------- 
    ResPopMenuIdListDeinit();

    // [Shared][45] Deinit repeat_id_list.txt output -------------------
    ResPopSharedRepeadIdListDeinit();

    // [Image][46] Deinit CustENFBImgData output------------------------
    ResPopImageENFBDataFileDeinit();

    // [Font][47] Deinit Font obj list output -------------------------- 
    ResPopFontObjListDeInit();	
    
    // [Font]Deinit CustFontDataHW.h output --------------------------
    ResPopFontDataFileDeInit();		

    ResPopFontENFBDataFileDeinit();
}

#else /* DEVELOPER_BUILD_FIRST_PASS */ 


#include "mmi_frm_gprot.h"

#if defined(__MMI_RESOURCE_STR_LZMA_COMPRESS__)
    #include "CompressResUtil.h"
#endif //__MMI_RESOURCE_STR_LZMA_COMPRESS__

#ifdef __MMI_RESOURCE_IMAGE_GROUP_COMPRESS__
    #include "ResCacheUtil.h"
#endif //__MMI_IMAGE_GROUP_COMPRESS__
#if defined(__MMI_RESOURCE_STR_ZLIB_COMPRESS__) || defined(__MMI_RESOURCE_AUDIO_COMPRESS__) || defined(__MMI_FONT_COMPRESSION__) || defined(__MMI_RESOURCE_IMAGE_COMPRESS__) || defined(__DSP_COMPRESS__)


#include "simple_memory_manager.h"
#include "drv_gfx_stack_switch_manager.h"
#include "app_zlib.h"
#include "init_memory_stack.h"
#include "App_mem_med.h"

#define RESORCE_DECOMPRESS_WORKING_BUFFER_SIZE     (100 * 1024)
static STSMM _resource_decompress_smm;


static void *mmi_res_unzip_malloc(void *opaque, unsigned int items, unsigned int size)
{
    unsigned int total_bytes;
    void *buffer_ptr = NULL;
    
    if (opaque)
    {
        items += size - size;   /// make compiler happy
    }
    total_bytes = items * size;
    
    buffer_ptr = smmMallocAligned(&_resource_decompress_smm, total_bytes, 4);

    ASSERT(buffer_ptr != NULL);

    return buffer_ptr;

}



static void mmi_res_unzip_free(void *opaque, void *address)
{
    return;
}




S32 mmi_res_decompress(U8 *dest, U32 destLen, const U8 *source, U32 sourceLen, void *pool_addr)
{
    S32 ret;
    U32 decpz_data_size = destLen;
    U32 size;

    ASSERT(pool_addr != NULL);

    smmInit(&_resource_decompress_smm, pool_addr, RESORCE_DECOMPRESS_WORKING_BUFFER_SIZE);
        
#if defined(__MTK_TARGET__)
        {
            /// try to switch stack for better performance
            kal_uint32 stack_size = JPEG_STACK_SIZE;
            void *stack_ptr = drv_gfx_stkmgr_get_stack(stack_size);
            
            if (stack_ptr)
            {
                ret = INT_SwitchStackToRun(stack_ptr, stack_size, (kal_func_ptr)uncompress_mtk, 6,
                    dest, (uLongf*)&decpz_data_size,
                    source, sourceLen, 
                    mmi_res_unzip_malloc, mmi_res_unzip_free);
                
                drv_gfx_stkmgr_release_stack(stack_ptr);
            }
            else
            {
                ret = uncompress_mtk(dest, (uLongf*)&decpz_data_size, source, sourceLen, 
                    mmi_res_unzip_malloc, mmi_res_unzip_free);
            }
        }
#else
        ret = uncompress_mtk(dest, (uLongf*)&decpz_data_size, source, sourceLen, 
                    mmi_res_unzip_malloc, mmi_res_unzip_free);
#endif
            
        ASSERT(0 == ret);
        ASSERT(decpz_data_size == destLen);

        return 0;
}

#endif /* __MMI_RESOURCE_STR_ZLIB_COMPRESS__ || __MMI_RESOURCE_AUDIO_COMPRESS__ || __MMI_FONT_COMPRESSION__ || __MMI_RESOURCE_IMAGE_COMPRESS__ || __DSP_COMPRESS__ */


#ifdef __MMI_RESOURCE_AUDIO_COMPRESS__
extern const unsigned short mmi_res_zip_aud_count;
extern const res_compress_list_struct mmi_res_zip_aud_struct[];
#endif /* __MMI_RESOURCE_AUDIO_COMPRESS__ */


#ifdef __MMI_RESOURCE_IMAGE_COMPRESS__
extern const unsigned short mmi_res_zip_img_count;
extern const res_compress_list_struct mmi_res_zip_img_struct[];
#endif /* __MMI_RESOURCE_IMAGE_COMPRESS__ */



/***************************************************************************** 
*
* Not FIRST_PASS, for MMI to get global resource info
*
*****************************************************************************/
U16 CurrMaxStringNum;
U32 CurrTotalStrLen;
U16 CurrMaxStringId;
U16 CurrMaxStringIdSearch;
U16 gCurrLangIndex;

MMI_BOOL g_is16bit;
#ifndef __MMI_RESOURCE_ENFB_SUPPORT__
MMI_BOOL g_isf16bit; /* fixed string 16bit flag */
#endif /* __MMI_RESOURCE_ENFB_SUPPORT__ */

static MMI_BOOL mmi_res_is_inited = MMI_FALSE;

const CUSTOM_STRING *gpStringRes;
const CUSTOM_STRING_MAP *gpStringMapRes;
const CUSTOM_STRING_MAP_16 *gpStringMapRes16;
const CUSTOM_STRMAP_SEARCH *gpStrMapSearch;
extern StringResList *gStringList;

#ifndef __MMI_RESOURCE_ENFB_SUPPORT__
const CUSTOM_STRING *gpStringResDup;
U32 gMaxNonDupStrOffset;
extern U16 gMaxDeployedLangs;

/* fixed string */
const CUSTOM_STRING *gpFixedStringRes;
const CUSTOM_STRING_MAP *gpFixedStringMapRes;
const CUSTOM_STRING_MAP_16 *gpFixedStringMapRes16;
U16 CurrFixedMaxStringNum;
U16 CurrFixedMaxStringId;
#endif /* __MMI_RESOURCE_ENFB_SUPPORT__ */

/*****************************************************************************
 * FUNCTION
 *  PopulateResGetBaseIDTable
 * DESCRIPTION
 *  Dummy function to make ARM linker happy such that developers can access
 *  g_mmi_resource_base_table in Trace32/VC++ even though the variable is not used
 *  in other places.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void *PopulateResGetBaseIDTable(void)
{
#if !defined(PRODUCTION_RELEASE)
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return (void*)g_mmi_resource_base_table;
#else /* !defined(PRODUCTION_RELEASE) */ 
    return NULL;
#endif /* !defined(PRODUCTION_RELEASE) */ 
}

#ifdef __MMI_FONT_COMPRESSION__
#include "fontres.h"
extern mmi_font_compress_info *gFontZipInfo;
//extern const mmi_font_compress_info mtk_internal_font_compress_info[];
#endif /* __MMI_FONT_COMPRESSION__ */

#if defined(__MMI_RESOURCE_STR_THIRD_ROM__) || defined(__MMI_RESOURCE_STR_LZMA_COMPRESS__)
extern void mmi_res_load_string_data(S8 gCurrLangIndex);
#endif //__MMI_RESOURCE_STR_THIRD_ROM__ || __MMI_RESOURCE_STR_LZMA_COMPRESS__

/*****************************************************************************
 * FUNCTION
 *  PopulateResData
 * DESCRIPTION
 *  Populate Resource, assign resource info to global variable
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void PopulateResData(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
#if defined(__MMI_RESOURCE_STR_ZLIB_COMPRESS__) || defined(__MMI_FONT_COMPRESSION__) || defined(__MMI_RESOURCE_AUDIO_COMPRESS__) || defined(__MMI_RESOURCE_IMAGE_COMPRESS__) || defined(__MMI_RESOURCE_STR_LZMA_COMPRESS__)
    S32 i;
    U32 tick_time = 0;
#endif

#if defined(__MMI_RESOURCE_STR_ZLIB_COMPRESS__) || defined(__MMI_FONT_COMPRESSION__) || defined(__MMI_RESOURCE_AUDIO_COMPRESS__) || defined(__MMI_RESOURCE_IMAGE_COMPRESS__) 
    U32 size = RESORCE_DECOMPRESS_WORKING_BUFFER_SIZE;
#endif

    U32 tick_start = 0;
    void *buff_pool = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (mmi_res_is_inited)
        return;
#if defined(__MMI_RESOURCE_STR_ZLIB_COMPRESS__) || defined(__MMI_FONT_COMPRESSION__) || defined(__MMI_RESOURCE_AUDIO_COMPRESS__) || defined(__MMI_RESOURCE_IMAGE_COMPRESS__)
    buff_pool = (void*)applib_asm_alloc_anonymous(size);
#endif
    
    mmi_res_dynamic_str_init();

    mmi_res_hide_dim_menu_init();

    kal_get_time(&tick_start);
    MMI_TRACE(MMI_FW_TRC_G2_GUI, MMI_RESGEN_ZIP_TIME_CHECK, 0, tick_start, tick_start* 4.615);


#if defined(__MMI_RESOURCE_STR_THIRD_ROM__) || defined(__MMI_RESOURCE_STR_LZMA_COMPRESS__)
    mmi_res_load_string_data(0);
#endif /* __MMI_RESOURCE_STR_LZMA_COMPRESS__ */

#ifdef __MMI_RESOURCE_STR_ZLIB_COMPRESS__
    kal_get_time(&tick_time);
    MMI_TRACE(MMI_FW_TRC_G2_GUI, MMI_RESGEN_ZIP_TIME_CHECK, 1, tick_time, (tick_time - tick_start)* 4.615);
    i = 0; /* decompress default language, 'gCurrLangIndex = 0;' */
    if (gStringList[i].pStringResZip != NULL)
    {
        mmi_res_decompress((U8*)gStringList[i].pStringRes, gStringList[i].nResSize, (U8*)gStringList[i].pStringResZip, gStringList[i].nResZipSize, buff_pool);
        mmi_res_decompress((U8*)gStringList[i].pStringMap, gStringList[i].nMapSize, (U8*)gStringList[i].pStringMapZip, gStringList[i].nMapZipSize, buff_pool);
    }    
    i = gMaxDeployedLangs; /* decompress duplicate language */
    if (gStringList[i].pStringResZip != NULL)
    {
        mmi_res_decompress((U8*)gStringList[i].pStringRes, gStringList[i].nResSize, (U8*)gStringList[i].pStringResZip, gStringList[i].nResZipSize, buff_pool);
    }
    if(gStringList[i + 1].pStringResZip != NULL)
    {
        mmi_res_decompress((U8*)gStringList[i + 1].pStringRes, gStringList[i + 1].nResSize, (U8*)gStringList[i + 1].pStringResZip, gStringList[i + 1].nResZipSize, buff_pool);
        mmi_res_decompress((U8*)gStringList[i + 1].pStringMap, gStringList[i + 1].nMapSize, (U8*)gStringList[i + 1].pStringMapZip, gStringList[i + 1].nMapZipSize, buff_pool);
    }

    kal_get_time(&tick_time);
    MMI_TRACE(MMI_FW_TRC_G2_GUI, MMI_RESGEN_ZIP_TIME_CHECK, 1, tick_time, (tick_time - tick_start)* 4.615);
#endif /*__MMI_RESOURCE_STR_ZLIB_COMPRESS__*/

#ifdef __MMI_FONT_COMPRESSION__
    /* Font uncompress */
    for (i = 0; ; i++)
    {
        if (gFontZipInfo[i].org_data_ptr == NULL)
        {
            break;
        }

        mmi_res_decompress(gFontZipInfo[i].org_data_ptr, gFontZipInfo[i].org_data_size, gFontZipInfo[i].zip_data_ptr, gFontZipInfo[i].zip_data_size, buff_pool);
    }
    kal_get_time(&tick_time);
    MMI_TRACE(MMI_FW_TRC_G2_GUI, MMI_RESGEN_ZIP_TIME_CHECK, 4, tick_time, (tick_time - tick_start)* 4.615);
  /*      
    for (i = 0; ; i++)
    {
        if (mtk_internal_font_compress_info[i].org_data_ptr == NULL)
        {
            break;
        }
        
        mmi_res_decompress(mtk_internal_font_compress_info[i].org_data_ptr, mtk_internal_font_compress_info[i].org_data_size, mtk_internal_font_compress_info[i].zip_data_ptr, mtk_internal_font_compress_info[i].zip_data_size, buff_pool);
    }
*/
    kal_get_time(&tick_time);
    MMI_TRACE(MMI_FW_TRC_G2_GUI, MMI_RESGEN_ZIP_TIME_CHECK, 5, tick_time, (tick_time - tick_start)* 4.615);
        
#endif /* __MMI_FONT_COMPRESSION__ */

#ifdef __MMI_RESOURCE_AUDIO_COMPRESS__
    
    for(i=0; i< mmi_res_zip_aud_count; i++)
    {
        mmi_res_decompress(
            mmi_res_zip_aud_struct[i].zi_name, 
            mmi_res_zip_aud_struct[i].zi_len, 
            mmi_res_zip_aud_struct[i].ro_name, 
            mmi_res_zip_aud_struct[i].ro_len,
            buff_pool);
    }
    kal_get_time(&tick_time);
    MMI_TRACE(MMI_FW_TRC_G2_GUI, MMI_RESGEN_ZIP_TIME_CHECK, 2, tick_time, (tick_time - tick_start)* 4.615);
        
#endif /*__MMI_RESOURCE_AUDIO_COMPRESS__*/

#ifdef __MMI_RESOURCE_IMAGE_COMPRESS__

    for(i=0; i< mmi_res_zip_img_count; i++)
    {
        mmi_res_decompress(
            mmi_res_zip_img_struct[i].zi_name, 
            mmi_res_zip_img_struct[i].zi_len, 
            mmi_res_zip_img_struct[i].ro_name, 
            mmi_res_zip_img_struct[i].ro_len,
            buff_pool);
    }
    kal_get_time(&tick_time);
    MMI_TRACE(MMI_FW_TRC_G2_GUI, MMI_RESGEN_ZIP_TIME_CHECK, 3, tick_time, (tick_time - tick_start)* 4.615);
        
#endif /*__MMI_RESOURCE_IMAGE_COMPRESS__*/

    gCurrLangIndex = 0;
    gpStringRes = gStringList[gCurrLangIndex].pStringRes;
#ifndef __MMI_RESOURCE_ENFB_SUPPORT__
    gpStringResDup = gStringList[gMaxDeployedLangs].pStringRes;
    /* check if there are any duplicated strings generated */
    if (gpStringResDup)
    {
        /* on dup case, nTotalStrMap stores the high 16 bits and 
         * nTotalStrMapSearch stores the low 16 bits of max offset within non dup strings
         */
        gMaxNonDupStrOffset = (U32)gStringList[gMaxDeployedLangs].nTotalStrMap;
        gMaxNonDupStrOffset = gMaxNonDupStrOffset << 16;
        gMaxNonDupStrOffset += gStringList[gMaxDeployedLangs].nTotalStrMapSearch;
    }
    else
    {
        /* on non dup case, assign it as max value of U32 type to prevent GetString from accessing gpStringResDup */
        gMaxNonDupStrOffset = 0xFFFFFFFF;
    }

    /* fixed string */
    gpFixedStringRes = gStringList[gMaxDeployedLangs + 1].pStringRes;
    CurrFixedMaxStringNum = gStringList[gMaxDeployedLangs + 1].nTotalStrRes;
    g_isf16bit = gStringList[gMaxDeployedLangs + 1].is16bit;
    if(g_isf16bit)
        gpFixedStringMapRes16 = (CUSTOM_STRING_MAP_16 *)gStringList[gMaxDeployedLangs + 1].pStringMap;
    else
        gpFixedStringMapRes = (CUSTOM_STRING_MAP *)gStringList[gMaxDeployedLangs + 1].pStringMap;
    CurrFixedMaxStringId = gStringList[gMaxDeployedLangs + 1].nTotalStrMap;
#endif /* __MMI_RESOURCE_ENFB_SUPPORT__ */
    g_is16bit = gStringList[gCurrLangIndex].is16bit;
    if (g_is16bit)
        gpStringMapRes16 = (CUSTOM_STRING_MAP_16 *)gStringList[gCurrLangIndex].pStringMap;
    else
        gpStringMapRes = (CUSTOM_STRING_MAP *)gStringList[gCurrLangIndex].pStringMap;
    gpStrMapSearch = gStringList[gCurrLangIndex].pStrMapSearch;
    CurrMaxStringNum = gStringList[gCurrLangIndex].nTotalStrRes;
    CurrMaxStringId = gStringList[gCurrLangIndex].nTotalStrMap;
    CurrMaxStringIdSearch = gStringList[gCurrLangIndex].nTotalStrMapSearch;

#if defined(__MMI_RESOURCE_STR_ZLIB_COMPRESS__) || defined(__MMI_FONT_COMPRESSION__) || defined(__MMI_RESOURCE_AUDIO_COMPRESS__) || defined(__MMI_RESOURCE_IMAGE_COMPRESS__)   
    applib_asm_free_anonymous(buff_pool);
#endif

    mmi_res_is_inited = MMI_TRUE;
    return;
}

#endif /* DEVELOPER_BUILD_FIRST_PASS */