window-copy.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef WINDOW_COPY_H
  2. #define WINDOW_COPY_H
  3. #include "tmux.h"
  4. enum window_copy_input_type {
  5. WINDOW_COPY_OFF,
  6. WINDOW_COPY_NAMEDBUFFER,
  7. WINDOW_COPY_NUMERICPREFIX,
  8. WINDOW_COPY_SEARCHUP,
  9. WINDOW_COPY_SEARCHDOWN,
  10. WINDOW_COPY_JUMPFORWARD,
  11. WINDOW_COPY_JUMPBACK,
  12. WINDOW_COPY_JUMPTOFORWARD,
  13. WINDOW_COPY_JUMPTOBACK,
  14. WINDOW_COPY_GOTOLINE,
  15. #ifdef TMATE
  16. WINDOW_COPY_PASSWORD,
  17. #endif
  18. };
  19. /*
  20. * Copy-mode's visible screen (the "screen" field) is filled from one of
  21. * two sources: the original contents of the pane (used when we
  22. * actually enter via the "copy-mode" command, to copy the contents of
  23. * the current pane), or else a series of lines containing the output
  24. * from an output-writing tmux command (such as any of the "show-*" or
  25. * "list-*" commands).
  26. *
  27. * In either case, the full content of the copy-mode grid is pointed at
  28. * by the "backing" field, and is copied into "screen" as needed (that
  29. * is, when scrolling occurs). When copy-mode is backed by a pane,
  30. * backing points directly at that pane's screen structure (&wp->base);
  31. * when backed by a list of output-lines from a command, it points at
  32. * a newly-allocated screen structure (which is deallocated when the
  33. * mode ends).
  34. */
  35. #ifdef TMATE
  36. typedef void (*copy_password_callback)(const char *password, void *private);
  37. #endif
  38. struct window_copy_mode_data {
  39. struct screen screen;
  40. struct screen *backing;
  41. int backing_written; /* backing display started */
  42. struct mode_key_data mdata;
  43. u_int oy;
  44. u_int selx;
  45. u_int sely;
  46. int rectflag; /* in rectangle copy mode? */
  47. int scroll_exit; /* exit on scroll to end? */
  48. u_int cx;
  49. u_int cy;
  50. u_int lastcx; /* position in last line w/ content */
  51. u_int lastsx; /* size of last line w/ content */
  52. enum window_copy_input_type inputtype;
  53. const char *inputprompt;
  54. char *inputstr;
  55. int inputexit;
  56. int numprefix;
  57. enum window_copy_input_type searchtype;
  58. char *searchstr;
  59. enum window_copy_input_type jumptype;
  60. char jumpchar;
  61. #ifdef TMATE
  62. copy_password_callback password_cb;
  63. void *password_cb_private;
  64. #endif
  65. };
  66. extern int window_copy_update_selection(struct window_pane *, int);
  67. extern void window_copy_redraw_screen(struct window_pane *);
  68. #endif