Commit 4690d6b7 authored by Mike Gabriel's avatar Mike Gabriel

hw/nxagent/NXwindow.c: Shrink file, drop duplicate code that can identically be…

hw/nxagent/NXwindow.c: Shrink file, drop duplicate code that can identically be found in dix/window.c.
parent e60f281a
...@@ -16,9 +16,11 @@ FFS_OBJ = ffs.o ...@@ -16,9 +16,11 @@ FFS_OBJ = ffs.o
#if (!(defined(NXAgentServer) && NXAgentServer)) #if (!(defined(NXAgentServer) && NXAgentServer))
NXAGENT_SKIP_SRCS = \ NXAGENT_SKIP_SRCS = \
extension.c \ extension.c \
window.c \
$(NULL) $(NULL)
NXAGENT_SKIP_OBJS = \ NXAGENT_SKIP_OBJS = \
extension.o \ extension.o \
window.o \
$(NULL) $(NULL)
#endif #endif
...@@ -42,7 +44,6 @@ SRCS = \ ...@@ -42,7 +44,6 @@ SRCS = \
swaprep.c \ swaprep.c \
swapreq.c \ swapreq.c \
tables.c \ tables.c \
window.c \
initatoms.c \ initatoms.c \
dixfonts.c \ dixfonts.c \
privates.c \ privates.c \
...@@ -70,7 +71,6 @@ OBJS = \ ...@@ -70,7 +71,6 @@ OBJS = \
swaprep.o \ swaprep.o \
swapreq.o \ swapreq.o \
tables.o \ tables.o \
window.o \
initatoms.o \ initatoms.o \
dixfonts.o \ dixfonts.o \
privates.o \ privates.o \
......
...@@ -160,7 +160,7 @@ static Bool TileScreenSaver(int i, int kind); ...@@ -160,7 +160,7 @@ static Bool TileScreenSaver(int i, int kind);
int numSaveUndersViewable = 0; int numSaveUndersViewable = 0;
int deltaSaveUndersViewable = 0; int deltaSaveUndersViewable = 0;
#ifdef DEBUG #if defined(DEBUG) || (defined(NXAGENT_SERVER) && defined(WINDOW_TREE_DEBUG))
/****** /******
* PrintWindowTree * PrintWindowTree
* For debugging only * For debugging only
...@@ -286,6 +286,7 @@ SetWindowToDefaults(register WindowPtr pWin) ...@@ -286,6 +286,7 @@ SetWindowToDefaults(register WindowPtr pWin)
#endif #endif
} }
#ifndef NXAGENT_SERVER
static void static void
MakeRootTile(WindowPtr pWin) MakeRootTile(WindowPtr pWin)
{ {
...@@ -331,6 +332,7 @@ MakeRootTile(WindowPtr pWin) ...@@ -331,6 +332,7 @@ MakeRootTile(WindowPtr pWin)
FreeScratchGC(pGC); FreeScratchGC(pGC);
} }
#endif /* NXAGENT_SERVER */
WindowPtr WindowPtr
AllocateWindow(ScreenPtr pScreen) AllocateWindow(ScreenPtr pScreen)
...@@ -477,6 +479,7 @@ CreateRootWindow(ScreenPtr pScreen) ...@@ -477,6 +479,7 @@ CreateRootWindow(ScreenPtr pScreen)
return TRUE; return TRUE;
} }
#ifndef NXAGENT_SERVER
void void
InitRootWindow(WindowPtr pWin) InitRootWindow(WindowPtr pWin)
{ {
...@@ -498,6 +501,7 @@ InitRootWindow(WindowPtr pWin) ...@@ -498,6 +501,7 @@ InitRootWindow(WindowPtr pWin)
MapWindow(pWin, serverClient); MapWindow(pWin, serverClient);
} }
#endif /* NXAGENT_SERVER */
/* Set the region to the intersection of the rectangle and the /* Set the region to the intersection of the rectangle and the
* window's winSize. The window is typically the parent of the * window's winSize. The window is typically the parent of the
...@@ -873,12 +877,14 @@ CrushTree(WindowPtr pWin) ...@@ -873,12 +877,14 @@ CrushTree(WindowPtr pWin)
} }
} }
/***** /*****
* DeleteWindow * DeleteWindow
* Deletes child of window then window itself * Deletes child of window then window itself
* If wid is None, don't send any events * If wid is None, don't send any events
*****/ *****/
#ifndef NXAGENT_SERVER
int int
DeleteWindow(void * value, XID wid) DeleteWindow(void * value, XID wid)
{ {
...@@ -914,6 +920,7 @@ DeleteWindow(void * value, XID wid) ...@@ -914,6 +920,7 @@ DeleteWindow(void * value, XID wid)
xfree(pWin); xfree(pWin);
return Success; return Success;
} }
#endif /* NXAGENT_SERVER */
void void
DestroySubwindows(register WindowPtr pWin, ClientPtr client) DestroySubwindows(register WindowPtr pWin, ClientPtr client)
...@@ -1231,6 +1238,25 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt ...@@ -1231,6 +1238,25 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt
#endif /* DO_SAVE_UNDERS */ #endif /* DO_SAVE_UNDERS */
break; break;
case CWEventMask: case CWEventMask:
/*
* TODO: Some applications like java bean shell
* don' t work if they cannot monitor the root
* window for Structure Redirect events. However
* this doesn't seem to be the best solution, since
* also an X server with a window manager running,
* doesn't allow to monitor for those events, but
* the java bean shell works flawlessy on this
* server.
*
* #ifdef NXAGENT_SERVER
* if (nxagentCheckIllegalRootMonitoring(pWin, (Mask)*pVlist))
* {
* return BadAccess;
* }
* #endif
*/
result = EventSelectForWindow(pWin, client, (Mask )*pVlist); result = EventSelectForWindow(pWin, client, (Mask )*pVlist);
if (result) if (result)
{ {
...@@ -1752,6 +1778,7 @@ GravityTranslate (register int x, register int y, int oldx, int oldy, ...@@ -1752,6 +1778,7 @@ GravityTranslate (register int x, register int y, int oldx, int oldy,
} }
/* XXX need to retile border on each window with ParentRelative origin */ /* XXX need to retile border on each window with ParentRelative origin */
#ifndef NXAGENT_SERVER
void void
ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh) ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
{ {
...@@ -1816,6 +1843,7 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh) ...@@ -1816,6 +1843,7 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
} }
} }
} }
#endif /* NXAGENT_SERVER */
#define GET_INT16(m, f) \ #define GET_INT16(m, f) \
if (m & mask) \ if (m & mask) \
...@@ -2164,6 +2192,7 @@ ReflectStackChange( ...@@ -2164,6 +2192,7 @@ ReflectStackChange(
* ConfigureWindow * ConfigureWindow
*****/ *****/
#ifndef NXAGENT_SERVER
int int
ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientPtr client) ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientPtr client)
{ {
...@@ -2417,6 +2446,7 @@ ActuallyDoSomething: ...@@ -2417,6 +2446,7 @@ ActuallyDoSomething:
#undef RESIZE_WIN #undef RESIZE_WIN
#undef REBORDER_WIN #undef REBORDER_WIN
} }
#endif /* NXAGENT_SERVER */
/****** /******
...@@ -2436,6 +2466,17 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) ...@@ -2436,6 +2466,17 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
xEvent event; xEvent event;
BoxRec box; BoxRec box;
/*
* #ifdef NXAGENT_SERVER
* if (nxagentOption(Rootless) && nxagentWMIsRunning &&
* nxagentWindowTopLevel(pWin) && pWin -> overrideRedirect == 0)
* {
* nxagentCirculateRootlessWindows(direction);
* return Success;
* }
* #endif
*/
pHead = RealChildHead(pParent); pHead = RealChildHead(pParent);
pFirst = pHead ? pHead->nextSib : pParent->firstChild; pFirst = pHead ? pHead->nextSib : pParent->firstChild;
if (direction == RaiseLowest) if (direction == RaiseLowest)
...@@ -2501,6 +2542,7 @@ CompareWIDs( ...@@ -2501,6 +2542,7 @@ CompareWIDs(
* ReparentWindow * ReparentWindow
*****/ *****/
#ifndef NXAGENT_SERVER
int int
ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
int x, int y, ClientPtr client) int x, int y, ClientPtr client)
...@@ -2593,6 +2635,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, ...@@ -2593,6 +2635,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
RecalculateDeliverableEvents(pWin); RecalculateDeliverableEvents(pWin);
return(Success); return(Success);
} }
#endif /* NXAGENT_SERVER */
static void static void
RealizeTree(WindowPtr pWin) RealizeTree(WindowPtr pWin)
...@@ -2635,6 +2678,7 @@ RealizeTree(WindowPtr pWin) ...@@ -2635,6 +2678,7 @@ RealizeTree(WindowPtr pWin)
* MapNotify event is generated. * MapNotify event is generated.
*****/ *****/
#ifndef NXAGENT_SERVER
int int
MapWindow(register WindowPtr pWin, ClientPtr client) MapWindow(register WindowPtr pWin, ClientPtr client)
{ {
...@@ -2737,7 +2781,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client) ...@@ -2737,7 +2781,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
return(Success); return(Success);
} }
#endif /* NXAGENT_SERVER */
/***** /*****
* MapSubwindows * MapSubwindows
...@@ -2926,6 +2970,7 @@ UnrealizeTree( ...@@ -2926,6 +2970,7 @@ UnrealizeTree(
* generated. Cannot unmap a root window. * generated. Cannot unmap a root window.
*****/ *****/
#ifndef NXAGENT_SERVER
int int
UnmapWindow(register WindowPtr pWin, Bool fromConfigure) UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
{ {
...@@ -2979,6 +3024,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure) ...@@ -2979,6 +3024,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
WindowsRestructured (); WindowsRestructured ();
return(Success); return(Success);
} }
#endif /* NXAGENT_SERVER */
/***** /*****
* UnmapSubwindows * UnmapSubwindows
...@@ -3251,6 +3297,7 @@ static void DrawLogo( ...@@ -3251,6 +3297,7 @@ static void DrawLogo(
); );
#endif #endif
#ifndef NXAGENT_SERVER
void void
SaveScreens(int on, int mode) SaveScreens(int on, int mode)
{ {
...@@ -3363,6 +3410,7 @@ SaveScreens(int on, int mode) ...@@ -3363,6 +3410,7 @@ SaveScreens(int on, int mode)
if (mode == ScreenSaverReset) if (mode == ScreenSaverReset)
SetScreenSaverTimer(); SetScreenSaverTimer();
} }
#endif /* NXAGENT_SERVER */
static Bool static Bool
TileScreenSaver(int i, int kind) TileScreenSaver(int i, int kind)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -32,6 +32,8 @@ is" without express or implied warranty. ...@@ -32,6 +32,8 @@ is" without express or implied warranty.
#ifndef __Screen_H__ #ifndef __Screen_H__
#define __Screen_H__ #define __Screen_H__
#include "scrnintstr.h"
#define MIN_NXAGENT_WIDTH 80 #define MIN_NXAGENT_WIDTH 80
#define MIN_NXAGENT_HEIGHT 60 #define MIN_NXAGENT_HEIGHT 60
#define NXAGENT_FRAME_WIDTH 2000 #define NXAGENT_FRAME_WIDTH 2000
......
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