FACT++  1.0
void Shell::HandleResize ( )
private

Non static member function called by HandleResize.

Signal handler for SIGWINCH. It resizes the terminal and all panels according to the new terminal size and redisplay the backlog buffer in both windows

Todo:
Maybe there are more efficient ways than to display the whole buffers

Definition at line 332 of file Shell.cc.

References CreateWindows(), WindowLog::Display(), fPanelFrame, fPanelIn, fPanelOut, ReadlineWindow::SetWindow(), WindowLog::SetWindow(), win, and wout.

Referenced by HandleResizeImp().

333 {
334  // Get the new terminal size
335  struct winsize w;
336  ioctl(0, TIOCGWINSZ, &w);
337 
338  // propagate it to the terminal
339  resize_term(w.ws_row, w.ws_col);
340 
341  // Store the pointer to the old windows
342  WINDOW *w_in = panel_window(fPanelIn);
343  WINDOW *w_frame = panel_window(fPanelFrame);
344  WINDOW *w_out = panel_window(fPanelOut);
345 
346  // Create new windows
347  WINDOW *wins[3];
348  CreateWindows(wins);
349 
350  // Redirect the streams and the readline output to the new windows
351  win.SetWindow(wins[0]);
352  wout.SetWindow(wins[2]);
353 
354  SetWindow(wins[0]);
355 
356  // Replace windows in the panels
357  replace_panel(fPanelIn, wins[0]);
358  replace_panel(fPanelFrame, wins[1]);
359  replace_panel(fPanelOut, wins[2]);
360 
361  // delete the old obsolete windows
362  delwin(w_in);
363  delwin(w_out);
364  delwin(w_frame);
365 
366  // FIXME: NEEDED also in Redisplay panel
367  //Redisplay();
368 
369  // Redisplay their contents
370  win.Display();
371  wout.Display();
372 }
PANEL * fPanelOut
Pointer to the panel for the frame around the output.
Definition: Shell.h:23
WindowLog win
pointer to our glocal object to get the static member functions into scope
Definition: Shell.h:17
void SetWindow(WINDOW *w)
void CreateWindows(WINDOW *w[3], int all=true)
Helper for the constructor and window resizing to create the windows and panels.
Definition: Shell.cc:240
PANEL * fPanelFrame
Pointer to the panel for the input stream.
Definition: Shell.h:22
void SetWindow(WINDOW *w)
Redirect the output to an ncurses WINDOW instead of cout.
Definition: WindowLog.h:118
PANEL * fPanelIn
Definition: Shell.h:21
struct _win_st WINDOW
Definition: ReadlineWindow.h:6
WindowLog wout
Definition: Shell.h:18
void Display(bool empty=false)
Display backlog.
Definition: WindowLog.cc:46

+ Here is the call graph for this function:

+ Here is the caller graph for this function: