wmii/cmd/menu/dat.h

109 lines
1.3 KiB
C
Raw Normal View History

#define _XOPEN_SOURCE 600
2008-10-13 21:38:03 -04:00
#define IXP_P9_STRUCTS
#define IXP_NO_P9_
#include <fmt.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
2009-01-28 18:35:53 -05:00
#include <string.h>
2008-10-13 21:38:03 -04:00
#include <unistd.h>
2010-05-27 03:58:02 -04:00
#include <ixp.h>
2010-05-21 22:52:47 -04:00
#include <stuff/x.h>
#include <stuff/util.h>
2008-10-13 21:38:03 -04:00
#ifndef EXTERN
# define EXTERN extern
#endif
2008-10-14 16:57:48 -04:00
enum {
FORWARD,
BACKWARD,
LINE,
WORD,
CHAR,
CARET_LAST,
};
2009-05-13 23:30:20 -04:00
enum {
LACCEPT,
LBACKWARD,
LCHAR,
LCOMPLETE,
2011-09-03 07:49:40 -04:00
LDELETE,
2009-05-13 23:30:20 -04:00
LFIRST,
LFORWARD,
LHISTORY,
LKILL,
LLAST,
LLINE,
LLITERAL,
LNEXT,
LNEXTPAGE,
2010-10-07 16:31:42 -04:00
LPASTE,
2009-05-13 23:30:20 -04:00
LPREV,
LPREVPAGE,
LREJECT,
LWORD,
};
2008-10-13 21:38:03 -04:00
typedef struct Item Item;
struct Item {
char* string;
char* retstring;
Item* next_link;
Item* next;
Item* prev;
int len;
int width;
};
2008-10-14 16:57:48 -04:00
EXTERN struct {
char* string;
char* end;
char* pos;
2009-05-22 23:33:25 -04:00
char* pos_end;
2008-10-14 16:57:48 -04:00
int size;
2009-05-22 23:33:25 -04:00
char* filter;
int filter_start;
2008-10-14 16:57:48 -04:00
} input;
2010-10-07 16:31:41 -04:00
EXTERN struct {
Window* win;
Image* buf;
char* prompt;
int height;
int rows;
bool ontop;
Rectangle itemr;
Point arrow;
} menu;
2008-10-13 21:38:03 -04:00
2010-10-07 16:31:41 -04:00
extern char binding_spec[];
2008-10-13 21:38:03 -04:00
EXTERN IxpServer srv;
2010-10-07 16:31:41 -04:00
EXTERN struct {
Item* all;
Item* first;
Item* start;
Item* end;
Item* sel;
int maxwidth;
} match;
Font* font;
CTuple cnorm;
CTuple csel;
2008-10-13 21:38:03 -04:00
EXTERN Item hist;
2010-10-07 16:31:41 -04:00
EXTERN Item* histsel;
2008-10-13 21:38:03 -04:00
2010-10-07 16:31:41 -04:00
EXTERN int itempad;
2008-10-13 21:38:03 -04:00
EXTERN int result;
2010-10-07 16:31:41 -04:00
EXTERN char* (*find)(const char*, const char*);
EXTERN int (*compare)(const char*, const char*, size_t);
2009-03-29 23:01:07 -04:00