Added background color to sprite.

Renamed FileType to FileFormat.
Moved ase/jinete/src to ase/src/jinete.
Moved ase/jinete/include to ase/src/jinete.
Moved ase/jinete/freetype to ase/third_party/freetype.
This commit is contained in:
David Capello 2007-12-05 01:30:50 +00:00
parent 9e8a50d58d
commit c8db258b00
525 changed files with 2406 additions and 1821 deletions

View File

@ -1,3 +1,12 @@
2007-12-03 David A. Capello <dacap@users.sourceforge.net>
* src/raster/sprite.h (struct Sprite): Added "stock" (now the
stock of images is shared between all layers).
(struct Sprite): Added bgcolor field:
* src/raster/layer.h (struct Layer): Removed the "stock" from the
layers.
2007-11-28 David A. Capello <dacap@users.sourceforge.net>
* src/modules/gui.c (init_module_gui): Better graphics-resolution

View File

@ -9,7 +9,8 @@ NEWS
+ Better file selector.
+ Restructured all the menus (more user friendly options).
- Temporaly removed a lot of complex functionality:
Mask-Repository (but you can use .msk files yet), Draw-Text.
Mask-Repository (but you can use .msk files yet), Draw-Text,
Layer-Sets and Link-Cels.
+ New XML format for the menus.
- Removed menu scripting customization.
- Removed screen saver.

View File

@ -1,8 +1,7 @@
High priority work
------------------
- search for XXX (XXXX is supposed to be high priority);
+ replace XXX to TODO;
- search for TODO;
- add support for PNG files.
- ver por el nuevo load_font de Allegro.
- complete palette operations, and palette editor (it needs a slider

View File

@ -68,7 +68,7 @@
<key command="convolution_matrix" shortcut="F9" />
<key command="color_curve" shortcut="Ctrl+M" />
<key command="color_curve" shortcut="F10" />
<key command="run_script" shortcut="Ctrl+0" />
<!-- <key command="run_script" shortcut="Ctrl+0" /> -->
<key command="tips" shortcut="F1" />
<key command="options" shortcut="Shift+Ctrl+O" />
</keyboard>
@ -160,7 +160,7 @@
<item command="new_cel" name="&New" />
<item command="move_cel" name="&Move" />
<item command="copy_cel" name="&Copy" />
<item command="link_cel" name="&Link" />
<!-- <item command="link_cel" name="&Link" /> -->
<item command="remove_cel" name="&Remove" />
<separator />
<item command="crop_cel" name="Cr&op" />
@ -204,12 +204,12 @@
</menu>
<!-- <item command="draw_text" name="Draw &Text" /> -->
<!-- <item command="mapgen" name="&MapGen" /> -->
<menu name="Scripting">
<item command="run_script" name="Run &Script" />
</menu>
<menu name="Extras">
<item command="play_flic" name="Pla&y FLI/FLC File" />
</menu>
<!-- <menu name="Scripting"> -->
<!-- <item command="run_script" name="Run &Script" /> -->
<!-- </menu> -->
<!-- <menu name="Extras"> -->
<!-- <item command="play_flic" name="Pla&y FLI/FLC File" /> -->
<!-- </menu> -->
<separator />
<item command="tips" name="T&ips" />
<item command="options" name="&Options" />

View File

@ -11,12 +11,14 @@
<label text="Type:" />
<label text="Size:" />
<label text="Frames:" />
<label text="Background:" />
</box>
<box vertical homogeneous expansive>
<entry maxsize=256 name="name" />
<label text="" name="name" />
<label text="" name="type" />
<label text="" name="size" />
<entry maxsize=4 name="frames" />
<label text="" name="frames" />
<box vertical name="bgcolor_box" />
</box>
</box>
<button text="Constant Frame-Rate Speed" name="speed" />

View File

@ -63,13 +63,29 @@ WORD Frames
WORD Width in pixels
WORD Height in pixels
WORD Color depth (bits per pixel)
32 bpp = RGBA
16 bpp = Grayscale
8 bpp = Indexed
DWORD Flags (must be 0)
WORD Speed (milliseconds between frame, like in FLC files)
DEPRECATED!!!: you should use the frame duration
field from each frame header
DWORD Set be 0
DWORD Set be 0
BYTE[100] For future (set to zero)
BYTE[4] Background color:
For 32 bpp
BYTE Red
BYTE Green
BYTE Blue
BYTE Alpha
For 16 bpp:
BYTE Gray
BYTE Alpha
BYTE[2] Padding
For 8 bpp:
BYTE Index
BYTE[3] Padding
BYTE[96] For future (set to zero)
========================================
@ -177,6 +193,8 @@ Mask Chunk (0x2016) DEPRECATED!!!
Path Chunk (0x2017)
----------------------------------------
Never used.
Notes
----------------------------------------

View File

@ -1,71 +0,0 @@
/* Jinete - a GUI library
* Copyright (c) 2003, 2004, 2005, 2007, David A. Capello
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of the Jinete nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef JINETE_H
#define JINETE_H
#include "jinete/accel.h"
#include "jinete/alert.h"
#include "jinete/base.h"
#include "jinete/box.h"
#include "jinete/button.h"
#include "jinete/clipbrd.h"
#include "jinete/combobox.h"
#include "jinete/draw.h"
#include "jinete/entry.h"
#include "jinete/file.h"
#include "jinete/filesel.h"
#include "jinete/font.h"
#include "jinete/hook.h"
#include "jinete/image.h"
#include "jinete/label.h"
#include "jinete/list.h"
#include "jinete/listbox.h"
#include "jinete/manager.h"
#include "jinete/menu.h"
#include "jinete/message.h"
#include "jinete/panel.h"
#include "jinete/qckmenu.h"
#include "jinete/rect.h"
#include "jinete/region.h"
#include "jinete/scroll.h"
#include "jinete/sep.h"
#include "jinete/slider.h"
#include "jinete/stream.h"
#include "jinete/system.h"
#include "jinete/textbox.h"
#include "jinete/theme.h"
#include "jinete/view.h"
#include "jinete/widget.h"
#include "jinete/window.h"
#include "jinete/xml.h"
#endif /* JINETE_H */

View File

@ -6,8 +6,8 @@ _default: default
######################################################################
# Setup CFLAGS and LFLAGS for GCC
CFLAGS += -Wall -I. -Isrc -Ijinete/include -Ithird_party \
-I$(JINETE_DIR)/freetype/include \
CFLAGS += -Wall -I. -Isrc -Ithird_party \
-I$(LIBFREETYPE_DIR)/include \
-I$(LIBLUA_DIR)/include \
-I$(LIBJPEG_DIR) \
-I$(LIBGFLI_DIR) \
@ -18,7 +18,7 @@ CFLAGS += -Wall -I. -Isrc -Ijinete/include -Ithird_party \
# -I$(LIBGD_DIR)
LFLAGS += $(JINETE_LIB) $(THIRD_PARTY_LIBS)
LFLAGS += $(THIRD_PARTY_LIBS)
ifdef PROFILE
CFLAGS += -pg
@ -41,13 +41,6 @@ ifdef USE_PRECOMPILED_HEADER
CFLAGS += -DUSE_PRECOMPILED_HEADER
endif
######################################################################
# Rules to make Jinete
JINETE_DIR = jinete
include $(JINETE_DIR)/makefile.lst
include $(JINETE_DIR)/makefile.gcc
######################################################################
# Rules to make third party libraries
@ -55,6 +48,10 @@ $(LIBART_LIB): $(LIBART_OBJS)
-rm -f $@
ar rs $@ $^
$(LIBFREETYPE_LIB): $(LIBFREETYPE_OBJS)
-rm -f $@
ar rs $@ $^
$(LIBGD_LIB): $(LIBGD_OBJS)
-rm -f $@
ar rs $@ $^
@ -92,6 +89,8 @@ VPATH = src \
src/file \
src/file/gif \
src/intl \
src/jinete \
src/jinete/themes \
src/modules \
src/raster \
src/script \
@ -99,38 +98,35 @@ VPATH = src \
src/widgets \
src/widgets/editor \
$(LIBART_DIR) \
$(LIBFREETYPE_DIR)/src/base \
$(LIBFREETYPE_DIR)/src/autohint \
$(LIBFREETYPE_DIR)/src/cache \
$(LIBFREETYPE_DIR)/src/cff \
$(LIBFREETYPE_DIR)/src/cid \
$(LIBFREETYPE_DIR)/src/pcf \
$(LIBFREETYPE_DIR)/src/psaux \
$(LIBFREETYPE_DIR)/src/pshinter \
$(LIBFREETYPE_DIR)/src/psnames \
$(LIBFREETYPE_DIR)/src/raster \
$(LIBFREETYPE_DIR)/src/sfnt \
$(LIBFREETYPE_DIR)/src/smooth \
$(LIBFREETYPE_DIR)/src/truetype \
$(LIBFREETYPE_DIR)/src/type1 \
$(LIBFREETYPE_DIR)/src/winfonts \
$(LIBGD_DIR) \
$(LIBGFLI_DIR) \
$(LIBJPEG_DIR) \
$(LIBLUA_DIR)/src \
$(LIBLUA_DIR)/src/lib \
$(LIBPNG_DIR) \
$(ZLIB_DIR) \
$(JINETE_DIR)/src \
$(JINETE_DIR)/src/themes \
$(JINETE_DIR)/freetype/src/base \
$(JINETE_DIR)/freetype/src/autohint \
$(JINETE_DIR)/freetype/src/cache \
$(JINETE_DIR)/freetype/src/cff \
$(JINETE_DIR)/freetype/src/cid \
$(JINETE_DIR)/freetype/src/pcf \
$(JINETE_DIR)/freetype/src/psaux \
$(JINETE_DIR)/freetype/src/pshinter \
$(JINETE_DIR)/freetype/src/psnames \
$(JINETE_DIR)/freetype/src/raster \
$(JINETE_DIR)/freetype/src/sfnt \
$(JINETE_DIR)/freetype/src/smooth \
$(JINETE_DIR)/freetype/src/truetype \
$(JINETE_DIR)/freetype/src/type1 \
$(JINETE_DIR)/freetype/src/winfonts \
$(JINETE_DIR)/examples
$(ZLIB_DIR)
ifdef USE_PRECOMPILED_HEADER
ASE_DEPS = config.h.gch
else
ASE_DEPS =
endif
ASE_DEPS += $(ASE_OBJS) $(JINETE_LIB) $(THIRD_PARTY_LIBS)
ASE_DEPS += $(ASE_OBJS) $(THIRD_PARTY_LIBS)
ifdef USE_PRECOMPILED_HEADER
config.h.gch: config.h
@ -145,6 +141,9 @@ $(OBJ_DIR)/%$(OBJ): %.c
$(OBJ_DIR)/art.%$(OBJ): %.c
$(CC) $(CFLAGS) -o $@ -c $<
$(OBJ_DIR)/freetype.%$(OBJ): %.c
$(CC) $(CFLAGS) -o $@ -c $<
$(OBJ_DIR)/gd.%$(OBJ): %.c
$(CC) $(CFLAGS) -DNONDLL -DHAVE_CONFIG_H -o $@ -c $<

View File

@ -100,20 +100,58 @@ ASE_SOURCES = \
src/effect/invrtcol.c \
src/effect/median.c \
src/effect/replcol.c \
src/file/ase.c \
src/file/bmp.c \
src/file/ase_format.c \
src/file/bmp_format.c \
src/file/file.c \
src/file/fli.c \
src/file/gif.c \
src/file/fli_format.c \
src/file/gif/format.c \
src/file/gif/lzw.c \
src/file/ico.c \
src/file/jpeg.c \
src/file/pcx.c \
src/file/png_file.c \
src/file/tga.c \
src/file/gif_format.c \
src/file/ico_format.c \
src/file/jpeg_format.c \
src/file/pcx_format.c \
src/file/png_format.c \
src/file/tga_format.c \
src/intl/intl.c \
src/intl/msgids.c \
src/jinete/jaccel.c \
src/jinete/jalert.c \
src/jinete/jbox.c \
src/jinete/jbutton.c \
src/jinete/jclipbrd.c \
src/jinete/jcombox.c \
src/jinete/jdraw.c \
src/jinete/jentry.c \
src/jinete/jfile.c \
src/jinete/jfilesel.c \
src/jinete/jfont.c \
src/jinete/jfontbmp.c \
src/jinete/jhook.c \
src/jinete/jimage.c \
src/jinete/jintern.c \
src/jinete/jlabel.c \
src/jinete/jlist.c \
src/jinete/jlistbox.c \
src/jinete/jmanager.c \
src/jinete/jmem.c \
src/jinete/jmenu.c \
src/jinete/jmessage.c \
src/jinete/jpanel.c \
src/jinete/jqckmenu.c \
src/jinete/jrect.c \
src/jinete/jregion.c \
src/jinete/jsep.c \
src/jinete/jslider.c \
src/jinete/jstream.c \
src/jinete/jsystem.c \
src/jinete/jtextbox.c \
src/jinete/jtheme.c \
src/jinete/jview.c \
src/jinete/jwidget.c \
src/jinete/jwindow.c \
src/jinete/jxml.c \
src/jinete/themes/jsimple.c \
src/jinete/themes/jstand.c \
src/main.c \
src/modules/color.c \
src/modules/editors.c \
@ -229,6 +267,38 @@ LIBART_OBJS = $(addprefix $(OBJ_DIR)/art., \
$(addsuffix $(OBJ), \
$(notdir $(basename $(LIBART_SOURCES)))))
######################################################################
# Freetype
LIBFREETYPE_LIB = $(OBJ_DIR)/libfreetype$(LIB)
LIBFREETYPE_DIR = third_party/freetype
LIBFREETYPE_SOURCES = \
$(LIBFREETYPE_DIR)/src/base/ftsystem.c \
$(LIBFREETYPE_DIR)/src/base/ftdebug.c \
$(LIBFREETYPE_DIR)/src/base/ftinit.c \
$(LIBFREETYPE_DIR)/src/base/ftbase.c \
$(LIBFREETYPE_DIR)/src/base/ftglyph.c \
$(LIBFREETYPE_DIR)/src/base/ftmm.c \
$(LIBFREETYPE_DIR)/src/base/ftbbox.c \
$(LIBFREETYPE_DIR)/src/autohint/autohint.c \
$(LIBFREETYPE_DIR)/src/cache/ftcache.c \
$(LIBFREETYPE_DIR)/src/cff/cff.c \
$(LIBFREETYPE_DIR)/src/cid/type1cid.c \
$(LIBFREETYPE_DIR)/src/pcf/pcf.c \
$(LIBFREETYPE_DIR)/src/psaux/psaux.c \
$(LIBFREETYPE_DIR)/src/pshinter/pshinter.c \
$(LIBFREETYPE_DIR)/src/psnames/psmodule.c \
$(LIBFREETYPE_DIR)/src/raster/raster.c \
$(LIBFREETYPE_DIR)/src/sfnt/sfnt.c \
$(LIBFREETYPE_DIR)/src/smooth/smooth.c \
$(LIBFREETYPE_DIR)/src/truetype/truetype.c \
$(LIBFREETYPE_DIR)/src/type1/type1.c \
$(LIBFREETYPE_DIR)/src/winfonts/winfnt.c
LIBFREETYPE_OBJS = $(addprefix $(OBJ_DIR)/freetype., \
$(addsuffix $(OBJ), \
$(notdir $(basename $(LIBFREETYPE_SOURCES)))))
######################################################################
# GD Library
@ -425,6 +495,7 @@ ZLIB_OBJS = $(addprefix $(OBJ_DIR)/zlib., \
ALL_OBJS = \
$(ASE_OBJS) \
$(LIBLUA_OBJS) \
$(LIBFREETYPE_OBJS) \
$(LIBGFLI_OBJS) \
$(LIBART_OBJS) \
$(LIBPNG_OBJS) \
@ -432,6 +503,7 @@ ALL_OBJS = \
THIRD_PARTY_LIBS = \
$(LIBART_LIB) \
$(LIBFREETYPE_LIB) \
$(LIBGFLI_LIB) \
$(LIBJPEG_LIB) \
$(LIBLUA_LIB) \

View File

@ -19,6 +19,7 @@ CFLAGS="-I. \
-Ithird_party/intl \
-Ithird_party/libpng \
-Ithird_party/zlib \
-Ithird_party/jpeg \
-Ijinete/freetype/include \
-Ithird_party"

View File

@ -22,8 +22,9 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/core.h"
#include "core/dirs.h"
@ -31,7 +32,7 @@
static char *read_authors_txt(const char *filename);
void command_execute_about(const char *argument)
static void cmd_about_execute(const char *argument)
{
JWidget window, box1, label1, label2, separator1;
JWidget textbox, view, separator2;
@ -130,3 +131,10 @@ static char *read_authors_txt(const char *filename)
return txt;
}
Command cmd_about = {
CMD_ABOUT,
NULL,
NULL,
cmd_about_execute,
NULL
};

View File

@ -20,7 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
@ -30,7 +30,7 @@
static bool advanced_mode = FALSE;
void command_execute_advanced_mode(const char *argument)
static void cmd_advanced_mode_execute(const char *argument)
{
advanced_mode = !advanced_mode;
@ -73,3 +73,11 @@ void command_execute_advanced_mode(const char *argument)
}
}
}
Command cmd_advanced_mode = {
CMD_ADVANCED_MODE,
NULL,
NULL,
cmd_advanced_mode_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
@ -32,12 +33,12 @@
#endif
bool command_enabled_cel_properties(const char *argument)
static bool cmd_cel_properties_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_cel_properties(const char *argument)
static void cmd_cel_properties_execute(const char *argument)
{
JWidget window, entry_frame, entry_xpos, entry_ypos, slider_opacity, button_ok;
Sprite *sprite;
@ -137,3 +138,11 @@ void command_execute_cel_properties(const char *argument)
jwidget_free(window);
}
Command cmd_cel_properties = {
CMD_CEL_PROPERTIES,
cmd_cel_properties_enabled,
NULL,
cmd_cel_properties_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "core/cfg.h"
#include "modules/gui.h"
@ -33,12 +34,12 @@
#endif
bool command_enabled_change_image_type(const char *argument)
static bool cmd_change_image_type_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_change_image_type(const char *argument)
static void cmd_change_image_type_execute(const char *argument)
{
JWidget window, from, radio1, radio2, radio3, dither1, dither2;
@ -102,3 +103,11 @@ void command_execute_change_image_type(const char *argument)
jwidget_free(window);
}
Command cmd_change_image_type = {
CMD_CHANGE_IMAGE_TYPE,
cmd_change_image_type_enabled,
NULL,
cmd_change_image_type_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
@ -27,12 +28,12 @@
#endif
bool command_enabled_clear(const char *argument)
static bool cmd_clear_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_clear(const char *argument)
static void cmd_clear_execute(const char *argument)
{
/* get current sprite */
Sprite *sprite = current_sprite;
@ -43,3 +44,11 @@ void command_execute_clear(const char *argument)
/* refresh the sprite */
update_screen_for_sprite(sprite);
}
Command cmd_clear = {
CMD_CLEAR,
cmd_clear_enabled,
NULL,
cmd_clear_execute,
NULL
};

View File

@ -21,7 +21,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
@ -36,12 +36,12 @@ static bool close_current_sprite(void);
/* close_file */
/* ======================== */
bool command_enabled_close_file(const char *argument)
static bool cmd_close_file_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_close_file(const char *argument)
static void cmd_close_file_execute(const char *argument)
{
close_current_sprite();
}
@ -50,12 +50,12 @@ void command_execute_close_file(const char *argument)
/* close_all_files */
/* ======================== */
bool command_enabled_close_all_files(const char *argument)
static bool cmd_close_all_files_enabled(const char *argument)
{
return !jlist_empty(get_sprite_list());
}
void command_execute_close_all_files(const char *argument)
static void cmd_close_all_files_execute(const char *argument)
{
if (!current_sprite)
sprite_show(get_first_sprite());
@ -100,3 +100,19 @@ static bool close_current_sprite(void)
sprite_free(sprite);
return TRUE;
}
Command cmd_close_file = {
CMD_CLOSE_FILE,
cmd_close_file_enabled,
NULL,
cmd_close_file_execute,
NULL
};
Command cmd_close_all_files = {
CMD_CLOSE_ALL_FILES,
cmd_close_all_files_enabled,
NULL,
cmd_close_all_files_execute,
NULL
};

View File

@ -22,8 +22,9 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/app.h"
/* #include "core/cfg.h" */
@ -54,7 +55,7 @@ static int old_card, old_w, old_h, old_depth, old_scaling;
static void show_dialog(void);
static void try_new_gfx_mode(void);
void command_execute_configure_screen(const char *argument)
static void cmd_configure_screen_execute(const char *argument)
{
/* get the active status */
old_card = gfx_driver->id;
@ -193,3 +194,11 @@ static void try_new_gfx_mode(void)
jmanager_refresh_screen();
}
}
Command cmd_configure_screen = {
CMD_CONFIGURE_SCREEN,
NULL,
NULL,
cmd_configure_screen_execute,
NULL
};

View File

@ -22,8 +22,9 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/editors.h"
#include "modules/gfx.h"
@ -62,7 +63,7 @@ static int set_grid_button_select_hook(JWidget widget, int user_data);
static int cursor_button_change_hook(JWidget widget, int user_data);
static int onionskin_check_change_hook(JWidget widget, int user_data);
void command_execute_configure_tools(const char *argument)
static void cmd_configure_tools_execute(const char *argument)
{
JWidget filled, tiled, use_grid, view_grid, set_grid;
JWidget brush_size, brush_angle, glass_dirty;
@ -328,3 +329,11 @@ static int onionskin_check_change_hook(JWidget widget, int user_data)
return FALSE;
}
Command cmd_configure_tools = {
CMD_CONFIGURE_TOOLS,
NULL,
NULL,
cmd_configure_tools_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "modules/sprites.h"
#include "raster/layer.h"
#include "raster/mask.h"
@ -31,7 +32,7 @@
#endif
bool command_enabled_copy(const char *argument)
static bool cmd_copy_enabled(const char *argument)
{
if ((!current_sprite) ||
(!current_sprite->layer) ||
@ -44,7 +45,15 @@ bool command_enabled_copy(const char *argument)
return GetImage() ? TRUE: FALSE;
}
void command_execute_copy(const char *argument)
static void cmd_copy_execute(const char *argument)
{
copy_to_clipboard();
}
Command cmd_copy = {
CMD_COPY,
cmd_copy_enabled,
NULL,
cmd_copy_execute,
NULL
};

View File

@ -20,19 +20,28 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "dialogs/filmedit.h"
#include "util/celmove.h"
#endif
bool command_enabled_copy_cel(const char *argument)
static bool cmd_copy_cel_enabled(const char *argument)
{
return is_movingcel();
}
void command_execute_copy_cel(const char *argument)
static void cmd_copy_cel_execute(const char *argument)
{
copy_cel();
}
Command cmd_copy_cel = {
CMD_COPY_CEL,
cmd_copy_cel_enabled,
NULL,
cmd_copy_cel_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/sprites.h"
#include "raster/image.h"
#include "raster/mask.h"
@ -31,32 +32,32 @@
#endif
static bool command_enabled_crop(const char *argument);
static bool cmd_crop_enabled(const char *argument);
/* ======================== */
/* crop_sprite */
/* ======================== */
bool command_enabled_crop_sprite(const char *argument)
static bool cmd_crop_sprite_enabled(const char *argument)
{
return command_enabled_crop(argument);
return cmd_crop_enabled(argument);
}
void command_execute_crop_sprite(const char *argument)
static void cmd_crop_sprite_execute(const char *argument)
{
crop_sprite();
}
/* ======================== */
/* auto_crop_sprite */
/* autocrop_sprite */
/* ======================== */
bool command_enabled_autocrop_sprite(const char *argument)
static bool cmd_autocrop_sprite_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_autocrop_sprite(const char *argument)
static void cmd_autocrop_sprite_execute(const char *argument)
{
autocrop_sprite();
}
@ -65,12 +66,12 @@ void command_execute_autocrop_sprite(const char *argument)
/* crop_layer */
/* ======================== */
bool command_enabled_crop_layer(const char *argument)
static bool cmd_crop_layer_enabled(const char *argument)
{
return command_enabled_crop(argument);
return cmd_crop_enabled(argument);
}
void command_execute_crop_layer(const char *argument)
static void cmd_crop_layer_execute(const char *argument)
{
crop_layer();
}
@ -79,12 +80,12 @@ void command_execute_crop_layer(const char *argument)
/* crop_cel */
/* ======================== */
bool command_enabled_crop_cel(const char *argument)
static bool cmd_crop_cel_enabled(const char *argument)
{
return command_enabled_crop(argument);
return cmd_crop_enabled(argument);
}
void command_execute_crop_cel(const char *argument)
static void cmd_crop_cel_execute(const char *argument)
{
crop_cel();
}
@ -92,7 +93,7 @@ void command_execute_crop_cel(const char *argument)
/**********************************************************************/
/* local */
static bool command_enabled_crop(const char *argument)
static bool cmd_crop_enabled(const char *argument)
{
if ((!current_sprite) ||
(!current_sprite->layer) ||
@ -104,3 +105,35 @@ static bool command_enabled_crop(const char *argument)
else
return GetImage() ? TRUE: FALSE;
}
Command cmd_crop_sprite = {
CMD_CROP_SPRITE,
cmd_crop_sprite_enabled,
NULL,
cmd_crop_sprite_execute,
NULL
};
Command cmd_autocrop_sprite = {
CMD_AUTOCROP_SPRITE,
cmd_autocrop_sprite_enabled,
NULL,
cmd_autocrop_sprite_execute,
NULL
};
Command cmd_crop_layer = {
CMD_CROP_LAYER,
cmd_crop_layer_enabled,
NULL,
cmd_crop_layer_execute,
NULL
};
Command cmd_crop_cel = {
CMD_CROP_CEL,
cmd_crop_cel_enabled,
NULL,
cmd_crop_cel_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "modules/sprites.h"
#include "raster/layer.h"
#include "raster/mask.h"
@ -31,7 +32,7 @@
#endif
bool command_enabled_cut(const char *argument)
static bool cmd_cut_enabled(const char *argument)
{
if ((!current_sprite) ||
(!current_sprite->layer) ||
@ -44,7 +45,15 @@ bool command_enabled_cut(const char *argument)
return GetImage() ? TRUE: FALSE;
}
void command_execute_cut(const char *argument)
static void cmd_cut_execute(const char *argument)
{
cut_to_clipboard();
}
Command cmd_cut = {
CMD_CUT,
cmd_cut_enabled,
NULL,
cmd_cut_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/mask.h"
@ -28,14 +29,14 @@
#endif
bool command_enabled_deselect_mask(const char *argument)
static bool cmd_deselect_mask_enabled(const char *argument)
{
return
current_sprite != NULL &&
!mask_is_empty(current_sprite->mask);
}
void command_execute_deselect_mask(const char *argument)
static void cmd_deselect_mask_execute(const char *argument)
{
Sprite *sprite = current_sprite;
Mask *mask;
@ -62,3 +63,11 @@ void command_execute_deselect_mask(const char *argument)
sprite_generate_mask_boundaries(sprite);
update_screen_for_sprite(sprite);
}
Command cmd_deselect_mask = {
CMD_DESELECT_MASK,
cmd_deselect_mask_enabled,
NULL,
cmd_deselect_mask_execute,
NULL
};

View File

@ -20,14 +20,23 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_draw_text(const char *argument)
{
}
/* static void cmd_draw_text_execute(const char *argument) */
/* { */
/* } */
/* Command cmd_draw_text = { */
/* CMD_DRAW_TEXT, */
/* cmd_draw_text_enabled, */
/* NULL, */
/* cmd_draw_text_execute, */
/* NULL */
/* }; */

View File

@ -22,8 +22,9 @@
#include <allegro/unicode.h>
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "modules/tools.h"
#endif
@ -32,12 +33,12 @@
/* brush_tool */
/* ======================== */
bool command_checked_brush_tool(const char *argument)
static bool cmd_brush_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_brush;
}
void command_execute_brush_tool(const char *argument)
static void cmd_brush_tool_execute(const char *argument)
{
select_tool(&ase_tool_brush);
}
@ -46,12 +47,12 @@ void command_execute_brush_tool(const char *argument)
/* dots_tool */
/* ======================== */
bool command_checked_dots_tool(const char *argument)
static bool cmd_dots_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_dots;
}
void command_execute_dots_tool(const char *argument)
static void cmd_dots_tool_execute(const char *argument)
{
select_tool(&ase_tool_dots);
}
@ -60,12 +61,12 @@ void command_execute_dots_tool(const char *argument)
/* ellipse_tool */
/* ======================== */
bool command_checked_ellipse_tool(const char *argument)
static bool cmd_ellipse_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_ellipse;
}
void command_execute_ellipse_tool(const char *argument)
static void cmd_ellipse_tool_execute(const char *argument)
{
select_tool(&ase_tool_ellipse);
}
@ -74,12 +75,12 @@ void command_execute_ellipse_tool(const char *argument)
/* floodfill_tool */
/* ======================== */
bool command_checked_floodfill_tool(const char *argument)
static bool cmd_floodfill_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_floodfill;
}
void command_execute_floodfill_tool(const char *argument)
static void cmd_floodfill_tool_execute(const char *argument)
{
select_tool(&ase_tool_floodfill);
}
@ -88,12 +89,12 @@ void command_execute_floodfill_tool(const char *argument)
/* line_tool */
/* ======================== */
bool command_checked_line_tool(const char *argument)
static bool cmd_line_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_line;
}
void command_execute_line_tool(const char *argument)
static void cmd_line_tool_execute(const char *argument)
{
select_tool(&ase_tool_line);
}
@ -102,12 +103,12 @@ void command_execute_line_tool(const char *argument)
/* marker_tool */
/* ======================== */
bool command_checked_marker_tool(const char *argument)
static bool cmd_marker_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_marker;
}
void command_execute_marker_tool(const char *argument)
static void cmd_marker_tool_execute(const char *argument)
{
select_tool(&ase_tool_marker);
}
@ -116,12 +117,12 @@ void command_execute_marker_tool(const char *argument)
/* pencil_tool */
/* ======================== */
bool command_checked_pencil_tool(const char *argument)
static bool cmd_pencil_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_pencil;
}
void command_execute_pencil_tool(const char *argument)
static void cmd_pencil_tool_execute(const char *argument)
{
select_tool(&ase_tool_pencil);
}
@ -130,12 +131,12 @@ void command_execute_pencil_tool(const char *argument)
/* rectangle_tool */
/* ======================== */
bool command_checked_rectangle_tool(const char *argument)
static bool cmd_rectangle_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_rectangle;
}
void command_execute_rectangle_tool(const char *argument)
static void cmd_rectangle_tool_execute(const char *argument)
{
select_tool(&ase_tool_rectangle);
}
@ -144,12 +145,87 @@ void command_execute_rectangle_tool(const char *argument)
/* spray_tool */
/* ======================== */
bool command_checked_spray_tool(const char *argument)
static bool cmd_spray_tool_checked(const char *argument)
{
return current_tool && current_tool == &ase_tool_spray;
}
void command_execute_spray_tool(const char *argument)
static void cmd_spray_tool_execute(const char *argument)
{
select_tool(&ase_tool_spray);
}
/* ================================================ */
/* Commands */
Command cmd_brush_tool = {
CMD_BRUSH_TOOL,
NULL,
cmd_brush_tool_checked,
cmd_brush_tool_execute,
NULL
};
Command cmd_dots_tool = {
CMD_DOTS_TOOL,
NULL,
cmd_dots_tool_checked,
cmd_dots_tool_execute,
NULL
};
Command cmd_ellipse_tool = {
CMD_ELLIPSE_TOOL,
NULL,
cmd_ellipse_tool_checked,
cmd_ellipse_tool_execute,
NULL
};
Command cmd_floodfill_tool = {
CMD_FLOODFILL_TOOL,
NULL,
cmd_floodfill_tool_checked,
cmd_floodfill_tool_execute,
NULL
};
Command cmd_line_tool = {
CMD_LINE_TOOL,
NULL,
cmd_line_tool_checked,
cmd_line_tool_execute,
NULL
};
Command cmd_marker_tool = {
CMD_MARKER_TOOL,
NULL,
cmd_marker_tool_checked,
cmd_marker_tool_execute,
NULL
};
Command cmd_pencil_tool = {
CMD_PENCIL_TOOL,
NULL,
cmd_pencil_tool_checked,
cmd_pencil_tool_execute,
NULL
};
Command cmd_rectangle_tool = {
CMD_RECTANGLE_TOOL,
NULL,
cmd_rectangle_tool_checked,
cmd_rectangle_tool_execute,
NULL
};
Command cmd_spray_tool = {
CMD_SPRAY_TOOL,
NULL,
cmd_spray_tool_checked,
cmd_spray_tool_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/app.h"
#include "modules/gui.h"
@ -32,22 +33,22 @@
#endif
static Layer *DuplicateLayer(void);
static Layer *duplicate_layer(void);
bool command_enabled_duplicate_layer(const char *argument)
static bool cmd_duplicate_layer_enabled(const char *argument)
{
return
current_sprite != NULL &&
current_sprite->layer != NULL;
}
void command_execute_duplicate_layer(const char *argument)
static void cmd_duplicate_layer_execute(const char *argument)
{
if (DuplicateLayer() != NULL)
if (duplicate_layer() != NULL)
update_screen_for_sprite(current_sprite);
}
static Layer *DuplicateLayer(void)
static Layer *duplicate_layer(void)
{
Sprite *sprite = current_sprite;
Layer *layer_copy;
@ -83,3 +84,11 @@ static Layer *DuplicateLayer(void)
return layer_copy;
}
Command cmd_duplicate_layer = {
CMD_DUPLICATE_LAYER,
cmd_duplicate_layer_enabled,
NULL,
cmd_duplicate_layer_execute,
NULL
};

View File

@ -22,8 +22,9 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "core/cfg.h"
#include "modules/gui.h"
@ -32,12 +33,12 @@
#endif
bool command_enabled_duplicate_sprite(const char *argument)
static bool cmd_duplicate_sprite_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_duplicate_sprite(const char *argument)
static void cmd_duplicate_sprite_execute(const char *argument)
{
JWidget window, src_name, dst_name, flatten;
Sprite *sprite = current_sprite;
@ -84,3 +85,11 @@ void command_execute_duplicate_sprite(const char *argument)
jwidget_free(window);
}
Command cmd_duplicate_sprite = {
CMD_DUPLICATE_SPRITE,
cmd_duplicate_sprite_enabled,
NULL,
cmd_duplicate_sprite_execute,
NULL
};

View File

@ -20,15 +20,16 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_exit(const char *argument)
static void cmd_exit_execute(const char *argument)
{
Sprite *sprite = get_first_sprite();
Sprite *clipboard = get_clipboard_sprite();
@ -49,3 +50,11 @@ void command_execute_exit(const char *argument)
/* close the window */
jwindow_close(app_get_top_window(), 0);
}
Command cmd_exit = {
CMD_EXIT,
NULL,
NULL,
cmd_exit_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
/* #include "core/app.h" */
#include "modules/sprites.h"
/* #include "raster/sprite.h" */
@ -29,12 +30,20 @@
#endif
bool command_enabled_film_editor(const char *argument)
static bool cmd_film_editor_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_film_editor(const char *argument)
static void cmd_film_editor_execute(const char *argument)
{
switch_between_film_and_sprite_editor();
}
Command cmd_film_editor = {
CMD_FILM_EDITOR,
cmd_film_editor_enabled,
NULL,
cmd_film_editor_execute,
NULL
};

View File

@ -20,17 +20,26 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/sprites.h"
#include "script/functions.h"
#endif
bool command_enabled_flatten_layers(const char *argument)
static bool cmd_flatten_layers_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_flatten_layers(const char *argument)
static void cmd_flatten_layers_execute(const char *argument)
{
FlattenLayers();
}
Command cmd_flatten_layers = {
CMD_FLATTEN_LAYERS,
cmd_flatten_layers_enabled,
NULL,
cmd_flatten_layers_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/editors.h"
#include "modules/gui.h"
#include "modules/sprites.h"
@ -37,12 +38,12 @@ static void do_flip(int horz);
/* flip_horizontal */
/* ======================== */
bool command_enabled_flip_horizontal(const char *argument)
static bool cmd_flip_horizontal_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_flip_horizontal(const char *argument)
static void cmd_flip_horizontal_execute(const char *argument)
{
do_flip(TRUE);
}
@ -51,12 +52,12 @@ void command_execute_flip_horizontal(const char *argument)
/* flip_vertical */
/* ======================== */
bool command_enabled_flip_vertical(const char *argument)
static bool cmd_flip_vertical_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_flip_vertical(const char *argument)
static void cmd_flip_vertical_execute(const char *argument)
{
do_flip(FALSE);
}
@ -110,3 +111,19 @@ static void do_flip(int horz)
image_free(area);
update_screen_for_sprite(current_sprite);
}
Command cmd_flip_horizontal = {
CMD_FLIP_HORIZONTAL,
cmd_flip_horizontal_enabled,
NULL,
cmd_flip_horizontal_execute,
NULL
};
Command cmd_flip_vertical = {
CMD_FLIP_VERTICAL,
cmd_flip_vertical_enabled,
NULL,
cmd_flip_vertical_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
/* #include "core/app.h" */
#include "modules/gui.h"
#include "modules/sprites.h"
@ -34,12 +35,12 @@
void dialogs_frame_length(int sprite_frame);
bool command_enabled_frame_properties(const char *argument)
static bool cmd_frame_properties_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_frame_properties(const char *argument)
static void cmd_frame_properties_execute(const char *argument)
{
dialogs_frame_length(current_sprite->frame);
}
@ -87,3 +88,11 @@ void dialogs_frame_length(int sprite_frame)
}
jwidget_free(window);
}
Command cmd_frame_properties = {
CMD_FRAME_PROPERTIES,
cmd_frame_properties_enabled,
NULL,
cmd_frame_properties_execute,
NULL
};

View File

@ -30,12 +30,12 @@
#endif
bool command_enabled_invert_mask(const char *argument)
static bool cmd_invert_mask_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_invert_mask(const char *argument)
static void cmd_invert_mask_execute(const char *argument)
{
Sprite *sprite = current_sprite;
Mask *mask;
@ -80,3 +80,11 @@ void command_execute_invert_mask(const char *argument)
update_screen_for_sprite(sprite);
}
}
Command cmd_invert_mask = {
CMD_INVERT_MASK,
cmd_invert_mask_enabled,
NULL,
cmd_invert_mask_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
@ -30,12 +31,12 @@
#endif
bool command_enabled_layer_properties(const char *argument)
static bool cmd_layer_properties_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_layer_properties(const char *argument)
static void cmd_layer_properties_execute(const char *argument)
{
JWidget window, box1, box2, box3, label_name, entry_name;
JWidget button_ok, button_cancel, label_bm, view_bm, list_bm;
@ -119,3 +120,11 @@ void command_execute_layer_properties(const char *argument)
jwidget_free(window);
}
Command cmd_layer_properties = {
CMD_LAYER_PROPERTIES,
cmd_layer_properties_enabled,
NULL,
cmd_layer_properties_execute,
NULL
};

View File

@ -20,19 +20,28 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "dialogs/filmedit.h"
#include "util/celmove.h"
#endif
bool command_enabled_link_cel(const char *argument)
static bool cmd_link_cel_enabled(const char *argument)
{
return is_movingcel();
}
void command_execute_link_cel(const char *argument)
static void cmd_link_cel_execute(const char *argument)
{
link_cel();
}
Command cmd_link_cel = {
CMD_LINK_CEL,
cmd_link_cel_enabled,
NULL,
cmd_link_cel_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/alert.h"
#include "jinete/jalert.h"
#include "commands/commands.h"
#include "dialogs/filesel.h"
#include "modules/gui.h"
#include "modules/sprites.h"
@ -32,12 +33,12 @@
#endif
bool command_enabled_load_mask(const char *argument)
static bool cmd_load_mask_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_load_mask(const char *argument)
static void cmd_load_mask_execute(const char *argument)
{
/* get current sprite */
Sprite *sprite = current_sprite;
@ -65,3 +66,11 @@ void command_execute_load_mask(const char *argument)
jfree(filename);
}
}
Command cmd_load_mask = {
CMD_LOAD_MASK,
cmd_load_mask_enabled,
NULL,
cmd_load_mask_execute,
NULL
};

View File

@ -20,14 +20,23 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_mapgen(const char *argument)
{
}
/* static void cmd_mapgen_execute(const char *argument) */
/* { */
/* } */
/* Command cmd_mapgen = { */
/* CMD_MAPGEN, */
/* cmd_mapgen_enabled, */
/* NULL, */
/* cmd_mapgen_execute, */
/* NULL */
/* }; */

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/mask.h"
@ -28,12 +29,12 @@
#endif
bool command_enabled_mask_all(const char *argument)
static bool cmd_mask_all_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_mask_all(const char *argument)
static void cmd_mask_all_execute(const char *argument)
{
Sprite *sprite = current_sprite;
@ -47,3 +48,11 @@ void command_execute_mask_all(const char *argument)
sprite_generate_mask_boundaries(sprite);
update_screen_for_sprite(sprite);
}
Command cmd_mask_all = {
CMD_MASK_ALL,
cmd_mask_all_enabled,
NULL,
cmd_mask_all_execute,
NULL
};

View File

@ -20,19 +20,28 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "dialogs/maskcol.h"
#include "modules/sprites.h"
#endif
bool command_enabled_mask_by_color(const char *argument)
static bool cmd_mask_by_color_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_mask_by_color(const char *argument)
static void cmd_mask_by_color_execute(const char *argument)
{
dialogs_mask_color();
}
Command cmd_mask_by_color = {
CMD_MASK_BY_COLOR,
cmd_mask_by_color_enabled,
NULL,
cmd_mask_by_color_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
@ -34,7 +35,7 @@
#endif
bool command_enabled_merge_down_layer(const char *argument)
static bool cmd_merge_down_layer_enabled(const char *argument)
{
Layer *src_layer, *dst_layer;
Sprite *sprite;
@ -54,7 +55,7 @@ bool command_enabled_merge_down_layer(const char *argument)
return TRUE;
}
void command_execute_merge_down_layer(const char *argument)
static void cmd_merge_down_layer_execute(const char *argument)
{
Sprite *sprite = current_sprite;
Layer *src_layer, *dst_layer;
@ -75,12 +76,12 @@ void command_execute_merge_down_layer(const char *argument)
/* get images */
if (src_cel)
src_image = stock_get_image(src_layer->stock, src_cel->image);
src_image = stock_get_image(sprite->stock, src_cel->image);
else
src_image = NULL;
if (dst_cel)
dst_image = stock_get_image(dst_layer->stock, dst_cel->image);
dst_image = stock_get_image(sprite->stock, dst_cel->image);
else
dst_image = NULL;
@ -88,18 +89,23 @@ void command_execute_merge_down_layer(const char *argument)
if (src_image) {
/* no destination image */
if (!dst_image) {
/* copy this cel to the destination layer */
/* copy this cel to the destination layer... */
/* creating a copy of the image */
dst_image = image_new_copy(src_image);
index = stock_add_image(dst_layer->stock, dst_image);
if (undo_is_enabled(sprite->undo)) {
undo_add_image(sprite->undo, dst_layer->stock, dst_image);
}
/* adding it in the stock of images */
index = stock_add_image(sprite->stock, dst_image);
if (undo_is_enabled(sprite->undo))
undo_add_image(sprite->undo, sprite->stock, dst_image);
/* creating a copy of the cell */
dst_cel = cel_new(frpos, index);
cel_set_position(dst_cel, src_cel->x, src_cel->y);
cel_set_opacity(dst_cel, src_cel->opacity);
if (undo_is_enabled(sprite->undo)) {
if (undo_is_enabled(sprite->undo))
undo_add_cel(sprite->undo, dst_layer, dst_cel);
}
layer_add_cel(dst_layer, dst_cel);
}
/* with destination */
@ -121,10 +127,10 @@ void command_execute_merge_down_layer(const char *argument)
src_layer->blend_mode);
cel_set_position(dst_cel, x1, y1);
if (undo_is_enabled(sprite->undo)) {
undo_replace_image(sprite->undo, dst_layer->stock, dst_cel->image);
}
stock_replace_image(dst_layer->stock, dst_cel->image, new_image);
if (undo_is_enabled(sprite->undo))
undo_replace_image(sprite->undo, sprite->stock, dst_cel->image);
stock_replace_image(sprite->stock, dst_cel->image, new_image);
image_free(dst_image);
}
@ -143,3 +149,11 @@ void command_execute_merge_down_layer(const char *argument)
update_screen_for_sprite(sprite);
}
Command cmd_merge_down_layer = {
CMD_MERGE_DOWN_LAYER,
cmd_merge_down_layer_enabled,
NULL,
cmd_merge_down_layer_execute,
NULL
};

View File

@ -20,19 +20,28 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "dialogs/filmedit.h"
#include "util/celmove.h"
#endif
bool command_enabled_move_cel(const char *argument)
static bool cmd_move_cel_enabled(const char *argument)
{
return is_movingcel();
}
void command_execute_move_cel(const char *argument)
static void cmd_move_cel_execute(const char *argument)
{
move_cel();
}
Command cmd_move_cel = {
CMD_MOVE_CEL,
cmd_move_cel_enabled,
NULL,
cmd_move_cel_execute,
NULL
};

View File

@ -20,10 +20,10 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/color.h"
#include "modules/sprites.h"
@ -33,11 +33,10 @@
#include "raster/sprite.h"
#include "raster/stock.h"
#include "raster/undo.h"
#include "widgets/colbar.h"
#endif
bool command_enabled_new_cel(const char *argument)
static bool cmd_new_cel_enabled(const char *argument)
{
return
current_sprite &&
@ -48,9 +47,9 @@ bool command_enabled_new_cel(const char *argument)
!layer_get_cel(current_sprite->layer, current_sprite->frame);
}
void command_execute_new_cel(const char *argument)
static void cmd_new_cel_execute(const char *argument)
{
int bg, image_index;
int image_index;
Image *image;
Cel *cel;
@ -64,16 +63,14 @@ void command_execute_new_cel(const char *argument)
}
/* background color (right color) */
bg = get_color_for_image(image->imgtype,
color_bar_get_color(app_get_color_bar(), 1));
image_clear(image, bg);
image_clear(image, 0);
/* add the image in the stock */
image_index = stock_add_image(current_sprite->layer->stock, image);
image_index = stock_add_image(current_sprite->stock, image);
undo_open(current_sprite->undo);
undo_add_image(current_sprite->undo,
current_sprite->layer->stock, image);
current_sprite->stock, image);
/* add the cel in the layer */
cel = cel_new(current_sprite->frame, image_index);
@ -84,3 +81,11 @@ void command_execute_new_cel(const char *argument)
update_screen_for_sprite(current_sprite);
}
Command cmd_new_cel = {
CMD_NEW_CEL,
cmd_new_cel_enabled,
NULL,
cmd_new_cel_execute,
NULL
};

View File

@ -23,8 +23,9 @@
#include <allegro/config.h>
#include <allegro/unicode.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/app.h"
#include "dialogs/colsel.h"
@ -51,7 +52,7 @@ static Sprite *new_sprite(int imgtype, int w, int h);
/**
* Shows the "New Sprite" dialog.
*/
void command_execute_new_file(const char *argument)
static void cmd_new_file_execute(const char *argument)
{
JWidget window, width, height, radio1, radio2, radio3, ok, bg_box;
int imgtype, w, h, bg;
@ -141,7 +142,8 @@ void command_execute_new_file(const char *argument)
usprintf(buf, "Sprite-%04d", ++_sprite_counter);
sprite_set_filename(sprite, buf);
image_clear(GetImage(), get_color_for_image(imgtype, color));
/* image_clear(GetImage(), get_color_for_image(imgtype, color)); */
sprite->bgcolor = get_color_for_image(imgtype, color);
sprite_show(sprite);
}
@ -164,3 +166,11 @@ static Sprite *new_sprite(int imgtype, int w, int h)
set_current_sprite(sprite);
return sprite;
}
Command cmd_new_file = {
CMD_NEW_FILE,
NULL,
NULL,
cmd_new_file_execute,
NULL
};

View File

@ -20,10 +20,10 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/color.h"
#include "modules/sprites.h"
@ -33,14 +33,13 @@
#include "raster/sprite.h"
#include "raster/stock.h"
#include "raster/undo.h"
#include "widgets/colbar.h"
#endif
static bool new_frame_for_layer(Sprite *sprite, Layer *layer, int frame);
static bool copy_cel_in_next_frame(Sprite *sprite, Layer *layer, int frame);
bool command_enabled_new_frame(const char *argument)
static bool cmd_new_frame_enabled(const char *argument)
{
return
current_sprite &&
@ -50,7 +49,7 @@ bool command_enabled_new_frame(const char *argument)
layer_is_image(current_sprite->layer);
}
void command_execute_new_frame(const char *argument)
static void cmd_new_frame_execute(const char *argument)
{
Sprite *sprite = current_sprite;
@ -105,9 +104,6 @@ static bool new_frame_for_layer(Sprite *sprite, Layer *layer, int frame)
break;
}
case GFXOBJ_LAYER_TEXT:
/* TODO */
break;
}
return TRUE;
@ -115,7 +111,7 @@ static bool new_frame_for_layer(Sprite *sprite, Layer *layer, int frame)
static bool copy_cel_in_next_frame(Sprite *sprite, Layer *layer, int frame)
{
int bg, image_index;
int image_index;
Image *image;
Cel *cel;
@ -126,15 +122,12 @@ static bool copy_cel_in_next_frame(Sprite *sprite, Layer *layer, int frame)
return FALSE;
}
/* background color (right color) */
bg = get_color_for_image(image->imgtype,
color_bar_get_color(app_get_color_bar(), 1));
image_clear(image, bg);
/* background color */
image_clear(image, 0);
/* add the image in the stock */
image_index = stock_add_image(layer->stock, image);
undo_add_image(sprite->undo, layer->stock, image);
image_index = stock_add_image(sprite->stock, image);
undo_add_image(sprite->undo, sprite->stock, image);
/* add the cel in the layer */
cel = cel_new(frame, image_index);
@ -143,3 +136,11 @@ static bool copy_cel_in_next_frame(Sprite *sprite, Layer *layer, int frame)
return TRUE;
}
Command cmd_new_frame = {
CMD_NEW_FRAME,
cmd_new_frame_enabled,
NULL,
cmd_new_frame_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
@ -31,12 +32,12 @@
#endif
bool command_enabled_new_layer(const char *argument)
static bool cmd_new_layer_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_new_layer(const char *argument)
static void cmd_new_layer_execute(const char *argument)
{
JWidget window, name_widget;
Sprite *sprite = current_sprite; /* get current sprite */
@ -78,3 +79,11 @@ void command_execute_new_layer(const char *argument)
jwidget_free(window);
}
Command cmd_new_layer = {
CMD_NEW_LAYER,
cmd_new_layer_enabled,
NULL,
cmd_new_layer_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/gui.h"
#include "modules/sprites.h"
@ -31,12 +32,12 @@
#endif
bool command_enabled_new_layer_set(const char *argument)
static bool cmd_new_layer_set_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_new_layer_set(const char *argument)
static void cmd_new_layer_set_execute(const char *argument)
{
JWidget window;
Sprite *sprite = current_sprite; /* get current sprite */
@ -60,3 +61,11 @@ void command_execute_new_layer_set(const char *argument)
jwidget_free(window);
}
Command cmd_new_layer_set = {
CMD_NEW_LAYER_SET,
cmd_new_layer_set_enabled,
NULL,
cmd_new_layer_set_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "dialogs/filesel.h"
#include "file/file.h"
#include "raster/sprite.h"
@ -28,7 +29,7 @@
#endif
void command_execute_open_file(const char *argument)
static void cmd_open_file_execute(const char *argument)
{
char *filename;
@ -57,3 +58,11 @@ void command_execute_open_file(const char *argument)
jfree(filename);
}
}
Command cmd_open_file = {
CMD_OPEN_FILE,
NULL,
NULL,
cmd_open_file_execute,
NULL
};

View File

@ -20,13 +20,22 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "dialogs/options.h"
#endif
void command_execute_options(const char *argument)
static void cmd_options_execute(const char *argument)
{
dialogs_options();
}
Command cmd_options = {
CMD_OPTIONS,
NULL,
NULL,
cmd_options_execute,
NULL
};

View File

@ -20,14 +20,28 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_palette_editor(const char *argument)
static bool cmd_palette_editor_enabled(const char *argument)
{
return FALSE;
}
static void cmd_palette_editor_execute(const char *argument)
{
}
Command cmd_palette_editor = {
CMD_PALETTE_EDITOR,
cmd_palette_editor_enabled,
NULL,
cmd_palette_editor_execute,
NULL
};

View File

@ -20,13 +20,14 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#include "util/clipbrd.h"
#endif
bool command_enabled_paste(const char *argument)
static bool cmd_paste_enabled(const char *argument)
{
Sprite *sprite = current_sprite;
Sprite *clipboard = get_clipboard_sprite();
@ -34,7 +35,15 @@ bool command_enabled_paste(const char *argument)
return (sprite && clipboard && (clipboard != sprite));
}
void command_execute_paste(const char *argument)
static void cmd_paste_execute(const char *argument)
{
paste_from_clipboard();
}
Command cmd_paste = {
CMD_PASTE,
cmd_paste_enabled,
NULL,
cmd_paste_execute,
NULL
};

View File

@ -20,14 +20,23 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
void command_execute_play_flic(const char *argument)
{
}
/* static void cmd_play_flic_execute(const char *argument) */
/* { */
/* } */
/* Command cmd_play_flic = { */
/* CMD_PLAY_FLIC, */
/* cmd_play_flic_enabled, */
/* NULL, */
/* cmd_play_flic_execute, */
/* NULL */
/* }; */

View File

@ -24,8 +24,9 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/editors.h"
#include "modules/gfx.h"
@ -43,7 +44,7 @@
static void preview_sprite(int flags);
bool command_enabled_preview(const char *argument)
static bool cmd_preview_enabled(const char *argument)
{
return current_sprite != NULL;
}
@ -52,7 +53,7 @@ bool command_enabled_preview(const char *argument)
/* preview_fit_to_screen */
/* ======================== */
void command_execute_preview_fit_to_screen(const char *argument)
static void cmd_preview_fit_to_screen_execute(const char *argument)
{
preview_sprite(PREVIEW_FIT_ON_SCREEN);
}
@ -61,7 +62,7 @@ void command_execute_preview_fit_to_screen(const char *argument)
/* preview_normal */
/* ======================== */
void command_execute_preview_normal(const char *argument)
static void cmd_preview_normal_execute(const char *argument)
{
preview_sprite(0);
}
@ -70,7 +71,7 @@ void command_execute_preview_normal(const char *argument)
/* preview_tiled */
/* ======================== */
void command_execute_preview_tiled(const char *argument)
static void cmd_preview_tiled_execute(const char *argument)
{
preview_sprite(PREVIEW_TILED);
}
@ -255,3 +256,27 @@ static void preview_sprite(int flags)
jrect_free(vp);
}
}
Command cmd_preview_fit_to_screen = {
CMD_PREVIEW_FIT_TO_SCREEN,
cmd_preview_enabled,
NULL,
cmd_preview_fit_to_screen_execute,
NULL
};
Command cmd_preview_normal = {
CMD_PREVIEW_NORMAL,
cmd_preview_enabled,
NULL,
cmd_preview_normal_execute,
NULL
};
Command cmd_preview_tiled = {
CMD_PREVIEW_TILED,
cmd_preview_enabled,
NULL,
cmd_preview_tiled_execute,
NULL
};

View File

@ -22,19 +22,20 @@
#include <allegro/gfx.h>
#include "jinete/base.h"
#include "jinete/alert.h"
#include "jinete/jbase.h"
#include "jinete/jalert.h"
#include "commands/commands.h"
#include "util/recscr.h"
#endif
bool command_checked_record_screen(const char *argument)
static bool cmd_record_screen_checked(const char *argument)
{
return is_rec_screen();
}
void command_execute_record_screen(const char *argument)
static void cmd_record_screen_execute(const char *argument)
{
if (is_rec_screen())
rec_screen_off();
@ -48,3 +49,11 @@ void command_execute_record_screen(const char *argument)
rec_screen_on();
}
}
Command cmd_record_screen = {
CMD_RECORD_SCREEN,
NULL,
cmd_record_screen_checked,
cmd_record_screen_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
@ -27,14 +28,22 @@
#endif
bool command_enabled_redo(const char *argument)
static bool cmd_redo_enabled(const char *argument)
{
return current_sprite != NULL && undo_can_redo(current_sprite->undo);
}
void command_execute_redo(const char *argument)
static void cmd_redo_execute(const char *argument)
{
undo_redo(current_sprite->undo);
sprite_generate_mask_boundaries(current_sprite);
update_screen_for_sprite(current_sprite);
}
Command cmd_redo = {
CMD_REDO,
cmd_redo_enabled,
NULL,
cmd_redo_execute,
NULL
};

View File

@ -22,13 +22,14 @@
#include <allegro.h>
#include "jinete/system.h"
#include "jinete/jsystem.h"
#include "commands/commands.h"
#include "core/app.h"
#endif
void command_execute_refresh(const char *argument)
static void cmd_refresh_execute(const char *argument)
{
jmouse_hide();
clear_to_color(screen, makecol(0, 0, 0));
@ -36,3 +37,11 @@ void command_execute_refresh(const char *argument)
app_refresh_screen();
}
Command cmd_refresh = {
CMD_REFRESH,
NULL,
NULL,
cmd_refresh_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/cel.h"
@ -29,7 +30,7 @@
#endif
bool command_enabled_remove_cel(const char *argument)
static bool cmd_remove_cel_enabled(const char *argument)
{
return
current_sprite &&
@ -40,7 +41,7 @@ bool command_enabled_remove_cel(const char *argument)
layer_get_cel(current_sprite->layer, current_sprite->frame);
}
void command_execute_remove_cel(const char *argument)
static void cmd_remove_cel_execute(const char *argument)
{
Cel *cel = layer_get_cel(current_sprite->layer,
current_sprite->frame);
@ -48,3 +49,11 @@ void command_execute_remove_cel(const char *argument)
RemoveCel(current_sprite->layer, cel);
update_screen_for_sprite(current_sprite);
}
Command cmd_remove_cel = {
CMD_REMOVE_CEL,
cmd_remove_cel_enabled,
NULL,
cmd_remove_cel_execute,
NULL
};

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/cel.h"
@ -34,14 +35,14 @@
static void remove_frame_for_layer(Sprite *sprite, Layer *layer, int frame);
bool command_enabled_remove_frame(const char *argument)
static bool cmd_remove_frame_enabled(const char *argument)
{
return
current_sprite != NULL &&
current_sprite->frames > 1;
}
void command_execute_remove_frame(const char *argument)
static void cmd_remove_frame_execute(const char *argument)
{
Sprite *sprite = current_sprite;
@ -91,8 +92,13 @@ static void remove_frame_for_layer(Sprite *sprite, Layer *layer, int frame)
break;
}
case GFXOBJ_LAYER_TEXT:
/* TODO */
break;
}
}
Command cmd_remove_frame = {
CMD_REMOVE_FRAME,
cmd_remove_frame_enabled,
NULL,
cmd_remove_frame_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
@ -27,13 +28,21 @@
#endif
bool command_enabled_remove_layer(const char *argument)
static bool cmd_remove_layer_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_remove_layer(const char *argument)
static void cmd_remove_layer_execute(const char *argument)
{
RemoveLayer();
update_screen_for_sprite(current_sprite);
}
Command cmd_remove_layer = {
CMD_REMOVE_LAYER,
cmd_remove_layer_enabled,
NULL,
cmd_remove_layer_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/mask.h"
@ -28,14 +29,14 @@
#endif
bool command_enabled_reselect_mask(const char *argument)
static bool cmd_reselect_mask_enabled(const char *argument)
{
return
current_sprite != NULL &&
sprite_request_mask(current_sprite, "*deselected*") != NULL;
}
void command_execute_reselect_mask(const char *argument)
static void cmd_reselect_mask_execute(const char *argument)
{
Sprite *sprite = current_sprite;
Mask *mask;
@ -57,3 +58,11 @@ void command_execute_reselect_mask(const char *argument)
sprite_generate_mask_boundaries(sprite);
update_screen_for_sprite(sprite);
}
Command cmd_reselect_mask = {
CMD_RESELECT_MASK,
cmd_reselect_mask_enabled,
NULL,
cmd_reselect_mask_execute,
NULL
};

View File

@ -20,13 +20,14 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "script/script.h"
#endif
void command_execute_run_script(const char *argument)
static void cmd_run_script_execute(const char *argument)
{
char *filename = ji_file_select(_("Load Script File(.lua)"), "", "lua");
if (filename) {
@ -34,3 +35,11 @@ void command_execute_run_script(const char *argument)
jfree(filename);
}
}
Command cmd_run_script = {
CMD_RUN_SCRIPT,
NULL,
NULL,
cmd_run_script_execute,
NULL
};

View File

@ -20,7 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "console/console.h"
@ -31,12 +31,12 @@
#endif
bool command_enabled_save_file(const char *argument)
static bool cmd_save_file_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_save_file(const char *argument)
static void cmd_save_file_execute(const char *argument)
{
/* if the sprite is associated to a file in the file-system, we can
save it directly without user interaction */
@ -59,3 +59,11 @@ void command_execute_save_file(const char *argument)
command_execute(command_get_by_name(CMD_SAVE_FILE_AS), argument);
}
}
Command cmd_save_file = {
CMD_SAVE_FILE,
cmd_save_file_enabled,
NULL,
cmd_save_file_execute,
NULL
};

View File

@ -22,8 +22,9 @@
#include <allegro.h>
#include "jinete/alert.h"
#include "jinete/jalert.h"
#include "commands/commands.h"
#include "console/console.h"
/* #include "core/app.h" */
#include "dialogs/filesel.h"
@ -35,12 +36,12 @@
#endif
bool command_enabled_save_file_as(const char *argument)
static bool cmd_save_file_as_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_save_file_as(const char *argument)
static void cmd_save_file_as_execute(const char *argument)
{
char filename[4096];
char *newfilename;
@ -92,3 +93,11 @@ void command_execute_save_file_as(const char *argument)
filename);
}
}
Command cmd_save_file_as = {
CMD_SAVE_FILE_AS,
cmd_save_file_as_enabled,
NULL,
cmd_save_file_as_execute,
NULL
};

View File

@ -22,8 +22,9 @@
#include <allegro/file.h>
#include "jinete/alert.h"
#include "jinete/jalert.h"
#include "commands/commands.h"
#include "dialogs/filesel.h"
#include "modules/sprites.h"
#include "raster/mask.h"
@ -32,7 +33,7 @@
#endif
bool command_enabled_save_mask(const char *argument)
static bool cmd_save_mask_enabled(const char *argument)
{
if (!current_sprite)
return FALSE;
@ -41,7 +42,7 @@ bool command_enabled_save_mask(const char *argument)
current_sprite->mask->bitmap) ? TRUE: FALSE;
}
void command_execute_save_mask(const char *argument)
static void cmd_save_mask_execute(const char *argument)
{
/* get current sprite */
Sprite *sprite = current_sprite;
@ -79,3 +80,11 @@ void command_execute_save_mask(const char *argument)
_("Error"), _("Error saving .msk file"),
_(filename), _("&Close"));
}
Command cmd_save_mask = {
CMD_SAVE_MASK,
cmd_save_mask_enabled,
NULL,
cmd_save_mask_execute,
NULL
};

View File

@ -22,13 +22,14 @@
#include <allegro.h>
#include "jinete/system.h"
#include "jinete/jsystem.h"
#include "commands/commands.h"
#include "core/core.h"
#endif
void command_execute_screen_shot(const char *argument)
static void cmd_screen_shot_execute(const char *argument)
{
int old_flag;
char buf[512];
@ -63,3 +64,11 @@ void command_execute_screen_shot(const char *argument)
/* restore the freeze flag by the previous value */
freeze_mouse_flag = old_flag;
}
Command cmd_screen_shot = {
CMD_SCREEN_SHOT,
NULL,
NULL,
cmd_screen_shot_execute,
NULL
};

View File

@ -23,15 +23,16 @@
#include <allegro/debug.h>
#include <allegro/unicode.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "core/app.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#endif
bool command_enabled_select_file(const char *argument)
static bool cmd_select_file_enabled(const char *argument)
{
/* with argument, the argument specified the ID of the GfxObj */
if (argument) {
@ -44,7 +45,7 @@ bool command_enabled_select_file(const char *argument)
return TRUE;
}
bool command_checked_select_file(const char *argument)
static bool cmd_select_file_checked(const char *argument)
{
if (argument) {
int sprite_id = ustrtol(argument, NULL, 10);
@ -57,7 +58,7 @@ bool command_checked_select_file(const char *argument)
return current_sprite == NULL;
}
void command_execute_select_file(const char *argument)
static void cmd_select_file_execute(const char *argument)
{
if (argument) {
int sprite_id = ustrtol(argument, NULL, 10);
@ -70,3 +71,11 @@ void command_execute_select_file(const char *argument)
sprite_show(NULL);
}
}
Command cmd_select_file = {
CMD_SELECT_FILE,
cmd_select_file_enabled,
cmd_select_file_checked,
cmd_select_file_execute,
NULL
};

View File

@ -20,26 +20,59 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/editors.h"
#endif
void command_execute_close_editor(const char *argument)
static void cmd_close_editor_execute(const char *argument)
{
close_editor(current_editor);
}
void command_execute_make_unique_editor(const char *argument)
static void cmd_make_unique_editor_execute(const char *argument)
{
make_unique_editor(current_editor);
}
void command_execute_split_editor_horizontally(const char *argument)
static void cmd_split_editor_horizontally_execute(const char *argument)
{
split_editor(current_editor, JI_HORIZONTAL);
}
void command_execute_split_editor_vertically(const char *argument)
static void cmd_split_editor_vertically_execute(const char *argument)
{
split_editor(current_editor, JI_VERTICAL);
}
Command cmd_close_editor = {
CMD_CLOSE_EDITOR,
NULL,
NULL,
cmd_close_editor_execute,
NULL
};
Command cmd_make_unique_editor = {
CMD_MAKE_UNIQUE_EDITOR,
NULL,
NULL,
cmd_make_unique_editor_execute,
NULL
};
Command cmd_split_editor_horizontally = {
CMD_SPLIT_EDITOR_HORIZONTALLY,
NULL,
NULL,
cmd_split_editor_horizontally_execute,
NULL
};
Command cmd_split_editor_vertically = {
CMD_SPLIT_EDITOR_VERTICALLY,
NULL,
NULL,
cmd_split_editor_vertically_execute,
NULL
};

View File

@ -22,30 +22,35 @@
#include <allegro/unicode.h>
#include "jinete.h"
#include "jinete/jinete.h"
/* #include "core/app.h" */
#include "commands/commands.h"
#include "modules/color.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/image.h"
#include "raster/sprite.h"
#include "raster/undo.h"
#include "widgets/colbut.h"
#endif
/* TODO remove this */
void dialogs_frame_length(int sprite_frpos);
bool command_enabled_sprite_properties(const char *argument)
static bool cmd_sprite_properties_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_sprite_properties(const char *argument)
static void cmd_sprite_properties_execute(const char *argument)
{
JWidget window, killer, name, type, size, frames, speed, ok;
JWidget bgcolor_box, bgcolor_button;
Sprite *sprite = current_sprite;
char *imgtype_text;
char buf[256];
char *tmp;
/* load the window widget */
window = load_widget("sprprop.jid", "sprite_properties");
@ -57,6 +62,7 @@ void command_execute_sprite_properties(const char *argument)
"type", &type,
"size", &size,
"frames", &frames,
"bgcolor_box", &bgcolor_box,
"speed", &speed,
"ok", &ok, NULL)) {
jwidget_free(window);
@ -79,13 +85,28 @@ void command_execute_sprite_properties(const char *argument)
break;
}
/* filename */
jwidget_set_text(name, sprite->filename);
jwidget_set_static_size(name, 256, 0);
/* color mode */
jwidget_set_text(type, imgtype_text);
/* sprite size (width and height) */
usprintf(buf, "%dx%d", sprite->w, sprite->h);
jwidget_set_text(size, buf);
/* how many frames */
usprintf(buf, "%d", sprite->frames);
jwidget_set_text(frames, buf);
/* background color */
tmp = color_from_image(sprite->imgtype, sprite->bgcolor);
bgcolor_button = color_button_new(tmp, current_sprite->imgtype);
jfree(tmp);
jwidget_add_child(bgcolor_box, bgcolor_button);
jwindow_remap(window);
jwindow_center(window);
@ -96,19 +117,20 @@ void command_execute_sprite_properties(const char *argument)
killer = jwindow_get_killer(window);
if (killer == ok) {
const char *filename = jwidget_get_text(name);
int nframes = ustrtol(jwidget_get_text(frames), NULL, 10);
int new_bgcolor;
nframes = MID(1, nframes, 9999);
/* the background color changes */
new_bgcolor = get_color_for_image(sprite->imgtype,
color_button_get_color(bgcolor_button));
/* does filename change? */
if (filename != sprite->filename) {
sprite_set_filename(sprite, filename);
rebuild_sprite_list();
/* set frames */
if (sprite->bgcolor != new_bgcolor) {
if (undo_is_enabled(sprite->undo))
undo_int(sprite->undo, (GfxObj *)sprite, &sprite->bgcolor);
sprite_set_bgcolor(sprite, new_bgcolor);
}
sprite_set_frames(sprite, nframes);
/* update sprite in editors */
update_screen_for_sprite(sprite);
break;
@ -122,3 +144,11 @@ void command_execute_sprite_properties(const char *argument)
jwidget_free(window);
}
Command cmd_sprite_properties = {
CMD_SPRITE_PROPERTIES,
cmd_sprite_properties_enabled,
NULL,
cmd_sprite_properties_execute,
NULL
};

View File

@ -20,13 +20,22 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "commands/commands.h"
#include "dialogs/tips.h"
#endif
void command_execute_tips(const char *argument)
static void cmd_tips_execute(const char *argument)
{
dialogs_tips(TRUE);
}
Command cmd_tips = {
CMD_TIPS,
NULL,
NULL,
cmd_tips_execute,
NULL
};

View File

@ -20,6 +20,7 @@
#ifndef USE_PRECOMPILED_HEADER
#include "commands/commands.h"
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
@ -27,14 +28,22 @@
#endif
bool command_enabled_undo(const char *argument)
static bool cmd_undo_enabled(const char *argument)
{
return current_sprite != NULL && undo_can_undo(current_sprite->undo);
}
void command_execute_undo(const char *argument)
static void cmd_undo_execute(const char *argument)
{
undo_undo(current_sprite->undo);
sprite_generate_mask_boundaries(current_sprite);
update_screen_for_sprite(current_sprite);
}
Command cmd_undo = {
CMD_UNDO,
cmd_undo_enabled,
NULL,
cmd_undo_execute,
NULL
};

View File

@ -24,283 +24,209 @@
#include <string.h>
#include <allegro/unicode.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "console/console.h"
#include "commands/commands.h"
#endif
/********************************************************************/
/* All commands */
/* file */
void command_execute_new_file(const char *argument);
void command_execute_new_file(const char *argument);
void command_execute_open_file(const char *argument);
bool command_enabled_save_file(const char *argument);
void command_execute_save_file(const char *argument);
bool command_enabled_save_file_as(const char *argument);
void command_execute_save_file_as(const char *argument);
bool command_enabled_close_file(const char *argument);
void command_execute_close_file(const char *argument);
bool command_enabled_close_all_files(const char *argument);
void command_execute_close_all_files(const char *argument);
void command_execute_screen_shot(const char *argument);
bool command_checked_record_screen(const char *argument);
void command_execute_record_screen(const char *argument);
void command_execute_about(const char *argument);
void command_execute_exit(const char *argument);
extern Command cmd_new_file;
extern Command cmd_open_file;
extern Command cmd_save_file;
extern Command cmd_save_file_as;
extern Command cmd_close_file;
extern Command cmd_close_all_files;
extern Command cmd_screen_shot;
extern Command cmd_record_screen;
extern Command cmd_about;
extern Command cmd_exit;
/* edit */
bool command_enabled_undo(const char *argument);
void command_execute_undo(const char *argument);
bool command_enabled_redo(const char *argument);
void command_execute_redo(const char *argument);
bool command_enabled_cut(const char *argument);
void command_execute_cut(const char *argument);
bool command_enabled_copy(const char *argument);
void command_execute_copy(const char *argument);
bool command_enabled_paste(const char *argument);
void command_execute_paste(const char *argument);
bool command_enabled_clear(const char *argument);
void command_execute_clear(const char *argument);
bool command_enabled_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);
bool command_enabled_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_refresh(const char *argument);
void command_execute_configure_screen(const char *argument);
void command_execute_advanced_mode(const char *argument);
void command_execute_make_unique_editor(const char *argument);
void command_execute_split_editor_vertically(const char *argument);
void command_execute_split_editor_horizontally(const char *argument);
void command_execute_close_editor(const char *argument);
bool command_enabled_preview(const char *argument);
void command_execute_preview_fit_to_screen(const char *argument);
void command_execute_preview_normal(const char *argument);
void command_execute_preview_tiled(const char *argument);
extern Command cmd_undo;
extern Command cmd_redo;
extern Command cmd_cut;
extern Command cmd_copy;
extern Command cmd_paste;
extern Command cmd_clear;
extern Command cmd_flip_horizontal;
extern Command cmd_flip_vertical;
extern Command cmd_replace_color;
extern Command cmd_invert_color;
/* view */
extern Command cmd_refresh;
extern Command cmd_configure_screen;
extern Command cmd_advanced_mode;
extern Command cmd_make_unique_editor;
extern Command cmd_split_editor_vertically;
extern Command cmd_split_editor_horizontally;
extern Command cmd_close_editor;
extern Command cmd_preview_tiled, preview;
extern Command cmd_preview_normal, preview;
extern Command cmd_preview_fit_to_screen, preview;
/* sprite */
bool command_enabled_sprite_properties(const char *argument);
void command_execute_sprite_properties(const char *argument);
bool command_enabled_duplicate_sprite(const char *argument);
void command_execute_duplicate_sprite(const char *argument);
bool command_enabled_change_image_type(const char *argument);
void command_execute_change_image_type(const char *argument);
bool command_enabled_crop_sprite(const char *argument);
void command_execute_crop_sprite(const char *argument);
bool command_enabled_autocrop_sprite(const char *argument);
void command_execute_autocrop_sprite(const char *argument);
extern Command cmd_sprite_properties;
extern Command cmd_duplicate_sprite;
extern Command cmd_change_image_type;
extern Command cmd_crop_sprite;
extern Command cmd_autocrop_sprite;
/* layer */
bool command_enabled_layer_properties(const char *argument);
void command_execute_layer_properties(const char *argument);
bool command_enabled_new_layer(const char *argument);
void command_execute_new_layer(const char *argument);
bool command_enabled_new_layer_set(const char *argument);
void command_execute_new_layer_set(const char *argument);
bool command_enabled_remove_layer(const char *argument);
void command_execute_remove_layer(const char *argument);
bool command_enabled_duplicate_layer(const char *argument);
void command_execute_duplicate_layer(const char *argument);
bool command_enabled_merge_down_layer(const char *argument);
void command_execute_merge_down_layer(const char *argument);
bool command_enabled_flatten_layers(const char *argument);
void command_execute_flatten_layers(const char *argument);
bool command_enabled_crop_layer(const char *argument);
void command_execute_crop_layer(const char *argument);
extern Command cmd_layer_properties;
extern Command cmd_new_layer;
extern Command cmd_new_layer_set;
extern Command cmd_remove_layer;
extern Command cmd_duplicate_layer;
extern Command cmd_merge_down_layer;
extern Command cmd_flatten_layers;
extern Command cmd_crop_layer;
/* frame */
bool command_enabled_frame_properties(const char *argument);
void command_execute_frame_properties(const char *argument);
bool command_enabled_remove_frame(const char *argument);
void command_execute_remove_frame(const char *argument);
bool command_enabled_new_frame(const char *argument);
void command_execute_new_frame(const char *argument);
extern Command cmd_frame_properties;
extern Command cmd_remove_frame;
extern Command cmd_new_frame;
/* cel */
bool command_enabled_cel_properties(const char *argument);
void command_execute_cel_properties(const char *argument);
bool command_enabled_remove_cel(const char *argument);
void command_execute_remove_cel(const char *argument);
bool command_enabled_new_cel(const char *argument);
void command_execute_new_cel(const char *argument);
bool command_enabled_move_cel(const char *argument);
void command_execute_move_cel(const char *argument);
bool command_enabled_copy_cel(const char *argument);
void command_execute_copy_cel(const char *argument);
bool command_enabled_link_cel(const char *argument);
void command_execute_link_cel(const char *argument);
bool command_enabled_crop_cel(const char *argument);
void command_execute_crop_cel(const char *argument);
/* select */
bool command_enabled_mask_all(const char *argument);
void command_execute_mask_all(const char *argument);
bool command_enabled_deselect_mask(const char *argument);
void command_execute_deselect_mask(const char *argument);
bool command_enabled_reselect_mask(const char *argument);
void command_execute_reselect_mask(const char *argument);
bool command_enabled_invert_mask(const char *argument);
void command_execute_invert_mask(const char *argument);
bool command_enabled_mask_by_color(const char *argument);
void command_execute_mask_by_color(const char *argument);
bool command_enabled_load_mask(const char *argument);
void command_execute_load_mask(const char *argument);
bool command_enabled_save_mask(const char *argument);
void command_execute_save_mask(const char *argument);
extern Command cmd_cel_properties;
extern Command cmd_remove_cel;
extern Command cmd_new_cel;
extern Command cmd_move_cel;
extern Command cmd_copy_cel;
extern Command cmd_link_cel;
extern Command cmd_crop_cel;
/* mask */
extern Command cmd_mask_all;
extern Command cmd_deselect_mask;
extern Command cmd_reselect_mask;
extern Command cmd_invert_mask;
extern Command cmd_mask_by_color;
extern Command cmd_load_mask;
extern Command cmd_save_mask;
/* tools */
void command_execute_configure_tools(const char *argument);
bool command_checked_marker_tool(const char *argument);
void command_execute_marker_tool(const char *argument);
bool command_checked_dots_tool(const char *argument);
void command_execute_dots_tool(const char *argument);
bool command_checked_pencil_tool(const char *argument);
void command_execute_pencil_tool(const char *argument);
bool command_checked_brush_tool(const char *argument);
void command_execute_brush_tool(const char *argument);
bool command_checked_spray_tool(const char *argument);
void command_execute_spray_tool(const char *argument);
bool command_checked_floodfill_tool(const char *argument);
void command_execute_floodfill_tool(const char *argument);
bool command_checked_line_tool(const char *argument);
void command_execute_line_tool(const char *argument);
bool command_checked_rectangle_tool(const char *argument);
void command_execute_rectangle_tool(const char *argument);
bool command_checked_ellipse_tool(const char *argument);
void command_execute_ellipse_tool(const char *argument);
bool command_enabled_film_editor(const char *argument);
void command_execute_film_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);
bool command_enabled_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_draw_text(const char *argument); */
/* void command_execute_play_flic(const char *argument); */
void command_execute_run_script(const char *argument);
void command_execute_tips(const char *argument);
void command_execute_options(const char *argument);
/* internal commands */
bool command_enabled_select_file(const char *argument);
bool command_checked_select_file(const char *argument);
void command_execute_select_file(const char *argument);
extern Command cmd_configure_tools;
extern Command cmd_marker_tool;
extern Command cmd_dots_tool;
extern Command cmd_pencil_tool;
extern Command cmd_brush_tool;
extern Command cmd_spray_tool;
extern Command cmd_floodfill_tool;
extern Command cmd_line_tool;
extern Command cmd_rectangle_tool;
extern Command cmd_ellipse_tool;
extern Command cmd_film_editor;
extern Command cmd_palette_editor;
extern Command cmd_convolution_matrix;
extern Command cmd_color_curve;
extern Command cmd_despeckle;
extern Command cmd_run_script;
extern Command cmd_tips;
extern Command cmd_options;
/* internal */
extern Command cmd_select_file;
/* EXE=execute, ENA=enabled, CHK=checked */
#define CMD_EXE(name) { #name, NULL, NULL, command_execute_##name, NULL }
#define CMD_EXE_ENA(name) { #name, command_enabled_##name, NULL, command_execute_##name, NULL }
#define CMD_EXE_ENA2(name,name2){ #name, command_enabled_##name2, NULL, command_execute_##name, NULL }
#define CMD_EXE_ENA_CHK(name) { #name, command_enabled_##name, command_checked_##name, command_execute_##name, NULL }
#define CMD_EXE_CHK(name) { #name, NULL, command_checked_##name, command_execute_##name, NULL }
static Command commands[] = {
static Command *commands[] = {
/* file */
CMD_EXE(new_file),
CMD_EXE(open_file),
CMD_EXE_ENA(save_file),
CMD_EXE_ENA(save_file_as),
CMD_EXE_ENA(close_file),
CMD_EXE_ENA(close_all_files),
CMD_EXE(screen_shot),
CMD_EXE_CHK(record_screen),
CMD_EXE(about),
CMD_EXE(exit),
&cmd_new_file,
&cmd_open_file,
&cmd_save_file,
&cmd_save_file_as,
&cmd_close_file,
&cmd_close_all_files,
&cmd_screen_shot,
&cmd_record_screen,
&cmd_about,
&cmd_exit,
/* edit */
CMD_EXE_ENA(undo),
CMD_EXE_ENA(redo),
CMD_EXE_ENA(cut),
CMD_EXE_ENA(copy),
CMD_EXE_ENA(paste),
CMD_EXE_ENA(clear),
CMD_EXE_ENA(flip_horizontal),
CMD_EXE_ENA(flip_vertical),
CMD_EXE_ENA(replace_color),
CMD_EXE_ENA(invert_color),
&cmd_undo,
&cmd_redo,
&cmd_cut,
&cmd_copy,
&cmd_paste,
&cmd_clear,
&cmd_flip_horizontal,
&cmd_flip_vertical,
&cmd_replace_color,
&cmd_invert_color,
/* view */
CMD_EXE(refresh),
CMD_EXE(configure_screen),
CMD_EXE(advanced_mode),
CMD_EXE(make_unique_editor),
CMD_EXE(split_editor_vertically),
CMD_EXE(split_editor_horizontally),
CMD_EXE(close_editor),
CMD_EXE_ENA2(preview_tiled, preview),
CMD_EXE_ENA2(preview_normal, preview),
CMD_EXE_ENA2(preview_fit_to_screen, preview),
&cmd_refresh,
&cmd_configure_screen,
&cmd_advanced_mode,
&cmd_make_unique_editor,
&cmd_split_editor_vertically,
&cmd_split_editor_horizontally,
&cmd_close_editor,
&cmd_preview_tiled,
&cmd_preview_normal,
&cmd_preview_fit_to_screen,
/* sprite */
CMD_EXE_ENA(sprite_properties),
CMD_EXE_ENA(duplicate_sprite),
CMD_EXE_ENA(change_image_type),
CMD_EXE_ENA(crop_sprite),
CMD_EXE_ENA(autocrop_sprite),
&cmd_sprite_properties,
&cmd_duplicate_sprite,
&cmd_change_image_type,
&cmd_crop_sprite,
&cmd_autocrop_sprite,
/* layer */
CMD_EXE_ENA(layer_properties),
CMD_EXE_ENA(new_layer),
CMD_EXE_ENA(new_layer_set),
CMD_EXE_ENA(remove_layer),
CMD_EXE_ENA(duplicate_layer),
CMD_EXE_ENA(merge_down_layer),
CMD_EXE_ENA(flatten_layers),
CMD_EXE_ENA(crop_layer),
&cmd_layer_properties,
&cmd_new_layer,
&cmd_new_layer_set,
&cmd_remove_layer,
&cmd_duplicate_layer,
&cmd_merge_down_layer,
&cmd_flatten_layers,
&cmd_crop_layer,
/* frame */
CMD_EXE_ENA(frame_properties),
CMD_EXE_ENA(remove_frame),
CMD_EXE_ENA(new_frame),
&cmd_frame_properties,
&cmd_remove_frame,
&cmd_new_frame,
/* cel */
CMD_EXE_ENA(cel_properties),
CMD_EXE_ENA(remove_cel),
CMD_EXE_ENA(new_cel),
CMD_EXE_ENA(move_cel),
CMD_EXE_ENA(copy_cel),
CMD_EXE_ENA(link_cel),
CMD_EXE_ENA(crop_cel),
&cmd_cel_properties,
&cmd_remove_cel,
&cmd_new_cel,
&cmd_move_cel,
&cmd_copy_cel,
&cmd_link_cel,
&cmd_crop_cel,
/* mask */
CMD_EXE_ENA(mask_all),
CMD_EXE_ENA(deselect_mask),
CMD_EXE_ENA(reselect_mask),
CMD_EXE_ENA(invert_mask),
CMD_EXE_ENA(mask_by_color),
CMD_EXE_ENA(load_mask),
CMD_EXE_ENA(save_mask),
&cmd_mask_all,
&cmd_deselect_mask,
&cmd_reselect_mask,
&cmd_invert_mask,
&cmd_mask_by_color,
&cmd_load_mask,
&cmd_save_mask,
/* tools */
CMD_EXE(configure_tools),
CMD_EXE_CHK(marker_tool),
CMD_EXE_CHK(dots_tool),
CMD_EXE_CHK(pencil_tool),
CMD_EXE_CHK(brush_tool),
CMD_EXE_CHK(spray_tool),
CMD_EXE_CHK(floodfill_tool),
CMD_EXE_CHK(line_tool),
CMD_EXE_CHK(rectangle_tool),
CMD_EXE_CHK(ellipse_tool),
CMD_EXE_ENA(film_editor),
{ CMD_PALETTE_EDITOR, NULL, NULL, NULL, NULL },
CMD_EXE_ENA(convolution_matrix),
CMD_EXE_ENA(color_curve),
CMD_EXE_ENA(despeckle),
/* { CMD_DRAW_TEXT, NULL, NULL, NULL, NULL }, */
/* { CMD_PLAY_FLIC, NULL, NULL, NULL, NULL }, */
/* { CMD_MAPGEN, NULL, NULL, NULL, NULL }, */
CMD_EXE(run_script),
CMD_EXE(tips),
CMD_EXE(options),
&cmd_configure_tools,
&cmd_marker_tool,
&cmd_dots_tool,
&cmd_pencil_tool,
&cmd_brush_tool,
&cmd_spray_tool,
&cmd_floodfill_tool,
&cmd_line_tool,
&cmd_rectangle_tool,
&cmd_ellipse_tool,
&cmd_film_editor,
&cmd_palette_editor,
&cmd_convolution_matrix,
&cmd_color_curve,
&cmd_despeckle,
/* { CMD_DRAW_TEXT, NULL, NULL, NULL, NULL }, */
/* { CMD_PLAY_FLIC, NULL, NULL, NULL, NULL }, */
/* { CMD_MAPGEN, NULL, NULL, NULL, NULL }, */
&cmd_run_script,
&cmd_tips,
&cmd_options,
/* internal */
CMD_EXE_ENA_CHK(select_file),
{ NULL, NULL, NULL, NULL, NULL }
&cmd_select_file,
NULL
};
Command *command_get_by_name(const char *name)
{
Command *cmd;
Command **cmd;
if (!name)
return NULL;
for (cmd=commands; cmd->name; cmd++) {
if (strcmp(cmd->name, name) == 0)
return cmd;
for (cmd=commands; *cmd; cmd++) {
if (strcmp((*cmd)->name, name) == 0)
return *cmd;
}
return NULL;
@ -308,11 +234,11 @@ Command *command_get_by_name(const char *name)
Command *command_get_by_key(JMessage msg)
{
Command *cmd;
Command **cmd;
for (cmd=commands; cmd->name; cmd++) {
if (command_is_key_pressed(cmd, msg))
return cmd;
for (cmd=commands; *cmd; cmd++) {
if (command_is_key_pressed(*cmd, msg))
return *cmd;
}
return NULL;
@ -378,12 +304,12 @@ void command_add_key(Command *command, const char *string)
void command_reset_keys()
{
Command *cmd;
Command **cmd;
for (cmd=commands; cmd->name; cmd++) {
if (cmd->accel) {
jaccel_free(cmd->accel);
cmd->accel = NULL;
for (cmd=commands; *cmd; cmd++) {
if ((*cmd)->accel) {
jaccel_free((*cmd)->accel);
(*cmd)->accel = NULL;
}
}
}

View File

@ -19,7 +19,7 @@
#ifndef COMMANDS_COMMANDS_H
#define COMMANDS_COMMANDS_H
#include "jinete/base.h"
#include "jinete/jbase.h"
/* file */
#define CMD_NEW_FILE "new_file"
@ -59,7 +59,7 @@
#define CMD_DUPLICATE_SPRITE "duplicate_sprite"
#define CMD_CHANGE_IMAGE_TYPE "change_image_type"
#define CMD_CROP_SPRITE "crop_sprite"
#define CMD_AUTO_CROP_SPRITE "auto_crop_sprite"
#define CMD_AUTOCROP_SPRITE "autocrop_sprite"
/* layer */
#define CMD_LAYER_PROPERTIES "layer_properties"
#define CMD_NEW_LAYER "new_layer"

View File

@ -20,8 +20,9 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/cfg.h"
#include "core/core.h"
@ -35,7 +36,6 @@
#include "raster/mask.h"
#include "raster/sprite.h"
#include "util/misc.h"
#include "widgets/colbar.h"
#include "widgets/colbut.h"
#include "widgets/curvedit.h"
#include "widgets/preview.h"
@ -49,12 +49,12 @@ static JWidget check_preview, preview;
static bool hooked_msg_proc(JWidget widget, JMessage msg);
static void make_preview(void);
bool command_enabled_color_curve(const char *argument)
static bool cmd_color_curve_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_color_curve(const char *argument)
static void cmd_color_curve_execute(const char *argument)
{
JWidget window, button_ok;
JWidget view_curve, curve_editor;
@ -170,3 +170,11 @@ static void make_preview(void)
if (jwidget_is_selected(check_preview))
preview_restart(preview);
}
Command cmd_color_curve = {
CMD_COLOR_CURVE,
cmd_color_curve_enabled,
NULL,
cmd_color_curve_execute,
NULL
};

View File

@ -22,17 +22,18 @@
#include <string.h>
#include "jinete/box.h"
#include "jinete/button.h"
#include "jinete/hook.h"
#include "jinete/label.h"
#include "jinete/list.h"
#include "jinete/listbox.h"
#include "jinete/slider.h"
#include "jinete/view.h"
#include "jinete/widget.h"
#include "jinete/window.h"
#include "jinete/jbox.h"
#include "jinete/jbutton.h"
#include "jinete/jhook.h"
#include "jinete/jlabel.h"
#include "jinete/jlist.h"
#include "jinete/jlistbox.h"
#include "jinete/jslider.h"
#include "jinete/jview.h"
#include "jinete/jwidget.h"
#include "jinete/jwindow.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/cfg.h"
#include "core/core.h"
@ -48,7 +49,6 @@
#include "raster/mask.h"
#include "raster/sprite.h"
#include "util/misc.h"
#include "widgets/colbar.h"
#include "widgets/colbut.h"
#include "widgets/curvedit.h"
#include "widgets/preview.h"
@ -72,12 +72,12 @@ static int preview_change_hook (JWidget widget, int user_data);
static int tiled_change_hook (JWidget widget, int user_data);
static void make_preview (void);
bool command_enabled_convolution_matrix(const char *argument)
static bool cmd_convolution_matrix_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_convolution_matrix(const char *argument)
static void cmd_convolution_matrix_execute(const char *argument)
{
JWidget window, button_ok;
JWidget view_convmatr, list_convmatr;
@ -137,7 +137,7 @@ void command_execute_convolution_matrix(const char *argument)
HOOK (reload, JI_SIGNAL_BUTTON_SELECT, reload_select_hook, list_convmatr);
HOOK (generate, JI_SIGNAL_BUTTON_SELECT, generate_select_hook, 0);
/* XXXX enable this someday */
/* TODO enable this someday */
jwidget_disable (generate);
/* default position */
@ -286,7 +286,7 @@ static int generate_select_hook (JWidget widget, int user_data)
jwidget_set_static_size (view_x, 64, 64);
jwidget_set_static_size (view_y, 64, 64);
/* XXX fix this */
/* TODO fix this */
/* jwidget_get_vtable (div)->request_size = NULL; */
/* jwidget_get_vtable (bias)->request_size = NULL; */
@ -295,7 +295,7 @@ static int generate_select_hook (JWidget widget, int user_data)
jwindow_open_fg (window);
/* XXX do something */
/* TODO do something */
jwidget_free (window);
@ -344,3 +344,11 @@ static void make_preview (void)
if (jwidget_is_selected (check_preview))
preview_restart (preview);
}
Command cmd_convolution_matrix = {
CMD_CONVOLUTION_MATRIX,
cmd_convolution_matrix_enabled,
NULL,
cmd_convolution_matrix_execute,
NULL
};

View File

@ -22,13 +22,14 @@
#include <stdio.h>
#include "jinete/box.h"
#include "jinete/button.h"
#include "jinete/entry.h"
#include "jinete/hook.h"
#include "jinete/widget.h"
#include "jinete/window.h"
#include "jinete/jbox.h"
#include "jinete/jbutton.h"
#include "jinete/jentry.h"
#include "jinete/jhook.h"
#include "jinete/jwidget.h"
#include "jinete/jwindow.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/cfg.h"
#include "core/core.h"
@ -57,12 +58,12 @@ static int preview_change_hook (JWidget widget, int user_data);
static int tiled_change_hook (JWidget widget, int user_data);
static void make_preview (void);
bool command_enabled_despeckle(const char *argument)
static bool cmd_despeckle_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_despeckle(const char *argument)
static void cmd_despeckle_execute(const char *argument)
{
JWidget window, box_target, target_button, button_ok;
Image *image;
@ -196,3 +197,11 @@ static void make_preview (void)
if (jwidget_is_selected (check_preview))
preview_restart (preview);
}
Command cmd_despeckle = {
CMD_DESPECKLE,
cmd_despeckle_enabled,
NULL,
cmd_despeckle_execute,
NULL
};

View File

@ -20,14 +20,15 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/box.h"
#include "jinete/button.h"
#include "jinete/hook.h"
#include "jinete/label.h"
#include "jinete/slider.h"
#include "jinete/widget.h"
#include "jinete/window.h"
#include "jinete/jbox.h"
#include "jinete/jbutton.h"
#include "jinete/jhook.h"
#include "jinete/jlabel.h"
#include "jinete/jslider.h"
#include "jinete/jwidget.h"
#include "jinete/jwindow.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/cfg.h"
#include "core/core.h"
@ -39,7 +40,6 @@
#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"
@ -52,12 +52,12 @@ static int target_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_invert_color(const char *argument)
static bool cmd_invert_color_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_invert_color(const char *argument)
static void cmd_invert_color_execute(const char *argument)
{
JWidget window, box_target, target_button, button_ok;
Sprite *sprite = current_sprite;
@ -146,3 +146,11 @@ static void make_preview(void)
if (jwidget_is_selected(check_preview))
preview_restart(preview);
}
Command cmd_invert_color = {
CMD_INVERT_COLOR,
cmd_invert_color_enabled,
NULL,
cmd_invert_color_execute,
NULL
};

View File

@ -22,8 +22,9 @@
#include <stdio.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "commands/commands.h"
#include "console/console.h"
#include "core/app.h"
#include "core/cfg.h"
@ -56,12 +57,12 @@ 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)
static bool cmd_replace_color_enabled(const char *argument)
{
return current_sprite != NULL;
}
void command_execute_replace_color(const char *argument)
static void cmd_replace_color_execute(const char *argument)
{
JWidget window, color_buttons_box;
JWidget button1_1, button1_2;
@ -231,3 +232,11 @@ static void make_preview(void)
if (jwidget_is_selected(check_preview))
preview_restart(preview);
}
Command cmd_replace_color = {
CMD_REPLACE_COLOR,
cmd_replace_color_enabled,
NULL,
cmd_replace_color_execute,
NULL
};

View File

@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdarg.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "core/app.h"
#include "core/core.h"

View File

@ -28,8 +28,8 @@
#include <string.h>
#include <time.h>
#include "jinete.h"
#include "jinete/intern.h"
#include "jinete/jinete.h"
#include "jinete/jintern.h"
#include "commands/commands.h"
#include "console/console.h"
@ -450,7 +450,7 @@ void app_realloc_sprite_list(void)
if (sprite == clipboard)
continue;
/* `count' limit -- XXXX how I know the height of menu-items? */
/* `count' limit -- TODO how I know the height of menu-items? */
/* if (count >= SCREEN_H/(text_height (font)+4)-2) { */
if (count >= 14) {
menuitem = menuitem_new(_("More"), NULL, NULL);

View File

@ -19,7 +19,7 @@
#ifndef CORE_APP_H
#define CORE_APP_H
#include "jinete/base.h"
#include "jinete/jbase.h"
int app_init(int argc, char *argv[]);
void app_loop(void);

View File

@ -24,7 +24,7 @@
#include <allegro/file.h>
#include <allegro/unicode.h>
#include "jinete/rect.h"
#include "jinete/jrect.h"
#include "core/cfg.h"
#include "core/core.h"

View File

@ -20,7 +20,7 @@
#define CORE_CFG_H
#include <allegro/config.h>
#include "jinete/base.h"
#include "jinete/jbase.h"
void ase_config_init(void);
void ase_config_exit(void);

View File

@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "core/core.h"
#include "core/dirs.h"

View File

@ -19,7 +19,7 @@
#ifndef CORE_H
#define CORE_H
#include <jinete/base.h>
#include "jinete/jbase.h"
enum {
MODE_VERBOSE = 1, /* verbose mode status */

View File

@ -26,7 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include "jinete/base.h"
#include "jinete/jbase.h"
#include "core/core.h"
#include "core/dirs.h"

View File

@ -22,13 +22,13 @@
#include <allegro.h>
#include "jinete/box.h"
#include "jinete/button.h"
#include "jinete/entry.h"
#include "jinete/hook.h"
#include "jinete/label.h"
#include "jinete/widget.h"
#include "jinete/window.h"
#include "jinete/jbox.h"
#include "jinete/jbutton.h"
#include "jinete/jentry.h"
#include "jinete/jhook.h"
#include "jinete/jlabel.h"
#include "jinete/jwidget.h"
#include "jinete/jwindow.h"
#include "core/cfg.h"
#include "core/core.h"
@ -38,7 +38,6 @@
#include "modules/gui.h"
#include "modules/sprites.h"
#include "raster/sprite.h"
#include "widgets/colbar.h"
#include "widgets/colbut.h"
#include "widgets/groupbut.h"

View File

@ -24,7 +24,7 @@
#include <stdio.h>
#include <string.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "core/cfg.h"
#include "dialogs/filesel.h"

View File

@ -26,8 +26,8 @@
#include <stdlib.h>
#include <time.h>
#include "jinete.h"
#include "jinete/intern.h"
#include "jinete/jinete.h"
#include "jinete/jintern.h"
#include "console/console.h"
#include "core/cfg.h"

View File

@ -24,7 +24,7 @@
#include <stdio.h>
#include <string.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "core/cfg.h"
#include "dialogs/filesel.h"

View File

@ -22,7 +22,7 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "console/console.h"
#include "core/app.h"

View File

@ -35,7 +35,7 @@
#include <shlobj.h>
#endif
#include "jinete.h"
#include "jinete/jinete.h"
#include "core/cfg.h"
#include "core/dirs.h"

View File

@ -22,8 +22,8 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/intern.h"
#include "jinete/jinete.h"
#include "jinete/jintern.h"
#include "commands/commands.h"
#include "core/app.h"
@ -628,8 +628,7 @@ static bool cel_box_msg_proc(JWidget widget, JMessage msg)
k_image = cel->image;
cel_link = cel_is_link(cel, layer);
thumbnail = generate_thumbnail(cel_link ? cel_link: cel,
layer);
thumbnail = generate_thumbnail(cel_link ? cel_link: cel, sprite);
x1 = k_frame*FRMSIZE-scroll_x+FRMSIZE/2-THUMBSIZE/2;
y1 = y+3;
@ -650,8 +649,6 @@ static bool cel_box_msg_proc(JWidget widget, JMessage msg)
}
break;
}
case GFXOBJ_LAYER_TEXT:
break;
}
y += h;

View File

@ -20,13 +20,13 @@
#ifndef USE_PRECOMPILED_HEADER
#include "jinete/box.h"
#include "jinete/button.h"
#include "jinete/hook.h"
#include "jinete/label.h"
#include "jinete/slider.h"
#include "jinete/widget.h"
#include "jinete/window.h"
#include "jinete/jbox.h"
#include "jinete/jbutton.h"
#include "jinete/jhook.h"
#include "jinete/jlabel.h"
#include "jinete/jslider.h"
#include "jinete/jwidget.h"
#include "jinete/jwindow.h"
#include "core/app.h"
#include "core/cfg.h"

View File

@ -22,14 +22,14 @@
#include <stdio.h>
#include "jinete/box.h"
#include "jinete/button.h"
#include "jinete/hook.h"
#include "jinete/list.h"
#include "jinete/rect.h"
#include "jinete/system.h"
#include "jinete/widget.h"
#include "jinete/window.h"
#include "jinete/jbox.h"
#include "jinete/jbutton.h"
#include "jinete/jhook.h"
#include "jinete/jlist.h"
#include "jinete/jrect.h"
#include "jinete/jsystem.h"
#include "jinete/jwidget.h"
#include "jinete/jwindow.h"
#include "modules/color.h"
#include "modules/gui.h"

View File

@ -19,7 +19,7 @@
#ifndef DIALOGS_MINIPAL_H
#define DIALOGS_MINIPAL_H
#include "jinete/base.h"
#include "jinete/jbase.h"
void ji_minipal_new (JWidget color_bar, int x, int y);

View File

@ -22,7 +22,7 @@
#include <allegro.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "core/cfg.h"
#include "dialogs/filesel.h"

View File

@ -24,8 +24,8 @@
#include <stdio.h>
#include <string.h>
#include "jinete/manager.h"
#include "jinete/system.h"
#include "jinete/jmanager.h"
#include "jinete/jsystem.h"
#include "core/core.h"
#include "modules/gui.h"

View File

@ -19,7 +19,7 @@
#ifndef DIALOGS_PLAYFLI_H
#define DIALOGS_PLAYFLI_H
#include "jinete/base.h"
#include "jinete/jbase.h"
void play_fli_animation (const char *filename, bool loop, bool fullscreen);

View File

@ -23,7 +23,7 @@
#include <allegro/gfx.h>
#include <allegro/unicode.h>
#include "jinete.h"
#include "jinete/jinete.h"
#include "core/cfg.h"
#include "dialogs/repo.h"

View File

@ -19,7 +19,7 @@
#ifndef DIALOGS_REPO_H
#define DIALOGS_REPO_H
#include "jinete/base.h"
#include "jinete/jbase.h"
typedef struct RepoDlg { /* a window to shows repositories
(used for mask/paths repositories,

View File

@ -22,8 +22,8 @@
#include <allegro.h>
#include "jinete/manager.h"
#include "jinete/system.h"
#include "jinete/jmanager.h"
#include "jinete/jsystem.h"
#include "core/core.h"
#include "modules/gui.h"

Some files were not shown because too many files have changed in this diff Show More