summaryrefslogtreecommitdiff
path: root/xkb/xkbUtils.c
AgeCommit message (Collapse)AuthorFilesLines
2009-09-13xkb: split effectiveGroup calculation into separate utility function.Peter Hutterer1-0/+35
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-05xkb: remove now-unused XkbGetKeysym.Peter Hutterer1-29/+0
XkbGetKeysyms was only used by the now-removed Keysym grabs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-30include: untangle events.h from the SDK headers.Peter Hutterer1-0/+1
InternalEvents shouldn't be used anywhere outside the X server itself. Split up into events.h for opaque typedefs for the events needed by various headers and eventstr.h for the actual struct definitions. eventstr.h must only be included by code that requires internal events and is not part of the SDK. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-10Revert "XKB: Sanitise * actions" commits (#19602)Peter Hutterer1-2/+2
Reverts the following four patches: feb757f384382c7782ceac55 "XKB: Sanitise vmods for redirected keys" b5f49382fe48f0a762d9a15f "XKB: Sanitise ctrls action" 1bd7fd195d85681e722161f8 "XKB: Sanitise pointer actions" 61c508fa78aa08ea2666fde9 "XKB: Sanitise vmods in actions" Strictly speaking, the structs used in the server are not part of the client ABI. Practically, they are as we copy from the wire straight into the structs. Changing the struct sizes breaks various wire/server conversions. Even when the structs have the same size, some internal magic causes conversions to fail. Visible by diffing the output files of: setxkbmap -layout de; xkbcomp -xkb :0 busted.xkb setxkbmap -layout de -print | xkbcomp -xkb - correct.xkb Interestingly enough, busted.xkb is the working one although the output is incorrect. Revert the four offending patches until the exact cause of this breakage can be determined. This patch restores functionality to Level3 modifiers. X.Org Bug 19602 <http://bugs.freedesktop.org/show_bug.cgi?id=19602> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-06Xi: add GrabButton and GrabKeysym code.Peter Hutterer1-0/+30
We don't do keycode grabs in XI2, they're pointless.
2009-03-20xkb: don't overrun the map index when accessing symbols.Peter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-17xkb: Fix wrong colour reference in XKB geometry copying. #20081Peter Hutterer1-2/+2
base_color and label_color need to reference the color in the destination, not in the source. X.Org Bug 20081 <http://bugs.freedesktop.org/show_bug.cgi?id=20081> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-02-16xserver: Avoid sending uninitialized padding data over the networkPeter Åstrand1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04Fix "warning: unused variable XXX"Tomas Carnecky1-1/+1
events.c:4614: warning: unused variable ‘kbd’ xkbUtils.c:361: warning: unused variable ‘maxKeysPerMod’ xf86Events.c:409: warning: unused variable ‘ke’ generic.c:131: warning: unused variable ‘cs’ generic.c:130: warning: unused variable ‘size’ xf86RandR12.c:591: warning: unused variable ‘crtc’ Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-28Fix duplicate code, off-by one in space calculation, not initialized membersPierre Willenbrock1-30/+9
2009-01-22Input: Remove core keysyms from KeyClassRecDaniel Stone1-105/+95
Instead of always keeping two copies of the keymap, only generate the core keymap from the XKB keymap when we really need to, and use the XKB keymap as the canonical keymap. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Clean up keymap change notificationsDaniel Stone1-112/+71
Keyboard map notifications are always generated from within XKB code, which also takes care of copying the keysyms, etc. If you need to mangle the keymap yourself, generate a new core keymap/modmap, and pass it to XkbApplyMappingChange. SendMappingNotify is renamed to SendPointerMappingNotify (and ditto its Device variants), which still only _sends_ the notifications, as opposed to also doing the copying a la XkbApplyMappingChange. Also have the modmap change code traverse the device hierachy, rather than just going off the core keyboard. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-22XKB: Sanitise vmods in actionsDaniel Stone1-2/+2
Turn vmods from two unsigned chars into one int. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22XKB: Remove unsupported Xi operation flagsDaniel Stone1-2/+1
We support every XKB operation on Xi devices, so always report that we support everything, and that nothing is ever unsupported. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Remove modifierMap from coreDaniel Stone1-7/+1
We already have modmap (in the exact same format!) in XKB, so just use that all the time, instead of duplicating the information. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Remove modifierKeyMapDaniel Stone1-41/+0
Since modifierKeyMap is generated from modifierMap, just remove it, and only generate it when we need to send the modifier map to the client. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Overhaul keyboard initialisation processDaniel Stone1-6/+0
XkbInitKeyboardDeviceStruct is now the only valid keyboard initialisation: all the details are hidden behind here. This now makes it impossible to supply a core keymap at startup. If dev->key is valid, dev->key->xkbInfo->desc is also valid. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22XKB: Remove lock actions disablingDaniel Stone1-2/+0
For some reason, XKB allows clients to set a global (!) flag that simply turns lock keys into state no-ops. Ignore this flag. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-20XKB: Be more verbose about XkbCopyKeymap failure in debug modeDaniel Stone1-8/+24
Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-20XKB: Trying to copy to the same keymap is not fatalDaniel Stone1-1/+4
Humour the user if they run XkbCopyKeymap(foo, foo). Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-20XkbCopyKeymap: inputInfo.keyboard is not a special caseDaniel Stone1-19/+12
The device-walking code is still depressing, though. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-30XKB: Also copy keyboard feedback when copying the keymapDaniel Stone1-1/+16
When updating the XKB keymap, make sure the keyboard feedback is also copied, to preserve autorepeat settings etc. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2008-12-23xkb: don't replicate past the number of groups we have.Peter Hutterer1-3/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-12-23xkb: ensure enough symbols for core Group1 replication.Peter Hutterer1-2/+17
A single-group key on a multi-group keyboard has to be replicated across all three groups (see Section 12.4 of the XKB protocol spec). Ensure that there's enough symbols available to actually do that. e.g. a key ABCD on a 3 group keyboard needs to be replicated as ABABCDCDABCD, hence requiring space for 12 symbols, even if maxSymsPerKey is less than that. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-1/+0
A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-22/+22
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-22/+22
This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode()
2008-11-04XKB: Tiny cleanups to _XkbLookupAnyDeviceDaniel Stone1-3/+4
A couple of coding style cleanups, a warning fix via removing a now-unused label, and also put an else so we don't spuriously trip a condition that should admittedly never occur anyway. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-10-31xkb: remove unused label "out", clean up program flow.Peter Hutterer1-3/+1
2008-09-26xkb: fix core keyboard map generation. #14373Peter Hutterer1-5/+34
According to Section 12.4 of the XKB Protocol Spec, if a key only has a single group but the keyboard has multiple groups defined, the core description of the key is a duplication of the single group across all symbols. i.e. G1L1 G1L2 G1L1 G1L2 G1L3 G1L4 G1L3 G1L4 The previous code generated G1L1 G1L2 G1L3 G1L4 G1L3 G1L4, leading to "invented" groups when the process is reversed. Note that this creates wrong key types on reconstruction from core to xkb, i.e. any single-group key with a key type that is not one of the canonical four (Sec 12.2.3), will get the assigned type on group 1, and a canonical type for the other gruops. X.Org Bug 14373 <http://bugs.freedesktop.org/show_bug.cgi?id=14373>
2008-08-04xkb: break up XkbCopyKeymap into bite-sized chunks.Peter Hutterer1-76/+167
2008-07-28xkb: remove superfluous inputInfo.keyboard treatment.Peter Hutterer1-17/+11
Really not necessary, we can just walk the list and spare us the special treatment of the VCK.
2008-07-28xkb: use PickPointer/PickKeyboard in _XkbLookupAnyDevice.Peter Hutterer1-8/+2
2008-05-20xkb: remove superfluous checks in if statement.Peter Hutterer1-3/+3
2008-04-07Merge branch 'master' into dcdc_reworkPeter Hutterer1-2/+5
Conflicts: Xext/xevie.c dix/dispatch.c
2008-03-14XkbCopyKeymap: Fix broken indentationDaniel Stone1-4/+4
An astute observer will note that the entirety of XkbCopyKeymap is indented with spaces, and no tabs whatsoever, and not commit changes which break the otherwise consistent indentation. A non-astute observer will note the breakage when the commit mail comes through with clearly broken indentation. A polite, non-astute, observer will then fix it. C'est la vie.
2008-03-10XkbCopyKeymap was mangling doodads and overlaysKeith Packard1-2/+5
2008-03-04Merge branch 'master' into mpxPeter Hutterer1-16/+13
This merge reverts Magnus' device coorindate scaling changes. MPX core event generation is very different, so we can't scale in GetPointerEvents. Conflicts: Xi/opendev.c dix/devices.c dix/dixfonts.c dix/getevents.c dix/resource.c dix/window.c hw/xfree86/common/xf86Xinput.c mi/mipointer.c xkb/ddxBeep.c xkb/ddxCtrls.c xkb/ddxKeyClick.c xkb/ddxList.c xkb/ddxLoad.c xkb/xkb.c xkb/xkbAccessX.c xkb/xkbEvents.c xkb/xkbInit.c xkb/xkbPrKeyEv.c xkb/xkbUtils.c
2008-02-17XKB: Always set size correctly in XkbCopyKeymap's geometry routinesDaniel Stone1-5/+12
We were forgetting to set the sizes for sections and rows and a couple of other misc bits in XkbCopyKeymap's geometry. Sort that out, and add a couple of clarifying comments along the way.
2008-02-17XKB: Remove a bunch of mad ifdefsDaniel Stone1-10/+0
We have SEEK_SET and size_t, seriously. Also use DebugF instead of ifdef DEBUG, and ditch a couple of random bits that were never used.
2008-02-17XKB: Move headers into the server treeDaniel Stone1-1/+1
We need to start breaking the XKB API to enforce sanity, so drag whichever headers we need to do so into the server tree, as the client API is set in stone, being part of Xlib.
2008-02-09xkb: when copying the keymap, make sure the structs default to 0/NULL.Peter Hutterer1-8/+15
It actually does help if a pointer is NULL rather than pointing to nirvana when you're trying to free it lateron. Who would have thought? (cherry picked from commit 7a97ca667405a42d008265c3a870210cc1da97dd)
2008-02-09xkb: when copying the keymap, make sure the structs default to 0/NULL.Peter Hutterer1-8/+15
It actually does help if a pointer is NULL rather than pointing to nirvana when you're trying to free it lateron. Who would have thought?
2008-02-07xkb: when copying sections, make sure num_rows is set too.Peter Hutterer1-0/+1
(cherry picked from commit 41991fb991313202e8e6b513fe928ba14f8fcb87)
2008-02-05xkb: when copying sections, make sure num_rows is set too.Peter Hutterer1-0/+1
2008-01-26Merge branch 'master' into mpxPeter Hutterer1-0/+1
Conflicts: Xext/sampleEVI.c
2008-01-17XKB: XkbCopyKeymap: Don't leak all the sectionsDaniel Stone1-0/+1
Previously, we'd just keep num_sections at 0, which would break the geometry and lead us to leak sections. Don't do that.
2008-01-03Merge branch 'master' into mpxPeter Hutterer1-62/+85
Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c
2007-11-13dix: Send MappingNotify when keyboard maps change.Peter Hutterer1-1/+4
If a slave device is attached to a master device, then we need to send a mapping notify to the client. Mapping notify needs to be sent if - different slave device but on same master - different master This gives you funny behaviour with the ClientPointer. When a MappingNotify is sent to the client, the client usually responds with a GetKeyboardMapping. This will retrieve the ClientPointer's keyboard mapping, regardless of which keyboard sent the last mapping notify request. So depending on the CP setting, your keyboard may change layout in each app...
2007-09-28xace: add hooks + new access codes: XKB extension.Eamon Walsh1-62/+85
Removes "LookupKeyboardDevice" and "LookupPointerDevice" in favor of inputInfo.keyboard and inputInfo.pointer, respectively; all use cases are non-XI compliant anyway.