summaryrefslogtreecommitdiff
path: root/xkb/xkbInit.c
AgeCommit message (Collapse)AuthorFilesLines
2011-02-15Replace _XkbDupString with XstrdupAlan Coopersmith1-10/+10
The two functions have identical semantics, including safely returning NULL when NULL is passed in (which POSIX strdup does not guarantee). Some callers could probably be adjusted to call libc strdup directly, when we know the input is non-NULL. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-06-11Remove more superfluous if(p) checks around free(p)Matt Turner1-4/+2
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov1-20/+10
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-03Move each screen's root-window pointer into ScreenRec.Jamey Sharp1-1/+2
Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-31/+31
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-02-02xkb: sed True -> TRUE and False -> FALSEPeter Hutterer1-15/+15
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2009-10-20xkb: don't conditionally include xkb-config.h.Peter Hutterer1-2/+0
If HAVE_XKB_CONFIG_H is ever undefined, we fail to build anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-16xkb: cosmetic fix, use TRUE instead of True.Peter Hutterer1-1/+1
Rest of InitKeyboardDeviceStruct uses TRUE and FALSE. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-17Xi: Add support for sourceid in the device classes.Peter Hutterer1-0/+1
2009-05-11xkb: if kbd init failed, NULL out the pointers after freeing them (#21278)Peter Hutterer1-0/+3
Reproducible: Configure a server that uses the keyboard driver with an invalid ruleset, e.g. (Option "XkbRules" "foobar"). Ensure that Option "AllowEmptyInput" is "off" in the ServerFlags or ServerLayout section. Start the server. After failing to init the keymap, the server will try to clean up after the device, double-freeing some xkb structs that have not been reset properly. X.Org Bug 21278 <http://bugs.freedesktop.org/show_bug.cgi?id=21278> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08xkb: remove _XkbAlloc, _XkbCalloc, _XkbRealloc and _XkbFreePeter Hutterer1-17/+17
We all agree that wrapping is fun, but seriously. One of these days someone will get hurt. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-20xkb: set bell_func in InitKeyboardDeviceStruct.Colin Harrison1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19xkb: Add XkbFreeRMLVOSet helper function.Peter Hutterer1-11/+19
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dan Nicholson <dbn.lists@gmail.com>
2009-04-17xkb: strdup the values returned by XkbGetRulesDfltsPeter Hutterer1-0/+21
XkbGetRulesDftls may get a copy of what will later be freed when passed into XkbSetRulesDftls. On the second run of XkbGet/SetRulesDflts: XkbGetRulesDflts(rmlvo) rmlvo->rules = current-rules XkbSetRulesDflts(rmlvo) free(current-rules) current-rules = strdup(rmlvo->rules) Leaving us with garbage in current-rules. This patch requires callers of XkbGetRulesDflts to free the associated memory. See also http://lists.freedesktop.org/archives/xorg-devel/2009-February/000305.html Reported-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-04-17input: allow NULL as XkbRMVLOSet in InitKeyboardDeviceStruct.Peter Hutterer1-1/+9
Virtually all callers use XkbGetRulesDefault(&rmlvo); InitKeyboardDeviceStruct(..., rmlvo); Let's save them the trouble and accept NULL as a hint to take the default RMLVO. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Close <Benjamin.Close@clearchain.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-02-20xkb: Use cached XKB keymap when rules haven't changedDan Nicholson1-2/+46
Rather than compiling a new keymap every time InitKeyboardDeviceStruct is called, cache the previous keymap and reuse it if the rules have not changed. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-04XKB: Remove -kb and +kb from -help text and man page.Adam Jackson1-2/+0
2009-01-22XKB: Remove unused DDX functionsDaniel Stone1-2/+0
They were complete no-ops anyway. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Input: Remove core keysyms from KeyClassRecDaniel Stone1-4/+0
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: Remove modifierMap from coreDaniel Stone1-3/+0
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: Overhaul keyboard initialisation processDaniel Stone1-335/+141
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: Make XKB mandatoryDaniel Stone1-13/+1
No more #ifdef XKB, because you can't disable the build, and no more noXkbExtension either. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-20XKB: Allow build-time configuration of XKB defaultsDaniel Stone1-31/+10
Instead of hardcoding base/pc105/us, allow users to change the defaults at ./configure time. Change the default model to be evdev on Linux. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2009-01-11xkb: ANSI cleanupJulien Cristau1-1/+1
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-11/+11
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-12-03xkb: Allow NULL as rulesFile in XkbSetRulesDflts.Peter Hutterer1-5/+24
If no rules file is given, simply re-use the previous one. If no RF is given the first time this function is called, use the built-in default. This includes fixing the built-in default to something that actually exists. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-8/+8
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-07-23Unifdef __osf__Adam Jackson1-1/+1
2008-07-23Unifdef sgi.Adam Jackson1-8/+0
2008-07-17Dead code removalDaniel Stone1-1/+1
Remove a whole bunch of code that was never built, be it entire files or just dead ifdefs.
2008-06-05xkb: reset xkb_cached_map on CloseDownDevices.Peter Hutterer1-0/+3
Could lead to some invalid pointers in the second server generation.
2008-06-02xkb: delete default rules when devices are closed.Peter Hutterer1-0/+15
We only have one set of default rules options in xkb. When the second keyboard is brought up with Xkb options specified, these new options overwrite the old. In future server generations, the rules used for the VCK are a mixture of the default ones and ones previously specified for other keyboards. Simply resetting the xkb default rules to NULL avoids this issue. Reproducable by setting XkbLayout "de" and XkbVariant "nodeadkeys". In the second server generation, the VCK has "us(nodeadkeys)". This again produces a SIGABRT when the first key is hit. I could not figure out why the SIGABRT happens. This patch is avoiding the issue rather than fixing it.
2008-04-08xkb: don't overwrite CtrlProc in the second run of XkbFinishDeviceInit.Peter Hutterer1-1/+4
XkbFinishDeviceInit is called once when the device is initialised, but also when a class copy causes the key class of a device to change. In this case, overwriting the CtrlProc of the KeybdFeedbackClass with XkbDDXKeybdCtrlProc sets up a nice recursive loop of XkbDDXKeybdCtrlProc calling itself until the cows come home.
2008-04-07Merge branch 'master' into dcdc_reworkPeter Hutterer1-5/+6
Conflicts: Xext/xevie.c dix/dispatch.c
2008-03-04Merge branch 'master' into mpxPeter Hutterer1-134/+103
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-03-04XKB: Fix initial map setting on startupDaniel Stone1-3/+4
Due to an unwitting sense inversion when eliminating XkbFileInfo, we were setting the complete wrong keymap on startup (non-XKB map if we had an XKB map available, or the XKB map if we didn't have any available). Invert the sense properly, and add two small bits that also went missing in that commit.
2008-02-29dix: Modify callers of property and selection API to use new interfaces.Eamon Walsh1-2/+2
2008-02-22XKB: Actually use the keymap we compile at startupDaniel Stone1-42/+80
During XkbInitKeyboardDevice, we compiled a keymap and promptly threw it away; brief inspection revealed the embarassingly simple problem. Sorry.
2008-02-17XKB: Ditch XkbFileInfoDaniel Stone1-101/+62
Sorry about the megacommit, but this touches on a lot of stuff. Get rid of XkbFileInfo, which was pretty seriously redundant, and move the only useful thing it had (defined) into XkbDescRec. defined will be removed pretty soon anyway. Is the compat map pointer non-NULL? Then you have a compat map, congratulations! Anyhow, I digress. All functions that took an XkbFileInfoPtr now take an XkbDescPtr, _except_ XkmReadFile, which returns an XkbDescPtr *, because people want to deal in XkbDescPtrs, not XkbDescRecs.
2008-02-17XKB: Remove support for pre-built keymapsDaniel Stone1-18/+3
Don't load prebuilt keymaps anymore.
2008-02-17XKB: Remove a bunch of mad ifdefsDaniel Stone1-16/+1
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-2/+2
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.
2007-11-07Merge branch 'master' into mpxPeter Hutterer1-2/+2
Conflicts: Xi/extinit.c Xi/grabdev.c Xi/setmode.c Xi/ungrdev.c dix/devices.c dix/events.c dix/getevents.c include/dix.h mi/midispcur.c mi/misprite.c xkb/xkbActions.c xkb/xkbEvents.c xkb/xkbPrKeyEv.c
2007-11-05XKB: Remove usage of allocaDaniel Stone1-2/+2
alloca has no way to return failure, and instead can possibly arbitrarily overflow the stack. Let's avoid that one.
2007-09-26xkb: unify ErrorFs. Prefix all with [xkb].Peter Hutterer1-5/+5
Output for XkbUseMsg intentionally skipped.
2007-06-28Remove the remnants of OS/2 support.Adam Jackson1-1/+1
This has never worked in any modular server release, and as far as I know was never tested in 6.7 through 6.9.
2007-03-20Static markup and dead code cull over xkb/.Adam Jackson1-16/+10
The former <X11/extensions/XKBsrv.h> has been pulled into the server now as include/xkbsrv.h, and the world updated to look for it in the new place, since it made no sense to define server API in an extension header. Any further work along this line will need to do similar things with XKBgeom.h and friends.
2006-07-21Remove RCS tags. Fix Xprint makefile braindamage.Adam Jackson1-3/+0
2006-05-29Remove -xkbmap argument.Daniel Stone1-46/+1