home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / opus / v5 / opussdk / examples / viewfont / viewfont.h < prev   
C/C++ Source or Header  |  1977-12-31  |  3KB  |  137 lines

  1. #define CATCOMP_NUMBERS
  2. #include "viewfont.strings"
  3.  
  4. #include <dopus/dopusbase.h>
  5.  
  6. #include <clib/asl_protos.h>
  7. #include <clib/diskfont_protos.h>
  8. #include <clib/dos_protos.h>
  9. #include <clib/exec_protos.h>
  10. #include <clib/graphics_protos.h>
  11. #include <clib/intuition_protos.h>
  12. #include <clib/layers_protos.h>
  13. #include <clib/locale_protos.h>
  14. #include <clib/wb_protos.h>
  15. #include <libraries/asl.h>
  16. #include <libraries/diskfont.h>
  17. #include <pragmas/asl_pragmas.h>
  18. #include <pragmas/diskfont_pragmas.h>
  19. #include <pragmas/dos_pragmas.h>
  20. #include <pragmas/exec_pragmas.h>
  21. #include <pragmas/graphics_pragmas.h>
  22. #include <pragmas/intuition_pragmas.h>
  23. #include <pragmas/layers_pragmas.h>
  24. #include <pragmas/locale_pragmas.h>
  25. #include <pragmas/wb_pragmas.h>
  26. #include <workbench/startup.h>
  27. #include <string.h>
  28. #include <stdio.h>
  29. #include <ctype.h>
  30. #include <stdlib.h>
  31.  
  32.  
  33. enum
  34. {
  35.     ARG_FONT,
  36.     ARG_SIZE,
  37.     ARG_BOLD,
  38.     ARG_ITALIC,
  39.     ARG_ULINE,
  40.     ARG_SCREEN,
  41.     ARG_COUNT
  42. };
  43.  
  44. typedef struct
  45. {
  46.     struct Screen        *screen;
  47.     struct Window        *window;
  48.     struct DOpusLocale    locale;
  49.  
  50.     ConfigWindow        win_dims;
  51.     NewConfigWindow        new_win;
  52.     ObjectList        *list;
  53.  
  54.     struct TextAttr        attr;
  55.     struct TextFont        *font;
  56.  
  57.     char            font_name[256];
  58.     short            font_size;
  59.     short            font_style;
  60.  
  61.     char            title[80];
  62.  
  63.     ULONG             arg_array[ARG_COUNT];
  64.  
  65.     char            font_text[256];
  66.  
  67.     struct MsgPort        *appport;
  68.     struct AppWindow    *appwindow;
  69.  
  70.     struct RDArgs        *args;
  71.     BOOL            resized;
  72.     BOOL            first;
  73.  
  74.     struct Hook        refresh_hook;
  75.  
  76.     char            last_font_name[256];
  77.     char            **size_labels;
  78.  
  79.     struct Window        *about;
  80. } font_data;
  81.  
  82. BOOL font_open(font_data *data);
  83. void font_close(font_data *data);
  84. void font_free(font_data *data);
  85. void font_get_font(font_data *data);
  86. void font_show_font(font_data *data,BOOL refresh);
  87. void font_get_name(font_data *data,char *name);
  88. void font_ask_name(font_data *data);
  89.  
  90. extern ConfigWindow font_window;
  91. extern ObjectDef font_objects[];
  92.  
  93. enum
  94. {
  95.     GAD_FONT_LAYOUT,
  96.  
  97.     GAD_FONT_FONT,
  98.     GAD_FONT_SIZE,
  99.     GAD_FONT_PRINT,
  100.     GAD_FONT_UP,
  101.     GAD_FONT_DOWN,
  102.     GAD_FONT_BOLD,
  103.     GAD_FONT_ITALIC,
  104.     GAD_FONT_ULINE,
  105.     GAD_FONT_DISPLAY,
  106.     GAD_FONT_FONT_POPUP,
  107.     GAD_FONT_CYCLE,
  108.  
  109.     MENU_OPEN_FONT,
  110.     MENU_SAVE_SETTINGS,
  111.     MENU_QUIT,
  112.     MENU_ABOUT,
  113. };
  114.  
  115.  
  116. extern struct Library *DOpusBase;
  117. extern struct Library *GfxBase;
  118. extern struct Library *LocaleBase;
  119. extern struct Library *LayersBase;
  120. extern struct Library *AslBase;
  121. extern struct Library *DiskfontBase;
  122. extern struct Library *LocaleBase;
  123. extern struct Library *WorkbenchBase;
  124. extern struct Library *IntuitionBase;
  125. extern struct Library *DOSBase;
  126.  
  127. extern MenuData font_menus[];
  128.  
  129. void init_locale_data(struct DOpusLocale *locale);
  130. ULONG __asm font_refresh(register __a0 struct Hook *hook,register __a1 struct IntuiMessage *msg);
  131. short font_get_size(font_data *data,short dir);
  132. void font_build_labels(font_data *data,struct FontContentsHeader *fch);
  133. void font_show_about(font_data *data);
  134. void font_save_settings(font_data *data);
  135. void font_read_settings(font_data *data);
  136. void read_parse_set(char **ptr,unsigned short *val);
  137.