Rename some functions.

This commit is contained in:
Nicholas Marriott 2008-09-10 19:15:06 +00:00
parent ded348064a
commit f07cedf048
8 changed files with 38 additions and 38 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-respawn-window.c,v 1.4 2008-07-01 05:06:11 nicm Exp $ */
/* $Id: cmd-respawn-window.c,v 1.5 2008-09-10 19:15:04 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -68,7 +68,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
ctx->error(ctx, "respawn failed: %s:%d", s->name, wl->idx);
return;
}
screen_reset(&wl->window->base);
screen_reinit(&wl->window->base);
recalculate_sizes();
server_redraw_window(wl->window);

View File

@ -1,4 +1,4 @@
/* $Id: screen.c,v 1.70 2008-09-10 18:59:29 nicm Exp $ */
/* $Id: screen.c,v 1.71 2008-09-10 19:15:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -76,7 +76,7 @@
/* Create a new screen. */
void
screen_create(struct screen *s, u_int dx, u_int dy, u_int hlimit)
screen_init(struct screen *s, u_int dx, u_int dy, u_int hlimit)
{
s->dx = dx;
s->dy = dy;
@ -110,7 +110,7 @@ screen_create(struct screen *s, u_int dx, u_int dy, u_int hlimit)
/* Reinitialise screen. */
void
screen_reset(struct screen *s)
screen_reinit(struct screen *s)
{
s->cx = 0;
s->cy = 0;
@ -130,6 +130,20 @@ screen_reset(struct screen *s)
screen_clear_selection(s);
}
/* Destroy a screen. */
void
screen_free(struct screen *s)
{
utf8_free(&s->utf8_table);
xfree(s->title);
screen_free_lines(s, 0, s->dy + s->hsize);
xfree(s->grid_data);
xfree(s->grid_attr);
xfree(s->grid_fg);
xfree(s->grid_bg);
xfree(s->grid_size);
}
/* Resize screen. */
void
screen_resize(struct screen *s, u_int sx, u_int sy)
@ -294,20 +308,6 @@ screen_set_cell(struct screen *s,
s->grid_bg[cy][cx] = bg;
}
/* Destroy a screen. */
void
screen_destroy(struct screen *s)
{
utf8_free(&s->utf8_table);
xfree(s->title);
screen_free_lines(s, 0, s->dy + s->hsize);
xfree(s->grid_data);
xfree(s->grid_attr);
xfree(s->grid_fg);
xfree(s->grid_bg);
xfree(s->grid_size);
}
/* Create a range of lines. */
void
screen_make_lines(struct screen *s, u_int py, u_int ny)

View File

@ -1,4 +1,4 @@
/* $Id: server.c,v 1.79 2008-09-08 17:40:51 nicm Exp $ */
/* $Id: server.c,v 1.80 2008-09-10 19:15:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -339,7 +339,7 @@ server_check_redraw(struct client *c)
* screen, this can't use anything which relies on
* cursor position.
*/
screen_create(&screen, xx, yy, 0);
screen_init(&screen, xx, yy, 0);
screen_redraw_start(&ctx, &screen, tty_write_client, c);
if (sx < xx)
screen_redraw_columns(&ctx, sx, xx - sx);
@ -349,7 +349,7 @@ server_check_redraw(struct client *c)
screen_redraw_lines(&ctx, sy, yy - sy);
}
screen_redraw_stop(&ctx);
screen_destroy(&screen);
screen_free(&screen);
}
screen_redraw_start_client(&ctx, c);

8
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.187 2008-09-10 18:59:29 nicm Exp $ */
/* $Id: tmux.h,v 1.188 2008-09-10 19:15:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -1255,9 +1255,9 @@ void screen_redraw_lines(struct screen_redraw_ctx *, u_int, u_int);
void screen_redraw_columns(struct screen_redraw_ctx *, u_int, u_int);
/* screen.c */
void screen_create(struct screen *, u_int, u_int, u_int);
void screen_reset(struct screen *);
void screen_destroy(struct screen *);
void screen_init(struct screen *, u_int, u_int, u_int);
void screen_reinit(struct screen *);
void screen_free(struct screen *);
void screen_resize(struct screen *, u_int, u_int);
void screen_expand_line(struct screen *, u_int, u_int);
void screen_reduce_line(struct screen *, u_int, u_int);

View File

@ -1,4 +1,4 @@
/* $Id: window-copy.c,v 1.29 2008-09-08 17:40:51 nicm Exp $ */
/* $Id: window-copy.c,v 1.30 2008-09-10 19:15:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -97,7 +97,7 @@ window_copy_init(struct window *w)
data->cy = w->base.cy;
s = &data->screen;
screen_create(s, screen_size_x(&w->base), screen_size_y(&w->base), 0);
screen_init(s, screen_size_x(&w->base), screen_size_y(&w->base), 0);
s->cx = data->cx;
s->cy = data->cy;
@ -115,7 +115,7 @@ window_copy_free(struct window *w)
{
struct window_copy_mode_data *data = w->modedata;
screen_destroy(&data->screen);
screen_free(&data->screen);
xfree(data);
}

View File

@ -1,4 +1,4 @@
/* $Id: window-more.c,v 1.17 2008-09-08 17:40:51 nicm Exp $ */
/* $Id: window-more.c,v 1.18 2008-09-10 19:15:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -92,7 +92,7 @@ window_more_init(struct window *w)
data->top = 0;
s = &data->screen;
screen_create(s, screen_size_x(&w->base), screen_size_y(&w->base), 0);
screen_init(s, screen_size_x(&w->base), screen_size_y(&w->base), 0);
s->mode &= ~MODE_CURSOR;
return (s);
@ -108,7 +108,7 @@ window_more_free(struct window *w)
xfree(ARRAY_ITEM(&data->list, i));
ARRAY_FREE(&data->list);
screen_destroy(&data->screen);
screen_free(&data->screen);
xfree(data);
}

View File

@ -1,4 +1,4 @@
/* $Id: window-scroll.c,v 1.22 2008-09-08 17:40:51 nicm Exp $ */
/* $Id: window-scroll.c,v 1.23 2008-09-10 19:15:05 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -65,7 +65,7 @@ window_scroll_init(struct window *w)
data->oy = 0;
s = &data->screen;
screen_create(s, screen_size_x(&w->base), screen_size_y(&w->base), 0);
screen_init(s, screen_size_x(&w->base), screen_size_y(&w->base), 0);
s->mode &= ~MODE_CURSOR;
screen_write_start(&ctx, s, NULL, NULL);
@ -81,7 +81,7 @@ window_scroll_free(struct window *w)
{
struct window_scroll_mode_data *data = w->modedata;
screen_destroy(&data->screen);
screen_free(&data->screen);
xfree(data);
}

View File

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.48 2008-07-01 20:35:16 nicm Exp $ */
/* $Id: window.c,v 1.49 2008-09-10 19:15:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -182,7 +182,7 @@ window_create(const char *name,
w->flags = 0;
w->limitx = w->limity = UINT_MAX;
screen_create(&w->base, sx, sy, hlimit);
screen_init(&w->base, sx, sy, hlimit);
w->screen = &w->base;
input_init(w);
@ -282,7 +282,7 @@ window_destroy(struct window *w)
input_free(w);
window_reset_mode(w);
screen_destroy(&w->base);
screen_free(&w->base);
buffer_destroy(w->in);
buffer_destroy(w->out);