htop/Panel.h

114 lines
2.2 KiB
C
Raw Permalink Normal View History

2006-06-06 20:28:42 +00:00
/* Do not edit this file. It was automatically generated. */
2006-05-30 13:47:28 +00:00
#ifndef HEADER_Panel
#define HEADER_Panel
/*
2006-06-06 20:28:42 +00:00
htop - Panel.h
2006-05-30 13:47:28 +00:00
(C) 2004-2006 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
#include "Object.h"
#include "Vector.h"
#include "CRT.h"
#include "RichString.h"
#include "ListItem.h"
2006-05-30 13:47:28 +00:00
#include <math.h>
#include <stdbool.h>
#include "debug.h"
#include <assert.h>
#include <curses.h>
//#link curses
typedef struct Panel_ Panel;
typedef enum HandlerResult_ {
HANDLED,
IGNORED,
BREAK_LOOP
} HandlerResult;
typedef HandlerResult(*Panel_EventHandler)(Panel*, int);
struct Panel_ {
Object super;
int x, y, w, h;
WINDOW* window;
Vector* items;
int selected;
int scrollV, scrollH;
int scrollHAmount;
2006-05-30 13:47:28 +00:00
int oldSelected;
bool needsRedraw;
RichString header;
Panel_EventHandler eventHandler;
};
2006-06-06 20:28:42 +00:00
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
2006-05-30 13:47:28 +00:00
#ifdef DEBUG
2006-06-06 20:28:42 +00:00
extern char* PANEL_CLASS;
#else
#define PANEL_CLASS NULL
#endif
2006-05-30 13:47:28 +00:00
Panel* Panel_new(int x, int y, int w, int h, char* type, bool owner, Object_Compare compare);
2006-05-30 13:47:28 +00:00
void Panel_delete(Object* cast);
void Panel_init(Panel* this, int x, int y, int w, int h, char* type, bool owner);
void Panel_done(Panel* this);
extern void Panel_setRichHeader(Panel* this, RichString header);
2006-05-30 13:47:28 +00:00
extern void Panel_setHeader(Panel* this, char* header);
2006-05-30 13:47:28 +00:00
2006-06-06 20:28:42 +00:00
void Panel_setEventHandler(Panel* this, Panel_EventHandler eh);
2006-05-30 13:47:28 +00:00
void Panel_move(Panel* this, int x, int y);
void Panel_resize(Panel* this, int w, int h);
void Panel_prune(Panel* this);
void Panel_add(Panel* this, Object* o);
void Panel_insert(Panel* this, int i, Object* o);
void Panel_set(Panel* this, int i, Object* o);
Object* Panel_get(Panel* this, int i);
Object* Panel_remove(Panel* this, int i);
Object* Panel_getSelected(Panel* this);
void Panel_moveSelectedUp(Panel* this);
void Panel_moveSelectedDown(Panel* this);
int Panel_getSelectedIndex(Panel* this);
int Panel_getSize(Panel* this);
void Panel_setSelected(Panel* this, int selected);
void Panel_draw(Panel* this, bool focus);
void Panel_onKey(Panel* this, int key);
#endif