home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / internet / freedomc_112 / sourcecode / freeexplorer / freecheck_cat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-10  |  3.9 KB  |  105 lines

  1. /* Prototypes */
  2. #ifdef __GNUC__
  3. #include <proto/locale.h>
  4. #include <proto/dos.h>
  5. #else
  6. #include <proto/locale.h>
  7. #include <clib/dos_protos.h>
  8.  
  9. extern struct Library *LocaleBase;
  10.  
  11. #endif /* __GNUC__ */
  12.  
  13.  
  14.  
  15. static LONG FreedomExplorer_Version = 0;
  16. static const STRPTR FreedomExplorer_BuiltInLanguage = (STRPTR) "english";
  17.  
  18. struct FC_Type
  19. {   LONG   ID;
  20.     char *Str;
  21. };
  22.  
  23. /* Definitions */
  24. const struct FC_Type _MSG_AppDescription = { 0, "Freedom Module for check actual call" };
  25. const struct FC_Type _MSG_AppCopyright = { 1, "Lithium Systems 1998" };
  26. const struct FC_Type _MSG_JanelaPrincipal = { 2, "By SuRRouND 98" };
  27. const struct FC_Type _MSG_MNlabel1Project = { 3, "Project" };
  28. const struct FC_Type _MSG_MNlabel1About = { 4, "About" };
  29. const struct FC_Type _MSG_MNlabel1AboutChar = { 5, "A " };
  30. const struct FC_Type _MSG_MNlabel1AboutMUI = { 6, "About MUI" };
  31. const struct FC_Type _MSG_MNlabel1AboutMUIChar = { 7, "U " };
  32. const struct FC_Type _MSG_MNlabel1BarLabel0 = { 8, "BarLabel0" };
  33. const struct FC_Type _MSG_MNlabel1Iconified = { 9, "Iconified" };
  34. const struct FC_Type _MSG_MNlabel1IconifiedChar = { 10, "I " };
  35. const struct FC_Type _MSG_MNlabel1Exit = { 11, "Exit" };
  36. const struct FC_Type _MSG_MNlabel1ExitChar = { 12, "E " };
  37. const struct FC_Type _MSG_MNlabel1Settings = { 13, "Settings" };
  38. const struct FC_Type _MSG_MNlabel1LoadConfiguration = { 14, "Load Configuration..." };
  39. const struct FC_Type _MSG_MNlabel1LoadConfigurationChar = { 15, "L " };
  40. const struct FC_Type _MSG_LabelPrincipal = { 16, "  Freedom Explore Call V1.01  " };
  41. const struct FC_Type _MSG_LabelConnectTitle = { 17, "Connect" };
  42. const struct FC_Type _MSG_LabelOnlineTitle = { 18, "Online" };
  43. const struct FC_Type _MSG_LabelCostTitle = { 19, "Cost" };
  44. const struct FC_Type _MSG_LabelStatusCallTitle = { 20, "Status" };
  45. const struct FC_Type _MSG_LabelStatusCall = { 21, "\nNot Connected..." };
  46. const struct FC_Type _MSG_BotaoExit = { 22, "_Exit" };
  47. const struct FC_Type _MSG_BotaoIconified = { 23, "_Iconified" };
  48. const struct FC_Type _MSG_BotaoUpdate = { 24, "_Update" };
  49. const struct FC_Type _MSG_JanelaMsg = { 25, "Janela de Mensagens" };
  50. const struct FC_Type _MSG_Msg01 = { 26, "\033cYou have an unregistered version\n\0338Please, send register form!\nRegister is a free e-mail" };
  51. const struct FC_Type _MSG_Msg02 = { 27, "_Ok" };
  52. const struct FC_Type _MSG_Msg03 = { 28, "Freedom Database directory not found! Look Freedom prefs!" };
  53. const struct FC_Type _MSG_Msg04 = { 29, "Not connected...\n\0338You need to connect on web!\033n" };
  54. const struct FC_Type _MSG_Msg05 = { 30, "FreeEventMiami event log not found!\n\0338Read FreeEventMiami Install Guide!\033n" };
  55. const struct FC_Type _MSG_Msg06 = { 31, "---" };
  56. const struct FC_Type _MSG_Msg07 = { 32, "\033cFreedom Call needs Assign!\0338\nInsert in your user-startup [Assign Freedom: Freedom directory] " };
  57. const struct FC_Type _MSG_JanelaAbout = { 33, "About..." };
  58. const struct FC_Type _MSG_AboutBotaoOk = { 34, "_Ok" };
  59.  
  60. extern void CloseAppCatalog(void);
  61.  
  62. static struct Catalog *FreedomExplorer_Catalog = NULL;
  63.  
  64. void OpenAppCatalog(struct Locale *loc, STRPTR language)
  65. {
  66.     LONG tag, tagarg;
  67.  
  68.     CloseAppCatalog(); /* Not needed if the programmer pairs OpenAppCatalog
  69.             and CloseAppCatalog right, but does no harm.  */
  70.  
  71.     if (FreedomExplorer_Catalog == NULL)
  72.     {
  73.         if (language == NULL)
  74.             tag = TAG_IGNORE;
  75.         else
  76.         {
  77.             tag = OC_Language;
  78.             tagarg = (LONG) language;
  79.         }
  80.         FreedomExplorer_Catalog = OpenCatalog(loc, (STRPTR) "FreedomExplorer.catalog",
  81.             OC_BuiltInLanguage,(LONG)FreedomExplorer_BuiltInLanguage,
  82.             tag, tagarg,
  83.             OC_Version, FreedomExplorer_Version,
  84.             TAG_DONE);
  85.     }
  86. }
  87.  
  88. void CloseAppCatalog(void)
  89. {
  90.     CloseCatalog(FreedomExplorer_Catalog);
  91.     FreedomExplorer_Catalog = NULL;
  92. }
  93.  
  94. char * Get_String(APTR fcstr)
  95. {
  96.     char *defaultstr;
  97.     LONG strnum;
  98.  
  99.     strnum = ((struct FC_Type *) fcstr)->ID;
  100.     defaultstr = ((struct FC_Type *) fcstr)->Str;
  101.  
  102.     return(FreedomExplorer_Catalog ? (char *)GetCatalogStr(FreedomExplorer_Catalog, strnum, defaultstr) :
  103.             defaultstr);
  104. }
  105.