Patch 8.1.1531

12 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 14, 2019, 3:37:17 PM6/14/19
to vim...@googlegroups.com

Patch 8.1.1531
Problem: Clipboard type name is inconsistent.
Solution: Rename VimClipboard to Clipboard_T.
Files: src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro, src/gui_mac.c,
src/proto/gui_mac.pro, src/gui_x11.c, src/proto/gui_x11.pro,
src/ops.c, src/proto/ops.pro, src/os_qnx.c, src/proto/os_qnx.pro,
src/os_unix.c, src/proto/os_unix.pro, src/ui.c, src/proto/ui.pro,
src/winclip.c, src/proto/winclip.pro, src/globals.h, src/proto.h


*** ../vim-8.1.1530/src/gui_gtk_x11.c 2019-05-28 23:08:12.064648717 +0200
--- src/gui_gtk_x11.c 2019-06-14 21:26:17.798104655 +0200
***************
*** 1394,1400 ****
guint time_ UNUSED,
gpointer user_data UNUSED)
{
! VimClipboard *cbd;
char_u *text;
char_u *tmpbuf = NULL;
guchar *tmpbuf_utf8 = NULL;
--- 1394,1400 ----
guint time_ UNUSED,
gpointer user_data UNUSED)
{
! Clipboard_T *cbd;
char_u *text;
char_u *tmpbuf = NULL;
guchar *tmpbuf_utf8 = NULL;
***************
*** 1511,1517 ****
int length;
int motion_type;
GdkAtom type;
! VimClipboard *cbd;

if (gtk_selection_data_get_selection(selection_data)
== clip_plus.gtk_sel_atom)
--- 1511,1517 ----
int length;
int motion_type;
GdkAtom type;
! Clipboard_T *cbd;

if (gtk_selection_data_get_selection(selection_data)
== clip_plus.gtk_sel_atom)
***************
*** 6602,6608 ****
* X Selection stuff, for cutting and pasting text to other windows.
*/
void
! clip_mch_request_selection(VimClipboard *cbd)
{
GdkAtom target;
unsigned i;
--- 6602,6608 ----
* X Selection stuff, for cutting and pasting text to other windows.
*/
void
! clip_mch_request_selection(Clipboard_T *cbd)
{
GdkAtom target;
unsigned i;
***************
*** 6639,6645 ****
* Disown the selection.
*/
void
! clip_mch_lose_selection(VimClipboard *cbd UNUSED)
{
if (!in_selection_clear_event)
{
--- 6639,6645 ----
* Disown the selection.
*/
void
! clip_mch_lose_selection(Clipboard_T *cbd UNUSED)
{
if (!in_selection_clear_event)
{
***************
*** 6652,6658 ****
* Own the selection and return OK if it worked.
*/
int
! clip_mch_own_selection(VimClipboard *cbd)
{
int success;

--- 6652,6658 ----
* Own the selection and return OK if it worked.
*/
int
! clip_mch_own_selection(Clipboard_T *cbd)
{
int success;

***************
*** 6667,6679 ****
* will fill in the selection only when requested by another app.
*/
void
! clip_mch_set_selection(VimClipboard *cbd UNUSED)
{
}

#if (defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) || defined(PROTO)
int
! clip_gtk_owner_exists(VimClipboard *cbd)
{
return gdk_selection_owner_get(cbd->gtk_sel_atom) != NULL;
}
--- 6667,6679 ----
* will fill in the selection only when requested by another app.
*/
void
! clip_mch_set_selection(Clipboard_T *cbd UNUSED)
{
}

#if (defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) || defined(PROTO)
int
! clip_gtk_owner_exists(Clipboard_T *cbd)
{
return gdk_selection_owner_get(cbd->gtk_sel_atom) != NULL;
}
*** ../vim-8.1.1530/src/proto/gui_gtk_x11.pro 2018-08-19 22:58:39.779568143 +0200
--- src/proto/gui_gtk_x11.pro 2019-06-14 21:30:50.048484225 +0200
***************
*** 59,69 ****
void gui_mch_clear_all(void);
void gui_mch_delete_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_lose_selection(VimClipboard *cbd);
! int clip_mch_own_selection(VimClipboard *cbd);
! void clip_mch_set_selection(VimClipboard *cbd);
! int clip_gtk_owner_exists(VimClipboard *cbd);
void gui_mch_menu_grey(vimmenu_T *menu, int grey);
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
void gui_mch_draw_menubar(void);
--- 59,69 ----
void gui_mch_clear_all(void);
void gui_mch_delete_lines(int row, int num_lines);
void gui_mch_insert_lines(int row, int num_lines);
! void clip_mch_request_selection(Clipboard_T *cbd);
! void clip_mch_lose_selection(Clipboard_T *cbd);
! int clip_mch_own_selection(Clipboard_T *cbd);
! void clip_mch_set_selection(Clipboard_T *cbd);
! int clip_gtk_owner_exists(Clipboard_T *cbd);
void gui_mch_menu_grey(vimmenu_T *menu, int grey);
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
void gui_mch_draw_menubar(void);
*** ../vim-8.1.1530/src/gui_mac.c 2019-05-28 23:08:12.064648717 +0200
--- src/gui_mac.c 2019-06-14 21:26:30.566026505 +0200
***************
*** 4434,4440 ****
*/

void
! clip_mch_request_selection(VimClipboard *cbd)
{

Handle textOfClip;
--- 4434,4440 ----
*/

void
! clip_mch_request_selection(Clipboard_T *cbd)
{

Handle textOfClip;
***************
*** 4524,4530 ****
}

void
! clip_mch_lose_selection(VimClipboard *cbd)
{
/*
* TODO: Really nothing to do?
--- 4524,4530 ----
}

void
! clip_mch_lose_selection(Clipboard_T *cbd)
{
/*
* TODO: Really nothing to do?
***************
*** 4532,4538 ****
}

int
! clip_mch_own_selection(VimClipboard *cbd)
{
return OK;
}
--- 4532,4538 ----
}

int
! clip_mch_own_selection(Clipboard_T *cbd)
{
return OK;
}
***************
*** 4541,4547 ****
* Send the current selection to the clipboard.
*/
void
! clip_mch_set_selection(VimClipboard *cbd)
{
Handle textOfClip;
long scrapSize;
--- 4541,4547 ----
* Send the current selection to the clipboard.
*/
void
! clip_mch_set_selection(Clipboard_T *cbd)
{
Handle textOfClip;
long scrapSize;
*** ../vim-8.1.1530/src/proto/gui_mac.pro 2018-01-31 21:05:31.000000000 +0100
--- src/proto/gui_mac.pro 2019-06-14 21:31:34.972224445 +0200
***************
*** 111,120 ****

void mch_errmsg(char *str);
void mch_display_error(void);
! void clip_mch_lose_selection(VimClipboard *cbd);
! void clip_mch_request_selection(VimClipboard *cbd);
! void clip_mch_set_selection(VimClipboard *cbd);
! int clip_mch_own_selection(VimClipboard *cbd);

pascal OSErr FindProcessBySignature( const OSType targetType,
const OSType targetCreator, ProcessSerialNumberPtr psnPtr );
--- 111,120 ----

void mch_errmsg(char *str);
void mch_display_error(void);
! void clip_mch_lose_selection(Clipboard_T *cbd);
! void clip_mch_request_selection(Clipboard_T *cbd);
! void clip_mch_set_selection(Clipboard_T *cbd);
! int clip_mch_own_selection(Clipboard_T *cbd);

pascal OSErr FindProcessBySignature( const OSType targetType,
const OSType targetCreator, ProcessSerialNumberPtr psnPtr );
*** ../vim-8.1.1530/src/gui_x11.c 2019-05-28 23:08:12.064648717 +0200
--- src/gui_x11.c 2019-06-14 21:26:51.509898876 +0200
***************
*** 2872,2897 ****
*/

void
! clip_mch_lose_selection(VimClipboard *cbd)
{
clip_x11_lose_selection(vimShell, cbd);
}

int
! clip_mch_own_selection(VimClipboard *cbd)
{
return clip_x11_own_selection(vimShell, cbd);
}

void
! clip_mch_request_selection(VimClipboard *cbd)
{
clip_x11_request_selection(vimShell, gui.dpy, cbd);
}

void
clip_mch_set_selection(
! VimClipboard *cbd)
{
clip_x11_set_selection(cbd);
}
--- 2872,2897 ----
*/

void
! clip_mch_lose_selection(Clipboard_T *cbd)
{
clip_x11_lose_selection(vimShell, cbd);
}

int
! clip_mch_own_selection(Clipboard_T *cbd)
{
return clip_x11_own_selection(vimShell, cbd);
}

void
! clip_mch_request_selection(Clipboard_T *cbd)
{
clip_x11_request_selection(vimShell, gui.dpy, cbd);
}

void
clip_mch_set_selection(
! Clipboard_T *cbd)
{
clip_x11_set_selection(cbd);
}
*** ../vim-8.1.1530/src/proto/gui_x11.pro 2018-05-17 13:53:01.000000000 +0200
--- src/proto/gui_x11.pro 2019-06-14 21:31:39.100200662 +0200
***************
*** 46,55 ****
void gui_mch_clear_all(void);
void gui_mch_delete_lines(int row, int num_lines);
void gui_mch_insert_lines(int row, int num_lines);
! void clip_mch_lose_selection(VimClipboard *cbd);
! int clip_mch_own_selection(VimClipboard *cbd);
! void clip_mch_request_selection(VimClipboard *cbd);
! void clip_mch_set_selection(VimClipboard *cbd);
void gui_mch_menu_grey(vimmenu_T *menu, int grey);
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
void gui_mch_draw_menubar(void);
--- 46,55 ----
void gui_mch_clear_all(void);
void gui_mch_delete_lines(int row, int num_lines);
void gui_mch_insert_lines(int row, int num_lines);
! void clip_mch_lose_selection(Clipboard_T *cbd);
! int clip_mch_own_selection(Clipboard_T *cbd);
! void clip_mch_request_selection(Clipboard_T *cbd);
! void clip_mch_set_selection(Clipboard_T *cbd);
void gui_mch_menu_grey(vimmenu_T *menu, int grey);
void gui_mch_menu_hidden(vimmenu_T *menu, int hidden);
void gui_mch_draw_menubar(void);
*** ../vim-8.1.1530/src/ops.c 2019-05-28 23:08:12.072648675 +0200
--- src/ops.c 2019-06-14 21:27:09.505789692 +0200
***************
*** 6460,6466 ****
#endif

void
! clip_free_selection(VimClipboard *cbd)
{
yankreg_T *y_ptr = y_current;

--- 6460,6466 ----
#endif

void
! clip_free_selection(Clipboard_T *cbd)
{
yankreg_T *y_ptr = y_current;

***************
*** 6477,6483 ****
* Get the selected text and put it in register '*' or '+'.
*/
void
! clip_get_selection(VimClipboard *cbd)
{
yankreg_T *old_y_previous, *old_y_current;
pos_T old_cursor;
--- 6477,6483 ----
* Get the selected text and put it in register '*' or '+'.
*/
void
! clip_get_selection(Clipboard_T *cbd)
{
yankreg_T *old_y_previous, *old_y_current;
pos_T old_cursor;
***************
*** 6542,6548 ****
int type,
char_u *str,
long len,
! VimClipboard *cbd)
{
yankreg_T *y_ptr;

--- 6542,6548 ----
int type,
char_u *str,
long len,
! Clipboard_T *cbd)
{
yankreg_T *y_ptr;

***************
*** 6562,6568 ****
* Returns the motion type, or -1 for failure.
*/
int
! clip_convert_selection(char_u **str, long_u *len, VimClipboard *cbd)
{
char_u *p;
int lnum;
--- 6562,6568 ----
* Returns the motion type, or -1 for failure.
*/
int
! clip_convert_selection(char_u **str, long_u *len, Clipboard_T *cbd)
{
char_u *p;
int lnum;
*** ../vim-8.1.1530/src/proto/ops.pro 2018-06-03 14:42:17.848505102 +0200
--- src/proto/ops.pro 2019-06-14 21:31:43.332176292 +0200
***************
*** 53,62 ****
void handle_viminfo_register(garray_T *values, int force);
void write_viminfo_registers(FILE *fp);
void x11_export_final_selection(void);
! void clip_free_selection(VimClipboard *cbd);
! void clip_get_selection(VimClipboard *cbd);
! void clip_yank_selection(int type, char_u *str, long len, VimClipboard *cbd);
! int clip_convert_selection(char_u **str, long_u *len, VimClipboard *cbd);
void dnd_yank_drag_data(char_u *str, long len);
char_u get_reg_type(int regname, long *reglen);
char_u *get_reg_contents(int regname, int flags);
--- 53,62 ----
void handle_viminfo_register(garray_T *values, int force);
void write_viminfo_registers(FILE *fp);
void x11_export_final_selection(void);
! void clip_free_selection(Clipboard_T *cbd);
! void clip_get_selection(Clipboard_T *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, Clipboard_T *cbd);
void dnd_yank_drag_data(char_u *str, long len);
char_u get_reg_type(int regname, long *reglen);
char_u *get_reg_contents(int regname, int flags);
*** ../vim-8.1.1530/src/os_qnx.c 2019-05-24 19:38:59.104545491 +0200
--- src/os_qnx.c 2019-06-14 21:27:27.501680962 +0200
***************
*** 48,65 ****

/* No support for owning the clipboard */
int
! clip_mch_own_selection(VimClipboard *cbd)
{
return FALSE;
}

void
! clip_mch_lose_selection(VimClipboard *cbd)
{
}

void
! clip_mch_request_selection(VimClipboard *cbd)
{
int type = MLINE, clip_length = 0, is_type_set = FALSE;
void *cbdata;
--- 48,65 ----

/* No support for owning the clipboard */
int
! clip_mch_own_selection(Clipboard_T *cbd)
{
return FALSE;
}

void
! clip_mch_lose_selection(Clipboard_T *cbd)
{
}

void
! clip_mch_request_selection(Clipboard_T *cbd)
{
int type = MLINE, clip_length = 0, is_type_set = FALSE;
void *cbdata;
***************
*** 102,108 ****
}

void
! clip_mch_set_selection(VimClipboard *cbd)
{
int type;
long_u len;
--- 102,108 ----
}

void
! clip_mch_set_selection(Clipboard_T *cbd)
{
int type;
long_u len;
*** ../vim-8.1.1530/src/proto/os_qnx.pro 2016-01-30 13:15:02.000000000 +0100
--- src/proto/os_qnx.pro 2019-06-14 21:31:48.548146285 +0200
***************
*** 1,8 ****
/* os_qnx.c */
void qnx_init(void);
void qnx_clip_init (void);
! int clip_mch_own_selection(VimClipboard *cbd);
! void clip_mch_lose_selection(VimClipboard *cbd);
! void clip_mch_request_selection(VimClipboard *cbd);
! void clip_mch_set_selection(VimClipboard *cbd);
/* vim: set ft=c : */
--- 1,8 ----
/* os_qnx.c */
void qnx_init(void);
void qnx_clip_init (void);
! int clip_mch_own_selection(Clipboard_T *cbd);
! void clip_mch_lose_selection(Clipboard_T *cbd);
! void clip_mch_request_selection(Clipboard_T *cbd);
! void clip_mch_set_selection(Clipboard_T *cbd);
/* vim: set ft=c : */
*** ../vim-8.1.1530/src/os_unix.c 2019-05-28 23:08:12.072648675 +0200
--- src/os_unix.c 2019-06-14 21:27:46.085569168 +0200
***************
*** 7775,7781 ****
}

int
! clip_xterm_own_selection(VimClipboard *cbd)
{
if (xterm_Shell != (Widget)0)
return clip_x11_own_selection(xterm_Shell, cbd);
--- 7775,7781 ----
}

int
! clip_xterm_own_selection(Clipboard_T *cbd)
{
if (xterm_Shell != (Widget)0)
return clip_x11_own_selection(xterm_Shell, cbd);
***************
*** 7783,7803 ****
}

void
! clip_xterm_lose_selection(VimClipboard *cbd)
{
if (xterm_Shell != (Widget)0)
clip_x11_lose_selection(xterm_Shell, cbd);
}

void
! clip_xterm_request_selection(VimClipboard *cbd)
{
if (xterm_Shell != (Widget)0)
clip_x11_request_selection(xterm_Shell, xterm_dpy, cbd);
}

void
! clip_xterm_set_selection(VimClipboard *cbd)
{
clip_x11_set_selection(cbd);
}
--- 7783,7803 ----
}

void
! clip_xterm_lose_selection(Clipboard_T *cbd)
{
if (xterm_Shell != (Widget)0)
clip_x11_lose_selection(xterm_Shell, cbd);
}

void
! clip_xterm_request_selection(Clipboard_T *cbd)
{
if (xterm_Shell != (Widget)0)
clip_x11_request_selection(xterm_Shell, xterm_dpy, cbd);
}

void
! clip_xterm_set_selection(Clipboard_T *cbd)
{
clip_x11_set_selection(cbd);
}
*** ../vim-8.1.1530/src/proto/os_unix.pro 2019-05-09 18:59:27.228463605 +0200
--- src/proto/os_unix.pro 2019-06-14 21:31:53.028120527 +0200
***************
*** 79,88 ****
void start_xterm_trace(int button);
void stop_xterm_trace(void);
void clear_xterm_clip(void);
! int clip_xterm_own_selection(VimClipboard *cbd);
! void clip_xterm_lose_selection(VimClipboard *cbd);
! void clip_xterm_request_selection(VimClipboard *cbd);
! void clip_xterm_set_selection(VimClipboard *cbd);
int xsmp_handle_requests(void);
void xsmp_init(void);
void xsmp_close(void);
--- 79,88 ----
void start_xterm_trace(int button);
void stop_xterm_trace(void);
void clear_xterm_clip(void);
! int clip_xterm_own_selection(Clipboard_T *cbd);
! void clip_xterm_lose_selection(Clipboard_T *cbd);
! void clip_xterm_request_selection(Clipboard_T *cbd);
! void clip_xterm_set_selection(Clipboard_T *cbd);
int xsmp_handle_requests(void);
void xsmp_init(void);
void xsmp_close(void);
*** ../vim-8.1.1530/src/ui.c 2019-06-13 23:59:46.788290732 +0200
--- src/ui.c 2019-06-14 21:28:47.009205692 +0200
***************
*** 724,730 ****
void
clip_init(int can_use)
{
! VimClipboard *cb;

cb = &clip_star;
for (;;)
--- 724,730 ----
void
clip_init(int can_use)
{
! Clipboard_T *cb;

cb = &clip_star;
for (;;)
***************
*** 751,757 ****
* this is called whenever VIsual mode is ended.
*/
void
! clip_update_selection(VimClipboard *clip)
{
pos_T start, end;

--- 751,757 ----
* this is called whenever VIsual mode is ended.
*/
void
! clip_update_selection(Clipboard_T *clip)
{
pos_T start, end;

***************
*** 786,792 ****
}

void
! clip_own_selection(VimClipboard *cbd)
{
/*
* Also want to check somehow that we are reading from the keyboard rather
--- 786,792 ----
}

void
! clip_own_selection(Clipboard_T *cbd)
{
/*
* Also want to check somehow that we are reading from the keyboard rather
***************
*** 822,828 ****
}

void
! clip_lose_selection(VimClipboard *cbd)
{
#ifdef FEAT_X11
int was_owned = cbd->owned;
--- 822,828 ----
}

void
! clip_lose_selection(Clipboard_T *cbd)
{
#ifdef FEAT_X11
int was_owned = cbd->owned;
***************
*** 860,866 ****
}

static void
! clip_copy_selection(VimClipboard *clip)
{
if (VIsual_active && (State & NORMAL) && clip->available)
{
--- 860,866 ----
}

static void
! clip_copy_selection(Clipboard_T *clip)
{
if (VIsual_active && (State & NORMAL) && clip->available)
{
***************
*** 990,999 ****

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_get_word_boundaries(VimClipboard *, int, int);
static int clip_get_line_end(int);
! static void clip_update_modeless_selection(VimClipboard *, int, int,
! int, int);

/* flags for clip_invert_area() */
#define CLIP_CLEAR 1
--- 990,998 ----

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_get_word_boundaries(Clipboard_T *, int, int);
static int clip_get_line_end(int);
! static void clip_update_modeless_selection(Clipboard_T *, int, int, int, int);

/* flags for clip_invert_area() */
#define CLIP_CLEAR 1
***************
*** 1058,1064 ****
void
clip_start_selection(int col, int row, int repeated_click)
{
! VimClipboard *cb = &clip_star;

if (cb->state == SELECT_DONE)
clip_clear_selection(cb);
--- 1057,1063 ----
void
clip_start_selection(int col, int row, int repeated_click)
{
! Clipboard_T *cb = &clip_star;

if (cb->state == SELECT_DONE)
clip_clear_selection(cb);
***************
*** 1130,1138 ****
int row,
int_u repeated_click)
{
! VimClipboard *cb = &clip_star;
! int diff;
! int slen = 1; /* cursor shape width */

if (button == MOUSE_RELEASE)
{
--- 1129,1137 ----
int row,
int_u repeated_click)
{
! Clipboard_T *cb = &clip_star;
! int diff;
! int slen = 1; // cursor shape width

if (button == MOUSE_RELEASE)
{
***************
*** 1326,1332 ****
* Called from outside to clear selected region from the display
*/
void
! clip_clear_selection(VimClipboard *cbd)
{

if (cbd->state == SELECT_CLEARED)
--- 1325,1331 ----
* Called from outside to clear selected region from the display
*/
void
! clip_clear_selection(Clipboard_T *cbd)
{

if (cbd->state == SELECT_CLEARED)
***************
*** 1651,1657 ****
#define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c))

static void
! clip_get_word_boundaries(VimClipboard *cb, int row, int col)
{
int start_class;
int temp_col;
--- 1650,1656 ----
#define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c))

static void
! clip_get_word_boundaries(Clipboard_T *cb, int row, int col)
{
int start_class;
int temp_col;
***************
*** 1712,1718 ****
*/
static void
clip_update_modeless_selection(
! VimClipboard *cb,
int row1,
int col1,
int row2,
--- 1711,1717 ----
*/
static void
clip_update_modeless_selection(
! Clipboard_T *cb,
int row1,
int col1,
int row2,
***************
*** 1738,1744 ****
}

int
! clip_gen_own_selection(VimClipboard *cbd)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI
--- 1737,1743 ----
}

int
! clip_gen_own_selection(Clipboard_T *cbd)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI
***************
*** 1753,1759 ****
}

void
! clip_gen_lose_selection(VimClipboard *cbd)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI
--- 1752,1758 ----
}

void
! clip_gen_lose_selection(Clipboard_T *cbd)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI
***************
*** 1768,1774 ****
}

void
! clip_gen_set_selection(VimClipboard *cbd)
{
if (!clip_did_set_selection)
{
--- 1767,1773 ----
}

void
! clip_gen_set_selection(Clipboard_T *cbd)
{
if (!clip_did_set_selection)
{
***************
*** 1794,1800 ****
}

void
! clip_gen_request_selection(VimClipboard *cbd)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI
--- 1793,1799 ----
}

void
! clip_gen_request_selection(Clipboard_T *cbd)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI
***************
*** 1810,1816 ****

#if (defined(FEAT_X11) && defined(USE_SYSTEM)) || defined(PROTO)
int
! clip_gen_owner_exists(VimClipboard *cbd UNUSED)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI_GTK
--- 1809,1815 ----

#if (defined(FEAT_X11) && defined(USE_SYSTEM)) || defined(PROTO)
int
! clip_gen_owner_exists(Clipboard_T *cbd UNUSED)
{
#ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI_GTK
***************
*** 2372,2378 ****
long_u len;
char_u *p;
char **text_list = NULL;
! VimClipboard *cbd;
char_u *tmpbuf = NULL;

if (*sel_atom == clip_plus.sel_atom)
--- 2371,2377 ----
long_u len;
char_u *p;
char **text_list = NULL;
! Clipboard_T *cbd;
char_u *tmpbuf = NULL;

if (*sel_atom == clip_plus.sel_atom)
***************
*** 2463,2469 ****
clip_x11_request_selection(
Widget myShell,
Display *dpy,
! VimClipboard *cbd)
{
XEvent event;
Atom type;
--- 2462,2468 ----
clip_x11_request_selection(
Widget myShell,
Display *dpy,
! Clipboard_T *cbd)
{
XEvent event;
Atom type;
***************
*** 2566,2572 ****
static long_u save_length = 0;
char_u *string;
int motion_type;
! VimClipboard *cbd;
int i;

if (*sel_atom == clip_plus.sel_atom)
--- 2565,2571 ----
static long_u save_length = 0;
char_u *string;
int motion_type;
! Clipboard_T *cbd;
int i;

if (*sel_atom == clip_plus.sel_atom)
***************
*** 2692,2698 ****
}

void
! clip_x11_lose_selection(Widget myShell, VimClipboard *cbd)
{
XtDisownSelection(myShell, cbd->sel_atom,
XtLastTimestampProcessed(XtDisplay(myShell)));
--- 2691,2697 ----
}

void
! clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd)
{
XtDisownSelection(myShell, cbd->sel_atom,
XtLastTimestampProcessed(XtDisplay(myShell)));
***************
*** 2705,2711 ****
}

int
! clip_x11_own_selection(Widget myShell, VimClipboard *cbd)
{
/* 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
--- 2704,2710 ----
}

int
! clip_x11_own_selection(Widget myShell, Clipboard_T *cbd)
{
/* 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
***************
*** 2737,2750 ****
* will fill in the selection only when requested by another app.
*/
void
! clip_x11_set_selection(VimClipboard *cbd UNUSED)
{
}

#if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) \
|| defined(PROTO)
int
! clip_x11_owner_exists(VimClipboard *cbd)
{
return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None;
}
--- 2736,2749 ----
* will fill in the selection only when requested by another app.
*/
void
! clip_x11_set_selection(Clipboard_T *cbd UNUSED)
{
}

#if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) \
|| defined(PROTO)
int
! clip_x11_owner_exists(Clipboard_T *cbd)
{
return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None;
}
***************
*** 2757,2763 ****
* Get the contents of the X CUT_BUFFER0 and put it in "cbd".
*/
void
! yank_cut_buffer0(Display *dpy, VimClipboard *cbd)
{
int nbytes = 0;
char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
--- 2756,2762 ----
* Get the contents of the X CUT_BUFFER0 and put it in "cbd".
*/
void
! yank_cut_buffer0(Display *dpy, Clipboard_T *cbd)
{
int nbytes = 0;
char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
*** ../vim-8.1.1530/src/proto/ui.pro 2019-06-12 20:21:57.733817549 +0200
--- src/proto/ui.pro 2019-06-14 21:32:01.932069379 +0200
***************
*** 15,23 ****
void ui_breakcheck(void);
void ui_breakcheck_force(int force);
void clip_init(int can_use);
! void clip_update_selection(VimClipboard *clip);
! void clip_own_selection(VimClipboard *cbd);
! void clip_lose_selection(VimClipboard *cbd);
void start_global_changes(void);
int is_clipboard_needs_update(void);
void end_global_changes(void);
--- 15,23 ----
void ui_breakcheck(void);
void ui_breakcheck_force(int force);
void clip_init(int can_use);
! void clip_update_selection(Clipboard_T *clip);
! void clip_own_selection(Clipboard_T *cbd);
! void clip_lose_selection(Clipboard_T *cbd);
void start_global_changes(void);
int is_clipboard_needs_update(void);
void end_global_changes(void);
***************
*** 28,42 ****
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_may_redraw_selection(int row, int col, int len);
! void clip_clear_selection(VimClipboard *cbd);
void clip_may_clear_selection(int row1, int row2);
void clip_scroll_selection(int rows);
void clip_copy_modeless_selection(int both);
! int clip_gen_own_selection(VimClipboard *cbd);
! void clip_gen_lose_selection(VimClipboard *cbd);
! void clip_gen_set_selection(VimClipboard *cbd);
! void clip_gen_request_selection(VimClipboard *cbd);
! int clip_gen_owner_exists(VimClipboard *cbd);
int vim_is_input_buf_full(void);
int vim_is_input_buf_empty(void);
int vim_free_in_input_buf(void);
--- 28,42 ----
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_may_redraw_selection(int row, int col, int len);
! void clip_clear_selection(Clipboard_T *cbd);
void clip_may_clear_selection(int row1, int row2);
void clip_scroll_selection(int rows);
void clip_copy_modeless_selection(int both);
! int clip_gen_own_selection(Clipboard_T *cbd);
! void clip_gen_lose_selection(Clipboard_T *cbd);
! void clip_gen_set_selection(Clipboard_T *cbd);
! void clip_gen_request_selection(Clipboard_T *cbd);
! int clip_gen_owner_exists(Clipboard_T *cbd);
int vim_is_input_buf_full(void);
int vim_is_input_buf_empty(void);
int vim_free_in_input_buf(void);
***************
*** 57,68 ****
void open_app_context(void);
void x11_setup_atoms(Display *dpy);
void x11_setup_selection(Widget w);
! void clip_x11_request_selection(Widget myShell, Display *dpy, VimClipboard *cbd);
! void clip_x11_lose_selection(Widget myShell, VimClipboard *cbd);
! int clip_x11_own_selection(Widget myShell, VimClipboard *cbd);
! void clip_x11_set_selection(VimClipboard *cbd);
! int clip_x11_owner_exists(VimClipboard *cbd);
! void yank_cut_buffer0(Display *dpy, VimClipboard *cbd);
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);
win_T *mouse_find_win(int *rowp, int *colp, mouse_find_T popup);
--- 57,68 ----
void open_app_context(void);
void x11_setup_atoms(Display *dpy);
void x11_setup_selection(Widget w);
! void clip_x11_request_selection(Widget myShell, Display *dpy, Clipboard_T *cbd);
! void clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd);
! int clip_x11_own_selection(Widget myShell, Clipboard_T *cbd);
! void clip_x11_set_selection(Clipboard_T *cbd);
! int clip_x11_owner_exists(Clipboard_T *cbd);
! void yank_cut_buffer0(Display *dpy, Clipboard_T *cbd);
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);
win_T *mouse_find_win(int *rowp, int *colp, mouse_find_T popup);
*** ../vim-8.1.1530/src/winclip.c 2019-05-28 23:08:12.080648632 +0200
--- src/winclip.c 2019-06-14 21:29:01.589119367 +0200
***************
*** 191,197 ****
/*
* Vim's own clipboard format recognises whether the text is char, line,
* or rectangular block. Only useful for copying between two Vims.
! * "VimClipboard" was used for previous versions, using the first
* character to specify MCHAR, MLINE or MBLOCK.
*/
clip_star.format = RegisterClipboardFormat("VimClipboard2");
--- 191,197 ----
/*
* Vim's own clipboard format recognises whether the text is char, line,
* or rectangular block. Only useful for copying between two Vims.
! * "Clipboard_T" was used for previous versions, using the first
* character to specify MCHAR, MLINE or MBLOCK.
*/
clip_star.format = RegisterClipboardFormat("VimClipboard2");
***************
*** 212,218 ****
* Make vim the owner of the current selection. Return OK upon success.
*/
int
! clip_mch_own_selection(VimClipboard *cbd UNUSED)
{
/*
* Never actually own the clipboard. If another application sets the
--- 212,218 ----
* Make vim the owner of the current selection. Return OK upon success.
*/
int
! clip_mch_own_selection(Clipboard_T *cbd UNUSED)
{
/*
* Never actually own the clipboard. If another application sets the
***************
*** 225,231 ****
* Make vim NOT the owner of the current selection.
*/
void
! clip_mch_lose_selection(VimClipboard *cbd UNUSED)
{
/* Nothing needs to be done here */
}
--- 225,231 ----
* Make vim NOT the owner of the current selection.
*/
void
! clip_mch_lose_selection(Clipboard_T *cbd UNUSED)
{
/* Nothing needs to be done here */
}
***************
*** 293,299 ****
* <VN>
*/
void
! clip_mch_request_selection(VimClipboard *cbd)
{
VimClipType_t metadata = { -1, -1, -1, -1 };
HGLOBAL hMem = NULL;
--- 293,299 ----
* <VN>
*/
void
! clip_mch_request_selection(Clipboard_T *cbd)
{
VimClipType_t metadata = { -1, -1, -1, -1 };
HGLOBAL hMem = NULL;
***************
*** 453,459 ****
* Send the current selection to the clipboard.
*/
void
! clip_mch_set_selection(VimClipboard *cbd)
{
char_u *str = NULL;
VimClipType_t metadata;
--- 453,459 ----
* Send the current selection to the clipboard.
*/
void
! clip_mch_set_selection(Clipboard_T *cbd)
{
char_u *str = NULL;
VimClipType_t metadata;
*** ../vim-8.1.1530/src/proto/winclip.pro 2018-05-17 13:53:04.000000000 +0200
--- src/proto/winclip.pro 2019-06-14 21:32:06.020045917 +0200
***************
*** 4,13 ****
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 win_clip_init(void);
! int clip_mch_own_selection(VimClipboard *cbd);
! void clip_mch_lose_selection(VimClipboard *cbd);
! void clip_mch_request_selection(VimClipboard *cbd);
! void clip_mch_set_selection(VimClipboard *cbd);
short_u *enc_to_utf16(char_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);
--- 4,13 ----
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 win_clip_init(void);
! int clip_mch_own_selection(Clipboard_T *cbd);
! void clip_mch_lose_selection(Clipboard_T *cbd);
! void clip_mch_request_selection(Clipboard_T *cbd);
! void clip_mch_set_selection(Clipboard_T *cbd);
short_u *enc_to_utf16(char_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);
*** ../vim-8.1.1530/src/globals.h 2019-06-10 21:23:52.363724122 +0200
--- src/globals.h 2019-06-14 21:29:23.708988850 +0200
***************
*** 545,555 ****
#endif

#ifdef FEAT_CLIPBOARD
! EXTERN VimClipboard clip_star; /* PRIMARY selection in X11 */
# ifdef FEAT_X11
! EXTERN VimClipboard clip_plus; /* CLIPBOARD selection in X11 */
# else
! # define clip_plus clip_star /* there is only one clipboard */
# define ONE_CLIPBOARD
# endif

--- 545,555 ----
#endif

#ifdef FEAT_CLIPBOARD
! EXTERN Clipboard_T clip_star; // PRIMARY selection in X11
# ifdef FEAT_X11
! EXTERN Clipboard_T clip_plus; // CLIPBOARD selection in X11
# else
! # define clip_plus clip_star // there is only one clipboard
# define ONE_CLIPBOARD
# endif

*** ../vim-8.1.1530/src/proto.h 2019-06-09 13:42:36.424522190 +0200
--- src/proto.h 2019-06-14 21:29:46.376855624 +0200
***************
*** 320,328 ****
#endif
#if defined(MACOS_X_DARWIN) && defined(FEAT_CLIPBOARD) && !defined(FEAT_GUI)
/* functions in os_macosx.m */
! void clip_mch_lose_selection(VimClipboard *cbd);
! int clip_mch_own_selection(VimClipboard *cbd);
! void clip_mch_request_selection(VimClipboard *cbd);
! void clip_mch_set_selection(VimClipboard *cbd);
#endif
#endif /* !PROTO && !NOPROTO */
--- 320,328 ----
#endif
#if defined(MACOS_X_DARWIN) && defined(FEAT_CLIPBOARD) && !defined(FEAT_GUI)
/* functions in os_macosx.m */
! void clip_mch_lose_selection(Clipboard_T *cbd);
! int clip_mch_own_selection(Clipboard_T *cbd);
! void clip_mch_request_selection(Clipboard_T *cbd);
! void clip_mch_set_selection(Clipboard_T *cbd);
#endif
#endif /* !PROTO && !NOPROTO */
*** ../vim-8.1.1530/src/version.c 2019-06-14 20:47:46.267700564 +0200
--- src/version.c 2019-06-14 21:35:13.902980227 +0200
***************
*** 779,780 ****
--- 779,782 ----
{ /* Add new patch number below this line */
+ /**/
+ 1531,
/**/

--
If Microsoft would build a car...
... You'd have to press the "Start" button to turn the engine off.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

John Marriott

unread,
Jun 14, 2019, 4:59:00 PM6/14/19
to vim...@googlegroups.com

On 14-Jun-2019 19:37, Bram Moolenaar wrote:
> Patch 8.1.1531
> Problem: Clipboard type name is inconsistent.
> Solution: Rename VimClipboard to Clipboard_T.
> Files: src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro, src/gui_mac.c,
> src/proto/gui_mac.pro, src/gui_x11.c, src/proto/gui_x11.pro,
> src/ops.c, src/proto/ops.pro, src/os_qnx.c, src/proto/os_qnx.pro,
> src/os_unix.c, src/proto/os_unix.pro, src/ui.c, src/proto/ui.pro,
> src/winclip.c, src/proto/winclip.pro, src/globals.h, src/proto.h
>
After this patch, mingw64 (gcc 9.1.1) spews a bunch of errors. Here is a
sample:

<snip>

gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN -DFEA
T_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer
-freg-struct-return crypt.c -o gobjnative/crypt.o
In file included from proto.h:44,
                 from vim.h:2084,
                 from crypt.c:13:
proto/winclip.pro:7:28: error: unknown type name 'Clipboard_T'
    7 | int clip_mch_own_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/winclip.pro:8:30: error: unknown type name 'Clipboard_T'
    8 | void clip_mch_lose_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/winclip.pro:9:33: error: unknown type name 'Clipboard_T'
    9 | void clip_mch_request_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/winclip.pro:10:29: error: unknown type name 'Clipboard_T'
   10 | void clip_mch_set_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
In file included from proto.h:171,
                 from vim.h:2084,
                 from crypt.c:13:
proto/ops.pro:56:26: error: unknown type name 'Clipboard_T'
   56 | void clip_free_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ops.pro:57:25: error: unknown type name 'Clipboard_T'
   57 | void clip_get_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ops.pro:58:59: error: unknown type name 'Clipboard_T'
   58 | void clip_yank_selection(int type, char_u *str, long len,
Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ops.pro:59:55: error: unknown type name 'Clipboard_T'
   59 | int clip_convert_selection(char_u **str, long_u *len,
Clipboard_T *cbd);
      | ^~~~~~~~~~~
In file included from proto.h:202,
                 from vim.h:2084,
                 from crypt.c:13:
proto/ui.pro:18:28: error: unknown type name 'Clipboard_T'
   18 | void clip_update_selection(Clipboard_T *clip);
      | ^~~~~~~~~~~
proto/ui.pro:19:25: error: unknown type name 'Clipboard_T'
   19 | void clip_own_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:20:26: error: unknown type name 'Clipboard_T'
   20 | void clip_lose_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:31:27: error: unknown type name 'Clipboard_T'
   31 | void clip_clear_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:35:28: error: unknown type name 'Clipboard_T'
   35 | int clip_gen_own_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:36:30: error: unknown type name 'Clipboard_T'
   36 | void clip_gen_lose_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:37:29: error: unknown type name 'Clipboard_T'
   37 | void clip_gen_set_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:38:33: error: unknown type name 'Clipboard_T'
   38 | void clip_gen_request_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:39:27: error: unknown type name 'Clipboard_T'
   39 | int clip_gen_owner_exists(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:60:63: error: unknown type name 'Clipboard_T'
   60 | void clip_x11_request_selection(Widget myShell, Display *dpy,
Clipboard_T *cbd);
| ^~~~~~~~~~~
proto/ui.pro:61:46: error: unknown type name 'Clipboard_T'
   61 | void clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:62:44: error: unknown type name 'Clipboard_T'
   62 | int clip_x11_own_selection(Widget myShell, Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:63:29: error: unknown type name 'Clipboard_T'
   63 | void clip_x11_set_selection(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:64:27: error: unknown type name 'Clipboard_T'
   64 | int clip_x11_owner_exists(Clipboard_T *cbd);
      | ^~~~~~~~~~~
proto/ui.pro:65:37: error: unknown type name 'Clipboard_T'
   65 | void yank_cut_buffer0(Display *dpy, Clipboard_T *cbd);
      | ^~~~~~~~~~~
In file included from vim.h:2131,
                 from crypt.c:13:
globals.h:548:8: error: unknown type name 'Clipboard_T'
  548 | EXTERN Clipboard_T clip_star; // PRIMARY selection in X11
      | ^~~~~~~~~~~

</snip>


Please check the attached patch.

Cheers

vim.h.8.1.1531.patch
Reply all
Reply to author
Forward
0 new messages