Commit Graph

37 Commits

Author SHA1 Message Date
Alexander Larsson
12b08f2c3e codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using
the C struct array-at-end-of-struct. To make this work we also remove
all use of @end for switches (making them C unions).

We drop the zero member of the notify message so that we can avoid this
use of @end for a primitive in the marshaller (plus its useless to send
over the wire).

We change the offsets and stuff in the migration messages to real pointers.
2010-07-19 16:28:22 +02:00
Alexander Larsson
2962bdaea0 codegen: Pass member to SubMarshallingSource rather than name
This way we can check attributes on the member.
2010-07-19 16:28:21 +02:00
Alexander Larsson
b8832e0391 codegen: Remove unused methos has_pointer() 2010-07-19 16:28:20 +02:00
Alexander Larsson
ceff16cad6 Make distcheck work 2010-07-08 20:20:35 +02:00
Alexander Larsson
9cc1582561 Fix inclusion of common files, no need for common/ part 2010-07-08 15:44:15 +02:00
Alexander Larsson
f0f623ddc0 codegen: No SPICE_ADDRESS types left, drop @c_ptr 2010-07-08 13:07:17 +02:00
Gerd Hoffmann
5ac88aa79f Properly parse QXLImage to the new-world SpiceImage
SpiceImage now replaces RedImage and has all image types in it.
All image data are now chunked (and as such not copied when demarshalling).
2010-07-07 23:58:33 +02:00
Alexander Larsson
26c1a0767f codegen: support @chunk on non-pointer arrays
This is similar to @as_ptr, but generates a single chunk of data.
2010-07-07 23:12:42 +02:00
Alexander Larsson
bda492f4aa Add support for @chunk 2010-07-07 23:12:42 +02:00
Alexander Larsson
96bb4d31f4 marshaller: Make get_nw_offset() handle deep member references 2010-07-07 23:12:42 +02:00
Alexander Larsson
f39d64f40b Convert SpicePath.segments to a pointer array 2010-07-05 20:45:13 +02:00
Alexander Larsson
6dcf43912e Handle extra size for switch and array the right way
Even for is_extra_size() we should calculate the mem_size for
arrays, its just that the parent type (in this case switch) should
request mem_size if the type is_extra_size.
2010-07-05 13:13:39 +02:00
Alexander Larsson
b8524fc338 marshaller: Add some docs describing the types of sizes 2010-07-05 13:13:09 +02:00
Alexander Larsson
d161994f46 marshaller: Make @nonnull a propagated attribute
This cleans up some stuff
2010-07-05 12:13:45 +02:00
Alexander Larsson
d7164a0669 marshaller: Make @c_ptr a propagated attribute
This simplifies some code
2010-07-05 12:09:08 +02:00
Alexander Larsson
4a60f1822a marshaller: Add generic way to handle propagating attributes
Also switches @ptr_array to use this
2010-07-05 12:03:34 +02:00
Gerd Hoffmann
3764a36472 Properly parse and marshall SpiceString 2010-07-02 16:47:51 +02:00
Alexander Larsson
4c74e73e1d Fix 32bit failure in demarshaller
Due to a typo we always read offsets as pointers, never as SPICE_ADDRESS.
2010-07-01 16:45:04 +02:00
Alexander Larsson
00e1caf45d Simplify SpiceLineAttr by removing unsed stuff
Also in new protocol don't send style data if not needed.
2010-06-30 22:35:17 +02:00
Alexander Larsson
1be4d5d26c Support @marshall to automatically marshall pointers 2010-06-30 22:35:17 +02:00
Alexander Larsson
a24a8ff72a Store SpicePath segment count rather than size
Internally and in the network protocol (for the new version) we
now store the actual number of segments rather than the size of the
full segments array in bytes. This change consists of multiple changes
to handle this:

* Make the qxl parser calculate num_segments
* Make the canvas stroke code handle the new SpicePath layout.
* Fix up is_equal_path in red_worker.c for the new layout
* replace multiple calls to spice_marshall_PathSegment with a single
  spice_marshall_Path call
* Make the byte_size() array size handling do the conversion from
  network size to number of elements when marshalling/demarshalling.
* Update the current spice protocol to send the segment count rather than
  the size
* Update the old spice protocol to use the new byte_size functionallity
  to calculate the size sent and the number of elements recieved
2010-06-30 22:35:17 +02:00
Alexander Larsson
bb85131765 demarshaller: Support @c_ptr attributes for pointers
A @c_ptr pointer is stored in memory as a real pointer rather than a
SPICE_ADDRESS. This is a temporary thing that will be removed again
when all SPICE_ADDRESSes have been converted to real pointer.
2010-06-30 22:35:16 +02:00
Alexander Larsson
a93351f367 demarshaller: Don't parse @zero members
These just write zeros at the right place in the network protocol
typically for old back-compat things. We don't want to read these
back in.
2010-06-30 22:35:16 +02:00
Alexander Larsson
b08b80d13f Fix build error due to member "SpiceMsgEmpty" same name as type 2010-06-28 12:45:07 +02:00
Alexander Larsson
dc8625c7e1 Make pointers 32bit in new protocol format 2010-06-23 16:33:07 +02:00
Alexander Larsson
929245bacd marshaller: Correctly determine if switches are fixed size
Switches are fixed size only if all cases have the same size *and*
it has a default case or all the valid cases are listed.
2010-06-23 16:33:07 +02:00
Alexander Larsson
06fe6a91c2 Fix handling of @ptr32 network size 2010-06-23 16:33:07 +02:00
Alexander Larsson
381025b1c3 Add support for @virtual markup in spice protocol
This means the member is not sent on the network at all.
Instead its initialized to the attribute argument when demarshalled.

This is useful for backwards compatibility support.
2010-06-22 16:03:34 +02:00
Alexander Larsson
759a3d5446 Make internal generated marshaller functions static 2010-06-22 16:03:02 +02:00
Alexander Larsson
c621b2bdf1 Support extra prefix in code generators
This is require when we add a new spice.proto for the old (major 1)
protocol description.
2010-06-22 16:01:57 +02:00
Alexander Larsson
5341b632e2 Support creating marshallers that are called indirectly
This is needed if we want to switch marshallers depending on what
major version the remote side has.
2010-06-22 10:54:59 +02:00
Alexander Larsson
9123e24e7b Add destructor for demarshalled messages
This is required because we don't want to free messages that just
refer to the unparsed message (like SpiceMsgData).

Also, in the future we might need it for more complex demarshalling.
2010-06-22 10:53:24 +02:00
Alexander Larsson
ae4436215c Make generated marshallers build on win32 2010-06-18 21:10:25 +02:00
Alexander Larsson
7fa29ea67e Support @as_ptr in demarshaller to avoid copying data unnecessary 2010-06-18 20:27:32 +02:00
Alexander Larsson
936b3f01f9 Add support for generating message and structure marshallers 2010-06-18 16:32:11 +02:00
Alexander Larsson
b228d18d5c Add python code to automake system 2010-06-18 16:32:11 +02:00
Alexander Larsson
0366e7395c Initial import of spice protocol description and demarshall generator
The "spice.proto" file describes in detail the networking prototcol
that spice uses and spice_codegen.py can parse this and generate
demarshallers for such network messages.
2010-06-18 16:32:10 +02:00