Skip to content
GitLab
Menu
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
2ec50a9d
Commit
2ec50a9d
authored
Apr 28, 1999
by
Sven Neumann
Browse files
Some code cleanup, changes to the crop-modifier_key_func and 128n fixes.
--Sven
parent
4e3c804f
Changes
18
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
2ec50a9d
Wed Apr 28 20:53:18 MEST 1999 Sven Neumann <sven@gimp.org>
* app/bucket_fill.c
* app/convolve.c
* app/crop.c
* app/flip_tool.c
* app/ops_buttons.c
* app/tool_options.c: some code cleanup and i18n fixes
Wed Apr 28 16:28:08 1999 ape@lrdpf.spacetec.no (Asbjorn Pettersen)
* app/gimprc.c: Add <sys/types.h>, Open text files with "rt".
...
...
app/bucket_fill.c
View file @
2ec50a9d
...
...
@@ -111,9 +111,9 @@ bucket_options_new (void)
GtkWidget
*
label
;
GtkWidget
*
scale
;
GtkWidget
*
frame
;
gchar
*
fill_mode_label
[
3
]
=
{
_
(
"FG Color Fill"
),
_
(
"BG Color Fill"
),
_
(
"Pattern Fill"
)
};
gchar
*
fill_mode_label
[
3
]
=
{
N
_
(
"FG Color Fill"
),
N
_
(
"BG Color Fill"
),
N
_
(
"Pattern Fill"
)
};
gint
fill_mode_value
[
3
]
=
{
FG_BUCKET_FILL
,
BG_BUCKET_FILL
,
PATTERN_BUCKET_FILL
};
...
...
app/convolve.c
View file @
2ec50a9d
...
...
@@ -126,7 +126,7 @@ convolve_options_new (void)
GtkWidget
*
label
;
GtkWidget
*
scale
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Blur"
),
_
(
"Sharpen"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Blur"
),
N
_
(
"Sharpen"
)
};
gint
type_value
[
2
]
=
{
BLUR_CONVOLVE
,
SHARPEN_CONVOLVE
};
/* the new convolve tool options structure */
...
...
app/core/gimptooloptions.c
View file @
2ec50a9d
...
...
@@ -170,7 +170,7 @@ tool_options_radio_buttons_new (gchar* label,
for
(
i
=
0
;
i
<
num
;
i
++
)
{
button_widget
[
i
]
=
gtk_radio_button_new_with_label
(
group
,
button_label
[
i
]);
gettext
(
button_label
[
i
])
)
;
group
=
gtk_radio_button_group
(
GTK_RADIO_BUTTON
(
button_widget
[
i
]));
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
button_widget
[
i
],
FALSE
,
FALSE
,
0
);
gtk_signal_connect
(
GTK_OBJECT
(
button_widget
[
i
]),
"toggled"
,
...
...
app/crop.c
View file @
2ec50a9d
...
...
@@ -40,8 +40,6 @@
#define RESIZING_LEFT 2
#define RESIZING_RIGHT 3
#define CROPPING 4
#define REFRAMING 5
/* speed of key movement */
#define ARROW_VELOCITY 25
...
...
@@ -120,7 +118,7 @@ static void crop_adjust_guides (GImage *, int, int, int, int);
/* Crop dialog functions */
static
void
crop_info_update
(
Tool
*
);
static
void
crop_info_create
(
Tool
*
);
static
void
crop_
ok
_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_
crop
_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_resize_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_close_callback
(
GtkWidget
*
,
gpointer
);
...
...
@@ -165,7 +163,7 @@ crop_options_new (void)
CropOptions
*
options
;
GtkWidget
*
vbox
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Crop"
),
_
(
"Resize"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Crop"
),
N
_
(
"Resize"
)
};
gint
type_value
[
2
]
=
{
CROP_CROP
,
RESIZE_CROP
};
/* the new crop tool options structure */
...
...
@@ -175,7 +173,7 @@ crop_options_new (void)
crop_options_reset
);
options
->
layer_only
=
options
->
layer_only_d
=
FALSE
;
options
->
allow_enlarge
=
options
->
allow_enlarge_d
=
TRUE
;
options
->
type
=
options
->
type_d
=
CROP
_CROP
;
options
->
type
=
options
->
type_d
=
RESIZE
_CROP
;
/* the main vbox */
vbox
=
options
->
tool_options
.
main_vbox
;
...
...
@@ -255,12 +253,7 @@ crop_button_press (Tool *tool,
/* If the pointer is in the rectangular region, crop or resize it! */
else
if
(
bevent
->
x
>
crop
->
x1
&&
bevent
->
x
<
crop
->
x2
&&
bevent
->
y
>
crop
->
y1
&&
bevent
->
y
<
crop
->
y2
)
{
if
(
crop_options
->
type
==
CROP_CROP
)
crop
->
function
=
CROPPING
;
else
crop
->
function
=
REFRAMING
;
}
crop
->
function
=
CROPPING
;
/* otherwise, the new function will be creating, since we want to start anew */
else
crop
->
function
=
CREATING
;
...
...
@@ -307,30 +300,27 @@ crop_button_release (Tool *tool,
gdk_pointer_ungrab
(
bevent
->
time
);
gdk_flush
();
gtk_statusbar_pop
(
GTK_STATUSBAR
(
gdisp
->
statusbar
),
crop
->
context_id
);
gtk_statusbar_pop
(
GTK_STATUSBAR
(
gdisp
->
statusbar
),
crop
->
context_id
);
if
(
!
(
bevent
->
state
&
GDK_BUTTON3_MASK
))
{
switch
(
crop
->
function
)
if
(
crop
->
function
==
CROPPING
)
{
case
CROPPING
:
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
TRUE
);
break
;
case
REFRAMING
:
crop_
image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
FALSE
);
break
;
default:
crop_info_update
(
tool
);
return
;
if
(
crop_options
->
type
==
CROP_CROP
)
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
TRUE
);
else
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_
options
->
layer_only
,
FALSE
);
/* Finish the tool */
draw_core_stop
(
crop
->
core
,
tool
);
info_dialog_popdown
(
crop_info
);
tool
->
state
=
INACTIVE
;
}
else
crop_info_update
(
tool
);
}
/* Finish the tool */
draw_core_stop
(
crop
->
core
,
tool
);
info_dialog_popdown
(
crop_info
);
tool
->
state
=
INACTIVE
;
}
static
void
...
...
@@ -398,7 +388,7 @@ crop_motion (Tool *tool,
/* This is the only case when the motion events should be ignored--
we're just waiting for the button release event to crop the image */
if
(
crop
->
function
==
CROPPING
||
crop
->
function
==
REFRAMING
)
if
(
crop
->
function
==
CROPPING
)
return
;
gdisplay_untransform_coords
(
gdisp
,
mevent
->
x
,
mevent
->
y
,
&
curx
,
&
cury
,
TRUE
,
FALSE
);
...
...
@@ -651,26 +641,19 @@ crop_modifier_key_func (Tool *tool,
GdkEventKey
*
kevent
,
gpointer
gdisp_ptr
)
{
GDisplay
*
gdisp
;
gdisp
=
(
GDisplay
*
)
gdisp_ptr
;
if
(
tool
->
state
==
ACTIVE
&&
tool
->
gdisp_ptr
==
gdisp_ptr
)
switch
(
kevent
->
keyval
)
{
switch
(
kevent
->
keyval
)
{
case
GDK_Alt_L
:
case
GDK_Alt_R
:
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
allow_enlarge_w
),
!
crop_options
->
allow_enlarge
);
break
;
case
GDK_Shift_L
:
case
GDK_Shift_R
:
if
(
crop_options
->
type
==
CROP_CROP
)
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
RESIZE_CROP
]),
TRUE
);
else
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
CROP_CROP
]),
TRUE
);
break
;
case
GDK_Control_L
:
case
GDK_Control_R
:
break
;
}
case
GDK_Alt_L
:
case
GDK_Alt_R
:
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
allow_enlarge_w
),
!
crop_options
->
allow_enlarge
);
break
;
case
GDK_Shift_L
:
case
GDK_Shift_R
:
if
(
crop_options
->
type
==
CROP_CROP
)
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
RESIZE_CROP
]),
TRUE
);
else
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
CROP_CROP
]),
TRUE
);
break
;
case
GDK_Control_L
:
case
GDK_Control_R
:
break
;
}
}
...
...
@@ -1007,11 +990,10 @@ crop_start (Tool *tool,
/* Crop dialog functions */
/*******************************************************/
static
ActionAreaItem
action_items
[
4
]
=
static
ActionAreaItem
action_items
[
3
]
=
{
{
N_
(
"Crop"
),
crop_
ok
_callback
,
NULL
,
NULL
},
{
N_
(
"Crop"
),
crop_
crop
_callback
,
NULL
,
NULL
},
{
N_
(
"Resize"
),
crop_resize_callback
,
NULL
,
NULL
},
/* { N_("Selection"), crop_selection_callback, NULL, NULL }, */
{
N_
(
"Close"
),
crop_close_callback
,
NULL
,
NULL
},
};
...
...
@@ -1132,8 +1114,8 @@ crop_info_update (Tool *tool)
}
static
void
crop_
ok
_callback
(
GtkWidget
*
w
,
gpointer
client_data
)
crop_
crop
_callback
(
GtkWidget
*
w
,
gpointer
client_data
)
{
Tool
*
tool
;
Crop
*
crop
;
...
...
app/flip_tool.c
View file @
2ec50a9d
...
...
@@ -67,7 +67,7 @@ flip_options_new (void)
GtkWidget
*
vbox
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Horizontal"
),
_
(
"Vertical"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Horizontal"
),
N
_
(
"Vertical"
)
};
gint
type_value
[
2
]
=
{
FLIP_HORZ
,
FLIP_VERT
};
/* the new flip tool options structure */
...
...
app/ops_buttons.c
View file @
2ec50a9d
...
...
@@ -93,7 +93,7 @@ GtkWidget *ops_button_box_new (GtkWidget *parent,
}
if
(
tool_tips
!=
NULL
)
gtk_tooltips_set_tip
(
tool_tips
,
button
,
ops_button
->
tooltip
,
NULL
);
gtk_tooltips_set_tip
(
tool_tips
,
button
,
gettext
(
ops_button
->
tooltip
)
,
NULL
);
gtk_box_pack_start
(
GTK_BOX
(
button_box
),
button
,
TRUE
,
TRUE
,
0
);
...
...
app/paint/gimpconvolve.c
View file @
2ec50a9d
...
...
@@ -126,7 +126,7 @@ convolve_options_new (void)
GtkWidget
*
label
;
GtkWidget
*
scale
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Blur"
),
_
(
"Sharpen"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Blur"
),
N
_
(
"Sharpen"
)
};
gint
type_value
[
2
]
=
{
BLUR_CONVOLVE
,
SHARPEN_CONVOLVE
};
/* the new convolve tool options structure */
...
...
app/tool_options.c
View file @
2ec50a9d
...
...
@@ -170,7 +170,7 @@ tool_options_radio_buttons_new (gchar* label,
for
(
i
=
0
;
i
<
num
;
i
++
)
{
button_widget
[
i
]
=
gtk_radio_button_new_with_label
(
group
,
button_label
[
i
]);
gettext
(
button_label
[
i
])
)
;
group
=
gtk_radio_button_group
(
GTK_RADIO_BUTTON
(
button_widget
[
i
]));
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
button_widget
[
i
],
FALSE
,
FALSE
,
0
);
gtk_signal_connect
(
GTK_OBJECT
(
button_widget
[
i
]),
"toggled"
,
...
...
app/tools/bucket_fill.c
View file @
2ec50a9d
...
...
@@ -111,9 +111,9 @@ bucket_options_new (void)
GtkWidget
*
label
;
GtkWidget
*
scale
;
GtkWidget
*
frame
;
gchar
*
fill_mode_label
[
3
]
=
{
_
(
"FG Color Fill"
),
_
(
"BG Color Fill"
),
_
(
"Pattern Fill"
)
};
gchar
*
fill_mode_label
[
3
]
=
{
N
_
(
"FG Color Fill"
),
N
_
(
"BG Color Fill"
),
N
_
(
"Pattern Fill"
)
};
gint
fill_mode_value
[
3
]
=
{
FG_BUCKET_FILL
,
BG_BUCKET_FILL
,
PATTERN_BUCKET_FILL
};
...
...
app/tools/convolve.c
View file @
2ec50a9d
...
...
@@ -126,7 +126,7 @@ convolve_options_new (void)
GtkWidget
*
label
;
GtkWidget
*
scale
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Blur"
),
_
(
"Sharpen"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Blur"
),
N
_
(
"Sharpen"
)
};
gint
type_value
[
2
]
=
{
BLUR_CONVOLVE
,
SHARPEN_CONVOLVE
};
/* the new convolve tool options structure */
...
...
app/tools/crop.c
View file @
2ec50a9d
...
...
@@ -40,8 +40,6 @@
#define RESIZING_LEFT 2
#define RESIZING_RIGHT 3
#define CROPPING 4
#define REFRAMING 5
/* speed of key movement */
#define ARROW_VELOCITY 25
...
...
@@ -120,7 +118,7 @@ static void crop_adjust_guides (GImage *, int, int, int, int);
/* Crop dialog functions */
static
void
crop_info_update
(
Tool
*
);
static
void
crop_info_create
(
Tool
*
);
static
void
crop_
ok
_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_
crop
_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_resize_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_close_callback
(
GtkWidget
*
,
gpointer
);
...
...
@@ -165,7 +163,7 @@ crop_options_new (void)
CropOptions
*
options
;
GtkWidget
*
vbox
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Crop"
),
_
(
"Resize"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Crop"
),
N
_
(
"Resize"
)
};
gint
type_value
[
2
]
=
{
CROP_CROP
,
RESIZE_CROP
};
/* the new crop tool options structure */
...
...
@@ -175,7 +173,7 @@ crop_options_new (void)
crop_options_reset
);
options
->
layer_only
=
options
->
layer_only_d
=
FALSE
;
options
->
allow_enlarge
=
options
->
allow_enlarge_d
=
TRUE
;
options
->
type
=
options
->
type_d
=
CROP
_CROP
;
options
->
type
=
options
->
type_d
=
RESIZE
_CROP
;
/* the main vbox */
vbox
=
options
->
tool_options
.
main_vbox
;
...
...
@@ -255,12 +253,7 @@ crop_button_press (Tool *tool,
/* If the pointer is in the rectangular region, crop or resize it! */
else
if
(
bevent
->
x
>
crop
->
x1
&&
bevent
->
x
<
crop
->
x2
&&
bevent
->
y
>
crop
->
y1
&&
bevent
->
y
<
crop
->
y2
)
{
if
(
crop_options
->
type
==
CROP_CROP
)
crop
->
function
=
CROPPING
;
else
crop
->
function
=
REFRAMING
;
}
crop
->
function
=
CROPPING
;
/* otherwise, the new function will be creating, since we want to start anew */
else
crop
->
function
=
CREATING
;
...
...
@@ -307,30 +300,27 @@ crop_button_release (Tool *tool,
gdk_pointer_ungrab
(
bevent
->
time
);
gdk_flush
();
gtk_statusbar_pop
(
GTK_STATUSBAR
(
gdisp
->
statusbar
),
crop
->
context_id
);
gtk_statusbar_pop
(
GTK_STATUSBAR
(
gdisp
->
statusbar
),
crop
->
context_id
);
if
(
!
(
bevent
->
state
&
GDK_BUTTON3_MASK
))
{
switch
(
crop
->
function
)
if
(
crop
->
function
==
CROPPING
)
{
case
CROPPING
:
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
TRUE
);
break
;
case
REFRAMING
:
crop_
image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
FALSE
);
break
;
default:
crop_info_update
(
tool
);
return
;
if
(
crop_options
->
type
==
CROP_CROP
)
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
TRUE
);
else
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_
options
->
layer_only
,
FALSE
);
/* Finish the tool */
draw_core_stop
(
crop
->
core
,
tool
);
info_dialog_popdown
(
crop_info
);
tool
->
state
=
INACTIVE
;
}
else
crop_info_update
(
tool
);
}
/* Finish the tool */
draw_core_stop
(
crop
->
core
,
tool
);
info_dialog_popdown
(
crop_info
);
tool
->
state
=
INACTIVE
;
}
static
void
...
...
@@ -398,7 +388,7 @@ crop_motion (Tool *tool,
/* This is the only case when the motion events should be ignored--
we're just waiting for the button release event to crop the image */
if
(
crop
->
function
==
CROPPING
||
crop
->
function
==
REFRAMING
)
if
(
crop
->
function
==
CROPPING
)
return
;
gdisplay_untransform_coords
(
gdisp
,
mevent
->
x
,
mevent
->
y
,
&
curx
,
&
cury
,
TRUE
,
FALSE
);
...
...
@@ -651,26 +641,19 @@ crop_modifier_key_func (Tool *tool,
GdkEventKey
*
kevent
,
gpointer
gdisp_ptr
)
{
GDisplay
*
gdisp
;
gdisp
=
(
GDisplay
*
)
gdisp_ptr
;
if
(
tool
->
state
==
ACTIVE
&&
tool
->
gdisp_ptr
==
gdisp_ptr
)
switch
(
kevent
->
keyval
)
{
switch
(
kevent
->
keyval
)
{
case
GDK_Alt_L
:
case
GDK_Alt_R
:
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
allow_enlarge_w
),
!
crop_options
->
allow_enlarge
);
break
;
case
GDK_Shift_L
:
case
GDK_Shift_R
:
if
(
crop_options
->
type
==
CROP_CROP
)
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
RESIZE_CROP
]),
TRUE
);
else
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
CROP_CROP
]),
TRUE
);
break
;
case
GDK_Control_L
:
case
GDK_Control_R
:
break
;
}
case
GDK_Alt_L
:
case
GDK_Alt_R
:
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
allow_enlarge_w
),
!
crop_options
->
allow_enlarge
);
break
;
case
GDK_Shift_L
:
case
GDK_Shift_R
:
if
(
crop_options
->
type
==
CROP_CROP
)
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
RESIZE_CROP
]),
TRUE
);
else
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
CROP_CROP
]),
TRUE
);
break
;
case
GDK_Control_L
:
case
GDK_Control_R
:
break
;
}
}
...
...
@@ -1007,11 +990,10 @@ crop_start (Tool *tool,
/* Crop dialog functions */
/*******************************************************/
static
ActionAreaItem
action_items
[
4
]
=
static
ActionAreaItem
action_items
[
3
]
=
{
{
N_
(
"Crop"
),
crop_
ok
_callback
,
NULL
,
NULL
},
{
N_
(
"Crop"
),
crop_
crop
_callback
,
NULL
,
NULL
},
{
N_
(
"Resize"
),
crop_resize_callback
,
NULL
,
NULL
},
/* { N_("Selection"), crop_selection_callback, NULL, NULL }, */
{
N_
(
"Close"
),
crop_close_callback
,
NULL
,
NULL
},
};
...
...
@@ -1132,8 +1114,8 @@ crop_info_update (Tool *tool)
}
static
void
crop_
ok
_callback
(
GtkWidget
*
w
,
gpointer
client_data
)
crop_
crop
_callback
(
GtkWidget
*
w
,
gpointer
client_data
)
{
Tool
*
tool
;
Crop
*
crop
;
...
...
app/tools/flip_tool.c
View file @
2ec50a9d
...
...
@@ -67,7 +67,7 @@ flip_options_new (void)
GtkWidget
*
vbox
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Horizontal"
),
_
(
"Vertical"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Horizontal"
),
N
_
(
"Vertical"
)
};
gint
type_value
[
2
]
=
{
FLIP_HORZ
,
FLIP_VERT
};
/* the new flip tool options structure */
...
...
app/tools/gimpbucketfilltool.c
View file @
2ec50a9d
...
...
@@ -111,9 +111,9 @@ bucket_options_new (void)
GtkWidget
*
label
;
GtkWidget
*
scale
;
GtkWidget
*
frame
;
gchar
*
fill_mode_label
[
3
]
=
{
_
(
"FG Color Fill"
),
_
(
"BG Color Fill"
),
_
(
"Pattern Fill"
)
};
gchar
*
fill_mode_label
[
3
]
=
{
N
_
(
"FG Color Fill"
),
N
_
(
"BG Color Fill"
),
N
_
(
"Pattern Fill"
)
};
gint
fill_mode_value
[
3
]
=
{
FG_BUCKET_FILL
,
BG_BUCKET_FILL
,
PATTERN_BUCKET_FILL
};
...
...
app/tools/gimpconvolvetool.c
View file @
2ec50a9d
...
...
@@ -126,7 +126,7 @@ convolve_options_new (void)
GtkWidget
*
label
;
GtkWidget
*
scale
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Blur"
),
_
(
"Sharpen"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Blur"
),
N
_
(
"Sharpen"
)
};
gint
type_value
[
2
]
=
{
BLUR_CONVOLVE
,
SHARPEN_CONVOLVE
};
/* the new convolve tool options structure */
...
...
app/tools/gimpcroptool.c
View file @
2ec50a9d
...
...
@@ -40,8 +40,6 @@
#define RESIZING_LEFT 2
#define RESIZING_RIGHT 3
#define CROPPING 4
#define REFRAMING 5
/* speed of key movement */
#define ARROW_VELOCITY 25
...
...
@@ -120,7 +118,7 @@ static void crop_adjust_guides (GImage *, int, int, int, int);
/* Crop dialog functions */
static
void
crop_info_update
(
Tool
*
);
static
void
crop_info_create
(
Tool
*
);
static
void
crop_
ok
_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_
crop
_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_resize_callback
(
GtkWidget
*
,
gpointer
);
static
void
crop_close_callback
(
GtkWidget
*
,
gpointer
);
...
...
@@ -165,7 +163,7 @@ crop_options_new (void)
CropOptions
*
options
;
GtkWidget
*
vbox
;
GtkWidget
*
frame
;
gchar
*
type_label
[
2
]
=
{
_
(
"Crop"
),
_
(
"Resize"
)
};
gchar
*
type_label
[
2
]
=
{
N
_
(
"Crop"
),
N
_
(
"Resize"
)
};
gint
type_value
[
2
]
=
{
CROP_CROP
,
RESIZE_CROP
};
/* the new crop tool options structure */
...
...
@@ -175,7 +173,7 @@ crop_options_new (void)
crop_options_reset
);
options
->
layer_only
=
options
->
layer_only_d
=
FALSE
;
options
->
allow_enlarge
=
options
->
allow_enlarge_d
=
TRUE
;
options
->
type
=
options
->
type_d
=
CROP
_CROP
;
options
->
type
=
options
->
type_d
=
RESIZE
_CROP
;
/* the main vbox */
vbox
=
options
->
tool_options
.
main_vbox
;
...
...
@@ -255,12 +253,7 @@ crop_button_press (Tool *tool,
/* If the pointer is in the rectangular region, crop or resize it! */
else
if
(
bevent
->
x
>
crop
->
x1
&&
bevent
->
x
<
crop
->
x2
&&
bevent
->
y
>
crop
->
y1
&&
bevent
->
y
<
crop
->
y2
)
{
if
(
crop_options
->
type
==
CROP_CROP
)
crop
->
function
=
CROPPING
;
else
crop
->
function
=
REFRAMING
;
}
crop
->
function
=
CROPPING
;
/* otherwise, the new function will be creating, since we want to start anew */
else
crop
->
function
=
CREATING
;
...
...
@@ -307,30 +300,27 @@ crop_button_release (Tool *tool,
gdk_pointer_ungrab
(
bevent
->
time
);
gdk_flush
();
gtk_statusbar_pop
(
GTK_STATUSBAR
(
gdisp
->
statusbar
),
crop
->
context_id
);
gtk_statusbar_pop
(
GTK_STATUSBAR
(
gdisp
->
statusbar
),
crop
->
context_id
);
if
(
!
(
bevent
->
state
&
GDK_BUTTON3_MASK
))
{
switch
(
crop
->
function
)
if
(
crop
->
function
==
CROPPING
)
{
case
CROPPING
:
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
TRUE
);
break
;
case
REFRAMING
:
crop_
image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
FALSE
);
break
;
default:
crop_info_update
(
tool
);
return
;
if
(
crop_options
->
type
==
CROP_CROP
)
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_options
->
layer_only
,
TRUE
);
else
crop_image
(
gdisp
->
gimage
,
crop
->
tx1
,
crop
->
ty1
,
crop
->
tx2
,
crop
->
ty2
,
crop_
options
->
layer_only
,
FALSE
);
/* Finish the tool */
draw_core_stop
(
crop
->
core
,
tool
);
info_dialog_popdown
(
crop_info
);
tool
->
state
=
INACTIVE
;
}
else
crop_info_update
(
tool
);
}
/* Finish the tool */
draw_core_stop
(
crop
->
core
,
tool
);
info_dialog_popdown
(
crop_info
);
tool
->
state
=
INACTIVE
;
}
static
void
...
...
@@ -398,7 +388,7 @@ crop_motion (Tool *tool,
/* This is the only case when the motion events should be ignored--
we're just waiting for the button release event to crop the image */
if
(
crop
->
function
==
CROPPING
||
crop
->
function
==
REFRAMING
)
if
(
crop
->
function
==
CROPPING
)
return
;
gdisplay_untransform_coords
(
gdisp
,
mevent
->
x
,
mevent
->
y
,
&
curx
,
&
cury
,
TRUE
,
FALSE
);
...
...
@@ -651,26 +641,19 @@ crop_modifier_key_func (Tool *tool,
GdkEventKey
*
kevent
,
gpointer
gdisp_ptr
)
{
GDisplay
*
gdisp
;
gdisp
=
(
GDisplay
*
)
gdisp_ptr
;
if
(
tool
->
state
==
ACTIVE
&&
tool
->
gdisp_ptr
==
gdisp_ptr
)
switch
(
kevent
->
keyval
)
{
switch
(
kevent
->
keyval
)
{
case
GDK_Alt_L
:
case
GDK_Alt_R
:
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
allow_enlarge_w
),
!
crop_options
->
allow_enlarge
);
break
;
case
GDK_Shift_L
:
case
GDK_Shift_R
:
if
(
crop_options
->
type
==
CROP_CROP
)
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
RESIZE_CROP
]),
TRUE
);
else
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
type_w
[
CROP_CROP
]),
TRUE
);
break
;
case
GDK_Control_L
:
case
GDK_Control_R
:
break
;
}
case
GDK_Alt_L
:
case
GDK_Alt_R
:
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
crop_options
->
allow_enlarge_w
),
!
crop_options
->
allow_enlarge
);
break
;
case
GDK_Shift_L
:
case
GDK_Shift_R
: