ELinks 0.18.0
Macros | Functions | Variables
inpfield.c File Reference
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bfu/button.h"
#include "bfu/dialog.h"
#include "bfu/inpfield.h"
#include "bfu/inphist.h"
#include "bfu/msgbox.h"
#include "bfu/text.h"
#include "config/kbdbind.h"
#include "intl/charsets.h"
#include "intl/libintl.h"
#include "osdep/osdep.h"
#include "session/session.h"
#include "terminal/draw.h"
#include "terminal/kbd.h"
#include "terminal/mouse.h"
#include "terminal/terminal.h"
#include "terminal/window.h"
#include "util/color.h"
#include "util/memlist.h"
#include "util/memory.h"
Include dependency graph for inpfield.c:

Macros

#define INPUTFIELD_HEIGHT   1
 
#define INPUTFIELD_FLOATLABEL_PADDING   1
 
#define INPUTFIELD_FLOAT_SEPARATOR   ":"
 
#define INPUTFIELD_FLOAT_SEPARATOR_LEN   1
 
#define INPUT_WIDGETS_COUNT   3
 
#define INPUT_WIDGETS_COUNT   3
 

Functions

void add_dlg_field_do (struct dialog *dlg, enum widget_type type, char *label, int min, int max, widget_handler_T *handler, int datalen, void *data, struct input_history *history, enum inpfield_flags flags)
 
widget_handler_status_T check_number (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
widget_handler_status_T check_nonempty (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
void dlg_format_field (struct dialog_data *dlg_data, struct widget_data *widget_data, int x, int *y, int w, int *rw, format_align_T align, int format_only)
 
static widget_handler_status_T input_field_cancel (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
static widget_handler_status_T input_field_ok (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
void input_field (struct terminal *term, struct memory_list *ml, int intl, char *title, char *text, char *okbutton, char *cancelbutton, void *data, struct input_history *history, int l, const char *def, int min, int max, widget_handler_T *check, void(*fn)(void *, char *), void(*cancelfn)(void *))
 
static void password_field (struct terminal *term, struct memory_list *ml, int intl, char *title, char *text, char *okbutton, char *cancelbutton, void *data, struct input_history *history, int l, const char *def, int min, int max, widget_handler_T *check, void(*fn)(void *, char *), void(*cancelfn)(void *))
 
void input_dialog (struct terminal *term, struct memory_list *ml, char *title, char *text, void *data, struct input_history *history, int l, const char *def, int min, int max, widget_handler_T *check, void(*fn)(void *, char *), void(*cancelfn)(void *))
 
void password_dialog (struct terminal *term, struct memory_list *ml, char *title, char *text, void *data, struct input_history *history, int l, const char *def, int min, int max, widget_handler_T *check, void(*fn)(void *, char *), void(*cancelfn)(void *))
 
static widget_handler_status_T display_field_do (struct dialog_data *dlg_data, struct widget_data *widget_data, int hide)
 
static widget_handler_status_T display_field (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
static widget_handler_status_T display_field_pass (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
static widget_handler_status_T init_field (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
static int field_prev_history (struct widget_data *widget_data)
 
static int field_next_history (struct widget_data *widget_data)
 
static widget_handler_status_T mouse_field (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
static widget_handler_status_T kbd_field (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
static widget_handler_status_T clear_field (struct dialog_data *dlg_data, struct widget_data *widget_data)
 
static void input_line_layouter (struct dialog_data *dlg_data)
 
static widget_handler_status_T input_line_event_handler (struct dialog_data *dlg_data)
 
void input_field_line (struct session *ses, char *prompt, void *data, struct input_history *history, input_line_handler_T handler)
 

Variables

const struct widget_ops field_ops
 
const struct widget_ops field_pass_ops
 

Macro Definition Documentation

◆ INPUT_WIDGETS_COUNT [1/2]

#define INPUT_WIDGETS_COUNT   3

◆ INPUT_WIDGETS_COUNT [2/2]

#define INPUT_WIDGETS_COUNT   3

◆ INPUTFIELD_FLOAT_SEPARATOR

#define INPUTFIELD_FLOAT_SEPARATOR   ":"

◆ INPUTFIELD_FLOAT_SEPARATOR_LEN

#define INPUTFIELD_FLOAT_SEPARATOR_LEN   1

◆ INPUTFIELD_FLOATLABEL_PADDING

#define INPUTFIELD_FLOATLABEL_PADDING   1

◆ INPUTFIELD_HEIGHT

#define INPUTFIELD_HEIGHT   1

Function Documentation

◆ add_dlg_field_do()

void add_dlg_field_do ( struct dialog *  dlg,
enum widget_type  type,
char *  label,
int  min,
int  max,
widget_handler_T *  handler,
int  datalen,
void *  data,
struct input_history *  history,
enum inpfield_flags  flags 
)

◆ check_nonempty()

widget_handler_status_T check_nonempty ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)

◆ check_number()

widget_handler_status_T check_number ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)

◆ clear_field()

static widget_handler_status_T clear_field ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ display_field()

static widget_handler_status_T display_field ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ display_field_do()

static widget_handler_status_T display_field_do ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data,
int  hide 
)
static

◆ display_field_pass()

static widget_handler_status_T display_field_pass ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ dlg_format_field()

void dlg_format_field ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data,
int  x,
int *  y,
int  w,
int *  rw,
format_align_T  align,
int  format_only 
)

◆ field_next_history()

static int field_next_history ( struct widget_data *  widget_data)
static

◆ field_prev_history()

static int field_prev_history ( struct widget_data *  widget_data)
static

◆ init_field()

static widget_handler_status_T init_field ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ input_dialog()

void input_dialog ( struct terminal *  term,
struct memory_list *  ml,
char *  title,
char *  text,
void *  data,
struct input_history *  history,
int  l,
const char *  def,
int  min,
int  max,
widget_handler_T *  check,
void(*)(void *, char *)  fn,
void(*)(void *)  cancelfn 
)

◆ input_field()

void input_field ( struct terminal *  term,
struct memory_list *  ml,
int  intl,
char *  title,
char *  text,
char *  okbutton,
char *  cancelbutton,
void *  data,
struct input_history *  history,
int  l,
const char *  def,
int  min,
int  max,
widget_handler_T *  check,
void(*)(void *, char *)  fn,
void(*)(void *)  cancelfn 
)

◆ input_field_cancel()

static widget_handler_status_T input_field_cancel ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ input_field_line()

void input_field_line ( struct session *  ses,
char *  prompt,
void *  data,
struct input_history *  history,
input_line_handler_T  handler 
)

◆ input_field_ok()

static widget_handler_status_T input_field_ok ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ input_line_event_handler()

static widget_handler_status_T input_line_event_handler ( struct dialog_data *  dlg_data)
static

◆ input_line_layouter()

static void input_line_layouter ( struct dialog_data *  dlg_data)
static

◆ kbd_field()

static widget_handler_status_T kbd_field ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ mouse_field()

static widget_handler_status_T mouse_field ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)
static

◆ password_dialog()

void password_dialog ( struct terminal *  term,
struct memory_list *  ml,
char *  title,
char *  text,
void *  data,
struct input_history *  history,
int  l,
const char *  def,
int  min,
int  max,
widget_handler_T *  check,
void(*)(void *, char *)  fn,
void(*)(void *)  cancelfn 
)

◆ password_field()

static void password_field ( struct terminal *  term,
struct memory_list *  ml,
int  intl,
char *  title,
char *  text,
char *  okbutton,
char *  cancelbutton,
void *  data,
struct input_history *  history,
int  l,
const char *  def,
int  min,
int  max,
widget_handler_T *  check,
void(*)(void *, char *)  fn,
void(*)(void *)  cancelfn 
)
static

Variable Documentation

◆ field_ops

const struct widget_ops field_ops
Initial value:
= {
}
#define NULL
Definition explodename.c:35
static widget_handler_status_T kbd_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
Definition inpfield.c:513
static widget_handler_status_T clear_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
Definition inpfield.c:796
static widget_handler_status_T init_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
Definition inpfield.c:428
static widget_handler_status_T mouse_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
Definition inpfield.c:475
static widget_handler_status_T display_field(struct dialog_data *dlg_data, struct widget_data *widget_data)
Definition inpfield.c:416

◆ field_pass_ops

const struct widget_ops field_pass_ops
Initial value:
= {
}
static widget_handler_status_T display_field_pass(struct dialog_data *dlg_data, struct widget_data *widget_data)
Definition inpfield.c:422