~ubuntu-branches/ubuntu/dapper/newt/dapper

« back to all changes in this revision

Viewing changes to newt_pr.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2005-03-22 12:44:37 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050322124437-nuhl0pqjcijjno9z
Tags: 0.51.6-20ubuntu3
Add Xhosa translation (thanks, Adi Attar).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef H_NEWT_PR
2
 
#define H_NEWT_PR
3
 
 
4
 
#define COLORSET_ROOT           NEWT_COLORSET_ROOT
5
 
#define COLORSET_BORDER         NEWT_COLORSET_BORDER
6
 
#define COLORSET_WINDOW         NEWT_COLORSET_WINDOW
7
 
#define COLORSET_SHADOW         NEWT_COLORSET_SHADOW
8
 
#define COLORSET_TITLE          NEWT_COLORSET_TITLE
9
 
#define COLORSET_BUTTON         NEWT_COLORSET_BUTTON
10
 
#define COLORSET_ACTBUTTON      NEWT_COLORSET_ACTBUTTON
11
 
#define COLORSET_CHECKBOX       NEWT_COLORSET_CHECKBOX
12
 
#define COLORSET_ACTCHECKBOX    NEWT_COLORSET_ACTCHECKBOX
13
 
#define COLORSET_ENTRY          NEWT_COLORSET_ENTRY
14
 
#define COLORSET_LABEL          NEWT_COLORSET_LABEL
15
 
#define COLORSET_LISTBOX        NEWT_COLORSET_LISTBOX
16
 
#define COLORSET_ACTLISTBOX     NEWT_COLORSET_ACTLISTBOX
17
 
#define COLORSET_TEXTBOX        NEWT_COLORSET_TEXTBOX
18
 
#define COLORSET_ACTTEXTBOX     NEWT_COLORSET_ACTTEXTBOX
19
 
 
20
 
int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense);
21
 
 
22
 
void newtGotorc(int row, int col);
23
 
void newtGetrc(int * row, int * col);
24
 
void newtGetWindowPos(int * x, int * y);
25
 
void newtDrawBox(int left, int top, int width, int height, int shadow);
26
 
void newtClearBox(int left, int top, int width, int height);
27
 
 
28
 
int newtGetKey(void);
29
 
 
30
 
struct newtComponent_struct {
31
 
    /* common data */
32
 
    int height, width;
33
 
    int top, left;
34
 
    int takesFocus;
35
 
    int isMapped;
36
 
 
37
 
    struct componentOps * ops;
38
 
 
39
 
    newtCallback callback;
40
 
    void * callbackData;
41
 
 
42
 
    void * data;
43
 
} ;
44
 
 
45
 
enum eventResultTypes { ER_IGNORED, ER_SWALLOWED, ER_EXITFORM, ER_SETFOCUS,
46
 
                        ER_NEXTCOMP };
47
 
struct eventResult {
48
 
    enum eventResultTypes result;
49
 
    union {
50
 
        newtComponent focus;
51
 
    } u;
52
 
};
53
 
 
54
 
enum eventTypes { EV_FOCUS, EV_UNFOCUS, EV_KEYPRESS, EV_MOUSE };
55
 
enum eventSequence { EV_EARLY, EV_NORMAL, EV_LATE };
56
 
 
57
 
struct event {
58
 
    enum eventTypes event;
59
 
    enum eventSequence when;
60
 
    union {
61
 
        int key;
62
 
        struct {
63
 
            enum { MOUSE_MOTION, MOUSE_BUTTON_DOWN, MOUSE_BUTTON_UP } type;
64
 
            int x, y;
65
 
        } mouse;
66
 
    } u;
67
 
} ;
68
 
 
69
 
struct componentOps {
70
 
    void (* draw)(newtComponent c);
71
 
    struct eventResult (* event)(newtComponent c, struct event ev);
72
 
    void (* destroy)(newtComponent c);
73
 
    void (* place)(newtComponent c, int newLeft, int newTop);
74
 
    void (* mapped)(newtComponent c, int isMapped);
75
 
} ;
76
 
 
77
 
void newtDefaultPlaceHandler(newtComponent c, int newLeft, int newTop);
78
 
void newtDefaultMappedHandler(newtComponent c, int isMapped);
79
 
struct eventResult newtDefaultEventHandler(newtComponent c,
80
 
                                           struct event ev);
81
 
 
82
 
/* declare some functions that are defined when UTF8 mode is used 
83
 
  dancer@debian.org */
84
 
#ifdef UTF8
85
 
int strwidth(const char *s);
86
 
#endif
87
 
 
88
 
#endif /* H_NEWT_PR */