home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / cdrom / compactplayer / source / compactplayer_cat.c < prev    next >
C/C++ Source or Header  |  1995-12-28  |  4KB  |  102 lines

  1. /****************************************************************
  2.    This file was created automatically by `FlexCat 1.5'
  3.    from "CompactPlayer.cd".
  4.  
  5.    Do NOT edit by hand!
  6. ****************************************************************/
  7.  
  8. #if defined(__SASC)  ||  defined(_DCC)
  9. #include <proto/locale.h>
  10. #elif defined(__GNUC__)
  11. #include <inline/locale.h>
  12. #else
  13. #include <clib/locale_protos.h>
  14. #endif
  15.  
  16.  
  17.  
  18.  
  19. static LONG CompactPlayer_Version = 0;
  20. static const STRPTR CompactPlayer_BuiltInLanguage = (STRPTR) "english";
  21.  
  22. struct FC_Type
  23. {   LONG   ID;
  24.     STRPTR Str;
  25. };
  26.  
  27.  
  28. const struct FC_Type _CDPANEL_FAIL = { 0, "Failed to create custom gadget class" };
  29. const struct FC_Type _TIMER_FAIL = { 1, "Can't initialize timer" };
  30. const struct FC_Type _DEVICE_FAIL = { 2, "Device %s/%ld is not a CD-ROM" };
  31. const struct FC_Type _TRACK_NUM = { 3, "Track %-2ld" };
  32. const struct FC_Type _UNKNOWN_ARTIST = { 4, "Unknown artist" };
  33. const struct FC_Type _UNKNOWN_TITLE = { 5, "Unknown title" };
  34. const struct FC_Type _ERROR_TITLE = { 6, "CompactPlayer Error" };
  35. const struct FC_Type _ERROR_BUTTON = { 7, "Oops" };
  36. const struct FC_Type _DEVICE_INCOMPATIBLE = { 8, "Device %s is listed as incompatible." };
  37. const struct FC_Type _PLEASE_WAIT = { 9, "Please wait..." };
  38. const struct FC_Type _ERROR = { 10, "« Error »" };
  39. const struct FC_Type _CONFIGURATION = { 11, "Configuration" };
  40. const struct FC_Type _B_USE_THIS = { 12, "_Use this" };
  41. const struct FC_Type _TITLE_COPYRIGHT = { 13, "CompactPlayer Copyright 1995 Osma Ahvenlampi" };
  42. const struct FC_Type _GUI_FAIL = { 14, "Failed to create GUI" };
  43. const struct FC_Type _STR_ARTIST = { 15, "_Artist" };
  44. const struct FC_Type _STR_TITLE = { 16, "_Title" };
  45. const struct FC_Type _SAVE_TITLES = { 17, "_Save titles" };
  46. const struct FC_Type _TITLE_EDITOR = { 18, "Title Editor" };
  47. const struct FC_Type _MENU_PROJECT = { 19, "Project" };
  48. const struct FC_Type _MENU_DEVICE = { 20, "D\000Select device" };
  49. const struct FC_Type _MENU_TITLES = { 21, "E\000Edit titles" };
  50. const struct FC_Type _MENU_ICONIFY = { 22, "I\000Iconify" };
  51. const struct FC_Type _MENU_QUIT = { 23, "Q\000Quit" };
  52. const struct FC_Type _B_TITLES = { 24, "_TITLES" };
  53. const struct FC_Type _B_PROGR = { 25, "_PROGR" };
  54. const struct FC_Type _COMPACTPLAYER = { 26, "CompactPlayer" };
  55. const struct FC_Type _FONTS_FAIL = { 27, "Failed to open fonts" };
  56. const struct FC_Type _SCSI_FAIL = { 28, "Failed to initialize SCSI functions (device %s unit %ld)" };
  57.  
  58.  
  59. static struct Catalog *CompactPlayer_Catalog = NULL;
  60.  
  61. void OpenCompactPlayerCatalog(struct Locale *loc, STRPTR language)
  62. { LONG tag, tagarg;
  63.   extern struct Library *LocaleBase;
  64.   extern void CloseCompactPlayerCatalog(void);
  65.  
  66.   CloseCompactPlayerCatalog(); /* Not needed if the programmer pairs OpenCompactPlayerCatalog
  67.                and CloseCompactPlayerCatalog right, but does no harm.  */
  68.  
  69.   if (LocaleBase != NULL  &&  CompactPlayer_Catalog == NULL)
  70.   { if (language == NULL)
  71.     { tag = TAG_IGNORE;
  72.     }
  73.     else
  74.     { tag = OC_Language;
  75.       tagarg = (LONG) language;
  76.     }
  77.     CompactPlayer_Catalog = OpenCatalog(loc, (STRPTR) "CompactPlayer.catalog",
  78.                 OC_BuiltInLanguage, CompactPlayer_BuiltInLanguage,
  79.                 tag, tagarg,
  80.                 OC_Version, CompactPlayer_Version,
  81.                 TAG_DONE);
  82.   }
  83. }
  84.  
  85. void CloseCompactPlayerCatalog(void)
  86. { if (LocaleBase != NULL)
  87.   { CloseCatalog(CompactPlayer_Catalog);
  88.   }
  89.   CompactPlayer_Catalog = NULL;
  90. }
  91.  
  92. STRPTR GetCompactPlayerString(APTR fcstr)
  93. { STRPTR defaultstr;
  94.   LONG strnum;
  95.  
  96.   strnum = ((struct FC_Type *) fcstr)->ID;
  97.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  98.  
  99.   return(CompactPlayer_Catalog ? GetCatalogStr(CompactPlayer_Catalog, strnum, defaultstr) :
  100.               defaultstr);
  101. }
  102.