summaryrefslogtreecommitdiff
path: root/fedora/.local/bin/htop-vim/HeaderOptionsPanel.c
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-28 15:42:50 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-28 15:42:50 +0900
commitae78dbbff81196f1d7bc8fabf84d05e6b9f3ca03 (patch)
treefdc69ee3e2772aa4db7e8efe4bd30d101c7f82ac /fedora/.local/bin/htop-vim/HeaderOptionsPanel.c
parent06ad645351572c0e7188c52028998384d718df2e (diff)
updatesHEADmaster
Diffstat (limited to 'fedora/.local/bin/htop-vim/HeaderOptionsPanel.c')
-rw-r--r--fedora/.local/bin/htop-vim/HeaderOptionsPanel.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/fedora/.local/bin/htop-vim/HeaderOptionsPanel.c b/fedora/.local/bin/htop-vim/HeaderOptionsPanel.c
deleted file mode 100644
index 25d1ddb..0000000
--- a/fedora/.local/bin/htop-vim/HeaderOptionsPanel.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-htop - HeaderOptionsPanel.c
-(C) 2021 htop dev team
-Released under the GNU GPLv2+, see the COPYING file
-in the source distribution for its full text.
-*/
-
-#include "HeaderOptionsPanel.h"
-
-#include <assert.h>
-#include <stdbool.h>
-#include <stdlib.h>
-
-#include "CRT.h"
-#include "FunctionBar.h"
-#include "Header.h"
-#include "HeaderLayout.h"
-#include "Object.h"
-#include "OptionItem.h"
-#include "ProvideCurses.h"
-
-
-static const char* const HeaderOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
-
-static void HeaderOptionsPanel_delete(Object* object) {
- Panel* super = (Panel*) object;
- HeaderOptionsPanel* this = (HeaderOptionsPanel*) object;
- Panel_done(super);
- free(this);
-}
-
-static HandlerResult HeaderOptionsPanel_eventHandler(Panel* super, int ch) {
- HeaderOptionsPanel* this = (HeaderOptionsPanel*) super;
-
- HandlerResult result = IGNORED;
- int mark;
-
- switch (ch) {
- case 0x0a:
- case 0x0d:
- case KEY_ENTER:
- case KEY_MOUSE:
- case KEY_RECLICK:
- case ' ':
- mark = Panel_getSelectedIndex(super);
- assert(mark >= 0);
- assert(mark < LAST_HEADER_LAYOUT);
-
- for (int i = 0; i < LAST_HEADER_LAYOUT; i++)
- CheckItem_set((CheckItem*)Panel_get(super, i), false);
- CheckItem_set((CheckItem*)Panel_get(super, mark), true);
-
- Header_setLayout(this->scr->header, mark);
- this->settings->changed = true;
- this->settings->lastUpdate++;
-
- ScreenManager_resize(this->scr);
-
- result = HANDLED;
- }
-
- return result;
-}
-
-const PanelClass HeaderOptionsPanel_class = {
- .super = {
- .extends = Class(Panel),
- .delete = HeaderOptionsPanel_delete
- },
- .eventHandler = HeaderOptionsPanel_eventHandler
-};
-
-HeaderOptionsPanel* HeaderOptionsPanel_new(Settings* settings, ScreenManager* scr) {
- HeaderOptionsPanel* this = AllocThis(HeaderOptionsPanel);
- Panel* super = (Panel*) this;
- FunctionBar* fuBar = FunctionBar_new(HeaderOptionsFunctions, NULL, NULL);
- Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar);
-
- this->scr = scr;
- this->settings = settings;
-
- Panel_setHeader(super, "Header Layout");
- for (int i = 0; i < LAST_HEADER_LAYOUT; i++) {
- Panel_add(super, (Object*) CheckItem_newByVal(HeaderLayout_layouts[i].description, false));
- }
- CheckItem_set((CheckItem*)Panel_get(super, scr->header->headerLayout), true);
- return this;
-}