changeset: 51:95f09e8f2334
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Fri Mar 02 15:41:43 2007 +0100
summary: reorganized st.h somewhat
diff -r f17403bd2acc -r 95f09e8f2334 main.c
--- a/main.c Fri Mar 02 15:25:38 2007 +0100
+++ b/main.c Fri Mar 02 15:41:43 2007 +0100
@@ -153,6 +153,18 @@ int screen;
int screen;
int ww;
int wh;
+int screen_rows = -1;
+int screen_cols = -1;
+int scroll_region_start = 1;
+int scroll_region_end = DEFAULT_NR_ROWS;
+int scroll_in_region = 0;
+int screen_rows;
+int screen_cols;
+int curr_row = 1;
+int curr_col = 1;
+text_letter_t text_attrs;
+text_row_t *text_screen;
+text_row_t *saved_screen;
int
main(int argc, char **argv) {
@@ -168,8 +180,10 @@ main(int argc, char **argv) {
initcolors();
initfont(DEFAULT_FONT);
initwin();
- if(init_vt_buffer())
- return 1;
+ text_screen = buffer_create(screen_rows, screen_cols);
+ curr_col = curr_row = 1;
+ scroll_region_start = 1;
+ scroll_region_end = screen_rows;
set_buffer_fg_color(7);
set_buffer_bg_color(0);
diff -r f17403bd2acc -r 95f09e8f2334 screen.c
--- a/screen.c Fri Mar 02 15:25:38 2007 +0100
+++ b/screen.c Fri Mar 02 15:41:43 2007 +0100
@@ -11,21 +11,6 @@
/* Maximum (numerical) parameters to an escape sequence */
#define NPAR 16
-
-/* Dimensions of the visible screen in characters */
-int screen_rows = -1;
-int screen_cols = -1;
-/* Start and end rows of the scrolling region */
-int scroll_region_start = 1;
-int scroll_region_end = DEFAULT_NR_ROWS;
-int scroll_in_region = 0;
-text_row_t *text_screen;
-text_row_t *saved_screen;
-int screen_rows;
-int screen_cols;
-text_letter_t text_attrs;
-int curr_row = 1;
-int curr_col = 1;
text_row_t *
buffer_create(int rows, int cols) {
@@ -137,16 +122,6 @@ add_rows(text_row_t *screen, int pos, in
screen[pos + i - 1].line[j] = text_attrs;
screen[pos + i - 1].needs_update = 1;
}
-}
-
-
-int
-init_vt_buffer(void) {
- text_screen = buffer_create(screen_rows, screen_cols);
- curr_col = curr_row = 1;
- scroll_region_start = 1;
- scroll_region_end = screen_rows;
- return 0;
}
void
diff -r f17403bd2acc -r 95f09e8f2334 st.h
--- a/st.h Fri Mar 02 15:25:38 2007 +0100
+++ b/st.h Fri Mar 02 15:41:43 2007 +0100
@@ -48,19 +48,6 @@ typedef struct text_row_t {
int needs_update;
} text_row_t;
-extern int saved_cursor_x, saved_cursor_y;
-extern int application_keypad_mode;
-extern int insert_mode;
-extern int decckm_mode;
-extern int wraparound_mode;
-extern int cursor_visible;
-extern int using_alternate_screen;
-extern int screen_cols;
-extern int screen_rows;
-extern int scroll_region_start;
-extern int scroll_region_end ;
-extern int scroll_in_region;
-
typedef struct {
unsigned int nfg;
unsigned long *fg;
@@ -77,9 +64,22 @@ typedef struct {
} font;
} DC;
+extern int saved_cursor_x, saved_cursor_y;
+extern int application_keypad_mode;
+extern int insert_mode;
+extern int decckm_mode;
+extern int wraparound_mode;
+extern int cursor_visible;
+extern int using_alternate_screen;
+extern int screen_cols;
+extern int screen_rows;
+extern int scroll_region_start;
+extern int scroll_region_end ;
+extern int scroll_in_region;
extern DC dc;
+extern text_letter_t text_attrs;
extern text_row_t *text_screen;
-extern text_letter_t text_attrs;
+extern text_row_t *saved_screen;
extern Display *dpy;
extern Window win, root;
extern GC gc;
@@ -88,6 +88,7 @@ extern int screen;
extern int screen;
extern int ww;
extern int wh;
+extern int curr_row, curr_col;
extern int cmd_write(const char *, int);
extern unsigned char cmdgetc(void);
@@ -103,6 +104,7 @@ extern void redraw_region(int,int,int,in
extern void redraw_region(int,int,int,int);
extern void force_redraw_screen(void);
extern void win_set_window_title(char *);
+extern text_row_t *buffer_create(int rows, int cols);
/* util.c */
void *emalloc(unsigned int size);
Received on Fri Mar 02 2007 - 15:42:18 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:04 UTC