summaryrefslogtreecommitdiff
path: root/workInProgress/lbx
diff options
context:
space:
mode:
authordawes <dawes>1995-06-27 04:30:58 +0000
committerdawes <dawes>1995-06-27 04:30:58 +0000
commit75f930de2d550f9a74e9ff55fbeb29cda3ae67ee (patch)
treeb5f41abb74d42d574f68b8c9491130325edd9bb4 /workInProgress/lbx
parenta359749eae859362b28c25908679abd256e70bf9 (diff)
updates
Diffstat (limited to 'workInProgress/lbx')
-rw-r--r--workInProgress/lbx/programs/lbxproxy/di/lbxdata.h100
-rw-r--r--workInProgress/lbx/programs/lbxproxy/di/stubs.c72
2 files changed, 127 insertions, 45 deletions
diff --git a/workInProgress/lbx/programs/lbxproxy/di/lbxdata.h b/workInProgress/lbx/programs/lbxproxy/di/lbxdata.h
index 1ed49fa84..7f1d94dd5 100644
--- a/workInProgress/lbx/programs/lbxproxy/di/lbxdata.h
+++ b/workInProgress/lbx/programs/lbxproxy/di/lbxdata.h
@@ -1,4 +1,4 @@
-/* $XConsortium: lbxdata.h,v 1.5 94/03/27 13:40:46 dpw Exp $ */
+/* $XConsortium: lbxdata.h,v 1.10 95/05/02 19:00:56 mor Exp $ */
/*
* Copyright 1994 Network Computing Devices, Inc.
*
@@ -20,22 +20,28 @@
* WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $NCDId: @(#)lbxdata.h,v 1.15 1994/03/24 17:55:08 lemke Exp $
+ * $NCDId: @(#)lbxdata.h,v 1.23 1994/11/29 22:14:02 lemke Exp $
+ *
+ * Author: Dave Lemke, Network Computing Devices
*/
#ifndef _LBXDATA_H_
#define _LBXDATA_H_
#include <X11/X.h> /* for X typedefs */
+#define NEED_REPLIES
+#include <X11/Xproto.h> /* for X typedefs */
#include "os.h"
#include "atomcache.h"
+#define _XLBX_SERVER_
+#include "lbxstr.h"
/* cache stuff */
#define MAX_ATOM_LENGTH 256 /* screw any large ones */
#define MAX_COLORNAME_LENGTH 256 /* screw any large ones */
/*
- * notes on request short-circuiting
+ * Notes on request short-circuiting
*
* X guarentees that any replies, events or errors generated by a
* previous request will be sent before those of a later request.
@@ -82,6 +88,36 @@
*
* this means we can't assume a single pending reply, but many.
* currently these get tacked onto a list.
+ *
+ *
+ * Notes on how the proxy attempts to solve all of this:
+ *
+ * There are 4 request that it will attempt to short-circuit:
+ * InternAtom, GetAtomName, LookupColor, AllocColor, and AllocNamedColor.
+ * All the code to do this is in lbxfuncs.c, and all of it works in
+ * essentially the same way -- whenever possible, it will try to respond
+ * to the client without sending the request all the way to the X server.
+ * The goal is to remove a roudn-trip entirely -- even though not a lot of data
+ * is involved, remving the roundtrip can make this useful.
+
+ * Unfortunately, figuring out *when* its safe is very nasty. First
+ * there are all the possibile stages outlined above. If the proxy
+ * isn't waiting, thinking there might be pending data, it can always
+ * short-circuit the request. However, this is the rare case. When
+ * the proxy can't immediately respond, it attempts to short-circuit anyways,
+ * delaying the reply until whatever it was waiting on arrives. Often
+ * it can't -- if the most paranoid type of checking is turned on, it'll
+ * never work. The complex part occurs with loose checking. If it knows
+ * a reply is coming back, it can delay the short-circuit until it gets
+ * the reply. This works fine for the core protocol, but breaks down
+ * again for extensions -- to be safe, any unknown extensions are assumed
+ * to have replies -- but since they may never arrive, the delayed
+ * short-circuit can never be flushed. To avoid this, whether a reply
+ * has been guessed at is tracked, and this info is used to decide
+ * whether a short-circuit can be delayed -- if not, it always needs
+ * to do the full round-trip.
+ *
+ * The complexity really makes me wonder if this stuff is worth the effort...
*/
@@ -149,6 +185,9 @@ typedef struct _querytag {
XID tag;
int tagtype;
union {
+ struct _query_font {
+ int compression;
+ } query_font;
struct _modmap {
int keyspermod;
} modmap;
@@ -163,10 +202,10 @@ typedef struct _querytag {
PropertyTagDataRec ptd;
} getprop;
struct _setup {
- int majorVersion;
- int minorVersion;
- pointer changes;
- } setup;
+ int majorVersion;
+ int minorVersion;
+ pointer changes;
+ } setup;
} typedata;
} QueryTagRec, *QueryTagPtr;
@@ -175,6 +214,7 @@ typedef struct _replystuff {
int request; /* request code */
int extension; /* extension opcode */
Bool lbx_req; /* is this an LBX request? */
+ Bool guessed; /* did we have to guess? */
union { /* reply data */
struct atom_data {
Atom atom;
@@ -211,12 +251,34 @@ typedef struct _replystuff {
struct changeprop {
PropertyTagDataRec ptd;
} lbxchangeprop;
+ struct queryextension {
+ char *name;
+ } lbxqueryextension;
+ struct getimage {
+#ifdef LBX_STATS
+ Drawable drawable;
+ INT16 x;
+ INT16 y;
+#endif
+ CARD16 width;
+ CARD16 height;
+ } lbxgetimage;
+ pointer lbxextensiondata;
} request_info;
struct _replystuff *next;
} ReplyStuffRec, *ReplyStuffPtr;
+typedef struct _replydata {
+ int dlen;
+ xReply reply;
+ pointer data;
+ int delay_seq_no; /* what seq i'm waiting for */
+ struct _replydata *next;
+} ReplyDataRec, *ReplyDataPtr;
+
typedef struct _lbxdata {
Bool cache_safe; /* safe to short circuit request? */
+ Bool can_delay_reply;/* safe to delay short-circuit request? */
int sequenceNumber; /* what we've seen */
int sequence_lost; /* requests short-circuited */
@@ -226,7 +288,16 @@ typedef struct _lbxdata {
KeyCode minKeyCode,
maxKeyCode;
+
+ CARD8 imageByteOrder; /* LSBFirst, MSBFirst */
+ CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/
+ CARD8 bitmapScanlineUnit, /* 8, 16, 32 */
+ bitmapScanlinePad; /* 8, 16, 32 */
+
ReplyStuffPtr replylist; /* list of pending replies */
+ ReplyDataPtr replydata; /* list of delayed short-circuited replies */
+ Drawable drawableCache[GFX_CACHE_SIZE];
+ GContext gcontextCache[GFX_CACHE_SIZE];
} LBXDataRec;
typedef struct _lbxdata *LBXDataPtr;
@@ -237,7 +308,12 @@ extern void FreeLBXStuff();
extern ReplyStuffPtr NewReply();
extern ReplyStuffPtr GetReply();
+extern ReplyStuffPtr GetMatchingReply();
+
+extern Bool FlushDelayedReply();
+extern Bool SaveDelayedReply();
extern int NumReplies();
+extern int NumGuessedReplies();
extern void RemoveReply();
extern void BumpSequence();
extern int QueryTag();
@@ -257,8 +333,6 @@ extern void ForceSequenceUpdate();
extern void LbxFreeTag();
extern void LbxSendTagData();
-#define LBX_STATS
-
#ifdef LBX_STATS
extern int intern_good,
intern_miss;
@@ -294,10 +368,18 @@ extern void ZeroStats();
#define LBXSequenceNumber(client) (((LBXDataPtr)((client)->screenPrivate[0]))->sequenceNumber)
#define LBXCacheSafe(client) (((LBXDataPtr)((client)->screenPrivate[0]))->cache_safe)
+#define LBXCanDelayReply(client) (((LBXDataPtr)((client)->screenPrivate[0]))->can_delay_reply)
#define LBXSequenceLost(client) (((LBXDataPtr)((client)->screenPrivate[0]))->sequence_lost)
#define LBXYanked(client) (((LBXDataPtr)((client)->screenPrivate[0]))->yanked)
#define LBXLastReply(client) (((LBXDataPtr)((client)->screenPrivate[0]))->lastReply)
#define LBXReplyList(client) (((LBXDataPtr)((client)->screenPrivate[0]))->replylist)
+#define LBXReplyData(client) (((LBXDataPtr)((client)->screenPrivate[0]))->replydata)
#define LBXMinKeyCode(client) (((LBXDataPtr)((client)->screenPrivate[0]))->minKeyCode)
#define LBXMaxKeyCode(client) (((LBXDataPtr)((client)->screenPrivate[0]))->maxKeyCode)
+#define LBXImageByteOrder(client) (((LBXDataPtr)((client)->screenPrivate[0]))->imageByteOrder)
+#define LBXBitmapBitOrder(client) (((LBXDataPtr)((client)->screenPrivate[0]))->bitmapBitOrder)
+#define LBXBitmapScanlineUnit(client) (((LBXDataPtr)((client)->screenPrivate[0]))->bitmapScanlineUnit)
+#define LBXBitmapScanlinePad(client) (((LBXDataPtr)((client)->screenPrivate[0]))->bitmapScanlinePad)
+#define LBXDrawableCache(client)(((LBXDataPtr)((client)->screenPrivate[0]))->drawableCache)
+#define LBXGContextCache(client)(((LBXDataPtr)((client)->screenPrivate[0]))->gcontextCache)
#endif /* _LBXDATA_H_ */
diff --git a/workInProgress/lbx/programs/lbxproxy/di/stubs.c b/workInProgress/lbx/programs/lbxproxy/di/stubs.c
index d3303446d..edffb69a9 100644
--- a/workInProgress/lbx/programs/lbxproxy/di/stubs.c
+++ b/workInProgress/lbx/programs/lbxproxy/di/stubs.c
@@ -1,7 +1,7 @@
-/* $XConsortium: stubs.c,v 1.5 94/03/27 13:53:51 dpw Exp $ */
+/* $XConsortium: stubs.c,v 1.7 95/04/04 21:08:31 dpw Exp $ */
/*
* $NCDOr: stubs.c,v 1.1 1993/11/16 17:58:49 keithp Exp keithp $
- * $NCDId: @(#)stubs.c,v 1.11 1994/03/24 17:54:41 lemke Exp $
+ * $NCDId: @(#)stubs.c,v 1.16 1994/11/18 20:35:22 lemke Exp $
*
* Copyright 1992 Network Computing Devices
*
@@ -33,22 +33,16 @@
#include "keysymdef.h"
-AbortDDX ()
-{
-}
-
-OsInitColors ()
-{
-}
-
extern int lbxDebug;
-extern int lbxLZW;
-extern int lbxDeltaN;
extern int lbxTagCacheSize;
extern Bool lbxUseTags;
extern Bool lbxUseLbx;
+extern Bool lbxDoSquishing;
+extern Bool lbxCompressImages;
+extern Bool lbxDoShortCircuiting;
+extern Bool lbxDoLbxGfx;
-ddxProcessArgument (argc, argv, i)
+proxyProcessArgument (argc, argv, i)
char **argv;
{
if (strcmp (argv[i], "-debug") == 0)
@@ -59,14 +53,29 @@ ddxProcessArgument (argc, argv, i)
UseMsg ();
return 2;
}
+ if (strcmp (argv[i], "-nogfx") == 0)
+ {
+ lbxDoLbxGfx = 0;
+ return 1;
+ }
+ if (strcmp (argv[i], "-nosc") == 0)
+ {
+ lbxDoShortCircuiting = 0;
+ return 1;
+ }
if (strcmp (argv[i], "-nolzw") == 0)
{
- lbxLZW = 0;
+ LbxNoComp();
+ return 1;
+ }
+ if (strcmp (argv[i], "-nocomp") == 0)
+ {
+ LbxNoComp();
return 1;
}
if (strcmp (argv[i], "-nodelta") == 0)
{
- lbxDeltaN = 0;
+ LbxNoDelta();
return 1;
}
if (strcmp (argv[i], "-notags") == 0)
@@ -79,6 +88,16 @@ ddxProcessArgument (argc, argv, i)
lbxUseLbx = 0;
return 1;
}
+ if (strcmp (argv[i], "-noimage") == 0)
+ {
+ lbxCompressImages = 0;
+ return 1;
+ }
+ if (strcmp (argv[i], "-nosquish") == 0)
+ {
+ LbxNoSquish();
+ return 1;
+ }
if (strcmp (argv[i], "-tagcachesize") == 0)
{
if (++i < argc)
@@ -90,30 +109,12 @@ ddxProcessArgument (argc, argv, i)
return 0;
}
+#ifndef MEMBUG
CheckMemory ()
{
}
+#endif
-void
-CopyISOLatin1Lowered(dest, source, length)
- register unsigned char *dest, *source;
- int length;
-{
- register int i;
-
- for (i = 0; i < length; i++, source++, dest++)
- {
- if ((*source >= XK_A) && (*source <= XK_Z))
- *dest = *source + (XK_a - XK_A);
- else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis))
- *dest = *source + (XK_agrave - XK_Agrave);
- else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn))
- *dest = *source + (XK_oslash - XK_Ooblique);
- else
- *dest = *source;
- }
- *dest = '\0';
-}
typedef struct _BlockHandler {
void (*BlockHandler)();
@@ -428,4 +429,3 @@ CallCallbacks(pcbl, call_data)
pointer call_data;
{
}
-