xlib 1.0.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 (109) hide show
  1. checksums.yaml +7 -0
  2. data/lib/x.rb +11 -0
  3. data/lib/x/constants.rb +614 -0
  4. data/lib/x/extensions.rb +10 -0
  5. data/lib/x/extensions/randr.rb +10 -0
  6. data/lib/x/extensions/randr/constants.rb +160 -0
  7. data/lib/x/extensions/randr/types.rb +18 -0
  8. data/lib/x/extensions/render.rb +10 -0
  9. data/lib/x/extensions/render/constants.rb +155 -0
  10. data/lib/x/extensions/render/types.rb +15 -0
  11. data/lib/x/types.rb +24 -0
  12. data/lib/xlib.rb +29 -0
  13. data/lib/xlib/constants.rb +119 -0
  14. data/lib/xlib/extensions.rb +10 -0
  15. data/lib/xlib/extensions/xrandr.rb +25 -0
  16. data/lib/xlib/extensions/xrandr/functions.rb +101 -0
  17. data/lib/xlib/extensions/xrandr/struct/crtc_change_notify_event.rb +24 -0
  18. data/lib/xlib/extensions/xrandr/struct/crtc_gamma.rb +16 -0
  19. data/lib/xlib/extensions/xrandr/struct/crtc_info.rb +24 -0
  20. data/lib/xlib/extensions/xrandr/struct/crtc_transform_attributes.rb +20 -0
  21. data/lib/xlib/extensions/xrandr/struct/mode_info.rb +26 -0
  22. data/lib/xlib/extensions/xrandr/struct/notify_event.rb +17 -0
  23. data/lib/xlib/extensions/xrandr/struct/output_change_notify_event.rb +24 -0
  24. data/lib/xlib/extensions/xrandr/struct/output_info.rb +27 -0
  25. data/lib/xlib/extensions/xrandr/struct/output_property_notify_event.rb +21 -0
  26. data/lib/xlib/extensions/xrandr/struct/panning.rb +25 -0
  27. data/lib/xlib/extensions/xrandr/struct/property_info.rb +17 -0
  28. data/lib/xlib/extensions/xrandr/struct/provider_change_notify_event.rb +20 -0
  29. data/lib/xlib/extensions/xrandr/struct/provider_info.rb +21 -0
  30. data/lib/xlib/extensions/xrandr/struct/provider_property_notify_event.rb +21 -0
  31. data/lib/xlib/extensions/xrandr/struct/provider_resources.rb +14 -0
  32. data/lib/xlib/extensions/xrandr/struct/resource_change_notify_event.rb +18 -0
  33. data/lib/xlib/extensions/xrandr/struct/screen_change_notify_event.rb +26 -0
  34. data/lib/xlib/extensions/xrandr/struct/screen_resources.rb +20 -0
  35. data/lib/xlib/extensions/xrandr/struct/screen_size.rb +16 -0
  36. data/lib/xlib/extensions/xrandr/types.rb +36 -0
  37. data/lib/xlib/extensions/xrender.rb +24 -0
  38. data/lib/xlib/extensions/xrender/constants.rb +28 -0
  39. data/lib/xlib/extensions/xrender/functions.rb +29 -0
  40. data/lib/xlib/extensions/xrender/struct/anim_cursor.rb +14 -0
  41. data/lib/xlib/extensions/xrender/struct/circle.rb +15 -0
  42. data/lib/xlib/extensions/xrender/struct/conical_gradient.rb +14 -0
  43. data/lib/xlib/extensions/xrender/struct/filters.rb +16 -0
  44. data/lib/xlib/extensions/xrender/struct/glyph_elt16.rb +17 -0
  45. data/lib/xlib/extensions/xrender/struct/glyph_elt32.rb +17 -0
  46. data/lib/xlib/extensions/xrender/struct/glyph_elt8.rb +17 -0
  47. data/lib/xlib/extensions/xrender/struct/glyph_info.rb +18 -0
  48. data/lib/xlib/extensions/xrender/struct/index_value.rb +17 -0
  49. data/lib/xlib/extensions/xrender/struct/line_fixed.rb +14 -0
  50. data/lib/xlib/extensions/xrender/struct/linear_gradient.rb +14 -0
  51. data/lib/xlib/extensions/xrender/struct/point_double.rb +14 -0
  52. data/lib/xlib/extensions/xrender/struct/point_fixed.rb +14 -0
  53. data/lib/xlib/extensions/xrender/struct/radial_gradient.rb +14 -0
  54. data/lib/xlib/extensions/xrender/struct/render_color.rb +16 -0
  55. data/lib/xlib/extensions/xrender/struct/render_direct_format.rb +20 -0
  56. data/lib/xlib/extensions/xrender/struct/render_pict_format.rb +17 -0
  57. data/lib/xlib/extensions/xrender/struct/render_picture_attributes.rb +25 -0
  58. data/lib/xlib/extensions/xrender/struct/span_fix.rb +15 -0
  59. data/lib/xlib/extensions/xrender/struct/transform.rb +13 -0
  60. data/lib/xlib/extensions/xrender/struct/trap.rb +14 -0
  61. data/lib/xlib/extensions/xrender/struct/trapezoid.rb +16 -0
  62. data/lib/xlib/extensions/xrender/struct/triangle.rb +15 -0
  63. data/lib/xlib/extensions/xrender/types.rb +37 -0
  64. data/lib/xlib/functions.rb +396 -0
  65. data/lib/xlib/struct/any_event.rb +17 -0
  66. data/lib/xlib/struct/button_event.rb +27 -0
  67. data/lib/xlib/struct/circulate_event.rb +19 -0
  68. data/lib/xlib/struct/circulate_request_event.rb +19 -0
  69. data/lib/xlib/struct/client_message_event.rb +27 -0
  70. data/lib/xlib/struct/colormap_event.rb +20 -0
  71. data/lib/xlib/struct/configure_event.rb +25 -0
  72. data/lib/xlib/struct/configure_request_event.rb +26 -0
  73. data/lib/xlib/struct/create_window_event.rb +24 -0
  74. data/lib/xlib/struct/crossing_event.rb +29 -0
  75. data/lib/xlib/struct/destroy_window_event.rb +18 -0
  76. data/lib/xlib/struct/display.rb +56 -0
  77. data/lib/xlib/struct/error_event.rb +19 -0
  78. data/lib/xlib/struct/event.rb +48 -0
  79. data/lib/xlib/struct/expose_event.rb +22 -0
  80. data/lib/xlib/struct/focus_change_event.rb +19 -0
  81. data/lib/xlib/struct/gc.rb +14 -0
  82. data/lib/xlib/struct/gc_values.rb +35 -0
  83. data/lib/xlib/struct/generic_event.rb +18 -0
  84. data/lib/xlib/struct/generic_event_cookie.rb +20 -0
  85. data/lib/xlib/struct/graphics_expose_event.rb +25 -0
  86. data/lib/xlib/struct/gravity_event.rb +20 -0
  87. data/lib/xlib/struct/image.rb +37 -0
  88. data/lib/xlib/struct/key_event.rb +27 -0
  89. data/lib/xlib/struct/key_sym.rb +28 -0
  90. data/lib/xlib/struct/keymap_event.rb +18 -0
  91. data/lib/xlib/struct/map_event.rb +19 -0
  92. data/lib/xlib/struct/map_request_event.rb +22 -0
  93. data/lib/xlib/struct/mapping_event.rb +20 -0
  94. data/lib/xlib/struct/motion_event.rb +27 -0
  95. data/lib/xlib/struct/no_expose_event.rb +19 -0
  96. data/lib/xlib/struct/point.rb +14 -0
  97. data/lib/xlib/struct/property_event.rb +20 -0
  98. data/lib/xlib/struct/reparent_event.rb +22 -0
  99. data/lib/xlib/struct/resize_request_event.rb +19 -0
  100. data/lib/xlib/struct/screen.rb +31 -0
  101. data/lib/xlib/struct/selection_clear_event.rb +19 -0
  102. data/lib/xlib/struct/selection_event.rb +21 -0
  103. data/lib/xlib/struct/selection_request_event.rb +22 -0
  104. data/lib/xlib/struct/unmap_event.rb +19 -0
  105. data/lib/xlib/struct/visibility_event.rb +18 -0
  106. data/lib/xlib/struct/visual.rb +20 -0
  107. data/lib/xlib/struct/window_attributes.rb +35 -0
  108. data/lib/xlib/types.rb +73 -0
  109. metadata +164 -0
@@ -0,0 +1,10 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ require_relative 'extensions/render'
10
+ require_relative 'extensions/randr'
@@ -0,0 +1,10 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ require_relative 'randr/types'
10
+ require_relative 'randr/constants'
@@ -0,0 +1,160 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ module Xlib
10
+ RANDR_NAME = 'RANDR'
11
+ RANDR_MAJOR = 1
12
+ RANDR_MINOR = 4
13
+
14
+ RRNumberErrors = 4
15
+ RRNumberEvents = 2
16
+ RRNumberRequests = 42
17
+
18
+ X_RRQueryVersion = 0
19
+ # we skip 1 to make old clients fail pretty immediately
20
+ X_RROldGetScreenInfo = 1
21
+ X_RR1_0SetScreenConfig = 2
22
+ # V1.0 apps share the same set screen config request id
23
+ X_RRSetScreenConfig = 2
24
+ X_RROldScreenChangeSelectInput = 3
25
+ # 3 used to be ScreenChangeSelectInput; deprecated
26
+ X_RRSelectInput = 4
27
+ X_RRGetScreenInfo = 5
28
+
29
+ # V1.2 additions
30
+ X_RRGetScreenSizeRange = 6
31
+ X_RRSetScreenSize = 7
32
+ X_RRGetScreenResources = 8
33
+ X_RRGetOutputInfo = 9
34
+ X_RRListOutputProperties = 10
35
+ X_RRQueryOutputProperty = 11
36
+ X_RRConfigureOutputProperty = 12
37
+ X_RRChangeOutputProperty = 13
38
+ X_RRDeleteOutputProperty = 14
39
+ X_RRGetOutputProperty = 15
40
+ X_RRCreateMode = 16
41
+ X_RRDestroyMode = 17
42
+ X_RRAddOutputMode = 18
43
+ X_RRDeleteOutputMode = 19
44
+ X_RRGetCrtcInfo = 20
45
+ X_RRSetCrtcConfig = 21
46
+ X_RRGetCrtcGammaSize = 22
47
+ X_RRGetCrtcGamma = 23
48
+ X_RRSetCrtcGamma = 24
49
+
50
+ # V1.3 additions
51
+ X_RRGetScreenResourcesCurrent = 25
52
+ X_RRSetCrtcTransform = 26
53
+ X_RRGetCrtcTransform = 27
54
+ X_RRGetPanning = 28
55
+ X_RRSetPanning = 29
56
+ X_RRSetOutputPrimary = 30
57
+ X_RRGetOutputPrimary = 31
58
+
59
+ RRTransformUnit = 2**0
60
+ RRTransformScaleUp = 2**1
61
+ RRTransformScaleDown = 2**2
62
+ RRTransformProjective = 2**3
63
+
64
+ # v1.4
65
+ X_RRGetProviders = 32
66
+ X_RRGetProviderInfo = 33
67
+ X_RRSetProviderOffloadSink = 34
68
+ X_RRSetProviderOutputSource = 35
69
+ X_RRListProviderProperties = 36
70
+ X_RRQueryProviderProperty = 37
71
+ X_RRConfigureProviderProperty = 38
72
+ X_RRChangeProviderProperty = 39
73
+ X_RRDeleteProviderProperty = 40
74
+ X_RRGetProviderProperty = 41
75
+
76
+ # Event selection bits
77
+ RRScreenChangeNotifyMask = 2**0
78
+ # V1.2 additions
79
+ RRCrtcChangeNotifyMask = 2**1
80
+ RROutputChangeNotifyMask = 2**2
81
+ RROutputPropertyNotifyMask = 2**3
82
+ # V1.4 additions
83
+ RRProviderChangeNotifyMask = 2**4
84
+ RRProviderPropertyNotifyMask = 2**5
85
+ RRResourceChangeNotifyMask = 2**6
86
+
87
+ # Event codes
88
+ RRScreenChangeNotify = 0
89
+ # V1.2 additions
90
+ RRNotify = 1
91
+ # RRNotify Subcodes
92
+ RRNotify_CrtcChange = 0
93
+ RRNotify_OutputChange = 1
94
+ RRNotify_OutputProperty = 2
95
+ RRNotify_ProviderChange = 3
96
+ RRNotify_ProviderProperty = 4
97
+ RRNotify_ResourceChange = 5
98
+ # used in the rotation field; rotation and reflection in 0.1 proto.
99
+ RR_Rotate_0 = 1
100
+ RR_Rotate_90 = 2
101
+ RR_Rotate_180 = 4
102
+ RR_Rotate_270 = 8
103
+
104
+ # new in 1.0 protocol, to allow reflection of screen
105
+
106
+ RR_Reflect_X = 16
107
+ RR_Reflect_Y = 32
108
+
109
+ RRSetConfigSuccess = 0
110
+ RRSetConfigInvalidConfigTime = 1
111
+ RRSetConfigInvalidTime = 2
112
+ RRSetConfigFailed = 3
113
+
114
+ # new in 1.2 protocol
115
+
116
+ RR_HSyncPositive = 0x00000001
117
+ RR_HSyncNegative = 0x00000002
118
+ RR_VSyncPositive = 0x00000004
119
+ RR_VSyncNegative = 0x00000008
120
+ RR_Interlace = 0x00000010
121
+ RR_DoubleScan = 0x00000020
122
+ RR_CSync = 0x00000040
123
+ RR_CSyncPositive = 0x00000080
124
+ RR_CSyncNegative = 0x00000100
125
+ RR_HSkewPresent = 0x00000200
126
+ RR_BCast = 0x00000400
127
+ RR_PixelMultiplex = 0x00000800
128
+ RR_DoubleClock = 0x00001000
129
+ RR_ClockDivideBy2 = 0x00002000
130
+
131
+ RR_Connected = 0
132
+ RR_Disconnected = 1
133
+ RR_UnknownConnection = 2
134
+
135
+ BadRROutput = 0
136
+ BadRRCrtc = 1
137
+ BadRRMode = 2
138
+ BadRRProvider = 3
139
+
140
+ # Conventional RandR output properties
141
+
142
+ RR_PROPERTY_BACKLIGHT = 'Backlight'
143
+ RR_PROPERTY_RANDR_EDID = 'EDID'
144
+ RR_PROPERTY_SIGNAL_FORMAT = 'SignalFormat'
145
+ RR_PROPERTY_SIGNAL_PROPERTIES = 'SignalProperties'
146
+ RR_PROPERTY_CONNECTOR_TYPE = 'ConnectorType'
147
+ RR_PROPERTY_CONNECTOR_NUMBER = 'ConnectorNumber'
148
+ RR_PROPERTY_COMPATIBILITY_LIST = 'CompatibilityList'
149
+ RR_PROPERTY_CLONE_LIST = 'CloneList'
150
+ RR_PROPERTY_BORDER = 'Border'
151
+ RR_PROPERTY_BORDER_DIMENSIONS = 'BorderDimensions'
152
+
153
+ # roles this device can carry out
154
+ RR_Capability_None = 0
155
+ RR_Capability_SourceOutput = 1
156
+ RR_Capability_SinkOutput = 2
157
+ RR_Capability_SourceOffload = 4
158
+ RR_Capability_SinkOffload = 8
159
+
160
+ end
@@ -0,0 +1,18 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ module FFI
10
+ typedef :ushort, :Rotation
11
+ typedef :ushort, :SizeID
12
+ typedef :ushort, :SubpixelOrder
13
+ typedef :ushort, :Connection
14
+ typedef :ushort, :XRandrRotation
15
+ typedef :ushort, :XRandrSizeID
16
+ typedef :ushort, :XRandrSubpixelOrder
17
+ typedef :ulong, :XRandrModeFlags
18
+ end
@@ -0,0 +1,10 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ require_relative 'render/types'
10
+ require_relative 'render/constants'
@@ -0,0 +1,155 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ module Xlib
10
+ RENDER_NAME = 'RENDER'
11
+ RENDER_MAJOR = 0
12
+ RENDER_MINOR = 11
13
+ X_RenderQueryVersion = 0
14
+ X_RenderQueryPictFormats = 1
15
+ X_RenderQueryPictIndexValues = 2 # 0.7
16
+ X_RenderQueryDithers = 3
17
+ X_RenderCreatePicture = 4
18
+ X_RenderChangePicture = 5
19
+ X_RenderSetPictureClipRectangles = 6
20
+ X_RenderFreePicture = 7
21
+ X_RenderComposite = 8
22
+ X_RenderScale = 9
23
+ X_RenderTrapezoids = 10
24
+ X_RenderTriangles = 11
25
+ X_RenderTriStrip = 12
26
+ X_RenderTriFan = 13
27
+ X_RenderColorTrapezoids = 14
28
+ X_RenderColorTriangles = 15
29
+ # X_RenderTransform = 16
30
+ X_RenderCreateGlyphSet = 17
31
+ X_RenderReferenceGlyphSet = 18
32
+ X_RenderFreeGlyphSet = 19
33
+ X_RenderAddGlyphs = 20
34
+ X_RenderAddGlyphsFromPicture = 21
35
+ X_RenderFreeGlyphs = 22
36
+ X_RenderCompositeGlyphs8 = 23
37
+ X_RenderCompositeGlyphs16 = 24
38
+ X_RenderCompositeGlyphs32 = 25
39
+ X_RenderFillRectangles = 26
40
+ X_RenderCreateCursor = 27
41
+ X_RenderSetPictureTransform = 28
42
+ X_RenderQueryFilters = 29
43
+ X_RenderSetPictureFilter = 30
44
+ X_RenderCreateAnimCursor = 31
45
+ X_RenderAddTraps = 32
46
+ X_RenderCreateSolidFill = 33
47
+ X_RenderCreateLinearGradient = 34
48
+ X_RenderCreateRadialGradient = 35
49
+ X_RenderCreateConicalGradient = 36
50
+ RenderNumberRequests = (X_RenderCreateConicalGradient+1)
51
+ BadPictFormat = 0
52
+ BadPicture = 1
53
+ BadPictOp = 2
54
+ BadGlyphSet = 3
55
+ BadGlyph = 4
56
+ RenderNumberErrors = (BadGlyph+1)
57
+ PictTypeIndexed = 0
58
+ PictTypeDirect = 1
59
+ PictOpMinimum = 0
60
+ PictOpClear = 0
61
+ PictOpSrc = 1
62
+ PictOpDst = 2
63
+ PictOpOver = 3
64
+ PictOpOverReverse = 4
65
+ PictOpIn = 5
66
+ PictOpInReverse = 6
67
+ PictOpOut = 7
68
+ PictOpOutReverse = 8
69
+ PictOpAtop = 9
70
+ PictOpAtopReverse = 10
71
+ PictOpXor = 11
72
+ PictOpAdd = 12
73
+ PictOpSaturate = 13
74
+ PictOpMaximum = 13
75
+ PictOpDisjointMinimum = 0x10
76
+ PictOpDisjointClear = 0x10
77
+ PictOpDisjointSrc = 0x11
78
+ PictOpDisjointDst = 0x12
79
+ PictOpDisjointOver = 0x13
80
+ PictOpDisjointOverReverse = 0x14
81
+ PictOpDisjointIn = 0x15
82
+ PictOpDisjointInReverse = 0x16
83
+ PictOpDisjointOut = 0x17
84
+ PictOpDisjointOutReverse = 0x18
85
+ PictOpDisjointAtop = 0x19
86
+ PictOpDisjointAtopReverse = 0x1a
87
+ PictOpDisjointXor = 0x1b
88
+ PictOpDisjointMaximum = 0x1b
89
+ PictOpConjointMinimum = 0x20
90
+ PictOpConjointClear = 0x20
91
+ PictOpConjointSrc = 0x21
92
+ PictOpConjointDst = 0x22
93
+ PictOpConjointOver = 0x23
94
+ PictOpConjointOverReverse = 0x24
95
+ PictOpConjointIn = 0x25
96
+ PictOpConjointInReverse = 0x26
97
+ PictOpConjointOut = 0x27
98
+ PictOpConjointOutReverse = 0x28
99
+ PictOpConjointAtop = 0x29
100
+ PictOpConjointAtopReverse = 0x2a
101
+ PictOpConjointXor = 0x2b
102
+ PictOpConjointMaximum = 0x2b
103
+ PictOpBlendMinimum = 0x30
104
+ PictOpMultiply = 0x30
105
+ PictOpScreen = 0x31
106
+ PictOpOverlay = 0x32
107
+ PictOpDarken = 0x33
108
+ PictOpLighten = 0x34
109
+ PictOpColorDodge = 0x35
110
+ PictOpColorBurn = 0x36
111
+ PictOpHardLight = 0x37
112
+ PictOpSoftLight = 0x38
113
+ PictOpDifference = 0x39
114
+ PictOpExclusion = 0x3a
115
+ PictOpHSLHue = 0x3b
116
+ PictOpHSLSaturation = 0x3c
117
+ PictOpHSLColor = 0x3d
118
+ PictOpHSLLuminosity = 0x3e
119
+ PictOpBlendMaximum = 0x3e
120
+ PolyEdgeSharp = 0
121
+ PolyEdgeSmooth = 1
122
+ PolyModePrecise = 0
123
+ PolyModeImprecise = 1
124
+ CPRepeat = (1 << 0)
125
+ CPAlphaMap = (1 << 1)
126
+ CPAlphaXOrigin = (1 << 2)
127
+ CPAlphaYOrigin = (1 << 3)
128
+ CPClipXOrigin = (1 << 4)
129
+ CPClipYOrigin = (1 << 5)
130
+ CPClipMask = (1 << 6)
131
+ CPGraphicsExposure = (1 << 7)
132
+ CPSubwindowMode = (1 << 8)
133
+ CPPolyEdge = (1 << 9)
134
+ CPPolyMode = (1 << 10)
135
+ CPDither = (1 << 11)
136
+ CPComponentAlpha = (1 << 12)
137
+ CPLastBit = 12
138
+ FilterNearest = 'nearest'
139
+ FilterBilinear = 'bilinear'
140
+ FilterConvolution = 'convolution'
141
+ FilterFast = 'fast'
142
+ FilterGood = 'good'
143
+ FilterBest = 'best'
144
+ FilterAliasNone = -1
145
+ SubPixelUnknown = 0
146
+ SubPixelHorizontalRGB = 1
147
+ SubPixelHorizontalBGR = 2
148
+ SubPixelVerticalRGB = 3
149
+ SubPixelVerticalBGR = 4
150
+ SubPixelNone = 5
151
+ RepeatNone = 0
152
+ RepeatNormal = 1
153
+ RepeatPad = 2
154
+ RepeatReflect = 3
155
+ end
@@ -0,0 +1,15 @@
1
+ #
2
+ # Copyleft meh. [http://meh.paranoid.pk | meh@paranoici.org]
3
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
4
+ #
5
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
6
+ # the LICENSE file found in the top-level directory of this distribution and at
7
+ # http://github.com/christopheraue/ruby-xlib.
8
+ #
9
+
10
+ module FFI
11
+ typedef :XID, :Glyph
12
+ typedef :XID, :GlyphSet
13
+ typedef :XID, :Picture
14
+ typedef :XID, :PictFormat
15
+ end
data/lib/x/types.rb ADDED
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ module FFI
10
+ typedef :ulong, :XID
11
+ typedef :ulong, :Mask
12
+ typedef :ulong, :Atom
13
+ typedef :ulong, :VisualID
14
+ typedef :ulong, :Time
15
+ typedef :XID, :Window
16
+ typedef :XID, :Drawable
17
+ typedef :XID, :Font
18
+ typedef :XID, :Pixmap
19
+ typedef :XID, :Cursor
20
+ typedef :XID, :Colormap
21
+ typedef :XID, :GContext
22
+ typedef :XID, :KeySym
23
+ typedef :uchar, :KeyCode
24
+ end
data/lib/xlib.rb ADDED
@@ -0,0 +1,29 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ require 'ffi'
10
+
11
+ module Xlib
12
+ extend FFI::Library
13
+
14
+ begin
15
+ ffi_lib 'X11'
16
+ def self.available?; true end
17
+ rescue LoadError => e
18
+ def self.available?; false end
19
+ end
20
+ end
21
+
22
+ require_relative 'x'
23
+ require_relative 'xlib/constants'
24
+ require_relative 'xlib/types'
25
+ require_relative 'xlib/extensions'
26
+
27
+ if Xlib.available?
28
+ require_relative 'xlib/functions'
29
+ end
@@ -0,0 +1,119 @@
1
+ #
2
+ # Copyright (c) 2014, Christopher Aue <mail@christopheraue.net>
3
+ #
4
+ # This file is part of the ruby xlib gem. It is subject to the license terms in
5
+ # the LICENSE file found in the top-level directory of this distribution and at
6
+ # http://github.com/christopheraue/ruby-xlib.
7
+ #
8
+
9
+ module Xlib
10
+ QueuedAlready = 0
11
+ QueuedAfterReading = 1
12
+ QueuedAfterFlush = 2
13
+
14
+ XNRequiredCharSet = 'requiredCharSet'
15
+ XNQueryOrientation = 'queryOrientation'
16
+ XNBaseFontName = 'baseFontName'
17
+ XNOMAutomatic = 'omAutomatic'
18
+ XNMissingCharSet = 'missingCharSet'
19
+ XNDefaultString = 'defaultString'
20
+ XNOrientation = 'orientation'
21
+ XNDirectionalDependentDrawing = 'directionalDependentDrawing'
22
+ XNContextualDrawing = 'contextualDrawing'
23
+ XNFontInfo = 'fontInfo'
24
+
25
+ XIMPreeditArea = 0x0001
26
+ XIMPreeditCallbacks = 0x0002
27
+ XIMPreeditPosition = 0x0004
28
+ XIMPreeditNothing = 0x0008
29
+ XIMPreeditNone = 0x0010
30
+ XIMStatusArea = 0x0100
31
+ XIMStatusCallbacks = 0x0200
32
+ XIMStatusNothing = 0x0400
33
+ XIMStatusNone = 0x0800
34
+
35
+ XNVaNestedList = 'XNVaNestedList'
36
+ XNQueryInputStyle = 'queryInputStyle'
37
+ XNClientWindow = 'clientWindow'
38
+ XNInputStyle = 'inputStyle'
39
+ XNFocusWindow = 'focusWindow'
40
+ XNResourceName = 'resourceName'
41
+ XNResourceClass = 'resourceClass'
42
+ XNGeometryCallback = 'geometryCallback'
43
+ XNDestroyCallback = 'destroyCallback'
44
+ XNFilterEvents = 'filterEvents'
45
+ XNPreeditStartCallback = 'preeditStartCallback'
46
+ XNPreeditDoneCallback = 'preeditDoneCallback'
47
+ XNPreeditDrawCallback = 'preeditDrawCallback'
48
+ XNPreeditCaretCallback = 'preeditCaretCallback'
49
+ XNPreeditStateNotifyCallback = 'preeditStateNotifyCallback'
50
+ XNPreeditAttributes = 'preeditAttributes'
51
+ XNStatusStartCallback = 'statusStartCallback'
52
+ XNStatusDoneCallback = 'statusDoneCallback'
53
+ XNStatusDrawCallback = 'statusDrawCallback'
54
+ XNStatusAttributes = 'statusAttributes'
55
+ XNArea = 'area'
56
+ XNAreaNeeded = 'areaNeeded'
57
+ XNSpotLocation = 'spotLocation'
58
+ XNColormap = 'colorMap'
59
+ XNStdColormap = 'stdColorMap'
60
+ XNForeground = 'foreground'
61
+ XNBackground = 'background'
62
+ XNBackgroundPixmap = 'backgroundPixmap'
63
+ XNFontSet = 'fontSet'
64
+ XNLineSpace = 'lineSpace'
65
+ XNCursor = 'cursor'
66
+ XNQueryIMValuesList = 'queryIMValuesList'
67
+ XNQueryICValuesList = 'queryICValuesList'
68
+ XNVisiblePosition = 'visiblePosition'
69
+ XNR6PreeditCallback = 'r6PreeditCallback'
70
+ XNStringConversionCallback = 'stringConversionCallback'
71
+ XNStringConversion = 'stringConversion'
72
+ XNResetState = 'resetState'
73
+ XNHotKey = 'hotKey'
74
+ XNHotKeyState = 'hotKeyState'
75
+ XNPreeditState = 'preeditState'
76
+ XNSeparatorofNestedList = 'separatorofNestedList'
77
+
78
+ XBufferOverflow = -1
79
+
80
+ XLookupNone = 1
81
+ XLookupChars = 2
82
+ XLookupKeySym = 3
83
+ XLookupBoth = 4
84
+
85
+ XIMReverse = 1
86
+ XIMUnderline = (1<<1)
87
+ XIMHighlight = (1<<2)
88
+ XIMPrimary = (1<<5)
89
+ XIMSecondary = (1<<6)
90
+ XIMTertiary = (1<<7)
91
+ XIMVisibleToForward = (1<<8)
92
+ XIMVisibleToBackword = (1<<9)
93
+ XIMVisibleToCenter = (1<<10)
94
+
95
+ XIMPreeditUnKnown = 0
96
+ XIMPreeditEnable = 1
97
+ XIMPreeditDisable = (1<<1)
98
+
99
+ XIMInitialState = 1
100
+ XIMPreserveState = (1<<1)
101
+
102
+ XIMStringConversionLeftEdge = (0x00000001)
103
+ XIMStringConversionRightEdge = (0x00000002)
104
+ XIMStringConversionTopEdge = (0x00000004)
105
+ XIMStringConversionBottomEdge = (0x00000008)
106
+ XIMStringConversionConcealed = (0x00000010)
107
+ XIMStringConversionWrapped = (0x00000020)
108
+
109
+ XIMStringConversionBuffer = (0x0001)
110
+ XIMStringConversionLine = (0x0002)
111
+ XIMStringConversionWord = (0x0003)
112
+ XIMStringConversionChar = (0x0004)
113
+
114
+ XIMStringConversionSubstitution = (0x0001)
115
+ XIMStringConversionRetrieval = (0x0002)
116
+
117
+ XIMHotKeyStateON = (0x0001)
118
+ XIMHotKeyStateOFF = (0x0002)
119
+ end