Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ in the source distribution for its full text.
#include <strings.h>

#include "CRT.h"
#include "FunctionBar.h"
#include "ListItem.h"
#include "Macros.h"
#include "ProvideCurses.h"
#include "RichString.h"
#include "Vector.h"
#include "XUtils.h"


Expand All @@ -33,7 +35,7 @@ const PanelClass Panel_class = {
.eventHandler = Panel_selectByTyping,
};

Panel* Panel_new(int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar) {
Panel* Panel_new(int x, int y, int w, int h, const ObjectClass* type, bool owner, struct FunctionBar_* fuBar) {
Panel* this = xMalloc(sizeof(Panel));
Object_setClass(this, Class(Panel));
Panel_init(this, x, y, w, h, type, owner, fuBar);
Expand All @@ -46,7 +48,7 @@ void Panel_delete(Object* cast) {
free(this);
}

void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar) {
void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, struct FunctionBar_* fuBar) {
this->x = x;
this->y = y;
this->w = w;
Expand Down Expand Up @@ -219,9 +221,9 @@ void Panel_setSelected(Panel* this, int selected) {
}
}

void Panel_splice(Panel* this, Vector* from) {
assert(this != NULL);
assert(from != NULL);
void Panel_splice(Panel* this, struct Vector_* from) {
assert (this != NULL);
assert (from != NULL);

Vector_splice(this->items, from);
this->prevSelected = -1;
Expand Down
17 changes: 8 additions & 9 deletions Panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ in the source distribution for its full text.
#include <stdbool.h>

#include "CRT.h"
#include "FunctionBar.h"
#include "Object.h"
#include "RichString.h"
#include "Vector.h"

struct FunctionBar_;
struct Vector_;

struct Panel_;
typedef struct Panel_ Panel;

typedef enum HandlerResult_ {
Expand Down Expand Up @@ -65,7 +64,7 @@ struct Panel_ {
Object super;
int x, y, w, h;
int cursorX, cursorY;
Vector* items;
struct Vector_* items;
int selected;
int oldSelected;
int prevSelected;
Expand All @@ -77,8 +76,8 @@ struct Panel_ {
bool cursorOn;
bool wasFocus;
int lastMouseBarClickX; /* X position of last mouse click on function bar (LINES-1) */
FunctionBar* currentBar;
FunctionBar* defaultBar;
struct FunctionBar_* currentBar;
struct FunctionBar_* defaultBar;
RichString header;
ColorElements selectionColorId;
};
Expand All @@ -93,11 +92,11 @@ struct Panel_ {

extern const PanelClass Panel_class;

Panel* Panel_new(int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar);
Panel* Panel_new(int x, int y, int w, int h, const ObjectClass* type, bool owner, struct FunctionBar_* fuBar);

void Panel_delete(Object* cast);

void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar);
void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, struct FunctionBar_* fuBar);

void Panel_done(Panel* this);

Expand Down Expand Up @@ -137,7 +136,7 @@ void Panel_setSelected(Panel* this, int selected);

void Panel_draw(Panel* this, bool force_redraw, bool focus, bool highlightSelected, bool hideFunctionBar);

void Panel_splice(Panel* this, Vector* from);
void Panel_splice(Panel* this, struct Vector_* from);

bool Panel_onKey(Panel* this, int key);

Expand Down
Loading