eventmachine-vnc 0.1.20101208010250 → 0.2.20101208014816

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 (2) hide show
  1. data/lib/eventmachine/protocols/vnc.rb +14 -0
  2. metadata +18 -4
@@ -41,6 +41,7 @@ module EventMachine; module Protocols
41
41
  end
42
42
  end # def receive_data
43
43
 
44
+ private
44
45
  def handshake
45
46
  return :wait if @buffer.length < 12
46
47
 
@@ -52,6 +53,7 @@ module EventMachine; module Protocols
52
53
  @state = :security
53
54
  end # def handshake
54
55
 
56
+ private
55
57
  def security
56
58
  return :wait if @buffer.length < 4
57
59
  security_type = consume(4).unpack("N").first
@@ -75,6 +77,7 @@ module EventMachine; module Protocols
75
77
  end # def security
76
78
 
77
79
  # Page 14, RFB 3.7 PDF
80
+ private
78
81
  def security_vnc_authentication
79
82
  # TODO(sissel): implement VNC auth (DES a 16 byte challenge + password)
80
83
  # Except the password is bitwise-reversed.
@@ -89,6 +92,7 @@ module EventMachine; module Protocols
89
92
  @state = :security_result
90
93
  end # def security_vnc_authentication
91
94
 
95
+ private
92
96
  def security_result
93
97
  return :wait if @buffer.length < 4
94
98
  result = consume(4).unpack("N").first
@@ -100,6 +104,7 @@ module EventMachine; module Protocols
100
104
  end # def security_result
101
105
 
102
106
  # ClientInit is 1 byte, U8. Value is 'shared-flag' nonzero is true.
107
+ private
103
108
  def client_init
104
109
  shared = [1].pack("C")
105
110
  send_data(shared)
@@ -113,6 +118,7 @@ module EventMachine; module Protocols
113
118
  # 16, PIXEL_FORMAT, server-pixel-format
114
119
  # 4, U32, name-length
115
120
  # <name-length>, U8 array, name-string
121
+ private
116
122
  def server_init
117
123
  return :wait if @buffer.length < 24
118
124
  @screen_width, @screen_height, @pixel_format, @name_length = \
@@ -121,6 +127,7 @@ module EventMachine; module Protocols
121
127
  @state = :server_init_name
122
128
  end
123
129
 
130
+ private
124
131
  def server_init_name
125
132
  return :wait if @buffer.length < @name_length
126
133
  @name = consume(@name_length)
@@ -129,10 +136,12 @@ module EventMachine; module Protocols
129
136
  ready if self.respond_to?(:ready)
130
137
  end
131
138
 
139
+ private
132
140
  def read_error
133
141
  error(@buffer)
134
142
  end
135
143
 
144
+ private
136
145
  def consume(bytes)
137
146
  result = @buffer[0 .. bytes - 1]
138
147
  @buffer = @buffer[bytes .. -1]
@@ -146,6 +155,11 @@ module EventMachine; module Protocols
146
155
  raise message
147
156
  end
148
157
  end
158
+
159
+ def pointerevent(x, y, buttonmask)
160
+ message = [ POINTER_EVENT, buttonmask, x, y ].pack("CCnn")
161
+ send_data(message)
162
+ end
149
163
  end # module Client
150
164
  end # module VNC
151
165
  end; end # module EventMachine::Protocols
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventmachine-vnc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 40202416020495
4
+ hash: 40202416029655
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 20101208010250
10
- version: 0.1.20101208010250
8
+ - 2
9
+ - 20101208014816
10
+ version: 0.2.20101208014816
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel
@@ -32,6 +32,20 @@ dependencies:
32
32
  version: "0"
33
33
  type: :runtime
34
34
  version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: ruby-vnc
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id002
35
49
  description: VNC for EventMachine
36
50
  email: jls@semicomplete.com
37
51
  executables: []