diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-12-03 05:43:34 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-12-03 05:43:34 -0200 |
commit | 49f77fff1495c0a2050fb18f9b1fc627839bbfc2 (patch) | |
tree | eebaec908150abfc0159d9ee941404918f553113 /hw/xfree86/dixmods | |
parent | 0b8f8b24f718820a72ebdc52423c2e6a44e848c5 (diff) |
Rework symbol visibility for easier maintenance
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).
Diffstat (limited to 'hw/xfree86/dixmods')
-rw-r--r-- | hw/xfree86/dixmods/extmod/Makefile.am | 2 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/dgaproc.h | 58 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/vidmodeproc.h | 77 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86dga2.c | 6 | ||||
-rw-r--r-- | hw/xfree86/dixmods/xkbKillSrv.c | 2 | ||||
-rw-r--r-- | hw/xfree86/dixmods/xkbPrivate.c | 2 | ||||
-rw-r--r-- | hw/xfree86/dixmods/xkbVT.c | 2 |
7 files changed, 36 insertions, 113 deletions
diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am index dd4ccd633..d93e63afa 100644 --- a/hw/xfree86/dixmods/extmod/Makefile.am +++ b/hw/xfree86/dixmods/extmod/Makefile.am @@ -12,7 +12,7 @@ XV_SRCS = xvmod.c xvmodproc.h endif if XF86VIDMODE -XF86VMODE_SRCS = xf86vmode.c vidmodeproc.h +XF86VMODE_SRCS = xf86vmode.c endif AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@ diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h index 67ca39c06..6745a6e7a 100644 --- a/hw/xfree86/dixmods/extmod/dgaproc.h +++ b/hw/xfree86/dixmods/extmod/dgaproc.h @@ -54,7 +54,7 @@ typedef struct { /* DDX interface */ -int +extern _X_EXPORT int DGASetMode( int Index, int num, @@ -62,35 +62,35 @@ DGASetMode( PixmapPtr *pPix ); -void +extern _X_EXPORT void DGASetInputMode( int Index, Bool keyboard, Bool mouse ); -void +extern _X_EXPORT void DGASelectInput( int Index, ClientPtr client, long mask ); -Bool DGAAvailable(int Index); -Bool DGAActive(int Index); -void DGAShutdown(void); -void DGAInstallCmap(ColormapPtr cmap); -int DGAGetViewportStatus(int Index); -int DGASync(int Index); +extern _X_EXPORT Bool DGAAvailable(int Index); +extern _X_EXPORT Bool DGAActive(int Index); +extern _X_EXPORT void DGAShutdown(void); +extern _X_EXPORT void DGAInstallCmap(ColormapPtr cmap); +extern _X_EXPORT int DGAGetViewportStatus(int Index); +extern _X_EXPORT int DGASync(int Index); -int +extern _X_EXPORT int DGAFillRect( int Index, int x, int y, int w, int h, unsigned long color ); -int +extern _X_EXPORT int DGABlitRect( int Index, int srcx, int srcy, @@ -98,7 +98,7 @@ DGABlitRect( int dstx, int dsty ); -int +extern _X_EXPORT int DGABlitTransRect( int Index, int srcx, int srcy, @@ -107,36 +107,36 @@ DGABlitTransRect( unsigned long color ); -int +extern _X_EXPORT int DGASetViewport( int Index, int x, int y, int mode ); -int DGAGetModes(int Index); -int DGAGetOldDGAMode(int Index); +extern _X_EXPORT int DGAGetModes(int Index); +extern _X_EXPORT int DGAGetOldDGAMode(int Index); -int DGAGetModeInfo(int Index, XDGAModePtr mode, int num); +extern _X_EXPORT int DGAGetModeInfo(int Index, XDGAModePtr mode, int num); -Bool DGAVTSwitch(void); -Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index, int button, +extern _X_EXPORT Bool DGAVTSwitch(void); +extern _X_EXPORT Bool DGAStealButtonEvent(DeviceIntPtr dev, int Index, int button, int is_down); -Bool DGAStealMotionEvent(DeviceIntPtr dev, int Index, int dx, int dy); -Bool DGAStealKeyEvent(DeviceIntPtr dev, int Index, int key_code, int is_down); -Bool DGAIsDgaEvent (xEvent *e); +extern _X_EXPORT Bool DGAStealMotionEvent(DeviceIntPtr dev, int Index, int dx, int dy); +extern _X_EXPORT Bool DGAStealKeyEvent(DeviceIntPtr dev, int Index, int key_code, int is_down); +extern _X_EXPORT Bool DGAIsDgaEvent (xEvent *e); -Bool DGAOpenFramebuffer(int Index, char **name, unsigned char **mem, +extern _X_EXPORT Bool DGAOpenFramebuffer(int Index, char **name, unsigned char **mem, int *size, int *offset, int *flags); -void DGACloseFramebuffer(int Index); -Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode); -int DGACreateColormap(int Index, ClientPtr client, int id, int mode, +extern _X_EXPORT void DGACloseFramebuffer(int Index); +extern _X_EXPORT Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode); +extern _X_EXPORT int DGACreateColormap(int Index, ClientPtr client, int id, int mode, int alloc); -extern unsigned char DGAReqCode; -extern int DGAErrorBase; -extern int DGAEventBase; -extern int *XDGAEventBase; +extern _X_EXPORT unsigned char DGAReqCode; +extern _X_EXPORT int DGAErrorBase; +extern _X_EXPORT int DGAEventBase; +extern _X_EXPORT int *XDGAEventBase; diff --git a/hw/xfree86/dixmods/extmod/vidmodeproc.h b/hw/xfree86/dixmods/extmod/vidmodeproc.h deleted file mode 100644 index c5ad03af2..000000000 --- a/hw/xfree86/dixmods/extmod/vidmodeproc.h +++ /dev/null @@ -1,77 +0,0 @@ - -/* Prototypes for DGA functions that the DDX must provide */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#ifndef _VIDMODEPROC_H_ -#define _VIDMODEPROC_H_ - - -typedef enum { - VIDMODE_H_DISPLAY, - VIDMODE_H_SYNCSTART, - VIDMODE_H_SYNCEND, - VIDMODE_H_TOTAL, - VIDMODE_H_SKEW, - VIDMODE_V_DISPLAY, - VIDMODE_V_SYNCSTART, - VIDMODE_V_SYNCEND, - VIDMODE_V_TOTAL, - VIDMODE_FLAGS, - VIDMODE_CLOCK -} VidModeSelectMode; - -typedef enum { - VIDMODE_MON_VENDOR, - VIDMODE_MON_MODEL, - VIDMODE_MON_NHSYNC, - VIDMODE_MON_NVREFRESH, - VIDMODE_MON_HSYNC_LO, - VIDMODE_MON_HSYNC_HI, - VIDMODE_MON_VREFRESH_LO, - VIDMODE_MON_VREFRESH_HI -} VidModeSelectMonitor; - -typedef union { - pointer ptr; - int i; - float f; -} vidMonitorValue; - -void XFree86VidModeExtensionInit(void); - -Bool VidModeAvailable(int scrnIndex); -Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock); -Bool VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock); -Bool VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock); -Bool VidModeDeleteModeline(int scrnIndex, pointer mode); -Bool VidModeZoomViewport(int scrnIndex, int zoom); -Bool VidModeGetViewPort(int scrnIndex, int *x, int *y); -Bool VidModeSetViewPort(int scrnIndex, int x, int y); -Bool VidModeSwitchMode(int scrnIndex, pointer mode); -Bool VidModeLockZoom(int scrnIndex, Bool lock); -Bool VidModeGetMonitor(int scrnIndex, pointer *monitor); -int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock); -Bool VidModeGetClocks(int scrnIndex, int *Clocks); -ModeStatus VidModeCheckModeForMonitor(int scrnIndex, pointer mode); -ModeStatus VidModeCheckModeForDriver(int scrnIndex, pointer mode); -void VidModeSetCrtcForMode(int scrnIndex, pointer mode); -Bool VidModeAddModeline(int scrnIndex, pointer mode); -int VidModeGetDotClock(int scrnIndex, int Clock); -int VidModeGetNumOfModes(int scrnIndex); -Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue); -Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue); -pointer VidModeCreateMode(void); -void VidModeCopyMode(pointer modefrom, pointer modeto); -int VidModeGetModeValue(pointer mode, int valtyp); -void VidModeSetModeValue(pointer mode, int valtyp, int val); -vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx); -Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); -Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); -int VidModeGetGammaRampSize(int scrnIndex); - -#endif - - diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index e712b4288..df0030e80 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -62,9 +62,9 @@ static void DGAClientStateChange (CallbackListPtr*, pointer, pointer); static ClientPtr DGAClients[MAXSCREENS]; -_X_EXPORT unsigned char DGAReqCode = 0; -_X_EXPORT int DGAErrorBase; -_X_EXPORT int DGAEventBase; +unsigned char DGAReqCode = 0; +int DGAErrorBase; +int DGAEventBase; static int DGAClientPrivateKeyIndex; static DevPrivateKey DGAClientPrivateKey = &DGAClientPrivateKeyIndex; diff --git a/hw/xfree86/dixmods/xkbKillSrv.c b/hw/xfree86/dixmods/xkbKillSrv.c index ac9c41220..9074fd390 100644 --- a/hw/xfree86/dixmods/xkbKillSrv.c +++ b/hw/xfree86/dixmods/xkbKillSrv.c @@ -45,7 +45,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "xf86.h" -_X_EXPORT int +int XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) { if (dev != inputInfo.keyboard) diff --git a/hw/xfree86/dixmods/xkbPrivate.c b/hw/xfree86/dixmods/xkbPrivate.c index e2a1273d7..db21a4e17 100644 --- a/hw/xfree86/dixmods/xkbPrivate.c +++ b/hw/xfree86/dixmods/xkbPrivate.c @@ -17,7 +17,7 @@ #include "os.h" #include "xf86.h" -_X_EXPORT int +int XkbDDXPrivate(DeviceIntPtr dev,KeyCode key,XkbAction *act) { XkbAnyAction *xf86act = &(act->any); diff --git a/hw/xfree86/dixmods/xkbVT.c b/hw/xfree86/dixmods/xkbVT.c index aaa4665a5..e6d69e2eb 100644 --- a/hw/xfree86/dixmods/xkbVT.c +++ b/hw/xfree86/dixmods/xkbVT.c @@ -45,7 +45,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "xf86.h" -_X_EXPORT int +int XkbDDXSwitchScreen(DeviceIntPtr dev,KeyCode key,XkbAction *act) { int scrnnum = XkbSAScreen(&act->screen); |