20 extern src::severity_logger<severity_level>
lg;
171 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> SPData-"<<
uuid<<
"_setRightNbr::";
173 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- SPData-"<<
uuid<<
"_setRightNbr::";
198 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> SPData-"<<
uuid<<
"_moveTo::x="<<x<<
" y="<<y;
199 move_panel(
panel, y, x);
282 std::vector<std::string>
contents();
304 virtual void Down()
override;
306 virtual void Up()
override;
329 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_setHeaderColor::"<<header;
330 header_color = color_pair;
331 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_setHeaderColor::"<<header;
339 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<this->
uuid<<
"_constructor::";
345 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<this->uuid<<
"_constructor::";
353 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<this->uuid<<
"_contents::";
354 std::vector<std::string> out_vec;
355 for(
auto elem: object_list)
356 out_vec.push_back(elem->shortDesc());
357 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<this->uuid<<
"_contents::";
366 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<this->uuid<<
"_insertIntoLeftNbr::"<<this->header;
368 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<this->uuid<<
"_insertIntoLeftNbr::"<<this->header;
404 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_currItem::";
407 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_currItem::";
409 return object_list[selected-1];
411 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_currItem::";
420 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_refreshItemList:: sel:"<<selected;
427 for(
int i=0; i<=(size_item_list+1);i++)
428 free_item(item_list[i]);
434 item_list = (ITEM**) calloc(object_list.size()+2,
sizeof(ITEM*));
436 size_item_list = (int)object_list.size();
437 item_list[0] = (ITEM*) new_item((
const char*)(header.c_str()), NULL);
438 item_opts_off(item_list[0], O_SELECTABLE);
440 for(
int i=1; i<=object_list.size(); i++)
441 item_list[i] = (ITEM*) new_item((object_list[i-1]->shortDesc()), (object_list[i-1]->longDesc()));
442 item_list[object_list.size()+1] = (ITEM *)NULL;
444 menu = new_menu((ITEM**) item_list);
445 set_menu_grey(menu, COLOR_PAIR(header_color));
447 set_menu_win(menu, win);
448 set_menu_mark(menu,
"");
450 menu_driver(menu, REQ_FIRST_ITEM);
451 set_menu_fore(menu, COLOR_PAIR(curr_color));
452 for(
int i=0; i<selected;i++)
453 menu_driver(menu, REQ_DOWN_ITEM);
455 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_refreshItemList:: sel:"<<selected;
464 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<uuid<<
"_refreshItemList2::sel:"<<selected<<
" browse:"<<browse_pos<<
" data: "<<data.size()<<
" prop: "<<prop_name<<
"menu: "<<menu<<
" win:"<<win<<
"header: "<<header;
471 for(
int i=0; i<=(size_item_list+1);i++)
472 free_item(item_list[i]);
474 item_list = (ITEM**) NULL;
480 item_list = (ITEM**) calloc(data.size()+2,
sizeof(ITEM*));
484 size_item_list = (int)data.size();
485 item_list[0] = (ITEM*) new_item((
const char*)header.c_str(), NULL);
486 item_opts_off(item_list[0], O_SELECTABLE);
488 for(
int i=1; i<=data.size(); i++)
489 item_list[i] = (ITEM*) new_item(data[sorted_indices[i-1]].shortDesc(), NULL);
491 item_list[data.size()+1] = (ITEM *)NULL;
493 menu = new_menu((ITEM**) item_list);
495 BOOST_LOG_SEV(
lg, error)<<
log_spacer<<
"ProcViewPanel-"<<uuid<<
"_refreshItemList2::menu allocation failed";
497 set_menu_grey(menu, COLOR_PAIR(header_color));
498 set_menu_win(menu, win);
499 set_menu_mark(menu,
"");
502 if (browse_pos == -1 || browse_pos == 0)
506 if (browse_pos >= data.size())
507 browse_pos = data.size();
513 selected = browse_pos;
514 set_menu_fore(menu, COLOR_PAIR(curr_color));
515 set_menu_format(menu, this->height, 1);
517 menu_driver(menu, REQ_FIRST_ITEM);
518 for(
int i=0; i<selected; i++)
519 menu_driver(menu, REQ_DOWN_ITEM);
524 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<uuid<<
"_refreshItemList2:: sel:"<<selected<<
" browse:"<<browse_pos<<
" data: "<<data.size()<<
" prop:"<<prop_name<<
" menu: "<<menu<<
" win:"<<win;
532 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_selectionOn::";
533 set_menu_fore(menu, COLOR_PAIR(selection_color));
534 curr_color = selection_color;
537 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_selectionOn::";
545 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_selectionOff::";
546 set_menu_fore(menu, COLOR_PAIR(1));
550 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_selectionOff::";
558 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_Down:: sel:"<<selected<<
" datasize: "<<size_item_list;
559 if (selected == -1 || selected == size_item_list)
561 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_Down:: sel:"<<selected;
566 menu_driver(menu, REQ_DOWN_ITEM);
569 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_Down:: sel:"<<selected<<
" datasize: "<<size_item_list;
577 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_Up:: sel: "<<selected<<
" datasize: "<<size_item_list;
580 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_Up:: sel:"<<selected;
585 menu_driver(menu, REQ_UP_ITEM);
588 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_Up:: sel:"<<selected<<
" datasize: "<<size_item_list;
596 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_Top:: sel:"<<selected;
599 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_Top:: sel: "<<selected;
604 menu_driver(menu, REQ_FIRST_ITEM);
605 menu_driver(menu, REQ_DOWN_ITEM);
607 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_Top:: sel: "<<selected;
615 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> BrowsePanelData-"<<uuid<<
"_resolveKey::";
617 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- BrowsePanelData-"<<uuid<<
"_resolveKey::";
647 void Down()
override;
688 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_release::"<<
"prop: "<<this->header<<
"win: "<<this->win;
690 if (this->menu != NULL)
692 unpost_menu(this->menu);
693 free_menu(this->menu);
694 for(
int i=0; i<=(this->size_item_list+1);i++)
695 free_item(this->item_list[i]);
696 free(this->item_list);
697 for(
int i=0; i<this->object_list.size(); i++)
698 delete(this->object_list[i]);
701 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_release::"<<
"prop: "<<this->header;
709 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_setHeaderColor::"<<this->header;
710 this->header_color = color;
711 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_setHeaderColor::"<<this->header;
719 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_insertIntoLeftNbr::"<<this->header;
721 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<--EditPanelData-"<<this->uuid<<
"_insertIntoLeftNbr::"<<this->header;
729 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_insertIntoRightNbr::"<<this->header;
730 dynamic_cast<EditPanelData<T>*
>(this->rightNbr())->insert(this->currItem());
731 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<--EditPanelData-"<<this->uuid<<
"_insertIntoRightNbr::"<<this->header;
739 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_toggleEditMode::";
741 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_toggleEditMode::";
749 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_selectionOn::";
751 this->curr_color = editing_color;
753 this->curr_color = this->selection_color;
754 set_menu_fore(this->menu, COLOR_PAIR(this->curr_color));
755 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_selectionOn::";
763 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_selectionOff::";
764 this->curr_color = 1;
765 set_menu_fore(this->menu, COLOR_PAIR(this->curr_color));
766 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_selectionOff::";
774 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_insert:: cap:"<<this->object_list.capacity();
776 std::vector<Info*> tmpvec;
777 tmpvec.reserve(this->object_list.capacity());
778 for(
auto it=(this->object_list.begin()+this->selected-1); it != this->object_list.end(); it++)
779 tmpvec.push_back(*it);
780 this->object_list.insert(this->object_list.begin()+this->selected-1, pinfo);
783 for(
int i=0; i<tmpvec.size(); i++)
784 this->object_list[this->selected+i] = tmpvec[i];
786 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_insert::";
800 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_editModeOn::";
802 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_editModeOn::";
810 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_editModeOff::";
812 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_editModeOff::";
820 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_Down:: sel:"<<this->selected<<
" datasize:"<<this->size_item_list;
824 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_Down:: sel: "<<this->selected;
829 if (this->selected == -1 || this->selected == this->size_item_list)
831 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_Down:: sel:"<<this->selected;
836 swap(this->object_list, this->selected-1, this->selected);
839 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_Down:: sel:"<<this->selected<<
" datasize:"<<this->size_item_list;
847 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_Up:: sel:"<<this->selected<<
" datasize:"<<this->size_item_list;
852 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_Up:: sel:"<<this->selected;
856 if (this->selected <= 1)
858 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_Up:: sel:"<<this->selected;
863 swap(this->object_list, this->selected-1, this->selected-2);
866 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_Up:: sel:"<<this->selected<<
" datasize:"<<this->size_item_list;
874 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_resolveKey::panel: "<<this->uuid;
876 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_resolveKey::panel: "<<this->uuid;
884 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> EditPanelData-"<<this->uuid<<
"_remove::, sel: :"<<this->selected;
886 if (this->selected <= 0)
888 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_remove::panel: "<<this->uuid;
892 delete(this->object_list[this->selected-1]);
893 std::vector<T*> tmpvec;
894 tmpvec.reserve(this->object_list.capacity());
895 for(
auto it=(this->object_list.begin()+this->selected); it != this->object_list.end(); it++)
896 tmpvec.push_back(*it);
897 this->object_list.erase(this->object_list.begin()+this->selected-1);
898 if (this->selected == (this->object_list.size()+1))
902 for(
int i=0; i<tmpvec.size(); i++)
903 this->object_list[i+this->selected-1] = tmpvec[i];
905 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- EditPanelData-"<<this->uuid<<
"_remove::sel: "<<this->selected;
922 std::vector<EditPanelData<InfoProc<std::string>>>
columns;
955 void show()
override;
957 void hide()
override;
967 void Down()
override;
990 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_setHeaderColor::";
992 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_setHeaderColor::";
999 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_displayedKeys::";
1000 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_displayedKeys::";
1008 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_resolveKey::";
1010 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_resolveKey::";
1017 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_syncColors::";
1020 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_syncColors::";
1027 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_createColumn::"<<
" mainwin:"<<
win;
1028 WINDOW* panel_win = derwin(
win, this->
height-2, width, 0, xpos);
1029 PANEL* temp_panel = new_panel(panel_win);
1030 panel_data.setWin(panel_win);
1031 panel_data.setPanel(temp_panel);
1032 panel_data.setHeader(header);
1033 panel_data.setHeaderColor(4);
1034 panel_data.setDimensions(this->
height-2, width);
1035 mvderwin(panel_win, 0, xpos);
1036 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_createColumn::"<<
" win:"<<panel_win<<
" width: "<<
width;
1043 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_loadColumnsFromActiveProc::";
1048 for(
auto prop: active_props)
1054 columns.push_back(panel_data);
1058 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_loadColumnsFromActiveProc::";
1065 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<this->
uuid<<
"_show::";
1068 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<this->uuid<<
"_show::";
1075 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<this->
uuid<<
"_hide::";
1078 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<this->uuid<<
"_hide::";
1085 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_deleteColumn::";
1092 columns[curr_index].release();
1099 for(
int i=0; i<curr_index; i++)
1101 for(
int i=curr_index; i<
clm_widths.size(); i++)
1106 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_deleteColumn::"<<curr_index;
1113 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_insertColumn::";
1120 for(
int i=0; i<curr_index; i++)
1128 for(
int i=curr_index+1; i<
columns.size(); i++)
1133 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_insertColumn::"<<
"win: "<<panel_data.
window();
1140 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_moveLeft::";
1144 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_moveLeft::"<<
"mode:"<<edit_mode;
1150 if (curr_index <= 0)
1152 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_moveLeft::"<<
"mode:"<<edit_mode;
1162 columns[curr_index] = tmpPanel;
1166 for(
int i=0; i<(curr_index-1); i++)
1171 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_moveLeft::"<<
"mode:"<<edit_mode;
1178 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"--> ProcViewPanel-"<<
uuid<<
"_moveRight::";
1182 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_moveRight::"<<
"mode:"<<edit_mode;
1191 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_moveRight::"<<
"mode:"<<edit_mode;
1202 columns[curr_index+1] = tmpPanel;
1206 for(
int i=0; i<curr_index; i++)
1211 BOOST_LOG_SEV(
lg, debug)<<
log_spacer<<
"<-- ProcViewPanel-"<<
uuid<<
"_moveRight::"<<
"mode:"<<edit_mode;
int width
width and height in panel window in ncurses units.
MENU * menu
pointer to MENU
virtual void insertColumn()
mock
void setDimensions(int h, int w)
set internal width, height variables corresponding to panel window dimensions
virtual void show2()
makes panel visible
std::string sortKey() const
called by Column::read. returns property name to be used as sort key
virtual void refreshItemList2(std::vector< InfoProc< std::string >> &, std::string, const std::vector< int > &, int &)
mock
SimplePanelData(int)
SimplePanelData constructor.
bool editing
editing status of panel
virtual void toggleEditMode()
mock
MapOfKeyDicts mapKeyDict
global variable for accessing key dictionaries by their uuid
derived from BrowsePanelData. capable of editing items in ncurses menu list.
int dbsize
size of property vector i.e. number of processes whose properties are being maintained
int size_item_list
size of object_list
virtual void addIntoRightNbr() override
mock
void Top() override
sets menu's first item as selected item
virtual void setHeaderColor(int color_pair) override
sets color of menu's header item to be header color_pair
int basic_color
color_pair id for unselected item in menu
virtual void selectionOff() override
sets currently selected menu item's color to basic color_pair and update curr_color to basic color_pa...
void setRightNbr(SimplePanelData *)
set pointer to right neighbour panel
virtual void setEditingColor(int)
mock
virtual void insertIntoLeftNbr()
mock
virtual void moveIntoLeftNbr() override
mock
void refreshItemList() override
intended to be used with browse panels. tears down menu and re-initializes with items in object_list
void refreshItemList2(std::vector< InfoProc< std::string >> &, std::string, const std::vector< int > &, int &) override
called from ProcViewPanel::refresh. tears down menu and reinitializes with data (reference to vector ...
int currIndex() const
returns currently selected item on object_list
virtual void refreshItemList()
mock
StateMachine smKeys
Keys statemachine.
void insertIntoLeftNbr() override
inserts value of currently selected menu item into menu of left neighbour
void setHeader(std::string head_str) override
sets panel header.
virtual void resolveKey(int) override
resolves current key with KeyDict
void setPanel(PANEL *panel_in)
sets reference to ncurses PANEL associated with this panel data structure
void createColumn(EditPanelData< InfoProc< std::string >> &, int, int, std::string)
responsible for creating a new edit panel containing menu to hold property values
virtual void resolveKey(int) override
resolves the key input at panel level
std::map< std::string, int > prop_wid_dict
dictionary of column width assigned to each process property
int uUid() const
returns unique identifier of this object
void release()
releases UI resources associated with this panel
void selectionOff() override
sets currently selected menu item's color to basic_color and update curr_color to basic_color
virtual void insertIntoRightNbr()
mock
virtual void insertIntoRightNbr() override
inserts value of currently selected menu item into menu of right neighbour
virtual void selectionOn()
mock
int selected
item selected in menu, 0 being header item
void insert(InfoProc< float > *)
not implemented
virtual void setSelectionColor(int)
mock
void selectionOn() override
sets currently selected menu item's color to selection curr_color_pair (editiing_color or selection_c...
int currState() const
returns current state
WINDOW * win
window attached to the panel
data structure that hold property values for processes. contains facilities to enable their proper ac...
bool editMode() const
return edit mode
void setHeaderColor(int hcolor) override
set column header color_pair
void moveLeft() override
swaps column (based on selection in active_proc_panel) with left neighbour
virtual void Down() override
moves menu item selection down by 1
virtual void insertIntoLeftNbr() override
inserts value of currently selected menu item into menu of left neighbour
void editModeOn() override
sets editing to true
SimplePanelData * rightNbr()
returns pointer to right neighbour panel
void Up() override
move cursor one position up
int capacity
capacity of object_list.
std::string sort_key
sorting key - some process's properties name
void toggleEditMode() override
toggles editing mode
virtual void addIntoRightNbr()
mock
void show() override
makes all columns associated with this panel visible
virtual void Up() override
moves menu item selection up by 1
src::severity_logger< severity_level > lg
std::vector< T * > object_list
vector of pointers to generic type containing value that goes into menu item.
std::vector< std::string > clm_names
vector of property names currently being displayed by the panel
void resolveKey(int) override
resolve current key with panel's key dictionary
std::vector< int > sorted_indices
vector that holds the permutation order to parse property vectors in sorted order
virtual void moveIntoLeftNbr()
mock
void insertColumn() override
inserts Column based on item selected in active_proc_panel
int curr_color
current color_pair (either selection_color or basic_color)
EditPanelData(int)
EditPanelData<T> constructor.
std::vector< std::string > displayedKeys() const
called by Column::read. return vector of property names currently being displayed
panel data structure responsible for displaying of property values for all live processes.
void setWin(WINDOW *win_in)
sets reference to ncurses WINDOW associated with panel
void setEditingColor(int color_pair) override
sets editing color_pair
virtual void editModeOff()
mock
virtual void editModeOn()
mock
void delSpace()
deletes one white-space from white-space string corresponding to invoking thread
virtual void show()
refreshes contents of associated BrowsePanel data structure and makes panel visible
virtual void setHeader(std::string)
mock
virtual void hide()
hides panel
virtual void remove()
mock
void setSelectionColor(int color_pair) override
sets color_pair for selected menu item
std::map< std::string, std::vector< InfoProc< std::string > > > database
dictionary that holds vector of values corresponding to each property name string
void insertIntoRightNbr() override
inserts value of currently selected menu item into menu of right neighbour
WINDOW * window() const
returns pointer to ncurses WINDOW associated with panel
int editing_color
index of color_pair for editing
BrowsePanelData(int)
BrowsePanelData<T> constructor.
void addSpace()
adds one white-space to white-space string corresponding to invoking thread
void hide() override
hides all columns associated with this panel
data structure that defines type of entry from which panel menu entrires obtain their c-string data
void moveTo(int, int)
move panel window to desired x,y pos on stdscr.
void setLeftNbr(SimplePanelData *)
set pointer to left neighbour panel
void deleteColumn() override
deletes Column based on item selected in active_proc_panel
derived from SimplePanelData. capable of storing list of item in a ncurses menu object.
SimplePanelData * r_next
pointer to panel data structures correponding to left/right neighbour of this panel
ProcDb * proc_database
pointer reference to ProcDb object
void insert(InfoProc< int > *)
not implemented
virtual void addIntoLeftNbr()
mock
virtual std::vector< std::string > displayedKeys() const
mock
SimplePanelData * active_proc_panel
reference to panel data structure containing property names to be displayed. clm_names,...
void loadColumnsFromActiveProc()
runs only initially to create columns to load all properties to be displayed
int header_color
color_paid id for header color
virtual void moveLeft()
mock
ITEM ** item_list
array of pointers to ITEM (array of ITEM*) for menu initialization
virtual void selectionOff()
mock
int selection_color
color_pair id for selected item in menu
enables indentation of logs for easy viewing
data structure that defines type of entry from which panel menu entries obtain their c-string data
ProcViewPanel(int id)
ProcViewPanel constructor.
std::string header
panel header.
Base class in heirarchy of UI objects responsible to storing the content associated with a panel and ...
void Down() override
move cursor one position down
virtual void setHeaderColor(int)
mock
void swap(std::vector< T > &v, int i, int j)
swaps supplied vectors' element corresponding to indices i and j
statemachine that uses integer corresponding to object uuids to represent states
std::vector< std::string > contents()
returns contents of panel's menu as vector of strings
PANEL * panel
panel to which the data structure is associated
int browse_pos
browser position in property column. 1 corresponds to 1st item
virtual T * currItem() const
returns copy of currently selected item in object_list
virtual void selectionOn() override
sets currently selected menu item's color to selection color_pair and update curr_color to selection ...
virtual void moveIntoRightNbr()
mock
void Down() override
swap selected item with item below it (editing) or moves cursor down by one (not editing)
void insert(InfoProc< std::string > *)
not implemented
void remove() override
remove currently selected menu item
std::vector< int > clm_widths
vector of column widths corresponding to properties being displayed
virtual void refresh()
mock
SimplePanelData * leftNbr()
returns pointer to left neighbour panel
void Up() override
swap selected item with item above it (editing) or moves cursor up by one (not editing)
void syncColors() override
virtual void deleteColumn()
mock
virtual void addIntoLeftNbr() override
mock
void setBasicColor(int color_pair) override
sets color_pair for unselected menu item
void editModeOff() override
sets editing to false
virtual void resolveKey(int)
mock
virtual void setBasicColor(int)
mock
void insert(Info *)
inserts Info* object into into object_list above selected item
virtual void syncColors()
mock
std::vector< EditPanelData< InfoProc< std::string > > > columns
vector of EditPanel data structures, each containing list of specific propertie's value for all proce...
int header_color
color_pair corresponding to column headers
void refresh() override
manages column initialization and column updates
void moveRight() override
swaps column (based on selection in active_proc_panel) with left neighbour
virtual void moveIntoRightNbr() override
mock
virtual void moveRight()
mock
void setHeaderColor(int) override
sets header color_pair