source: neercs/trunk/src/widgets.h @ 4048

Last change on this file since 4048 was 4048, checked in by Jean-Yves Lamoureux, 11 years ago
  • Created widgets.[c,h] and an unfinished (but working) input box
  • Python interpreter now uses generic input box code
File size: 1.3 KB
Line 
1/*
2 *  neercs        console-based window manager
3 *  Copyright (c) 2009 Jean-Yves Lamoureux <jylam@lnxscene.org>
4 *                All Rights Reserved
5 *
6 *  $Id: widget.h 3939 2009-11-18 14:40:39Z jylam $
7 *
8 *  This program is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15#include "config.h"
16
17#include <stdio.h>
18#include <string.h>
19#include <stdlib.h>
20#include <sys/types.h>
21
22#include <caca.h>
23
24
25enum input_box_code
26{
27    INPUT_BOX_ESC,
28    INPUT_BOX_RET,   
29        INPUT_BOX_NOTHING,
30};
31
32struct input_box
33{
34    caca_canvas_t *cv;
35    int x, y;
36    int w, h;
37    int size;
38    char *command;
39    char *output_err;
40    char *output_res;
41};
42
43struct input_box *widget_ibox_init(caca_canvas_t * cv, int w, int h);
44int widget_ibox_draw(struct input_box *box);
45int widget_ibox_handle_key(struct input_box *box, unsigned int c);
46char* widget_ibox_get_text(struct input_box *box);
47void widget_ibox_destroy(struct input_box *box);
48void widget_ibox_set_error(struct input_box *box, char *err);
49void widget_ibox_set_msg(struct input_box *box, char *msg);
Note: See TracBrowser for help on using the repository browser.