mirror of
https://codeberg.org/vyivel/dulcepan/
synced 2025-12-22 17:56:49 +02:00
Add fancy borders
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
#include <wayland-util.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#define DP_PI 3.14159265358979323846
|
||||
// sqrt(2) / 2
|
||||
#define DP_SQRT2_2 0.7071067811865476
|
||||
|
||||
// Per-output
|
||||
#define DP_SWAPCHAIN_LEN 2
|
||||
|
||||
@@ -128,14 +132,28 @@ enum dp_file_format {
|
||||
DP_FILE_PPM,
|
||||
};
|
||||
|
||||
enum dp_border_gradient {
|
||||
DP_BORDER_GRADIENT_NONE,
|
||||
DP_BORDER_GRADIENT_LINEAR,
|
||||
DP_BORDER_GRADIENT_LOOP,
|
||||
};
|
||||
|
||||
struct dp_config {
|
||||
// RGBA, not premultiplied
|
||||
float unselected_color[4];
|
||||
float selected_color[4];
|
||||
float border_color[4];
|
||||
float border_secondary_color[4];
|
||||
|
||||
xkb_keysym_t quit_key;
|
||||
xkb_keysym_t save_key;
|
||||
|
||||
int border_size; // 0 if disabled
|
||||
enum dp_border_gradient border_gradient;
|
||||
double gradient_angle; // In radians
|
||||
int loop_step;
|
||||
int animation_duration; // In milliseconds
|
||||
|
||||
int png_compression;
|
||||
bool quick_select;
|
||||
};
|
||||
@@ -172,6 +190,11 @@ struct dp_state {
|
||||
enum dp_file_format output_format;
|
||||
|
||||
bool show_cursors;
|
||||
|
||||
cairo_pattern_t *border_pattern;
|
||||
cairo_matrix_t precomputed_linear_matrix;
|
||||
double loop_step_scale;
|
||||
double time_multiplier;
|
||||
};
|
||||
|
||||
void dp_config_load(struct dp_state *state, const char *user_path);
|
||||
@@ -207,6 +230,8 @@ void dp_log_fatal(const char *fmt, ...);
|
||||
void *dp_zalloc(size_t size);
|
||||
char *dp_strdup(const char *str);
|
||||
|
||||
void dp_matrix_compute_linear(cairo_matrix_t *matrix, double angle);
|
||||
|
||||
const char *dp_ext_from_path(const char *path);
|
||||
enum dp_file_format dp_ext_to_format(const char *ext);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user