commit - 0ccc253b3526237047c81c7a94d2336dab094269
commit + 41aecabbf2e755f521a9101258a6a2d81ec6eea4
blob - 330c0076e2e9b3f4e45ac753f2e7a9ee4d02a7fb
blob + 8db10d9a51c879ea62b0acf30df7fc4f53ef6d9f
--- mymenu.c
+++ mymenu.c
} rgba_t;
/* Return a newly allocated (and empty) completion list */
-struct completions *
+static struct completions *
compls_new(size_t length)
{
struct completions *cs = malloc(sizeof(struct completions));
}
/* Delete the wrapper and the whole list */
-void
+static void
compls_delete(struct completions *cs)
{
if (cs == NULL)
* completions (null terminated). Expects a non-null `cs'. `lines' and
* `vlines' should have the same length OR `vlines' is NULL.
*/
-void
+static void
filter(struct completions *cs, char *text, char **lines, char **vlines)
{
size_t index = 0;
}
/* Update the given completion */
-void
+static void
update_completions(struct completions *cs, char *text, char **lines,
char **vlines, short first_selected)
{
* the new length. If the memory cannot be allocated `status' will be
* set to `ERR'.
*/
-void
+static void
complete(struct completions *cs, short first_selected, short p,
char **text, int *textlen, enum state *status)
{
}
/* Push the character c at the end of the string pointed by p */
-int
+static int
pushc(char **p, int maxlen, char c)
{
int len;
* from just setting the last byte to 0 (in some cases ofc). Return a
* pointer (e) to the last nonzero char. If e < p then p is empty!
*/
-char *
+static char *
popc(char *p)
{
int len = strlen(p);
}
/* Remove the last word plus trailing white spaces from the given string */
-void
+static void
popw(char *w)
{
short in_word = 1;
* If the string is surrounded by quates (`"') remove them and replace
* every `\"' in the string with a single double-quote.
*/
-char *
+static char *
normalize_str(const char *str)
{
int len, p;
return s;
}
-char **
+static char **
readlines(size_t *lineslen)
{
size_t len = 0, cap = 0;
* Compute the dimensions of the string str once rendered.
* It'll return the width and set ret_width and ret_height if not NULL
*/
-int
+static int
text_extents(char *str, int len, struct rendering *r, int *ret_width,
int *ret_height)
{
return width;
}
-void
+static void
draw_string(char *str, int len, int x, int y, struct rendering *r,
enum obj_type tt)
{
}
/* Duplicate the string and substitute every space with a 'n` */
-char *
+static char *
strdupn(char *str)
{
char *t, *dup;
return dup;
}
-int
+static int
draw_v_box(struct rendering *r, int y, char *prefix, int prefix_width,
enum obj_type t, char *text)
{
return ret;
}
-int
+static int
draw_h_box(struct rendering *r, int x, char *prefix, int prefix_width,
enum obj_type t, char *text)
{
* | 20 char text | completion | completion | completion | compl |
* `-----------------------------------------------------------------'
*/
-void
+static void
draw_horizontally(struct rendering *r, char *text, struct completions *cs)
{
size_t i;
* | completion |
* `-----------------------------------------------------------------'
*/
-void
+static void
draw_vertically(struct rendering *r, char *text, struct completions *cs)
{
size_t i;
cs->completions[i].offset = -1;
}
-void
+static void
draw(struct rendering *r, char *text, struct completions *cs)
{
/* Draw the background */
}
/* Set some WM stuff */
-void
+static void
set_win_atoms_hints(Display *d, Window w, int width, int height)
{
Atom type;
}
/* Get the width and height of the window `w' */
-void
+static void
get_wh(Display *d, Window *w, int *width, int *height)
{
XWindowAttributes win_attr;
}
/* find the current xinerama monitor if possible */
-void
+static void
findmonitor(Display *d, int *x, int *y, int *width, int *height)
{
XineramaScreenInfo *info;
XFree(info);
}
-int
+static int
grabfocus(Display *d, Window w)
{
int i;
* to actually grab that goddam keyboard. Only one call to
* XGrabKeyboard does not always end up with the keyboard grabbed!
*/
-int
+static int
take_keyboard(Display *d, Window w)
{
int i;
return 0;
}
-unsigned long
+static unsigned long
parse_color(const char *str, const char *def)
{
size_t len;
/*
* Given a string try to parse it as a number or return `def'.
*/
-int
+static int
parse_integer(const char *str, int def)
{
const char *errstr;
* Like parse_integer but recognize the percentages (i.e. strings
* ending with `%')
*/
-int
+static int
parse_int_with_percentage(const char *str, int default_value, int max)
{
int len = strlen(str);
return parse_integer(str, default_value);
}
-void
+static void
get_mouse_coords(Display *d, int *x, int *y)
{
Window w, root;
* - mx x coordinate of the mouse
* - my y coordinate of the mouse
*/
-int
+static int
parse_int_with_pos(Display *d, const char *str, int default_value, int max,
int self)
{
/* Parse a string like a CSS value. */
/* TODO: harden a bit this function */
-int
+static int
parse_csslike(const char *str, char **ret)
{
int i, j;
* return value is ADD_CHAR then `input' is a pointer to a string that
* will need to be free'ed later.
*/
-enum action
+static enum action
parse_event(Display *d, XKeyPressedEvent *ev, XIC xic, char **input)
{
char str[SYM_BUF_SIZE] = { 0 };
return ADD_CHAR;
}
-void
+static void
confirm(enum state *status, struct rendering *r, struct completions *cs,
char **text, int *textlen)
{
* first: the first (rendered) item
* def: the default action
*/
-enum action
+static enum action
select_clicked(struct completions *cs, size_t offset, size_t first,
enum action def)
{
return def;
}
-enum action
+static enum action
handle_mouse(struct rendering *r, struct completions *cs,
XButtonPressedEvent *e)
{
}
/* event loop */
-enum state
+static enum state
loop(struct rendering *r, char **text, int *textlen, struct completions *cs,
char **lines, char **vlines)
{
return status;
}
-int
+static int
load_font(struct rendering *r, const char *fontname)
{
r->font = XftFontOpenName(r->d, DefaultScreen(r->d), fontname);
return 0;
}
-void
+static void
xim_init(struct rendering *r, XrmDatabase *xdb)
{
XIMStyle best_match_style;
err(1, "XCreateIC");
}
-void
+static void
create_window(struct rendering *r, Window parent_window, Colormap cmap,
XVisualInfo vinfo, int x, int y, int ox, int oy,
unsigned long background_pixel)
vinfo.depth, InputOutput, vinfo.visual, vmask, &attr);
}
-void
+static void
ps1extents(struct rendering *r)
{
char *dup;
free(dup);
}
-void
+static void
usage(char *prgname)
{
fprintf(stderr,