diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2006-05-30 13:47:28 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2006-05-30 13:47:28 +0000 |
commit | c2cdcd0c1d2950291243b3a8645b5f061a0cdb2a (patch) | |
tree | 390297160c9caa342217d481406c68343785b5f9 /TraceScreen.c | |
parent | a853faaa2d2d0321da0ff6f51be656fc40cf8663 (diff) |
Rename ListBox to Panel, matching dit.
Diffstat (limited to 'TraceScreen.c')
-rw-r--r-- | TraceScreen.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/TraceScreen.c b/TraceScreen.c index a5fedede..42770f09 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -18,14 +18,14 @@ in the source distribution for its full text. #include "ProcessList.h" #include "Process.h" #include "ListItem.h" -#include "ListBox.h" +#include "Panel.h" #include "FunctionBar.h" /*{ typedef struct TraceScreen_ { Process* process; - ListBox* display; + Panel* display; FunctionBar* bar; bool tracing; } TraceScreen; @@ -44,14 +44,14 @@ static int tbEvents[3] = {KEY_F(4), KEY_F(5), 27}; TraceScreen* TraceScreen_new(Process* process) { TraceScreen* this = (TraceScreen*) malloc(sizeof(TraceScreen)); this->process = process; - this->display = ListBox_new(0, 1, COLS, LINES-2, LISTITEM_CLASS, true); + this->display = Panel_new(0, 1, COLS, LINES-2, LISTITEM_CLASS, true); this->bar = FunctionBar_new(3, tbFunctions, tbKeys, tbEvents); this->tracing = true; return this; } void TraceScreen_delete(TraceScreen* this) { - ListBox_delete((Object*)this->display); + Panel_delete((Object*)this->display); FunctionBar_delete((Object*)this->bar); free(this); } @@ -81,7 +81,7 @@ void TraceScreen_run(TraceScreen* this) { } fcntl(fdpair[0], F_SETFL, O_NONBLOCK); FILE* strace = fdopen(fdpair[0], "r"); - ListBox* lb = this->display; + Panel* lb = this->display; int fd_strace = fileno(strace); TraceScreen_draw(this); CRT_disableDelay(); @@ -105,23 +105,23 @@ void TraceScreen_run(TraceScreen* this) { if (buffer[i] == '\n') { buffer[i] = '\0'; if (contLine) { - ListItem_append((ListItem*)ListBox_get(lb, - ListBox_getSize(lb)-1), line); + ListItem_append((ListItem*)Panel_get(lb, + Panel_getSize(lb)-1), line); contLine = false; } else { - ListBox_add(lb, (Object*) ListItem_new(line, 0)); + Panel_add(lb, (Object*) ListItem_new(line, 0)); } line = buffer+i+1; } } if (line < buffer+nread) { - ListBox_add(lb, (Object*) ListItem_new(line, 0)); + Panel_add(lb, (Object*) ListItem_new(line, 0)); buffer[nread] = '\0'; contLine = true; } if (follow) - ListBox_setSelected(lb, ListBox_getSize(lb)-1); - ListBox_draw(lb, true); + Panel_setSelected(lb, Panel_getSize(lb)-1); + Panel_draw(lb, true); } int ch = getch(); if (ch == KEY_MOUSE) { @@ -129,7 +129,7 @@ void TraceScreen_run(TraceScreen* this) { int ok = getmouse(&mevent); if (ok == OK) if (mevent.y >= lb->y && mevent.y < LINES - 1) { - ListBox_setSelected(lb, mevent.y - lb->y + lb->scrollV); + Panel_setSelected(lb, mevent.y - lb->y + lb->scrollV); follow = false; ch = 0; } if (mevent.y == LINES - 1) @@ -147,21 +147,21 @@ void TraceScreen_run(TraceScreen* this) { case KEY_F(4): follow = !follow; if (follow) - ListBox_setSelected(lb, ListBox_getSize(lb)-1); + Panel_setSelected(lb, Panel_getSize(lb)-1); break; case 'q': case 27: looping = false; break; case KEY_RESIZE: - ListBox_resize(lb, COLS, LINES-2); + Panel_resize(lb, COLS, LINES-2); TraceScreen_draw(this); break; default: follow = false; - ListBox_onKey(lb, ch); + Panel_onKey(lb, ch); } - ListBox_draw(lb, true); + Panel_draw(lb, true); } kill(child, SIGTERM); waitpid(child, NULL, 0); |