Unverified Commit 3a3a3373 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/various2' into 3.6.x

parents 796c8e42 085f8a4f
...@@ -4,7 +4,7 @@ backported, it rather describes what functionality level the modules ...@@ -4,7 +4,7 @@ backported, it rather describes what functionality level the modules
are at (roughly): are at (roughly):
module xorg version module xorg version
composite 6.9/7.0 composite 1.12 (~ 9838b70 2012-03-21 Introduce a consistent coding style [Keith Packard])
damageext 6.9/7.0 damageext 6.9/7.0
dbe 1.4.2 dbe 1.4.2
dix 1.3.0.0 dix 1.3.0.0
...@@ -12,7 +12,7 @@ fb 7.1/1.1 ...@@ -12,7 +12,7 @@ fb 7.1/1.1
GL 6.9/7.0 GL 6.9/7.0
mi 7.1/1.1 mi 7.1/1.1
miext 7.1/1.1 miext 7.1/1.1
os 7.1/1.1 os ? 7.1/1.1 + many backports, some of them from 2017
randr 1.18.0 randr 1.18.0
record 1.4.2 record 1.4.2
render 6.9/7.0 render 6.9/7.0
......
...@@ -407,6 +407,9 @@ Dispatch(void) ...@@ -407,6 +407,9 @@ Dispatch(void)
} }
/* now, finally, deal with client requests */ /* now, finally, deal with client requests */
/* Update currentTime so request time checks, such as for input
* device grabs, are calculated correctly */
UpdateCurrentTimeIf();
result = ReadRequestFromClient(client); result = ReadRequestFromClient(client);
if (result <= 0) if (result <= 0)
{ {
......
...@@ -655,6 +655,7 @@ ProcListProperties(ClientPtr client) ...@@ -655,6 +655,7 @@ ProcListProperties(ClientPtr client)
return(client->noClientException); return(client->noClientException);
} }
#ifndef NXAGENT_SERVER
int int
ProcDeleteProperty(register ClientPtr client) ProcDeleteProperty(register ClientPtr client)
{ {
...@@ -692,3 +693,4 @@ ProcDeleteProperty(register ClientPtr client) ...@@ -692,3 +693,4 @@ ProcDeleteProperty(register ClientPtr client)
else else
return(result); return(result);
} }
#endif
...@@ -41,7 +41,7 @@ extern Bool nxagentWMIsRunning; ...@@ -41,7 +41,7 @@ extern Bool nxagentWMIsRunning;
* to the agent server. * to the agent server.
*/ */
int nxagentInitAtoms(WindowPtr pWin); void nxagentInitAtoms();
/* /*
* Query and create all the required atoms * Query and create all the required atoms
......
...@@ -74,9 +74,9 @@ Atom serverCutProperty; ...@@ -74,9 +74,9 @@ Atom serverCutProperty;
Atom clientCutProperty; Atom clientCutProperty;
static Window serverWindow; static Window serverWindow;
static const int nxagentPrimarySelection = 0; const int nxagentPrimarySelection = 0;
static const int nxagentClipboardSelection = 1; const int nxagentClipboardSelection = 1;
static const int nxagentMaxSelections = 2; const int nxagentMaxSelections = 2;
typedef struct _SelectionOwner typedef struct _SelectionOwner
{ {
...@@ -217,7 +217,7 @@ void nxagentPrintSelectionStat(int sel) ...@@ -217,7 +217,7 @@ void nxagentPrintSelectionStat(int sel)
{ {
SelectionOwner lOwner = lastSelectionOwner[sel]; SelectionOwner lOwner = lastSelectionOwner[sel];
Selection curSel = CurrentSelections[sel]; Selection curSel = CurrentSelections[sel];
char *s =NULL; char *s = NULL;
#ifdef CLIENTIDS #ifdef CLIENTIDS
fprintf(stderr, " lastSelectionOwner[].client [%p] index [%d] PID [%d] Cmd [%s]\n", fprintf(stderr, " lastSelectionOwner[].client [%p] index [%d] PID [%d] Cmd [%s]\n",
...@@ -304,8 +304,8 @@ void nxagentPrintClipboardStat(char *header) ...@@ -304,8 +304,8 @@ void nxagentPrintClipboardStat(char *header)
fprintf(stderr, " lastClientProperty (Atom) [% 4d][%s]\n", lastClientProperty, NameForAtom(lastClientProperty)); fprintf(stderr, " lastClientProperty (Atom) [% 4d][%s]\n", lastClientProperty, NameForAtom(lastClientProperty));
fprintf(stderr, " lastClientSelection (Atom) [% 4d][%s]\n", lastClientSelection, NameForAtom(lastClientSelection)); fprintf(stderr, " lastClientSelection (Atom) [% 4d][%s]\n", lastClientSelection, NameForAtom(lastClientSelection));
fprintf(stderr, " lastClientTarget (Atom) [% 4d][%s]\n", lastClientTarget, NameForAtom(lastClientTarget)); fprintf(stderr, " lastClientTarget (Atom) [% 4d][%s]\n", lastClientTarget, NameForAtom(lastClientTarget));
fprintf(stderr, " lastClientTime (Time) [%u]\n", lastServerTime); fprintf(stderr, " lastClientTime (Time) [%u]\n", lastClientTime);
fprintf(stderr, " lastClientReqTime (Time) [%u]\n", lastServerReqTime); fprintf(stderr, " lastClientReqTime (Time) [%u]\n", lastClientReqTime);
fprintf(stderr, " lastClientPropertySize (unsigned long) [%lu]\n", lastClientPropertySize); fprintf(stderr, " lastClientPropertySize (unsigned long) [%lu]\n", lastClientPropertySize);
fprintf(stderr, " lastClientStage (ClientSelectionStage) [%d][%s]\n", lastClientStage, GetClientSelectionStageString(lastClientStage)); fprintf(stderr, " lastClientStage (ClientSelectionStage) [%d][%s]\n", lastClientStage, GetClientSelectionStageString(lastClientStage));
...@@ -617,7 +617,7 @@ FIXME: Do we need this? ...@@ -617,7 +617,7 @@ FIXME: Do we need this?
} }
else else
{ {
if (lastSelectionOwner[i].client != NULL && if (lastSelectionOwner[i].client != NULL &&
nxagentOption(Clipboard) != ClipboardClient) nxagentOption(Clipboard) != ClipboardClient)
{ {
xEvent x; xEvent x;
...@@ -913,7 +913,7 @@ void nxagentCollectPropertyEvent(int resource) ...@@ -913,7 +913,7 @@ void nxagentCollectPropertyEvent(int resource)
SAFE_XFree(pszReturnData); SAFE_XFree(pszReturnData);
return; return;
} }
if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32) if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32)
{ {
#ifdef DEBUG #ifdef DEBUG
...@@ -1571,10 +1571,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection, ...@@ -1571,10 +1571,10 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
x.u.selectionNotify.selection = selection; x.u.selectionNotify.selection = selection;
x.u.selectionNotify.target = target; x.u.selectionNotify.target = target;
x.u.selectionNotify.property = property; x.u.selectionNotify.property = property;
(void) TryClientEvents(client, &x, 1, NoEventMask, (void) TryClientEvents(client, &x, 1, NoEventMask,
NoEventMask , NullGrab); NoEventMask , NullGrab);
return 1; return 1;
} }
......
...@@ -2803,11 +2803,11 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2803,11 +2803,11 @@ Bool nxagentReconnectDisplay(void *p0)
#endif #endif
nxagentConfineWindow = XCreateWindow(nxagentDisplay, nxagentConfineWindow = XCreateWindow(nxagentDisplay,
DefaultRootWindow(nxagentDisplay), DefaultRootWindow(nxagentDisplay),
0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0,
InputOnly, InputOnly,
CopyFromParent, CopyFromParent,
0L, NULL); 0L, NULL);
if (nxagentReportWindowIds) { if (nxagentReportWindowIds) {
fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n", fprintf(stderr, "NXAGENT_WINDOW_ID: CONFINEMENT_WINDOW,WID:[0x%x]\n",
......
...@@ -1692,6 +1692,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) ...@@ -1692,6 +1692,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
const char *s; const char *s;
int field; int field;
/* FIXME: use str(n)dup()? */
if ((scalableFontName = malloc(strlen(fontName) + 1)) == NULL) if ((scalableFontName = malloc(strlen(fontName) + 1)) == NULL)
{ {
#ifdef PANIC #ifdef PANIC
......
...@@ -185,8 +185,6 @@ void nxagentApplyPlaceholder(Drawable drawable, int x, int y, ...@@ -185,8 +185,6 @@ void nxagentApplyPlaceholder(Drawable drawable, int x, int y,
} }
XFreeGC(nxagentDisplay, gc); XFreeGC(nxagentDisplay, gc);
return;
} }
#ifdef DUMP #ifdef DUMP
......
...@@ -644,23 +644,23 @@ FIXME: Should use these. ...@@ -644,23 +644,23 @@ FIXME: Should use these.
pDrawable -> depth != 1 && pDrawable -> depth != 1 &&
nxagentOption(DeferLevel) >= 1) nxagentOption(DeferLevel) >= 1)
{ {
/* -- changed by dimbor (small "bed-sheets" never need be prevented - always put) --*/ /* -- changed by dimbor (small "bed-sheets" never need be prevented - always put) --*/
if (dstHeight > 16) if (dstHeight > 16)
{ {
/* -------------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------------- */
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on region [%d,%d,%d,%d] " fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on region [%d,%d,%d,%d] "
"for drawable at [%p] with drawable pixmap.\n", pRegion -> extents.x1, "for drawable at [%p] with drawable pixmap.\n", pRegion -> extents.x1,
pRegion -> extents.y1, pRegion -> extents.x2, pRegion -> extents.y2, pRegion -> extents.y1, pRegion -> extents.x2, pRegion -> extents.y2,
(void *) pDrawable); (void *) pDrawable);
#endif #endif
nxagentMarkCorruptedRegion(pDrawable, pRegion); nxagentMarkCorruptedRegion(pDrawable, pRegion);
goto nxagentPutImageEnd; goto nxagentPutImageEnd;
/* --- changed by dimbor ---*/ /* --- changed by dimbor ---*/
} }
/* ------------------------- */ /* ------------------------- */
} }
if (pDrawable -> type == DRAWABLE_WINDOW && if (pDrawable -> type == DRAWABLE_WINDOW &&
......
...@@ -203,18 +203,43 @@ INCLUDES = \ ...@@ -203,18 +203,43 @@ INCLUDES = \
### NXAGENT Defines: ### NXAGENT Defines:
# #
# NXAGENT_FONTCACHE_SIZE Number of cache slots # NXAGENT_SHAPE Old shape code
# NXAGENT_SHAPE Old shape code # NXAGENT_SHAPE2 New shape code
# NXAGENT_GLYPHCACHE # NXAGENT_FIXKEYS Force the release of pressed key when losing focus
# NXAGENT_GLYPHCACHE_SIZE Slots for glyph cache
# NXAGENT_SHAPE2 New shape code
# NXAGENT_FIXKEYS Force the release of pressed key when losing focus
# NXAGENT_EXPOSURES Manage expose events
# NXAGENT_CLIPBOARD Enables clipboard cut and paste function between X servers. # NXAGENT_CLIPBOARD Enables clipboard cut and paste function between X servers.
# NXAGENT_FONTEXCLUDE Exclude some specific font names (only "-ult1mo" at this moment). # NXAGENT_RANDR_MODE_PREFIX Prefix for RandR modes (i.e., nx_<x>x<y>) (default: nx_)
# NXAGENT FULLSCREEN Fullscreen mode
# NXAGENT_RANDR_MODE_PREFIX Use prefixed (i.e., nx_<x>x<y>) RandR modes
# NXAGENT_RANDR_XINERAMA_CLIPPING cut off invisible window parts in xinerama mode (you probably do not want this) # NXAGENT_RANDR_XINERAMA_CLIPPING cut off invisible window parts in xinerama mode (you probably do not want this)
# NXAGENT_TIMESTAMP print duration for some routines
#
### macros not investigated yet:
#
# NXAGENT_PICTURE_ALWAYS_POINTS_TO_VIRTUAL
# NXAGENT_RENDER_CLEANUP
# NXAGENT_WAKEUP=<milliseconds>
# NXAGENT_ONSTART
# NXAGENT_SPLASH
# NXAGENT_ARTSD
#
### Debug macros:
#
# DEBUG_COLORMAP
# DEBUG_TREE
# NXAGENT_DEBUG
# NXAGENT_FIXKEYS_DEBUG
# NXAGENT_FONTCACHE_DEBUG
# NXAGENT_FONTMATCH_DEBUG
# NXAGENT_LOGO_DEBUG
# NXAGENT_RECONNECT_COLORMAP_DEBUG
# NXAGENT_RECONNECT_CURSOR_DEBUG
# NXAGENT_RECONNECT_DEBUG
# NXAGENT_RECONNECT_DISPLAY_DEBUG
# NXAGENT_RECONNECT_FONT_DEBUG
# NXAGENT_RECONNECT_PICTFORMAT_DEBUG
# NXAGENT_RECONNECT_PICTURE_DEBUG
# NXAGENT_RECONNECT_SCREEN_DEBUG
# NXAGENT_RECONNECT_WINDOW_DEBUG
# NXAGENT_XKBD_DEBUG
# NX_DEBUG_INPUT
#if nxVersion #if nxVersion
NX_DEFINES = \ NX_DEFINES = \
...@@ -224,34 +249,26 @@ NX_DEFINES = \ ...@@ -224,34 +249,26 @@ NX_DEFINES = \
#endif #endif
DEFINES = \ DEFINES = \
-g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \ -g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \
-UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI \ -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI \
-DNXAGENT_SERVER \ -DNXAGENT_SERVER \
-DNXAGENT_CONSTRAINCURSOR \
-DNXAGENT_FONTCACHE_SIZE=50 \
-DNXAGENT_GLYPHCACHE -DNXAGENT_GLYPHCACHE_SIZE=50 \
-DNXAGENT_RENDER_CLEANUP \ -DNXAGENT_RENDER_CLEANUP \
-DNXAGENT_SHAPE2 \ -DNXAGENT_SHAPE2 \
-DNXAGENT_FIXKEYS \ -DNXAGENT_FIXKEYS \
-DNXAGENT_CLIPBOARD \ -DNXAGENT_CLIPBOARD \
-DNXAGENT_EXPOSURES \
-DNXAGENT_FONTEXCLUDE \
-DNXAGENT_PACKEDIMAGES \
-DNXAGENT_VISIBILITY \
-DNXAGENT_WAKEUP=1000 \ -DNXAGENT_WAKEUP=1000 \
-DNXAGENT_ONSTART \ -DNXAGENT_ONSTART \
-DNXAGENT_ARTSD \ -DNXAGENT_ARTSD \
-DNXAGENT_RANDR_MODE_PREFIX \
-UNX_DEBUG_INPUT \ -UNX_DEBUG_INPUT \
-DRANDR_10_INTERFACE=1 \ -DRANDR_10_INTERFACE=1 \
-DRANDR_12_INTERFACE=1 \ -DRANDR_12_INTERFACE=1 \
-DRANDR_13_INTERFACE=1 \ -DRANDR_13_INTERFACE=1 \
-DRANDR_14_INTERFACE=1 \ -DRANDR_14_INTERFACE=1 \
-DRANDR_15_INTERFACE=1 \ -DRANDR_15_INTERFACE=1 \
-DPANORAMIX \ -DPANORAMIX \
-UDEBUG_TREE \ -UDEBUG_TREE \
-DSYSTEMFONTDIR=\"$(SYSTEMFONTDIR)\" \ -DSYSTEMFONTDIR=\"$(SYSTEMFONTDIR)\" \
$(NULL) $(NULL)
all:: $(OBJS) all:: $(OBJS)
......
...@@ -71,6 +71,7 @@ is" without express or implied warranty. ...@@ -71,6 +71,7 @@ is" without express or implied warranty.
#include "Millis.h" #include "Millis.h"
#include "Error.h" #include "Error.h"
#include "Keystroke.h" #include "Keystroke.h"
#include "Atoms.h"
#include <nx/NX.h> #include <nx/NX.h>
#include "compext/Compext.h" #include "compext/Compext.h"
...@@ -148,6 +149,8 @@ extern void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data, ...@@ -148,6 +149,8 @@ extern void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
void *args); void *args);
#endif #endif
extern const char *nxagentProgName;
void ddxInitGlobals(void) void ddxInitGlobals(void)
{ {
/* /*
...@@ -199,8 +202,6 @@ Bool nxagentX2go; ...@@ -199,8 +202,6 @@ Bool nxagentX2go;
void checkX2goAgent(void) void checkX2goAgent(void)
{ {
extern const char *nxagentProgName;
#ifdef TEST #ifdef TEST
fprintf(stderr, "%s: nxagentProgName [%s]\n", __func__, nxagentProgName); fprintf(stderr, "%s: nxagentProgName [%s]\n", __func__, nxagentProgName);
#endif #endif
...@@ -221,15 +222,6 @@ void checkX2goAgent(void) ...@@ -221,15 +222,6 @@ void checkX2goAgent(void)
void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
{ {
char *authority;
int i;
#ifdef __sun
char *environment;
#endif
/* /*
* Print our pid and version information. * Print our pid and version information.
*/ */
...@@ -295,11 +287,13 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) ...@@ -295,11 +287,13 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
} }
#endif #endif
if ((authority = getenv("NX_XAUTHORITY"))) char *authority = getenv("NX_XAUTHORITY");
if (authority)
{ {
#ifdef __sun #ifdef __sun
environment = malloc(15 + strlen(authority)); char *environment = malloc(15 + strlen(authority));
sprintf(environment, "XAUTHORITY=%s", authority); sprintf(environment, "XAUTHORITY=%s", authority);
...@@ -391,7 +385,7 @@ FIXME: These variables, if not removed at all because have probably ...@@ -391,7 +385,7 @@ FIXME: These variables, if not removed at all because have probably
nxagentNumScreens = 1; nxagentNumScreens = 1;
} }
for (i = 0; i < nxagentNumScreens; i++) for (int i = 0; i < nxagentNumScreens; i++)
{ {
AddScreen(nxagentOpenScreen, argc, argv); AddScreen(nxagentOpenScreen, argc, argv);
} }
...@@ -421,6 +415,8 @@ FIXME: These variables, if not removed at all because have probably ...@@ -421,6 +415,8 @@ FIXME: These variables, if not removed at all because have probably
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
AddCallback(&SelectionCallback, nxagentSetSelectionCallback, NULL); AddCallback(&SelectionCallback, nxagentSetSelectionCallback, NULL);
#endif #endif
nxagentInitAtoms();
} }
void void
......
...@@ -188,261 +188,57 @@ static void nxagentCheckRemoteKeycodes(void); ...@@ -188,261 +188,57 @@ static void nxagentCheckRemoteKeycodes(void);
static CARD8 nxagentConvertedKeycodes[] = static CARD8 nxagentConvertedKeycodes[] =
{ {
/* evdev pc105*/ /* evdev pc105*/
/* 0 */ 0, /* 0 */ 0, /* 1 */ 1, /* 2 */ 2, /* 3 */ 3, /* 4 */ 4,
/* 1 */ 1, /* 5 */ 5, /* 6 */ 6, /* 7 */ 7, /* 8 */ 8, /* 9 */ 9,
/* 2 */ 2, /* 10 */ 10, /* 11 */ 11, /* 12 */ 12, /* 13 */ 13, /* 14 */ 14,
/* 3 */ 3, /* 15 */ 15, /* 16 */ 16, /* 17 */ 17, /* 18 */ 18, /* 19 */ 19,
/* 4 */ 4, /* 20 */ 20, /* 21 */ 21, /* 22 */ 22, /* 23 */ 23, /* 24 */ 24,
/* 5 */ 5, /* 25 */ 25, /* 26 */ 26, /* 27 */ 27, /* 28 */ 28, /* 29 */ 29,
/* 6 */ 6, /* 30 */ 30, /* 31 */ 31, /* 32 */ 32, /* 33 */ 33, /* 34 */ 34,
/* 7 */ 7, /* 35 */ 35, /* 36 */ 36, /* 37 */ 37, /* 38 */ 38, /* 39 */ 39,
/* 8 */ 8, /* 40 */ 40, /* 41 */ 41, /* 42 */ 42, /* 43 */ 43, /* 44 */ 44,
/* 9 */ 9, /* 45 */ 45, /* 46 */ 46, /* 47 */ 47, /* 48 */ 48, /* 49 */ 49,
/* 10 */ 10, /* 50 */ 50, /* 51 */ 51, /* 52 */ 52, /* 53 */ 53, /* 54 */ 54,
/* 11 */ 11, /* 55 */ 55, /* 56 */ 56, /* 57 */ 57, /* 58 */ 58, /* 59 */ 59,
/* 12 */ 12, /* 60 */ 60, /* 61 */ 61, /* 62 */ 62, /* 63 */ 63, /* 64 */ 64,
/* 13 */ 13, /* 65 */ 65, /* 66 */ 66, /* 67 */ 67, /* 68 */ 68, /* 69 */ 69,
/* 14 */ 14, /* 70 */ 70, /* 71 */ 71, /* 72 */ 72, /* 73 */ 73, /* 74 */ 74,
/* 15 */ 15, /* 75 */ 75, /* 76 */ 76, /* 77 */ 77, /* 78 */ 78, /* 79 */ 79,
/* 16 */ 16, /* 80 */ 80, /* 81 */ 81, /* 82 */ 82, /* 83 */ 83, /* 84 */ 84,
/* 17 */ 17, /* 85 */ 85, /* 86 */ 86, /* 87 */ 87, /* 88 */ 88, /* 89 */ 89,
/* 18 */ 18, /* 90 */ 90, /* 91 */ 91, /* 92 */ 124, /* 93 */ 93, /* 94 */ 94,
/* 19 */ 19, /* 95 */ 95, /* 96 */ 96, /* 97 */ 211, /* 98 */ 98, /* 99 */ 99,
/* 20 */ 20, /* 100 */ 100, /* 101 */ 208, /* 102 */ 102, /* 103 */ 103, /* 104 */ 108,
/* 21 */ 21, /* 105 */ 109, /* 106 */ 112, /* 107 */ 111, /* 108 */ 113, /* 109 */ 109,
/* 22 */ 22, /* 110 */ 97, /* 111 */ 98, /* 112 */ 99, /* 113 */ 100, /* 114 */ 102,
/* 23 */ 23, /* 115 */ 103, /* 116 */ 104, /* 117 */ 105, /* 118 */ 106, /* 119 */ 107,
/* 24 */ 24, /* 120 */ 120, /* 121 */ 121, /* 122 */ 122, /* 123 */ 123, /* 124 */ 124,
/* 25 */ 25, /* 125 */ 126, /* 126 */ 126, /* 127 */ 110, /* 128 */ 128, /* 129 */ 129,
/* 26 */ 26, /* 130 */ 130, /* 131 */ 131, /* 132 */ 133, /* 133 */ 115, /* 134 */ 116,
/* 27 */ 27, /* 135 */ 117, /* 136 */ 136, /* 137 */ 137, /* 138 */ 138, /* 139 */ 139,
/* 28 */ 28, /* 140 */ 140, /* 141 */ 141, /* 142 */ 142, /* 143 */ 143, /* 144 */ 144,
/* 29 */ 29, /* 145 */ 145, /* 146 */ 146, /* 147 */ 147, /* 148 */ 148, /* 149 */ 149,
/* 30 */ 30, /* 150 */ 150, /* 151 */ 151, /* 152 */ 152, /* 153 */ 153, /* 154 */ 154,
/* 31 */ 31, /* 155 */ 155, /* 156 */ 156, /* 157 */ 157, /* 158 */ 158, /* 159 */ 159,
/* 32 */ 32, /* 160 */ 160, /* 161 */ 161, /* 162 */ 162, /* 163 */ 163, /* 164 */ 164,
/* 33 */ 33, /* 165 */ 165, /* 166 */ 166, /* 167 */ 167, /* 168 */ 168, /* 169 */ 169,
/* 34 */ 34, /* 170 */ 170, /* 171 */ 171, /* 172 */ 172, /* 173 */ 173, /* 174 */ 174,
/* 35 */ 35, /* 175 */ 175, /* 176 */ 176, /* 177 */ 177, /* 178 */ 178, /* 179 */ 179,
/* 36 */ 36, /* 180 */ 180, /* 181 */ 181, /* 182 */ 182, /* 183 */ 183, /* 184 */ 184,
/* 37 */ 37, /* 185 */ 185, /* 186 */ 186, /* 187 */ 187, /* 188 */ 188, /* 189 */ 189,
/* 38 */ 38, /* 190 */ 190, /* 191 */ 118, /* 192 */ 119, /* 193 */ 120, /* 194 */ 121,
/* 39 */ 39, /* 195 */ 122, /* 196 */ 196, /* 197 */ 197, /* 198 */ 198, /* 199 */ 199,
/* 40 */ 40, /* 200 */ 200, /* 201 */ 201, /* 202 */ 202, /* 203 */ 93, /* 204 */ 125,
/* 41 */ 41, /* 205 */ 156, /* 206 */ 127, /* 207 */ 128, /* 208 */ 208, /* 209 */ 209,
/* 42 */ 42, /* 210 */ 210, /* 211 */ 211, /* 212 */ 212, /* 213 */ 213, /* 214 */ 214,
/* 43 */ 43, /* 215 */ 215, /* 216 */ 216, /* 217 */ 217, /* 218 */ 218, /* 219 */ 219,
/* 44 */ 44, /* 220 */ 220, /* 221 */ 221, /* 222 */ 222, /* 223 */ 223, /* 224 */ 224,
/* 45 */ 45, /* 225 */ 225, /* 226 */ 226, /* 227 */ 227, /* 228 */ 228, /* 229 */ 229,
/* 46 */ 46, /* 230 */ 230, /* 231 */ 231, /* 232 */ 232, /* 233 */ 233, /* 234 */ 234,
/* 47 */ 47, /* 235 */ 235, /* 236 */ 236, /* 237 */ 237, /* 238 */ 238, /* 239 */ 239,
/* 48 */ 48, /* 240 */ 240, /* 241 */ 241, /* 242 */ 242, /* 243 */ 243, /* 244 */ 244,
/* 49 */ 49, /* 245 */ 245, /* 246 */ 246, /* 247 */ 247, /* 248 */ 248, /* 249 */ 249,
/* 50 */ 50, /* 250 */ 250, /* 251 */ 251, /* 252 */ 252, /* 253 */ 253, /* 254 */ 254,
/* 51 */ 51,
/* 52 */ 52,
/* 53 */ 53,
/* 54 */ 54,
/* 55 */ 55,
/* 56 */ 56,
/* 57 */ 57,
/* 58 */ 58,
/* 59 */ 59,
/* 60 */ 60,
/* 61 */ 61,
/* 62 */ 62,
/* 63 */ 63,
/* 64 */ 64,
/* 65 */ 65,
/* 66 */ 66,
/* 67 */ 67,
/* 68 */ 68,
/* 69 */ 69,
/* 70 */ 70,
/* 71 */ 71,
/* 72 */ 72,
/* 73 */ 73,
/* 74 */ 74,
/* 75 */ 75,
/* 76 */ 76,
/* 77 */ 77,
/* 78 */ 78,
/* 79 */ 79,
/* 80 */ 80,
/* 81 */ 81,
/* 82 */ 82,
/* 83 */ 83,
/* 84 */ 84,
/* 85 */ 85,
/* 86 */ 86,
/* 87 */ 87,
/* 88 */ 88,
/* 89 */ 89,
/* 90 */ 90,
/* 91 */ 91,
/* 92 */ 124,
/* 93 */ 93,
/* 94 */ 94,
/* 95 */ 95,
/* 96 */ 96,
/* 97 */ 211,
/* 98 */ 98,
/* 99 */ 99,
/* 100 */ 100,
/* 101 */ 208,
/* 102 */ 102,
/* 103 */ 103,
/* 104 */ 108,
/* 105 */ 109,
/* 106 */ 112,
/* 107 */ 111,
/* 108 */ 113,
/* 109 */ 109,
/* 110 */ 97,
/* 111 */ 98,
/* 112 */ 99,
/* 113 */ 100,
/* 114 */ 102,
/* 115 */ 103,
/* 116 */ 104,
/* 117 */ 105,
/* 118 */ 106,
/* 119 */ 107,
/* 120 */ 120,
/* 121 */ 121,
/* 122 */ 122,
/* 123 */ 123,
/* 124 */ 124,
/* 125 */ 126,
/* 126 */ 126,
/* 127 */ 110,
/* 128 */ 128,
/* 129 */ 129,
/* 130 */ 130,
/* 131 */ 131,
/* 132 */ 133,
/* 133 */ 115,
/* 134 */ 116,
/* 135 */ 117,
/* 136 */ 136,
/* 137 */ 137,
/* 138 */ 138,
/* 139 */ 139,
/* 140 */ 140,
/* 141 */ 141,
/* 142 */ 142,
/* 143 */ 143,
/* 144 */ 144,
/* 145 */ 145,
/* 146 */ 146,
/* 147 */ 147,
/* 148 */ 148,
/* 149 */ 149,
/* 150 */ 150,
/* 151 */ 151,
/* 152 */ 152,
/* 153 */ 153,
/* 154 */ 154,
/* 155 */ 155,
/* 156 */ 156,
/* 157 */ 157,
/* 158 */ 158,
/* 159 */ 159,
/* 160 */ 160,
/* 161 */ 161,
/* 162 */ 162,
/* 163 */ 163,
/* 164 */ 164,
/* 165 */ 165,
/* 166 */ 166,
/* 167 */ 167,
/* 168 */ 168,
/* 169 */ 169,
/* 170 */ 170,
/* 171 */ 171,
/* 172 */ 172,
/* 173 */ 173,
/* 174 */ 174,
/* 175 */ 175,
/* 176 */ 176,
/* 177 */ 177,
/* 178 */ 178,
/* 179 */ 179,
/* 180 */ 180,
/* 181 */ 181,
/* 182 */ 182,
/* 183 */ 183,
/* 184 */ 184,
/* 185 */ 185,
/* 186 */ 186,
/* 187 */ 187,
/* 188 */ 188,
/* 189 */ 189,
/* 190 */ 190,
/* 191 */ 118,
/* 192 */ 119,
/* 193 */ 120,
/* 194 */ 121,
/* 195 */ 122,
/* 196 */ 196,
/* 197 */ 197,
/* 198 */ 198,
/* 199 */ 199,
/* 200 */ 200,
/* 201 */ 201,
/* 202 */ 202,
/* 203 */ 93,
/* 204 */ 125,
/* 205 */ 156,
/* 206 */ 127,
/* 207 */ 128,
/* 208 */ 208,
/* 209 */ 209,
/* 210 */ 210,
/* 211 */ 211,
/* 212 */ 212,
/* 213 */ 213,
/* 214 */ 214,
/* 215 */ 215,
/* 216 */ 216,
/* 217 */ 217,
/* 218 */ 218,
/* 219 */ 219,
/* 220 */ 220,
/* 221 */ 221,
/* 222 */ 222,
/* 223 */ 223,
/* 224 */ 224,
/* 225 */ 225,
/* 226 */ 226,
/* 227 */ 227,
/* 228 */ 228,
/* 229 */ 229,
/* 230 */ 230,
/* 231 */ 231,
/* 232 */ 232,
/* 233 */ 233,
/* 234 */ 234,
/* 235 */ 235,
/* 236 */ 236,
/* 237 */ 237,
/* 238 */ 238,
/* 239 */ 239,
/* 240 */ 240,
/* 241 */ 241,
/* 242 */ 242,
/* 243 */ 243,
/* 244 */ 244,
/* 245 */ 245,
/* 246 */ 246,
/* 247 */ 247,
/* 248 */ 248,
/* 249 */ 249,
/* 250 */ 250,
/* 251 */ 251,
/* 252 */ 252,
/* 253 */ 253,
/* 254 */ 254,
/* 255 */ 255 /* 255 */ 255
}; };
......
...@@ -194,6 +194,13 @@ extern int nxagentMaxAllowedResets; ...@@ -194,6 +194,13 @@ extern int nxagentMaxAllowedResets;
extern int nxagentFindClientResource(int, RESTYPE, void *); extern int nxagentFindClientResource(int, RESTYPE, void *);
#ifdef NXAGENT_CLIPBOARD
extern int nxagentPrimarySelection;
extern int nxagentClipboardSelection;
extern int nxagentMaxSelections;
#endif
extern int nxOpenFont(ClientPtr, XID, Mask, unsigned, char*);
void void
InitSelections() InitSelections()
...@@ -206,23 +213,23 @@ InitSelections() ...@@ -206,23 +213,23 @@ InitSelections()
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
{ {
Selection *newsels; Selection *newsels;
newsels = (Selection *)malloc(2 * sizeof(Selection)); newsels = (Selection *)malloc(nxagentMaxSelections * sizeof(Selection));
if (!newsels) if (!newsels)
return; return;
NumCurrentSelections += 2; NumCurrentSelections += nxagentMaxSelections;
CurrentSelections = newsels; CurrentSelections = newsels;
CurrentSelections[0].selection = XA_PRIMARY; CurrentSelections[nxagentPrimarySelection].selection = XA_PRIMARY;
CurrentSelections[0].lastTimeChanged = ClientTimeToServerTime(0); CurrentSelections[nxagentPrimarySelection].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[0].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[nxagentPrimarySelection].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[0].pWin = NULL; CurrentSelections[nxagentPrimarySelection].pWin = NULL;
CurrentSelections[0].client = NullClient; CurrentSelections[nxagentPrimarySelection].client = NullClient;
CurrentSelections[1].selection = MakeAtom("CLIPBOARD", 9, 1); CurrentSelections[nxagentClipboardSelection].selection = MakeAtom("CLIPBOARD", 9, 1);
CurrentSelections[1].lastTimeChanged = ClientTimeToServerTime(0); CurrentSelections[nxagentClipboardSelection].lastTimeChanged = ClientTimeToServerTime(0);
CurrentSelections[1].window = screenInfo.screens[0]->root->drawable.id; CurrentSelections[nxagentClipboardSelection].window = screenInfo.screens[0]->root->drawable.id;
CurrentSelections[1].pWin = NULL; CurrentSelections[nxagentClipboardSelection].pWin = NULL;
CurrentSelections[1].client = NullClient; CurrentSelections[nxagentClipboardSelection].client = NullClient;
} }
#endif #endif
...@@ -769,7 +776,6 @@ ProcOpenFont(register ClientPtr client) ...@@ -769,7 +776,6 @@ ProcOpenFont(register ClientPtr client)
fontReq[stuff->nbytes]=0; fontReq[stuff->nbytes]=0;
if (strchr(fontReq,'*') || strchr(fontReq,'?')) if (strchr(fontReq,'*') || strchr(fontReq,'?'))
{ {
extern int nxOpenFont(ClientPtr, XID, Mask, unsigned, char*);
#ifdef NXAGENT_FONTMATCH_DEBUG #ifdef NXAGENT_FONTMATCH_DEBUG
fprintf(stderr, "Dispatch: ProcOpenFont try to find a common font with font pattern=%s\n",fontReq); fprintf(stderr, "Dispatch: ProcOpenFont try to find a common font with font pattern=%s\n",fontReq);
#endif #endif
......
...@@ -88,13 +88,7 @@ static Bool doListFontsAndAliases(ClientPtr client, LFclosurePtr c); ...@@ -88,13 +88,7 @@ static Bool doListFontsAndAliases(ClientPtr client, LFclosurePtr c);
#include "Agent.h" #include "Agent.h"
#include "Font.h" #include "Font.h"
#ifndef NX_TRANS_SOCKET #ifdef NXAGENT_SERVER
#define NX_TRANS_SOCKET
#endif
#ifdef NX_TRANS_SOCKET
#define NXFONTPATHLENGTH 1024 #define NXFONTPATHLENGTH 1024
char _NXFontPath[NXFONTPATHLENGTH]; char _NXFontPath[NXFONTPATHLENGTH];
...@@ -107,8 +101,6 @@ char _NXFontPath[NXFONTPATHLENGTH]; ...@@ -107,8 +101,6 @@ char _NXFontPath[NXFONTPATHLENGTH];
static const char *_NXGetFontPath(const char *path) static const char *_NXGetFontPath(const char *path)
{ {
const char *fontEnv;
/* /*
* Check the environment only once. * Check the environment only once.
*/ */
...@@ -118,13 +110,13 @@ static const char *_NXGetFontPath(const char *path) ...@@ -118,13 +110,13 @@ static const char *_NXGetFontPath(const char *path)
return _NXFontPath; return _NXFontPath;
} }
fontEnv = getenv("NX_FONT"); const char *fontEnv = getenv("NX_FONT");
if (fontEnv != NULL && *fontEnv != '\0') if (fontEnv != NULL && *fontEnv != '\0')
{ {
if (strlen(fontEnv) + 1 > NXFONTPATHLENGTH) if (strlen(fontEnv) + 1 > NXFONTPATHLENGTH)
{ {
#ifdef NX_TRANS_TEST #ifdef TEST
fprintf(stderr, "_NXGetFontPath: WARNING! Maximum length of font path exceeded.\n"); fprintf(stderr, "_NXGetFontPath: WARNING! Maximum length of font path exceeded.\n");
#endif #endif
goto _NXGetFontPathError; goto _NXGetFontPathError;
...@@ -132,7 +124,7 @@ static const char *_NXGetFontPath(const char *path) ...@@ -132,7 +124,7 @@ static const char *_NXGetFontPath(const char *path)
snprintf(_NXFontPath, NXFONTPATHLENGTH, "%s", fontEnv); snprintf(_NXFontPath, NXFONTPATHLENGTH, "%s", fontEnv);
#ifdef NX_TRANS_TEST #ifdef TEST
fprintf(stderr, "_NXGetFontPath: Using NX font path [%s].\n", _NXFontPath); fprintf(stderr, "_NXGetFontPath: Using NX font path [%s].\n", _NXFontPath);
#endif #endif
...@@ -143,7 +135,7 @@ _NXGetFontPathError: ...@@ -143,7 +135,7 @@ _NXGetFontPathError:
snprintf(_NXFontPath, NXFONTPATHLENGTH, "%s", path); snprintf(_NXFontPath, NXFONTPATHLENGTH, "%s", path);
#ifdef NX_TRANS_TEST #ifdef TEST
fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath); fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath);
#endif #endif
...@@ -1003,9 +995,9 @@ SetDefaultFontPath(char *path) ...@@ -1003,9 +995,9 @@ SetDefaultFontPath(char *path)
size = 0, size = 0,
bad; bad;
#ifdef NX_TRANS_SOCKET #ifdef NXAGENT_SERVER
path = (char *) _NXGetFontPath(path); path = (char *) _NXGetFontPath(path);
#endif /* NX_TRANS_SOCKET */ #endif /* NXAGENT_SERVER */
start = path; start = path;
......
...@@ -147,6 +147,16 @@ extern Display *nxagentDisplay; ...@@ -147,6 +147,16 @@ extern Display *nxagentDisplay;
extern WindowPtr nxagentLastEnteredWindow; extern WindowPtr nxagentLastEnteredWindow;
#ifdef VIEWPORT_FRAME
extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr);
#endif
extern int nxagentShadowInit(ScreenPtr, WindowPtr);
#ifdef NXAGENT_CLIPBOARD
extern int nxagentSendNotify(xEvent*);
#endif
void void
ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
TimeStamp time, Bool autoGrab) TimeStamp time, Bool autoGrab)
...@@ -466,11 +476,6 @@ void ...@@ -466,11 +476,6 @@ void
DefineInitialRootWindow(register WindowPtr win) DefineInitialRootWindow(register WindowPtr win)
{ {
register ScreenPtr pScreen = win->drawable.pScreen; register ScreenPtr pScreen = win->drawable.pScreen;
#ifdef VIEWPORT_FRAME
extern void nxagentInitViewportFrame(ScreenPtr, WindowPtr);
#endif
extern int nxagentShadowInit(ScreenPtr, WindowPtr);
sprite.hotPhys.pScreen = pScreen; sprite.hotPhys.pScreen = pScreen;
sprite.hotPhys.x = pScreen->width / 2; sprite.hotPhys.x = pScreen->width / 2;
sprite.hotPhys.y = pScreen->height / 2; sprite.hotPhys.y = pScreen->height / 2;
...@@ -537,7 +542,6 @@ ProcSendEvent(ClientPtr client) ...@@ -537,7 +542,6 @@ ProcSendEvent(ClientPtr client)
if (stuff -> event.u.u.type == SelectionNotify) if (stuff -> event.u.u.type == SelectionNotify)
{ {
extern int nxagentSendNotify(xEvent*);
if (nxagentSendNotify(&stuff->event) == 1) if (nxagentSendNotify(&stuff->event) == 1)
return Success; return Success;
} }
......
...@@ -81,6 +81,8 @@ void *nxagentMatchingFormats(PictFormatPtr pForm); ...@@ -81,6 +81,8 @@ void *nxagentMatchingFormats(PictFormatPtr pForm);
void nxagentPictureCreateDefaultFormats(ScreenPtr pScreen, FormatInitRec *formats, int *nformats); void nxagentPictureCreateDefaultFormats(ScreenPtr pScreen, FormatInitRec *formats, int *nformats);
extern int nxagentPicturePrivateIndex;
PictFormatPtr PictFormatPtr
PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
{ {
...@@ -303,8 +305,6 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) ...@@ -303,8 +305,6 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
static PicturePtr createSourcePicture(void) static PicturePtr createSourcePicture(void)
{ {
extern int nxagentPicturePrivateIndex;
/* /*
* Compute size of entire PictureRect, plus privates. * Compute size of entire PictureRect, plus privates.
*/ */
......
...@@ -93,6 +93,14 @@ nxagentWMStateRec; ...@@ -93,6 +93,14 @@ nxagentWMStateRec;
#undef TEST #undef TEST
#undef DEBUG #undef DEBUG
#ifdef NXAGENT_CLIPBOARD
extern WindowPtr nxagentGetClipboardWindow(Atom, WindowPtr);
#endif
#ifdef NXAGENT_ARTSD
extern Atom mcop_local_atom;
#endif
int int
ProcChangeProperty(ClientPtr client) ProcChangeProperty(ClientPtr client)
{ {
...@@ -127,11 +135,7 @@ ProcChangeProperty(ClientPtr client) ...@@ -127,11 +135,7 @@ ProcChangeProperty(ClientPtr client)
REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize);
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
{ pWin = nxagentGetClipboardWindow(stuff->property, NULL);
extern WindowPtr nxagentGetClipboardWindow(Atom, WindowPtr);
pWin = nxagentGetClipboardWindow(stuff->property, NULL);
}
if (pWin == NULL) if (pWin == NULL)
#endif #endif
...@@ -168,7 +172,6 @@ ProcChangeProperty(ClientPtr client) ...@@ -168,7 +172,6 @@ ProcChangeProperty(ClientPtr client)
they are already set reflecting the server side settings. they are already set reflecting the server side settings.
Just return success. Just return success.
*/ */
extern Atom mcop_local_atom;
if (stuff->property == mcop_local_atom) if (stuff->property == mcop_local_atom)
return client->noClientException; return client->noClientException;
} }
...@@ -549,14 +552,17 @@ ProcGetProperty(ClientPtr client) ...@@ -549,14 +552,17 @@ ProcGetProperty(ClientPtr client)
#ifdef NXAGENT_CLIPBOARD #ifdef NXAGENT_CLIPBOARD
/* GetWindowProperty clipboard use only */ /* GetWindowProperty clipboard use only */
/* FIXME: that's wrong, it is also called in Window.c and Events. */
/* FIXME: should be moved to a different file, is not derived from
dix */
int int
GetWindowProperty(pWin, property, longOffset, longLength, delete, GetWindowProperty(pWin, property, longOffset, longLength, delete,
type, actualType, format, nItems, bytesAfter, propData ) type, actualType, format, nItems, bytesAfter, propData )
WindowPtr pWin; WindowPtr pWin;
Atom property; Atom property;
long longOffset; long longOffset;
long longLength; long longLength;
Bool delete; Bool delete;
Atom type; Atom type;
Atom *actualType; Atom *actualType;
int *format; int *format;
...@@ -569,24 +575,24 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -569,24 +575,24 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (!pWin) if (!pWin)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: invalid window\n", __func__); fprintf(stderr, "%s: invalid window\n", __func__);
#endif #endif
return BadWindow; return BadWindow;
} }
if (!ValidAtom(property)) if (!ValidAtom(property))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: invalid atom [%d]\n", __func__, property); fprintf(stderr, "%s: invalid atom [%d]\n", __func__, property);
#endif #endif
return(BadAtom); return(BadAtom);
} }
if ((type != AnyPropertyType) && !ValidAtom(type)) if ((type != AnyPropertyType) && !ValidAtom(type))
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: invalid type [%d]\n", __func__, type); fprintf(stderr, "%s: invalid type [%d]\n", __func__, type);
#endif #endif
return(BadAtom); return(BadAtom);
} }
...@@ -604,14 +610,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -604,14 +610,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (!pProp) if (!pProp)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: property not found [%d]\n", __func__, property); fprintf(stderr, "%s: property not found [%d]\n", __func__, property);
#endif #endif
return (BadAtom); return (BadAtom);
} }
/* If the request type and actual type don't match. Return the /* If the request type and actual type don't match. Return the
property information, but not the data. */ property information, but not the data. */
if (((type != pProp->type) && if (((type != pProp->type) &&
(type != AnyPropertyType)) (type != AnyPropertyType))
...@@ -624,20 +630,20 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -624,20 +630,20 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return(Success); return(Success);
} }
/* /*
* Return type, format, value to client * Return type, format, value to client
*/ */
n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */ n = (pProp->format/8) * pProp->size; /* size (bytes) of prop */
ind = longOffset << 2; ind = longOffset << 2;
/* If longOffset is invalid such that it causes "len" to /* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */ be negative, it's a value error. */
if (n < ind) if (n < ind)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: negative property len\n", __func__); fprintf(stderr, "%s: negative property len\n", __func__);
#endif #endif
return BadValue; return BadValue;
} }
...@@ -650,9 +656,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -650,9 +656,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (delete && (*bytesAfter == 0)) if (delete && (*bytesAfter == 0))
{ /* send the event */ { /* send the event */
xEvent event; xEvent event = {0};
memset(&event, 0, sizeof(xEvent));
event.u.u.type = PropertyNotify; event.u.u.type = PropertyNotify;
event.u.property.window = pWin->drawable.id; event.u.property.window = pWin->drawable.id;
event.u.property.state = PropertyDelete; event.u.property.state = PropertyDelete;
...@@ -663,7 +667,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -663,7 +667,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
if (len) if (len)
{ {
*propData = (unsigned char *)(pProp->data) + ind; *propData = (unsigned char *)(pProp->data) + ind;
} }
if (delete && (*bytesAfter == 0)) if (delete && (*bytesAfter == 0))
...@@ -681,3 +685,50 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete, ...@@ -681,3 +685,50 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return(Success); return(Success);
} }
#endif #endif
int
ProcDeleteProperty(register ClientPtr client)
{
WindowPtr pWin;
REQUEST(xDeletePropertyReq);
int result;
REQUEST_SIZE_MATCH(xDeletePropertyReq);
UpdateCurrentTime();
pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client,
DixWriteAccess);
if (!pWin)
return(BadWindow);
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return (BadAtom);
}
#ifdef XCSECURITY
switch(SecurityCheckPropertyAccess(client, pWin, stuff->property,
DixDestroyAccess))
{
case SecurityErrorOperation:
client->errorValue = stuff->property;
return BadAtom;;
case SecurityIgnoreOperation:
return Success;
}
#endif
#ifdef NXAGENT_SERVER
/* prevent clients from deleting the NX_AGENT_VERSION property */
{
Atom prop = MakeAtom("NX_AGENT_VERSION", strlen("NX_AGENT_VERSION"), True);
if (stuff->property == prop)
return client->noClientException;
}
#endif
result = DeleteProperty(pWin, stuff->property);
if (client->noClientException != Success)
return(client->noClientException);
else
return(result);
}
...@@ -90,7 +90,7 @@ void miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box); ...@@ -90,7 +90,7 @@ void miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
extern int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); extern int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
extern void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); extern void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
extern int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); extern void nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
extern int nxagentCreatePicture(PicturePtr, Mask); extern int nxagentCreatePicture(PicturePtr, Mask);
extern void nxagentChangePicture(PicturePtr, Mask); extern void nxagentChangePicture(PicturePtr, Mask);
extern int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); extern int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
...@@ -124,6 +124,8 @@ extern void nxagentRenderCreateConicalGradient(PicturePtr pPicture, ...@@ -124,6 +124,8 @@ extern void nxagentRenderCreateConicalGradient(PicturePtr pPicture,
xFixed *stops, xFixed *stops,
xRenderColor *colors); xRenderColor *colors);
extern int nxagentAlphaEnabled;
/* /*
* The void pointer is actually a XGlyphElt8. * The void pointer is actually a XGlyphElt8.
*/ */
...@@ -184,7 +186,6 @@ ProcRenderQueryPictFormats (ClientPtr client) ...@@ -184,7 +186,6 @@ ProcRenderQueryPictFormats (ClientPtr client)
int numScreens; int numScreens;
int numSubpixel; int numSubpixel;
extern int nxagentAlphaEnabled;
/* REQUEST(xRenderQueryPictFormatsReq); */ /* REQUEST(xRenderQueryPictFormatsReq); */
REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq);
...@@ -715,6 +716,9 @@ ProcRenderTrapezoids (ClientPtr client) ...@@ -715,6 +716,9 @@ ProcRenderTrapezoids (ClientPtr client)
{ {
if (pFormat != NULL) if (pFormat != NULL)
{ {
if (nxagentTrapezoidExtents && nxagentTrapezoidExtents != NullBox)
free(nxagentTrapezoidExtents);
nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec)); nxagentTrapezoidExtents = (BoxPtr) malloc(sizeof(BoxRec));
miTrapezoidBounds (ntraps, (xTrapezoid *) &stuff[1], nxagentTrapezoidExtents); miTrapezoidBounds (ntraps, (xTrapezoid *) &stuff[1], nxagentTrapezoidExtents);
......
...@@ -81,6 +81,8 @@ extern void fbPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -81,6 +81,8 @@ extern void fbPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
int x, int y, int w, int h, int leftPad, int format, int x, int y, int w, int h, int leftPad, int format,
char *pImage); char *pImage);
extern int nxagentImageLength(int, int, int, int, int);
void void
ShmExtensionInit(void) ShmExtensionInit(void)
{ {
...@@ -228,7 +230,6 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) ...@@ -228,7 +230,6 @@ fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
int length; int length;
char *newdata; char *newdata;
extern int nxagentImageLength(int, int, int, int, int);
#ifdef TEST #ifdef TEST
fprintf(stderr, "fbShmPutImage: Called with drawable at [%p] GC at [%p] data at [%p].\n", fprintf(stderr, "fbShmPutImage: Called with drawable at [%p] GC at [%p] data at [%p].\n",
......
...@@ -106,7 +106,6 @@ Equipment Corporation. ...@@ -106,7 +106,6 @@ Equipment Corporation.
#include "Screen.h" #include "Screen.h"
#include "Options.h" #include "Options.h"
#include "Atoms.h"
#include "Clipboard.h" #include "Clipboard.h"
#include "Splash.h" #include "Splash.h"
#include "Rootless.h" #include "Rootless.h"
...@@ -204,8 +203,6 @@ InitRootWindow(WindowPtr pWin) ...@@ -204,8 +203,6 @@ InitRootWindow(WindowPtr pWin)
fprintf(stderr, "InitRootWindow: Mapping default windows.\n"); fprintf(stderr, "InitRootWindow: Mapping default windows.\n");
#endif #endif
nxagentInitAtoms(pWin);
nxagentInitClipboard(pWin); nxagentInitClipboard(pWin);
nxagentMapDefaultWindows(); nxagentMapDefaultWindows();
...@@ -215,9 +212,7 @@ InitRootWindow(WindowPtr pWin) ...@@ -215,9 +212,7 @@ InitRootWindow(WindowPtr pWin)
#ifdef NXAGENT_ARTSD #ifdef NXAGENT_ARTSD
{ {
char artsd_port[10]; char artsd_port[10];
short int nPort; short int nPort = atoi(display) + 7000;
extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
nPort = atoi(display) + 7000;
sprintf(artsd_port,"%d", nPort); sprintf(artsd_port,"%d", nPort);
nxagentPropagateArtsdProperties(pScreen, artsd_port); nxagentPropagateArtsdProperties(pScreen, artsd_port);
} }
......
...@@ -133,7 +133,6 @@ void nxagentInitOptions(void) ...@@ -133,7 +133,6 @@ void nxagentInitOptions(void)
nxagentOptions.Xdmcp = 0; nxagentOptions.Xdmcp = 0;
nxagentOptions.DisplayLatency = 0;
nxagentOptions.DisplayBuffer = UNDEFINED; nxagentOptions.DisplayBuffer = UNDEFINED;
nxagentOptions.DisplayCoalescence = 0; nxagentOptions.DisplayCoalescence = 0;
......
...@@ -295,16 +295,6 @@ typedef struct _AgentOptions ...@@ -295,16 +295,6 @@ typedef struct _AgentOptions
int Xdmcp; int Xdmcp;
/* /*
* Latency of the link. It is simply set
* to a reference value, calculated based
* on the time required to complete the
* query of the agent's atoms at session
* startup.
*/
int DisplayLatency;
/*
* Size of the Xlib display buffer. The * Size of the Xlib display buffer. The
* default is set according to the link * default is set according to the link
* type. * type.
......
...@@ -63,10 +63,6 @@ int nxagentUniquePixels(XImage *image) ...@@ -63,10 +63,6 @@ int nxagentUniquePixels(XImage *image)
int elements = PIXEL_ELEMENTS; int elements = PIXEL_ELEMENTS;
int unique = 0; int unique = 0;
int total;
int ratio;
int step;
int last = -1; int last = -1;
const char *next = image -> data; const char *next = image -> data;
...@@ -80,9 +76,9 @@ int nxagentUniquePixels(XImage *image) ...@@ -80,9 +76,9 @@ int nxagentUniquePixels(XImage *image)
* Take at most 256 pixels from the image. * Take at most 256 pixels from the image.
*/ */
total = image -> width * image -> height; int total = image -> width * image -> height;
step = total / elements; int step = total / elements;
if (step < PIXEL_STEP) if (step < PIXEL_STEP)
{ {
...@@ -231,7 +227,7 @@ int nxagentUniquePixels(XImage *image) ...@@ -231,7 +227,7 @@ int nxagentUniquePixels(XImage *image)
#endif #endif
} }
ratio = unique * 100 / elements; int ratio = unique * 100 / elements;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentUniquePixels: Found [%d] unique pixels out of [%d] with ratio [%d%%].\n", fprintf(stderr, "nxagentUniquePixels: Found [%d] unique pixels out of [%d] with ratio [%d%%].\n",
...@@ -267,13 +263,11 @@ unsigned int Get16(const char *buffer, int order) ...@@ -267,13 +263,11 @@ unsigned int Get16(const char *buffer, int order)
unsigned int Get24(const char *buffer, int order) unsigned int Get24(const char *buffer, int order)
{ {
int i;
const char *next = (order == MSBFirst ? buffer : buffer + 2); const char *next = (order == MSBFirst ? buffer : buffer + 2);
unsigned int result = 0; unsigned int result = 0;
for (i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
result <<= 8; result <<= 8;
...@@ -294,13 +288,11 @@ unsigned int Get24(const char *buffer, int order) ...@@ -294,13 +288,11 @@ unsigned int Get24(const char *buffer, int order)
unsigned int Get32(const char *buffer, int order) unsigned int Get32(const char *buffer, int order)
{ {
int i;
const char *next = (order == MSBFirst ? buffer : buffer + 3); const char *next = (order == MSBFirst ? buffer : buffer + 3);
unsigned int result = 0; unsigned int result = 0;
for (i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
result <<= 8; result <<= 8;
...@@ -341,13 +333,11 @@ void Put16(unsigned int value, char *buffer, int order) ...@@ -341,13 +333,11 @@ void Put16(unsigned int value, char *buffer, int order)
void Put24(unsigned int value, char *buffer, int order) void Put24(unsigned int value, char *buffer, int order)
{ {
int i;
if (order == MSBFirst) if (order == MSBFirst)
{ {
buffer += 2; buffer += 2;
for (i = 3; i > 0; i--) for (int i = 3; i > 0; i--)
{ {
*buffer-- = (unsigned char) (value & 0xff); *buffer-- = (unsigned char) (value & 0xff);
...@@ -356,7 +346,7 @@ void Put24(unsigned int value, char *buffer, int order) ...@@ -356,7 +346,7 @@ void Put24(unsigned int value, char *buffer, int order)
} }
else else
{ {
for (i = 3; i > 0; i--) for (int i = 3; i > 0; i--)
{ {
*buffer++ = (unsigned char) (value & 0xff); *buffer++ = (unsigned char) (value & 0xff);
...@@ -367,13 +357,11 @@ void Put24(unsigned int value, char *buffer, int order) ...@@ -367,13 +357,11 @@ void Put24(unsigned int value, char *buffer, int order)
void Put32(unsigned int value, char *buffer, int order) void Put32(unsigned int value, char *buffer, int order)
{ {
int i;
if (order == MSBFirst) if (order == MSBFirst)
{ {
buffer += 3; buffer += 3;
for (i = 4; i > 0; i--) for (int i = 4; i > 0; i--)
{ {
*buffer-- = (unsigned char) (value & 0xff); *buffer-- = (unsigned char) (value & 0xff);
...@@ -382,7 +370,7 @@ void Put32(unsigned int value, char *buffer, int order) ...@@ -382,7 +370,7 @@ void Put32(unsigned int value, char *buffer, int order)
} }
else else
{ {
for (i = 4; i > 0; i--) for (int i = 4; i > 0; i--)
{ {
*buffer++ = (unsigned char) (value & 0xff); *buffer++ = (unsigned char) (value & 0xff);
......
...@@ -104,7 +104,7 @@ while (0) ...@@ -104,7 +104,7 @@ while (0)
void nxagentRenderExtensionInit(void); void nxagentRenderExtensionInit(void);
Bool nxagentPictureInit(ScreenPtr, PictFormatPtr, int); Bool nxagentPictureInit(ScreenPtr, PictFormatPtr, int);
int nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); void nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi,
int nglyphs, CARD8 *images, int sizeImages); int nglyphs, CARD8 *images, int sizeImages);
......
...@@ -136,6 +136,8 @@ void nxagentSetWMNormalHintsMaxsize(ScreenPtr, int, int); ...@@ -136,6 +136,8 @@ void nxagentSetWMNormalHintsMaxsize(ScreenPtr, int, int);
void nxagentShadowSetRatio(float, float); void nxagentShadowSetRatio(float, float);
void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
/* /*
* Change window settings to adapt to a ratio. * Change window settings to adapt to a ratio.
*/ */
......
...@@ -792,11 +792,11 @@ void nxagentWaitDrawable(DrawablePtr pDrawable) ...@@ -792,11 +792,11 @@ void nxagentWaitDrawable(DrawablePtr pDrawable)
else else
{ {
fprintf(stderr, "nxagentWaitDrawable: Drawable at [%p] can now be restarted.\n", fprintf(stderr, "nxagentWaitDrawable: Drawable at [%p] can now be restarted.\n",
(void *) pDrawable); (void *) pDrawable);
} }
#endif #endif
return; return;
} }
......
...@@ -27,91 +27,68 @@ ...@@ -27,91 +27,68 @@
#define __Traps_H__ #define __Traps_H__
/* /*
* Set if we are dispatching a render * Set if we are dispatching a render extension request. Used to avoid
* extension request. Used to avoid
* reentrancy in GC operations. * reentrancy in GC operations.
*/ */
extern int nxagentGCTrap; extern int nxagentGCTrap;
/* /*
* Set if we are enqueing an internal * Set if we are enqueing an internal operation, CreateWindow and
* operation, CreateWindow and Reparent- * Reparent- Window. Used to remove any screen operation.
* Window. Used to remove any screen operation.
*/ */
extern int nxagentScreenTrap; extern int nxagentScreenTrap;
/* /*
* Set if we are executing a GC operation * Set if we are executing a GC operation only on the X side. Used to
* only on the X side. Used to avoid * avoid reentrancy in FB layer.
* reentrancy in FB layer.
*/ */
extern int nxagentFBTrap; extern int nxagentFBTrap;
/* /*
* Set if we are dispatching a shared * Set if we are dispatching a shared memory extension request.
* memory extension request.
*/ */
extern int nxagentShmTrap; extern int nxagentShmTrap;
/* /*
* Set if a shared pixmap operation is * Set if a shared pixmap operation is requested by the client.
* requested by the client.
*/ */
extern int nxagentShmPixmapTrap; extern int nxagentShmPixmapTrap;
/* /*
* Set if we are dispatching a XVideo * Set if we are dispatching a XVideo extension request.
* extension request.
*/ */
extern int nxagentXvTrap; extern int nxagentXvTrap;
/* /*
* Set if we are dispatching a GLX * Set if we are dispatching a GLX extension request.
* extension request.
*/ */
extern int nxagentGlxTrap; extern int nxagentGlxTrap;
/* /*
* Set while we are resuming the session. * Set while we are resuming the session.
*/ */
extern int nxagentReconnectTrap; extern int nxagentReconnectTrap;
/* /*
* Set if we need to realize a drawable * Set if we need to realize a drawable by using a lossless encoding.
* by using a lossless encoding.
*/ */
extern int nxagentLosslessTrap; extern int nxagentLosslessTrap;
/* /*
* Set to force the synchronization of * Set to force the synchronization of a drawable.
* a drawable.
*/ */
extern int nxagentSplitTrap; extern int nxagentSplitTrap;
/* /*
* Set to avoid CapsLock synchronization * Set to avoid CapsLock synchronization problems when CapsLock is the
* problems when CapsLock is the first * first key to be pressed in the session.
* key to be pressed in the session.
*/ */
extern int nxagentXkbCapsTrap; extern int nxagentXkbCapsTrap;
/* /*
* Set to avoid NumLock synchronization * Set to avoid NumLock synchronization problems when NumLock is the
* problems when NumLock is the first * first key to be pressed in the session.
* key to be pressed in the session.
*/ */
extern int nxagentXkbNumTrap; extern int nxagentXkbNumTrap;
/* /*
...@@ -119,7 +96,6 @@ extern int nxagentXkbNumTrap; ...@@ -119,7 +96,6 @@ extern int nxagentXkbNumTrap;
* the real X server. This is used to avoid endless loops if callbacks * the real X server. This is used to avoid endless loops if callbacks
* would trigger another event by the real X server * would trigger another event by the real X server
*/ */
extern int nxagentExternalClipboardEventTrap; extern int nxagentExternalClipboardEventTrap;
#endif /* __Trap_H__ */ #endif /* __Trap_H__ */
...@@ -47,4 +47,8 @@ static inline const char * validateString(const char *str) { ...@@ -47,4 +47,8 @@ static inline const char * validateString(const char *str) {
#define SAFE_XFree(what) do {if (what) {XFree(what); what = NULL;}} while (0) #define SAFE_XFree(what) do {if (what) {XFree(what); what = NULL;}} while (0)
#define SAFE_free(what) do {free(what); what = NULL;} while (0) #define SAFE_free(what) do {free(what); what = NULL;} while (0)
/* some helper macros to produce a quoted string from other macros */
#define QUOTEEXP(str) #str
#define QUOTE(str) QUOTEEXP(str)
#endif /* __Utils_H__ */ #endif /* __Utils_H__ */
...@@ -2671,7 +2671,7 @@ void nxagentDisconnectWindow(void * p0, XID x1, void * p2) ...@@ -2671,7 +2671,7 @@ void nxagentDisconnectWindow(void * p0, XID x1, void * p2)
nxagentCursorPriv(pCursor, pScreen) && nxagentCursorPriv(pCursor, pScreen) &&
nxagentCursor(pCursor, pScreen)) nxagentCursor(pCursor, pScreen))
{ {
#ifdef NXAGENT_RECONNECT_CURSOR_DEBUG_disabled #ifdef NXAGENT_RECONNECT_CURSOR_DEBUG
char msg[] = "nxagentDisconnectWindow:"; char msg[] = "nxagentDisconnectWindow:";
nxagentPrintCursorInfo(pCursor, msg); nxagentPrintCursorInfo(pCursor, msg);
......
...@@ -271,6 +271,14 @@ long Memory_fail = 0; ...@@ -271,6 +271,14 @@ long Memory_fail = 0;
char *dev_tty_from_init = NULL; /* since we need to parse it anyway */ char *dev_tty_from_init = NULL; /* since we need to parse it anyway */
#endif #endif
#ifdef NXAGENT_SERVER
extern const char *nxagentProgName;
#endif
#ifdef NX_TRANS_SOCKET
extern char **environ;
#endif
extern char dispatchExceptionAtReset; extern char dispatchExceptionAtReset;
/* Extension enable/disable in miinitext.c */ /* Extension enable/disable in miinitext.c */
...@@ -554,7 +562,6 @@ AdjustWaitForDelay (void * waitTime, unsigned long newdelay) ...@@ -554,7 +562,6 @@ AdjustWaitForDelay (void * waitTime, unsigned long newdelay)
void UseMsg(void) void UseMsg(void)
{ {
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
extern const char *nxagentProgName;
ErrorF("Usage: %s [<options>] [:<display>]\n\n", nxagentProgName); ErrorF("Usage: %s [<options>] [:<display>]\n\n", nxagentProgName);
#else #else
ErrorF("use: X [:<display>] [option]\n"); ErrorF("use: X [:<display>] [option]\n");
...@@ -1731,8 +1738,6 @@ Popen(char *command, char *type) ...@@ -1731,8 +1738,6 @@ Popen(char *command, char *type)
#else #else
extern char **environ;
char **ep = environ; char **ep = environ;
ep = environ; ep = environ;
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
$(NULL) $(NULL)
INCLUDES = -I../include -I../mi \ INCLUDES = -I../include -I../mi \
-I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ -I../fb -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I../render \ -I../render \
`pkg-config --cflags-only-I pixman-1` `pkg-config --cflags-only-I pixman-1`
......
...@@ -44,7 +44,7 @@ NXAGENT_SKIP_OBJS = \ ...@@ -44,7 +44,7 @@ NXAGENT_SKIP_OBJS = \
$(NULL) $(NULL)
INCLUDES = -I. -I../include -I../mi \ INCLUDES = -I. -I../include -I../mi \
-I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ -I../fb -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I../Xext \ -I../Xext \
`pkg-config --cflags-only-I pixman-1` `pkg-config --cflags-only-I pixman-1`
LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln
......
...@@ -411,7 +411,7 @@ static XkbSymInterpretRec dfltSI[69]= { ...@@ -411,7 +411,7 @@ static XkbSymInterpretRec dfltSI[69]= {
255, 255,
{ XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00 } } }, { XkbSA_LockControls, { 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00 } } },
#ifndef NX_TRANS_SOCKET #ifndef NXAGENT_SERVER
/* /*
* Make sure that the server can't be killed * Make sure that the server can't be killed
......
...@@ -216,7 +216,7 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s ...@@ -216,7 +216,7 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s
// In order to allow this function to // In order to allow this function to
// be suspended and resumed later, we // be suspended and resumed later, we
// need to save these two status vars. // need to save these two status vars.
// //
static int idxIlace = 0; static int idxIlace = 0;
static int curLine = 0; static int curLine = 0;
......
...@@ -41,14 +41,11 @@ ...@@ -41,14 +41,11 @@
Logger logger; Logger logger;
void Logger::user(const char *format, ...) void Logger::user(const char *format, va_list arguments)
{ {
char string[1024]; char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments); vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s\n", string); fprintf(stderr, "%s\n", string);
} }
...@@ -59,26 +56,20 @@ void Logger::error(const char *name, int error) ...@@ -59,26 +56,20 @@ void Logger::error(const char *name, int error)
name, error, strerror(error)); name, error, strerror(error));
} }
void Logger::warning(const char *name, const char *format, ...) void Logger::warning(const char *name, const char *format, va_list arguments)
{ {
char string[1024]; char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments); vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s: WARNING! %s\n", name, string); fprintf(stderr, "%s: WARNING! %s\n", name, string);
} }
void Logger::test(const char *name, const char *format, ...) void Logger::test(const char *name, const char *format, va_list arguments)
{ {
char string[1024]; char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments); vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string); fprintf(stderr, "%s: %s\n", name, string);
} }
...@@ -88,14 +79,11 @@ void Logger::trace(const char *name) ...@@ -88,14 +79,11 @@ void Logger::trace(const char *name)
fprintf(stderr, "%s\n", name); fprintf(stderr, "%s\n", name);
} }
void Logger::debug(const char *name, const char *format, ...) void Logger::debug(const char *name, const char *format, va_list arguments)
{ {
char string[1024]; char string[1024];
va_list arguments;
va_start(arguments, format);
vsnprintf(string, 1024, format, arguments); vsnprintf(string, 1024, format, arguments);
va_end(arguments);
fprintf(stderr, "%s: %s\n", name, string); fprintf(stderr, "%s: %s\n", name, string);
} }
......
...@@ -43,17 +43,17 @@ class Logger ...@@ -43,17 +43,17 @@ class Logger
{ {
public: public:
void user(const char *format, ...) __attribute__((format(printf, 2, 0))); void user(const char *format, va_list arguments) __attribute__((format(printf, 2, 0)));
void error(const char *name, int error); void error(const char *name, int error);
void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); void warning(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); void test(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void trace(const char *name); void trace(const char *name);
void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); void debug(const char *name, const char *format, va_list arguments) __attribute__((format(printf, 3, 0)));
void dump(const char *name, const char *data, int size); void dump(const char *name, const char *data, int size);
}; };
......
...@@ -236,7 +236,7 @@ char *Poller::getRect(XRectangle r) ...@@ -236,7 +236,7 @@ char *Poller::getRect(XRectangle r)
else else
{ {
image_ -> width = r.width; image_ -> width = r.width;
image_ -> height = r.height; image_ -> height = r.height;
image_ -> bytes_per_line = ROUNDUP((image_ -> bits_per_pixel * image_ -> width), image_ -> bitmap_pad); image_ -> bytes_per_line = ROUNDUP((image_ -> bits_per_pixel * image_ -> width), image_ -> bitmap_pad);
...@@ -1155,11 +1155,11 @@ SendKeycode: ...@@ -1155,11 +1155,11 @@ SendKeycode:
if (XKeysymToKeycode(event -> xkey.display, XK_A) != keycode) if (XKeysymToKeycode(event -> xkey.display, XK_A) != keycode)
{ {
KeySym keysym = XKeycodeToKeysym(event -> xkey.display, event -> xkey.keycode, 0); KeySym keysym = XKeycodeToKeysym(event -> xkey.display, event -> xkey.keycode, 0);
if (keysym == XK_Mode_switch || keysym == XK_ISO_Level3_Shift) if (keysym == XK_Mode_switch || keysym == XK_ISO_Level3_Shift)
{ {
logUser("Poller::handleKeyboardEvent: keysym [%x].\n", (unsigned int)keysym); logUser("Poller::handleKeyboardEvent: keysym [%x].\n", (unsigned int)keysym);
if (XKeycodeToKeysym(display_, 113, 0) == XK_ISO_Level3_Shift || if (XKeycodeToKeysym(display_, 113, 0) == XK_ISO_Level3_Shift ||
(XKeycodeToKeysym(display_, 124, 0) == XK_ISO_Level3_Shift)) (XKeycodeToKeysym(display_, 124, 0) == XK_ISO_Level3_Shift))
{ {
...@@ -1169,7 +1169,7 @@ SendKeycode: ...@@ -1169,7 +1169,7 @@ SendKeycode:
{ {
event -> xkey.keycode = XKeysymToKeycode(display_, XK_Mode_switch); event -> xkey.keycode = XKeysymToKeycode(display_, XK_Mode_switch);
} }
logUser("Poller::handleKeyboardEvent: keycode translated to [%x].\n", (unsigned int)event -> xkey.keycode); logUser("Poller::handleKeyboardEvent: keycode translated to [%x].\n", (unsigned int)event -> xkey.keycode);
} }
else else
...@@ -1503,7 +1503,7 @@ void Poller::updateDamagedAreas(void) ...@@ -1503,7 +1503,7 @@ void Poller::updateDamagedAreas(void)
int i; int i;
int y; int y;
for (i = 0; i < lastUpdatedRegion_ -> numRects; i++) for (i = 0; i < lastUpdatedRegion_ -> numRects; i++)
{ {
boxPtr = lastUpdatedRegion_ -> rects + i; boxPtr = lastUpdatedRegion_ -> rects + i;
...@@ -1515,7 +1515,7 @@ void Poller::updateDamagedAreas(void) ...@@ -1515,7 +1515,7 @@ void Poller::updateDamagedAreas(void)
image_ -> bytes_per_line = image_ -> bytes_per_line =
ROUNDUP((image_ -> bits_per_pixel * image_ -> width), ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
image_ -> bitmap_pad); image_ -> bitmap_pad);
if (XShmGetImage(display_, DefaultRootWindow(display_), image_, if (XShmGetImage(display_, DefaultRootWindow(display_), image_,
boxPtr -> x1, boxPtr -> y1, AllPlanes) == 0) boxPtr -> x1, boxPtr -> y1, AllPlanes) == 0)
{ {
...@@ -1554,7 +1554,7 @@ void Poller::updateDamagedAreas(void) ...@@ -1554,7 +1554,7 @@ void Poller::updateDamagedAreas(void)
{ {
update(image_ -> data + y * image_ -> bytes_per_line, rectangle); update(image_ -> data + y * image_ -> bytes_per_line, rectangle);
rectangle.y++; rectangle.y++;
} }
if (shmExtension_ != 1) if (shmExtension_ != 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment