Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiplexer passthrough for graphics protocols #165

Merged
merged 30 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cc38947
doc: Remove the generic INSTALL instructions
hpjansson Sep 4, 2023
0802986
ChafaFrame: Add initial implementation
hpjansson Sep 6, 2023
bb8840b
ChafaImage: Add initial implementation
hpjansson Sep 6, 2023
ea8c11a
build: Add frame and image
hpjansson Sep 6, 2023
66bfb9b
seqs: Add tmux passthrough seqs
hpjansson Sep 6, 2023
49754f6
ChafaCanvasConfig: Add passthrough option to API
hpjansson Sep 6, 2023
4a1b394
seqs: Add kitty immediate virtual placement seq
hpjansson Sep 6, 2023
83a5897
ChafaCanvas, ChafaKittyCanvas: Implement encoding with tmux passthrough
hpjansson Sep 6, 2023
9ef588f
ChafaFrame, ChafaImage: Share innards with rest of library
hpjansson Sep 7, 2023
34b69f1
ChafaCanvas: Factor out the draw_all_pixels() logic
hpjansson Sep 7, 2023
9bd00cf
ChafaCanvas: Add API to draw from a ChafaImage with a placement ID
hpjansson Sep 7, 2023
c253bc8
chafa: Use ChafaImage to deliver pixel data
hpjansson Sep 7, 2023
2869459
chafa, PlacementCounter: Use rotating placement IDs for kitty graphics
hpjansson Sep 8, 2023
0e2831b
ChafaKittyCanvas: Don't generate 0 IDs, make the first 255 predictable
hpjansson Sep 9, 2023
10f64ae
ChafaTermDb: Pass through gfx seqs in tmux, and try to detect outer term
hpjansson Sep 9, 2023
3a1b5be
ChafaCanvas, ChafaSixelCanvas: Support passthrough for sixels
hpjansson Sep 9, 2023
2e3113d
chafa: Never produce a zero placement ID
hpjansson Sep 9, 2023
0618f27
ChafaTermDb, seqs: Add passthrough seqs for GNU Screen
hpjansson Sep 11, 2023
11048b9
ChafaCanvasConfig: Add support for GNU Screen passthrough to the API
hpjansson Sep 11, 2023
ac2f42e
ChafaPassthroughEncoder: Implement
hpjansson Sep 11, 2023
2f3eca4
ChafaSixelCanvas: Support GNU Screen passthrough
hpjansson Sep 11, 2023
987ed45
ChafaKittyCanvas: Use passthrough encoder and support GNU Screen
hpjansson Sep 11, 2023
1dad276
chafa: Add passthrough support to frontend
hpjansson Sep 11, 2023
a5a07e2
docs: Add --passthrough to man page
hpjansson Sep 11, 2023
7922f6e
ChafaKittyCanvas: Add workaround for glitches with big images in Screen
hpjansson Sep 11, 2023
1f97329
ChafaPassthroughEncoder: Add clarifying comment re. Screen's OSC buffer
hpjansson Sep 12, 2023
7ae2809
ChafaTermInfo: Add docstrings for new seq enums
hpjansson Sep 12, 2023
44dce64
ChafaCanvasConfig: Add dosctring for GNU Screen passthrough enum
hpjansson Sep 12, 2023
f2b5ef6
ChafaCanvas: Properly retain the assigned image, and document it
hpjansson Sep 12, 2023
c0ac2e0
libchafa: Sync docs
hpjansson Sep 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
368 changes: 0 additions & 368 deletions INSTALL

This file was deleted.

4 changes: 4 additions & 0 deletions chafa/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ libchafa_la_SOURCES = \
chafa-canvas.c \
chafa-canvas-config.c \
chafa-features.c \
chafa-frame.c \
chafa-image.c \
chafa-symbol-map.c \
chafa-term-db.c \
chafa-term-info.c \
Expand All @@ -28,6 +30,8 @@ chafainclude_HEADERS = \
chafa-canvas-config.h \
chafa-common.h \
chafa-features.h \
chafa-frame.h \
chafa-image.h \
chafa-symbol-map.h \
chafa-term-db.h \
chafa-term-info.h \
Expand Down
57 changes: 57 additions & 0 deletions chafa/chafa-canvas-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@
* @CHAFA_OPTIMIZATION_ALL: All optimizations enabled.
**/

/**
* ChafaPassthrough:
* @CHAFA_PASSTHROUGH_NONE: No passthrough guards will be used.
* @CHAFA_PASSTHROUGH_SCREEN: Passthrough guards for GNU Screen will be used.
* @CHAFA_PASSTHROUGH_TMUX: Passthrough guards for tmux will be used.
* @CHAFA_PASSTHROUGH_MAX: Last supported passthrough mode plus one.
**/

/* Private */

void
Expand Down Expand Up @@ -937,3 +945,52 @@ chafa_canvas_config_set_fg_only_enabled (ChafaCanvasConfig *config, gboolean fg_

config->fg_only_enabled = fg_only_enabled;
}

/**
* chafa_canvas_config_get_passthrough:
* @config: A #ChafaCanvasConfig
*
* Returns @config's #ChafaPassthrough setting. This defaults to
* #CHAFA_PASSTHROUGH_NONE.
*
* Passthrough is needed to transmit certain escape codes to the outer terminal
* when running in an inner terminal environment like tmux. When enabled, this
* will happen automatically as needed, dictated by information contained in a
* #ChafaTermInfo.
*
* Returns: The #ChafaPassthrough setting
*
* Since: 1.14
**/
ChafaPassthrough
chafa_canvas_config_get_passthrough (const ChafaCanvasConfig *config)
{
g_return_val_if_fail (config != NULL, CHAFA_PASSTHROUGH_NONE);
g_return_val_if_fail (config->refs > 0, CHAFA_PASSTHROUGH_NONE);

return config->passthrough;
}

/**
* chafa_canvas_config_set_passthrough:
* @config: A #ChafaCanvasConfig
* @passthrough: A #ChafaPassthrough value
*
* Indicates which passthrough mode to use. This defaults to
* #CHAFA_PASSTHROUGH_NONE.
*
* Passthrough is needed to transmit certain escape codes to the outer terminal
* when running in an inner terminal environment like tmux. When enabled, this
* will happen automatically as needed, dictated by information contained in a
* #ChafaTermInfo.
*
* Since: 1.14
**/
void
chafa_canvas_config_set_passthrough (ChafaCanvasConfig *config, ChafaPassthrough passthrough)
{
g_return_if_fail (config != NULL);
g_return_if_fail (config->refs > 0);

config->passthrough = passthrough;
}
17 changes: 17 additions & 0 deletions chafa/chafa-canvas-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ typedef enum
}
ChafaOptimizations;

/* Passthrough modes */

typedef enum
{
CHAFA_PASSTHROUGH_NONE,
CHAFA_PASSTHROUGH_SCREEN,
CHAFA_PASSTHROUGH_TMUX,

CHAFA_PASSTHROUGH_MAX
}
ChafaPassthrough;

/* Canvas config */

typedef struct ChafaCanvasConfig ChafaCanvasConfig;
Expand Down Expand Up @@ -210,6 +222,11 @@ gboolean chafa_canvas_config_get_fg_only_enabled (const ChafaCanvasConfig *confi
CHAFA_AVAILABLE_IN_1_8
void chafa_canvas_config_set_fg_only_enabled (ChafaCanvasConfig *config, gboolean fg_only_enabled);

CHAFA_AVAILABLE_IN_1_14
ChafaPassthrough chafa_canvas_config_get_passthrough (const ChafaCanvasConfig *config);
CHAFA_AVAILABLE_IN_1_14
void chafa_canvas_config_set_passthrough (ChafaCanvasConfig *config, ChafaPassthrough passthrough);

G_END_DECLS

#endif /* __CHAFA_CANVAS_CONFIG_H__ */
Loading