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

  1. #define CATCOMP_NUMBERS
  2. #include "iconclock.strings"
  3.  
  4. #define _DOPUS_MODULE_DEF
  5. #include <dopus/modules.h>
  6.  
  7. #include <exec/memory.h>
  8. #include <exec/execbase.h>
  9. #include <workbench/workbench.h>
  10. #include <clib/dos_protos.h>
  11. #include <clib/exec_protos.h>
  12. #include <clib/graphics_protos.h>
  13. #include <clib/intuition_protos.h>
  14. #include <clib/utility_protos.h>
  15. #include <clib/wb_protos.h>
  16. #include <pragmas/exec_pragmas.h>
  17. #include <pragmas/dos_pragmas.h>
  18. #include <pragmas/graphics_pragmas.h>
  19. #include <pragmas/intuition_pragmas.h>
  20. #include <pragmas/utility_pragmas.h>
  21. #include <pragmas/wb_pragmas.h>
  22. #include <string.h>
  23. #include <stdio.h>
  24. #include <dos.h>
  25. #include <ctype.h>
  26. #include <stdlib.h>
  27.  
  28. #define ENV_ICONCLOCK        "dopus/Icon Clock"
  29. #define NAME_ICONCLOCK        "Icon Clock"
  30.  
  31. #define CLOCK_WIDTH    48
  32. #define CLOCK_HEIGHT    17
  33.  
  34. #define NUMERAL_WIDTH    8
  35. #define NUMERAL_HEIGHT    13
  36. #define COLON_WIDTH    6
  37. #define COLON_HEIGHT    13
  38.  
  39. // Semaphore used to find the icon clock process in memory
  40. typedef struct
  41. {
  42.     struct SignalSemaphore    sem;
  43.     IPCData            *ipc;
  44. } IconClockSemaphore;
  45.  
  46. // Data used by this program
  47. typedef struct
  48. {
  49.     ULONG            a4;        // Keep A4 pointer to reference global data
  50.     struct Library        *library;    // Pointer to the dopus5.library
  51.     struct Library        *module;    // Pointer to this module
  52.  
  53.     IPCData            *ipc;        // Our IPC pointer
  54.     struct MsgPort        *notify_port;    // Notify message port
  55.     APTR            notify_req;    // Active notify request
  56.  
  57.     struct DiskObject    clock_icon;    // Clock icon
  58.     struct Image        clock_image;    // Clock image
  59.  
  60.     struct RastPort        clock_rp;    // Rastport for drawing
  61.     struct BitMap        clock_bm;    // Bitmap to draw into
  62.  
  63.     struct AppIcon        *appicon;    // AppIcon pointer
  64.     struct MsgPort        *app_port;    // AppIcon message port
  65.  
  66.     long            icon_x;        // Current position
  67.     long            icon_y;
  68.     char            buffer[256];    // Work buffer
  69.  
  70.     IconClockSemaphore    sem;        // Semaphore to identify ourselves
  71.  
  72.     TimerHandle        *timer;        // Timer stuff
  73.     long            day;
  74.     char            date_buffer[20];
  75.  
  76.     struct Screen        *screen;    // Screen we're on
  77.     short            pen;        // The pen we've allocated
  78.     long            colour;
  79.  
  80.     IPCData            *main_ipc;    // Opus main IPC pointer
  81.  
  82.     struct Window        *about;        // Pointer to about window
  83. } iconclock_data;
  84.  
  85. void icon_clock(void);
  86. ULONG __asm iconclock_startup(
  87.     register __a0 IPCData *,
  88.     register __a1 iconclock_data *);
  89. void iconclock_cleanup(iconclock_data *);
  90. void iconclock_show(iconclock_data *);
  91. void read_parse_set(char **,long *);
  92. void iconclock_init(iconclock_data *,struct Screen *);
  93.  
  94. extern USHORT __chip numeral_data[10][13],colon_data[3][13];
  95. void iconclock_info(iconclock_data *);
  96.