blob: 9e7f54f751ccb3dd21137a3ac76ce73ec21a5847 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001/* gui_mac.c */
2
3/*
4 * Mac specific prototypes
5 */
6
Bram Moolenaar4349c572016-01-30 13:28:28 +01007pascal Boolean WaitNextEventWrp(EventMask eventMask, EventRecord *theEvent, UInt32 sleep, RgnHandle mouseRgn);
8pascal void gui_mac_scroll_action(ControlHandle theControl, short partCode);
Bram Moolenaar071d4272004-06-13 20:20:40 +00009pascal void gui_mac_drag_thumb (ControlHandle theControl, short partCode);
Bram Moolenaar4349c572016-01-30 13:28:28 +010010void gui_mac_handle_event(EventRecord *event);
11void gui_mac_doMouseDown(EventRecord *theEvent);
12void gui_mac_do_key(EventRecord *theEvent);
13void gui_mac_handle_menu(long menuChoice);
14void gui_mac_focus_change(EventRecord *event);
15void gui_mac_update(EventRecord *event);
16short gui_mch_get_mac_menu_item_index(vimmenu_T *menu, vimmenu_T *parent);
17void gui_mch_set_blinking(long wait, long on, long off);
18void gui_mch_stop_blink(void);
19void gui_mch_start_blink(void);
20void gui_mch_getmouse(int *x, int *y);
21void gui_mch_setmouse(int x, int y);
22void gui_mch_prepare(int *argc, char **argv);
23int gui_mch_init_check(void);
24int gui_mch_init(void);
25void gui_mch_new_colors(void);
26int gui_mch_open(void);
27void gui_mch_exit(int);
28void gui_mch_set_winsize(int width, int height, int min_width, int min_height, int base_width, int base_height);
29int gui_mch_get_winpos(int *x, int *y);
30void gui_mch_set_winpos(int x, int y);
31void gui_mch_set_shellsize(int width, int height, int min_width, int min_height, int base_width, int base_height, int direction);
32void gui_mch_get_screen_dimensions(int *screen_w, int *screen_h);
33void gui_mch_set_text_area_pos(int x, int y, int w, int h);
34void gui_mch_enable_scrollbar(scrollbar_T *sb, int flag);
35void gui_mch_set_scrollbar_thumb(scrollbar_T *sb, long val, long size, long max);
36void gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h);
37void gui_mch_create_scrollbar(scrollbar_T *sb, int orient);
38void gui_mch_destroy_scrollbar(scrollbar_T *sb);
39int gui_mch_adjust_charheight(void);
40int gui_mch_init_font(char_u *font_name, int fontset);
41GuiFont gui_mch_get_font(char_u *name, int giveErrorIfMissing);
42char_u *gui_mch_get_fontname(GuiFont font, char_u *name);
43GuiFont gui_mac_find_font(char_u *font_name);
44void gui_mch_set_font(GuiFont font);
45int gui_mch_same_font(GuiFont f1, GuiFont f2);
46void gui_mch_free_font(GuiFont font);
47guicolor_T gui_mch_get_color(char_u *name);
48void gui_mch_set_fg_color(guicolor_T color);
49void gui_mch_set_bg_color(guicolor_T color);
50void gui_mch_set_sp_color(guicolor_T color);
51void gui_mch_draw_string(int row, int col, char_u *s, int len, int flags);
52int gui_mch_haskey(char_u *name);
53void gui_mch_beep(void);
54void gui_mch_flash(int msec);
55void gui_mch_invert_rectangle(int r, int c, int nr, int nc);
56void gui_mch_iconify(void);
57void gui_mch_settitle(char_u *title, char_u *icon);
58void gui_mch_draw_hollow_cursor(guicolor_T color);
59void gui_mch_draw_part_cursor(int w, int h, guicolor_T color);
60void gui_mch_update(void);
61int gui_mch_wait_for_chars(int wtime);
62void gui_mch_flush(void);
63void gui_mch_clear_block(int row1, int col1, int row2, int col2);
64void gui_mch_clear_all(void);
65void gui_mch_delete_lines(int row, int num_lines);
66void gui_mch_insert_lines(int row, int num_lines);
67void gui_mch_enable_menu(int flag);
68void gui_mch_set_menu_pos(int x, int y, int w, int h);
69/*void gui_mch_add_menu(vimmenu_T *menu, vimmenu_T *parent, int idx);*/
70void gui_mch_add_menu(vimmenu_T *menu, int pos);
71/*void gui_mch_add_menu_item(vimmenu_T *menu, vimmenu_T *parent, int idx);*/
72void gui_mch_add_menu_item(vimmenu_T *menu, int idx);
73void gui_mch_show_popupmenu(vimmenu_T *menu);
74void gui_mch_destroy_menu(vimmenu_T *menu);
75void gui_mch_menu_grey(vimmenu_T *menu, int grey);
76void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
77void gui_mch_draw_menubar(void);
78int gui_mch_get_lightness(guicolor_T pixel);
79long_u gui_mch_get_rgb(guicolor_T pixel);
80int gui_mch_get_mouse_x(void);
81int gui_mch_get_mouse_y(void);
82void gui_mch_setmouse(int x, int y);
83void gui_mch_show_popupmenu(vimmenu_T *menu);
84int gui_mch_dialog(int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd);
85char_u *gui_mch_browse(int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter);
86void gui_mch_set_foreground(void);
87void gui_mch_show_tabline(int showit);
88int gui_mch_showing_tabline(void);
89void gui_mch_update_tabline(void);
90void gui_mch_set_curtab(int nr);
Bram Moolenaar071d4272004-06-13 20:20:40 +000091
Bram Moolenaar4349c572016-01-30 13:28:28 +010092char_u *C2Pascal_save(char_u *Cstring);
93char_u *C2Pascal_save_and_remove_backslash(char_u *Cstring);
94int_u EventModifiers2VimMouseModifiers(EventModifiers macModifiers);
95char_u **new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error);
Bram Moolenaar071d4272004-06-13 20:20:40 +000096
97
Bram Moolenaar4349c572016-01-30 13:28:28 +010098void gui_request_selection(void);
99void gui_mch_lose_selection(void);
100int gui_mch_own_selection(void);
101void gui_mch_clear_selection(void);
Bram Moolenaar071d4272004-06-13 20:20:40 +0000102
Bram Moolenaar4349c572016-01-30 13:28:28 +0100103void gui_win_new_height(win_T *wp);
104void gui_win_comp_pos(void);
105void gui_win_free(win_T *wp);
106void gui_win_alloc(win_T *wp);
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107void mch_post_buffer_write (buf_T *buf);
108
Bram Moolenaar4349c572016-01-30 13:28:28 +0100109void mch_errmsg(char *str);
110void mch_display_error(void);
111void clip_mch_lose_selection(VimClipboard *cbd);
112void clip_mch_request_selection(VimClipboard *cbd);
113void clip_mch_set_selection(VimClipboard *cbd);
114int clip_mch_own_selection(VimClipboard *cbd);
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115
116pascal OSErr FindProcessBySignature( const OSType targetType,
117 const OSType targetCreator, ProcessSerialNumberPtr psnPtr );
118OSErr InstallAEHandlers (void);
119pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
120pascal OSErr Handle_aevt_oapp_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
121pascal OSErr Handle_aevt_quit_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
122pascal OSErr Handle_aevt_pdoc_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
123pascal OSErr Handle_unknown_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
124/* Shoulde we return MenuItemIndex? IMO yes, I did that for 5.7 ak*/
125short gui_mac_get_menu_item_index (vimmenu_T *pMenu);
126
127pascal OSErr Handle_KAHL_SRCH_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
128pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
129pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
130void Send_KAHL_MOD_AE (buf_T *buf);
131
Bram Moolenaar4349c572016-01-30 13:28:28 +0100132void gui_mac_doInContentClick(EventRecord *theEvent, WindowPtr whichWindow);
133void gui_mac_doInDragClick(Point where, WindowPtr whichWindow);
134void gui_mac_doInGrowClick(Point where, WindowPtr whichWindow);
135void gui_mac_doUpdateEvent(EventRecord *event);
136void gui_mac_doActivateEvent(EventRecord *event);
137void gui_mac_doSuspendEvent(EventRecord *event);
138void gui_mac_doKeyEvent(EventRecord *theEvent);
139void gui_mac_doMouseDownEvent(EventRecord *theEvent);
140void gui_mac_doMouseMovedEvent(EventRecord *event);
141void gui_mac_doMouseUpEvent(EventRecord *theEvent);
142void gui_mch_mousehide(int hide);
Bram Moolenaar071d4272004-06-13 20:20:40 +0000143
144int C2PascalString (char_u *CString, Str255 *PascalString);
145int GetFSSpecFromPath ( char_u *file, FSSpec *fileFSSpec);
146char_u *FullPathFromFSSpec_save (FSSpec file);
147
148/* vim: set ft=c : */