tmux  3.2a
About: tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal.
  Fossies Dox: tmux-3.2a.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

window-buffer.c File Reference
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "tmux.h"
Include dependency graph for window-buffer.c:

Go to the source code of this file.

Data Structures

struct  window_buffer_itemdata
 
struct  window_buffer_modedata
 
struct  window_buffer_editdata
 

Macros

#define WINDOW_BUFFER_DEFAULT_COMMAND   "paste-buffer -b '%%'"
 
#define WINDOW_BUFFER_DEFAULT_FORMAT    "#{t/p:buffer_created}: #{buffer_sample}"
 
#define WINDOW_BUFFER_DEFAULT_KEY_FORMAT
 

Enumerations

enum  window_buffer_sort_type { WINDOW_BUFFER_BY_TIME , WINDOW_BUFFER_BY_NAME , WINDOW_BUFFER_BY_SIZE }
 

Functions

static struct screenwindow_buffer_init (struct window_mode_entry *, struct cmd_find_state *, struct args *)
 
static void window_buffer_free (struct window_mode_entry *)
 
static void window_buffer_resize (struct window_mode_entry *, u_int, u_int)
 
static void window_buffer_update (struct window_mode_entry *)
 
static void window_buffer_key (struct window_mode_entry *, struct client *, struct session *, struct winlink *, key_code, struct mouse_event *)
 
static struct window_buffer_itemdatawindow_buffer_add_item (struct window_buffer_modedata *data)
 
static void window_buffer_free_item (struct window_buffer_itemdata *item)
 
static int window_buffer_cmp (const void *a0, const void *b0)
 
static void window_buffer_build (void *modedata, struct mode_tree_sort_criteria *sort_crit, uint64_t *tag, const char *filter)
 
static void window_buffer_draw (void *modedata, void *itemdata, struct screen_write_ctx *ctx, u_int sx, u_int sy)
 
static int window_buffer_search (void *modedata, void *itemdata, const char *ss)
 
static void window_buffer_menu (void *modedata, struct client *c, key_code key)
 
static key_code window_buffer_get_key (void *modedata, void *itemdata, u_int line)
 
static void window_buffer_do_delete (void *modedata, void *itemdata, struct client *c, key_code key)
 
static void window_buffer_do_paste (void *modedata, void *itemdata, struct client *c, key_code key)
 
static void window_buffer_finish_edit (struct window_buffer_editdata *ed)
 
static void window_buffer_edit_close_cb (char *buf, size_t len, void *arg)
 
static void window_buffer_start_edit (struct window_buffer_modedata *data, struct window_buffer_itemdata *item, struct client *c)
 

Variables

static const struct menu_item window_buffer_menu_items []
 
const struct window_mode window_buffer_mode
 
static const char * window_buffer_sort_list []
 
static struct mode_tree_sort_criteriawindow_buffer_sort
 

Macro Definition Documentation

◆ WINDOW_BUFFER_DEFAULT_COMMAND

#define WINDOW_BUFFER_DEFAULT_COMMAND   "paste-buffer -b '%%'"

Definition at line 39 of file window-buffer.c.

◆ WINDOW_BUFFER_DEFAULT_FORMAT

#define WINDOW_BUFFER_DEFAULT_FORMAT    "#{t/p:buffer_created}: #{buffer_sample}"

Definition at line 41 of file window-buffer.c.

◆ WINDOW_BUFFER_DEFAULT_KEY_FORMAT

#define WINDOW_BUFFER_DEFAULT_KEY_FORMAT
Value:
"#{?#{e|<:#{line},10}," \
"#{line}" \
"," \
"#{?#{e|<:#{line},36}," \
"M-#{a:#{e|+:97,#{e|-:#{line},10}}}" \
"," \
"" \
"}" \
"}"

Definition at line 44 of file window-buffer.c.

Enumeration Type Documentation

◆ window_buffer_sort_type

Enumerator
WINDOW_BUFFER_BY_TIME 
WINDOW_BUFFER_BY_NAME 
WINDOW_BUFFER_BY_SIZE 

Definition at line 82 of file window-buffer.c.

Function Documentation

◆ window_buffer_add_item()

static struct window_buffer_itemdata* window_buffer_add_item ( struct window_buffer_modedata data)
static

◆ window_buffer_build()

◆ window_buffer_cmp()

static int window_buffer_cmp ( const void *  a0,
const void *  b0 
)
static

◆ window_buffer_do_delete()

static void window_buffer_do_delete ( void *  modedata,
void *  itemdata,
struct client c,
key_code  key 
)
static

◆ window_buffer_do_paste()

static void window_buffer_do_paste ( void *  modedata,
void *  itemdata,
struct client c,
key_code  key 
)
static

◆ window_buffer_draw()

static void window_buffer_draw ( void *  modedata,
void *  itemdata,
struct screen_write_ctx ctx,
u_int  sx,
u_int  sy 
)
static

◆ window_buffer_edit_close_cb()

◆ window_buffer_finish_edit()

static void window_buffer_finish_edit ( struct window_buffer_editdata ed)
static

◆ window_buffer_free()

static void window_buffer_free ( struct window_mode_entry wme)
static

◆ window_buffer_free_item()

static void window_buffer_free_item ( struct window_buffer_itemdata item)
static

Definition at line 131 of file window-buffer.c.

References window_buffer_itemdata::name.

Referenced by window_buffer_build(), and window_buffer_free().

◆ window_buffer_get_key()

◆ window_buffer_init()

◆ window_buffer_key()

◆ window_buffer_menu()

static void window_buffer_menu ( void *  modedata,
struct client c,
key_code  key 
)
static

◆ window_buffer_resize()

static void window_buffer_resize ( struct window_mode_entry wme,
u_int  sx,
u_int  sy 
)
static

◆ window_buffer_search()

static int window_buffer_search ( void *  modedata,
void *  itemdata,
const char *  ss 
)
static

◆ window_buffer_start_edit()

◆ window_buffer_update()

static void window_buffer_update ( struct window_mode_entry wme)
static

Variable Documentation

◆ window_buffer_menu_items

const struct menu_item window_buffer_menu_items[]
static
Initial value:
= {
{ "Paste", 'p', NULL },
{ "Paste Tagged", 'P', NULL },
{ "", 0x000ff000000000ULL , NULL },
{ "Tag", 't', NULL },
{ "Tag All", '\024', NULL },
{ "Tag None", 'T', NULL },
{ "", 0x000ff000000000ULL , NULL },
{ "Delete", 'd', NULL },
{ "Delete Tagged", 'D', NULL },
{ "", 0x000ff000000000ULL , NULL },
{ "Cancel", 'q', NULL },
{ NULL, 0x000ff000000000ULL , NULL }
}

Definition at line 35 of file window-buffer.c.

Referenced by window_buffer_init().

◆ window_buffer_mode

const struct window_mode window_buffer_mode
Initial value:
= {
.name = "buffer-mode",
.default_format = "#{t/p:buffer_created}: #{buffer_sample}" ,
}
static void window_buffer_update(struct window_mode_entry *)
static struct screen * window_buffer_init(struct window_mode_entry *, struct cmd_find_state *, struct args *)
static void window_buffer_free(struct window_mode_entry *)
static void window_buffer_resize(struct window_mode_entry *, u_int, u_int)
static void window_buffer_key(struct window_mode_entry *, struct client *, struct session *, struct winlink *, key_code, struct mouse_event *)

Definition at line 35 of file window-buffer.c.

Referenced by format_cb_buffer_mode_format(), and window_buffer_edit_close_cb().

◆ window_buffer_sort

struct mode_tree_sort_criteria* window_buffer_sort
static

Definition at line 92 of file window-buffer.c.

Referenced by window_buffer_build(), and window_buffer_cmp().

◆ window_buffer_sort_list

const char* window_buffer_sort_list[]
static
Initial value:
= {
"time",
"name",
"size"
}

Definition at line 87 of file window-buffer.c.

Referenced by window_buffer_init().