source: golgotha/src/i4/video/mac/draw_sprocket.hh

Last change on this file was 80, checked in by Sam Hocevar, 15 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.7 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef DRAW_SPROCKET_HH
10#define DRAW_SPROCKET_HH
11
12#include "image/depth.hh"
13#include "image/image8.hh"
14#include "image/image15.hh"
15#include "image/image16.hh"
16#include "image/image32.hh"
17#include "video/display.hh"
18#include <QuickDraw.h>
19#include <Displays.h>
20#include <DrawSprocket.h>
21
22class draw_sprocket_class : public i4_display_class
23{
24protected:
25  GDHandle gd;
26  DisplayIDType display_id;
27  w32 wx,wy;
28
29  // PixMap handle to current back buffer memory
30  PixMapHandle PMH;
31
32  i4_draw_context_class *context;
33  DSpContextReference DSp_ref;
34
35  I4_SCREEN_TYPE *screen;
36
37  class device_manager_class : public i4_device_class
38  //{{{
39  {
40  protected:
41    sw32 mx,my, omx,omy;
42    w32 shift_state;            // keyboard shift state
43    char mac_modifier[8];
44  public:
45    virtual char *name() { return "draw_sprocket device manager"; }
46    device_manager_class();
47
48    virtual i4_bool process_events();
49    w32 request_device(i4_event_handler_class *for_who, w32 event_types);
50    void release_device(i4_event_handler_class *for_who, w32 event_types);
51  };
52  //}}}
53  device_manager_class devs;
54 
55  class draw_sprocket_mode_class : public mode
56  //{{{
57  {
58  public:
59    DSpContextReference ref;
60
61    draw_sprocket_mode_class(DSpContextReference _ref) : ref(_ref) {}
62  };
63  //}}}
64
65  draw_sprocket_mode_class *new_mode(DSpContextReference context);
66  void setup_back_buffer();
67public:
68  draw_sprocket_class();
69  ~draw_sprocket_class();
70
71  virtual i4_device_class *local_devices() { return &devs; }
72
73  virtual i4_image_class *get_screen() { return screen; }
74  virtual i4_draw_context_class *get_context() { return context; }
75
76  virtual void flush();
77
78  virtual char *name() const { return "Mac DrawSprocket"; }
79
80  virtual w16 width() const { return wx; }
81  virtual w16 height() const { return wy; }
82
83  virtual mode *get_first_mode();
84  virtual mode *get_next_mode(mode *last_mode);
85
86  virtual i4_bool initialize_mode(mode *which_one);
87
88  virtual i4_bool close();
89  virtual i4_bool available();
90
91  virtual i4_bool realize_palette(i4_pal_handle_class pal_id);
92
93  virtual i4_bool set_mouse_shape(i4_cursor_class *cursor);
94};
95
96#endif
97
98//{{{ Emacs Locals
99// Local Variables:
100// folded-file: t
101// End:
102//}}}
Note: See TracBrowser for help on using the repository browser.