summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlanCoopersmith <AlanCoopersmith@web>2013-08-25 14:08:37 -0700
committerxorg <iki-xorg@freedesktop.org>2013-08-25 14:08:37 -0700
commitcddeb9f9a3076c11c3ce06ba9dbe80e2fe4fc079 (patch)
tree05e5756b11edbe15fc26f6668b49ef6b21225e10
parent938167f7f7f9229b46c93d1dae5258345657c240 (diff)
fix formatting after moin->iki conversion
-rw-r--r--Development/Documentation/DevPrivates.mdwn31
1 files changed, 16 insertions, 15 deletions
diff --git a/Development/Documentation/DevPrivates.mdwn b/Development/Documentation/DevPrivates.mdwn
index 3235c070..ce11daef 100644
--- a/Development/Documentation/DevPrivates.mdwn
+++ b/Development/Documentation/DevPrivates.mdwn
@@ -1,7 +1,6 @@
+devPrivates are a way to store information in a struct without modifying the header for the struct, thus keeping the ABI.
-devPrivates are a way to store information in a struct without modifying the header for the struct, thus keeping the ABI.
-
-Each major struct ([[ScreenRec|ScreenRec]], [[DeviceIntRec|DeviceIntRec]], [[WindowRec|WindowRec]], [[ClientRec|ClientRec]]) has a pointer to it's devPrivates as part of the struct. The usage of the devPrivates is as follows:
+Each major struct (ScreenRec, DeviceIntRec, WindowRec, ClientRec) has a pointer to it's devPrivates as part of the struct. The usage of the devPrivates is as follows:
[[!format txt """
@@ -38,22 +37,23 @@ void delete_private(ClientPtr client)
}
"""]]
-devPrivates are more fully documented in the _Definition of the Porting Layer for the X v11 Sample Server_ document, sources of which are in [[xorg-docs/sgml/core/Xserver-spec.sgml|http://cgit.freedesktop.org/xorg/doc/xorg-docs/tree/sgml/core/Xserver-spec.sgml]]
+
+devPrivates are more fully documented in the _Definition of the Porting Layer for the X v11 Sample Server_ document, sources of which are in [[xorg-docs/sgml/core/Xserver-spec.sgml|http://cgit.freedesktop.org/xorg/doc/xorg-docs/tree/sgml/core/Xserver-spec.sgml]]
# Deprecated information
-The following is a description of the devPrivates system before the serious overhaul. It is now outdated.
+The following is a description of the devPrivates system before the serious overhaul. It is now outdated.
-Client devPrivates are similar to those of the [[ScreenRec|ScreenRec]] and [[DeviceIntRec|DeviceIntRec]] structures, but those have their own API to initialize and access them. Please note that there a overhaul of the devPrivates system in progress and this information may be out of date soon [[http://lists.freedesktop.org/archives/xorg/2007-March/022212.html|http://lists.freedesktop.org/archives/xorg/2007-March/022212.html]].
+Client devPrivates are similar to those of the ScreenRec and DeviceIntRec structures, but those have their own API to initialize and access them. Please note that there a overhaul of the devPrivates system in progress and this information may be out of date soon - see <http://lists.freedesktop.org/archives/xorg/2007-March/022212.html>.
-Need to be initialised at start time, as each time a client is allocated. The devPrivates are an array of [[DevUnions|DevUnions]] that are allocated when the client starts and released when the client finishes. Each client has the same size allocated for devPrivates and at the moment there are no methods to resize the array at a later point in time. Better make sure you allocate everything on server startup before the first client connects.
+Need to be initialised at start time, as each time a client is allocated. The devPrivates are an array of DevUnions that are allocated when the client starts and released when the client finishes. Each client has the same size allocated for devPrivates and at the moment there are no methods to resize the array at a later point in time. Better make sure you allocate everything on server startup before the first client connects.
-_[[AllocateClientPrivatesIndex|AllocateClientPrivatesIndex]]()_ gives you an index into the array. Each time you need to access your data, access it with `client->devPrivates[MyIndex].ptr` and cast it to your specific data information. Immediately after retrieving your index, call _[[AllocateClientPrivate|AllocateClientPrivate]]([[MyIndex|MyIndex]], size)_, where size is the number of bytes you need for your private struct in bytes. You can now assume that every client that connects will have enough space for your data.
+_AllocateClientPrivatesIndex()_ gives you an index into the array. Each time you need to access your data, access it with `client->devPrivates[MyIndex].ptr` and cast it to your specific data information. Immediately after retrieving your index, call _AllocateClientPrivate(MyIndex, size)_, where size is the number of bytes you need for your private struct in bytes. You can now assume that every client that connects will have enough space for your data.
-Finally, you will probably want to add a callback to reset the data when a client starts up. Use _[[AddCallback|AddCallback]]()_ to register your function and then do stuff. The first argument is always the same (_[[ClientStateCallback|ClientStateCallback]]_), the second your callback proc and the third one some pointer data which will get passed into the callback function (argument {{closure]] in example below). Most extensions just pass in 0. You need to check the state of the client in the callback function. If client->state is [[ClientStateRunning|ClientStateRunning]] then the client has just started up, [[ClientStateGone|ClientStateGone]] or [[ClientStateRetained|ClientStateRetained]] means it has been shut down. There are a few other states. (comment by Eamon Walsh)
+Finally, you will probably want to add a callback to reset the data when a client starts up. Use _AddCallback()_ to register your function and then do stuff. The first argument is always the same (_ClientStateCallback_), the second your callback proc and the third one some pointer data which will get passed into the callback function (argument _closure_ in example below). Most extensions just pass in 0. You need to check the state of the client in the callback function. If client->state is ClientStateRunning then the client has just started up, ClientStateGone or ClientStateRetained means it has been shut down. There are a few other states. (comment by Eamon Walsh)
-I recommend looking at damageext/damageext.c, it has a low signal-to-noise ratio. The full code you need:
+I recommend looking at damageext/damageext.c, it has a low signal-to-noise ratio. The full code you need:
[[!format txt """
@@ -71,17 +71,17 @@ static void MyCallbackProc(CallbackListPtr *list, pointer closure, pointer data)
}
"""]]
-Finally, you want to add a _[[DeleteCallback|DeleteCallback]]()_ call to remove your callback when the extension resets.
+Finally, you want to add a _DeleteCallback()_ call to remove your callback when the extension resets.
## Notes
-The client that owns the root window is `serverClient` and will be created before extensions initialize. It will (most likely) not have devPrivates set to what you added, so make sure you cater for this.
+The client that owns the root window is `serverClient` and will be created before extensions initialize. It will (most likely) not have devPrivates set to what you added, so make sure you cater for this.
### Window DevPrivates
-The devPrivates of a [[WindowRec|WindowRec]] are stored after the struct's memory. Each screen keeps a totalWindowSize for the memory that is to be allocated per screen. The memory for a [[WindowRec|WindowRec]] with 4 devPrivates entries looks approximately like this:
+The devPrivates of a WindowRec are stored after the struct's memory. Each screen keeps a totalWindowSize for the memory that is to be allocated per screen. The memory for a WindowRec with 4 devPrivates entries looks approximately like this:
[[!format txt """
@@ -95,6 +95,7 @@ The devPrivates of a [[WindowRec|WindowRec]] are stored after the struct's memor
| |__________|__________|
|______________|
"""]]
-With `1 = &A, 2 = &B, `etc. Before you allocate a window, you need to call _[[AllocateWindowPrivate|AllocateWindowPrivate]]()_ with the size you need for your entry. A, B, C, D have the sizes that were specified for _[[AllocateWindowPrivate|AllocateWindowPrivate]]_
+With `1 = &A, 2 = &B, `etc. Before you allocate a window, you need to call _AllocateWindowPrivate()_ with the size you need for your entry. A, B, C, D have the sizes that were specified for _AllocateWindowPrivate_
---- [[CategoryServerInternals|CategoryServerInternals]]
+---
+[[CategoryServerInternals]]