2019-02-03 13:47:36 -05:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
|
2018-10-03 17:46:18 -04:00
|
|
|
#pragma once
|
2019-02-03 13:47:36 -05:00
|
|
|
|
2018-12-31 09:27:18 -05:00
|
|
|
#include <xcb/render.h>
|
2019-01-01 06:01:47 -05:00
|
|
|
#include <xcb/xcb_image.h>
|
2018-12-31 09:27:18 -05:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include "region.h"
|
|
|
|
|
|
|
|
typedef struct session session_t;
|
|
|
|
typedef struct win win;
|
2019-01-01 06:01:47 -05:00
|
|
|
typedef struct conv conv;
|
2018-10-03 17:46:18 -04:00
|
|
|
|
2019-02-26 18:21:11 -05:00
|
|
|
bool build_shadow(xcb_connection_t *, xcb_drawable_t, double opacity, const int width,
|
|
|
|
const int height, const conv *kernel, xcb_render_picture_t shadow_pixel,
|
2019-02-20 13:17:16 -05:00
|
|
|
xcb_pixmap_t *pixmap, xcb_render_picture_t *pict);
|
2018-10-03 17:46:18 -04:00
|
|
|
|
2019-02-26 18:21:11 -05:00
|
|
|
xcb_render_picture_t solid_picture(xcb_connection_t *, xcb_drawable_t, bool argb,
|
|
|
|
double a, double r, double g, double b);
|
2018-12-31 09:27:18 -05:00
|
|
|
|
2019-01-01 06:35:59 -05:00
|
|
|
xcb_image_t *
|
|
|
|
make_shadow(xcb_connection_t *c, const conv *kernel, double opacity, int width, int height);
|
2019-02-03 13:41:02 -05:00
|
|
|
|
|
|
|
/// The default implementation of `is_win_transparent`, it simply looks at win::mode. So
|
|
|
|
/// this is not suitable for backends that alter the content of windows
|
|
|
|
bool default_is_win_transparent(void *, win *, void *);
|
|
|
|
|
|
|
|
/// The default implementation of `is_frame_transparent`, it uses win::frame_opacity. Same
|
|
|
|
/// caveat as `default_is_win_transparent` applies.
|
|
|
|
bool default_is_frame_transparent(void *, win *, void *);
|
2019-02-26 18:52:37 -05:00
|
|
|
|
|
|
|
void *default_backend_render_shadow(backend_t *backend_data, int width, int height,
|
2019-03-04 17:58:11 -05:00
|
|
|
const conv *kernel, double r, double g, double b, double a);
|