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

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.13 by pcg, Thu Dec 18 00:29:29 2003 UTC vs.
Revision 1.20 by pcg, Wed Dec 24 09:22:29 2003 UTC

1/* 1/*
2 * $Id: rxvt.h,v 1.13 2003/12/18 00:29:29 pcg Exp $ 2 * $Id: rxvt.h,v 1.20 2003/12/24 09:22:29 pcg Exp $
3 */ 3 */
4 4
5#ifndef _RXVT_H_ /* include once only */ 5#ifndef _RXVT_H_ /* include once only */
6#define _RXVT_H_ 6#define _RXVT_H_
7 7
16 16
17#include "defaultfont.h" 17#include "defaultfont.h"
18#include "rxvtcolor.h" 18#include "rxvtcolor.h"
19#include "iom.h" 19#include "iom.h"
20#include "salloc.h" 20#include "salloc.h"
21
22#include <wchar.h>
21 23
22/* 24/*
23 ***************************************************************************** 25 *****************************************************************************
24 * SYSTEM HACKS 26 * SYSTEM HACKS
25 ***************************************************************************** 27 *****************************************************************************
481 Rs_backgroundPixmap, 483 Rs_backgroundPixmap,
482#endif 484#endif
483#if (MENUBAR_MAX) 485#if (MENUBAR_MAX)
484 Rs_menu, 486 Rs_menu,
485#endif 487#endif
486#ifndef NO_BOLDFONT
487 Rs_boldFont,
488#endif
489#ifdef GREEK_SUPPORT 488#ifdef GREEK_SUPPORT
490 Rs_greek_keyboard, 489 Rs_greek_keyboard,
491 Rs_greektoggle_key, 490 Rs_greektoggle_key,
492#endif 491#endif
493 Rs_loginShell, 492 Rs_loginShell,
663#define STRLEN(x) strlen((const char *)(x)) 662#define STRLEN(x) strlen((const char *)(x))
664#define STRCHR(x, y) strchr((const char *)(x), (int)(y)) 663#define STRCHR(x, y) strchr((const char *)(x), (int)(y))
665#define STRRCHR(x, y) strrchr((const char *)(x), (int)(y)) 664#define STRRCHR(x, y) strrchr((const char *)(x), (int)(y))
666 665
667/* convert pixel dimensions to row/column values. Everything as int32_t */ 666/* convert pixel dimensions to row/column values. Everything as int32_t */
668#define Pixel2Col(x) Pixel2Width((int32_t)(x) - (int32_t)R->TermWin.int_bwidth) 667#define Pixel2Col(x) Pixel2Width((int32_t)(x) - (int32_t)TermWin.int_bwidth)
669#define Pixel2Row(y) Pixel2Height((int32_t)(y) - (int32_t)R->TermWin.int_bwidth) 668#define Pixel2Row(y) Pixel2Height((int32_t)(y) - (int32_t)TermWin.int_bwidth)
670#define Pixel2Width(x) ((int32_t)(x) / (int32_t)R->TermWin.fwidth) 669#define Pixel2Width(x) ((int32_t)(x) / (int32_t)TermWin.fwidth)
671#define Pixel2Height(y) ((int32_t)(y) / (int32_t)R->TermWin.fheight) 670#define Pixel2Height(y) ((int32_t)(y) / (int32_t)TermWin.fheight)
672#define Col2Pixel(col) ((int32_t)Width2Pixel(col) + (int32_t)R->TermWin.int_bwidth) 671#define Col2Pixel(col) ((int32_t)Width2Pixel(col) + (int32_t)TermWin.int_bwidth)
673#define Row2Pixel(row) ((int32_t)Height2Pixel(row) + (int32_t)R->TermWin.int_bwidth) 672#define Row2Pixel(row) ((int32_t)Height2Pixel(row) + (int32_t)TermWin.int_bwidth)
674#define Width2Pixel(n) ((int32_t)(n) * (int32_t)R->TermWin.fwidth) 673#define Width2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fwidth)
675#define Height2Pixel(n) ((int32_t)(n) * (int32_t)R->TermWin.fheight) 674#define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight)
676 675
677#define TermWin_TotalWidth() ((int32_t)R->TermWin.width + 2 * (int32_t)R->TermWin.int_bwidth) 676#define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth)
678#define TermWin_TotalHeight() ((int32_t)R->TermWin.height + 2 * (int32_t)R->TermWin.int_bwidth) 677#define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth)
679 678
680#define Xscreen DefaultScreen(R->Xdisplay) 679#define Xscreen DefaultScreen(R->Xdisplay)
681#define Xroot DefaultRootWindow(R->Xdisplay) 680#define Xroot DefaultRootWindow(R->Xdisplay)
682 681
683/* how to build & extract colors and attributes */ 682/* how to build & extract colors and attributes */
715 714
716#define SET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) 715#define SET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS)))
717#define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) 716#define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS)))
718 717
719#ifdef HAVE_SCROLLBARS 718#ifdef HAVE_SCROLLBARS
720# define scrollbar_TotalWidth() (R->scrollBar.width + R->sb_shadow * 2) 719# define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2)
721#else 720#else
722# define scrollbar_TotalWidth() (0) 721# define scrollbar_TotalWidth() (0)
723#endif 722#endif
724#define scrollbar_isMotion() (R->scrollBar.state == 'm') 723#define scrollbar_isMotion() (R->scrollBar.state == 'm')
725#define scrollbar_isUp() (R->scrollBar.state == 'U') 724#define scrollbar_isUp() (R->scrollBar.state == 'U')
726#define scrollbar_isDn() (R->scrollBar.state == 'D') 725#define scrollbar_isDn() (R->scrollBar.state == 'D')
727#define scrollbar_isUpDn() isupper (R->scrollBar.state) 726#define scrollbar_isUpDn() isupper (R->scrollBar.state)
728#define isScrollbarWindow(w) (R->scrollBar.state && (w) == R->scrollBar.win) 727#define isScrollbarWindow(w) (R->scrollBar.state && (w) == R->scrollBar.win)
729
730#define scrollbar_setIdle() R->scrollBar.state = 1
731#define scrollbar_setMotion() R->scrollBar.state = 'm'
732#define scrollbar_setUp() R->scrollBar.state = 'U'
733#define scrollbar_setDn() R->scrollBar.state = 'D'
734 728
735#define scrollbarnext_dnval() (R->scrollBar.end + (R->scrollBar.width + 1)) 729#define scrollbarnext_dnval() (R->scrollBar.end + (R->scrollBar.width + 1))
736#define scrollbarnext_upButton(y) ((y) > R->scrollBar.end \ 730#define scrollbarnext_upButton(y) ((y) > R->scrollBar.end \
737 && (y) <= scrollbarnext_dnval()) 731 && (y) <= scrollbarnext_dnval())
738#define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) 732#define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval())
751#define scrollbar_size() (R->scrollBar.end - R->scrollBar.beg \ 745#define scrollbar_size() (R->scrollBar.end - R->scrollBar.beg \
752 - scrollbar_minheight()) 746 - scrollbar_minheight())
753 747
754#if (MENUBAR_MAX > 1) 748#if (MENUBAR_MAX > 1)
755/* rendition style flags */ 749/* rendition style flags */
756# define menuBar_height() (R->TermWin.fheight + SHADOW) 750# define menuBar_height() (TermWin.fheight + SHADOW)
757# define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin) 751# define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin)
758# define isMenuBarWindow(w) ((w) == R->menuBar.win) 752# define isMenuBarWindow(w) ((w) == R->menuBar.win)
759#else 753#else
760# define menuBar_height() (0) 754# define menuBar_height() (0)
761# define menuBar_TotalHeight() (0) 755# define menuBar_TotalHeight() (0)
770 764
771#ifndef STRICT_FONT_CHECKING 765#ifndef STRICT_FONT_CHECKING
772# define rxvt_get_fontwidest(font) ((font)->max_bounds.width) 766# define rxvt_get_fontwidest(font) ((font)->max_bounds.width)
773#endif 767#endif
774 768
775#define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (r, 'P',(x),(y)) 769#define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (R, 'P',(x),(y))
776#define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (r, 'R',(x),(y)) 770#define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (R, 'R',(x),(y))
777 771
778#ifdef UTMP_SUPPORT 772#ifdef UTMP_SUPPORT
779# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) 773# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
780# undef HAVE_UTMPX_H 774# undef HAVE_UTMPX_H
781# undef HAVE_STRUCT_UTMPX 775# undef HAVE_STRUCT_UTMPX
839#endif 833#endif
840 834
841#define BLINK_INTERVAL 0.5 835#define BLINK_INTERVAL 0.5
842 836
843struct mbstate { 837struct mbstate {
844 unsigned char orig; 838 mbstate_t mbs;
845 uint32_t reg;
846 int cnt;
847 839
848 mbstate () 840 mbstate ()
849 { 841 {
850 cnt = 0; 842 MEMSET (&mbs, 0, sizeof (mbs));
851 } 843 }
852}; 844};
853 845
854struct rxvt_term : rxvt_vars { 846struct rxvt_term : rxvt_vars {
855 struct mbstate mbstate; 847 struct mbstate mbstate;
871#endif 863#endif
872#ifdef POINTER_BLANK 864#ifdef POINTER_BLANK
873 hidden_pointer:1, 865 hidden_pointer:1,
874#endif 866#endif
875 parsed_geometry:1, 867 parsed_geometry:1,
876 seen_input:1; /* wether any input has been seen so far */ 868 seen_input:1, /* wether any input has been seen so far */
869 enc_utf8:1; /* wether terminal reads/writes utf-8 */
877 870
878 unsigned char refresh_type, 871 unsigned char refresh_type,
879#ifdef UTMP_SUPPORT 872#ifdef UTMP_SUPPORT
880 next_utmp_action, 873 next_utmp_action,
881#endif 874#endif
892#ifdef GREEK_SUPPORT 885#ifdef GREEK_SUPPORT
893 short greek_mode; /* greek keyboard mode */ 886 short greek_mode; /* greek keyboard mode */
894#endif 887#endif
895 short rvideo; 888 short rvideo;
896 int16_t num_scr; /* screen: number lines scrolled */ 889 int16_t num_scr; /* screen: number lines scrolled */
897 uint16_t prev_ncol, /* screen: previous number of columns */ 890 unsigned int prev_ncol, /* screen: previous number of columns */
898 prev_nrow; /* screen: previous number of rows */ 891 prev_nrow; /* screen: previous number of rows */
899#ifdef RXVT_GRAPHICS 892#ifdef RXVT_GRAPHICS
900 uint16_t gr_prev_start; 893 uint16_t gr_prev_start;
901#endif 894#endif
902/* ---------- */ 895/* ---------- */
903 rend_t rstyle; 896 rend_t rstyle;
904/* ---------- */ 897/* ---------- */
905 uint32_t pixcolor_set[NPIXCLR_SETS]; 898 uint32_t pixcolor_set[NPIXCLR_SETS];
906/* ---------- */ 899/* ---------- */
907#ifdef SELECTION_SCROLLING 900#ifdef SELECTION_SCROLLING
908 int scroll_selection_delay, 901 int scroll_selection_delay,
909 scroll_selection_lines; 902 scroll_selection_lines;
910 enum page_dirn scroll_selection_dir; 903 enum page_dirn scroll_selection_dir;
1074 char *env_display; /* environmental variable DISPLAY */ 1067 char *env_display; /* environmental variable DISPLAY */
1075 char *env_term; /* environmental variable TERM */ 1068 char *env_term; /* environmental variable TERM */
1076 char *env_colorfgbg; 1069 char *env_colorfgbg;
1077 char *buffer; 1070 char *buffer;
1078 char *locale; 1071 char *locale;
1072 char *codeset;
1079 char charsets[4]; 1073 char charsets[4];
1080 unsigned char *v_buffer; /* pointer to physical buffer */ 1074 unsigned char *v_buffer; /* pointer to physical buffer */
1081 unsigned int v_buflen; /* size of area to write */ 1075 unsigned int v_buflen; /* size of area to write */
1082 char *newfont[MAX_NFONTS]; 1076 char *newfont[MAX_NFONTS];
1083#ifdef KEYSYM_RESOURCE 1077#ifdef KEYSYM_RESOURCE
1085#endif 1079#endif
1086 const char *rs[NUM_RESOURCES]; 1080 const char *rs[NUM_RESOURCES];
1087/* command input buffering */ 1081/* command input buffering */
1088 unsigned char *cmdbuf_ptr, *cmdbuf_endp; 1082 unsigned char *cmdbuf_ptr, *cmdbuf_endp;
1089 unsigned char cmdbuf_base[BUFSIZ]; 1083 unsigned char cmdbuf_base[BUFSIZ];
1090 unsigned char kbuf[KBUFSZ];
1091 1084
1092 rxvt_salloc *ralloc; 1085 rxvt_salloc *ralloc;
1093 rxvt_salloc *talloc; 1086 rxvt_salloc *talloc;
1094 1087
1095 void paste (const unsigned char *data, unsigned int len); 1088 void paste (const unsigned char *data, unsigned int len);
1131 bool pty_fill (); 1124 bool pty_fill ();
1132 void process_x_events (); 1125 void process_x_events ();
1133 1126
1134 void *operator new (size_t s); 1127 void *operator new (size_t s);
1135 void operator delete (void *p, size_t s); 1128 void operator delete (void *p, size_t s);
1129
1130 void init_secondary ();
1131 const char **init_resources (int argc, const char *const *argv);
1132 void init_env ();
1133 void set_locale (const char *locale);
1134 void init_xlocale ();
1135 void init_command (const char *const *argv);
1136 int run_command (const char *const *argv);
1137 int run_child (const char *const *argv);
1138
1139 void color_aliases(int idx);
1140 void recolour_cursor ();
1141 void create_windows (int argc, const char *const *argv);
1142 void resize_all_windows (unsigned int width, unsigned int height, int ignoreparent);
1143 void window_calc (unsigned int width, unsigned int height);
1144 void set_preedit_area (XRectangle * preedit_rect, XRectangle * status_rect, XRectangle * needed_rect);
1145
1146#if USE_XIM
1147 void set_size (XRectangle *size);
1148 void set_position (XPoint *pos);
1149 void set_color (unsigned long *fg, unsigned long *bg);
1150#endif
1151
1152 void resize_scrollbar ();
1153
1154 void pixel_position (int *x, int *y);
1155
1156 void selection_click (int clicks, int x, int y);
1157 void selection_extend (int x, int y, int flag);
1158 void selection_rotate (int x, int y);
1136 1159
1137 /* screen(!) */ 1160 /* screen(!) */
1138 void scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs); 1161 void scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs);
1139 void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs); 1162 void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs);
1140 int scr_scroll_text (int row1, int row2, int count, int spec); 1163 int scr_scroll_text (int row1, int row2, int count, int spec);
1141 void scr_reset (); 1164 void scr_reset ();
1142 void scr_reset_realloc (); 1165 void scr_reset_realloc ();
1143 void scr_release (); 1166 void scr_release ();
1167 void scr_clear ();
1168 void scr_refresh (unsigned char refresh_type);
1169 void scr_erase_screen (int mode);
1170 void scr_touch (bool refresh);
1171 void scr_expose (int x, int y, int width, int height, bool refresh);
1144}; 1172};
1173
1174#define SET_LOCALE(locale) rxvt_set_locale (locale)
1175extern void rxvt_set_locale (const char *locale);
1145 1176
1146#ifndef __attribute__ 1177#ifndef __attribute__
1147# ifdef __GNUC__ 1178# ifdef __GNUC__
1148# if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) 1179# if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2)
1149# define __attribute__(x) 1180# define __attribute__(x)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines