1 | /* |
1 | /* |
2 | * $Id: rxvt.h,v 1.17 2003/12/18 07:31:19 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 | |
… | |
… | |
662 | #define STRLEN(x) strlen((const char *)(x)) |
662 | #define STRLEN(x) strlen((const char *)(x)) |
663 | #define STRCHR(x, y) strchr((const char *)(x), (int)(y)) |
663 | #define STRCHR(x, y) strchr((const char *)(x), (int)(y)) |
664 | #define STRRCHR(x, y) strrchr((const char *)(x), (int)(y)) |
664 | #define STRRCHR(x, y) strrchr((const char *)(x), (int)(y)) |
665 | |
665 | |
666 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
666 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
667 | #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) |
668 | #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) |
669 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)R->TermWin.fwidth) |
669 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)TermWin.fwidth) |
670 | #define Pixel2Height(y) ((int32_t)(y) / (int32_t)R->TermWin.fheight) |
670 | #define Pixel2Height(y) ((int32_t)(y) / (int32_t)TermWin.fheight) |
671 | #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) |
672 | #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) |
673 | #define Width2Pixel(n) ((int32_t)(n) * (int32_t)R->TermWin.fwidth) |
673 | #define Width2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fwidth) |
674 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)R->TermWin.fheight) |
674 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) |
675 | |
675 | |
676 | #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) |
677 | #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) |
678 | |
678 | |
679 | #define Xscreen DefaultScreen(R->Xdisplay) |
679 | #define Xscreen DefaultScreen(R->Xdisplay) |
680 | #define Xroot DefaultRootWindow(R->Xdisplay) |
680 | #define Xroot DefaultRootWindow(R->Xdisplay) |
681 | |
681 | |
682 | /* how to build & extract colors and attributes */ |
682 | /* how to build & extract colors and attributes */ |
… | |
… | |
714 | |
714 | |
715 | #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))) |
716 | #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))) |
717 | |
717 | |
718 | #ifdef HAVE_SCROLLBARS |
718 | #ifdef HAVE_SCROLLBARS |
719 | # define scrollbar_TotalWidth() (R->scrollBar.width + R->sb_shadow * 2) |
719 | # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) |
720 | #else |
720 | #else |
721 | # define scrollbar_TotalWidth() (0) |
721 | # define scrollbar_TotalWidth() (0) |
722 | #endif |
722 | #endif |
723 | #define scrollbar_isMotion() (R->scrollBar.state == 'm') |
723 | #define scrollbar_isMotion() (R->scrollBar.state == 'm') |
724 | #define scrollbar_isUp() (R->scrollBar.state == 'U') |
724 | #define scrollbar_isUp() (R->scrollBar.state == 'U') |
… | |
… | |
745 | #define scrollbar_size() (R->scrollBar.end - R->scrollBar.beg \ |
745 | #define scrollbar_size() (R->scrollBar.end - R->scrollBar.beg \ |
746 | - scrollbar_minheight()) |
746 | - scrollbar_minheight()) |
747 | |
747 | |
748 | #if (MENUBAR_MAX > 1) |
748 | #if (MENUBAR_MAX > 1) |
749 | /* rendition style flags */ |
749 | /* rendition style flags */ |
750 | # define menuBar_height() (R->TermWin.fheight + SHADOW) |
750 | # define menuBar_height() (TermWin.fheight + SHADOW) |
751 | # define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin) |
751 | # define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin) |
752 | # define isMenuBarWindow(w) ((w) == R->menuBar.win) |
752 | # define isMenuBarWindow(w) ((w) == R->menuBar.win) |
753 | #else |
753 | #else |
754 | # define menuBar_height() (0) |
754 | # define menuBar_height() (0) |
755 | # define menuBar_TotalHeight() (0) |
755 | # define menuBar_TotalHeight() (0) |
… | |
… | |
885 | #ifdef GREEK_SUPPORT |
885 | #ifdef GREEK_SUPPORT |
886 | short greek_mode; /* greek keyboard mode */ |
886 | short greek_mode; /* greek keyboard mode */ |
887 | #endif |
887 | #endif |
888 | short rvideo; |
888 | short rvideo; |
889 | int16_t num_scr; /* screen: number lines scrolled */ |
889 | int16_t num_scr; /* screen: number lines scrolled */ |
890 | uint16_t prev_ncol, /* screen: previous number of columns */ |
890 | unsigned int prev_ncol, /* screen: previous number of columns */ |
891 | prev_nrow; /* screen: previous number of rows */ |
891 | prev_nrow; /* screen: previous number of rows */ |
892 | #ifdef RXVT_GRAPHICS |
892 | #ifdef RXVT_GRAPHICS |
893 | uint16_t gr_prev_start; |
893 | uint16_t gr_prev_start; |
894 | #endif |
894 | #endif |
895 | /* ---------- */ |
895 | /* ---------- */ |
… | |
… | |
1079 | #endif |
1079 | #endif |
1080 | const char *rs[NUM_RESOURCES]; |
1080 | const char *rs[NUM_RESOURCES]; |
1081 | /* command input buffering */ |
1081 | /* command input buffering */ |
1082 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1082 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1083 | unsigned char cmdbuf_base[BUFSIZ]; |
1083 | unsigned char cmdbuf_base[BUFSIZ]; |
1084 | unsigned char kbuf[KBUFSZ]; |
|
|
1085 | |
1084 | |
1086 | rxvt_salloc *ralloc; |
1085 | rxvt_salloc *ralloc; |
1087 | rxvt_salloc *talloc; |
1086 | rxvt_salloc *talloc; |
1088 | |
1087 | |
1089 | void paste (const unsigned char *data, unsigned int len); |
1088 | void paste (const unsigned char *data, unsigned int len); |
… | |
… | |
1137 | int run_command (const char *const *argv); |
1136 | int run_command (const char *const *argv); |
1138 | int run_child (const char *const *argv); |
1137 | int run_child (const char *const *argv); |
1139 | |
1138 | |
1140 | void color_aliases(int idx); |
1139 | void color_aliases(int idx); |
1141 | void recolour_cursor (); |
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); |
1142 | |
1159 | |
1143 | /* screen(!) */ |
1160 | /* screen(!) */ |
1144 | 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); |
1145 | 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); |
1146 | 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); |
1147 | void scr_reset (); |
1164 | void scr_reset (); |
1148 | void scr_reset_realloc (); |
1165 | void scr_reset_realloc (); |
1149 | 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); |
1150 | }; |
1172 | }; |
1151 | |
1173 | |
1152 | #define SET_LOCALE(locale) rxvt_set_locale (locale) |
1174 | #define SET_LOCALE(locale) rxvt_set_locale (locale) |
1153 | extern void rxvt_set_locale (const char *locale); |
1175 | extern void rxvt_set_locale (const char *locale); |
1154 | |
1176 | |