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