The R Project SVN R

Rev

Rev 28786 | Rev 29066 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28786 Rev 28840
Line 23... Line 23...
23
#include <config.h>
23
#include <config.h>
24
#endif
24
#endif
25
 
25
 
26
#include <stdlib.h>
26
#include <stdlib.h>
27
 
27
 
28
#include "Defn.h"
-
 
29
#include "Print.h"
-
 
30
 
-
 
31
/* don't use X11 function prototypes (which tend to ...): */
28
/* don't use X11 function prototypes (which tend to ...): */
32
#define NeedFunctionPrototypes 0
29
#define NeedFunctionPrototypes 0
33
#include <X11/X.h>
30
#include <X11/X.h>
34
#include <X11/Xlib.h>
31
#include <X11/Xlib.h>
35
#include <X11/Xutil.h>
32
#include <X11/Xutil.h>
36
#include <X11/keysym.h>
33
#include <X11/keysym.h>
37
#include <X11/cursorfont.h>
34
#include <X11/cursorfont.h>
38
 
35
 
-
 
36
#include "Defn.h"
-
 
37
#include "Print.h"
-
 
38
 
-
 
39
 
-
 
40
/* <FIXME> this is wrong  as KeySym is defined nowadays */
39
#define KeySym int
41
#define KeySym int
-
 
42
/* </FIXME> */
40
#define DEEvent XEvent
43
#define DEEvent XEvent
41
 
44
 
42
typedef enum { UP, DOWN, LEFT, RIGHT } DE_DIRECTION;
45
typedef enum { UP, DOWN, LEFT, RIGHT } DE_DIRECTION;
43
 
46
 
44
typedef enum {UNKNOWNN, NUMERIC, CHARACTER} CellType;
47
typedef enum {UNKNOWNN, NUMERIC, CHARACTER} CellType;
Line 1264... Line 1267...
1264
static KeySym GetKey(DEEvent * event)
1267
static KeySym GetKey(DEEvent * event)
1265
{
1268
{
1266
    char text[1];
1269
    char text[1];
1267
    KeySym iokey;
1270
    KeySym iokey;
1268
 
1271
 
1269
    XLookupString(event, text, 1, &iokey, 0);
1272
    XLookupString((XKeyEvent *)event, text, 1, &iokey, 0);
1270
    return iokey;
1273
    return iokey;
1271
}
1274
}
1272
 
1275
 
1273
static char GetCharP(DEEvent * event)
1276
static char GetCharP(DEEvent * event)
1274
{
1277
{
1275
    char text[1];
1278
    char text[1];
1276
    KeySym iokey;
1279
    KeySym iokey;
1277
 
1280
 
1278
    XLookupString(event, text, 1, &iokey, 0);
1281
    XLookupString((XKeyEvent *)event, text, 1, &iokey, 0);
1279
    return text[0];
1282
    return text[0];
1280
}
1283
}
1281
 
1284
 
1282
static int CheckControl(DEEvent * event)
1285
static int CheckControl(DEEvent * event)
1283
{
1286
{
Line 1294... Line 1297...
1294
    int i;
1297
    int i;
1295
    char text[1];
1298
    char text[1];
1296
    KeySym iokey;
1299
    KeySym iokey;
1297
 
1300
 
1298
    (*event).xkey.state = 0;
1301
    (*event).xkey.state = 0;
1299
    XLookupString(event, text, 1, &iokey, 0);
1302
    XLookupString((XKeyEvent *)event, text, 1, &iokey, 0);
1300
    /* one row overlap when scrolling: top line <--> bottom line */
1303
    /* one row overlap when scrolling: top line <--> bottom line */
1301
    switch (text[0]) {
1304
    switch (text[0]) {
1302
	case 'b':
1305
	case 'b':
1303
	    i = rowmin - nhigh + 2;
1306
	    i = rowmin - nhigh + 2;
1304
	    jumpwin(colmin, max(1, i));
1307
	    jumpwin(colmin, max(1, i));
Line 1323... Line 1326...
1323
	drawwindow();
1326
	drawwindow();
1324
}
1327
}
1325
 
1328
 
1326
static void RefreshKeyboardMapping(DEEvent * event)
1329
static void RefreshKeyboardMapping(DEEvent * event)
1327
{
1330
{
1328
    XRefreshKeyboardMapping(event);
1331
    XRefreshKeyboardMapping((XMappingEvent *)event);
1329
}
1332
}
1330
 
1333
 
1331
/* Initialize/Close Windows */
1334
/* Initialize/Close Windows */
1332
 
1335
 
1333
void closewin(void)
1336
void closewin(void)
Line 1433... Line 1436...
1433
	ioblack,
1436
	ioblack,
1434
	iowhite)) == 0)
1437
	iowhite)) == 0)
1435
	return TRUE;
1438
	return TRUE;
1436
 
1439
 
1437
    XSetStandardProperties(iodisplay, iowindow, ioname, ioname, None,
1440
    XSetStandardProperties(iodisplay, iowindow, ioname, ioname, None,
1438
			   ioname, 0, &iohint);
1441
			   (char **)NULL, 0, &iohint);
1439
 
1442
 
1440
    winattr.backing_store = Always;
1443
    winattr.backing_store = Always;
1441
    XChangeWindowAttributes(iodisplay, iowindow, CWBackingStore, &winattr);
1444
    XChangeWindowAttributes(iodisplay, iowindow, CWBackingStore, &winattr);
1442
 
1445
 
1443
    /* set up protocols so that window manager sends */
1446
    /* set up protocols so that window manager sends */