ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtperl.xs
(Generate patch)

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.96 by root, Fri Feb 3 05:47:05 2006 UTC vs.
Revision 1.98 by root, Mon Feb 6 05:40:15 2006 UTC

762# include "optinc.h" 762# include "optinc.h"
763# undef nodef 763# undef nodef
764# undef def 764# undef def
765 765
766 HV *stash = gv_stashpv ("urxvt", 1); 766 HV *stash = gv_stashpv ("urxvt", 1);
767 struct { 767 static const struct {
768 const char *name; 768 const char *name;
769 IV iv; 769 IV iv;
770 } *civ, const_iv[] = { 770 } *civ, const_iv[] = {
771# define const_iv(name) { # name, (IV)name } 771# define const_iv(name) { # name, (IV)name }
772 const_iv (DEFAULT_RSTYLE), 772 const_iv (DEFAULT_RSTYLE),
923 RETVAL 923 RETVAL
924 924
925int 925int
926SET_FGCOLOR (int rend, int new_color) 926SET_FGCOLOR (int rend, int new_color)
927 CODE: 927 CODE:
928 RETVAL = SET_FGCOLOR (rend, new_color); 928 RETVAL = SET_FGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
929 OUTPUT: 929 OUTPUT:
930 RETVAL 930 RETVAL
931 931
932int 932int
933SET_BGCOLOR (int rend, int new_color) 933SET_BGCOLOR (int rend, int new_color)
934 CODE: 934 CODE:
935 RETVAL = SET_BGCOLOR (rend, new_color); 935 RETVAL = SET_BGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
936 OUTPUT: 936 OUTPUT:
937 RETVAL 937 RETVAL
938 938
939int 939int
940GET_CUSTOM (int rend) 940GET_CUSTOM (int rend)
1292 1292
1293void 1293void
1294rxvt_term::focus_out () 1294rxvt_term::focus_out ()
1295 1295
1296void 1296void
1297rxvt_term::key_press (unsigned int state, unsigned int keycode, Time time = CurrentTime)
1298 ALIAS:
1299 key_release = 1
1300 CODE:
1301{
1302 XKeyEvent xkey;
1303
1304 memset (&xkey, 0, sizeof (xkey));
1305
1306 xkey.time = time;
1307 xkey.state = state;
1308 xkey.keycode = keycode;
1309
1310 xkey.type = ix ? KeyRelease : KeyPress;
1311 xkey.display = THIS->dpy;
1312 xkey.window = THIS->vt;
1313 xkey.root = THIS->display->root;
1314 xkey.subwindow = THIS->vt;
1315
1316 if (ix)
1317 THIS->key_release (xkey);
1318 else
1319 THIS->key_press (xkey);
1320}
1321
1322void
1297rxvt_term::want_refresh () 1323rxvt_term::want_refresh ()
1298 CODE: 1324 CODE:
1299 THIS->want_refresh = 1; 1325 THIS->want_refresh = 1;
1300 1326
1301void 1327void
1492 1518
1493void 1519void
1494rxvt_term::_resource (char *name, int index, SV *newval = 0) 1520rxvt_term::_resource (char *name, int index, SV *newval = 0)
1495 PPCODE: 1521 PPCODE:
1496{ 1522{
1497 struct resval { const char *name; int value; } rslist [] = { 1523 static const struct resval { const char *name; int value; } *rs, rslist [] = {
1498# define def(name) { # name, Rs_ ## name }, 1524# define def(name) { # name, Rs_ ## name },
1499# define reserve(name,count) 1525# define reserve(name,count)
1500# include "rsinc.h" 1526# include "rsinc.h"
1501# undef def 1527# undef def
1502# undef reserve 1528# undef reserve
1503 }; 1529 };
1504 1530
1505 struct resval *rs = rslist + sizeof (rslist) / sizeof (rslist [0]); 1531 rs = rslist + sizeof (rslist) / sizeof (rslist [0]);
1506 1532
1507 do { 1533 do {
1508 if (rs-- == rslist) 1534 if (rs-- == rslist)
1509 croak ("no such resource '%s', requested", name); 1535 croak ("no such resource '%s', requested", name);
1510 } while (strcmp (name, rs->name)); 1536 } while (strcmp (name, rs->name));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines