summaryrefslogtreecommitdiff
path: root/gsk/gsktransform.h
blob: f3676bca631cf0d393dcf969de5124b14a093a66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
 * Copyright © 2019 Benjamin Otte
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Benjamin Otte <otte@gnome.org>
 */


#ifndef __GSK_TRANSFORM_H__
#define __GSK_TRANSFORM_H__

#if !defined (__GSK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gsk/gsk.h> can be included directly."
#endif

#include <gsk/gskenums.h>
#include <gsk/gsktypes.h>

G_BEGIN_DECLS

#define GSK_TYPE_TRANSFORM (gsk_transform_get_type ())

GDK_AVAILABLE_IN_ALL
GType                   gsk_transform_get_type                  (void) G_GNUC_CONST;

GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_ref                       (GskTransform                   *self);
GDK_AVAILABLE_IN_ALL
void                    gsk_transform_unref                     (GskTransform                   *self);

GDK_AVAILABLE_IN_ALL
void                    gsk_transform_print                     (GskTransform                   *self,
                                                                 GString                        *string);
GDK_AVAILABLE_IN_ALL
char *                  gsk_transform_to_string                 (GskTransform                   *self);
GDK_AVAILABLE_IN_ALL
gboolean                gsk_transform_parse                     (const char                     *string,
                                                                 GskTransform                  **out_transform);
GDK_AVAILABLE_IN_ALL
void                    gsk_transform_to_matrix                 (GskTransform                   *self,
                                                                 graphene_matrix_t              *out_matrix);
GDK_AVAILABLE_IN_ALL
void                    gsk_transform_to_2d                     (GskTransform                   *self,
                                                                 float                          *out_xx,
                                                                 float                          *out_yx,
                                                                 float                          *out_xy,
                                                                 float                          *out_yy,
                                                                 float                          *out_dx,
                                                                 float                          *out_dy);
GDK_AVAILABLE_IN_ALL
void                    gsk_transform_to_affine                 (GskTransform                   *self,
                                                                 float                          *out_scale_x,
                                                                 float                          *out_scale_y,
                                                                 float                          *out_dx,
                                                                 float                          *out_dy);
GDK_AVAILABLE_IN_ALL
void                    gsk_transform_to_translate              (GskTransform                   *self,
                                                                 float                          *out_dx,
                                                                 float                          *out_dy);

GDK_AVAILABLE_IN_ALL
GskTransformCategory    gsk_transform_get_category              (GskTransform                   *self) G_GNUC_PURE;
GDK_AVAILABLE_IN_ALL
gboolean                gsk_transform_equal                     (GskTransform                   *first,
                                                                 GskTransform                   *second) G_GNUC_PURE;

GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_new                       (void);
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_transform                 (GskTransform                   *next,
                                                                 GskTransform                   *other) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_invert                    (GskTransform                   *self) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_matrix                    (GskTransform                   *next,
                                                                 const graphene_matrix_t        *matrix) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_translate                 (GskTransform                   *next,
                                                                 const graphene_point_t         *point) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_translate_3d              (GskTransform                   *next,
                                                                 const graphene_point3d_t       *point) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_rotate                    (GskTransform                   *next,
                                                                 float                           angle) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_rotate_3d                 (GskTransform                   *next,
                                                                 float                           angle,
                                                                 const graphene_vec3_t          *axis) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_scale                     (GskTransform                   *next,
                                                                 float                           factor_x,
                                                                 float                           factor_y) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_scale_3d                  (GskTransform                   *next,
                                                                 float                           factor_x,
                                                                 float                           factor_y,
                                                                 float                           factor_z) G_GNUC_WARN_UNUSED_RESULT;
GDK_AVAILABLE_IN_ALL
GskTransform *          gsk_transform_perspective               (GskTransform                   *next,
                                                                 float                           depth) G_GNUC_WARN_UNUSED_RESULT;

GDK_AVAILABLE_IN_ALL
void                    gsk_transform_transform_bounds          (GskTransform                   *self,
                                                                 const graphene_rect_t          *rect,
                                                                 graphene_rect_t                *out_rect);
GDK_AVAILABLE_IN_ALL
void                    gsk_transform_transform_point           (GskTransform                   *self,
                                                                 const graphene_point_t          *point,
                                                                 graphene_point_t                *out_point);


G_END_DECLS

#endif /* __GSK_TRANSFORM_H__ */