0
0
mirror of https://github.com/vim/vim.git synced 2025-07-25 10:54:51 -04:00

patch 8.1.1531: clipboard type name is inconsistent

Problem:    Clipboard type name is inconsistent.
Solution:   Rename VimClipboard to Clipboard_T.
This commit is contained in:
Bram Moolenaar 2019-06-14 21:36:54 +02:00
parent f42397c395
commit 0554fa478d
19 changed files with 112 additions and 111 deletions

View File

@ -545,11 +545,11 @@ EXTERN int gui_win_y INIT(= -1);
#endif #endif
#ifdef FEAT_CLIPBOARD #ifdef FEAT_CLIPBOARD
EXTERN VimClipboard clip_star; /* PRIMARY selection in X11 */ EXTERN Clipboard_T clip_star; // PRIMARY selection in X11
# ifdef FEAT_X11 # ifdef FEAT_X11
EXTERN VimClipboard clip_plus; /* CLIPBOARD selection in X11 */ EXTERN Clipboard_T clip_plus; // CLIPBOARD selection in X11
# else # else
# define clip_plus clip_star /* there is only one clipboard */ # define clip_plus clip_star // there is only one clipboard
# define ONE_CLIPBOARD # define ONE_CLIPBOARD
# endif # endif

View File

@ -1394,7 +1394,7 @@ selection_received_cb(GtkWidget *widget UNUSED,
guint time_ UNUSED, guint time_ UNUSED,
gpointer user_data UNUSED) gpointer user_data UNUSED)
{ {
VimClipboard *cbd; Clipboard_T *cbd;
char_u *text; char_u *text;
char_u *tmpbuf = NULL; char_u *tmpbuf = NULL;
guchar *tmpbuf_utf8 = NULL; guchar *tmpbuf_utf8 = NULL;
@ -1511,7 +1511,7 @@ selection_get_cb(GtkWidget *widget UNUSED,
int length; int length;
int motion_type; int motion_type;
GdkAtom type; GdkAtom type;
VimClipboard *cbd; Clipboard_T *cbd;
if (gtk_selection_data_get_selection(selection_data) if (gtk_selection_data_get_selection(selection_data)
== clip_plus.gtk_sel_atom) == clip_plus.gtk_sel_atom)
@ -6602,7 +6602,7 @@ gui_mch_insert_lines(int row, int num_lines)
* X Selection stuff, for cutting and pasting text to other windows. * X Selection stuff, for cutting and pasting text to other windows.
*/ */
void void
clip_mch_request_selection(VimClipboard *cbd) clip_mch_request_selection(Clipboard_T *cbd)
{ {
GdkAtom target; GdkAtom target;
unsigned i; unsigned i;
@ -6639,7 +6639,7 @@ clip_mch_request_selection(VimClipboard *cbd)
* Disown the selection. * Disown the selection.
*/ */
void void
clip_mch_lose_selection(VimClipboard *cbd UNUSED) clip_mch_lose_selection(Clipboard_T *cbd UNUSED)
{ {
if (!in_selection_clear_event) if (!in_selection_clear_event)
{ {
@ -6652,7 +6652,7 @@ clip_mch_lose_selection(VimClipboard *cbd UNUSED)
* Own the selection and return OK if it worked. * Own the selection and return OK if it worked.
*/ */
int int
clip_mch_own_selection(VimClipboard *cbd) clip_mch_own_selection(Clipboard_T *cbd)
{ {
int success; int success;
@ -6667,13 +6667,13 @@ clip_mch_own_selection(VimClipboard *cbd)
* will fill in the selection only when requested by another app. * will fill in the selection only when requested by another app.
*/ */
void void
clip_mch_set_selection(VimClipboard *cbd UNUSED) clip_mch_set_selection(Clipboard_T *cbd UNUSED)
{ {
} }
#if (defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) || defined(PROTO) #if (defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) || defined(PROTO)
int int
clip_gtk_owner_exists(VimClipboard *cbd) clip_gtk_owner_exists(Clipboard_T *cbd)
{ {
return gdk_selection_owner_get(cbd->gtk_sel_atom) != NULL; return gdk_selection_owner_get(cbd->gtk_sel_atom) != NULL;
} }

View File

@ -4434,7 +4434,7 @@ gui_mch_insert_lines(int row, int num_lines)
*/ */
void void
clip_mch_request_selection(VimClipboard *cbd) clip_mch_request_selection(Clipboard_T *cbd)
{ {
Handle textOfClip; Handle textOfClip;
@ -4524,7 +4524,7 @@ clip_mch_request_selection(VimClipboard *cbd)
} }
void void
clip_mch_lose_selection(VimClipboard *cbd) clip_mch_lose_selection(Clipboard_T *cbd)
{ {
/* /*
* TODO: Really nothing to do? * TODO: Really nothing to do?
@ -4532,7 +4532,7 @@ clip_mch_lose_selection(VimClipboard *cbd)
} }
int int
clip_mch_own_selection(VimClipboard *cbd) clip_mch_own_selection(Clipboard_T *cbd)
{ {
return OK; return OK;
} }
@ -4541,7 +4541,7 @@ clip_mch_own_selection(VimClipboard *cbd)
* Send the current selection to the clipboard. * Send the current selection to the clipboard.
*/ */
void void
clip_mch_set_selection(VimClipboard *cbd) clip_mch_set_selection(Clipboard_T *cbd)
{ {
Handle textOfClip; Handle textOfClip;
long scrapSize; long scrapSize;

View File

@ -2872,26 +2872,26 @@ gui_x11_check_copy_area(void)
*/ */
void void
clip_mch_lose_selection(VimClipboard *cbd) clip_mch_lose_selection(Clipboard_T *cbd)
{ {
clip_x11_lose_selection(vimShell, cbd); clip_x11_lose_selection(vimShell, cbd);
} }
int int
clip_mch_own_selection(VimClipboard *cbd) clip_mch_own_selection(Clipboard_T *cbd)
{ {
return clip_x11_own_selection(vimShell, cbd); return clip_x11_own_selection(vimShell, cbd);
} }
void void
clip_mch_request_selection(VimClipboard *cbd) clip_mch_request_selection(Clipboard_T *cbd)
{ {
clip_x11_request_selection(vimShell, gui.dpy, cbd); clip_x11_request_selection(vimShell, gui.dpy, cbd);
} }
void void
clip_mch_set_selection( clip_mch_set_selection(
VimClipboard *cbd) Clipboard_T *cbd)
{ {
clip_x11_set_selection(cbd); clip_x11_set_selection(cbd);
} }

View File

@ -6460,7 +6460,7 @@ x11_export_final_selection(void)
#endif #endif
void void
clip_free_selection(VimClipboard *cbd) clip_free_selection(Clipboard_T *cbd)
{ {
yankreg_T *y_ptr = y_current; yankreg_T *y_ptr = y_current;
@ -6477,7 +6477,7 @@ clip_free_selection(VimClipboard *cbd)
* Get the selected text and put it in register '*' or '+'. * Get the selected text and put it in register '*' or '+'.
*/ */
void void
clip_get_selection(VimClipboard *cbd) clip_get_selection(Clipboard_T *cbd)
{ {
yankreg_T *old_y_previous, *old_y_current; yankreg_T *old_y_previous, *old_y_current;
pos_T old_cursor; pos_T old_cursor;
@ -6542,7 +6542,7 @@ clip_yank_selection(
int type, int type,
char_u *str, char_u *str,
long len, long len,
VimClipboard *cbd) Clipboard_T *cbd)
{ {
yankreg_T *y_ptr; yankreg_T *y_ptr;
@ -6562,7 +6562,7 @@ clip_yank_selection(
* Returns the motion type, or -1 for failure. * Returns the motion type, or -1 for failure.
*/ */
int int
clip_convert_selection(char_u **str, long_u *len, VimClipboard *cbd) clip_convert_selection(char_u **str, long_u *len, Clipboard_T *cbd)
{ {
char_u *p; char_u *p;
int lnum; int lnum;

View File

@ -48,18 +48,18 @@ void qnx_clip_init(void)
/* No support for owning the clipboard */ /* No support for owning the clipboard */
int int
clip_mch_own_selection(VimClipboard *cbd) clip_mch_own_selection(Clipboard_T *cbd)
{ {
return FALSE; return FALSE;
} }
void void
clip_mch_lose_selection(VimClipboard *cbd) clip_mch_lose_selection(Clipboard_T *cbd)
{ {
} }
void void
clip_mch_request_selection(VimClipboard *cbd) clip_mch_request_selection(Clipboard_T *cbd)
{ {
int type = MLINE, clip_length = 0, is_type_set = FALSE; int type = MLINE, clip_length = 0, is_type_set = FALSE;
void *cbdata; void *cbdata;
@ -102,7 +102,7 @@ clip_mch_request_selection(VimClipboard *cbd)
} }
void void
clip_mch_set_selection(VimClipboard *cbd) clip_mch_set_selection(Clipboard_T *cbd)
{ {
int type; int type;
long_u len; long_u len;

View File

@ -7775,7 +7775,7 @@ xterm_update(void)
} }
int int
clip_xterm_own_selection(VimClipboard *cbd) clip_xterm_own_selection(Clipboard_T *cbd)
{ {
if (xterm_Shell != (Widget)0) if (xterm_Shell != (Widget)0)
return clip_x11_own_selection(xterm_Shell, cbd); return clip_x11_own_selection(xterm_Shell, cbd);
@ -7783,21 +7783,21 @@ clip_xterm_own_selection(VimClipboard *cbd)
} }
void void
clip_xterm_lose_selection(VimClipboard *cbd) clip_xterm_lose_selection(Clipboard_T *cbd)
{ {
if (xterm_Shell != (Widget)0) if (xterm_Shell != (Widget)0)
clip_x11_lose_selection(xterm_Shell, cbd); clip_x11_lose_selection(xterm_Shell, cbd);
} }
void void
clip_xterm_request_selection(VimClipboard *cbd) clip_xterm_request_selection(Clipboard_T *cbd)
{ {
if (xterm_Shell != (Widget)0) if (xterm_Shell != (Widget)0)
clip_x11_request_selection(xterm_Shell, xterm_dpy, cbd); clip_x11_request_selection(xterm_Shell, xterm_dpy, cbd);
} }
void void
clip_xterm_set_selection(VimClipboard *cbd) clip_xterm_set_selection(Clipboard_T *cbd)
{ {
clip_x11_set_selection(cbd); clip_x11_set_selection(cbd);
} }

View File

@ -320,9 +320,9 @@ extern char *vim_SelFile(Widget toplevel, char *prompt, char *init_path, int (*s
#endif #endif
#if defined(MACOS_X_DARWIN) && defined(FEAT_CLIPBOARD) && !defined(FEAT_GUI) #if defined(MACOS_X_DARWIN) && defined(FEAT_CLIPBOARD) && !defined(FEAT_GUI)
/* functions in os_macosx.m */ /* functions in os_macosx.m */
void clip_mch_lose_selection(VimClipboard *cbd); void clip_mch_lose_selection(Clipboard_T *cbd);
int clip_mch_own_selection(VimClipboard *cbd); int clip_mch_own_selection(Clipboard_T *cbd);
void clip_mch_request_selection(VimClipboard *cbd); void clip_mch_request_selection(Clipboard_T *cbd);
void clip_mch_set_selection(VimClipboard *cbd); void clip_mch_set_selection(Clipboard_T *cbd);
#endif #endif
#endif /* !PROTO && !NOPROTO */ #endif /* !PROTO && !NOPROTO */

View File

@ -59,11 +59,11 @@ void gui_mch_clear_block(int row1arg, int col1arg, int row2arg, int col2arg);
void gui_mch_clear_all(void); void gui_mch_clear_all(void);
void gui_mch_delete_lines(int row, int num_lines); void gui_mch_delete_lines(int row, int num_lines);
void gui_mch_insert_lines(int row, int num_lines); void gui_mch_insert_lines(int row, int num_lines);
void clip_mch_request_selection(VimClipboard *cbd); void clip_mch_request_selection(Clipboard_T *cbd);
void clip_mch_lose_selection(VimClipboard *cbd); void clip_mch_lose_selection(Clipboard_T *cbd);
int clip_mch_own_selection(VimClipboard *cbd); int clip_mch_own_selection(Clipboard_T *cbd);
void clip_mch_set_selection(VimClipboard *cbd); void clip_mch_set_selection(Clipboard_T *cbd);
int clip_gtk_owner_exists(VimClipboard *cbd); int clip_gtk_owner_exists(Clipboard_T *cbd);
void gui_mch_menu_grey(vimmenu_T *menu, int grey); void gui_mch_menu_grey(vimmenu_T *menu, int grey);
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden); void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
void gui_mch_draw_menubar(void); void gui_mch_draw_menubar(void);

View File

@ -111,10 +111,10 @@ void mch_post_buffer_write (buf_T *buf);
void mch_errmsg(char *str); void mch_errmsg(char *str);
void mch_display_error(void); void mch_display_error(void);
void clip_mch_lose_selection(VimClipboard *cbd); void clip_mch_lose_selection(Clipboard_T *cbd);
void clip_mch_request_selection(VimClipboard *cbd); void clip_mch_request_selection(Clipboard_T *cbd);
void clip_mch_set_selection(VimClipboard *cbd); void clip_mch_set_selection(Clipboard_T *cbd);
int clip_mch_own_selection(VimClipboard *cbd); int clip_mch_own_selection(Clipboard_T *cbd);
pascal OSErr FindProcessBySignature( const OSType targetType, pascal OSErr FindProcessBySignature( const OSType targetType,
const OSType targetCreator, ProcessSerialNumberPtr psnPtr ); const OSType targetCreator, ProcessSerialNumberPtr psnPtr );

View File

@ -46,10 +46,10 @@ void gui_mch_clear_block(int row1, int col1, int row2, int col2);
void gui_mch_clear_all(void); void gui_mch_clear_all(void);
void gui_mch_delete_lines(int row, int num_lines); void gui_mch_delete_lines(int row, int num_lines);
void gui_mch_insert_lines(int row, int num_lines); void gui_mch_insert_lines(int row, int num_lines);
void clip_mch_lose_selection(VimClipboard *cbd); void clip_mch_lose_selection(Clipboard_T *cbd);
int clip_mch_own_selection(VimClipboard *cbd); int clip_mch_own_selection(Clipboard_T *cbd);
void clip_mch_request_selection(VimClipboard *cbd); void clip_mch_request_selection(Clipboard_T *cbd);
void clip_mch_set_selection(VimClipboard *cbd); void clip_mch_set_selection(Clipboard_T *cbd);
void gui_mch_menu_grey(vimmenu_T *menu, int grey); void gui_mch_menu_grey(vimmenu_T *menu, int grey);
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden); void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
void gui_mch_draw_menubar(void); void gui_mch_draw_menubar(void);

View File

@ -53,10 +53,10 @@ int read_viminfo_register(vir_T *virp, int force);
void handle_viminfo_register(garray_T *values, int force); void handle_viminfo_register(garray_T *values, int force);
void write_viminfo_registers(FILE *fp); void write_viminfo_registers(FILE *fp);
void x11_export_final_selection(void); void x11_export_final_selection(void);
void clip_free_selection(VimClipboard *cbd); void clip_free_selection(Clipboard_T *cbd);
void clip_get_selection(VimClipboard *cbd); void clip_get_selection(Clipboard_T *cbd);
void clip_yank_selection(int type, char_u *str, long len, VimClipboard *cbd); void clip_yank_selection(int type, char_u *str, long len, Clipboard_T *cbd);
int clip_convert_selection(char_u **str, long_u *len, VimClipboard *cbd); int clip_convert_selection(char_u **str, long_u *len, Clipboard_T *cbd);
void dnd_yank_drag_data(char_u *str, long len); void dnd_yank_drag_data(char_u *str, long len);
char_u get_reg_type(int regname, long *reglen); char_u get_reg_type(int regname, long *reglen);
char_u *get_reg_contents(int regname, int flags); char_u *get_reg_contents(int regname, int flags);

View File

@ -1,8 +1,8 @@
/* os_qnx.c */ /* os_qnx.c */
void qnx_init(void); void qnx_init(void);
void qnx_clip_init (void); void qnx_clip_init (void);
int clip_mch_own_selection(VimClipboard *cbd); int clip_mch_own_selection(Clipboard_T *cbd);
void clip_mch_lose_selection(VimClipboard *cbd); void clip_mch_lose_selection(Clipboard_T *cbd);
void clip_mch_request_selection(VimClipboard *cbd); void clip_mch_request_selection(Clipboard_T *cbd);
void clip_mch_set_selection(VimClipboard *cbd); void clip_mch_set_selection(Clipboard_T *cbd);
/* vim: set ft=c : */ /* vim: set ft=c : */

View File

@ -79,10 +79,10 @@ void setup_term_clip(void);
void start_xterm_trace(int button); void start_xterm_trace(int button);
void stop_xterm_trace(void); void stop_xterm_trace(void);
void clear_xterm_clip(void); void clear_xterm_clip(void);
int clip_xterm_own_selection(VimClipboard *cbd); int clip_xterm_own_selection(Clipboard_T *cbd);
void clip_xterm_lose_selection(VimClipboard *cbd); void clip_xterm_lose_selection(Clipboard_T *cbd);
void clip_xterm_request_selection(VimClipboard *cbd); void clip_xterm_request_selection(Clipboard_T *cbd);
void clip_xterm_set_selection(VimClipboard *cbd); void clip_xterm_set_selection(Clipboard_T *cbd);
int xsmp_handle_requests(void); int xsmp_handle_requests(void);
void xsmp_init(void); void xsmp_init(void);
void xsmp_close(void); void xsmp_close(void);

View File

@ -15,9 +15,9 @@ int ui_get_winpos(int *x, int *y, varnumber_T timeout);
void ui_breakcheck(void); void ui_breakcheck(void);
void ui_breakcheck_force(int force); void ui_breakcheck_force(int force);
void clip_init(int can_use); void clip_init(int can_use);
void clip_update_selection(VimClipboard *clip); void clip_update_selection(Clipboard_T *clip);
void clip_own_selection(VimClipboard *cbd); void clip_own_selection(Clipboard_T *cbd);
void clip_lose_selection(VimClipboard *cbd); void clip_lose_selection(Clipboard_T *cbd);
void start_global_changes(void); void start_global_changes(void);
int is_clipboard_needs_update(void); int is_clipboard_needs_update(void);
void end_global_changes(void); void end_global_changes(void);
@ -28,15 +28,15 @@ void clip_modeless(int button, int is_click, int is_drag);
void clip_start_selection(int col, int row, int repeated_click); void clip_start_selection(int col, int row, int repeated_click);
void clip_process_selection(int button, int col, int row, int_u repeated_click); void clip_process_selection(int button, int col, int row, int_u repeated_click);
void clip_may_redraw_selection(int row, int col, int len); void clip_may_redraw_selection(int row, int col, int len);
void clip_clear_selection(VimClipboard *cbd); void clip_clear_selection(Clipboard_T *cbd);
void clip_may_clear_selection(int row1, int row2); void clip_may_clear_selection(int row1, int row2);
void clip_scroll_selection(int rows); void clip_scroll_selection(int rows);
void clip_copy_modeless_selection(int both); void clip_copy_modeless_selection(int both);
int clip_gen_own_selection(VimClipboard *cbd); int clip_gen_own_selection(Clipboard_T *cbd);
void clip_gen_lose_selection(VimClipboard *cbd); void clip_gen_lose_selection(Clipboard_T *cbd);
void clip_gen_set_selection(VimClipboard *cbd); void clip_gen_set_selection(Clipboard_T *cbd);
void clip_gen_request_selection(VimClipboard *cbd); void clip_gen_request_selection(Clipboard_T *cbd);
int clip_gen_owner_exists(VimClipboard *cbd); int clip_gen_owner_exists(Clipboard_T *cbd);
int vim_is_input_buf_full(void); int vim_is_input_buf_full(void);
int vim_is_input_buf_empty(void); int vim_is_input_buf_empty(void);
int vim_free_in_input_buf(void); int vim_free_in_input_buf(void);
@ -57,12 +57,12 @@ int check_row(int row);
void open_app_context(void); void open_app_context(void);
void x11_setup_atoms(Display *dpy); void x11_setup_atoms(Display *dpy);
void x11_setup_selection(Widget w); void x11_setup_selection(Widget w);
void clip_x11_request_selection(Widget myShell, Display *dpy, VimClipboard *cbd); void clip_x11_request_selection(Widget myShell, Display *dpy, Clipboard_T *cbd);
void clip_x11_lose_selection(Widget myShell, VimClipboard *cbd); void clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd);
int clip_x11_own_selection(Widget myShell, VimClipboard *cbd); int clip_x11_own_selection(Widget myShell, Clipboard_T *cbd);
void clip_x11_set_selection(VimClipboard *cbd); void clip_x11_set_selection(Clipboard_T *cbd);
int clip_x11_owner_exists(VimClipboard *cbd); int clip_x11_owner_exists(Clipboard_T *cbd);
void yank_cut_buffer0(Display *dpy, VimClipboard *cbd); void yank_cut_buffer0(Display *dpy, Clipboard_T *cbd);
int jump_to_mouse(int flags, int *inclusive, int which_button); int jump_to_mouse(int flags, int *inclusive, int which_button);
int mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump); int mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump);
win_T *mouse_find_win(int *rowp, int *colp, mouse_find_T popup); win_T *mouse_find_win(int *rowp, int *colp, mouse_find_T popup);

View File

@ -4,10 +4,10 @@ int utf16_to_utf8(short_u *instr, int inlen, char_u *outstr);
void MultiByteToWideChar_alloc(UINT cp, DWORD flags, LPCSTR in, int inlen, LPWSTR *out, int *outlen); void MultiByteToWideChar_alloc(UINT cp, DWORD flags, LPCSTR in, int inlen, LPWSTR *out, int *outlen);
void WideCharToMultiByte_alloc(UINT cp, DWORD flags, LPCWSTR in, int inlen, LPSTR *out, int *outlen, LPCSTR def, LPBOOL useddef); void WideCharToMultiByte_alloc(UINT cp, DWORD flags, LPCWSTR in, int inlen, LPSTR *out, int *outlen, LPCSTR def, LPBOOL useddef);
void win_clip_init(void); void win_clip_init(void);
int clip_mch_own_selection(VimClipboard *cbd); int clip_mch_own_selection(Clipboard_T *cbd);
void clip_mch_lose_selection(VimClipboard *cbd); void clip_mch_lose_selection(Clipboard_T *cbd);
void clip_mch_request_selection(VimClipboard *cbd); void clip_mch_request_selection(Clipboard_T *cbd);
void clip_mch_set_selection(VimClipboard *cbd); void clip_mch_set_selection(Clipboard_T *cbd);
short_u *enc_to_utf16(char_u *str, int *lenp); short_u *enc_to_utf16(char_u *str, int *lenp);
char_u *utf16_to_enc(short_u *str, int *lenp); char_u *utf16_to_enc(short_u *str, int *lenp);
void acp_to_enc(char_u *str, int str_size, char_u **out, int *outlen); void acp_to_enc(char_u *str, int str_size, char_u **out, int *outlen);

View File

@ -724,7 +724,7 @@ ui_breakcheck_force(int force)
void void
clip_init(int can_use) clip_init(int can_use)
{ {
VimClipboard *cb; Clipboard_T *cb;
cb = &clip_star; cb = &clip_star;
for (;;) for (;;)
@ -751,7 +751,7 @@ clip_init(int can_use)
* this is called whenever VIsual mode is ended. * this is called whenever VIsual mode is ended.
*/ */
void void
clip_update_selection(VimClipboard *clip) clip_update_selection(Clipboard_T *clip)
{ {
pos_T start, end; pos_T start, end;
@ -786,7 +786,7 @@ clip_update_selection(VimClipboard *clip)
} }
void void
clip_own_selection(VimClipboard *cbd) clip_own_selection(Clipboard_T *cbd)
{ {
/* /*
* Also want to check somehow that we are reading from the keyboard rather * Also want to check somehow that we are reading from the keyboard rather
@ -822,7 +822,7 @@ clip_own_selection(VimClipboard *cbd)
} }
void void
clip_lose_selection(VimClipboard *cbd) clip_lose_selection(Clipboard_T *cbd)
{ {
#ifdef FEAT_X11 #ifdef FEAT_X11
int was_owned = cbd->owned; int was_owned = cbd->owned;
@ -860,7 +860,7 @@ clip_lose_selection(VimClipboard *cbd)
} }
static void static void
clip_copy_selection(VimClipboard *clip) clip_copy_selection(Clipboard_T *clip)
{ {
if (VIsual_active && (State & NORMAL) && clip->available) if (VIsual_active && (State & NORMAL) && clip->available)
{ {
@ -990,10 +990,9 @@ clip_isautosel_plus(void)
static void clip_invert_area(int, int, int, int, int how); static void clip_invert_area(int, int, int, int, int how);
static void clip_invert_rectangle(int row, int col, int height, int width, int invert); static void clip_invert_rectangle(int row, int col, int height, int width, int invert);
static void clip_get_word_boundaries(VimClipboard *, int, int); static void clip_get_word_boundaries(Clipboard_T *, int, int);
static int clip_get_line_end(int); static int clip_get_line_end(int);
static void clip_update_modeless_selection(VimClipboard *, int, int, static void clip_update_modeless_selection(Clipboard_T *, int, int, int, int);
int, int);
/* flags for clip_invert_area() */ /* flags for clip_invert_area() */
#define CLIP_CLEAR 1 #define CLIP_CLEAR 1
@ -1058,7 +1057,7 @@ clip_compare_pos(
void void
clip_start_selection(int col, int row, int repeated_click) clip_start_selection(int col, int row, int repeated_click)
{ {
VimClipboard *cb = &clip_star; Clipboard_T *cb = &clip_star;
if (cb->state == SELECT_DONE) if (cb->state == SELECT_DONE)
clip_clear_selection(cb); clip_clear_selection(cb);
@ -1130,9 +1129,9 @@ clip_process_selection(
int row, int row,
int_u repeated_click) int_u repeated_click)
{ {
VimClipboard *cb = &clip_star; Clipboard_T *cb = &clip_star;
int diff; int diff;
int slen = 1; /* cursor shape width */ int slen = 1; // cursor shape width
if (button == MOUSE_RELEASE) if (button == MOUSE_RELEASE)
{ {
@ -1326,7 +1325,7 @@ clip_may_redraw_selection(int row, int col, int len)
* Called from outside to clear selected region from the display * Called from outside to clear selected region from the display
*/ */
void void
clip_clear_selection(VimClipboard *cbd) clip_clear_selection(Clipboard_T *cbd)
{ {
if (cbd->state == SELECT_CLEARED) if (cbd->state == SELECT_CLEARED)
@ -1651,7 +1650,7 @@ clip_copy_modeless_selection(int both UNUSED)
#define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c)) #define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c))
static void static void
clip_get_word_boundaries(VimClipboard *cb, int row, int col) clip_get_word_boundaries(Clipboard_T *cb, int row, int col)
{ {
int start_class; int start_class;
int temp_col; int temp_col;
@ -1712,7 +1711,7 @@ clip_get_line_end(int row)
*/ */
static void static void
clip_update_modeless_selection( clip_update_modeless_selection(
VimClipboard *cb, Clipboard_T *cb,
int row1, int row1,
int col1, int col1,
int row2, int row2,
@ -1738,7 +1737,7 @@ clip_update_modeless_selection(
} }
int int
clip_gen_own_selection(VimClipboard *cbd) clip_gen_own_selection(Clipboard_T *cbd)
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI # ifdef FEAT_GUI
@ -1753,7 +1752,7 @@ clip_gen_own_selection(VimClipboard *cbd)
} }
void void
clip_gen_lose_selection(VimClipboard *cbd) clip_gen_lose_selection(Clipboard_T *cbd)
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI # ifdef FEAT_GUI
@ -1768,7 +1767,7 @@ clip_gen_lose_selection(VimClipboard *cbd)
} }
void void
clip_gen_set_selection(VimClipboard *cbd) clip_gen_set_selection(Clipboard_T *cbd)
{ {
if (!clip_did_set_selection) if (!clip_did_set_selection)
{ {
@ -1794,7 +1793,7 @@ clip_gen_set_selection(VimClipboard *cbd)
} }
void void
clip_gen_request_selection(VimClipboard *cbd) clip_gen_request_selection(Clipboard_T *cbd)
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI # ifdef FEAT_GUI
@ -1810,7 +1809,7 @@ clip_gen_request_selection(VimClipboard *cbd)
#if (defined(FEAT_X11) && defined(USE_SYSTEM)) || defined(PROTO) #if (defined(FEAT_X11) && defined(USE_SYSTEM)) || defined(PROTO)
int int
clip_gen_owner_exists(VimClipboard *cbd UNUSED) clip_gen_owner_exists(Clipboard_T *cbd UNUSED)
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI_GTK # ifdef FEAT_GUI_GTK
@ -2372,7 +2371,7 @@ clip_x11_request_selection_cb(
long_u len; long_u len;
char_u *p; char_u *p;
char **text_list = NULL; char **text_list = NULL;
VimClipboard *cbd; Clipboard_T *cbd;
char_u *tmpbuf = NULL; char_u *tmpbuf = NULL;
if (*sel_atom == clip_plus.sel_atom) if (*sel_atom == clip_plus.sel_atom)
@ -2463,7 +2462,7 @@ clip_x11_request_selection_cb(
clip_x11_request_selection( clip_x11_request_selection(
Widget myShell, Widget myShell,
Display *dpy, Display *dpy,
VimClipboard *cbd) Clipboard_T *cbd)
{ {
XEvent event; XEvent event;
Atom type; Atom type;
@ -2566,7 +2565,7 @@ clip_x11_convert_selection_cb(
static long_u save_length = 0; static long_u save_length = 0;
char_u *string; char_u *string;
int motion_type; int motion_type;
VimClipboard *cbd; Clipboard_T *cbd;
int i; int i;
if (*sel_atom == clip_plus.sel_atom) if (*sel_atom == clip_plus.sel_atom)
@ -2692,7 +2691,7 @@ clip_x11_lose_ownership_cb(Widget w UNUSED, Atom *sel_atom)
} }
void void
clip_x11_lose_selection(Widget myShell, VimClipboard *cbd) clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd)
{ {
XtDisownSelection(myShell, cbd->sel_atom, XtDisownSelection(myShell, cbd->sel_atom,
XtLastTimestampProcessed(XtDisplay(myShell))); XtLastTimestampProcessed(XtDisplay(myShell)));
@ -2705,7 +2704,7 @@ clip_x11_notify_cb(Widget w UNUSED, Atom *sel_atom UNUSED, Atom *target UNUSED)
} }
int int
clip_x11_own_selection(Widget myShell, VimClipboard *cbd) clip_x11_own_selection(Widget myShell, Clipboard_T *cbd)
{ {
/* When using the GUI we have proper timestamps, use the one of the last /* When using the GUI we have proper timestamps, use the one of the last
* event. When in the console we don't get events (the terminal gets * event. When in the console we don't get events (the terminal gets
@ -2737,14 +2736,14 @@ clip_x11_own_selection(Widget myShell, VimClipboard *cbd)
* will fill in the selection only when requested by another app. * will fill in the selection only when requested by another app.
*/ */
void void
clip_x11_set_selection(VimClipboard *cbd UNUSED) clip_x11_set_selection(Clipboard_T *cbd UNUSED)
{ {
} }
#if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) \ #if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) \
|| defined(PROTO) || defined(PROTO)
int int
clip_x11_owner_exists(VimClipboard *cbd) clip_x11_owner_exists(Clipboard_T *cbd)
{ {
return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None; return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None;
} }
@ -2757,7 +2756,7 @@ clip_x11_owner_exists(VimClipboard *cbd)
* Get the contents of the X CUT_BUFFER0 and put it in "cbd". * Get the contents of the X CUT_BUFFER0 and put it in "cbd".
*/ */
void void
yank_cut_buffer0(Display *dpy, VimClipboard *cbd) yank_cut_buffer0(Display *dpy, Clipboard_T *cbd)
{ {
int nbytes = 0; int nbytes = 0;
char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);

View File

@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1531,
/**/ /**/
1530, 1530,
/**/ /**/

View File

@ -191,7 +191,7 @@ win_clip_init(void)
/* /*
* Vim's own clipboard format recognises whether the text is char, line, * Vim's own clipboard format recognises whether the text is char, line,
* or rectangular block. Only useful for copying between two Vims. * or rectangular block. Only useful for copying between two Vims.
* "VimClipboard" was used for previous versions, using the first * "Clipboard_T" was used for previous versions, using the first
* character to specify MCHAR, MLINE or MBLOCK. * character to specify MCHAR, MLINE or MBLOCK.
*/ */
clip_star.format = RegisterClipboardFormat("VimClipboard2"); clip_star.format = RegisterClipboardFormat("VimClipboard2");
@ -212,7 +212,7 @@ typedef struct
* Make vim the owner of the current selection. Return OK upon success. * Make vim the owner of the current selection. Return OK upon success.
*/ */
int int
clip_mch_own_selection(VimClipboard *cbd UNUSED) clip_mch_own_selection(Clipboard_T *cbd UNUSED)
{ {
/* /*
* Never actually own the clipboard. If another application sets the * Never actually own the clipboard. If another application sets the
@ -225,7 +225,7 @@ clip_mch_own_selection(VimClipboard *cbd UNUSED)
* Make vim NOT the owner of the current selection. * Make vim NOT the owner of the current selection.
*/ */
void void
clip_mch_lose_selection(VimClipboard *cbd UNUSED) clip_mch_lose_selection(Clipboard_T *cbd UNUSED)
{ {
/* Nothing needs to be done here */ /* Nothing needs to be done here */
} }
@ -293,7 +293,7 @@ vim_open_clipboard(void)
* <VN> * <VN>
*/ */
void void
clip_mch_request_selection(VimClipboard *cbd) clip_mch_request_selection(Clipboard_T *cbd)
{ {
VimClipType_t metadata = { -1, -1, -1, -1 }; VimClipType_t metadata = { -1, -1, -1, -1 };
HGLOBAL hMem = NULL; HGLOBAL hMem = NULL;
@ -453,7 +453,7 @@ clip_mch_request_selection(VimClipboard *cbd)
* Send the current selection to the clipboard. * Send the current selection to the clipboard.
*/ */
void void
clip_mch_set_selection(VimClipboard *cbd) clip_mch_set_selection(Clipboard_T *cbd)
{ {
char_u *str = NULL; char_u *str = NULL;
VimClipType_t metadata; VimClipType_t metadata;