home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / Triton / Source / catalogs / triton.h < prev    next >
C/C++ Source or Header  |  1998-05-23  |  5KB  |  193 lines

  1. #ifndef CATALOGS_TRITON_H
  2. #define CATALOGS_TRITON_H
  3.  
  4.  
  5. /****************************************************************************/
  6.  
  7.  
  8. /* This file was created automatically by CatComp.
  9.  * Do NOT edit by hand!
  10.  */
  11.  
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifdef CATCOMP_ARRAY
  18. #undef CATCOMP_NUMBERS
  19. #undef CATCOMP_STRINGS
  20. #define CATCOMP_NUMBERS
  21. #define CATCOMP_STRINGS
  22. #endif
  23.  
  24. #ifdef CATCOMP_BLOCK
  25. #undef CATCOMP_STRINGS
  26. #define CATCOMP_STRINGS
  27. #endif
  28.  
  29.  
  30. /****************************************************************************/
  31.  
  32.  
  33. #ifdef CATCOMP_NUMBERS
  34.  
  35. #define MSG_SYSTEMREQUEST_TITLE 0
  36. #define MSG_ERROR_UNKNOWN 1
  37. #define MSG_ERROR_ALLOCMEM 2
  38. #define MSG_ERROR_OPENWINDOW 3
  39. #define MSG_ERROR_WINDOWTOOBIG 4
  40. #define MSG_ERROR_DRAWINFO 5
  41. #define MSG_ERROR_OPENFONT 6
  42. #define MSG_ERROR_CREATEMSGPORT 7
  43. #define MSG_ERROR_INSTALLOBJECT 8
  44. #define MSG_ERROR_CREATECLASS 9
  45. #define MSG_ERROR_NOLOCKPUBSCREEN 10
  46. #define MSG_ERROR_CREATEMENUS 11
  47. #define MSG_ERROR_GADGETCONTEXT 12
  48.  
  49. #endif /* CATCOMP_NUMBERS */
  50.  
  51.  
  52. /****************************************************************************/
  53.  
  54.  
  55. #ifdef CATCOMP_STRINGS
  56.  
  57. #define MSG_SYSTEMREQUEST_TITLE_STR "System request"
  58. #define MSG_ERROR_UNKNOWN_STR "Triton failed for unknown reason"
  59. #define MSG_ERROR_ALLOCMEM_STR "Can't allocate memory"
  60. #define MSG_ERROR_OPENWINDOW_STR "Can't open window"
  61. #define MSG_ERROR_WINDOWTOOBIG_STR "The window would become too big (even with fallback)"
  62. #define MSG_ERROR_DRAWINFO_STR "Can't get the screen's DrawInfo"
  63. #define MSG_ERROR_OPENFONT_STR "Can't open font"
  64. #define MSG_ERROR_CREATEMSGPORT_STR "Can't create message port"
  65. #define MSG_ERROR_INSTALLOBJECT_STR "Can't install object"
  66. #define MSG_ERROR_CREATECLASS_STR "Can't create class"
  67. #define MSG_ERROR_NOLOCKPUBSCREEN_STR "Can't lock public screen"
  68. #define MSG_ERROR_CREATEMENUS_STR "Can't create menus"
  69. #define MSG_ERROR_GADGETCONTEXT_STR "Can't create gadget context"
  70.  
  71. #endif /* CATCOMP_STRINGS */
  72.  
  73.  
  74. /****************************************************************************/
  75.  
  76.  
  77. #ifdef CATCOMP_ARRAY
  78.  
  79. struct CatCompArrayType
  80. {
  81.     LONG   cca_ID;
  82.     STRPTR cca_Str;
  83. };
  84.  
  85. static const struct CatCompArrayType CatCompArray[] =
  86. {
  87.     {MSG_SYSTEMREQUEST_TITLE,(STRPTR)MSG_SYSTEMREQUEST_TITLE_STR},
  88.     {MSG_ERROR_UNKNOWN,(STRPTR)MSG_ERROR_UNKNOWN_STR},
  89.     {MSG_ERROR_ALLOCMEM,(STRPTR)MSG_ERROR_ALLOCMEM_STR},
  90.     {MSG_ERROR_OPENWINDOW,(STRPTR)MSG_ERROR_OPENWINDOW_STR},
  91.     {MSG_ERROR_WINDOWTOOBIG,(STRPTR)MSG_ERROR_WINDOWTOOBIG_STR},
  92.     {MSG_ERROR_DRAWINFO,(STRPTR)MSG_ERROR_DRAWINFO_STR},
  93.     {MSG_ERROR_OPENFONT,(STRPTR)MSG_ERROR_OPENFONT_STR},
  94.     {MSG_ERROR_CREATEMSGPORT,(STRPTR)MSG_ERROR_CREATEMSGPORT_STR},
  95.     {MSG_ERROR_INSTALLOBJECT,(STRPTR)MSG_ERROR_INSTALLOBJECT_STR},
  96.     {MSG_ERROR_CREATECLASS,(STRPTR)MSG_ERROR_CREATECLASS_STR},
  97.     {MSG_ERROR_NOLOCKPUBSCREEN,(STRPTR)MSG_ERROR_NOLOCKPUBSCREEN_STR},
  98.     {MSG_ERROR_CREATEMENUS,(STRPTR)MSG_ERROR_CREATEMENUS_STR},
  99.     {MSG_ERROR_GADGETCONTEXT,(STRPTR)MSG_ERROR_GADGETCONTEXT_STR},
  100. };
  101.  
  102. #endif /* CATCOMP_ARRAY */
  103.  
  104.  
  105. /****************************************************************************/
  106.  
  107.  
  108. #ifdef CATCOMP_BLOCK
  109.  
  110. static const char CatCompBlock[] =
  111. {
  112.     "\x00\x00\x00\x00\x00\x10"
  113.     MSG_SYSTEMREQUEST_TITLE_STR "\x00\x00"
  114.     "\x00\x00\x00\x01\x00\x22"
  115.     MSG_ERROR_UNKNOWN_STR "\x00\x00"
  116.     "\x00\x00\x00\x02\x00\x16"
  117.     MSG_ERROR_ALLOCMEM_STR "\x00"
  118.     "\x00\x00\x00\x03\x00\x12"
  119.     MSG_ERROR_OPENWINDOW_STR "\x00"
  120.     "\x00\x00\x00\x04\x00\x36"
  121.     MSG_ERROR_WINDOWTOOBIG_STR "\x00\x00"
  122.     "\x00\x00\x00\x05\x00\x20"
  123.     MSG_ERROR_DRAWINFO_STR "\x00"
  124.     "\x00\x00\x00\x06\x00\x10"
  125.     MSG_ERROR_OPENFONT_STR "\x00"
  126.     "\x00\x00\x00\x07\x00\x1A"
  127.     MSG_ERROR_CREATEMSGPORT_STR "\x00"
  128.     "\x00\x00\x00\x08\x00\x16"
  129.     MSG_ERROR_INSTALLOBJECT_STR "\x00\x00"
  130.     "\x00\x00\x00\x09\x00\x14"
  131.     MSG_ERROR_CREATECLASS_STR "\x00\x00"
  132.     "\x00\x00\x00\x0A\x00\x1A"
  133.     MSG_ERROR_NOLOCKPUBSCREEN_STR "\x00\x00"
  134.     "\x00\x00\x00\x0B\x00\x14"
  135.     MSG_ERROR_CREATEMENUS_STR "\x00\x00"
  136.     "\x00\x00\x00\x0C\x00\x1C"
  137.     MSG_ERROR_GADGETCONTEXT_STR "\x00"
  138. };
  139.  
  140. #endif /* CATCOMP_BLOCK */
  141.  
  142.  
  143. /****************************************************************************/
  144.  
  145.  
  146. struct LocaleInfo
  147. {
  148.     APTR li_LocaleBase;
  149.     APTR li_Catalog;
  150. };
  151.  
  152.  
  153. #include <dos.h>
  154. STRPTR __asm GetString(register __a0 struct LocaleInfo *li,register __d0 ULONG id);
  155.  
  156.  
  157. #ifdef CATCOMP_CODE
  158.  
  159. STRPTR GetString(struct LocaleInfo *li, LONG stringNum)
  160. {
  161. LONG   *l;
  162. UWORD  *w;
  163. STRPTR  builtIn;
  164.  
  165.     l = (LONG *)CatCompBlock;
  166.  
  167.     while (*l != stringNum)
  168.     {
  169.         w = (UWORD *)((ULONG)l + 4);
  170.         l = (LONG *)((ULONG)l + (ULONG)*w + 6);
  171.     }
  172.     builtIn = (STRPTR)((ULONG)l + 6);
  173.  
  174. #define XLocaleBase LocaleBase
  175. #define LocaleBase li->li_LocaleBase
  176.     
  177.     if (LocaleBase)
  178.         return(GetCatalogStr(li->li_Catalog,stringNum,builtIn));
  179. #define LocaleBase XLocaleBase
  180. #undef XLocaleBase
  181.  
  182.     return(builtIn);
  183. }
  184.  
  185.  
  186. #endif /* CATCOMP_CODE */
  187.  
  188.  
  189. /****************************************************************************/
  190.  
  191.  
  192. #endif /* CATALOGS_TRITON_H */
  193.