Removed src/dialogs/effect/*.c

This commit is contained in:
David Capello 2007-11-08 00:54:31 +00:00
parent 0acca25989
commit 36f861ddd7
34 changed files with 2388 additions and 2101 deletions

View File

@ -1,7 +1,21 @@
2007-11-07 David A. Capello <dacap@users.sourceforge.net>
* src/commands/cmd_color_curve.c: Done. Removed src/dialogs/effect/dcolcurv.c
* src/commands/cmd_convolution_matrix.c: Done. Removed src/dialogs/effect/dconvmtr.c
* src/commands/cmd_despeckle.c: Done. Removed src/dialogs/effect/dmedian.c
* src/commands/cmd_replace_color.c: Done. Removed src/dialogs/effect/dreplcol.c
* src/commands/cmd_invert_color.c: Done. Removed src/dialogs/effect/dinvcol.c
* src/commands/cmd_flip.c: Done. Removed src/util/flip.c
2007-10-07 David A. Capello <dacap@users.sourceforge.net> 2007-10-07 David A. Capello <dacap@users.sourceforge.net>
* src/commands/cmd_new_frame.c (command_execute_new_frame): Added * src/commands/cmd_new_frame.c (command_execute_new_frame): Added
from new_frame() routine (now with undo of everything). from new_frame() routine (now with undo of sprite_set_frames).
* src/raster/undo.c (undo_set_frames): Added. * src/raster/undo.c (undo_set_frames): Added.

View File

@ -1,9 +1,10 @@
High priority work High priority work
------------------ ------------------
- search for XXX (XXXX is supposed to be high priority);
+ replace XXX to TODO;
- add support for PNG files. - add support for PNG files.
- ver por el nuevo load_font de Allegro. - ver por el nuevo load_font de Allegro.
- search for XXX (XXXX is supposed to be high priority);
- complete palette operations, and palette editor (it needs a slider - complete palette operations, and palette editor (it needs a slider
or something to move between palette changes); or something to move between palette changes);
- fix undo of big chunks (more than limit): - fix undo of big chunks (more than limit):
@ -44,7 +45,14 @@ High priority work
Wish-list Wish-list
--------- ---------
- Add menu customization through UI (Tools/Customize). - my wish-list:
+ keyboard shortcuts for snap-to-grid and view-grid
+ different snap-to-grid for paste operation
+ better dialogs: widder buttons, more borders.
+ better film editor
+ "middle mouse button" for the film editor.
+ don't use LINKs when load a sequence of bitmaps.
- add menu customization through UI (Tools/Customize).
- Mateusz Czaplinski ideas: - Mateusz Czaplinski ideas:
+ when move selections, will be good the possibility to see relative + when move selections, will be good the possibility to see relative
position from the starting point of movement; position from the starting point of movement;

View File

@ -21,8 +21,6 @@
<key command="copy" shortcut="Ctrl+C" /> <key command="copy" shortcut="Ctrl+Ins" /> <key command="copy" shortcut="Ctrl+C" /> <key command="copy" shortcut="Ctrl+Ins" />
<key command="paste" shortcut="Ctrl+V" /> <key command="paste" shortcut="Shift+Ins" /> <key command="paste" shortcut="Ctrl+V" /> <key command="paste" shortcut="Shift+Ins" />
<key command="clear" shortcut="Ctrl+B" /> <key command="clear" shortcut="Ctrl+Del" /> <key command="clear" shortcut="Ctrl+B" /> <key command="clear" shortcut="Ctrl+Del" />
<key command="quick_move" shortcut="Shift+M" />
<key command="quick_copy" shortcut="Shift+C" />
<key command="flip_horizontal" shortcut="Shift+H" /> <key command="flip_horizontal" shortcut="Shift+H" />
<key command="flip_vertical" shortcut="Shift+V" /> <key command="flip_vertical" shortcut="Shift+V" />
<key command="replace_color" shortcut="Shift+R" /> <key command="replace_color" shortcut="Shift+R" />
@ -99,9 +97,6 @@
<item command="paste" name="&Paste" /> <item command="paste" name="&Paste" />
<item command="clear" name="C&lear" /> <item command="clear" name="C&lear" />
<separator /> <separator />
<item command="quick_move" name="Quick &Move" />
<item command="quick_copy" name="Quick C&opy" />
<separator />
<item command="flip_horizontal" name="Flip &Horizontal" /> <item command="flip_horizontal" name="Flip &Horizontal" />
<item command="flip_vertical" name="Flip &Vertical" /> <item command="flip_vertical" name="Flip &Vertical" />
<separator /> <separator />

View File

@ -146,7 +146,6 @@ void ji_set_standard_theme(void)
{ {
if (!ji_standard_theme) { if (!ji_standard_theme) {
ji_standard_theme = jtheme_new_standard(); ji_standard_theme = jtheme_new_standard();
/* ji_standard_theme = jtheme_new_simple(); */
if (!ji_standard_theme) if (!ji_standard_theme)
return; return;
} }

File diff suppressed because it is too large Load Diff

View File

@ -84,10 +84,10 @@ $(ZLIB_LIB): $(ZLIB_OBJS)
VPATH = src \ VPATH = src \
src/commands \ src/commands \
src/commands/fx \
src/console \ src/console \
src/core \ src/core \
src/dialogs \ src/dialogs \
src/dialogs/effect \
src/effect \ src/effect \
src/file \ src/file \
src/file/gif \ src/file/gif \

View File

@ -5,182 +5,175 @@
ASE = ase$(EXE) ASE = ase$(EXE)
ASE_SOURCES = \ ASE_SOURCES = \
src/commands/cmd_about.c \ src/commands/cmd_about.c \
src/commands/cmd_advanced_mode.c \ src/commands/cmd_advanced_mode.c \
src/commands/cmd_change_image_type.c \ src/commands/cmd_change_image_type.c \
src/commands/cmd_clear.c \ src/commands/cmd_clear.c \
src/commands/cmd_close_file.c \ src/commands/cmd_close_file.c \
src/commands/cmd_color_curve.c \ src/commands/cmd_configure_screen.c \
src/commands/cmd_configure_screen.c \ src/commands/cmd_configure_tools.c \
src/commands/cmd_configure_tools.c \ src/commands/cmd_copy.c \
src/commands/cmd_convolution_matrix.c \ src/commands/cmd_copy_frame.c \
src/commands/cmd_copy.c \ src/commands/cmd_crop.c \
src/commands/cmd_copy_frame.c \ src/commands/cmd_cut.c \
src/commands/cmd_crop.c \ src/commands/cmd_deselect_mask.c \
src/commands/cmd_cut.c \ src/commands/cmd_draw_text.c \
src/commands/cmd_deselect_mask.c \ src/commands/cmd_drawing_tools.c \
src/commands/cmd_despeckle.c \ src/commands/cmd_duplicate_layer.c \
src/commands/cmd_draw_text.c \ src/commands/cmd_duplicate_sprite.c \
src/commands/cmd_drawing_tools.c \ src/commands/cmd_exit.c \
src/commands/cmd_duplicate_layer.c \ src/commands/cmd_film_editor.c \
src/commands/cmd_duplicate_sprite.c \ src/commands/cmd_flatten_layers.c \
src/commands/cmd_sprite_editor.c \ src/commands/cmd_flip.c \
src/commands/cmd_exit.c \ src/commands/cmd_frame_properties.c \
src/commands/cmd_film_editor.c \ src/commands/cmd_invert_mask.c \
src/commands/cmd_flatten_layers.c \ src/commands/cmd_layer_properties.c \
src/commands/cmd_flip_horizontal.c \ src/commands/cmd_link_frame.c \
src/commands/cmd_flip_vertical.c \ src/commands/cmd_load_mask.c \
src/commands/cmd_frame_properties.c \ src/commands/cmd_mapgen.c \
src/commands/cmd_invert_color.c \ src/commands/cmd_mask_all.c \
src/commands/cmd_invert_mask.c \ src/commands/cmd_mask_by_color.c \
src/commands/cmd_layer_properties.c \ src/commands/cmd_merge_down_layer.c \
src/commands/cmd_link_frame.c \ src/commands/cmd_move_frame.c \
src/commands/cmd_load_mask.c \ src/commands/cmd_new_file.c \
src/commands/cmd_mapgen.c \ src/commands/cmd_new_frame.c \
src/commands/cmd_mask_all.c \ src/commands/cmd_new_layer.c \
src/commands/cmd_mask_by_color.c \ src/commands/cmd_new_layer_set.c \
src/commands/cmd_merge_down_layer.c \ src/commands/cmd_open_file.c \
src/commands/cmd_move_frame.c \ src/commands/cmd_options.c \
src/commands/cmd_new_file.c \ src/commands/cmd_palette_editor.c \
src/commands/cmd_new_frame.c \ src/commands/cmd_paste.c \
src/commands/cmd_new_layer.c \ src/commands/cmd_play_flic.c \
src/commands/cmd_new_layer_set.c \ src/commands/cmd_preview.c \
src/commands/cmd_open_file.c \ src/commands/cmd_quick_copy.c \
src/commands/cmd_options.c \ src/commands/cmd_quick_move.c \
src/commands/cmd_palette_editor.c \ src/commands/cmd_record_screen.c \
src/commands/cmd_paste.c \ src/commands/cmd_redo.c \
src/commands/cmd_play_flic.c \ src/commands/cmd_refresh.c \
src/commands/cmd_preview.c \ src/commands/cmd_remove_frame.c \
src/commands/cmd_quick_copy.c \ src/commands/cmd_remove_layer.c \
src/commands/cmd_quick_move.c \ src/commands/cmd_reselect_mask.c \
src/commands/cmd_record_screen.c \ src/commands/cmd_run_script.c \
src/commands/cmd_redo.c \ src/commands/cmd_save_file.c \
src/commands/cmd_refresh.c \ src/commands/cmd_save_file_as.c \
src/commands/cmd_remove_frame.c \ src/commands/cmd_save_mask.c \
src/commands/cmd_remove_layer.c \ src/commands/cmd_screen_shot.c \
src/commands/cmd_replace_color.c \ src/commands/cmd_select_file.c \
src/commands/cmd_reselect_mask.c \ src/commands/cmd_sprite_editor.c \
src/commands/cmd_run_script.c \ src/commands/cmd_sprite_properties.c \
src/commands/cmd_save_file.c \ src/commands/cmd_tips.c \
src/commands/cmd_save_file_as.c \ src/commands/cmd_undo.c \
src/commands/cmd_save_mask.c \ src/commands/commands.c \
src/commands/cmd_screen_shot.c \ src/commands/fx/cmd_color_curve.c \
src/commands/cmd_select_file.c \ src/commands/fx/cmd_convolution_matrix.c \
src/commands/cmd_sprite_properties.c \ src/commands/fx/cmd_despeckle.c \
src/commands/cmd_tips.c \ src/commands/fx/cmd_invert_color.c \
src/commands/cmd_undo.c \ src/commands/fx/cmd_replace_color.c \
src/commands/commands.c \ src/console/console.c \
src/console/console.c \ src/core/app.c \
src/core/app.c \ src/core/config.c \
src/core/config.c \ src/core/cfg.c \
src/core/cfg.c \ src/core/core.c \
src/core/core.c \ src/core/dirs.c \
src/core/dirs.c \ src/core/modules.c \
src/core/modules.c \ src/dialogs/canvasze.c \
src/dialogs/canvasze.c \ src/dialogs/colsel.c \
src/dialogs/colsel.c \ src/dialogs/dmapgen.c \
src/dialogs/dmapgen.c \ src/dialogs/dpaledit.c \
src/dialogs/dpaledit.c \ src/dialogs/drawtext.c \
src/dialogs/drawtext.c \ src/dialogs/filesel.c \
src/dialogs/effect/dcolcurv.c \ src/dialogs/filmedit.c \
src/dialogs/effect/dconvmtr.c \ src/dialogs/gfxsel.c \
src/dialogs/effect/dinvcol.c \ src/dialogs/maskcol.c \
src/dialogs/effect/dmedian.c \ src/dialogs/minipal.c \
src/dialogs/effect/dreplcol.c \ src/dialogs/options.c \
src/dialogs/filesel.c \ src/dialogs/playfli.c \
src/dialogs/filmedit.c \ src/dialogs/quick.c \
src/dialogs/gfxsel.c \ src/dialogs/repo.c \
src/dialogs/maskcol.c \ src/dialogs/scrsaver.c \
src/dialogs/minipal.c \ src/dialogs/tips.c \
src/dialogs/options.c \ src/dialogs/vectmap.c \
src/dialogs/playfli.c \ src/effect/colcurve.c \
src/dialogs/quick.c \ src/effect/convmatr.c \
src/dialogs/repo.c \ src/effect/effect.c \
src/dialogs/scrsaver.c \ src/effect/invrtcol.c \
src/dialogs/tips.c \ src/effect/median.c \
src/dialogs/vectmap.c \ src/effect/replcol.c \
src/effect/colcurve.c \ src/file/ase.c \
src/effect/convmatr.c \ src/file/bmp.c \
src/effect/effect.c \ src/file/file.c \
src/effect/invrtcol.c \ src/file/fli.c \
src/effect/median.c \ src/file/ico.c \
src/effect/replcol.c \ src/file/jpeg.c \
src/file/ase.c \ src/file/pcx.c \
src/file/bmp.c \ src/file/png_file.c \
src/file/file.c \ src/file/tga.c \
src/file/fli.c \ src/file/gif.c \
src/file/ico.c \ src/file/gif/format.c \
src/file/jpeg.c \ src/file/gif/lzw.c \
src/file/pcx.c \ src/intl/intl.c \
src/file/png_file.c \ src/intl/msgids.c \
src/file/tga.c \ src/main.c \
src/file/gif.c \ src/modules/color.c \
src/file/gif/format.c \ src/modules/editors.c \
src/file/gif/lzw.c \ src/modules/gfx.c \
src/intl/intl.c \ src/modules/gui.c \
src/intl/msgids.c \ src/modules/palette.c \
src/main.c \ src/modules/recent.c \
src/modules/color.c \ src/modules/render.c \
src/modules/editors.c \ src/modules/rootmenu.c \
src/modules/gfx.c \ src/modules/sprites.c \
src/modules/gui.c \ src/modules/tools.c \
src/modules/palette.c \ src/modules/tools2.c \
src/modules/recent.c \ src/raster/algo.c \
src/modules/render.c \ src/raster/algofill.c \
src/modules/rootmenu.c \ src/raster/blend.c \
src/modules/sprites.c \ src/raster/brush.c \
src/modules/tools.c \ src/raster/dirty.c \
src/modules/tools2.c \ src/raster/frame.c \
src/raster/algo.c \ src/raster/gfxobj.c \
src/raster/algofill.c \ src/raster/image.c \
src/raster/blend.c \ src/raster/layer.c \
src/raster/brush.c \ src/raster/mask.c \
src/raster/dirty.c \ src/raster/path.c \
src/raster/frame.c \ src/raster/quant.c \
src/raster/gfxobj.c \ src/raster/rotate.c \
src/raster/image.c \ src/raster/sprite.c \
src/raster/layer.c \ src/raster/stock.c \
src/raster/mask.c \ src/raster/undo.c \
src/raster/path.c \ src/script/bindings.c \
src/raster/quant.c \ src/script/script.c \
src/raster/rotate.c \ src/util/autocrop.c \
src/raster/sprite.c \ src/util/boundary.c \
src/raster/stock.c \ src/util/clipbrd.c \
src/raster/undo.c \ src/util/col_file.c \
src/script/bindings.c \ src/util/crop.c \
src/script/script.c \ src/util/filetoks.c \
src/util/autocrop.c \ src/util/frmove.c \
src/util/boundary.c \ src/util/hash.c \
src/util/clipbrd.c \ src/util/mapgen.c \
src/util/col_file.c \ src/util/misc.c \
src/util/crop.c \ src/util/msk_file.c \
src/util/filetoks.c \ src/util/pic_file.c \
src/util/flip.c \ src/util/quantize.c \
src/util/frmove.c \ src/util/recscr.c \
src/util/hash.c \ src/util/setgfx.c \
src/util/mapgen.c \ src/util/thmbnail.c \
src/util/misc.c \ src/widgets/colbar.c \
src/util/msk_file.c \ src/widgets/colbut.c \
src/util/pic_file.c \ src/widgets/colview.c \
src/util/quantize.c \ src/widgets/curvedit.c \
src/util/recscr.c \ src/widgets/editor/click.c \
src/util/setgfx.c \ src/widgets/editor/cursor.c \
src/util/thmbnail.c \ src/widgets/editor/editor.c \
src/widgets/colbar.c \ src/widgets/editor/keys.c \
src/widgets/colbut.c \ src/widgets/groupbut.c \
src/widgets/colview.c \ src/widgets/menuitem.c \
src/widgets/curvedit.c \ src/widgets/paledit.c \
src/widgets/editor/click.c \ src/widgets/preview.c \
src/widgets/editor/cursor.c \ src/widgets/statebar.c \
src/widgets/editor/editor.c \ src/widgets/target.c \
src/widgets/editor/keys.c \
src/widgets/groupbut.c \
src/widgets/menuitem.c \
src/widgets/paledit.c \
src/widgets/preview.c \
src/widgets/statebar.c \
src/widgets/target.c \
src/widgets/toolbar.c src/widgets/toolbar.c
ASE_OBJS = $(addprefix $(OBJ_DIR)/, \ ASE_OBJS = $(addprefix $(OBJ_DIR)/, \

View File

@ -102,8 +102,8 @@ ase_files="all.h \
*.txt \ *.txt \
data/aseicon.* \ data/aseicon.* \
data/convmatr.def \ data/convmatr.def \
data/defgui-en.xml \ data/gui-en.xml \
data/defgui-es.xml \ data/gui-es.xml \
data/fonts/*.pcx \ data/fonts/*.pcx \
data/jids/*.jid \ data/jids/*.jid \
data/palettes/*.col \ data/palettes/*.col \

View File

@ -27,10 +27,10 @@ rm -f makefile.dep
$GCC $CFLAGS jinete/src/*.c \ $GCC $CFLAGS jinete/src/*.c \
src/*.c \ src/*.c \
src/commands/*.c \ src/commands/*.c \
src/commands/fx/*.c \
src/console/*.c \ src/console/*.c \
src/core/*.c \ src/core/*.c \
src/dialogs/*.c \ src/dialogs/*.c \
src/dialogs/effect/*.c \
src/effect/*.c \ src/effect/*.c \
src/file/*.c \ src/file/*.c \
src/intl/*.c \ src/intl/*.c \

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_color_curve(const char *argument)
{
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_convolution_matrix(const char *argument)
{
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_despeckle(const char *argument)
{
}

View File

@ -1,85 +1,112 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory /* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005 David A. Capello * Copyright (C) 2007 David A. Capello
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h" #include "config.h"
#ifndef USE_PRECOMPILED_HEADER #ifndef USE_PRECOMPILED_HEADER
#include "modules/editors.h" #include "modules/editors.h"
#include "modules/sprites.h" #include "modules/gui.h"
#include "raster/image.h" #include "modules/sprites.h"
#include "raster/mask.h" #include "raster/image.h"
#include "raster/sprite.h" #include "raster/mask.h"
#include "raster/undo.h" #include "raster/sprite.h"
#include "util/misc.h" #include "raster/undo.h"
#include "util/misc.h"
#endif
#endif
static void do_flip (int horz);
static void do_flip(int horz);
void flip_horizontal (void) { do_flip (TRUE); }
void flip_vertical (void) { do_flip (FALSE); } /* ======================== */
/* flip_horizontal */
static void do_flip (int horz) /* ======================== */
{
Sprite *sprite = current_sprite; bool command_enabled_flip_horizontal(const char *argument)
Image *image, *area; {
int x1, y1, x2, y2; return current_sprite != NULL;
int x, y; }
if (!sprite) void command_execute_flip_horizontal(const char *argument)
return; {
do_flip(TRUE);
image = GetImage2 (sprite, &x, &y, NULL); }
if (!image)
return; /* ======================== */
/* flip_vertical */
if (mask_is_empty (sprite->mask)) { /* ======================== */
x1 = 0;
y1 = 0; bool command_enabled_flip_vertical(const char *argument)
x2 = image->w-1; {
y2 = image->h-1; return current_sprite != NULL;
} }
else {
/* apply the frame offset */ void command_execute_flip_vertical(const char *argument)
x1 = sprite->mask->x - x; {
y1 = sprite->mask->y - y; do_flip(FALSE);
x2 = sprite->mask->x + sprite->mask->w - 1 - x; }
y2 = sprite->mask->y + sprite->mask->h - 1 - y;
/************************************************************/
/* clip */ /* do_flip */
x1 = MID (0, x1, image->w-1);
y1 = MID (0, y1, image->h-1); static void do_flip(int horz)
x2 = MID (0, x2, image->w-1); {
y2 = MID (0, y2, image->h-1); Sprite *sprite = current_sprite;
} Image *image, *area;
int x1, y1, x2, y2;
/* insert the undo operation */ int x, y;
if (undo_is_enabled (sprite->undo))
undo_flip (sprite->undo, image, x1, y1, x2, y2, horz); image = GetImage2(sprite, &x, &y, NULL);
if (!image)
/* flip the portion of the bitmap */ return;
area = image_crop (image, x1, y1, x2-x1+1, y2-y1+1);
for (y=0; y<(y2-y1+1); y++) if (mask_is_empty(sprite->mask)) {
for (x=0; x<(x2-x1+1); x++) x1 = 0;
image_putpixel (image, y1 = 0;
horz ? x2-x: x1+x, x2 = image->w-1;
!horz? y2-y: y1+y, y2 = image->h-1;
image_getpixel (area, x, y)); }
image_free (area); else {
} /* apply the frame offset */
x1 = sprite->mask->x - x;
y1 = sprite->mask->y - y;
x2 = sprite->mask->x + sprite->mask->w - 1 - x;
y2 = sprite->mask->y + sprite->mask->h - 1 - y;
/* clip */
x1 = MID (0, x1, image->w-1);
y1 = MID (0, y1, image->h-1);
x2 = MID (0, x2, image->w-1);
y2 = MID (0, y2, image->h-1);
}
/* insert the undo operation */
if (undo_is_enabled(sprite->undo))
undo_flip(sprite->undo, image, x1, y1, x2, y2, horz);
/* flip the portion of the bitmap */
area = image_crop(image, x1, y1, x2-x1+1, y2-y1+1);
for (y=0; y<(y2-y1+1); y++)
for (x=0; x<(x2-x1+1); x++)
image_putpixel(image,
horz ? x2-x: x1+x,
!horz? y2-y: y1+y,
image_getpixel (area, x, y));
image_free(area);
GUI_Refresh(current_sprite);
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_flip_horizontal(const char *argument)
{
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_flip_vertical(const char *argument)
{
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_invert_color(const char *argument)
{
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_quick_copy(const char *argument)
{
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_quick_move(const char *argument)
{
}

View File

@ -1,33 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_replace_color(const char *argument)
{
}

View File

@ -63,11 +63,13 @@ bool command_enabled_paste(const char *argument);
void command_execute_paste(const char *argument); void command_execute_paste(const char *argument);
bool command_enabled_clear(const char *argument); bool command_enabled_clear(const char *argument);
void command_execute_clear(const char *argument); void command_execute_clear(const char *argument);
void command_execute_quick_move(const char *argument); bool command_enabled_flip_horizontal(const char *argument);
void command_execute_quick_copy(const char *argument);
void command_execute_flip_horizontal(const char *argument); void command_execute_flip_horizontal(const char *argument);
bool command_enabled_flip_vertical(const char *argument);
void command_execute_flip_vertical(const char *argument); void command_execute_flip_vertical(const char *argument);
bool command_enabled_replace_color(const char *argument);
void command_execute_replace_color(const char *argument); void command_execute_replace_color(const char *argument);
bool command_enabled_invert_color(const char *argument);
void command_execute_invert_color(const char *argument); void command_execute_invert_color(const char *argument);
void command_execute_refresh(const char *argument); void command_execute_refresh(const char *argument);
void command_execute_configure_screen(const char *argument); void command_execute_configure_screen(const char *argument);
@ -150,8 +152,11 @@ void command_execute_ellipse_tool(const char *argument);
bool command_enabled_film_editor(const char *argument); bool command_enabled_film_editor(const char *argument);
void command_execute_film_editor(const char *argument); void command_execute_film_editor(const char *argument);
void command_execute_palette_editor(const char *argument); void command_execute_palette_editor(const char *argument);
bool command_enabled_convolution_matrix(const char *argument);
void command_execute_convolution_matrix(const char *argument); void command_execute_convolution_matrix(const char *argument);
bool command_enabled_color_curve(const char *argument);
void command_execute_color_curve(const char *argument); void command_execute_color_curve(const char *argument);
bool command_enabled_despeckle(const char *argument);
void command_execute_despeckle(const char *argument); void command_execute_despeckle(const char *argument);
/* void command_execute_draw_text(const char *argument); */ /* void command_execute_draw_text(const char *argument); */
/* void command_execute_play_flic(const char *argument); */ /* void command_execute_play_flic(const char *argument); */
@ -188,12 +193,10 @@ static Command commands[] = {
CMD_EXE_ENA(copy), CMD_EXE_ENA(copy),
CMD_EXE_ENA(paste), CMD_EXE_ENA(paste),
CMD_EXE_ENA(clear), CMD_EXE_ENA(clear),
{ CMD_QUICK_MOVE, NULL, NULL, NULL, NULL }, CMD_EXE_ENA(flip_horizontal),
{ CMD_QUICK_COPY, NULL, NULL, NULL, NULL }, CMD_EXE_ENA(flip_vertical),
{ CMD_FLIP_HORIZONTAL, NULL, NULL, NULL, NULL }, CMD_EXE_ENA(replace_color),
{ CMD_FLIP_VERTICAL, NULL, NULL, NULL, NULL }, CMD_EXE_ENA(invert_color),
{ CMD_REPLACE_COLOR, NULL, NULL, NULL, NULL },
{ CMD_INVERT_COLOR, NULL, NULL, NULL, NULL },
CMD_EXE(refresh), CMD_EXE(refresh),
{ CMD_CONFIGURE_SCREEN, NULL, NULL, NULL, NULL }, { CMD_CONFIGURE_SCREEN, NULL, NULL, NULL, NULL },
CMD_EXE(advanced_mode), CMD_EXE(advanced_mode),
@ -243,9 +246,9 @@ static Command commands[] = {
CMD_EXE_CHK(ellipse_tool), CMD_EXE_CHK(ellipse_tool),
CMD_EXE_ENA(film_editor), CMD_EXE_ENA(film_editor),
{ CMD_PALETTE_EDITOR, NULL, NULL, NULL, NULL }, { CMD_PALETTE_EDITOR, NULL, NULL, NULL, NULL },
{ CMD_CONVOLUTION_MATRIX, NULL, NULL, NULL, NULL }, CMD_EXE_ENA(convolution_matrix),
{ CMD_COLOR_CURVE, NULL, NULL, NULL, NULL }, CMD_EXE_ENA(color_curve),
{ CMD_DESPECKLE, NULL, NULL, NULL, NULL }, CMD_EXE_ENA(despeckle),
/* { CMD_DRAW_TEXT, NULL, NULL, NULL, NULL }, */ /* { CMD_DRAW_TEXT, NULL, NULL, NULL, NULL }, */
/* { CMD_PLAY_FLIC, NULL, NULL, NULL, NULL }, */ /* { CMD_PLAY_FLIC, NULL, NULL, NULL, NULL }, */
/* { CMD_MAPGEN, NULL, NULL, NULL, NULL }, */ /* { CMD_MAPGEN, NULL, NULL, NULL, NULL }, */

View File

@ -39,8 +39,6 @@
#define CMD_COPY "copy" #define CMD_COPY "copy"
#define CMD_PASTE "paste" #define CMD_PASTE "paste"
#define CMD_CLEAR "clear" #define CMD_CLEAR "clear"
#define CMD_QUICK_MOVE "quick_move"
#define CMD_QUICK_COPY "quick_copy"
#define CMD_FLIP_HORIZONTAL "flip_horizontal" #define CMD_FLIP_HORIZONTAL "flip_horizontal"
#define CMD_FLIP_VERTICAL "flip_vertical" #define CMD_FLIP_VERTICAL "flip_vertical"
#define CMD_REPLACE_COLOR "replace_color" #define CMD_REPLACE_COLOR "replace_color"

View File

@ -1,170 +1,172 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory /* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005, 2007 David A. Capello * Copyright (C) 2007 David A. Capello
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h" #include "config.h"
#ifndef USE_PRECOMPILED_HEADER #ifndef USE_PRECOMPILED_HEADER
#include "jinete.h" #include "jinete.h"
#include "console/console.h" #include "console/console.h"
#include "core/cfg.h" #include "core/cfg.h"
#include "core/core.h" #include "core/core.h"
#include "effect/colcurve.h" #include "effect/colcurve.h"
#include "effect/effect.h" #include "effect/effect.h"
#include "modules/color.h" #include "modules/color.h"
/* #include "modules/editors.h" */ /* #include "modules/editors.h" */
#include "modules/gui.h" #include "modules/gui.h"
#include "modules/sprites.h" #include "modules/sprites.h"
#include "raster/image.h" #include "raster/image.h"
#include "raster/mask.h" #include "raster/mask.h"
#include "raster/sprite.h" #include "raster/sprite.h"
#include "util/misc.h" #include "util/misc.h"
#include "widgets/colbar.h" #include "widgets/colbar.h"
#include "widgets/colbut.h" #include "widgets/colbut.h"
#include "widgets/curvedit.h" #include "widgets/curvedit.h"
#include "widgets/preview.h" #include "widgets/preview.h"
#include "widgets/target.h" #include "widgets/target.h"
#endif #endif
static Curve *the_curve = NULL; static Curve *the_curve = NULL;
static JWidget check_preview, preview; static JWidget check_preview, preview;
static bool hooked_msg_proc (JWidget widget, JMessage msg); static bool hooked_msg_proc (JWidget widget, JMessage msg);
static void make_preview (void); static void make_preview (void);
void dialogs_color_curve(void) bool command_enabled_color_curve(const char *argument)
{ {
JWidget window, button_ok; return current_sprite != NULL;
JWidget view_curve, curve_editor; }
JWidget box_target, target_button;
Sprite *sprite = current_sprite; void command_execute_color_curve(const char *argument)
Image *image; {
Effect *effect; JWidget window, button_ok;
JWidget view_curve, curve_editor;
if (!the_curve) { JWidget box_target, target_button;
/* default curve */ Sprite *sprite = current_sprite;
the_curve = curve_new (CURVE_LINEAR); Image *image;
curve_add_point (the_curve, curve_point_new (0, 0)); Effect *effect;
curve_add_point (the_curve, curve_point_new (255, 255));
} if (!the_curve) {
/* default curve */
if (!is_interactive () || !sprite) the_curve = curve_new (CURVE_LINEAR);
return; curve_add_point (the_curve, curve_point_new (0, 0));
curve_add_point (the_curve, curve_point_new (255, 255));
image = GetImage (); }
if (!image)
return; image = GetImage ();
if (!image)
window = load_widget ("colcurv.jid", "color_curve"); return;
if (!window)
return; window = load_widget ("colcurv.jid", "color_curve");
if (!window)
if (!get_widgets (window, return;
"preview", &check_preview,
"button_ok", &button_ok, if (!get_widgets (window,
"curve", &view_curve, "preview", &check_preview,
"target", &box_target, NULL)) { "button_ok", &button_ok,
jwidget_free (window); "curve", &view_curve,
return; "target", &box_target, NULL)) {
} jwidget_free (window);
return;
effect = effect_new (sprite, "color_curve"); }
if (!effect) {
console_printf (_("Error creating the effect applicator for this sprite\n")); effect = effect_new (sprite, "color_curve");
jwidget_free (window); if (!effect) {
return; console_printf (_("Error creating the effect applicator for this sprite\n"));
} jwidget_free (window);
return;
preview = preview_new (effect); }
set_color_curve (the_curve); preview = preview_new (effect);
curve_editor = curve_editor_new (the_curve, 0, 0, 255, 255); set_color_curve (the_curve);
target_button = target_button_new (sprite->imgtype, TRUE);
curve_editor = curve_editor_new (the_curve, 0, 0, 255, 255);
if (get_config_bool ("ColorCurve", "Preview", TRUE)) target_button = target_button_new (sprite->imgtype, TRUE);
jwidget_select (check_preview);
if (get_config_bool ("ColorCurve", "Preview", TRUE))
jview_attach (view_curve, curve_editor); jwidget_select (check_preview);
jwidget_set_static_size (view_curve, 64, 64);
jview_attach (view_curve, curve_editor);
jwidget_add_child (box_target, target_button); jwidget_set_static_size (view_curve, 64, 64);
jwidget_add_child (window, preview);
jwidget_add_child (box_target, target_button);
jwidget_add_hook (window, JI_WIDGET, hooked_msg_proc, NULL); jwidget_add_child (window, preview);
/* default position */ jwidget_add_hook (window, JI_WIDGET, hooked_msg_proc, NULL);
jwindow_remap (window);
jwindow_center (window); /* default position */
jwindow_remap (window);
/* first preview */ jwindow_center (window);
make_preview ();
/* first preview */
/* load window configuration */ make_preview ();
load_window_pos (window, "ColorCurve");
/* load window configuration */
/* open the window */ load_window_pos (window, "ColorCurve");
jwindow_open_fg (window);
/* open the window */
if (jwindow_get_killer (window) == button_ok) { jwindow_open_fg (window);
effect_apply_to_target (effect);
} if (jwindow_get_killer (window) == button_ok) {
effect_apply_to_target (effect);
effect_free (effect); }
/* update editors */ effect_free (effect);
GUI_Refresh (sprite);
/* update editors */
/* save window configuration */ GUI_Refresh (sprite);
save_window_pos (window, "ColorCurve");
/* save window configuration */
jwidget_free (window); save_window_pos (window, "ColorCurve");
}
jwidget_free (window);
static bool hooked_msg_proc (JWidget widget, JMessage msg) }
{
if (msg->type == JM_SIGNAL) { static bool hooked_msg_proc (JWidget widget, JMessage msg)
switch (msg->signal.num) { {
if (msg->type == JM_SIGNAL) {
case SIGNAL_CURVE_EDITOR_CHANGE: switch (msg->signal.num) {
set_color_curve (curve_editor_get_curve (msg->signal.from));
make_preview (); case SIGNAL_CURVE_EDITOR_CHANGE:
break; set_color_curve (curve_editor_get_curve (msg->signal.from));
make_preview ();
case SIGNAL_TARGET_BUTTON_CHANGE: break;
effect_load_target (preview_get_effect (preview));
make_preview (); case SIGNAL_TARGET_BUTTON_CHANGE:
break; effect_load_target (preview_get_effect (preview));
make_preview ();
case JI_SIGNAL_CHECK_CHANGE: break;
set_config_bool ("ColorCurve", "Preview",
jwidget_is_selected (msg->signal.from)); case JI_SIGNAL_CHECK_CHANGE:
make_preview (); set_config_bool ("ColorCurve", "Preview",
break; jwidget_is_selected (msg->signal.from));
} make_preview ();
} break;
return FALSE; }
} }
return FALSE;
static void make_preview (void) }
{
if (jwidget_is_selected (check_preview)) static void make_preview (void)
preview_restart (preview); {
} if (jwidget_is_selected (check_preview))
preview_restart (preview);
}

View File

@ -1,344 +1,346 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory /* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005, 2007 David A. Capello * Copyright (C) 2007 David A. Capello
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h" #include "config.h"
#ifndef USE_PRECOMPILED_HEADER #ifndef USE_PRECOMPILED_HEADER
#include <string.h> #include <string.h>
#include "jinete/box.h" #include "jinete/box.h"
#include "jinete/button.h" #include "jinete/button.h"
#include "jinete/hook.h" #include "jinete/hook.h"
#include "jinete/label.h" #include "jinete/label.h"
#include "jinete/list.h" #include "jinete/list.h"
#include "jinete/listbox.h" #include "jinete/listbox.h"
#include "jinete/slider.h" #include "jinete/slider.h"
#include "jinete/view.h" #include "jinete/view.h"
#include "jinete/widget.h" #include "jinete/widget.h"
#include "jinete/window.h" #include "jinete/window.h"
#include "console/console.h" #include "console/console.h"
#include "core/cfg.h" #include "core/cfg.h"
#include "core/core.h" #include "core/core.h"
#include "effect/colcurve.h" #include "effect/colcurve.h"
#include "effect/convmatr.h" #include "effect/convmatr.h"
#include "effect/effect.h" #include "effect/effect.h"
#include "modules/color.h" #include "modules/color.h"
/* #include "modules/editors.h" */ /* #include "modules/editors.h" */
#include "modules/gui.h" #include "modules/gui.h"
#include "modules/sprites.h" #include "modules/sprites.h"
#include "modules/tools.h" #include "modules/tools.h"
#include "raster/image.h" #include "raster/image.h"
#include "raster/mask.h" #include "raster/mask.h"
#include "raster/sprite.h" #include "raster/sprite.h"
#include "util/misc.h" #include "util/misc.h"
#include "widgets/colbar.h" #include "widgets/colbar.h"
#include "widgets/colbut.h" #include "widgets/colbut.h"
#include "widgets/curvedit.h" #include "widgets/curvedit.h"
#include "widgets/preview.h" #include "widgets/preview.h"
#include "widgets/target.h" #include "widgets/target.h"
#endif #endif
static JWidget check_preview, preview; static JWidget check_preview, preview;
static JWidget check_tiled; static JWidget check_tiled;
static JWidget listbox_generate_convmatg (void); static JWidget listbox_generate_convmatg (void);
static void listbox_fill_convmatg (JWidget listbox); static void listbox_fill_convmatg (JWidget listbox);
static void listbox_select_current_convmatr (JWidget listbox); static void listbox_select_current_convmatr (JWidget listbox);
static int reload_select_hook (JWidget widget, int user_data); static int reload_select_hook (JWidget widget, int user_data);
static int generate_select_hook (JWidget widget, int user_data); static int generate_select_hook (JWidget widget, int user_data);
static int list_change_hook (JWidget widget, int user_data); static int list_change_hook (JWidget widget, int user_data);
static int target_change_hook (JWidget widget, int user_data); static int target_change_hook (JWidget widget, int user_data);
static int preview_change_hook (JWidget widget, int user_data); static int preview_change_hook (JWidget widget, int user_data);
static int tiled_change_hook (JWidget widget, int user_data); static int tiled_change_hook (JWidget widget, int user_data);
static void make_preview (void); static void make_preview (void);
void dialogs_convolution_matrix(void) bool command_enabled_convolution_matrix(const char *argument)
{ {
JWidget window, button_ok; return current_sprite != NULL;
JWidget view_convmatr, list_convmatr; }
JWidget box_target, target_button;
JWidget reload, generate; void command_execute_convolution_matrix(const char *argument)
Sprite *sprite = current_sprite; {
Image *image; JWidget window, button_ok;
Effect *effect; JWidget view_convmatr, list_convmatr;
JWidget box_target, target_button;
if (!is_interactive () || !sprite) JWidget reload, generate;
return; Sprite *sprite = current_sprite;
Image *image;
image = GetImage (); Effect *effect;
if (!image)
return; image = GetImage ();
if (!image)
window = load_widget ("convmatr.jid", "convolution_matrix"); return;
if (!window)
return; window = load_widget ("convmatr.jid", "convolution_matrix");
if (!window)
if (!get_widgets (window, return;
"preview", &check_preview,
"tiled", &check_tiled, if (!get_widgets (window,
"button_ok", &button_ok, "preview", &check_preview,
"view", &view_convmatr, "tiled", &check_tiled,
"target", &box_target, "button_ok", &button_ok,
"reload", &reload, "view", &view_convmatr,
"generate", &generate, NULL)) { "target", &box_target,
jwidget_free (window); "reload", &reload,
return; "generate", &generate, NULL)) {
} jwidget_free (window);
return;
effect = effect_new (sprite, "convolution_matrix"); }
if (!effect) {
console_printf (_("Error creating the effect applicator for this sprite\n")); effect = effect_new (sprite, "convolution_matrix");
jwidget_free (window); if (!effect) {
return; console_printf (_("Error creating the effect applicator for this sprite\n"));
} jwidget_free (window);
return;
preview = preview_new (effect); }
list_convmatr = listbox_generate_convmatg (); preview = preview_new (effect);
target_button = target_button_new (sprite->imgtype, TRUE);
list_convmatr = listbox_generate_convmatg ();
if (get_config_bool ("ConvolutionMatrix", "Preview", TRUE)) target_button = target_button_new (sprite->imgtype, TRUE);
jwidget_select (check_preview);
if (get_config_bool ("ConvolutionMatrix", "Preview", TRUE))
if (get_tiled_mode ()) jwidget_select (check_preview);
jwidget_select (check_tiled);
if (get_tiled_mode ())
jview_attach (view_convmatr, list_convmatr); jwidget_select (check_tiled);
jwidget_set_static_size (view_convmatr, 64, 64);
jview_attach (view_convmatr, list_convmatr);
jwidget_add_child (box_target, target_button); jwidget_set_static_size (view_convmatr, 64, 64);
jwidget_add_child (window, preview);
jwidget_add_child (box_target, target_button);
HOOK (target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0); jwidget_add_child (window, preview);
HOOK (check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0);
HOOK (check_tiled, JI_SIGNAL_CHECK_CHANGE, tiled_change_hook, 0); HOOK (target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0);
HOOK (reload, JI_SIGNAL_BUTTON_SELECT, reload_select_hook, list_convmatr); HOOK (check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0);
HOOK (generate, JI_SIGNAL_BUTTON_SELECT, generate_select_hook, 0); HOOK (check_tiled, JI_SIGNAL_CHECK_CHANGE, tiled_change_hook, 0);
HOOK (reload, JI_SIGNAL_BUTTON_SELECT, reload_select_hook, list_convmatr);
/* XXXX enable this someday */ HOOK (generate, JI_SIGNAL_BUTTON_SELECT, generate_select_hook, 0);
jwidget_disable (generate);
/* XXXX enable this someday */
/* default position */ jwidget_disable (generate);
jwindow_remap (window);
jwindow_center (window); /* default position */
jwindow_remap (window);
/* load window configuration */ jwindow_center (window);
load_window_pos (window, "ConvolutionMatrix");
/* load window configuration */
/* select default convmatr */ load_window_pos (window, "ConvolutionMatrix");
listbox_select_current_convmatr (list_convmatr);
/* select default convmatr */
/* open the window */ listbox_select_current_convmatr (list_convmatr);
jwindow_open_fg (window);
/* open the window */
if (jwindow_get_killer (window) == button_ok) { jwindow_open_fg (window);
effect_apply_to_target (effect);
} if (jwindow_get_killer (window) == button_ok) {
effect_apply_to_target (effect);
effect_free (effect); }
/* update editors */ effect_free (effect);
GUI_Refresh (sprite);
/* update editors */
/* save window configuration */ GUI_Refresh (sprite);
save_window_pos (window, "ConvolutionMatrix");
/* save window configuration */
jwidget_free (window); save_window_pos (window, "ConvolutionMatrix");
}
jwidget_free (window);
static JWidget listbox_generate_convmatg (void) }
{
JWidget listbox = jlistbox_new (); static JWidget listbox_generate_convmatg (void)
listbox_fill_convmatg (listbox); {
HOOK (listbox, JI_SIGNAL_LISTBOX_CHANGE, list_change_hook, 0); JWidget listbox = jlistbox_new ();
return listbox; listbox_fill_convmatg (listbox);
} HOOK (listbox, JI_SIGNAL_LISTBOX_CHANGE, list_change_hook, 0);
return listbox;
static void listbox_fill_convmatg (JWidget listbox) }
{
ConvMatr *convmatr; static void listbox_fill_convmatg (JWidget listbox)
JWidget listitem; {
JLink link; ConvMatr *convmatr;
JWidget listitem;
JI_LIST_FOR_EACH(get_convmatr_stock(), link) { JLink link;
convmatr = link->data;
listitem = jlistitem_new(convmatr->name); JI_LIST_FOR_EACH(get_convmatr_stock(), link) {
listitem->user_data[0] = convmatr; convmatr = link->data;
jwidget_add_child(listbox, listitem); listitem = jlistitem_new(convmatr->name);
} listitem->user_data[0] = convmatr;
} jwidget_add_child(listbox, listitem);
}
static void listbox_select_current_convmatr (JWidget listbox) }
{
const char *selected = get_config_string ("ConvolutionMatrix", static void listbox_select_current_convmatr (JWidget listbox)
"Selected", ""); {
JWidget select_this = jlist_first_data(listbox->children); const char *selected = get_config_string ("ConvolutionMatrix",
JWidget child = NULL; "Selected", "");
JLink link; JWidget select_this = jlist_first_data(listbox->children);
JWidget child = NULL;
if (selected && *selected) { JLink link;
JI_LIST_FOR_EACH(listbox->children, link) {
child = link->data; if (selected && *selected) {
JI_LIST_FOR_EACH(listbox->children, link) {
if (strcmp(jwidget_get_text(child), selected) == 0) { child = link->data;
select_this = child;
break; if (strcmp(jwidget_get_text(child), selected) == 0) {
} select_this = child;
} break;
} }
}
if (select_this) { }
jwidget_select (select_this);
list_change_hook (listbox, 0); if (select_this) {
} jwidget_select (select_this);
} list_change_hook (listbox, 0);
}
static int reload_select_hook(JWidget widget, int user_data) }
{
JWidget listbox = (JWidget)user_data; static int reload_select_hook(JWidget widget, int user_data)
JWidget listitem; {
JLink link, next; JWidget listbox = (JWidget)user_data;
JWidget listitem;
/* clean the list */ JLink link, next;
JI_LIST_FOR_EACH_SAFE(listbox->children, link, next) {
listitem = link->data; /* clean the list */
jwidget_remove_child (listbox, listitem); JI_LIST_FOR_EACH_SAFE(listbox->children, link, next) {
jwidget_free (listitem); listitem = link->data;
} jwidget_remove_child (listbox, listitem);
jwidget_free (listitem);
/* re-load the convolution matrix stock */ }
reload_matrices_stock ();
/* re-load the convolution matrix stock */
/* re-fill the list */ reload_matrices_stock ();
listbox_fill_convmatg (listbox);
listbox_select_current_convmatr (listbox); /* re-fill the list */
jview_update (jwidget_get_view (listbox)); listbox_fill_convmatg (listbox);
listbox_select_current_convmatr (listbox);
return TRUE; /* do not close */ jview_update (jwidget_get_view (listbox));
}
return TRUE; /* do not close */
static int generate_select_hook (JWidget widget, int user_data) }
{
JWidget window; static int generate_select_hook (JWidget widget, int user_data)
JWidget view_x; {
JWidget view_y; JWidget window;
JWidget curvedit_x; JWidget view_x;
JWidget curvedit_y; JWidget view_y;
Curve *curve_x; JWidget curvedit_x;
Curve *curve_y; JWidget curvedit_y;
JWidget div, div_auto; Curve *curve_x;
JWidget bias, bias_auto; Curve *curve_y;
JWidget div, div_auto;
window = load_widget ("convmatr.jid", "generate_convolution_matrix"); JWidget bias, bias_auto;
if (!window)
return TRUE; /* don't close */ window = load_widget ("convmatr.jid", "generate_convolution_matrix");
if (!window)
if (!get_widgets (window, return TRUE; /* don't close */
"view_x", &view_x,
"view_y", &view_y, if (!get_widgets (window,
"div", &div, "view_x", &view_x,
"bias", &bias, "view_y", &view_y,
"div_auto", &div_auto, "div", &div,
"bias_auto", &bias_auto, NULL)) { "bias", &bias,
jwidget_free (window); "div_auto", &div_auto,
return TRUE; /* don't close */ "bias_auto", &bias_auto, NULL)) {
} jwidget_free (window);
return TRUE; /* don't close */
/* curve_x = curve_new (CURVE_SPLINE); */ }
/* curve_y = curve_new (CURVE_SPLINE); */
curve_x = curve_new (CURVE_LINEAR); /* curve_x = curve_new (CURVE_SPLINE); */
curve_y = curve_new (CURVE_LINEAR); /* curve_y = curve_new (CURVE_SPLINE); */
curve_add_point (curve_x, curve_point_new (-100, 0)); curve_x = curve_new (CURVE_LINEAR);
curve_add_point (curve_x, curve_point_new (0, +100)); curve_y = curve_new (CURVE_LINEAR);
curve_add_point (curve_x, curve_point_new (+100, 0)); curve_add_point (curve_x, curve_point_new (-100, 0));
curve_add_point (curve_y, curve_point_new (-100, 0)); curve_add_point (curve_x, curve_point_new (0, +100));
curve_add_point (curve_y, curve_point_new (0, +100)); curve_add_point (curve_x, curve_point_new (+100, 0));
curve_add_point (curve_y, curve_point_new (+100, 0)); curve_add_point (curve_y, curve_point_new (-100, 0));
curve_add_point (curve_y, curve_point_new (0, +100));
curvedit_x = curve_editor_new (curve_x, -200, -200, 200, 200); curve_add_point (curve_y, curve_point_new (+100, 0));
curvedit_y = curve_editor_new (curve_y, -200, -200, 200, 200);
curvedit_x = curve_editor_new (curve_x, -200, -200, 200, 200);
jview_attach (view_x, curvedit_x); curvedit_y = curve_editor_new (curve_y, -200, -200, 200, 200);
jview_attach (view_y, curvedit_y);
jview_attach (view_x, curvedit_x);
jwidget_set_static_size (view_x, 64, 64); jview_attach (view_y, curvedit_y);
jwidget_set_static_size (view_y, 64, 64);
jwidget_set_static_size (view_x, 64, 64);
/* XXX fix this */ jwidget_set_static_size (view_y, 64, 64);
/* jwidget_get_vtable (div)->request_size = NULL; */
/* jwidget_get_vtable (bias)->request_size = NULL; */ /* XXX fix this */
/* jwidget_get_vtable (div)->request_size = NULL; */
jwidget_set_static_size (div, 1, 1); /* jwidget_get_vtable (bias)->request_size = NULL; */
jwidget_set_static_size (bias, 1, 1);
jwidget_set_static_size (div, 1, 1);
jwindow_open_fg (window); jwidget_set_static_size (bias, 1, 1);
/* XXX do something */ jwindow_open_fg (window);
jwidget_free (window); /* XXX do something */
curve_free (curve_x); jwidget_free (window);
curve_free (curve_y);
curve_free (curve_x);
return TRUE; /* do not close */ curve_free (curve_y);
}
return TRUE; /* do not close */
static int list_change_hook (JWidget widget, int user_data) }
{
JWidget selected = jlistbox_get_selected_child (widget); static int list_change_hook (JWidget widget, int user_data)
ConvMatr *convmatr = selected->user_data[0]; {
JWidget selected = jlistbox_get_selected_child (widget);
set_config_string ("ConvolutionMatrix", "Selected", convmatr->name); ConvMatr *convmatr = selected->user_data[0];
set_convmatr (convmatr); set_config_string ("ConvolutionMatrix", "Selected", convmatr->name);
make_preview ();
return FALSE; set_convmatr (convmatr);
} make_preview ();
return FALSE;
static int target_change_hook (JWidget widget, int user_data) }
{
effect_load_target (preview_get_effect (preview)); static int target_change_hook (JWidget widget, int user_data)
make_preview (); {
return FALSE; effect_load_target (preview_get_effect (preview));
} make_preview ();
return FALSE;
static int preview_change_hook (JWidget widget, int user_data) }
{
set_config_bool ("ConvolutionMatrix", "Preview", static int preview_change_hook (JWidget widget, int user_data)
jwidget_is_selected (widget)); {
make_preview (); set_config_bool ("ConvolutionMatrix", "Preview",
return FALSE; jwidget_is_selected (widget));
} make_preview ();
return FALSE;
static int tiled_change_hook (JWidget widget, int user_data) }
{
set_tiled_mode (jwidget_is_selected (widget)); static int tiled_change_hook (JWidget widget, int user_data)
make_preview (); {
return FALSE; set_tiled_mode (jwidget_is_selected (widget));
} make_preview ();
return FALSE;
static void make_preview (void) }
{
if (jwidget_is_selected (check_preview)) static void make_preview (void)
preview_restart (preview); {
} if (jwidget_is_selected (check_preview))
preview_restart (preview);
}

View File

@ -1,197 +1,198 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory /* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005, 2007 David A. Capello * Copyright (C) 2007 David A. Capello
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h" #include "config.h"
#ifndef USE_PRECOMPILED_HEADER #ifndef USE_PRECOMPILED_HEADER
#include <stdio.h> #include <stdio.h>
#include "jinete/box.h" #include "jinete/box.h"
#include "jinete/button.h" #include "jinete/button.h"
#include "jinete/entry.h" #include "jinete/entry.h"
#include "jinete/hook.h" #include "jinete/hook.h"
#include "jinete/widget.h" #include "jinete/widget.h"
#include "jinete/window.h" #include "jinete/window.h"
#include "console/console.h" #include "console/console.h"
#include "core/cfg.h" #include "core/cfg.h"
#include "core/core.h" #include "core/core.h"
#include "effect/effect.h" #include "effect/effect.h"
#include "effect/median.h" #include "effect/median.h"
/* #include "modules/editors.h" */ #include "modules/gui.h"
#include "modules/gui.h" #include "modules/sprites.h"
#include "modules/sprites.h" #include "modules/tools.h"
#include "modules/tools.h" #include "raster/image.h"
#include "raster/image.h" #include "raster/mask.h"
#include "raster/mask.h" #include "raster/sprite.h"
#include "raster/sprite.h" #include "util/misc.h"
#include "util/misc.h" #include "widgets/preview.h"
#include "widgets/preview.h" #include "widgets/target.h"
#include "widgets/target.h"
#endif
#endif
static JWidget entry_width, entry_height;
static JWidget entry_width, entry_height; static JWidget check_preview, preview;
static JWidget check_preview, preview; static JWidget check_tiled;
static JWidget check_tiled;
static int width_change_hook (JWidget widget, int user_data);
static int width_change_hook (JWidget widget, int user_data); static int height_change_hook (JWidget widget, int user_data);
static int height_change_hook (JWidget widget, int user_data); static int target_change_hook (JWidget widget, int user_data);
static int target_change_hook (JWidget widget, int user_data); static int preview_change_hook (JWidget widget, int user_data);
static int preview_change_hook (JWidget widget, int user_data); static int tiled_change_hook (JWidget widget, int user_data);
static int tiled_change_hook (JWidget widget, int user_data); static void make_preview (void);
static void make_preview (void);
bool command_enabled_despeckle(const char *argument)
void dialogs_median_filter(void) {
{ return current_sprite != NULL;
JWidget window, box_target, target_button, button_ok; }
Image *image;
Effect *effect; void command_execute_despeckle(const char *argument)
char buf[32]; {
JWidget window, box_target, target_button, button_ok;
if (!is_interactive () || !current_sprite) Image *image;
return; Effect *effect;
char buf[32];
image = GetImage ();
if (!image) image = GetImage ();
return; if (!image)
return;
window = load_widget ("median.jid", "median");
if (!window) window = load_widget ("median.jid", "median");
return; if (!window)
return;
if (!get_widgets (window,
"width", &entry_width, if (!get_widgets (window,
"height", &entry_height, "width", &entry_width,
"preview", &check_preview, "height", &entry_height,
"tiled", &check_tiled, "preview", &check_preview,
"target", &box_target, "tiled", &check_tiled,
"button_ok", &button_ok, NULL)) { "target", &box_target,
jwidget_free (window); "button_ok", &button_ok, NULL)) {
return; jwidget_free (window);
} return;
}
effect = effect_new (current_sprite, "median");
if (!effect) { effect = effect_new (current_sprite, "median");
console_printf (_("Error creating the effect applicator for this sprite\n")); if (!effect) {
jwidget_free (window); console_printf (_("Error creating the effect applicator for this sprite\n"));
return; jwidget_free (window);
} return;
}
preview = preview_new (effect);
preview = preview_new (effect);
target_button = target_button_new (current_sprite->imgtype, TRUE);
target_button = target_button_new (current_sprite->imgtype, TRUE);
sprintf (buf, "%d", get_config_int ("Median", "Width", 3));
jwidget_set_text (entry_width, buf); sprintf (buf, "%d", get_config_int ("Median", "Width", 3));
sprintf (buf, "%d", get_config_int ("Median", "Height", 3)); jwidget_set_text (entry_width, buf);
jwidget_set_text (entry_height, buf); sprintf (buf, "%d", get_config_int ("Median", "Height", 3));
jwidget_set_text (entry_height, buf);
if (get_config_bool ("Median", "Preview", TRUE))
jwidget_select (check_preview); if (get_config_bool ("Median", "Preview", TRUE))
jwidget_select (check_preview);
if (get_tiled_mode ())
jwidget_select (check_tiled); if (get_tiled_mode ())
jwidget_select (check_tiled);
jwidget_add_child (box_target, target_button);
jwidget_add_child (window, preview); jwidget_add_child (box_target, target_button);
jwidget_add_child (window, preview);
HOOK (entry_width, JI_SIGNAL_ENTRY_CHANGE, width_change_hook, 0);
HOOK (entry_height, JI_SIGNAL_ENTRY_CHANGE, height_change_hook, 0); HOOK (entry_width, JI_SIGNAL_ENTRY_CHANGE, width_change_hook, 0);
HOOK (target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0); HOOK (entry_height, JI_SIGNAL_ENTRY_CHANGE, height_change_hook, 0);
HOOK (check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0); HOOK (target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0);
HOOK (check_tiled, JI_SIGNAL_CHECK_CHANGE, tiled_change_hook, 0); HOOK (check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0);
HOOK (check_tiled, JI_SIGNAL_CHECK_CHANGE, tiled_change_hook, 0);
/* default position */
jwindow_remap (window); /* default position */
jwindow_center (window); jwindow_remap (window);
jwindow_center (window);
/* first preview */
make_preview (); /* first preview */
make_preview ();
/* load window configuration */
load_window_pos (window, "Median"); /* load window configuration */
load_window_pos (window, "Median");
/* open the window */
jwindow_open_fg (window); /* open the window */
jwindow_open_fg (window);
if (jwindow_get_killer (window) == button_ok) {
effect_apply_to_target (effect); if (jwindow_get_killer (window) == button_ok) {
} effect_apply_to_target (effect);
}
effect_free (effect);
effect_free (effect);
/* update editors */
GUI_Refresh (current_sprite); /* update editors */
GUI_Refresh (current_sprite);
/* save window configuration */
save_window_pos (window, "Median"); /* save window configuration */
save_window_pos (window, "Median");
jwidget_free (window);
} jwidget_free (window);
}
static int width_change_hook (JWidget widget, int user_data)
{ static int width_change_hook (JWidget widget, int user_data)
set_config_int ("Median", "Width", {
strtol (jwidget_get_text (widget), NULL, 10)); set_config_int ("Median", "Width",
make_preview (); strtol (jwidget_get_text (widget), NULL, 10));
return TRUE; make_preview ();
} return TRUE;
}
static int height_change_hook (JWidget widget, int user_data)
{ static int height_change_hook (JWidget widget, int user_data)
set_config_int ("Median", "Height", {
strtol (jwidget_get_text (widget), NULL, 10)); set_config_int ("Median", "Height",
make_preview (); strtol (jwidget_get_text (widget), NULL, 10));
return TRUE; make_preview ();
} return TRUE;
}
static int target_change_hook (JWidget widget, int user_data)
{ static int target_change_hook (JWidget widget, int user_data)
effect_load_target (preview_get_effect (preview)); {
make_preview (); effect_load_target (preview_get_effect (preview));
return FALSE; make_preview ();
} return FALSE;
}
static int preview_change_hook (JWidget widget, int user_data)
{ static int preview_change_hook (JWidget widget, int user_data)
set_config_bool ("Median", "Preview", jwidget_is_selected (widget)); {
make_preview (); set_config_bool ("Median", "Preview", jwidget_is_selected (widget));
return FALSE; make_preview ();
} return FALSE;
}
static int tiled_change_hook (JWidget widget, int user_data)
{ static int tiled_change_hook (JWidget widget, int user_data)
set_tiled_mode (jwidget_is_selected (widget)); {
make_preview (); set_tiled_mode (jwidget_is_selected (widget));
return FALSE; make_preview ();
} return FALSE;
}
static void make_preview (void)
{ static void make_preview (void)
int w, h; {
int w, h;
w = get_config_int ("Median", "Width", 3);
h = get_config_int ("Median", "Height", 3); w = get_config_int ("Median", "Width", 3);
h = get_config_int ("Median", "Height", 3);
set_median_size (MID (1, w, 32), MID (1, h, 32));
set_median_size (MID (1, w, 32), MID (1, h, 32));
if (jwidget_is_selected (check_preview))
preview_restart (preview); if (jwidget_is_selected (check_preview))
} preview_restart (preview);
}

View File

@ -1,147 +1,148 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory /* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005, 2007 David A. Capello * Copyright (C) 2007 David A. Capello
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "config.h" #include "config.h"
#ifndef USE_PRECOMPILED_HEADER #ifndef USE_PRECOMPILED_HEADER
#include "jinete/box.h" #include "jinete/box.h"
#include "jinete/button.h" #include "jinete/button.h"
#include "jinete/hook.h" #include "jinete/hook.h"
#include "jinete/label.h" #include "jinete/label.h"
#include "jinete/slider.h" #include "jinete/slider.h"
#include "jinete/widget.h" #include "jinete/widget.h"
#include "jinete/window.h" #include "jinete/window.h"
#include "console/console.h" #include "console/console.h"
#include "core/cfg.h" #include "core/cfg.h"
#include "core/core.h" #include "core/core.h"
#include "effect/effect.h" #include "effect/effect.h"
#include "modules/color.h" #include "modules/color.h"
/* #include "modules/editors.h" */ #include "modules/gui.h"
#include "modules/gui.h" #include "modules/sprites.h"
#include "modules/sprites.h" #include "raster/image.h"
#include "raster/image.h" #include "raster/mask.h"
#include "raster/mask.h" #include "raster/sprite.h"
#include "raster/sprite.h" #include "util/misc.h"
#include "util/misc.h" #include "widgets/colbar.h"
#include "widgets/colbar.h" #include "widgets/colbut.h"
#include "widgets/colbut.h" #include "widgets/preview.h"
#include "widgets/preview.h" #include "widgets/target.h"
#include "widgets/target.h"
#endif
#endif
static JWidget check_preview, preview;
static JWidget check_preview, preview;
static int target_change_hook (JWidget widget, int user_data);
static int target_change_hook (JWidget widget, int user_data); static int preview_change_hook (JWidget widget, int user_data);
static int preview_change_hook (JWidget widget, int user_data); static void make_preview (void);
static void make_preview (void);
bool command_enabled_invert_color(const char *argument)
void dialogs_invert_color(void) {
{ return current_sprite != NULL;
JWidget window, box_target, target_button, button_ok; }
Sprite *sprite = current_sprite;
Image *image; void command_execute_invert_color(const char *argument)
Effect *effect; {
JWidget window, box_target, target_button, button_ok;
if (!is_interactive () || !sprite) Sprite *sprite = current_sprite;
return; Image *image;
Effect *effect;
image = GetImage ();
if (!image) image = GetImage();
return; if (!image)
return;
window = load_widget ("invrtcol.jid", "invert_color");
if (!window) window = load_widget("invrtcol.jid", "invert_color");
return; if (!window)
return;
if (!get_widgets (window,
"target", &box_target, if (!get_widgets(window,
"preview", &check_preview, "target", &box_target,
"button_ok", &button_ok, NULL)) { "preview", &check_preview,
jwidget_free (window); "button_ok", &button_ok, NULL)) {
return; jwidget_free(window);
} return;
}
effect = effect_new (sprite, "invert_color");
if (!effect) { effect = effect_new(sprite, "invert_color");
console_printf (_("Error creating the effect applicator for this sprite\n")); if (!effect) {
jwidget_free (window); console_printf(_("Error creating the effect applicator for this sprite\n"));
return; jwidget_free(window);
} return;
}
preview = preview_new (effect);
target_button = target_button_new (sprite->imgtype, TRUE); preview = preview_new(effect);
target_button = target_button_new(sprite->imgtype, TRUE);
if (get_config_bool ("InvertColor", "Preview", TRUE))
jwidget_select (check_preview); if (get_config_bool("InvertColor", "Preview", TRUE))
jwidget_select(check_preview);
jwidget_add_child (box_target, target_button);
jwidget_add_child (window, preview); jwidget_add_child(box_target, target_button);
jwidget_add_child(window, preview);
HOOK (target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0);
HOOK (check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0); HOOK(target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0);
HOOK(check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0);
/* default position */
jwindow_remap (window); /* default position */
jwindow_center (window); jwindow_remap(window);
jwindow_center(window);
/* first preview */
make_preview (); /* first preview */
make_preview();
/* load window configuration */
load_window_pos (window, "InvertColor"); /* load window configuration */
load_window_pos(window, "InvertColor");
/* open the window */
jwindow_open_fg (window); /* open the window */
jwindow_open_fg(window);
if (jwindow_get_killer (window) == button_ok) {
effect_apply_to_target (effect); if (jwindow_get_killer(window) == button_ok) {
} effect_apply_to_target(effect);
}
effect_free (effect);
effect_free(effect);
/* update editors */
GUI_Refresh (sprite); /* update editors */
GUI_Refresh(sprite);
/* save window configuration */
save_window_pos (window, "InvertColor"); /* save window configuration */
save_window_pos(window, "InvertColor");
jwidget_free (window);
} jwidget_free(window);
}
static int target_change_hook (JWidget widget, int user_data)
{ static int target_change_hook(JWidget widget, int user_data)
effect_load_target (preview_get_effect (preview)); {
make_preview (); effect_load_target(preview_get_effect(preview));
return FALSE; make_preview();
} return FALSE;
}
static int preview_change_hook (JWidget widget, int user_data)
{ static int preview_change_hook(JWidget widget, int user_data)
set_config_bool ("InvertColor", "Preview", jwidget_is_selected (widget)); {
make_preview (); set_config_bool("InvertColor", "Preview", jwidget_is_selected(widget));
return FALSE; make_preview();
} return FALSE;
}
static void make_preview (void)
{ static void make_preview(void)
if (jwidget_is_selected (check_preview)) {
preview_restart (preview); if (jwidget_is_selected(check_preview))
} preview_restart(preview);
}

View File

@ -0,0 +1,233 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include <stdio.h>
#include "jinete.h"
#include "console/console.h"
#include "core/app.h"
#include "core/cfg.h"
#include "core/core.h"
#include "effect/effect.h"
#include "effect/replcol.h"
#include "modules/color.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/image.h"
#include "raster/mask.h"
#include "raster/sprite.h"
#include "util/misc.h"
#include "widgets/colbar.h"
#include "widgets/colbut.h"
#include "widgets/preview.h"
#include "widgets/target.h"
#endif
static JWidget button_color1, button_color2;
static JWidget slider_fuzziness, check_preview;
static JWidget preview;
static int button_1_select_hook(JWidget widget, int user_data);
static int button_2_select_hook(JWidget widget, int user_data);
static int color_change_hook(JWidget widget, int user_data);
static int target_change_hook(JWidget widget, int user_data);
static int slider_change_hook(JWidget widget, int user_data);
static int preview_change_hook(JWidget widget, int user_data);
static void make_preview(void);
bool command_enabled_replace_color(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_replace_color(const char *argument)
{
JWidget window, color_buttons_box;
JWidget button1_1, button1_2;
JWidget button2_1, button2_2;
JWidget box_target, target_button;
JWidget button_ok;
Image *image;
Effect *effect;
image = GetImage();
if (!image)
return;
window = load_widget("replcol.jid", "replace_color");
if (!window)
return;
if (!get_widgets(window,
"color_buttons_box", &color_buttons_box,
"button1_1", &button1_1,
"button1_2", &button1_2,
"button2_1", &button2_1,
"button2_2", &button2_2,
"preview", &check_preview,
"fuzziness", &slider_fuzziness,
"target", &box_target,
"button_ok", &button_ok, NULL)) {
jwidget_free(window);
return;
}
effect = effect_new(current_sprite, "replace_color");
if (!effect) {
console_printf(_("Error creating the effect applicator for this sprite\n"));
jwidget_free(window);
return;
}
preview = preview_new(effect);
button_color1 = color_button_new
(get_config_string("ReplaceColor", "Color1",
color_bar_get_color(app_get_color_bar(), 0)),
current_sprite->imgtype);
button_color2 = color_button_new
(get_config_string("ReplaceColor", "Color2",
color_bar_get_color(app_get_color_bar(), 1)),
current_sprite->imgtype);
target_button = target_button_new(current_sprite->imgtype, FALSE);
jslider_set_value(slider_fuzziness,
get_config_int ("ReplaceColor", "Fuzziness", 0));
if (get_config_bool("ReplaceColor", "Preview", TRUE))
jwidget_select(check_preview);
jwidget_add_child(color_buttons_box, button_color1);
jwidget_add_child(color_buttons_box, button_color2);
jwidget_add_child(box_target, target_button);
jwidget_add_child(window, preview);
HOOK(button1_1, JI_SIGNAL_BUTTON_SELECT, button_1_select_hook, 1);
HOOK(button1_2, JI_SIGNAL_BUTTON_SELECT, button_2_select_hook, 1);
HOOK(button2_1, JI_SIGNAL_BUTTON_SELECT, button_1_select_hook, 2);
HOOK(button2_2, JI_SIGNAL_BUTTON_SELECT, button_2_select_hook, 2);
HOOK(button_color1, SIGNAL_COLOR_BUTTON_CHANGE, color_change_hook, 1);
HOOK(button_color2, SIGNAL_COLOR_BUTTON_CHANGE, color_change_hook, 2);
HOOK(target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0);
HOOK(slider_fuzziness, JI_SIGNAL_SLIDER_CHANGE, slider_change_hook, 0);
HOOK(check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0);
/* default position */
jwindow_remap(window);
jwindow_center(window);
/* first preview */
make_preview();
/* load window configuration */
load_window_pos(window, "ReplaceColor");
/* open the window */
jwindow_open_fg(window);
if (jwindow_get_killer(window) == button_ok) {
effect_apply_to_target(effect);
}
effect_free(effect);
/* update editors */
GUI_Refresh(current_sprite);
/* save window configuration */
save_window_pos(window, "ReplaceColor");
jwidget_free(window);
}
static int button_1_select_hook (JWidget widget, int user_data)
{
JWidget w = user_data == 1 ? button_color1: button_color2;
color_button_set_color(w, color_bar_get_color(app_get_color_bar(), 0));
color_change_hook(w, user_data);
return TRUE;
}
static int button_2_select_hook (JWidget widget, int user_data)
{
JWidget w = user_data == 1 ? button_color1: button_color2;
color_button_set_color(w, color_bar_get_color(app_get_color_bar(), 1));
color_change_hook(w, user_data);
return TRUE;
}
static int color_change_hook(JWidget widget, int user_data)
{
char buf[64];
sprintf(buf, "Color%d", user_data);
set_config_string("ReplaceColor", buf, color_button_get_color(widget));
make_preview();
return FALSE;
}
static int target_change_hook(JWidget widget, int user_data)
{
effect_load_target(preview_get_effect(preview));
make_preview();
return FALSE;
}
static int slider_change_hook(JWidget widget, int user_data)
{
set_config_int("ReplaceColor", "Fuzziness", jslider_get_value (widget));
make_preview();
return FALSE;
}
static int preview_change_hook(JWidget widget, int user_data)
{
set_config_bool("ReplaceColor", "Preview", jwidget_is_selected (widget));
make_preview();
return FALSE;
}
static void make_preview(void)
{
Effect *effect = preview_get_effect(preview);
const char *from, *to;
int fuzziness;
from = get_config_string("ReplaceColor", "Color1", "mask");
to = get_config_string("ReplaceColor", "Color2", "mask");
fuzziness = get_config_int("ReplaceColor", "Fuzziness", 0);
set_replace_colors(get_color_for_image(effect->dst->imgtype, from),
get_color_for_image(effect->dst->imgtype, to),
MID(0, fuzziness, 255));
if (jwidget_is_selected(check_preview))
preview_restart(preview);
}

View File

@ -1,28 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005, 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DIALOGS_EFFECT_H
#define DIALOGS_EFFECT_H
void dialogs_color_curve(void);
void dialogs_convolution_matrix(void);
void dialogs_invert_color(void);
void dialogs_median_filter(void);
void dialogs_replace_color(void);
#endif /* DIALOGS_EFFECT_H */

View File

@ -1,232 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005, 2007 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifndef USE_PRECOMPILED_HEADER
#include <stdio.h>
#include "jinete.h"
#include "console/console.h"
#include "core/app.h"
#include "core/cfg.h"
#include "core/core.h"
#include "effect/effect.h"
#include "effect/replcol.h"
#include "modules/color.h"
/* #include "modules/editors.h" */
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/image.h"
#include "raster/mask.h"
#include "raster/sprite.h"
#include "util/misc.h"
#include "widgets/colbar.h"
#include "widgets/colbut.h"
#include "widgets/preview.h"
#include "widgets/target.h"
#endif
static JWidget button_color1, button_color2;
static JWidget slider_fuzziness, check_preview;
static JWidget preview;
static int button_1_select_hook (JWidget widget, int user_data);
static int button_2_select_hook (JWidget widget, int user_data);
static int color_change_hook (JWidget widget, int user_data);
static int target_change_hook (JWidget widget, int user_data);
static int slider_change_hook (JWidget widget, int user_data);
static int preview_change_hook (JWidget widget, int user_data);
static void make_preview (void);
void dialogs_replace_color(void)
{
JWidget window, color_buttons_box;
JWidget button1_1, button1_2;
JWidget button2_1, button2_2;
JWidget box_target, target_button;
JWidget button_ok;
Image *image;
Effect *effect;
if (!is_interactive () || !current_sprite)
return;
image = GetImage ();
if (!image)
return;
window = load_widget ("replcol.jid", "replace_color");
if (!window)
return;
if (!get_widgets (window,
"color_buttons_box", &color_buttons_box,
"button1_1", &button1_1,
"button1_2", &button1_2,
"button2_1", &button2_1,
"button2_2", &button2_2,
"preview", &check_preview,
"fuzziness", &slider_fuzziness,
"target", &box_target,
"button_ok", &button_ok, NULL)) {
jwidget_free (window);
return;
}
effect = effect_new (current_sprite, "replace_color");
if (!effect) {
console_printf (_("Error creating the effect applicator for this sprite\n"));
jwidget_free (window);
return;
}
preview = preview_new (effect);
button_color1 = color_button_new
(get_config_string ("ReplaceColor", "Color1",
color_bar_get_color (app_get_color_bar (), 0)),
current_sprite->imgtype);
button_color2 = color_button_new
(get_config_string ("ReplaceColor", "Color2",
color_bar_get_color (app_get_color_bar (), 1)),
current_sprite->imgtype);
target_button = target_button_new (current_sprite->imgtype, FALSE);
jslider_set_value (slider_fuzziness,
get_config_int ("ReplaceColor", "Fuzziness", 0));
if (get_config_bool ("ReplaceColor", "Preview", TRUE))
jwidget_select (check_preview);
jwidget_add_child (color_buttons_box, button_color1);
jwidget_add_child (color_buttons_box, button_color2);
jwidget_add_child (box_target, target_button);
jwidget_add_child (window, preview);
HOOK (button1_1, JI_SIGNAL_BUTTON_SELECT, button_1_select_hook, 1);
HOOK (button1_2, JI_SIGNAL_BUTTON_SELECT, button_2_select_hook, 1);
HOOK (button2_1, JI_SIGNAL_BUTTON_SELECT, button_1_select_hook, 2);
HOOK (button2_2, JI_SIGNAL_BUTTON_SELECT, button_2_select_hook, 2);
HOOK (button_color1, SIGNAL_COLOR_BUTTON_CHANGE, color_change_hook, 1);
HOOK (button_color2, SIGNAL_COLOR_BUTTON_CHANGE, color_change_hook, 2);
HOOK (target_button, SIGNAL_TARGET_BUTTON_CHANGE, target_change_hook, 0);
HOOK (slider_fuzziness, JI_SIGNAL_SLIDER_CHANGE, slider_change_hook, 0);
HOOK (check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, 0);
/* default position */
jwindow_remap (window);
jwindow_center (window);
/* first preview */
make_preview ();
/* load window configuration */
load_window_pos (window, "ReplaceColor");
/* open the window */
jwindow_open_fg (window);
if (jwindow_get_killer (window) == button_ok) {
effect_apply_to_target (effect);
}
effect_free (effect);
/* update editors */
GUI_Refresh (current_sprite);
/* save window configuration */
save_window_pos (window, "ReplaceColor");
jwidget_free (window);
}
static int button_1_select_hook (JWidget widget, int user_data)
{
JWidget w = user_data == 1 ? button_color1: button_color2;
color_button_set_color (w, color_bar_get_color (app_get_color_bar (), 0));
color_change_hook (w, user_data);
return TRUE;
}
static int button_2_select_hook (JWidget widget, int user_data)
{
JWidget w = user_data == 1 ? button_color1: button_color2;
color_button_set_color (w, color_bar_get_color (app_get_color_bar (), 1));
color_change_hook (w, user_data);
return TRUE;
}
static int color_change_hook (JWidget widget, int user_data)
{
char buf[64];
sprintf (buf, "Color%d", user_data);
set_config_string ("ReplaceColor", buf, color_button_get_color (widget));
make_preview ();
return FALSE;
}
static int target_change_hook (JWidget widget, int user_data)
{
effect_load_target (preview_get_effect (preview));
make_preview ();
return FALSE;
}
static int slider_change_hook (JWidget widget, int user_data)
{
set_config_int ("ReplaceColor", "Fuzziness", jslider_get_value (widget));
make_preview ();
return FALSE;
}
static int preview_change_hook (JWidget widget, int user_data)
{
set_config_bool ("ReplaceColor", "Preview", jwidget_is_selected (widget));
make_preview ();
return FALSE;
}
static void make_preview (void)
{
Effect *effect = preview_get_effect (preview);
const char *from, *to;
int fuzziness;
from = get_config_string ("ReplaceColor", "Color1", "mask");
to = get_config_string ("ReplaceColor", "Color2", "mask");
fuzziness = get_config_int ("ReplaceColor", "Fuzziness", 0);
set_replace_colors (get_color_for_image (effect->dst->imgtype, from),
get_color_for_image (effect->dst->imgtype, to),
MID (0, fuzziness, 255));
if (jwidget_is_selected (check_preview))
preview_restart (preview);
}

View File

@ -95,9 +95,9 @@ int load_root_menu(void)
dirs = filename_in_datadir("usergui.xml"); dirs = filename_in_datadir("usergui.xml");
{ {
char buf[256]; char buf[256];
sprintf(buf, "defgui-%s.xml", intl_get_lang()); sprintf(buf, "gui-%s.xml", intl_get_lang());
dirs_cat_dirs(dirs, filename_in_datadir(buf)); dirs_cat_dirs(dirs, filename_in_datadir(buf));
dirs_cat_dirs(dirs, filename_in_datadir("defgui-en.xml")); dirs_cat_dirs(dirs, filename_in_datadir("gui-en.xml"));
} }
for (dir=dirs; dir; dir=dir->next) { for (dir=dirs; dir; dir=dir->next) {

View File

@ -287,7 +287,7 @@ static int metatable_index(lua_State *L)
else if (strcmp (index, "writable") == 0) else if (strcmp (index, "writable") == 0)
lua_pushboolean (L, layer->writable); lua_pushboolean (L, layer->writable);
else if (strcmp (index, "prev") == 0) else if (strcmp (index, "prev") == 0)
push_userdata (L, Type_Layer, layer_get_prev (layer)); push_userdata (L, Type_Layer, layer_get_prev (layer));
else if (strcmp (index, "next") == 0) else if (strcmp (index, "next") == 0)
push_userdata (L, Type_Layer, layer_get_next (layer)); push_userdata (L, Type_Layer, layer_get_next (layer));
else { else {
@ -719,7 +719,6 @@ static int bind_jwidget_hook_signal (lua_State *L)
#include "dialogs/canvasze.h" #include "dialogs/canvasze.h"
#include "dialogs/dmapgen.h" #include "dialogs/dmapgen.h"
#include "dialogs/drawtext.h" #include "dialogs/drawtext.h"
#include "dialogs/effect.h"
#include "dialogs/filmedit.h" #include "dialogs/filmedit.h"
#include "dialogs/maskcol.h" #include "dialogs/maskcol.h"
#include "dialogs/options.h" #include "dialogs/options.h"
@ -734,7 +733,6 @@ static int bind_jwidget_hook_signal (lua_State *L)
#include "util/autocrop.h" #include "util/autocrop.h"
#include "util/clipbrd.h" #include "util/clipbrd.h"
#include "util/crop.h" #include "util/crop.h"
#include "util/flip.h"
#include "util/frmove.h" #include "util/frmove.h"
#include "util/mapgen.h" #include "util/mapgen.h"
#include "util/msk_file.h" #include "util/msk_file.h"

View File

@ -225,11 +225,6 @@ void crop_sprite(void);
void crop_layer(void); void crop_layer(void);
void crop_frame(void); void crop_frame(void);
/* util/flip.c */
void flip_horizontal(void);
void flip_vertical(void);
/* util/frame.c */ /* util/frame.c */
void set_frame_to_handle(Layer *layer, Frame *frame); void set_frame_to_handle(Layer *layer, Frame *frame);
@ -285,17 +280,12 @@ int set_gfx(const char *card, int w, int h, int depth);
/* dialogs/... */ /* dialogs/... */
void dialogs_color_curve(void);
void dialogs_convolution_matrix(void);
void dialogs_draw_text(void); void dialogs_draw_text(void);
void switch_between_film_and_sprite_editor(void); void switch_between_film_and_sprite_editor(void);
void dialogs_invert_color(void);
void dialogs_mapgen(void); void dialogs_mapgen(void);
void dialogs_mask_color(void); void dialogs_mask_color(void);
void dialogs_median_filter(void);
void dialogs_options(void); void dialogs_options(void);
void dialogs_palette_editor(void); void dialogs_palette_editor(void);
void dialogs_replace_color(void);
void dialogs_screen_saver(void); void dialogs_screen_saver(void);
void dialogs_select_language(bool force); void dialogs_select_language(bool force);
void dialogs_tips(bool forced); void dialogs_tips(bool forced);

View File

@ -1133,18 +1133,6 @@ static int bind_crop_frame(lua_State *L)
return 0; return 0;
} }
static int bind_flip_horizontal(lua_State *L)
{
flip_horizontal();
return 0;
}
static int bind_flip_vertical(lua_State *L)
{
flip_vertical();
return 0;
}
static int bind_set_frame_to_handle(lua_State *L) static int bind_set_frame_to_handle(lua_State *L)
{ {
Layer *layer; Layer *layer;
@ -1317,18 +1305,6 @@ static int bind_set_gfx(lua_State *L)
return 1; return 1;
} }
static int bind_dialogs_color_curve(lua_State *L)
{
dialogs_color_curve();
return 0;
}
static int bind_dialogs_convolution_matrix(lua_State *L)
{
dialogs_convolution_matrix();
return 0;
}
static int bind_dialogs_draw_text(lua_State *L) static int bind_dialogs_draw_text(lua_State *L)
{ {
dialogs_draw_text(); dialogs_draw_text();
@ -1341,12 +1317,6 @@ static int bind_switch_between_film_and_sprite_editor(lua_State *L)
return 0; return 0;
} }
static int bind_dialogs_invert_color(lua_State *L)
{
dialogs_invert_color();
return 0;
}
static int bind_dialogs_mapgen(lua_State *L) static int bind_dialogs_mapgen(lua_State *L)
{ {
dialogs_mapgen(); dialogs_mapgen();
@ -1359,12 +1329,6 @@ static int bind_dialogs_mask_color(lua_State *L)
return 0; return 0;
} }
static int bind_dialogs_median_filter(lua_State *L)
{
dialogs_median_filter();
return 0;
}
static int bind_dialogs_options(lua_State *L) static int bind_dialogs_options(lua_State *L)
{ {
dialogs_options(); dialogs_options();
@ -1377,12 +1341,6 @@ static int bind_dialogs_palette_editor(lua_State *L)
return 0; return 0;
} }
static int bind_dialogs_replace_color(lua_State *L)
{
dialogs_replace_color();
return 0;
}
static int bind_dialogs_screen_saver(lua_State *L) static int bind_dialogs_screen_saver(lua_State *L)
{ {
dialogs_screen_saver(); dialogs_screen_saver();
@ -5725,8 +5683,6 @@ const luaL_reg bindings_routines[] = {
{ "crop_sprite", bind_crop_sprite }, { "crop_sprite", bind_crop_sprite },
{ "crop_layer", bind_crop_layer }, { "crop_layer", bind_crop_layer },
{ "crop_frame", bind_crop_frame }, { "crop_frame", bind_crop_frame },
{ "flip_horizontal", bind_flip_horizontal },
{ "flip_vertical", bind_flip_vertical },
{ "set_frame_to_handle", bind_set_frame_to_handle }, { "set_frame_to_handle", bind_set_frame_to_handle },
{ "move_frame", bind_move_frame }, { "move_frame", bind_move_frame },
{ "copy_frame", bind_copy_frame }, { "copy_frame", bind_copy_frame },
@ -5749,17 +5705,12 @@ const luaL_reg bindings_routines[] = {
{ "quick_swap", bind_quick_swap }, { "quick_swap", bind_quick_swap },
{ "play_fli_animation", bind_play_fli_animation }, { "play_fli_animation", bind_play_fli_animation },
{ "set_gfx", bind_set_gfx }, { "set_gfx", bind_set_gfx },
{ "dialogs_color_curve", bind_dialogs_color_curve },
{ "dialogs_convolution_matrix", bind_dialogs_convolution_matrix },
{ "dialogs_draw_text", bind_dialogs_draw_text }, { "dialogs_draw_text", bind_dialogs_draw_text },
{ "switch_between_film_and_sprite_editor", bind_switch_between_film_and_sprite_editor }, { "switch_between_film_and_sprite_editor", bind_switch_between_film_and_sprite_editor },
{ "dialogs_invert_color", bind_dialogs_invert_color },
{ "dialogs_mapgen", bind_dialogs_mapgen }, { "dialogs_mapgen", bind_dialogs_mapgen },
{ "dialogs_mask_color", bind_dialogs_mask_color }, { "dialogs_mask_color", bind_dialogs_mask_color },
{ "dialogs_median_filter", bind_dialogs_median_filter },
{ "dialogs_options", bind_dialogs_options }, { "dialogs_options", bind_dialogs_options },
{ "dialogs_palette_editor", bind_dialogs_palette_editor }, { "dialogs_palette_editor", bind_dialogs_palette_editor },
{ "dialogs_replace_color", bind_dialogs_replace_color },
{ "dialogs_screen_saver", bind_dialogs_screen_saver }, { "dialogs_screen_saver", bind_dialogs_screen_saver },
{ "dialogs_select_language", bind_dialogs_select_language }, { "dialogs_select_language", bind_dialogs_select_language },
{ "dialogs_tips", bind_dialogs_tips }, { "dialogs_tips", bind_dialogs_tips },

View File

@ -1,26 +0,0 @@
/* ase -- allegro-sprite-editor: the ultimate sprites factory
* Copyright (C) 2001-2005 David A. Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef UTIL_FLIP_H
#define UTIL_FLIP_H
void flip_horizontal (void);
void flip_vertical (void);
#endif /* UTIL_FLIP_H */