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 #include "create_object.h"
21 #include "modify_tool.h"
22 #include "scroll_tool.h"
23 #include "interface.h"
26 Tool
*active_tool
= NULL
;
29 tool_select(ToolType type
, gpointer extra_data
, gpointer user_data
)
31 switch(active_tool
->type
) {
33 free_modify_tool(active_tool
);
35 case CREATE_OBJECT_TOOL
:
36 free_create_object_tool(active_tool
);
39 free_magnify_tool(active_tool
);
42 free_scroll_tool(active_tool
);
47 active_tool
= create_modify_tool();
49 case CREATE_OBJECT_TOOL
:
51 create_create_object_tool(object_get_type((char *)extra_data
),
55 active_tool
= create_magnify_tool();
58 active_tool
= create_scroll_tool();
64 tool_options_dialog_show(ToolType type
, gpointer extra_data
,
69 if (active_tool
->type
!= type
) {
70 switch(active_tool
->type
) {
72 free_modify_tool(active_tool
);
74 case CREATE_OBJECT_TOOL
:
75 free_create_object_tool(active_tool
);
78 free_magnify_tool(active_tool
);
81 free_scroll_tool(active_tool
);
86 active_tool
= create_modify_tool();
88 case CREATE_OBJECT_TOOL
:
90 create_create_object_tool(object_get_type((char *)extra_data
),
94 active_tool
= create_magnify_tool();
97 active_tool
= create_scroll_tool();
104 case CREATE_OBJECT_TOOL
:
105 objtype
= object_get_type((char *)extra_data
);
106 defaults_show(objtype
);
118 gtk_signal_emit_by_name(GTK_OBJECT(modify_tool_button
), "clicked",
119 GTK_BUTTON(modify_tool_button
), NULL
);