Hi Andy,
since the marshalling of bit-fields is difficult, it might be
worthwhile trying to do things completely differently.
You could try to serialize an event using the following strategy:
- query the size of the event
- read each of the bytes in an event and serialize them (in hex or so)
-
Hi Axel,
Axel Simon writes:
> Hi Andy,
>
> On Jul 4, 2010, at 16:20, Andy Stewart wrote:
>>>
>>> pokeSerializedEventKey ptr (SerializedEvent
>>> (SerializedEventKeyValue
>>> {
>>> [..]
>>> ,sEventString = string_
>>> }) window_) = do
>>> str <- newCString string_
>>> [..]
>>> #{poke GdkEventKey,
Hi Andy,
On Jul 4, 2010, at 16:20, Andy Stewart wrote:
>>
>> pokeSerializedEventKey ptr (SerializedEvent
>> (SerializedEventKeyValue
>> {
>> [..]
>> ,sEventString = string_
>> }) window_) = do
>> str <- newCString string_
>> [..]
>> #{poke GdkEventKey, string} ptr str
>> Here, you leak the space o
Hi Axel,
Axel Simon writes:
> H Andy,
>
> a few comment:
>
> - you make your SerializedEvent an instance of Storable. That could work, but
> you really have to
> ensure that the size of the C structure you allocated is big enough. At the
> moment, you have
>
> instance Storable SerializedEven
H Andy,
a few comment:
- you make your SerializedEvent an instance of Storable. That could
work, but you really have to ensure that the size of the C structure
you allocated is big enough. At the moment, you have
instance Storable SerializedEvent where
sizeOf _ = #{const sizeof (GdkEventKey)