3 * Copyright (C) 2005 Laboratoire d'Informatique de Paris 6
4 * Author: Pierre Duquesne
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "pixmaps/aadlthread.xpm"
25 /***********************************************
27 ***********************************************/
30 static void aadlthread_draw_borders(Aadlbox
*aadlbox
, DiaRenderer
*renderer
)
32 aadlbox_draw_inclined_box(aadlbox
, renderer
, LINESTYLE_DASHED
);
35 static void aadlthread_draw(Aadlbox
*aadlbox
, DiaRenderer
*renderer
)
37 aadlthread_draw_borders(aadlbox
, renderer
);
38 aadlbox_draw(aadlbox
, renderer
);
41 static Aadlbox_specific aadlthread_specific
=
43 (AadlProjectionFunc
) aadlbox_inclined_project_point_on_nearest_border
,
44 (AadlTextPosFunc
) aadlprocess_text_position
,
45 (AadlSizeFunc
) aadlprocess_minsize
49 ObjectTypeOps aadlthread_type_ops
;
51 DiaObjectType aadlthread_type
=
53 "AADL - Thread", /* name */
55 (char **) aadlthread_xpm
, /* pixmap */
57 &aadlthread_type_ops
, /* ops */
59 &aadlthread_specific
/* user data */
63 static ObjectOps aadlthread_ops
=
65 (DestroyFunc
) aadlbox_destroy
,
66 (DrawFunc
) aadlthread_draw
, /* redefined */
67 (DistanceFunc
) aadlbox_distance_from
,
68 (SelectFunc
) aadlbox_select
,
69 (CopyFunc
) aadlbox_copy
,
70 (MoveFunc
) aadlbox_move
,
71 (MoveHandleFunc
) aadlbox_move_handle
,
72 (GetPropertiesFunc
) object_create_props_dialog
,
73 (ApplyPropertiesFunc
) object_apply_props_from_dialog
,
74 (ObjectMenuFunc
) aadlbox_get_object_menu
,
75 (DescribePropsFunc
) aadlbox_describe_props
,
76 (GetPropsFunc
) aadlbox_get_props
,
77 (SetPropsFunc
) aadlbox_set_props
82 static DiaObject
*aadlthread_create(Point
*startpoint
, void *user_data
, Handle
**handle1
, Handle
**handle2
)
84 DiaObject
*obj
= aadlbox_create(startpoint
, user_data
, handle1
, handle2
);
86 obj
->type
= &aadlthread_type
;
87 obj
->ops
= &aadlthread_ops
;
92 static DiaObject
*aadlthread_load(ObjectNode obj_node
, int version
, const char *filename
)
95 Point startpoint
= {0.0,0.0};
96 Handle
*handle1
,*handle2
;
98 obj
= aadlthread_create(&startpoint
,&aadlthread_specific
, &handle1
,&handle2
);
99 aadlbox_load(obj_node
, version
, filename
, (Aadlbox
*) obj
);
104 ObjectTypeOps aadlthread_type_ops
=
106 (CreateFunc
) aadlthread_create
,
107 (LoadFunc
) aadlthread_load
,/*using_properties*/ /* load */
108 (SaveFunc
) aadlbox_save
, /* save */
109 (GetDefaultsFunc
) NULL
,
110 (ApplyDefaultsFunc
) NULL