1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) 2005 Sebastien Granjoux
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 /* Defines how output (stdout and stderr) should be handled */
31 typedef enum _ATPOutputType
33 ATP_TOUT_UNKNOWN
= -1,
38 ATP_TOUT_REPLACE_BUFFER
,
39 ATP_TOUT_INSERT_BUFFER
,
40 ATP_TOUT_APPEND_BUFFER
,
41 ATP_TOUT_REPLACE_SELECTION
,
42 ATP_TOUT_POPUP_DIALOG
,
47 /* Defines how input should be handled */
48 typedef enum _ATPInputType
59 /* Simple type to associate an identifier and a string */
60 typedef struct _ATPEnumType
66 /* Defines how and where tool information will be stored. */
67 typedef enum _ATPToolStore
69 ATP_TSTORE_GLOBAL
= 0,
75 /* Additional tool information */
76 typedef enum _ATPToolFlag
78 /* Select the operation needed on the flag */
84 ATP_TOOL_ENABLE
= 1 << 2,
85 ATP_TOOL_AUTOSAVE
= 1 << 3,
86 ATP_TOOL_TERMINAL
= 1 << 4
89 typedef struct _ATPUserTool ATPUserTool
;
90 typedef struct _ATPToolList ATPToolList
;
95 GStringChunk
* string_pool
;
102 /*---------------------------------------------------------------------------*/
104 const ATPEnumType
* atp_get_output_type_list (void);
105 const ATPEnumType
* atp_get_error_type_list (void);
106 const ATPEnumType
* atp_get_input_type_list (void);
108 /*---------------------------------------------------------------------------*/
110 gchar
* atp_remove_mnemonic (const gchar
* label
);
112 /*---------------------------------------------------------------------------*/
114 ATPUserTool
* atp_user_tool_new (ATPToolList
*list
, const gchar
* name
, ATPToolStore storage
);
115 void atp_user_tool_free(ATPUserTool
*tool
);
117 ATPUserTool
*atp_user_tool_append_new (ATPUserTool
* this, const gchar
*name
, ATPToolStore storage
);
118 ATPUserTool
*atp_user_tool_clone_new (ATPUserTool
* this, ATPToolStore storage
);
120 gboolean
atp_user_tool_activate (ATPUserTool
* this, GtkMenu
* submenu
, GtkAccelGroup
* group
);
121 void atp_user_tool_deactivate (ATPUserTool
* this);
123 gboolean
atp_user_tool_move_after (ATPUserTool
* this, ATPUserTool
* position
);
125 gboolean
atp_user_tool_set_name (ATPUserTool
*this, const gchar
*value
);
126 const gchar
* atp_user_tool_get_name (const ATPUserTool
* this);
128 void atp_user_tool_set_command (ATPUserTool
* this, const gchar
* value
);
129 const gchar
* atp_user_tool_get_command (const ATPUserTool
* this);
131 void atp_user_tool_set_param (ATPUserTool
* this, const gchar
* value
);
132 const gchar
* atp_user_tool_get_param (const ATPUserTool
* this);
134 void atp_user_tool_set_working_dir (ATPUserTool
* this, const gchar
* value
);
135 const gchar
* atp_user_tool_get_working_dir (const ATPUserTool
* this);
137 void atp_user_tool_set_flag (ATPUserTool
*this, ATPToolFlag flag
);
138 gboolean
atp_user_tool_get_flag (const ATPUserTool
*this, ATPToolFlag flag
);
140 void atp_user_tool_set_output (ATPUserTool
*this, ATPOutputType type
);
141 ATPOutputType
atp_user_tool_get_output (const ATPUserTool
*this);
143 void atp_user_tool_set_error (ATPUserTool
*this, ATPOutputType type
);
144 ATPOutputType
atp_user_tool_get_error (const ATPUserTool
*this);
146 void atp_user_tool_set_input (ATPUserTool
*this, ATPInputType type
, const gchar
* value
);
147 ATPInputType
atp_user_tool_get_input (const ATPUserTool
*this);
148 const gchar
* atp_user_tool_get_input_string (const ATPUserTool
*this);
150 void atp_user_tool_set_accelerator (ATPUserTool
*this, guint key
, GdkModifierType mods
);
151 gboolean
atp_user_tool_get_accelerator (const ATPUserTool
*this, guint
*key
, GdkModifierType
*mods
);
153 void atp_user_tool_set_icon (ATPUserTool
*this, const gchar
* value
);
154 const gchar
* atp_user_tool_get_icon (const ATPUserTool
*this);
156 ATPToolStore
atp_user_tool_get_storage (const ATPUserTool
*this);
158 ATPPlugin
* atp_user_tool_get_plugin (ATPUserTool
* this);
160 gboolean
atp_user_tool_is_valid (const ATPUserTool
* this);
162 ATPUserTool
*atp_user_tool_next (ATPUserTool
* this);
163 ATPUserTool
*atp_user_tool_next_in_same_storage (ATPUserTool
* this);
164 ATPUserTool
*atp_user_tool_previous (ATPUserTool
* this);
165 ATPUserTool
*atp_user_tool_override (const ATPUserTool
* this);
167 /*---------------------------------------------------------------------------*/
169 ATPToolList
*atp_tool_list_construct (ATPToolList
*this, ATPPlugin
* plugin
);
170 void atp_tool_list_destroy (ATPToolList
*this);
172 ATPUserTool
* atp_tool_list_first (ATPToolList
*this);
173 ATPUserTool
* atp_tool_list_first_in_storage (ATPToolList
*this, ATPToolStore storage
);
174 ATPUserTool
* atp_tool_list_last (ATPToolList
*this);
176 gboolean
atp_tool_list_activate (ATPToolList
*this);
177 ATPUserTool
*atp_tool_list_append_new (ATPToolList
* this, const gchar
*name
, ATPToolStore storage
);