2019-02-17 11:54:04 +00:00
|
|
|
/*
|
|
|
|
* 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>
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2019-02-28 08:52:49 +00:00
|
|
|
#ifndef __GSK_TRANSFORM_H__
|
|
|
|
#define __GSK_TRANSFORM_H__
|
2019-02-17 11:54:04 +00:00
|
|
|
|
2019-02-28 08:52:49 +00:00
|
|
|
#if !defined (__GSK_H_INSIDE__) && !defined (GSK_COMPILATION)
|
|
|
|
#error "Only <gsk/gsk.h> can be included directly."
|
2019-02-17 11:54:04 +00:00
|
|
|
#endif
|
|
|
|
|
2019-03-01 06:51:23 +00:00
|
|
|
#include <gsk/gskenums.h>
|
2019-02-28 08:52:49 +00:00
|
|
|
#include <gsk/gsktypes.h>
|
2019-02-17 11:54:04 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2019-02-28 08:52:49 +00:00
|
|
|
#define GSK_TYPE_TRANSFORM (gsk_transform_get_type ())
|
2019-02-17 11:54:04 +00:00
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GType gsk_transform_get_type (void) G_GNUC_CONST;
|
2019-02-17 11:54:04 +00:00
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_ref (GskTransform *self);
|
2019-02-17 11:54:04 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
void gsk_transform_unref (GskTransform *self);
|
2019-02-17 11:54:04 +00:00
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
void gsk_transform_print (GskTransform *self,
|
2019-02-17 11:54:04 +00:00
|
|
|
GString *string);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
char * gsk_transform_to_string (GskTransform *self);
|
2019-02-17 11:54:04 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-03-21 04:52:41 +00:00
|
|
|
gboolean gsk_transform_parse (const char *string,
|
|
|
|
GskTransform **out_transform);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
void gsk_transform_to_matrix (GskTransform *self,
|
2019-02-17 11:54:04 +00:00
|
|
|
graphene_matrix_t *out_matrix);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-03-04 18:33:04 +00:00
|
|
|
void gsk_transform_to_2d (GskTransform *self,
|
2019-03-01 05:24:33 +00:00
|
|
|
float *out_xx,
|
|
|
|
float *out_yx,
|
|
|
|
float *out_xy,
|
|
|
|
float *out_yy,
|
|
|
|
float *out_dx,
|
2019-03-04 18:33:04 +00:00
|
|
|
float *out_dy);
|
2019-03-01 05:24:33 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-03-04 18:33:04 +00:00
|
|
|
void gsk_transform_to_affine (GskTransform *self,
|
2019-03-01 05:24:33 +00:00
|
|
|
float *out_scale_x,
|
|
|
|
float *out_scale_y,
|
|
|
|
float *out_dx,
|
2019-03-04 18:33:04 +00:00
|
|
|
float *out_dy);
|
2019-03-01 05:24:33 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-03-04 18:33:04 +00:00
|
|
|
void gsk_transform_to_translate (GskTransform *self,
|
2019-03-01 05:24:33 +00:00
|
|
|
float *out_dx,
|
2019-03-04 18:33:04 +00:00
|
|
|
float *out_dy);
|
2019-03-01 05:24:33 +00:00
|
|
|
|
2019-03-01 06:51:23 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GskTransformCategory gsk_transform_get_category (GskTransform *self) G_GNUC_PURE;
|
2019-03-01 05:24:33 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
gboolean gsk_transform_equal (GskTransform *first,
|
|
|
|
GskTransform *second) G_GNUC_PURE;
|
2019-02-17 11:54:04 +00:00
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_new (void);
|
2019-02-17 11:54:04 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_transform (GskTransform *next,
|
|
|
|
GskTransform *other);
|
2019-02-17 11:54:04 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-03-03 16:57:11 +00:00
|
|
|
GskTransform * gsk_transform_invert (GskTransform *self);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_matrix (GskTransform *next,
|
2019-02-17 11:54:04 +00:00
|
|
|
const graphene_matrix_t *matrix);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_translate (GskTransform *next,
|
2019-02-17 11:54:04 +00:00
|
|
|
const graphene_point_t *point);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_translate_3d (GskTransform *next,
|
2019-02-17 11:54:04 +00:00
|
|
|
const graphene_point3d_t *point);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_rotate (GskTransform *next,
|
2019-02-17 11:54:04 +00:00
|
|
|
float angle);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_rotate_3d (GskTransform *next,
|
2019-02-17 11:54:04 +00:00
|
|
|
float angle,
|
|
|
|
const graphene_vec3_t *axis);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_scale (GskTransform *next,
|
2019-02-17 11:54:04 +00:00
|
|
|
float factor_x,
|
|
|
|
float factor_y);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2019-02-28 08:52:49 +00:00
|
|
|
GskTransform * gsk_transform_scale_3d (GskTransform *next,
|
2019-02-17 11:54:04 +00:00
|
|
|
float factor_x,
|
|
|
|
float factor_y,
|
|
|
|
float factor_z);
|
2019-03-05 08:27:30 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GskTransform * gsk_transform_perspective (GskTransform *next,
|
|
|
|
float depth);
|
2019-02-17 11:54:04 +00:00
|
|
|
|
2019-03-01 05:24:33 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
void gsk_transform_transform_bounds (GskTransform *self,
|
|
|
|
const graphene_rect_t *rect,
|
|
|
|
graphene_rect_t *out_rect);
|
|
|
|
|
2019-02-17 11:54:04 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2019-02-28 08:52:49 +00:00
|
|
|
#endif /* __GSK_TRANSFORM_H__ */
|