home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classes.lha / Classes / BOOPSI / boopsilib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-31  |  3.5 KB  |  133 lines

  1. #ifndef BOOPSI_BOOPSILIB_H
  2. #define BOOPSI_BOOPSILIB_H
  3.  
  4. // Einige immer wieder benötigte Funktionen für BOOPSI Implementationen
  5. //
  6. // Autor: Jochen Becher
  7. //
  8. // Historie:
  9. // Version 1.0 am 15. Mai 94
  10.  
  11. #ifndef EXEC_TYPES_H
  12. #include <exec/types.h>
  13. #endif
  14.  
  15. #ifndef UTILITY_TAGITEM_H
  16. #include <utility/tagitem.h>
  17. #endif
  18.  
  19. #ifndef INTUITION_CLASSUSR_H
  20. #include <intuition/classusr.h>
  21. #endif
  22.  
  23. #ifndef INTUITION_CLASSES_H
  24. #include <intuition/classes.h>
  25. #endif
  26.  
  27. #ifndef INTUITION_INTUITION_H
  28. #include <intuition/intuition.h>
  29. #endif
  30.  
  31. #ifndef INTUITION_IMAGECLASS_H
  32. #include <intuition/imageclass.h>
  33. #endif
  34.  
  35. // SuperDrawImageState zeichnet Images unter Verwendung von DrawImage
  36. // und DrawImageState. Dabei werden sowohl BOOPSI Images wie auch
  37. // "normale" Images geeignet gezeichnet.
  38. // Das Image wird in das umfassende Rechteck (dx,dy,width,height) zentriert
  39. // gezeichnet.
  40. VOID SuperDrawImageState(struct RastPort *rp, struct Image *image,
  41.     struct Image *select, LONG dx, LONG dy, LONG width, LONG height,
  42.     ULONG state, struct DrawInfo *drawinfo);
  43.  
  44. // Setzen von Attributen eines Gadgets aus einem Gadget mit bekannter
  45. // GadgetInfo
  46. ULONG SetGInfoAttrs(Object *, struct GadgetInfo *, Tag tag1type, ...);
  47.  
  48. // Setzen von Attributen des Elterngadgets aus einem Gadget mit bekannter
  49. // GadgetInfo
  50. ULONG SetSuperGInfoAttrs(Class *, Object *, struct GadgetInfo *,
  51.     Tag tag1type, ...);
  52.  
  53. // Schickt eine Update Nachricht mit bekannter GadgetInfo
  54. ULONG UpdateGInfoAttrs(Object *, struct GadgetInfo *, ULONG flags,
  55.     Tag tag1type, ...);
  56.  
  57. // Die SetGadgetAttrs Routine der amiga.lib ist "broken"
  58. ULONG SetGadgetAttrsJB(struct Gadget *g, struct Window *w,
  59.     struct Requester *r,    Tag tag1type, ...);
  60.  
  61. // Für umrahmte Gadgets, deren Rahmen im Gadget drin liegen, kann man
  62. // hiermit die Größe und Position des inneren Bereichs ausmessen.
  63. VOID GetInnerFrame(struct Gadget *g, Object *frame, struct IBox *framebox,
  64.     WORD *frameright, WORD *framebottom);
  65.  
  66. // Ausgabe eines Labels mit Unterstreichung ohne Clipping.
  67. #define STADJUST_Left     0
  68. #define STADJUST_Center   1
  69. #define STADJUST_Right    2
  70.  
  71. struct LabelText {
  72.     struct IntuiText itext;
  73.     ULONG memsize;
  74.     LONG markpos;
  75.     WORD length;
  76.     WORD markX;
  77.     WORD markWidth;
  78. };
  79.  
  80. struct LabelText *AllocLText(STRPTR str, struct TextAttr *tattr,
  81.     UBYTE apen, UBYTE bpen = 0, UBYTE drmd = JAM1, UBYTE mark = 0);
  82. VOID FreeLText(struct LabelText *);
  83. WORD MeasureLText(struct LabelText *);
  84. VOID ChangeLTextFont(struct LabelText *, struct TextAttr *);
  85. VOID ChangeLTextPens(struct LabelText *, UBYTE apen, UBYTE bpen, UBYTE drmd);
  86. VOID ChangeLText(struct LabelText *, STRPTR , UBYTE mark = 0);
  87. VOID PrintLText(struct RastPort *, struct LabelText *,
  88.     WORD x, WORD y, WORD width, WORD height, WORD adjust = STADJUST_Left);
  89.  
  90. // Einige Textroutinen
  91. WORD MeasureTextLength(STRPTR s, struct TextAttr *);
  92. VOID PrintClipped(struct RastPort *, STRPTR s,
  93.     WORD x, WORD y, WORD width, WORD height, WORD adjust = STADJUST_Left);
  94.  
  95. // Eine einfache Drawengine für skalierbare Symbole
  96. #define DRAWCMD_End    0
  97. #define DRAWCMD_Move   1
  98. #define DRAWCMD_Draw   2
  99. #define DRAWCMD_Attr   3
  100. #define DRAWCMD_Fill   4
  101. #define DRAWCMD_Image  5
  102.  
  103. struct DrawData {
  104.     WORD command;
  105.     union {
  106.         struct {
  107.             WORD x;
  108.             WORD y;
  109.         } move;
  110.         struct {
  111.             WORD x;
  112.             WORD y;
  113.         } draw;
  114.         struct {
  115.             WORD pen;
  116.             WORD planepen;
  117.         } attr;
  118.         struct {
  119.             WORD pen;
  120.             WORD planepen;
  121.         } fill;
  122.         struct {
  123.             struct Image *image;
  124.         } image;
  125.     } c;
  126. };
  127.  
  128. VOID drawOutlineImage(struct RastPort *rp, struct DrawData *v,
  129.     WORD x, WORD y, WORD w, WORD h, struct DrawInfo *di,
  130.     BOOL outline, BOOL plane, BOOL recessed, LONG state);
  131.  
  132. #endif
  133.