]> Pileus Git - ~andy/gtk/blob - gtk/gtkroundedboxprivate.h
css: Convert border-radius to GtkCssNumber
[~andy/gtk] / gtk / gtkroundedboxprivate.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GTK_ROUNDED_BOX_PRIVATE_H__
21 #define __GTK_ROUNDED_BOX_PRIVATE_H__
22
23 #include <glib-object.h>
24 #include <cairo.h>
25 #include <gtk/gtkenums.h>
26 #include <gtk/gtkthemingengine.h>
27
28 #include "gtkcsstypesprivate.h"
29
30 G_BEGIN_DECLS
31
32 typedef struct _GtkRoundedBox GtkRoundedBox;
33 typedef struct _GtkRoundedBoxCorner GtkRoundedBoxCorner;
34
35 struct _GtkRoundedBoxCorner {
36   double                   horizontal;
37   double                   vertical;
38 };
39
40 struct _GtkRoundedBox {
41   /*< private >*/
42   cairo_rectangle_t        box;
43   GtkRoundedBoxCorner      corner[4];
44 };
45
46 void            _gtk_rounded_box_init_rect                      (GtkRoundedBox       *box,
47                                                                  double               x,
48                                                                  double               y,
49                                                                  double               width,
50                                                                  double               height);
51
52 void            _gtk_rounded_box_apply_border_radius            (GtkRoundedBox       *box,
53                                                                  GtkThemingEngine    *engine,
54                                                                  GtkStateFlags        state,
55                                                                  GtkJunctionSides     junction);
56 void            _gtk_rounded_box_shrink                         (GtkRoundedBox       *box,
57                                                                  double               top,
58                                                                  double               right,
59                                                                  double               bottom,
60                                                                  double               left);
61 void            _gtk_rounded_box_move                           (GtkRoundedBox       *box,
62                                                                  double               dx,
63                                                                  double               dy);
64
65 double          _gtk_rounded_box_guess_length                   (const GtkRoundedBox *box,
66                                                                  GtkCssSide           side);
67
68 void            _gtk_rounded_box_path                           (const GtkRoundedBox *box,
69                                                                  cairo_t             *cr);
70 void            _gtk_rounded_box_path_side                      (const GtkRoundedBox *box,
71                                                                  cairo_t             *cr,
72                                                                  GtkCssSide           side);
73 void            _gtk_rounded_box_path_top                       (const GtkRoundedBox *outer,
74                                                                  const GtkRoundedBox *inner,
75                                                                  cairo_t             *cr);
76 void            _gtk_rounded_box_path_right                     (const GtkRoundedBox *outer,
77                                                                  const GtkRoundedBox *inner,
78                                                                  cairo_t             *cr);
79 void            _gtk_rounded_box_path_bottom                    (const GtkRoundedBox *outer,
80                                                                  const GtkRoundedBox *inner,
81                                                                  cairo_t             *cr);
82 void            _gtk_rounded_box_path_left                      (const GtkRoundedBox *outer,
83                                                                  const GtkRoundedBox *inner,
84                                                                  cairo_t             *cr);
85 void            _gtk_rounded_box_clip_path                      (const GtkRoundedBox *box,
86                                                                  cairo_t             *cr);
87
88 G_END_DECLS
89
90 #endif /* __GTK_ROUNDED_BOX_PRIVATE_H__ */