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