source: golgotha/src/i4/video/x11/x11_input.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 14 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.1 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 __X11_INPUT_HH
10#define __X11_INPUT_HH
11
12#include "device/device.hh"
13#include "time/time.hh"
14#include <X11/Xlib.h>
15#include <X11/Xutil.h>
16
17class i4_display_class;
18class x11_shm_extension_class;
19class i4_draw_context_class;
20
21class x11_input_class : public i4_device_class
22{
23public:
24  Atom                    wm_delete_window, wm_protocols;
25  XVisualInfo             *my_visual;
26  Display                 *display;
27  i4_bool                  mouse_locked;
28  Window                   mainwin;
29  GC                       gc;
30  i4_display_class        *i4_display;
31  Colormap                 xcolor_map;
32  int                      screen_num;
33
34  i4_draw_context_class   *context;
35  w16                      modifier_state;            // keyboard shift state
36  sw32                     mouse_x, mouse_y;
37  i4_time_class            last_down[3], last_up[3];
38 
39  void get_x_time(w32 xtick, i4_time_class &t);
40
41  i4_time_class i4_start_time;
42  i4_bool need_first_time;
43  sw32 first_time;
44  i4_bool repeat_on;
45
46  XVisualInfo *find_visual_with_depth(int depth);
47  char *name() { return "X11 input"; }
48
49  i4_bool open_display();
50  void close_display();
51
52  i4_bool create_window(sw32 x, sw32 y, w32 w, w32 h,
53                        i4_display_class *i4_display,
54                        i4_bool takeup_fullscreen,
55                        XVisualInfo *visual);
56  void destroy_window();
57
58  virtual i4_bool process_events();
59
60  virtual void resize(int w, int h) { ; }
61  virtual void note_event(XEvent &xev) { ; }
62
63  i4_bool lock_mouse_in_place(i4_bool yes_no)
64  {
65    mouse_locked=yes_no;
66    return i4_T;
67  }
68
69  x11_input_class();
70};
71
72
73
74
75#endif
Note: See TracBrowser for help on using the repository browser.