Commit graph

25 commits

Author SHA1 Message Date
Vidar Hokstad
2fb378f1ff Fix include to match updates names 2021-09-23 19:23:16 +01:00
Richard Ramsden
ad10e78306 Major refactor of packet builder
I decided to ditch the Packet class name and go with a Form module
that contains a BaseForm which child classes inherit from.

I've created a few tests so you can see how the BaseForm class
works and how packets can be read and sent over a socket to
an X11 server
2012-05-20 17:36:18 -07:00
Richard Ramsden
a503b8391e add method to give unique ids for x11 resources
X11 Protocol expects clients to track unique identifiers in order to reduce 
network traffic. This reduces network traffic because when you create a new
resource say a window the X11 server doesn't have to reply with the ID
of the newly created resource. This makes the X11 protocol extremely fast
since most requests the server doesn't need to reply to a message.

In the first packet returned from X11 they give you a 
resource-id-mask and a resource-id-base. You can use these values to
generate a unique id for X11.
2012-05-19 15:47:50 -07:00
Richard Ramsden
1dafc7ee61 add opcode field to packets
X11 requests must contain an opcode field
to be sent so the X11 server can identify
the request
2012-05-19 13:17:16 -07:00
Richard Ramsden
736e4d179b use OpenStruct instead of returning a hash value
When we created a Packet object before using
Packet.read would return a hash. Instead, return
an OpenStruct object which makes accessing
parameters easier
2012-05-19 13:14:47 -07:00
Richard Ramsden
13f78a85a0 pretty print display class 2012-05-19 12:03:23 -07:00
Richard Ramsden
1bb7cc9f6b add more types 2012-05-19 11:59:21 -07:00
Richard Ramsden
e94a3450fa List data types now working 2012-05-13 11:48:24 -07:00
Richard Ramsden
9f62ffbc11 packet ecoding/decoding now works 2012-05-12 16:46:48 -07:00
Richard Ramsden
336a418a6a ruby-x11 now successfully established a connection 2012-05-06 20:30:29 -07:00
Richard Ramsden
6f281d14ff We dont need to pass lengths of strings
Instead of manually passing lengths of strings
we can check the length of the parameter
passed in when we construct the packet
2012-05-06 19:05:33 -07:00
Richard Ramsden
bbc950ae39 these should all inherit from X11Error 2012-03-11 22:37:44 -07:00
Richard Ramsden
5663788eb8 inherit custom errors from StandardError 2012-03-11 22:33:22 -07:00
Richard Ramsden
910924a36d Merge remote-tracking branch 'matt/master'
Conflicts:
	lib/X11.rb
	lib/X11/auth.rb
	lib/X11/protocol.rb
2012-03-11 22:20:53 -07:00
Richard Ramsden
75b7bde359 add docs for encode.rb 2012-03-11 15:11:49 -07:00
Richard Ramsden
8b74338037 this is no longer used 2012-03-11 14:38:06 -07:00
Richard Ramsden
e6f63e926e add extra docs to packet.rb 2012-03-11 14:37:50 -07:00
Richard Ramsden
3bee98236e library now succesfully connects to an X11 server :) 2012-03-11 14:18:30 -07:00
Matthias Beyer
11ac2cd2c6 added error/exception classes for better handling 2012-03-11 20:28:09 +01:00
Matthias Beyer
a6999815de shortened 2012-03-11 20:27:45 +01:00
Richard Ramsden
88152ffee6 remove whitespace 2012-03-08 21:52:42 -08:00
Richard Ramsden
4d243c1644 get rid of jeweler 2012-03-08 21:51:31 -08:00
Matthias Beyer
0e65d44f97 fixed typo 2012-03-08 09:14:05 +01:00
Matthias Beyer
73349fe703 shortened and speedup code - removed method #displays which was just called from within the class 2012-03-07 23:13:51 +01:00
Richard Ramsden
943eb399c7 first commit 2011-07-31 21:51:22 -07:00