summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 660e6d3)
raw | patch | inline | side by side (parent: 660e6d3)
author | Max Kellermann <max@duempel.org> | |
Sat, 10 Oct 2009 15:45:19 +0000 (17:45 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 10 Oct 2009 15:45:19 +0000 (17:45 +0200) |
Call this function instead of manually setting the "cols" and "rows"
attributes.
attributes.
diff --git a/src/list_window.c b/src/list_window.c
index d7da155fdb6e50788af3e52052b4ec9b7f93ffce..ba2542905b4cdac993f660726aae545a762a9328 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
}
}
+void
+list_window_resize(struct list_window *lw, unsigned width, unsigned height)
+{
+ lw->cols = width;
+ lw->rows = height;
+}
+
void
list_window_set_length(struct list_window *lw, unsigned length)
{
diff --git a/src/list_window.h b/src/list_window.h
index 99f702882a40e1834c27286e6b6e252718ce8eab..edb3e260bd3f13a4205a0378516b38b20df3d84e 100644 (file)
--- a/src/list_window.h
+++ b/src/list_window.h
/* reset a list window (selected=0, start=0) */
void list_window_reset(struct list_window *lw);
+void
+list_window_resize(struct list_window *lw, unsigned width, unsigned height);
+
void
list_window_set_length(struct list_window *lw, unsigned length);
diff --git a/src/screen_artist.c b/src/screen_artist.c
index cb6629a2e4ff9f7ef4cc7401d9d37ae728617625..a1ba4691a37e7f2481dd5ea2e7b84ca1e1a34ec1 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
static void
screen_artist_resize(int cols, int rows)
{
- browser.lw->cols = cols;
- browser.lw->rows = rows;
+ list_window_resize(browser.lw, cols, rows);
}
static void
diff --git a/src/screen_file.c b/src/screen_file.c
index 8e1cf5b87f46dc6d097d0a9f3d6493ab07052c20..7fae5f202e11b32a84d62dfdf451365c6aede245 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
static void
screen_file_resize(int cols, int rows)
{
- browser.lw->cols = cols;
- browser.lw->rows = rows;
+ list_window_resize(browser.lw, cols, rows);
}
static void
diff --git a/src/screen_help.c b/src/screen_help.c
index cf2a40fddece1aae8f094e2d5e7fd203b9ec0af3..316231b6b79dbe7b6c1f4124298b4e9605f9b25c 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
static void
help_resize(int cols, int rows)
{
- lw->cols = cols;
- lw->rows = rows;
+ list_window_resize(lw, cols, rows);
}
static void
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index 71efe48e2b9dd71948d25f17f6e228d762314dde..cea71b49d6462fdc53a744e80e277ce3f983a39b 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
static void
keydef_resize(int cols, int rows)
{
- lw->cols = cols;
- lw->rows = rows;
+ list_window_resize(lw, cols, rows);
}
static void
diff --git a/src/screen_outputs.c b/src/screen_outputs.c
index a1ee33dd88a822d6ad92df394e4e38b117fe5423..39d67d3dc2154bbd195304f441cfeb3c60b6c404 100644 (file)
--- a/src/screen_outputs.c
+++ b/src/screen_outputs.c
static void
outputs_resize(int cols, int rows)
{
- lw->cols = cols;
- lw->rows = rows;
+ list_window_resize(lw, cols, rows);
}
static void
diff --git a/src/screen_play.c b/src/screen_play.c
index 37825e6b640f2be6c4c20ec3931421a3fc8b6c3c..66649b256ca37d82939945ca276d1ba788cb0469 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
static void
screen_playlist_resize(int cols, int rows)
{
- lw->cols = cols;
- lw->rows = rows;
+ list_window_resize(lw, cols, rows);
}
diff --git a/src/screen_search.c b/src/screen_search.c
index 24a6a91ebc9d440d2e1787d75b6c8890abc4e24e..7c35fd2fa44da1c86a0e60e460fadbac7a5956aa 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
static void
screen_search_resize(int cols, int rows)
{
- browser.lw->cols = cols;
- browser.lw->rows = rows;
+ list_window_resize(browser.lw, cols, rows);
}
static void
diff --git a/src/screen_song.c b/src/screen_song.c
index 82e4cd4e1376456d50176a760528576db3b4325c..121599eb97f2dd85f9a93bef1a9761cba7a517fb 100644 (file)
--- a/src/screen_song.c
+++ b/src/screen_song.c
static void
screen_song_resize(int cols, int rows)
{
- lw->cols = cols;
- lw->rows = rows;
+ list_window_resize(lw, cols, rows);
}
static const char *
diff --git a/src/screen_text.h b/src/screen_text.h
index a64b858df59532267dd38a07243b82dcfd7dc266..5358feb82e9329f73c00e778d3596fe71f3ff63e 100644 (file)
--- a/src/screen_text.h
+++ b/src/screen_text.h
static inline void
screen_text_resize(struct screen_text *text, int cols, int rows)
{
- text->lw->cols = cols;
- text->lw->rows = rows;
+ list_window_resize(text->lw, cols, rows);
}
static inline bool