1 /* Dia -- an diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program 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
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 /*! \file handle.h - describing the different behavious of handles, used e.g. to resize objects */
26 /*! Some object resizing depends on the placement of the handle */
28 HANDLE_RESIZE_NW
, /*!< north/west or top/left */
29 HANDLE_RESIZE_N
, /*!< north or top */
30 HANDLE_RESIZE_NE
, /*!< north/east or top/right */
31 HANDLE_RESIZE_W
, /*!< west or left */
32 HANDLE_RESIZE_E
, /*!< east or right */
33 HANDLE_RESIZE_SW
, /*!< south/west or bottom/left */
34 HANDLE_RESIZE_S
, /*!< south or bottom */
35 HANDLE_RESIZE_SE
, /*!< south/east or bottom/right */
36 HANDLE_MOVE_STARTPOINT
, /*!< for lines: the beginning */
37 HANDLE_MOVE_ENDPOINT
, /*!< for lines: the ending */
39 /*! These handles can be used privately by objects: */
51 /*! HandleType is used for color coding the different handles */
57 NUM_HANDLE_TYPES
/* Must be last */
60 /*! When an objects move_handle() function is called this is passed in */
63 HANDLE_MOVE_USER_FINAL
,
64 HANDLE_MOVE_CONNECTED
,
65 HANDLE_MOVE_CREATE
, /*!< the initial drag during object placement */
66 HANDLE_MOVE_CREATE_FINAL
/*!< finish of initial drag */
69 /*! If the handle is connectable or not */
71 HANDLE_NONCONNECTABLE
, /*!< not connectable */
72 HANDLE_CONNECTABLE
, /*!< connectable */
73 HANDLE_CONNECTABLE_NOBREAK
/*!< (unused) Don't break connection on object move */
77 * \brief A handle is used to resize objects or to connet to them.
80 HandleId id
; /*!< gives (mostly) the placement relative to the object */
81 HandleType type
; /*!< color coding */
82 Point pos
; /*! where the handle currently is in diagram coordinates */
84 HandleConnectType connect_type
; /*!< how to connect if at all */
85 ConnectionPoint
*connected_to
; /*!< NULL if not connected */