wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

dat.h (1358B)


      1 #define _XOPEN_SOURCE 600
      2 #define IXP_P9_STRUCTS
      3 #define IXP_NO_P9_
      4 #include <fmt.h>
      5 #include <stdarg.h>
      6 #include <stdbool.h>
      7 #include <stdlib.h>
      8 #include <string.h>
      9 #include <unistd.h>
     10 #include <ixp.h>
     11 #include <stuff/x.h>
     12 #include <stuff/util.h>
     13 
     14 #ifndef EXTERN
     15 # define EXTERN extern
     16 #endif
     17 
     18 enum {
     19 	FORWARD,
     20 	BACKWARD,
     21 	LINE,
     22 	WORD,
     23 	CHAR,
     24 	CARET_LAST,
     25 };
     26 
     27 enum {
     28 	LACCEPT,
     29 	LBACKWARD,
     30 	LCHAR,
     31 	LCOMPLETE,
     32 	LDELETE,
     33 	LFIRST,
     34 	LFORWARD,
     35 	LHISTORY,
     36 	LKILL,
     37 	LLAST,
     38 	LLINE,
     39 	LLITERAL,
     40 	LNEXT,
     41 	LNEXTPAGE,
     42 	LPASTE,
     43 	LPREV,
     44 	LPREVPAGE,
     45 	LREJECT,
     46 	LWORD,
     47 };
     48 
     49 typedef struct Item	Item;
     50 
     51 struct Item {
     52 	char*	string;
     53 	char*	retstring;
     54 	Item*	next_link;
     55 	Item*	next;
     56 	Item*	prev;
     57 	int	len;
     58 	int	width;
     59 };
     60 
     61 EXTERN struct {
     62 	char*	string;
     63 	char*	end;
     64 	char*	pos;
     65 	char*	pos_end;
     66 	int	size;
     67 
     68 	char*	filter;
     69 	int	filter_start;
     70 } input;
     71 
     72 EXTERN struct {
     73 	Window*		win;
     74 	Image*		buf;
     75 	char*		prompt;
     76 	int		height;
     77 	int		rows;
     78 	bool		ontop;
     79 	Rectangle	itemr;
     80 	Point		arrow;
     81 } menu;
     82 
     83 extern char	binding_spec[];
     84 
     85 EXTERN IxpServer	srv;
     86 
     87 EXTERN struct {
     88 	Item*	all;
     89 	Item*	first;
     90 	Item*	start;
     91 	Item*	end;
     92 	Item*	sel;
     93 	int	maxwidth;
     94 } match;
     95 
     96 Font*		font;
     97 CTuple		cnorm;
     98 CTuple		csel;
     99 
    100 EXTERN Item	hist;
    101 EXTERN Item*	histsel;
    102 
    103 EXTERN int	itempad;
    104 EXTERN int	result;
    105 
    106 EXTERN char*	(*find)(const char*, const char*);
    107 EXTERN int	(*compare)(const char*, const char*, size_t);
    108