Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
dialog.h File Reference
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <libintl.h>

Go to the source code of this file.

Data Structures

struct  dialog_color
 
struct  dialog_info
 
struct  dialog_item
 
struct  dialog_list
 

Macros

#define OLD_NCURSES   0
 
#define TR(params)   _tracef params
 
#define KEY_ESC   27
 
#define TAB   9
 
#define MAX_LEN   2048
 
#define BUF_SIZE   (10*1024)
 
#define MIN(x, y)   (x < y ? x : y)
 
#define MAX(x, y)   (x > y ? x : y)
 
#define ACS_ULCORNER   '+'
 
#define ACS_LLCORNER   '+'
 
#define ACS_URCORNER   '+'
 
#define ACS_LRCORNER   '+'
 
#define ACS_HLINE   '-'
 
#define ACS_VLINE   '|'
 
#define ACS_LTEE   '+'
 
#define ACS_RTEE   '+'
 
#define ACS_UARROW   '^'
 
#define ACS_DARROW   'v'
 
#define ERRDISPLAYTOOSMALL   (KEY_MAX + 1)
 
#define MAXITEMSTR   200
 
#define item_foreach()
 
#define M_EVENT   (KEY_MAX+1)
 

Typedefs

typedef void(* update_text_fn )(char *buf, size_t start, size_t end, void *_data)
 

Functions

void item_reset (void)
 
void item_make (const char *fmt,...)
 
void item_add_str (const char *fmt,...)
 
void item_set_tag (char tag)
 
void item_set_data (void *p)
 
void item_set_selected (int val)
 
int item_activate_selected (void)
 
voiditem_data (void)
 
char item_tag (void)
 
int item_count (void)
 
void item_set (int n)
 
int item_n (void)
 
const charitem_str (void)
 
int item_is_selected (void)
 
int item_is_tag (char tag)
 
int on_key_esc (WINDOW *win)
 
int on_key_resize (void)
 
int init_dialog (const char *backtitle)
 
void set_dialog_backtitle (const char *backtitle)
 
void end_dialog (int x, int y)
 
void attr_clear (WINDOW *win, int height, int width, chtype attr)
 
void dialog_clear (void)
 
void print_autowrap (WINDOW *win, const char *prompt, int width, int y, int x)
 
void print_button (WINDOW *win, const char *label, int y, int x, int selected)
 
void print_title (WINDOW *dialog, const char *title, int width)
 
void draw_box (WINDOW *win, int y, int x, int height, int width, chtype box, chtype border)
 
void draw_shadow (WINDOW *win, int y, int x, int height, int width)
 
int first_alpha (const char *string, const char *exempt)
 
int dialog_yesno (const char *title, const char *prompt, int height, int width)
 
int dialog_msgbox (const char *title, const char *prompt, int height, int width, int pause)
 
int dialog_textbox (const char *title, char *tbuf, int initial_height, int initial_width, int *keys, int *_vscroll, int *_hscroll, update_text_fn update_text, void *data)
 
int dialog_menu (const char *title, const char *prompt, const void *selected, int *s_scroll)
 
int dialog_checklist (const char *title, const char *prompt, int height, int width, int list_height)
 
int dialog_inputbox (const char *title, const char *prompt, int height, int width, const char *init)
 

Variables

struct dialog_info dlg
 
char dialog_input_result []
 
int saved_x
 
int saved_y
 
struct dialog_listitem_cur
 
struct dialog_list item_nil
 
struct dialog_listitem_head
 

Macro Definition Documentation

#define ACS_DARROW   'v'

Definition at line 93 of file dialog.h.

#define ACS_HLINE   '-'

Definition at line 78 of file dialog.h.

#define ACS_LLCORNER   '+'

Definition at line 69 of file dialog.h.

#define ACS_LRCORNER   '+'

Definition at line 75 of file dialog.h.

#define ACS_LTEE   '+'

Definition at line 84 of file dialog.h.

#define ACS_RTEE   '+'

Definition at line 87 of file dialog.h.

#define ACS_UARROW   '^'

Definition at line 90 of file dialog.h.

#define ACS_ULCORNER   '+'

Definition at line 66 of file dialog.h.

#define ACS_URCORNER   '+'

Definition at line 72 of file dialog.h.

#define ACS_VLINE   '|'

Definition at line 81 of file dialog.h.

#define BUF_SIZE   (10*1024)

Definition at line 61 of file dialog.h.

#define ERRDISPLAYTOOSMALL   (KEY_MAX + 1)

Definition at line 97 of file dialog.h.

#define item_foreach ( )
Value:
item_cur && (item_cur != &item_nil); item_cur = item_cur->next)

Definition at line 189 of file dialog.h.

#define KEY_ESC   27

Definition at line 58 of file dialog.h.

#define M_EVENT   (KEY_MAX+1)

Definition at line 237 of file dialog.h.

#define MAX (   x,
  y 
)    (x > y ? x : y)

Definition at line 63 of file dialog.h.

#define MAX_LEN   2048

Definition at line 60 of file dialog.h.

#define MAXITEMSTR   200

Definition at line 165 of file dialog.h.

#define MIN (   x,
  y 
)    (x < y ? x : y)

Definition at line 62 of file dialog.h.

#define OLD_NCURSES   0

Definition at line 53 of file dialog.h.

#define TAB   9

Definition at line 59 of file dialog.h.

#define TR (   params)    _tracef params

Definition at line 56 of file dialog.h.

Typedef Documentation

typedef void(* update_text_fn)(char *buf, size_t start, size_t end, void *_data)

Definition at line 215 of file dialog.h.

Function Documentation

void attr_clear ( WINDOW win,
int  height,
int  width,
chtype  attr 
)

Definition at line 242 of file util.c.

int dialog_checklist ( const char title,
const char prompt,
int  height,
int  width,
int  list_height 
)

Definition at line 117 of file checklist.c.

void dialog_clear ( void  )

Definition at line 255 of file util.c.

int dialog_inputbox ( const char title,
const char prompt,
int  height,
int  width,
const char init 
)

Definition at line 44 of file inputbox.c.

int dialog_menu ( const char title,
const char prompt,
const void selected,
int s_scroll 
)

Definition at line 182 of file menubox.c.

int dialog_msgbox ( const char title,
const char prompt,
int  height,
int  width,
int  pause 
)
int dialog_textbox ( const char title,
char tbuf,
int  initial_height,
int  initial_width,
int keys,
int _vscroll,
int _hscroll,
update_text_fn  update_text,
void data 
)

Definition at line 56 of file textbox.c.

int dialog_yesno ( const char title,
const char prompt,
int  height,
int  width 
)

Definition at line 42 of file yesno.c.

void draw_box ( WINDOW win,
int  y,
int  x,
int  height,
int  width,
chtype  box,
chtype  border 
)

Definition at line 428 of file util.c.

void draw_shadow ( WINDOW win,
int  y,
int  x,
int  height,
int  width 
)

Definition at line 462 of file util.c.

void end_dialog ( int  x,
int  y 
)

Definition at line 308 of file util.c.

int first_alpha ( const char string,
const char exempt 
)

Definition at line 483 of file util.c.

int init_dialog ( const char backtitle)

Definition at line 274 of file util.c.

int item_activate_selected ( void  )

Definition at line 602 of file util.c.

void item_add_str ( const char fmt,
  ... 
)

Definition at line 574 of file util.c.

int item_count ( void  )

Definition at line 620 of file util.c.

void* item_data ( void  )

Definition at line 610 of file util.c.

int item_is_selected ( void  )

Definition at line 656 of file util.c.

int item_is_tag ( char  tag)

Definition at line 661 of file util.c.

void item_make ( const char fmt,
  ... 
)

Definition at line 557 of file util.c.

int item_n ( void  )

Definition at line 638 of file util.c.

void item_reset ( void  )

Definition at line 545 of file util.c.

void item_set ( int  n)

Definition at line 630 of file util.c.

void item_set_data ( void p)

Definition at line 592 of file util.c.

void item_set_selected ( int  val)

Definition at line 597 of file util.c.

void item_set_tag ( char  tag)

Definition at line 588 of file util.c.

const char* item_str ( void  )

Definition at line 651 of file util.c.

char item_tag ( void  )

Definition at line 615 of file util.c.

int on_key_esc ( WINDOW win)

Definition at line 511 of file util.c.

int on_key_resize ( void  )

Definition at line 535 of file util.c.

void print_autowrap ( WINDOW win,
const char prompt,
int  width,
int  y,
int  x 
)

Definition at line 336 of file util.c.

void print_button ( WINDOW win,
const char label,
int  y,
int  x,
int  selected 
)

Definition at line 398 of file util.c.

void print_title ( WINDOW dialog,
const char title,
int  width 
)

Definition at line 319 of file util.c.

void set_dialog_backtitle ( const char backtitle)

Definition at line 300 of file util.c.

Variable Documentation

char dialog_input_result

Definition at line 224 of file dialog.h.

Definition at line 29 of file util.c.

struct dialog_list* item_cur

Definition at line 541 of file util.c.

Definition at line 543 of file util.c.

struct dialog_list item_nil

Definition at line 542 of file util.c.

int saved_x

Definition at line 27 of file util.c.

int saved_y

Definition at line 27 of file util.c.