]> Pileus Git - ~andy/gtk/blob - gtk/gtkroundedboxprivate.h
42806c069a7eb94f07dad5269aeaba73233a6050
[~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                                                                  GtkCssBorderCornerRadius **corner,
54                                                                  GtkJunctionSides junction);
55 void            _gtk_rounded_box_apply_border_radius_for_engine (GtkRoundedBox       *box,
56                                                                  GtkThemingEngine    *engine,
57                                                                  GtkStateFlags        state,
58                                                                  GtkJunctionSides     junction);
59 void            _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox    *box,
60                                                                   GtkStyleContext  *context,
61                                                                   GtkStateFlags     state,
62                                                                   GtkJunctionSides  junction);
63
64 void            _gtk_rounded_box_shrink                         (GtkRoundedBox       *box,
65                                                                  double               top,
66                                                                  double               right,
67                                                                  double               bottom,
68                                                                  double               left);
69 void            _gtk_rounded_box_move                           (GtkRoundedBox       *box,
70                                                                  double               dx,
71                                                                  double               dy);
72
73 double          _gtk_rounded_box_guess_length                   (const GtkRoundedBox *box,
74                                                                  GtkCssSide           side);
75
76 void            _gtk_rounded_box_path                           (const GtkRoundedBox *box,
77                                                                  cairo_t             *cr);
78 void            _gtk_rounded_box_path_side                      (const GtkRoundedBox *box,
79                                                                  cairo_t             *cr,
80                                                                  GtkCssSide           side);
81 void            _gtk_rounded_box_path_top                       (const GtkRoundedBox *outer,
82                                                                  const GtkRoundedBox *inner,
83                                                                  cairo_t             *cr);
84 void            _gtk_rounded_box_path_right                     (const GtkRoundedBox *outer,
85                                                                  const GtkRoundedBox *inner,
86                                                                  cairo_t             *cr);
87 void            _gtk_rounded_box_path_bottom                    (const GtkRoundedBox *outer,
88                                                                  const GtkRoundedBox *inner,
89                                                                  cairo_t             *cr);
90 void            _gtk_rounded_box_path_left                      (const GtkRoundedBox *outer,
91                                                                  const GtkRoundedBox *inner,
92                                                                  cairo_t             *cr);
93 void            _gtk_rounded_box_clip_path                      (const GtkRoundedBox *box,
94                                                                  cairo_t             *cr);
95
96 G_END_DECLS
97
98 #endif /* __GTK_ROUNDED_BOX_PRIVATE_H__ */