summaryrefslogtreecommitdiffstats
path: root/src/seltrans-handles.h
blob: 0afa552ea0183b45398970566c59d3b42a13fa82 (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
#ifndef __SP_SELTRANS_HANDLES_H__
#define __SP_SELTRANS_HANDLES_H__

/*
 * Seltrans knots
 *
 * Authors:
 *   Lauris Kaplinski <lauris@kaplinski.com>
 *
 * Copyright (C) 1999-2002 authors
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#include "display/sodipodi-ctrl.h"

namespace Inkscape
{
  class SelTrans;
}

class SPSelTransHandle;

// request handlers
gboolean sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans,
				    SPSelTransHandle const &handle, NR::Point &p, guint state);
gboolean sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans,
				      SPSelTransHandle const &handle, NR::Point &p, guint state);
gboolean sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans,
				   SPSelTransHandle const &handle, NR::Point &p, guint state);
gboolean sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans,
				     SPSelTransHandle const &handle, NR::Point &p, guint state);
gboolean sp_sel_trans_center_request(Inkscape::SelTrans *seltrans,
				     SPSelTransHandle const &handle, NR::Point &p, guint state);

// action handlers
void sp_sel_trans_scale(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state);
void sp_sel_trans_stretch(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state);
void sp_sel_trans_skew(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state);
void sp_sel_trans_rotate(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state);
void sp_sel_trans_center(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state);

struct SPSelTransHandle {
	GtkAnchorType anchor;
	GdkCursorType cursor;
	guint control;
	void (* action) (Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state);
	gboolean (* request) (Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state);
	gdouble x, y;
};

extern SPSelTransHandle const handles_scale[8];
extern SPSelTransHandle const handles_rotate[8];
extern SPSelTransHandle const handle_center;

#endif