summaryrefslogtreecommitdiff
path: root/include/dix.h
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27Introduce a consistent coding styleKeith Packard1-366/+359
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
2011-12-22Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into ↵Peter Hutterer1-2/+2
multitouch Conflicts: configure.ac dix/inpututils.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-21Process and deliver touch eventsPeter Hutterer1-0/+6
Does not include pointer emulation handling. Does include partial ownership handling but not the actual processing of ownership events. Note: this commit is a retroactive commit extracted from a series of ~50 commits and may thus appear a bit more complicated than what you'd write out from scratch. Pointer processing tree is roughly: - ProcessOtherEvents - ProcessTouchEvents - DeliverTouchEvents - DeliverTouchBeginEvent|DeliverTouchEndEvent|... - DeliverOneTouchEvent Also hooks up the event history playing to the right function now. Co-authored-by: Daniel Stone <daniel@fooishbar.org> Co-authored-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-16Hook up TouchBegin/Update/End eventsPeter Hutterer1-0/+1
The are the same as device events internally but require the touch ID separately from the detail.button field (the protocol uses the detail field for the touch id). For simpler integration of pointer emulation we need to set the detail.button field while keeping the touchid around. Add the three new touch event types to the various places in the server where they need to be handled. The actual handling of the events is somewhat more complicated in most places. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-14Merge remote-tracking branch 'whot/for-keith'Keith Packard1-0/+5
2011-12-13dix: split grab event conversion and delivery into a helper functionPeter Hutterer1-0/+5
Effective functional change: XI2 events are checked with XACE now. DeliverOneGrabbedEvent is exported for future use by touch events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-12CompareISOLatin1Lowered: constify argumentsAlan Coopersmith1-2/+2
Allows callers to avoid deconstifying arguments when calling, fixing gcc warning: filter.c: In function 'PictureGetFilterId': filter.c:59:2: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-08Merge remote-tracking branch 'whot/for-keith'Keith Packard1-0/+1
2011-12-09dix: switch the syncEvent queue to a struct listPeter Hutterer1-0/+1
No effective functionality change, just cleanup to make this code slightly more sane. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-05Fix gcc warnings about redundant declarations of fallback functionsAlan Coopersmith1-0/+2
Ensure ffs, strndup, strlcat, etc. aren't defined by our headers if they're already defined in the system headers. This does export the HAVE_FFS, HAVE_STRNDUP, etc. definitions to drivers, but if you built the Xserver with a libc that had those, and then build the drivers with a less capable libc, you're going to have problems anyway, and this should solve some reported problems with conflicts between our strndup definition and gcc magic for it. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-10-28Fix position _X_EXPORTAlexandr Shadchin1-2/+2
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-08dix: rename ProcessRawEvents to dix/events.c:DeliverRawEventPeter Hutterer1-0/+5
No functional changes, prep work for future changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-05-13dix: return deliveries from DeliverGrabbedEventPeter Hutterer1-1/+1
This isn't currently used by any of the callers but it will likely be in the future. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-05-06Input: Make CheckPassiveGrabsOnWindow take InternalEventDaniel Stone1-1/+1
Previously, it only took DeviceEvents, but it would be much more useful if it took InternalEvents. Any event that activates a grab must still be a DeviceEvent, so put in a check to enforce this. Change all callers to make the appropriate casts. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-08dix: Remove deprecated.cAdam Jackson1-31/+0
No more internal users, this can be dropped now. Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-22dix: Add IsFloating(device) wrapper.Peter Hutterer1-0/+1
Simplifies check for floating devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
2011-01-06Input: Make CheckPassiveGrabsOnWindow return grab, exportDaniel Stone1-0/+7
Change CheckPassiveGrabsOnWindow to return the GrabPtr it used (or NULL if none) rather than a boolean, and export it. Also add an additional boolean 'activate' parameter; use TRUE for existing behaviour, or FALSE to only find the grab and then return it. This will be used in forthcoming touch patches to find the grabs, rather than open-coding same. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-13Move replay-window check from ComputeFreezes to CheckDeviceGrabs.Jamey Sharp1-1/+1
This just simplifies ComputeFreezes, eliminating some duplicated code and a goto. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-2/+2
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-22Declare functions that unconditionally call FatalError as _X_NORETURN.Jamey Sharp1-1/+1
For AtomError, this should fix a clang warning; in the other cases it's just good documentation. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07Introduce dixLookupFontable for "FONT or GC" parameters.Jamey Sharp1-0/+6
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-30Move callback definitions to their own fileKeith Packard1-30/+1
Needed as the privates stuff uses the callbacks before they would have been defined in dix.h Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-02-22Re-enable RECORD extension.Chris Dekter1-3/+3
RECORD was disabled during the switch to internal events. This patch modifies the record callback to work with internal events instead of xEvents. The InternalEvents are converted to core/Xi events as needed. Since record is a loadable extension, the EventTo* calls must be externed. Signed-off-by: Chris Dekter <cdekter@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-15Remove CopyISOLatin1LoweredYaakov Selkowitz1-5/+0
This function was moved verbatim into libXfont-1.4, and it is not used by the server or any drivers. Exporting it in both places leads to multiple definition linking errors on Cygwin, where we need to use a static libXfont due to poor weak-symbol handling. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-10-14dix: Export IsPointerDevice() and IsKeyboardDevice().Eamon Walsh1-2/+2
Makes the functions available to extmod for extensions to call. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-09-27Xi: Make CopyKeyClass X_HIDDEN to avoid ugly ifdef-fuJeremy Huddleston1-0/+1
(cherry picked from commit 6d436e17a9ae7f4ce8537f3fabc052d4f07ca75f)
2009-08-25Ensure that rotation updates happen frequentlyKeith Packard1-0/+6
The smart scheduler is designed to minimize scheduler overhead by increasing the interval between WaitForSomething calls when a single client is running. However, the software rotation code depends on its BlockHandler being invoked for screen updates; the long delays caused by the smart scheduler optimizations means that screen updates can be delayed a long time as well. The change is simple -- prevent the smart scheduler from increasing the scheduling interval while any screen is using software rotation. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-08-24input: move CorePointer/KeyboardProc declarations into header.Peter Hutterer1-0/+3
The extern declaration in xichangehierarchy.c was broken anyway. This fixes a crash on creating a new master device. Reported-by: Maxim Levitsky Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-23Xi: check for Use permission on the device in SetClientPointer().Eamon Walsh1-1/+1
Presumably, some intelligent, XI2-aware management app will be calling XISetClientPointer on behalf of other clients; this check makes sure the target client has permission on the device. Requires changing the prototype to return status code instead of Bool. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-12input: remove un-used "setter" argument from SetClientPointer.Peter Hutterer1-2/+1
It's obsolete, not likely to come back, let's drop it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-28Xi: Send Enter or Leave events with XIPassive(Un)grabNotifyPeter Hutterer1-0/+1
If a passive enter or focus in grab activates, send additional enter or focus events with mode XIPassiveGrabNotify to the grabbing client. Likewise, if the grab deactivates, send additional leave or focus out events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-27Xi: Add support for Enter and FocusIn grabs.Peter Hutterer1-0/+5
Enter grabs are checked for in CheckMotion(), each time the sprite window changes the current grab is deactivated (if applicable) and the new grab is activated (if applicable). Exception - if the grab is on a parent window of the current window since we keep the grab across descendants. Since CheckMotion() may change the grab status of a device, we mustn't get "dev->deviceGrab.grab" in ProcessOtherEvents until after CheckMotion(). FocusIn grabs are checked in much the same manner. The event delivery for grabs replaces the NotifyNormal on window change with a NotifyGrab on window change. Note that this happens before the grab activates, so the EnterNotify(NotifyGrab) is still delivered to the window, not to the grabbing client. This is in line with the core protocol semantics for NotifyGrab events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-22Input: rename DeviceIntRec->isMaster to ->type.Peter Hutterer1-0/+1
isMaster is not enough as long as we differ between master pointers and keyboard. With flexible device classes, the usual checks for whether a master device is a pointer (currently check for ->button, ->valuators or ->key) do not work as an SD may post an event through a master and mess this check up. Example, a device with valuators but no buttons would remove the button class from the VCP and thus result in the IsPointerDevice(inputInfo.pointer) == FALSE. This will become worse in the future when new device classes are introduced that aren't provided in the current system (e.g. a switch class). This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an IsMaster(dev).
2009-04-28dix: remove all but main() from main.cPeter Hutterer1-0/+1
All other functions are pushed into where they seemed to fit. main.c is now linked separately into libmain.a and linked in by the various DDXs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19dix: remove un-used parameter "core" from AllowSomePeter Hutterer1-2/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19input: use a GrabMask union in GrabDevice to allow for XI2 masks.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19input: replace GrabRec's coreGrab field with grabtype.Peter Hutterer1-1/+1
Don't allow grabs of different types to override each other. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20include: un-export a bunch of server-only functions.Peter Hutterer1-31/+30
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20dix: move ProcGrabPointer guts into GrabDevice.Peter Hutterer1-2/+4
Yes, this means we have even more arguments to GrabDevice. But it beats having a copy of most but not all of GrabDevice in ProcGrabPointer. Also, reshuffle the order of parameters, the CARD* status is a return value and should be last. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20dix: remove now obsolete mskidx parameter from DeliverEventsToWindow.Peter Hutterer1-2/+1
mskidx would always be dev->id anyway, so if we're already passing in the device, mskidx is superfluous.
2009-03-20Xext: purge XGE event masks.Peter Hutterer1-12/+0
The masks were originally designed to generically handle event masks for extensions. Since all that is in-server anyway, it's much better writing custom event masks for those extensions that need it and not providing a unified mechanism. XI2 needs more than the current implementation, which is already too complex for most other extensions. good riddance. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23Input: change processing API to InternalEvents.Peter Hutterer1-3/+2
Don't pass xEvent* and count through to processing, pass a single InternalEvent. Custom handlers are disabled for the time being. And for extra fun, XKB's pointer motion emulation is disabled. But stick an error in there so that we get reminded should we forget about it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23dix: Deliver{Grabbed|Focused|Device}Events API changed to InternalEvents.Peter Hutterer1-9/+6
With the API change, we can now purge the XI conversion from POE. Note: this commit breaks DGA even more. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23dix: convert passive grabs to use internal events.Peter Hutterer1-4/+3
deviceGrab.sync.event is now an internal event, and CheckDeviceGrabs and friends is changed over. Note that this currently breaks some frozen grabs. See towards the end of ComputeFreezes(). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23Xi: make ProcessOtherEvents more InternalEvent aware.Peter Hutterer1-1/+1
Get rid of the deviceValuator processing and a few other things, but still drop back into XI before checking device grabs or doing anything else. NoticeEventTime now needs to take InternalEvents, and while we're at it, change NoticeTime from a macro to a function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23dix: update CheckMotion to deal with DeviceEvents.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-23xkb: Switch the xkb event processing path over to InternalEvents.Peter Hutterer1-1/+2
Before dropping down into the DIX, convert back into XI events. This is a temporary solution only, until the DIX is capable of handling InternalEvents anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-16dix: Don't set core events in SetMaskForEvent.Peter Hutterer1-1/+1
Rather, modify the two callers to call separately for the two different. events. Unexport SetMaskForEvent too. And while we're at it, get rid of the MotionFilter macro, because it's one half confusing and one half pointless. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-13dix: remove DefineInitialRootWindow()Peter Hutterer1-3/+0
Obsolete. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-03Constify atom name stringsAlan Coopersmith1-2/+2
Changes MakeAtom to take a const char * and NameForAtom to return them, since many callers pass pointers to constant strings stored in read-only ELF sections. Updates in-tree callers as necessary to clear const mismatch warnings introduced by this change. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>