Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar-wayland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar-wayland
Commits
28e41603
Commit
28e41603
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Store high-level protocol wrappers (Up/Down) in Object
parent
01389117
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Quasar/Wayland/Protocol/Core.hs
+5
-5
5 additions, 5 deletions
src/Quasar/Wayland/Protocol/Core.hs
with
5 additions
and
5 deletions
src/Quasar/Wayland/Protocol/Core.hs
+
5
−
5
View file @
28e41603
...
@@ -242,7 +242,7 @@ class IsInterfaceSide s i => IsInterfaceHandler s i a where
...
@@ -242,7 +242,7 @@ class IsInterfaceSide s i => IsInterfaceHandler s i a where
-- | Data kind
-- | Data kind
data
Side
=
Client
|
Server
data
Side
=
Client
|
Server
data
Object
s
i
=
IsInterfaceSide
s
i
=>
Object
(
ProtocolHandle
s
)
GenericObjectId
(
WireCallback
s
i
)
data
Object
s
i
=
IsInterfaceSide
s
i
=>
Object
(
ProtocolHandle
s
)
GenericObjectId
(
Up
s
i
)
(
Down
s
i
)
(
WireCallback
s
i
)
instance
IsInterface
i
=>
Show
(
Object
s
i
)
where
instance
IsInterface
i
=>
Show
(
Object
s
i
)
where
show
=
showObject
show
=
showObject
...
@@ -258,7 +258,7 @@ class IsObjectSide a where
...
@@ -258,7 +258,7 @@ class IsObjectSide a where
describeDownMessage
::
a
->
Opcode
->
BSL
.
ByteString
->
String
describeDownMessage
::
a
->
Opcode
->
BSL
.
ByteString
->
String
instance
forall
s
i
.
IsInterface
i
=>
IsObject
(
Object
s
i
)
where
instance
forall
s
i
.
IsInterface
i
=>
IsObject
(
Object
s
i
)
where
objectId
(
Object
_
oId
_
)
=
oId
objectId
(
Object
_
oId
_
_
_
)
=
oId
objectInterfaceName
_
=
interfaceName
@
i
objectInterfaceName
_
=
interfaceName
@
i
instance
forall
s
i
.
IsInterfaceSide
s
i
=>
IsObjectSide
(
Object
s
i
)
where
instance
forall
s
i
.
IsInterfaceSide
s
i
=>
IsObjectSide
(
Object
s
i
)
where
...
@@ -452,7 +452,7 @@ initializeProtocol wlDisplayWireCallback initializationAction = do
...
@@ -452,7 +452,7 @@ initializeProtocol wlDisplayWireCallback initializationAction = do
}
}
writeTVar
stateVar
(
Right
state
)
writeTVar
stateVar
(
Right
state
)
let
wlDisplay
=
Object
protocol
wlDisplayId
wlDisplayWireCallback
let
wlDisplay
=
Object
protocol
wlDisplayId
undefined
undefined
wlDisplayWireCallback
modifyTVar'
objectsVar
(
HM
.
insert
wlDisplayId
(
SomeObject
wlDisplay
))
modifyTVar'
objectsVar
(
HM
.
insert
wlDisplayId
(
SomeObject
wlDisplay
))
result
<-
runReaderT
(
initializationAction
wlDisplay
)
state
result
<-
runReaderT
(
initializationAction
wlDisplay
)
state
...
@@ -546,7 +546,7 @@ newObjectFromId (NewId oId) callback = do
...
@@ -546,7 +546,7 @@ newObjectFromId (NewId oId) callback = do
protocol
<-
askProtocol
protocol
<-
askProtocol
let
let
genericObjectId
=
toGenericObjectId
oId
genericObjectId
=
toGenericObjectId
oId
object
=
Object
protocol
genericObjectId
callback
object
=
Object
protocol
genericObjectId
undefined
undefined
callback
someObject
=
SomeObject
object
someObject
=
SomeObject
object
modifyProtocolVar
(
.
objectsVar
)
(
HM
.
insert
genericObjectId
someObject
)
modifyProtocolVar
(
.
objectsVar
)
(
HM
.
insert
genericObjectId
someObject
)
pure
object
pure
object
...
@@ -606,7 +606,7 @@ getMessageAction
...
@@ -606,7 +606,7 @@ getMessageAction
=>
Object
s
i
=>
Object
s
i
->
Opcode
->
Opcode
->
Get
(
ProtocolM
s
()
)
->
Get
(
ProtocolM
s
()
)
getMessageAction
object
@
(
Object
_
_
objectHandler
)
opcode
=
do
getMessageAction
object
@
(
Object
_
_
_
_
objectHandler
)
opcode
=
do
verifyMessage
<-
getWireDown
object
opcode
verifyMessage
<-
getWireDown
object
opcode
pure
$
handleMessage
objectHandler
object
=<<
verifyMessage
pure
$
handleMessage
objectHandler
object
=<<
verifyMessage
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment