Commit f3747dba authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed GimpToolState (ACTIVE, INACTIVE).

2003-05-06  Michael Natterer  <mitch@gimp.org>

	* app/tools/tools-enums.[ch]: removed GimpToolState (ACTIVE,
	INACTIVE).

	* app/tools/gimptoolcontrol.[ch]: replaced "GimpToolState state"
	by "gboolean active".

	* app/tools/gimptool.c (gimp_tool_control)
	* app/tools/tool_manager.c (tool_manager_control_active): check
	for gimp_tool_control_is_active() before calling
	gimp_tool_control_halt().
parent 1317d180
2003-05-06 Michael Natterer <mitch@gimp.org>
* app/tools/tools-enums.[ch]: removed GimpToolState (ACTIVE,
INACTIVE).
* app/tools/gimptoolcontrol.[ch]: replaced "GimpToolState state"
by "gboolean active".
* app/tools/gimptool.c (gimp_tool_control)
* app/tools/tool_manager.c (tool_manager_control_active): check
for gimp_tool_control_is_active() before calling
gimp_tool_control_halt().
2003-05-06 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.c (gimp_tool_motion): added
......@@ -271,10 +271,8 @@ gimp_tool_control (GimpTool *tool,
switch (action)
{
case PAUSE:
if (!gimp_tool_control_is_paused (tool->control))
{
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
}
if (! gimp_tool_control_is_paused (tool->control))
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
gimp_tool_control_pause (tool->control);
break;
......@@ -284,10 +282,8 @@ gimp_tool_control (GimpTool *tool,
{
gimp_tool_control_resume (tool->control);
if (!gimp_tool_control_is_paused (tool->control))
{
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
}
if (! gimp_tool_control_is_paused (tool->control))
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
}
else
{
......@@ -299,7 +295,8 @@ gimp_tool_control (GimpTool *tool,
case HALT:
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
gimp_tool_control_halt (tool->control);
if (gimp_tool_control_is_active (tool->control))
gimp_tool_control_halt (tool->control);
break;
}
}
......
......@@ -69,7 +69,7 @@ gimp_tool_control_class_init (GimpToolControlClass *klass)
static void
gimp_tool_control_init (GimpToolControl *control)
{
control->state = INACTIVE;
control->active = FALSE;
control->paused_count = 0;
control->toggled = FALSE;
......@@ -99,7 +99,6 @@ gimp_tool_control_pause (GimpToolControl *control)
{
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
/* control->state = PAUSED ? */
control->paused_count++;
}
......@@ -123,16 +122,18 @@ void
gimp_tool_control_activate (GimpToolControl *control)
{
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
g_return_if_fail (control->active == FALSE);
control->state = ACTIVE;
control->active = TRUE;
}
void
gimp_tool_control_halt (GimpToolControl *control)
{
g_return_if_fail (GIMP_IS_TOOL_CONTROL (control));
g_return_if_fail (control->active == TRUE);
control->state = INACTIVE;
control->active = FALSE;
}
gboolean
......@@ -140,7 +141,7 @@ gimp_tool_control_is_active (GimpToolControl *control)
{
g_return_val_if_fail (GIMP_IS_TOOL_CONTROL (control), FALSE);
return control->state == ACTIVE;
return control->active;
}
void
......
......@@ -38,7 +38,7 @@ struct _GimpToolControl
{
GimpObject parent_instance;
GimpToolState state; /* state of tool activity */
gboolean active; /* state of tool activity */
gint paused_count; /* paused control count */
gboolean scroll_lock; /* allow scrolling or not */
......
......@@ -383,7 +383,8 @@ tool_manager_control_active (Gimp *gimp,
}
else if (action == HALT)
{
gimp_tool_control_halt (tool_manager->active_tool->control);
if (gimp_tool_control_is_active (tool_manager->active_tool->control))
gimp_tool_control_halt (tool_manager->active_tool->control);
}
}
......
......@@ -52,25 +52,6 @@ select_ops_get_type (void)
}
static const GEnumValue gimp_tool_state_enum_values[] =
{
{ INACTIVE, "INACTIVE", "inactive" },
{ ACTIVE, "ACTIVE", "active" },
{ 0, NULL, NULL }
};
GType
gimp_tool_state_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpToolState", gimp_tool_state_enum_values);
return enum_type;
}
static const GEnumValue gimp_tool_action_enum_values[] =
{
{ PAUSE, "PAUSE", "pause" },
......
......@@ -62,13 +62,6 @@ typedef enum /*< pdb-skip >*/ /*< skip >*/
SELECTION_ANCHOR
} SelectOps;
/* The possible states for tools */
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
INACTIVE,
ACTIVE
} GimpToolState;
/* Tool control actions */
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment