Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GIMP
Commits
782aeab6
Commit
782aeab6
authored
Oct 29, 2004
by
Øyvind Kolås
Browse files
reordered to be alphabetical
parent
882ad0de
Changes
4
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
782aeab6
2004-10-29 Kevin Cozens <kcozens@cvs.gimp.org>
2004-10-29 Øyvind Kolås <pippin@gimp.org>
* app/actions/drawable-commands.[ch]
* app/actions/drawable-actions.[ch]: alphabetized file pending
addition.
2004-10-29 Kevin Cozens <kcozens@cvs.gimp.org>
* plug-ins/script-fu/scripts/test-sphere.scm: Added notes about
use of SF-PALETTE.
...
...
app/actions/drawable-actions.c
View file @
782aeab6
...
...
@@ -46,16 +46,16 @@ static GimpActionEntry drawable_actions[] =
G_CALLBACK
(
drawable_desaturate_cmd_callback
),
GIMP_HELP_LAYER_DESATURATE
},
{
"drawable-invert"
,
GIMP_STOCK_INVERT
,
N_
(
"In_vert"
),
NULL
,
NULL
,
G_CALLBACK
(
drawable_invert_cmd_callback
),
GIMP_HELP_LAYER_INVERT
},
{
"drawable-equalize"
,
NULL
,
N_
(
"_Equalize"
),
NULL
,
NULL
,
G_CALLBACK
(
drawable_equalize_cmd_callback
),
GIMP_HELP_LAYER_EQUALIZE
},
{
"drawable-invert"
,
GIMP_STOCK_INVERT
,
N_
(
"In_vert"
),
NULL
,
NULL
,
G_CALLBACK
(
drawable_invert_cmd_callback
),
GIMP_HELP_LAYER_INVERT
},
{
"drawable-offset"
,
NULL
,
N_
(
"_Offset..."
),
"<control><shift>O"
,
NULL
,
G_CALLBACK
(
drawable_offset_cmd_callback
),
...
...
@@ -64,17 +64,17 @@ static GimpActionEntry drawable_actions[] =
static
GimpToggleActionEntry
drawable_toggle_actions
[]
=
{
{
"drawable-visible"
,
GIMP_STOCK_VISIBLE
,
N_
(
"_Visible"
),
NULL
,
NULL
,
G_CALLBACK
(
drawable_visible_cmd_callback
),
FALSE
,
GIMP_HELP_LAYER_VISIBLE
},
{
"drawable-linked"
,
GIMP_STOCK_LINKED
,
N_
(
"_Linked"
),
NULL
,
NULL
,
G_CALLBACK
(
drawable_linked_cmd_callback
),
FALSE
,
GIMP_HELP_LAYER_LINKED
}
GIMP_HELP_LAYER_LINKED
},
{
"drawable-visible"
,
GIMP_STOCK_VISIBLE
,
N_
(
"_Visible"
),
NULL
,
NULL
,
G_CALLBACK
(
drawable_visible_cmd_callback
),
FALSE
,
GIMP_HELP_LAYER_VISIBLE
}
};
static
GimpEnumActionEntry
drawable_flip_actions
[]
=
...
...
@@ -174,8 +174,8 @@ drawable_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_SENSITIVE
(
"drawable-desaturate"
,
drawable
&&
is_rgb
);
SET_SENSITIVE
(
"drawable-invert"
,
drawable
&&
!
is_indexed
);
SET_SENSITIVE
(
"drawable-equalize"
,
drawable
&&
!
is_indexed
);
SET_SENSITIVE
(
"drawable-invert"
,
drawable
&&
!
is_indexed
);
SET_SENSITIVE
(
"drawable-offset"
,
drawable
);
SET_SENSITIVE
(
"drawable-visible"
,
drawable
);
...
...
app/actions/drawable-commands.c
View file @
782aeab6
...
...
@@ -63,8 +63,8 @@ drawable_desaturate_cmd_callback (GtkAction *action,
}
void
drawable_
invert
_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
drawable_
equalize
_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
{
GimpImage
*
gimage
;
GimpDrawable
*
drawable
;
...
...
@@ -72,61 +72,78 @@ drawable_invert_cmd_callback (GtkAction *action,
if
(
gimp_drawable_is_indexed
(
drawable
))
{
g_message
(
_
(
"
Invert
does not operate on indexed layers."
));
g_message
(
_
(
"
Equalize
does not operate on indexed layers."
));
return
;
}
gimp_drawable_
invert
(
drawable
);
gimp_drawable_
equalize
(
drawable
,
TRUE
);
gimp_image_flush
(
gimage
);
}
void
drawable_equalize_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
drawable_flip_cmd_callback
(
GtkAction
*
action
,
gint
value
,
gpointer
data
)
{
GimpImage
*
gimage
;
GimpDrawable
*
drawable
;
GimpItem
*
item
;
GimpContext
*
context
;
gint
off_x
,
off_y
;
gdouble
axis
=
0
.
0
;
return_if_no_drawable
(
gimage
,
drawable
,
data
);
return_if_no_context
(
context
,
data
);
if
(
gimp_drawable_is_indexed
(
drawable
))
item
=
GIMP_ITEM
(
drawable
);
gimp_item_offsets
(
item
,
&
off_x
,
&
off_y
);
switch
((
GimpOrientationType
)
value
)
{
g_message
(
_
(
"Equalize does not operate on indexed layers."
));
return
;
case
GIMP_ORIENTATION_HORIZONTAL
:
axis
=
((
gdouble
)
off_x
+
(
gdouble
)
gimp_item_width
(
item
)
/
2
.
0
);
break
;
case
GIMP_ORIENTATION_VERTICAL
:
axis
=
((
gdouble
)
off_y
+
(
gdouble
)
gimp_item_height
(
item
)
/
2
.
0
);
break
;
default:
break
;
}
if
(
gimp_item_get_linked
(
item
))
gimp_image_undo_group_start
(
gimage
,
GIMP_UNDO_GROUP_TRANSFORM
,
GIMP_ITEM_GET_CLASS
(
item
)
->
flip_desc
);
gimp_item_flip
(
item
,
context
,
(
GimpOrientationType
)
value
,
axis
,
FALSE
);
if
(
gimp_item_get_linked
(
item
))
{
gimp_item_linked_flip
(
item
,
context
,
(
GimpOrientationType
)
action
,
axis
,
FALSE
);
gimp_image_undo_group_end
(
gimage
);
}
gimp_drawable_equalize
(
drawable
,
TRUE
);
gimp_image_flush
(
gimage
);
}
void
drawable_
visible
_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
drawable_
invert
_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
{
GimpImage
*
gimage
;
GimpDrawable
*
drawable
;
gboolean
visible
;
return_if_no_drawable
(
gimage
,
drawable
,
data
);
visible
=
gtk_toggle_action_get_active
(
GTK_TOGGLE_ACTION
(
action
));
if
(
GIMP_IS_LAYER_MASK
(
drawable
))
drawable
=
GIMP_DRAWABLE
(
gimp_layer_mask_get_layer
(
GIMP_LAYER_MASK
(
drawable
)));
if
(
visible
!=
gimp_item_get_visible
(
GIMP_ITEM
(
drawable
)))
if
(
gimp_drawable_is_indexed
(
drawable
))
{
GimpUndo
*
undo
;
gboolean
push_undo
=
TRUE
;
undo
=
gimp_image_undo_can_compress
(
gimage
,
GIMP_TYPE_ITEM_UNDO
,
GIMP_UNDO_ITEM_VISIBILITY
);
if
(
undo
&&
GIMP_ITEM_UNDO
(
undo
)
->
item
==
GIMP_ITEM
(
drawable
))
push_undo
=
FALSE
;
gimp_item_set_visible
(
GIMP_ITEM
(
drawable
),
visible
,
push_undo
);
gimp_image_flush
(
gimage
);
g_message
(
_
(
"Invert does not operate on indexed layers."
));
return
;
}
gimp_drawable_invert
(
drawable
);
gimp_image_flush
(
gimage
);
}
void
...
...
@@ -161,51 +178,18 @@ drawable_linked_cmd_callback (GtkAction *action,
}
void
drawable_flip_cmd_callback
(
GtkAction
*
action
,
gint
value
,
gpointer
data
)
drawable_offset_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
{
GimpImage
*
gimage
;
GimpDrawable
*
drawable
;
GimpItem
*
item
;
GimpContext
*
context
;
gint
off_x
,
off_y
;
gdouble
axis
=
0
.
0
;
GtkWidget
*
widget
;
GtkWidget
*
dialog
;
return_if_no_drawable
(
gimage
,
drawable
,
data
);
return_if_no_context
(
context
,
data
);
item
=
GIMP_ITEM
(
drawable
);
gimp_item_offsets
(
item
,
&
off_x
,
&
off_y
);
switch
((
GimpOrientationType
)
value
)
{
case
GIMP_ORIENTATION_HORIZONTAL
:
axis
=
((
gdouble
)
off_x
+
(
gdouble
)
gimp_item_width
(
item
)
/
2
.
0
);
break
;
case
GIMP_ORIENTATION_VERTICAL
:
axis
=
((
gdouble
)
off_y
+
(
gdouble
)
gimp_item_height
(
item
)
/
2
.
0
);
break
;
default:
break
;
}
if
(
gimp_item_get_linked
(
item
))
gimp_image_undo_group_start
(
gimage
,
GIMP_UNDO_GROUP_TRANSFORM
,
GIMP_ITEM_GET_CLASS
(
item
)
->
flip_desc
);
gimp_item_flip
(
item
,
context
,
(
GimpOrientationType
)
value
,
axis
,
FALSE
);
if
(
gimp_item_get_linked
(
item
))
{
gimp_item_linked_flip
(
item
,
context
,
(
GimpOrientationType
)
action
,
axis
,
FALSE
);
gimp_image_undo_group_end
(
gimage
);
}
return_if_no_widget
(
widget
,
data
);
gimp_image_flush
(
gimage
);
dialog
=
offset_dialog_new
(
drawable
,
widget
);
gtk_widget_show
(
dialog
);
}
void
...
...
@@ -251,16 +235,32 @@ drawable_rotate_cmd_callback (GtkAction *action,
}
void
drawable_
offset
_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
drawable_
visible
_cmd_callback
(
GtkAction
*
action
,
gpointer
data
)
{
GimpImage
*
gimage
;
GimpDrawable
*
drawable
;
GtkWidget
*
widget
;
GtkWidget
*
dialog
;
gboolean
visible
;
return_if_no_drawable
(
gimage
,
drawable
,
data
);
return_if_no_widget
(
widget
,
data
);
dialog
=
offset_dialog_new
(
drawable
,
widget
);
gtk_widget_show
(
dialog
);
visible
=
gtk_toggle_action_get_active
(
GTK_TOGGLE_ACTION
(
action
));
if
(
GIMP_IS_LAYER_MASK
(
drawable
))
drawable
=
GIMP_DRAWABLE
(
gimp_layer_mask_get_layer
(
GIMP_LAYER_MASK
(
drawable
)));
if
(
visible
!=
gimp_item_get_visible
(
GIMP_ITEM
(
drawable
)))
{
GimpUndo
*
undo
;
gboolean
push_undo
=
TRUE
;
undo
=
gimp_image_undo_can_compress
(
gimage
,
GIMP_TYPE_ITEM_UNDO
,
GIMP_UNDO_ITEM_VISIBILITY
);
if
(
undo
&&
GIMP_ITEM_UNDO
(
undo
)
->
item
==
GIMP_ITEM
(
drawable
))
push_undo
=
FALSE
;
gimp_item_set_visible
(
GIMP_ITEM
(
drawable
),
visible
,
push_undo
);
gimp_image_flush
(
gimage
);
}
}
app/actions/drawable-commands.h
View file @
782aeab6
...
...
@@ -22,21 +22,21 @@
void
drawable_desaturate_cmd_callback
(
GtkAction
*
action
,
gpointer
data
);
void
drawable_invert_cmd_callback
(
GtkAction
*
action
,
gpointer
data
);
void
drawable_equalize_cmd_callback
(
GtkAction
*
action
,
gpointer
data
);
void
drawable_visible_cmd_callback
(
GtkAction
*
action
,
void
drawable_flip_cmd_callback
(
GtkAction
*
action
,
gint
value
,
gpointer
data
);
void
drawable_invert_cmd_callback
(
GtkAction
*
action
,
gpointer
data
);
void
drawable_linked_cmd_callback
(
GtkAction
*
action
,
gpointer
data
);
void
drawable_flip_cmd_callback
(
GtkAction
*
action
,
gint
value
,
void
drawable_offset_cmd_callback
(
GtkAction
*
action
,
gpointer
data
);
void
drawable_rotate_cmd_callback
(
GtkAction
*
action
,
gint
value
,
gpointer
data
);
void
drawable_
offset
_cmd_callback
(
GtkAction
*
action
,
void
drawable_
visible
_cmd_callback
(
GtkAction
*
action
,
gpointer
data
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment