libx11 0.1.0 → 0.2.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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/bin/generate-constants +92 -0
  3. data/bin/generate-functions +64 -0
  4. data/bin/generate-structs +103 -0
  5. data/bin/typesym.rb +50 -0
  6. data/example/window_manager.rb +10 -14
  7. data/lib/libx11/version.rb +1 -1
  8. data/lib/libx11/x.rb +573 -132
  9. data/lib/libx11/xlib.rb +463 -28
  10. data/lib/libx11/xlib/depth.rb +11 -0
  11. data/lib/libx11/xlib/screen.rb +28 -0
  12. data/lib/libx11/xlib/screen_format.rb +12 -0
  13. data/lib/libx11/xlib/visual.rb +16 -0
  14. data/lib/libx11/xlib/{xany_event.rb → x_any_event.rb} +1 -1
  15. data/lib/libx11/xlib/x_arc.rb +14 -0
  16. data/lib/libx11/xlib/{xbutton_event.rb → x_button_event.rb} +2 -2
  17. data/lib/libx11/xlib/x_char2b.rb +10 -0
  18. data/lib/libx11/xlib/x_char_struct.rb +14 -0
  19. data/lib/libx11/xlib/{xcirculate_event.rb → x_circulate_event.rb} +1 -1
  20. data/lib/libx11/xlib/{xcirculate_request_event.rb → x_circulate_request_event.rb} +2 -2
  21. data/lib/libx11/xlib/{xclient_message_event.rb → x_client_message_event.rb} +0 -0
  22. data/lib/libx11/xlib/x_color.rb +14 -0
  23. data/lib/libx11/xlib/{xcolormap_event.rb → x_colormap_event.rb} +2 -2
  24. data/lib/libx11/xlib/{xconfigure_event.rb → x_configure_event.rb} +2 -2
  25. data/lib/libx11/xlib/{xconfigure_request_event.rb → x_configure_request_event.rb} +2 -2
  26. data/lib/libx11/xlib/{xcreate_window_event.rb → x_create_window_event.rb} +2 -2
  27. data/lib/libx11/xlib/{xcrossing_event.rb → x_crossing_event.rb} +4 -4
  28. data/lib/libx11/xlib/{xdestroy_window_event.rb → x_destroy_window_event.rb} +1 -1
  29. data/lib/libx11/xlib/x_edata_object.rb +14 -0
  30. data/lib/libx11/xlib/{xerror_event.rb → x_error_event.rb} +0 -0
  31. data/lib/libx11/xlib/{xevent.rb → x_event.rb} +34 -34
  32. data/lib/libx11/xlib/{xexpose_event.rb → x_expose_event.rb} +1 -1
  33. data/lib/libx11/xlib/x_ext_codes.rb +12 -0
  34. data/lib/libx11/xlib/{xfocus_change_event.rb → x_focus_change_event.rb} +2 -2
  35. data/lib/libx11/xlib/x_font_prop.rb +10 -0
  36. data/lib/libx11/xlib/x_font_set_extents.rb +10 -0
  37. data/lib/libx11/xlib/x_font_struct.rb +24 -0
  38. data/lib/libx11/xlib/{xgeneric_event.rb → x_generic_event.rb} +0 -0
  39. data/lib/libx11/xlib/{xgeneric_event_cookie.rb → x_generic_event_cookie.rb} +1 -1
  40. data/lib/libx11/xlib/{xgraphics_expose_event.rb → x_graphics_expose_event.rb} +1 -2
  41. data/lib/libx11/xlib/{xgravity_event.rb → x_gravity_event.rb} +1 -1
  42. data/lib/libx11/xlib/x_host_address.rb +11 -0
  43. data/lib/libx11/xlib/x_key_event.rb +23 -0
  44. data/lib/libx11/xlib/x_keyboard_control.rb +16 -0
  45. data/lib/libx11/xlib/x_keyboard_state.rb +15 -0
  46. data/lib/libx11/xlib/{xkeymap_event.rb → x_keymap_event.rb} +1 -1
  47. data/lib/libx11/xlib/{xmap_event.rb → x_map_event.rb} +2 -2
  48. data/lib/libx11/xlib/x_map_request_event.rb +14 -0
  49. data/lib/libx11/xlib/{xmapping_event.rb → x_mapping_event.rb} +1 -1
  50. data/lib/libx11/xlib/x_modifier_keymap.rb +10 -0
  51. data/lib/libx11/xlib/{xmotion_event.rb → x_motion_event.rb} +2 -2
  52. data/lib/libx11/xlib/{xno_expose_event.rb → x_no_expose_event.rb} +1 -1
  53. data/lib/libx11/xlib/x_pixmap_format_values.rb +11 -0
  54. data/lib/libx11/xlib/x_point.rb +10 -0
  55. data/lib/libx11/xlib/{xproperty_event.rb → x_property_event.rb} +1 -1
  56. data/lib/libx11/xlib/x_rectangle.rb +12 -0
  57. data/lib/libx11/xlib/{xreparent_event.rb → x_reparent_event.rb} +2 -2
  58. data/lib/libx11/xlib/{xresize_request_event.rb → x_resize_request_event.rb} +1 -1
  59. data/lib/libx11/xlib/x_segment.rb +12 -0
  60. data/lib/libx11/xlib/{xselection_clear_event.rb → x_selection_clear_event.rb} +1 -1
  61. data/lib/libx11/xlib/{xselection_event.rb → x_selection_event.rb} +1 -1
  62. data/lib/libx11/xlib/{xselection_request_event.rb → x_selection_request_event.rb} +1 -1
  63. data/lib/libx11/xlib/x_server_interpreted_address.rb +12 -0
  64. data/lib/libx11/xlib/x_set_window_attributes.rb +23 -0
  65. data/lib/libx11/xlib/x_text_item.rb +12 -0
  66. data/lib/libx11/xlib/x_text_item16.rb +12 -0
  67. data/lib/libx11/xlib/x_time_coord.rb +11 -0
  68. data/lib/libx11/xlib/{xunmap_event.rb → x_unmap_event.rb} +2 -2
  69. data/lib/libx11/xlib/{xvisibility_event.rb → x_visibility_event.rb} +1 -1
  70. data/lib/libx11/xlib/x_window_attributes.rb +31 -0
  71. data/lib/libx11/xlib/x_window_changes.rb +15 -0
  72. data/lib/libx11/xlib/xgc_values.rb +31 -0
  73. data/lib/libx11/xlib/xic_callback.rb +10 -0
  74. data/lib/libx11/xlib/xim_callback.rb +10 -0
  75. data/lib/libx11/xlib/xim_styles.rb +10 -0
  76. data/lib/libx11/xlib/xim_values_list.rb +10 -0
  77. data/lib/libx11/xlib/xmb_text_item.rb +12 -0
  78. data/lib/libx11/xlib/xom_char_set_list.rb +10 -0
  79. data/lib/libx11/xlib/xom_font_info.rb +11 -0
  80. data/lib/libx11/xlib/xom_orientation.rb +10 -0
  81. data/lib/libx11/xlib/xwc_text_item.rb +12 -0
  82. data/libx11.gemspec +2 -1
  83. metadata +105 -49
  84. data/lib/libx11/xlib/xkey_event.rb +0 -23
  85. data/lib/libx11/xlib/xmap_request_event.rb +0 -18
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :extension, :int,
10
10
  :evtype, :int,
@@ -4,9 +4,8 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
- :window, :Window,
10
9
  :drawable, :Drawable,
11
10
  :x, :int,
12
11
  :y, :int,
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :event, :Window,
10
10
  :window, :Window,
@@ -0,0 +1,11 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XHostAddress < FFI::Struct
4
+ layout(
5
+ :family, :int,
6
+ :length, :int,
7
+ :address, :string,
8
+ )
9
+ end
10
+ end
11
+ 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,16 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XKeyboardControl < FFI::Struct
4
+ layout(
5
+ :key_click_percent, :int,
6
+ :bell_percent, :int,
7
+ :bell_pitch, :int,
8
+ :bell_duration, :int,
9
+ :led, :int,
10
+ :led_mode, :int,
11
+ :key, :int,
12
+ :auto_repeat_mode, :int,
13
+ )
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XKeyboardState < FFI::Struct
4
+ layout(
5
+ :key_click_percent, :int,
6
+ :bell_percent, :int,
7
+ :bell_pitch, :uint,
8
+ :bell_duration, :uint,
9
+ :led_mask, :ulong,
10
+ :global_auto_repeat, :int,
11
+ :auto_repeats, [:char, 32],
12
+ )
13
+ end
14
+ end
15
+ end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :window, :Window,
10
10
  :key_vector, [:char, 32],
@@ -4,11 +4,11 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :event, :Window,
10
10
  :window, :Window,
11
- :override_redirect, :Bool
11
+ :override_redirect, :bool,
12
12
  )
13
13
  end
14
14
  end
@@ -0,0 +1,14 @@
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
+ :parent, :Window,
10
+ :window, :Window,
11
+ )
12
+ end
13
+ end
14
+ end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :window, :Window,
10
10
  :request, :int,
@@ -0,0 +1,10 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XModifierKeymap < FFI::Struct
4
+ layout(
5
+ :max_keypermod, :int,
6
+ :modifiermap, :pointer,
7
+ )
8
+ end
9
+ end
10
+ end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :window, :Window,
10
10
  :root, :Window,
@@ -16,7 +16,7 @@ module LibX11
16
16
  :y_root, :int,
17
17
  :state, :uint,
18
18
  :is_hint, :char,
19
- :same_screen, :Bool,
19
+ :same_screen, :bool,
20
20
  )
21
21
  end
22
22
  end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :drawable, :Drawable,
10
10
  :major_code, :int,
@@ -0,0 +1,11 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XPixmapFormatValues < FFI::Struct
4
+ layout(
5
+ :depth, :int,
6
+ :bits_per_pixel, :int,
7
+ :scanline_pad, :int,
8
+ )
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XPoint < FFI::Struct
4
+ layout(
5
+ :x, :short,
6
+ :y, :short,
7
+ )
8
+ end
9
+ end
10
+ end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :window, :Window,
10
10
  :atom, :Atom,
@@ -0,0 +1,12 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XRectangle < FFI::Struct
4
+ layout(
5
+ :x, :short,
6
+ :y, :short,
7
+ :width, :ushort,
8
+ :height, :ushort,
9
+ )
10
+ end
11
+ end
12
+ end
@@ -4,14 +4,14 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :event, :Window,
10
10
  :window, :Window,
11
11
  :parent, :Window,
12
12
  :x, :int,
13
13
  :y, :int,
14
- :override_redirect, :Bool,
14
+ :override_redirect, :bool,
15
15
  )
16
16
  end
17
17
  end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :window, :Window,
10
10
  :width, :int,
@@ -0,0 +1,12 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XSegment < FFI::Struct
4
+ layout(
5
+ :x1, :short,
6
+ :y1, :short,
7
+ :x2, :short,
8
+ :y2, :short,
9
+ )
10
+ end
11
+ end
12
+ end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :window, :Window,
10
10
  :selection, :Atom,
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :requestor, :Window,
10
10
  :selection, :Atom,
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :owner, :Window,
10
10
  :requestor, :Window,
@@ -0,0 +1,12 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XServerInterpretedAddress < FFI::Struct
4
+ layout(
5
+ :typelength, :int,
6
+ :valuelength, :int,
7
+ :type, :string,
8
+ :value, :string,
9
+ )
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XSetWindowAttributes < FFI::Struct
4
+ layout(
5
+ :background_pixmap, :Pixmap,
6
+ :background_pixel, :ulong,
7
+ :border_pixmap, :Pixmap,
8
+ :border_pixel, :ulong,
9
+ :bit_gravity, :int,
10
+ :win_gravity, :int,
11
+ :backing_store, :int,
12
+ :backing_planes, :ulong,
13
+ :backing_pixel, :ulong,
14
+ :save_under, :bool,
15
+ :event_mask, :long,
16
+ :do_not_propagate_mask, :long,
17
+ :override_redirect, :bool,
18
+ :colormap, :Colormap,
19
+ :cursor, :Cursor,
20
+ )
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,12 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XTextItem < FFI::Struct
4
+ layout(
5
+ :chars, :string,
6
+ :nchars, :int,
7
+ :delta, :int,
8
+ :font, :Font,
9
+ )
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XTextItem16 < FFI::Struct
4
+ layout(
5
+ :chars, :pointer,
6
+ :nchars, :int,
7
+ :delta, :int,
8
+ :font, :Font,
9
+ )
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XTimeCoord < FFI::Struct
4
+ layout(
5
+ :time, :Time,
6
+ :x, :short,
7
+ :y, :short,
8
+ )
9
+ end
10
+ end
11
+ end
@@ -4,11 +4,11 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :event, :Window,
10
10
  :window, :Window,
11
- :from_configure, :Bool,
11
+ :from_configure, :bool,
12
12
  )
13
13
  end
14
14
  end
@@ -4,7 +4,7 @@ module LibX11
4
4
  layout(
5
5
  :type, :int,
6
6
  :serial, :ulong,
7
- :send_event, :Bool,
7
+ :send_event, :bool,
8
8
  :display, Display.ptr,
9
9
  :window, :Window,
10
10
  :state, :int,
@@ -0,0 +1,31 @@
1
+ module LibX11
2
+ module Xlib
3
+ class XWindowAttributes < FFI::Struct
4
+ layout(
5
+ :x, :int,
6
+ :y, :int,
7
+ :width, :int,
8
+ :height, :int,
9
+ :border_width, :int,
10
+ :depth, :int,
11
+ :visual, :pointer,
12
+ :root, :Window,
13
+ :class, :int,
14
+ :bit_gravity, :int,
15
+ :win_gravity, :int,
16
+ :backing_store, :int,
17
+ :backing_planes, :ulong,
18
+ :backing_pixel, :ulong,
19
+ :save_under, :bool,
20
+ :colormap, :Colormap,
21
+ :map_installed, :bool,
22
+ :map_state, :int,
23
+ :all_event_masks, :long,
24
+ :your_event_mask, :long,
25
+ :do_not_propagate_mask, :long,
26
+ :override_redirect, :bool,
27
+ :screen, :pointer,
28
+ )
29
+ end
30
+ end
31
+ end