Kristian Høgsberg | ffd710e | 2008-12-02 15:15:01 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2008 Kristian Høgsberg |
| 3 | * |
| 4 | * Permission to use, copy, modify, distribute, and sell this software and its |
| 5 | * documentation for any purpose is hereby granted without fee, provided that |
| 6 | * the above copyright notice appear in all copies and that both that copyright |
| 7 | * notice and this permission notice appear in supporting documentation, and |
| 8 | * that the name of the copyright holders not be used in advertising or |
| 9 | * publicity pertaining to distribution of the software without specific, |
| 10 | * written prior permission. The copyright holders make no representations |
| 11 | * about the suitability of this software for any purpose. It is provided "as |
| 12 | * is" without express or implied warranty. |
| 13 | * |
| 14 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
| 15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO |
| 16 | * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
| 17 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, |
| 18 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 19 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
| 20 | * OF THIS SOFTWARE. |
| 21 | */ |
| 22 | |
Kristian Høgsberg | 2f2cfae | 2008-11-08 22:46:30 -0500 | [diff] [blame] | 23 | #ifndef _CAIRO_UTIL_H |
| 24 | #define _CAIRO_UTIL_H |
| 25 | |
Kristian Høgsberg | 2f2cfae | 2008-11-08 22:46:30 -0500 | [diff] [blame] | 26 | void |
Benjamin Franzke | 47eb8f4 | 2011-10-07 09:08:56 +0200 | [diff] [blame] | 27 | surface_flush_device(cairo_surface_t *surface); |
| 28 | |
| 29 | void |
Kristian Høgsberg | 10bdd29 | 2008-11-08 23:27:27 -0500 | [diff] [blame] | 30 | blur_surface(cairo_surface_t *surface, int margin); |
Kristian Høgsberg | 2f2cfae | 2008-11-08 22:46:30 -0500 | [diff] [blame] | 31 | |
Kristian Høgsberg | dcb71b6 | 2010-06-15 17:16:35 -0400 | [diff] [blame] | 32 | void |
| 33 | tile_mask(cairo_t *cr, cairo_surface_t *surface, |
Kristian Høgsberg | 9a68624 | 2010-08-18 15:28:04 -0400 | [diff] [blame] | 34 | int x, int y, int width, int height, int margin, int top_margin); |
Kristian Høgsberg | dcb71b6 | 2010-06-15 17:16:35 -0400 | [diff] [blame] | 35 | |
| 36 | void |
| 37 | tile_source(cairo_t *cr, cairo_surface_t *surface, |
Kristian Høgsberg | 9a68624 | 2010-08-18 15:28:04 -0400 | [diff] [blame] | 38 | int x, int y, int width, int height, int margin, int top_margin); |
Kristian Høgsberg | dcb71b6 | 2010-06-15 17:16:35 -0400 | [diff] [blame] | 39 | |
Kristian Høgsberg | 1e164b9 | 2011-09-13 14:47:46 -0400 | [diff] [blame] | 40 | void |
| 41 | rounded_rect(cairo_t *cr, int x0, int y0, int x1, int y1, int radius); |
| 42 | |
Kristian Høgsberg | 27d3866 | 2011-10-20 13:11:12 -0400 | [diff] [blame] | 43 | cairo_surface_t * |
Kristian Høgsberg | f02a649 | 2012-03-12 01:05:25 -0400 | [diff] [blame] | 44 | load_cairo_surface(const char *filename); |
Kristian Høgsberg | 27d3866 | 2011-10-20 13:11:12 -0400 | [diff] [blame] | 45 | |
Kristian Høgsberg | 42abdf5 | 2012-05-15 22:14:27 -0400 | [diff] [blame] | 46 | struct theme { |
| 47 | cairo_surface_t *active_frame; |
| 48 | cairo_surface_t *inactive_frame; |
| 49 | cairo_surface_t *shadow; |
| 50 | int frame_radius; |
| 51 | int margin; |
| 52 | int width; |
| 53 | int titlebar_height; |
| 54 | }; |
| 55 | |
Kristian Høgsberg | 5adb480 | 2012-05-15 22:25:28 -0400 | [diff] [blame] | 56 | struct theme * |
| 57 | theme_create(void); |
Kristian Høgsberg | 42abdf5 | 2012-05-15 22:14:27 -0400 | [diff] [blame] | 58 | void |
Kristian Høgsberg | 5adb480 | 2012-05-15 22:25:28 -0400 | [diff] [blame] | 59 | theme_destroy(struct theme *t); |
| 60 | |
| 61 | #define THEME_FRAME_ACTIVE 1 |
| 62 | |
Kristian Høgsberg | 42abdf5 | 2012-05-15 22:14:27 -0400 | [diff] [blame] | 63 | void |
Kristian Høgsberg | 5adb480 | 2012-05-15 22:25:28 -0400 | [diff] [blame] | 64 | theme_render_frame(struct theme *t, |
| 65 | cairo_t *cr, int width, int height, |
| 66 | const char *title, uint32_t flags); |
Kristian Høgsberg | 42abdf5 | 2012-05-15 22:14:27 -0400 | [diff] [blame] | 67 | |
Kristian Høgsberg | 2f2cfae | 2008-11-08 22:46:30 -0500 | [diff] [blame] | 68 | #endif |