Subversion Repositories Kolibri OS

Rev

Rev 6479 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6479 Rev 6612
Line 3... Line 3...
3
 
3
 
Line 4... Line 4...
4
#include "kolibri_colors.h"
4
#include "kolibri_colors.h"
5
 
5
 
6
/*  flags meaning
6
/*  flags meaning
7
ed_figure_only= 1000000000000000b   ;îäíè ñèìâîëû
7
ed_figure_only= 1000000000000000b   ;îäíè ñèìâîëû
8
ed_always_focus= 100000000000000b
8
ed_always_focus= 100000000000000b   // âñåãäà ñ êóðñîðîì (ôîêóñîì)
9
ed_focus=                     10b   ;ôîêóñ ââîäà ïðèëîæåíèÿ
9
ed_focus=                     10b   ;ôîêóñ ââîäà ïðèëîæåíèÿ, ìûøèòñÿ ñàìîñòîÿòåëüíî
10
ed_pass=                       1b   ;ïîëå ñ ïàðîëåì
10
ed_pass=                       1b   ;ïîëå ñ ïàðîëåì
11
ed_shift_on=                1000b   ;åñëè íå óñòàíîâëåí -çíà÷èò âïåðâûå íàæàò shift,åñëè áûë óñòàíîâëåí, çíà÷èò ìû óæå ÷òî - òî äåëàëè óäåðæèâàÿ shift
11
ed_shift_on=                1000b   ;åñëè íå óñòàíîâëåí -çíà÷èò âïåðâûå íàæàò shift,åñëè áûë óñòàíîâëåí, çíà÷èò ìû óæå ÷òî - òî äåëàëè óäåðæèâàÿ shift
12
ed_shift_on_off=1111111111110111b
12
ed_shift_on_off=1111111111110111b
Line 42... Line 42...
42
    unsigned int focus_border_color;
42
    unsigned int focus_border_color;
43
    unsigned int blur_border_color;
43
    unsigned int blur_border_color;
44
    unsigned int text_color;
44
    unsigned int text_color;
45
    unsigned int max;
45
    unsigned int max;
46
    char *text;
46
    char        *text;
47
    struct edit_box_t** mouse_variable; // must be pointer edit_box** to save focused editbox
47
    void        *mouse_variable; // must be pointer edit_box** to save focused editbox
48
    unsigned int flags;
48
    unsigned int flags;
Line 49... Line 49...
49
 
49
 
50
    unsigned int size;  // used symbols in buffer without trailing zero
50
    unsigned int size;  // used symbols in buffer without trailing zero
51
    unsigned int pos;  // cursor position
51
    unsigned int pos;  // cursor position
Line 70... Line 70...
70
 
70
 
71
   tlx,tly = Coordinates of the beginning of the edit box.
71
   tlx,tly = Coordinates of the beginning of the edit box.
72
   max_chars = Limit of number of characters user can enter into edit box.
72
   max_chars = Limit of number of characters user can enter into edit box.
Line 73... Line 73...
73
*/
73
*/
74
 
74
 
75
edit_box* kolibri_new_edit_box(unsigned int tlx, unsigned int tly, unsigned int max_chars, edit_box **editbox_interlock)
75
edit_box* kolibri_new_edit_box(unsigned int tlx, unsigned int tly, unsigned int max_chars, void *editbox_interlock)
76
{
76
{
77
    unsigned int PIXELS_PER_CHAR = 7;
77
    unsigned int PIXELS_PER_CHAR = 7;
Line 97... Line 97...
97
    return new_textbox;
97
    return new_textbox;
98
}
98
}
Line 99... Line 99...
99
 
99
 
Line -... Line 100...
-
 
100
extern void (*edit_box_draw)(edit_box *) __attribute__((__stdcall__));
100
extern void (*edit_box_draw)(edit_box *) __attribute__((__stdcall__));
101
 
101
 
102
extern void (*edit_box_key)(edit_box *) __attribute__((__stdcall__));
102
/* editbox_key is a wrapper written in assembly to handle key press events for editboxes */
103
/* editbox_key is a wrapper written in assembly to handle key press events for editboxes */
103
/* because inline assembly in GCC is a PITA and interferes with the EAX (AH) register */
104
/* because inline assembly in GCC is a PITA and interferes with the EAX (AH) register */
-
 
105
/* which edit_box_key requires */
-
 
106
__attribute__((__stdcall__)) void editbox_key(edit_box *e, oskey_t ch)
-
 
107
/// åñëè flags íå ñîäåðæèò ed_focus, èãíîðèðóåò ââîä
-
 
108
/// åñëè flags ñîäåðæèò ed_mouse_on èëè ed_disabled, èãíîðèðóåò ââîä
-
 
109
/// íà ââîäå îæèäàåò ch - êîä êëàâèøè, òîëüêî â ðåæèìå ASCII
-
 
110
{
-
 
111
    __asm__ __volatile__ (
-
 
112
             "push %2\n\t"
Line 104... Line 113...
104
/* which edit_box_key requires */
113
             "call *%1 \n\t"::"a"(ch.val), "m"(edit_box_key), "m"(e):);
-
 
114
}
-
 
115
 
-
 
116
extern void (*edit_box_mouse)(edit_box *) __attribute__((__stdcall__));
105
extern void editbox_key(edit_box *) __attribute__((__stdcall__));
117
/// ïðè ùåë÷êå íå ëåâîé êíîïêîé, îáíóëÿåò *mouse_variable! è ñáðàñûâàåò ôëàã ed_mouse_on
106
 
118
 
107
extern void (*edit_box_mouse)(edit_box *) __attribute__((__stdcall__));
119