1 | /*--------------------------------*-C-*--------------------------------------* |
1 | /*--------------------------------*-C-*--------------------------------------* |
2 | * File: screen.c |
2 | * File: screen.c |
3 | *---------------------------------------------------------------------------* |
3 | *---------------------------------------------------------------------------* |
4 | * $Id: screen.C,v 1.4 2003/11/25 15:25:17 pcg Exp $ |
4 | * $Id: screen.C,v 1.5 2003/11/27 16:49:45 pcg Exp $ |
5 | * |
5 | * |
6 | * Copyright (c) 1997-2001 Geoff Wing <gcw@pobox.com> |
6 | * Copyright (c) 1997-2001 Geoff Wing <gcw@pobox.com> |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
… | |
… | |
363 | R->tabs[p] = (p % TABSIZE == 0) ? 1 : 0; |
363 | R->tabs[p] = (p % TABSIZE == 0) ? 1 : 0; |
364 | |
364 | |
365 | R->prev_nrow = nrow; |
365 | R->prev_nrow = nrow; |
366 | R->prev_ncol = ncol; |
366 | R->prev_ncol = ncol; |
367 | |
367 | |
368 | rxvt_tt_winsize(R->cmd_fd, R->TermWin.ncol, R->TermWin.nrow, R->cmd_pid); |
368 | rxvt_tt_winsize (R->cmd_fd, R->TermWin.ncol, R->TermWin.nrow, R->cmd_pid); |
369 | } |
369 | } |
370 | |
370 | |
371 | /* INTPROTO */ |
371 | /* INTPROTO */ |
372 | void |
372 | void |
373 | rxvt_scr_reset_realloc(pR) |
373 | rxvt_scr_reset_realloc(pR) |
… | |
… | |
1548 | */ |
1548 | */ |
1549 | /* EXTPROTO */ |
1549 | /* EXTPROTO */ |
1550 | void |
1550 | void |
1551 | rxvt_scr_report_position(pR) |
1551 | rxvt_scr_report_position(pR) |
1552 | { |
1552 | { |
1553 | rxvt_tt_printf(aR_ "\033[%d;%dR", R->screen.cur.row + 1, |
1553 | R->tt_printf("\033[%d;%dR", R->screen.cur.row + 1, R->screen.cur.col + 1); |
1554 | R->screen.cur.col + 1); |
|
|
1555 | } |
1554 | } |
1556 | |
1555 | |
1557 | /* ------------------------------------------------------------------------- * |
1556 | /* ------------------------------------------------------------------------- * |
1558 | * FONTS * |
1557 | * FONTS * |
1559 | * ------------------------------------------------------------------------- */ |
1558 | * ------------------------------------------------------------------------- */ |
… | |
… | |
2417 | /* |
2416 | /* |
2418 | * Paste a selection direct to the command fd |
2417 | * Paste a selection direct to the command fd |
2419 | */ |
2418 | */ |
2420 | /* INTPROTO */ |
2419 | /* INTPROTO */ |
2421 | void |
2420 | void |
2422 | rxvt_PasteIt(pR_ const unsigned char *data, unsigned int nitems) |
2421 | rxvt_PasteIt (pR_ const unsigned char *data, unsigned int nitems) |
2423 | { |
2422 | { |
2424 | unsigned int i, j, n; |
2423 | unsigned int i, j, n; |
2425 | unsigned char *ds = (unsigned char *)rxvt_malloc(PROP_SIZE); |
2424 | unsigned char *ds = (unsigned char *)rxvt_malloc (PROP_SIZE); |
2426 | |
2425 | |
2427 | /* convert normal newline chars into common keyboard Return key sequence */ |
2426 | /* convert normal newline chars into common keyboard Return key sequence */ |
2428 | for (i = 0; i < nitems; i += PROP_SIZE) { |
2427 | for (i = 0; i < nitems; i += PROP_SIZE) |
|
|
2428 | { |
2429 | n = min(nitems - i, PROP_SIZE); |
2429 | n = min (nitems - i, PROP_SIZE); |
2430 | MEMCPY(ds, data + i, n); |
2430 | MEMCPY (ds, data + i, n); |
2431 | for (j = 0; j < n; j++) |
2431 | for (j = 0; j < n; j++) |
2432 | if (ds[j] == '\n') |
2432 | if (ds[j] == '\n') |
2433 | ds[j] = '\r'; |
2433 | ds[j] = '\r'; |
2434 | rxvt_tt_write(aR_ ds, (int)n); |
2434 | R->tt_write (ds, (int)n); |
2435 | } |
2435 | } |
|
|
2436 | |
2436 | free(ds); |
2437 | free(ds); |
2437 | } |
2438 | } |
2438 | |
2439 | |
2439 | /* ------------------------------------------------------------------------- */ |
2440 | /* ------------------------------------------------------------------------- */ |
2440 | /* |
2441 | /* |
2441 | * Respond to a notification that a primary selection has been sent |
2442 | * Respond to a notification that a primary selection has been sent |