~ubuntu-branches/debian/squeeze/alpine/squeeze

« back to all changes in this revision

Viewing changes to alpine/radio.h

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: radio.h 136 2006-09-22 20:06:05Z hubert@u.washington.edu $
 
3
 *
 
4
 * ========================================================================
 
5
 * Copyright 2006 University of Washington
 
6
 *
 
7
 * Licensed under the Apache License, Version 2.0 (the "License");
 
8
 * you may not use this file except in compliance with the License.
 
9
 * You may obtain a copy of the License at
 
10
 *
 
11
 *     http://www.apache.org/licenses/LICENSE-2.0
 
12
 *
 
13
 * ========================================================================
 
14
 */
 
15
 
 
16
#ifndef PINE_RADIO_INCLUDED
 
17
#define PINE_RADIO_INCLUDED
 
18
 
 
19
#include "../pith/helptext.h"
 
20
 
 
21
#include "help.h"
 
22
 
 
23
 
 
24
/* 
 
25
 * For optionally_enter and radio_buttons, special meanings for keys.
 
26
 */
 
27
typedef struct esckey {
 
28
    long ch;                    /* holds all UCS values plus -1 and -2 */
 
29
    int  rval;                  /* return value                        */
 
30
    char *name;                 /* short name                          */
 
31
    char *label;                /* long descriptive key name           */
 
32
} ESCKEY_S;
 
33
 
 
34
 
 
35
/*
 
36
 * Minimum space needed after the prompt for optionally_enter() to work well.
 
37
 * If the available width after the prompt is smaller than this then the prompt will
 
38
 * have the leading edge cut off by optionally_enter.
 
39
 * (note: used to be 5)
 
40
 */
 
41
#define MIN_OPT_ENT_WIDTH (7)
 
42
 
 
43
/* max length prompt for optionally_enter and want_to */
 
44
#define MAXPROMPT       (ps_global->ttyo->screen_cols - MIN_OPT_ENT_WIDTH)
 
45
 
 
46
 
 
47
#define SEQ_EXCEPTION   (-3)            /* returned when seq # change and no
 
48
                                           on_ctrl_C available.          */
 
49
#define RB_NORM         0x00            /* flags modifying radio_buttons */
 
50
#define RB_ONE_TRY      0x01            /* one shot answer, else default */
 
51
#define RB_FLUSH_IN     0x02            /* discard pending input         */
 
52
#define RB_NO_NEWMAIL   0x04            /* Quell new mail check          */
 
53
#define RB_SEQ_SENSITIVE 0x08           /* Sensitive to seq # changes    */
 
54
#define RB_RET_HELP     0x10            /* Return when help key pressed  */
 
55
 
 
56
 
 
57
#define OE_NONE                 0x00    /* optionally_enter flags       */
 
58
#define OE_DISALLOW_CANCEL      0x01    /* Turn off Cancel menu item    */
 
59
#define OE_DISALLOW_HELP        0x02    /* Turn off Help menu item      */
 
60
#define OE_USER_MODIFIED        0x08    /* set on return if user input  */
 
61
#define OE_KEEP_TRAILING_SPACE  0x10    /* Allow trailing white-space   */
 
62
#define OE_SEQ_SENSITIVE        0x20    /* Sensitive to seq # changes   */
 
63
#define OE_APPEND_CURRENT       0x40    /* append, don't truncate       */
 
64
#define OE_PASSWD               0x80    /* Don't echo user input        */
 
65
 
 
66
#define WT_NORM          0x00           /* flags modifying want_to       */
 
67
#define WT_FLUSH_IN      0x01           /* discard pending input         */
 
68
#define WT_SEQ_SENSITIVE 0x02           /* Sensitive to seq # changes  */
 
69
 
 
70
 
 
71
/* exported protoypes */
 
72
int     want_to(char *, int, int, HelpType, int);
 
73
int     one_try_want_to(char *, int, int, HelpType, int);
 
74
int     radio_buttons(char *, int, ESCKEY_S *, int, int, HelpType, int);
 
75
int     double_radio_buttons(char *, int, ESCKEY_S *, int, int, HelpType, int);
 
76
                                        
 
77
 
 
78
 
 
79
#endif /* PINE_RADIO_INCLUDED */