Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 7577 → Rev 7579

/contrib/C_Layer/ASM/loadboxlib.asm
119,6 → 119,7
ted_but_find, 'ted_but_find' , \
ted_but_replace, 'ted_but_replace' , \
ted_text_colored, 'ted_text_colored' , \
ted_go_to_position, 'ted_go_to_position' , \
frame_draw, 'frame_draw' , \
progressbar_draw,'progressbar_draw' , \
progressbar_progress, 'progressbar_progress'
186,6 → 187,7
public ted_but_find as '_ted_but_find'
public ted_but_replace as '_ted_but_replace'
public ted_text_colored as 'ted_text_colored_asm'
public ted_go_to_position as '_ted_go_to_position'
 
public tl_data_init as '_tl_data_init'
public tl_data_clear as '_tl_data_clear'
/contrib/C_Layer/INCLUDE/kolibri_editor.h
77,16 → 77,16
uint8_t mode_color; // 1 ðåæèì âûäåëåíèÿ ñëîâ öâåòîì (0-âûêë. 1-âêë.)
uint8_t mode_invis; // 0 ðåæèì ïîêàçà íåïå÷àòàåìûõ ñèìâîëîâ
uint8_t gp_opt; // 0 îïöèè âîçâðàùàåìûå ôóíêöèåé ted_get_pos_by_cursor
editor_callback fun_on_key_ctrl_o; // óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè íàæàòèè Ctrl+O (îòêðûòèå ôàéëà), can be NULL
editor_callback fun_on_key_ctrl_f; // ... Ctrl+F (âûçîâà/ñêðûòèÿ ïàíåëè ïîèñêà)
editor_callback fun_on_key_ctrl_n; // ... Ctrl+N (ñîçäàíèå íîâîãî äîêóìåíòà)
editor_callback fun_on_key_ctrl_s; // ... Ctrl+S
editor_callback fun_on_key_ctrl_all; // óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè íàæàòèè Ctrl+N,O,S,F,G,H, can be NULL
uint32_t reserved_1; // ...
uint32_t reserved_2; // ...
uint32_t reserved_3; // ...
uint32_t buffer_size;// BUF_SIZE ðàçìåð áóôåðà êîïèðîâàíèÿ/âñòàâêè
editor_callback fun_find_err; // óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ïîèñê çàêîí÷èëñÿ íåóäà÷íî
editor_callback fun_init_synt_err; // unused óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ ïðè îøèáî÷íîì îòêðûòèè ôàéëà ñèíòàêñèñà
editor_callback fun_draw_panel_buttons; // óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ñ êíîïêàìè
editor_callback fun_draw_panel_find; // óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ïîèñêà
editor_callback fun_draw_panel_syntax; // óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ñèíòàêñèñà
editor_callback fun_draw_panels; // óêàçàòåëü íà ôóíêöèþ ðèñîâàíèÿ ïàíåëè ïîèñêà|çàìåíû|ïåðåõîäà|ñèíòàêñèñà
uint32_t reserved_4; // ...
editor_callback fun_save_err; // óêàçàòåëü íà ôóíêöèþ âûçûâàåìóþ åñëè ñîõðàíåíèå ôàéëà çàêîí÷èëîñü íåóäà÷íî
uint32_t increase_size; //200 ÷èñëî ñèìâîëîâ íà êîòîðûå áóäåò óâå÷èâàòüñÿ ïàìÿòü ïðè íåõâàòêå
void *ptr_free_symb; // èñïîëüçóåòñÿ âíóòðè ýëåìåíòà äëÿ óñêîðåíèÿ âñòàâêè òåêñòà
145,19 → 145,19
extern void (*ted_init_scroll_bars)(editor *, int opt) __attribute__((__stdcall__));
/// opt bits = 1 - ìåíÿòü öâåò ñêðîëëèíãîâ, 2 - èçìåíèëèñü ðàçìåðû îêíà, 4 - èçìåíèëèñü ðàçìåðû äîêóìåíòà
extern void (*ted_init_syntax_file)(editor *) __attribute__((__stdcall__));
extern void (*ted_mouse)(editor *) __attribute__((__stdcall__));
extern void (*ted_mouse)(editor *) __attribute__((__stdcall__));
extern void (*ted_text_add)(editor *, char *text, int textlen, int opt) __attribute__((__stdcall__));
/// add text to cursor pos
/// opt == ted_opt_ed_change_time, ted_opt_ed_move_cursor
///ted_opt_ed_move_cursor equ 1 ;äâèãàòü êóðñîð ïîñëå äîáàâëåíèÿ òåêñòà
///ted_opt_ed_change_time equ 2 ;äîáàâëÿòü èçìåíåíèÿ ïðè ðåäàêòèðîâàíèè òåêñòà
extern void (*ted_but_select_word)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_select_word)(editor *) __attribute__((__stdcall__));
/// select word under cursor
extern void (*ted_but_copy)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_paste)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_copy)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_paste)(editor *) __attribute__((__stdcall__));
 
extern void (*ted_but_find)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_replace)(editor *) __attribute__((__stdcall__));
extern void (*ted_but_replace)(editor *) __attribute__((__stdcall__));
///move cursor to <ed_buffer_find>, calls ted_fun_find_err() if exist
 
 
170,7 → 170,7
 
/// return 1 if need to be saved (has changes), 0 otherwise
extern int (*ted_can_save)(editor *) __attribute__((__stdcall__));
 
 
/// all==1 - clear all memory
extern void (*ted_clear)(editor *, int all) __attribute__((__stdcall__));
 
183,7 → 183,7
free(ed->scr_h);
free(ed->buffer);
free(ed->buffer_find);
}
}
 
/// allocate memory
extern void (*ted_init)(editor *) __attribute__((__stdcall__));
214,7 → 214,7
"nop \n\t"::"a"(ch):);
(*ted_key_asm)(ed, table, control);
*/
}
}
 
extern void (*ted_open_file_asm)(editor *, struct fs_dirinfo*, char *fname) __attribute__((__stdcall__));
static inline int editor_openfile(editor *ed, char *fname, int *readbytes)
230,7 → 230,7
__asm__ __volatile__ (
"pop %%edi \n\t":"=b"(*readbytes), "=a"(ret)::);
return ret;
}
}
 
extern void (*ted_save_file_asm)(editor *, struct fs_dirinfo*, char *fname) __attribute__((__stdcall__));
static inline int editor_savefile(editor *ed, char *fname)
241,7 → 241,7
(*ted_save_file_asm)(ed, &di, fname);
 
return ed->err_save;
}
}
 
extern void (*ted_but_cut)(editor *) __attribute__((__stdcall__));
 
257,7 → 257,7
__asm__ __volatile__ (
"call *%0 \n\t"::"m"(ted_text_colored_asm), "D"(ed):);
 
}
}
 
static inline
uint32_t get_control_keys(void)
309,7 → 309,7
 
static inline void gui_add_editor(kolibri_window *wnd, editor* e)
{
kolibri_window_add_element(wnd, KOLIBRI_EDITOR, e);
kolibri_window_add_element(wnd, KOLIBRI_EDITOR, e);
}
 
static inline editor* kolibri_new_editor(uint32_t x_w, uint32_t y_h, uint32_t font, uint32_t max_chars, void *editor_interlock)
317,11 → 317,11
 
{
editor *ed = (editor *)calloc(1, sizeof(editor));
ed->x_pos = x_w >> 16;
ed->width = x_w & 0xFFFF;
ed->y_pos = y_h >> 16;
ed->x_pos = x_w >> 16;
ed->width = x_w & 0xFFFF;
ed->y_pos = y_h >> 16;
ed->hight = y_h & 0xFFFF;
 
 
ed->w_pane = 30;
ed->h_pane = 20;
// font
352,8 → 352,8
*/
ed->symbol_new_line = 20; // ascii(20)
 
ed->scr_w = kolibri_new_scrollbar_def(X_Y(0, 16), X_Y(0, 0), 100, 30, 0); // cur_area will be inited ltr, max & pos undef
ed->scr_h = kolibri_new_scrollbar_def(X_Y(0, 0), X_Y(0, 16), 100, 30, 0); // cur_area will be inited ltr, max & pos undef
ed->scr_w = kolibri_new_scrollbar_def(X_Y(0, 16), X_Y(0, 0), 100, 30, 0); // cur_area will be inited ltr, max & pos undef
ed->scr_h = kolibri_new_scrollbar_def(X_Y(0, 0), X_Y(0, 16), 100, 30, 0); // cur_area will be inited ltr, max & pos undef
 
ed->buffer_size = TE_BUF_SIZE;
ed->buffer = malloc(TE_BUF_SIZE);
372,7 → 372,7
ed->key_words_data = &word1;
 
return ed;
}
}
 
/// return 1 if symbol is not visible (deleted or undo-ed)
static inline int editor_symbol_not_vis(editor* ed, struct editor_symbol* sym)