libx11 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -5
  3. data/.travis.yml +1 -1
  4. data/Rakefile +1 -9
  5. data/example/aliases.rb +2 -0
  6. data/example/create_window.rb +15 -13
  7. data/example/window_manager.rb +30 -22
  8. data/lib/libx11.rb +4 -2
  9. data/lib/libx11/keysymdef.rb +2272 -0
  10. data/lib/libx11/version.rb +1 -1
  11. data/lib/libx11/x.rb +148 -0
  12. data/lib/libx11/xlib.rb +42 -0
  13. data/lib/libx11/xlib/display.rb +52 -0
  14. data/lib/libx11/xlib/xany_event.rb +13 -0
  15. data/lib/libx11/xlib/xbutton_event.rb +23 -0
  16. data/lib/libx11/xlib/xcirculate_event.rb +15 -0
  17. data/lib/libx11/xlib/xcirculate_request_event.rb +15 -0
  18. data/lib/libx11/xlib/xclient_message_event.rb +24 -0
  19. data/lib/libx11/xlib/xcolormap_event.rb +16 -0
  20. data/lib/libx11/xlib/xconfigure_event.rb +21 -0
  21. data/lib/libx11/xlib/xconfigure_request_event.rb +22 -0
  22. data/lib/libx11/xlib/xcreate_window_event.rb +20 -0
  23. data/lib/libx11/xlib/xcrossing_event.rb +25 -0
  24. data/lib/libx11/xlib/xdestroy_window_event.rb +14 -0
  25. data/lib/libx11/xlib/xerror_event.rb +15 -0
  26. data/lib/libx11/xlib/xevent.rb +77 -0
  27. data/lib/libx11/xlib/xexpose_event.rb +18 -0
  28. data/lib/libx11/xlib/xfocus_change_event.rb +15 -0
  29. data/lib/libx11/xlib/xgeneric_event.rb +14 -0
  30. data/lib/libx11/xlib/xgeneric_event_cookie.rb +16 -0
  31. data/lib/libx11/xlib/xgraphics_expose_event.rb +21 -0
  32. data/lib/libx11/xlib/xgravity_event.rb +16 -0
  33. data/lib/libx11/xlib/xkey_event.rb +23 -0
  34. data/lib/libx11/xlib/xkeymap_event.rb +14 -0
  35. data/lib/libx11/xlib/xmap_event.rb +15 -0
  36. data/lib/libx11/xlib/xmap_request_event.rb +18 -0
  37. data/lib/libx11/xlib/xmapping_event.rb +16 -0
  38. data/lib/libx11/xlib/xmotion_event.rb +23 -0
  39. data/lib/libx11/xlib/xno_expose_event.rb +15 -0
  40. data/lib/libx11/xlib/xproperty_event.rb +16 -0
  41. data/lib/libx11/xlib/xreparent_event.rb +18 -0
  42. data/lib/libx11/xlib/xresize_request_event.rb +15 -0
  43. data/lib/libx11/xlib/xselection_clear_event.rb +15 -0
  44. data/lib/libx11/xlib/xselection_event.rb +17 -0
  45. data/lib/libx11/xlib/xselection_request_event.rb +18 -0
  46. data/lib/libx11/xlib/xunmap_event.rb +15 -0
  47. data/lib/libx11/xlib/xvisibility_event.rb +14 -0
  48. data/libx11.gemspec +1 -1
  49. metadata +56 -13
  50. data/HACKING.md +0 -14
  51. data/ext/libx11_ruby/constants.c +0 -182
  52. data/ext/libx11_ruby/display.c +0 -197
  53. data/ext/libx11_ruby/extconf.rb +0 -6
  54. data/ext/libx11_ruby/libx11_ruby.c +0 -13
  55. data/ext/libx11_ruby/libx11_ruby.h +0 -14
  56. data/ext/libx11_ruby/window.c +0 -33
  57. data/ext/libx11_ruby/xerror_event.c +0 -104
  58. data/ext/libx11_ruby/xevent.c +0 -134
@@ -0,0 +1,14 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XDestroyWindowEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :event, :Window,
10
+ :window, :Window,
11
+ )
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XErrorEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :display, Display.ptr,
7
+ :resourceid, :XID,
8
+ :serial, :ulong,
9
+ :error_code, :uchar,
10
+ :request_code, :uchar,
11
+ :minor_code, :uchar,
12
+ )
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,77 @@
1
+ require 'libx11/xlib/xany_event'
2
+ require 'libx11/xlib/xbutton_event'
3
+ require 'libx11/xlib/xcirculate_event'
4
+ require 'libx11/xlib/xcirculate_request_event'
5
+ require 'libx11/xlib/xclient_message_event'
6
+ require 'libx11/xlib/xcolormap_event'
7
+ require 'libx11/xlib/xconfigure_event'
8
+ require 'libx11/xlib/xconfigure_request_event'
9
+ require 'libx11/xlib/xcreate_window_event'
10
+ require 'libx11/xlib/xcrossing_event'
11
+ require 'libx11/xlib/xdestroy_window_event'
12
+ require 'libx11/xlib/xerror_event'
13
+ require 'libx11/xlib/xexpose_event'
14
+ require 'libx11/xlib/xfocus_change_event'
15
+ require 'libx11/xlib/xgeneric_event'
16
+ require 'libx11/xlib/xgeneric_event_cookie'
17
+ require 'libx11/xlib/xgraphics_expose_event'
18
+ require 'libx11/xlib/xgravity_event'
19
+ require 'libx11/xlib/xkey_event'
20
+ require 'libx11/xlib/xkeymap_event'
21
+ require 'libx11/xlib/xmap_event'
22
+ require 'libx11/xlib/xmap_request_event'
23
+ require 'libx11/xlib/xmapping_event'
24
+ require 'libx11/xlib/xmotion_event'
25
+ require 'libx11/xlib/xno_expose_event'
26
+ require 'libx11/xlib/xproperty_event'
27
+ require 'libx11/xlib/xreparent_event'
28
+ require 'libx11/xlib/xresize_request_event'
29
+ require 'libx11/xlib/xselection_clear_event'
30
+ require 'libx11/xlib/xselection_event'
31
+ require 'libx11/xlib/xselection_request_event'
32
+ require 'libx11/xlib/xunmap_event'
33
+ require 'libx11/xlib/xvisibility_event'
34
+
35
+ module LibX11
36
+ module Xlib
37
+ class XEvent < FFI::Struct
38
+ layout(
39
+ :type, :int,
40
+ :xany, XAnyEvent,
41
+ :xkey, XKeyEvent,
42
+ :xbutton, XButtonEvent,
43
+ :xmotion, XMotionEvent,
44
+ :xcrossing, XCrossingEvent,
45
+ :xfocus, XFocusChangeEvent,
46
+ :xexpose, XExposeEvent,
47
+ :xgraphicsexpose, XGraphicsExposeEvent,
48
+ :xnoexpose, XNoExposeEvent,
49
+ :xvisibility, XVisibilityEvent,
50
+ :xcreatewindow, XCreateWindowEvent,
51
+ :xdestroywindow, XDestroyWindowEvent,
52
+ :xunmap, XUnmapEvent,
53
+ :xmap, XMapEvent,
54
+ :xmaprequest, XMapRequestEvent,
55
+ :xreparent, XReparentEvent,
56
+ :xconfigure, XConfigureEvent,
57
+ :xgravity, XGravityEvent,
58
+ :xresizerequest, XResizeRequestEvent,
59
+ :xconfigurerequest, XConfigureRequestEvent,
60
+ :xcirculate, XCirculateEvent,
61
+ :xcirculaterequest, XCirculateRequestEvent,
62
+ :xproperty, XPropertyEvent,
63
+ :xselectionclear, XSelectionClearEvent,
64
+ :xselectionrequest, XSelectionRequestEvent,
65
+ :xselection, XSelectionEvent,
66
+ :xcolormap, XColormapEvent,
67
+ :xclient, XClientMessageEvent,
68
+ :xmapping, XMappingEvent,
69
+ :xerror, XErrorEvent,
70
+ :xkeymap, XKeymapEvent,
71
+ :xgeneric, XGenericEvent,
72
+ :xcookie, XGenericEventCookie,
73
+ :pad, [:long, 24],
74
+ )
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,18 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XExposeEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :x, :int,
11
+ :y, :int,
12
+ :width, :int,
13
+ :height, :int,
14
+ :count, :int,
15
+ )
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XFocusChangeEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :mode, :int,
11
+ :detail, :int
12
+ )
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XGenericEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :extension, :int,
10
+ :evtype, :int,
11
+ )
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XGenericEventCookie < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :extension, :int,
10
+ :evtype, :int,
11
+ :cookie, :uint,
12
+ :data, :pointer,
13
+ )
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XGraphicsExposeEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :drawable, :Drawable,
11
+ :x, :int,
12
+ :y, :int,
13
+ :width, :int,
14
+ :height, :int,
15
+ :count, :int,
16
+ :major_code, :int,
17
+ :minor_code, :int,
18
+ )
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XGravityEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :event, :Window,
10
+ :window, :Window,
11
+ :x, :int,
12
+ :y, :int,
13
+ )
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,23 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XKeyEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :root, :Window,
11
+ :subwindow, :Window,
12
+ :time, :Time,
13
+ :x, :int,
14
+ :y, :int,
15
+ :x_root, :int,
16
+ :y_root, :int,
17
+ :state, :uint,
18
+ :keycode, :uint,
19
+ :same_screen, :Bool,
20
+ )
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,14 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XKeymapEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :key_vector, [:char, 32],
11
+ )
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XMapEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :event, :Window,
10
+ :window, :Window,
11
+ :override_redirect, :Bool
12
+ )
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XMapRequestEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :event, :Window,
10
+ :window, :Window,
11
+ :parent, :Window,
12
+ :x, :int,
13
+ :y, :int,
14
+ :override_redirect, :Bool,
15
+ )
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XMappingEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :request, :int,
11
+ :first_keycode, :int,
12
+ :count, :int,
13
+ )
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,23 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XMotionEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :root, :Window,
11
+ :subwindow, :Window,
12
+ :time, :Time,
13
+ :x, :int,
14
+ :y, :int,
15
+ :x_root, :int,
16
+ :y_root, :int,
17
+ :state, :uint,
18
+ :is_hint, :char,
19
+ :same_screen, :Bool,
20
+ )
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XNoExposeEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :drawable, :Drawable,
10
+ :major_code, :int,
11
+ :minor_code, :int,
12
+ )
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XPropertyEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :atom, :Atom,
11
+ :time, :Time,
12
+ :state, :int,
13
+ )
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XReparentEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :event, :Window,
10
+ :window, :Window,
11
+ :parent, :Window,
12
+ :x, :int,
13
+ :y, :int,
14
+ :override_redirect, :Bool,
15
+ )
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XResizeRequestEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :width, :int,
11
+ :height, :int,
12
+ )
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XSelectionClearEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :window, :Window,
10
+ :selection, :Atom,
11
+ :time, :Time,
12
+ )
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XSelectionEvent < FFI::Struct
4
+ layout(
5
+ :type, :int,
6
+ :serial, :ulong,
7
+ :send_event, :Bool,
8
+ :display, Display.ptr,
9
+ :requestor, :Window,
10
+ :selection, :Atom,
11
+ :target, :Atom,
12
+ :property, :Atom,
13
+ :time, :Time,
14
+ )
15
+ end
16
+ end
17
+ end