diff --git a/makefile.lst b/makefile.lst index e3e4ddc64..f5544bb5e 100644 --- a/makefile.lst +++ b/makefile.lst @@ -7,7 +7,6 @@ ASE = aseprite$(EXE) COMMON_SOURCES = \ src/ase/context.cpp \ - src/ase/current_sprite.cpp \ src/ase/ui_context.cpp \ src/commands/cmd_about.cpp \ src/commands/cmd_advanced_mode.cpp \ diff --git a/src/ase_exception.h b/src/ase_exception.h index 1e73dbeb7..a8ac0534e 100644 --- a/src/ase_exception.h +++ b/src/ase_exception.h @@ -39,6 +39,10 @@ public: { } + virtual ~ase_exception() throw() + { + } + void show() { Console console; diff --git a/src/commands/cmd_advanced_mode.cpp b/src/commands/cmd_advanced_mode.cpp index 388058f95..e27dab391 100644 --- a/src/commands/cmd_advanced_mode.cpp +++ b/src/commands/cmd_advanced_mode.cpp @@ -56,7 +56,7 @@ static void cmd_advanced_mode_execute(const char *argument) char key[1024]; char buf[1024]; - JWidgetPtr window = load_widget("advanced.jid", "advanced_mode_warning"); + JWidgetPtr window(load_widget("advanced.jid", "advanced_mode_warning")); JWidget warning_label = find_widget(window, "warning_label"); JWidget donot_show = find_widget(window, "donot_show"); diff --git a/src/commands/cmd_canvas_size.cpp b/src/commands/cmd_canvas_size.cpp index c671fb790..e66700d04 100644 --- a/src/commands/cmd_canvas_size.cpp +++ b/src/commands/cmd_canvas_size.cpp @@ -44,7 +44,7 @@ static void cmd_canvas_size_execute(const char *argument) CurrentSpriteWriter sprite; // load the window widget - JWidgetPtr window = load_widget("canvas.jid", "canvas_size"); + JWidgetPtr window(load_widget("canvas.jid", "canvas_size")); get_widgets(window, "left", &left, "top", &top, diff --git a/src/commands/cmd_cel_properties.cpp b/src/commands/cmd_cel_properties.cpp index 4f29b5682..2e99874ec 100644 --- a/src/commands/cmd_cel_properties.cpp +++ b/src/commands/cmd_cel_properties.cpp @@ -62,7 +62,7 @@ static void cmd_cel_properties_execute(const char *argument) /* get current cel (can be NULL) */ cel = layer_get_cel(layer, sprite->frame); - JWidgetPtr window = load_widget("celprop.jid", "cel_properties"); + JWidgetPtr window(load_widget("celprop.jid", "cel_properties")); get_widgets(window, "frame", &label_frame, "pos", &label_pos, diff --git a/src/commands/cmd_configure_screen.cpp b/src/commands/cmd_configure_screen.cpp index 8998ed2ad..dac8e7268 100644 --- a/src/commands/cmd_configure_screen.cpp +++ b/src/commands/cmd_configure_screen.cpp @@ -77,7 +77,7 @@ static void show_dialog() JWidget resolution, color_depth, pixel_scale, fullscreen; char buf[512]; - JWidgetPtr window = load_widget("confscr.jid", "configure_screen"); + JWidgetPtr window(load_widget("confscr.jid", "configure_screen")); get_widgets(window, "resolution", &resolution, "color_depth", &color_depth, @@ -133,10 +133,10 @@ static void show_dialog() /* setup graphics mode */ if (try_new_gfx_mode()) { - JWidgetPtr alert_window = jalert_new("Confirm Screen" - "<layer; - JWidgetPtr window = jwindow_new(_("Layer Properties")); + JWidgetPtr window(jwindow_new(_("Layer Properties"))); box1 = jbox_new(JI_VERTICAL); box2 = jbox_new(JI_HORIZONTAL); box3 = jbox_new(JI_HORIZONTAL + JI_HOMOGENEOUS); diff --git a/src/commands/cmd_new_file.cpp b/src/commands/cmd_new_file.cpp index 24f758b6a..bd5b6d8f2 100644 --- a/src/commands/cmd_new_file.cpp +++ b/src/commands/cmd_new_file.cpp @@ -62,7 +62,7 @@ static void cmd_new_file_execute(const char *argument) }; /* load the window widget */ - JWidgetPtr window = load_widget("newspr.jid", "new_sprite"); + JWidgetPtr window(load_widget("newspr.jid", "new_sprite")); width = jwidget_find_name(window, "width"); height = jwidget_find_name(window, "height"); diff --git a/src/commands/cmd_new_layer.cpp b/src/commands/cmd_new_layer.cpp index e85084c96..7e8dfb186 100644 --- a/src/commands/cmd_new_layer.cpp +++ b/src/commands/cmd_new_layer.cpp @@ -41,7 +41,7 @@ static void cmd_new_layer_execute(const char* argument) { CurrentSpriteWriter sprite; - JWidgetPtr window = load_widget("newlay.jid", "new_layer"); + JWidgetPtr window(load_widget("newlay.jid", "new_layer")); JWidget name_widget = find_widget(window, "name"); { char* name = get_unique_layer_name(sprite); diff --git a/src/commands/cmd_new_layer_set.cpp b/src/commands/cmd_new_layer_set.cpp index 23e61f9df..28eea4ef3 100644 --- a/src/commands/cmd_new_layer_set.cpp +++ b/src/commands/cmd_new_layer_set.cpp @@ -39,7 +39,7 @@ static void cmd_new_layer_set_execute(const char *argument) CurrentSpriteWriter sprite; // load the window widget - JWidgetPtr window = load_widget("newlay.jid", "new_layer_set"); + JWidgetPtr window(load_widget("newlay.jid", "new_layer_set")); jwindow_open_fg(window); diff --git a/src/commands/cmd_palette_editor.cpp b/src/commands/cmd_palette_editor.cpp index 107370290..21216863a 100644 --- a/src/commands/cmd_palette_editor.cpp +++ b/src/commands/cmd_palette_editor.cpp @@ -87,7 +87,7 @@ static void cmd_palette_editor_execute(const char *argument) } /* load widgets */ - JWidgetPtr window = load_widget("paledit.jid", "palette_editor"); + JWidgetPtr window(load_widget("paledit.jid", "palette_editor")); get_widgets(window, "red", &slider_R, "green", &slider_G, diff --git a/src/commands/cmd_sprite_properties.cpp b/src/commands/cmd_sprite_properties.cpp index 5e31ccb44..55ccd9982 100644 --- a/src/commands/cmd_sprite_properties.cpp +++ b/src/commands/cmd_sprite_properties.cpp @@ -49,7 +49,7 @@ static void cmd_sprite_properties_execute(const char *argument) char buf[256]; /* load the window widget */ - JWidgetPtr window = load_widget("sprprop.jid", "sprite_properties"); + JWidgetPtr window(load_widget("sprprop.jid", "sprite_properties")); get_widgets(window, "name", &name, "type", &type, diff --git a/src/commands/cmd_sprite_size.cpp b/src/commands/cmd_sprite_size.cpp index 2797bd245..9fc1c30b6 100644 --- a/src/commands/cmd_sprite_size.cpp +++ b/src/commands/cmd_sprite_size.cpp @@ -137,7 +137,7 @@ static void cmd_sprite_size_execute(const char *argument) const CurrentSpriteReader sprite; // load the window widget - JWidgetPtr window = load_widget("sprsize.jid", "sprite_size"); + JWidgetPtr window(load_widget("sprsize.jid", "sprite_size")); get_widgets(window, "width_px", &width_px, "height_px", &height_px, diff --git a/src/commands/fx/cmd_color_curve.cpp b/src/commands/fx/cmd_color_curve.cpp index 546dbfa3b..aef1226b2 100644 --- a/src/commands/fx/cmd_color_curve.cpp +++ b/src/commands/fx/cmd_color_curve.cpp @@ -70,7 +70,7 @@ static void cmd_color_curve_execute(const char *argument) the_curve); } - JWidgetPtr window = load_widget("colcurv.jid", "color_curve"); + JWidgetPtr window(load_widget("colcurv.jid", "color_curve")); get_widgets(window, "preview", &check_preview, "button_ok", &button_ok, diff --git a/src/commands/fx/cmd_convolution_matrix.cpp b/src/commands/fx/cmd_convolution_matrix.cpp index 4bcedaf1b..a344e0201 100644 --- a/src/commands/fx/cmd_convolution_matrix.cpp +++ b/src/commands/fx/cmd_convolution_matrix.cpp @@ -82,7 +82,7 @@ static void cmd_convolution_matrix_execute(const char *argument) JWidget box_target; JWidget reload, generate; - JWidgetPtr window = load_widget("convmatr.jid", "convolution_matrix"); + JWidgetPtr window(load_widget("convmatr.jid", "convolution_matrix")); get_widgets(window, "preview", &check_preview, "tiled", &check_tiled, @@ -221,7 +221,7 @@ static bool generate_select_hook(JWidget widget, void *data) JWidget div, div_auto; JWidget bias, bias_auto; - JWidgetPtr window = load_widget("convmatr.jid", "generate_convolution_matrix"); + JWidgetPtr window(load_widget("convmatr.jid", "generate_convolution_matrix")); get_widgets(window, "view_x", &view_x, "view_y", &view_y, diff --git a/src/commands/fx/cmd_despeckle.cpp b/src/commands/fx/cmd_despeckle.cpp index 35662ebe6..96e9445ad 100644 --- a/src/commands/fx/cmd_despeckle.cpp +++ b/src/commands/fx/cmd_despeckle.cpp @@ -67,7 +67,7 @@ static void cmd_despeckle_execute(const char *argument) JWidget box_target, target_button, button_ok; char buf[32]; - JWidgetPtr window = load_widget("median.jid", "median"); + JWidgetPtr window(load_widget("median.jid", "median")); get_widgets(window, "width", &entry_width, "height", &entry_height, diff --git a/src/commands/fx/cmd_invert_color.cpp b/src/commands/fx/cmd_invert_color.cpp index 7bb6838a5..17c3f2b27 100644 --- a/src/commands/fx/cmd_invert_color.cpp +++ b/src/commands/fx/cmd_invert_color.cpp @@ -61,7 +61,7 @@ static void cmd_invert_color_execute(const char *argument) JWidget box_target, target_button, button_ok; const CurrentSpriteReader sprite; - JWidgetPtr window = load_widget("invrtcol.jid", "invert_color"); + JWidgetPtr window(load_widget("invrtcol.jid", "invert_color")); get_widgets(window, "target", &box_target, "preview", &check_preview, diff --git a/src/commands/fx/cmd_replace_color.cpp b/src/commands/fx/cmd_replace_color.cpp index 2da5b7b3b..9f498b8a1 100644 --- a/src/commands/fx/cmd_replace_color.cpp +++ b/src/commands/fx/cmd_replace_color.cpp @@ -66,7 +66,7 @@ static void cmd_replace_color_execute(const char *argument) JWidget box_target, target_button; JWidget button_ok; - JWidgetPtr window = load_widget("replcol.jid", "replace_color"); + JWidgetPtr window(load_widget("replcol.jid", "replace_color")); get_widgets(window, "color_buttons_box", &color_buttons_box, "preview", &check_preview, diff --git a/src/dialogs/options.cpp b/src/dialogs/options.cpp index 2584645a0..d33f9bc3a 100644 --- a/src/dialogs/options.cpp +++ b/src/dialogs/options.cpp @@ -60,7 +60,7 @@ void dialogs_options() old_y = y; /* load the window widget */ - JWidgetPtr window = load_widget("options.jid", "options"); + JWidgetPtr window(load_widget("options.jid", "options")); get_widgets(window, "mouse_x", &slider_x, "mouse_y", &slider_y, diff --git a/src/file/jpeg_format.cpp b/src/file/jpeg_format.cpp index af6589300..50869799d 100644 --- a/src/file/jpeg_format.cpp +++ b/src/file/jpeg_format.cpp @@ -360,7 +360,7 @@ static FormatOptions *get_options_JPEG(FileOp *fop) return (FormatOptions*)jpeg_options; /* widgets */ - JWidgetPtr window = load_widget("jpeg_options.jid", "jpeg_options"); + JWidgetPtr window(load_widget("jpeg_options.jid", "jpeg_options")); JWidget slider_quality, ok; get_widgets(window, "quality", &slider_quality, diff --git a/src/main.cpp b/src/main.cpp index e70f86da3..e555612eb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,13 +37,13 @@ public: ~Allegro() { allegro_exit(); } }; +#if defined MEMLEAK class MemLeaks { public: -#if defined MEMLEAK MemLeaks() { jmemleak_init(); } ~MemLeaks() { jmemleak_exit(); } -#endif }; +#endif ////////////////////////////////////////////////////////////////////// // Main Routine @@ -52,7 +52,9 @@ public: int main(int argc, char *argv[]) { Allegro allegro; +#if defined MEMLEAK MemLeaks memleaks; +#endif set_uformat(U_ASCII); diff --git a/src/modules/gui.h b/src/modules/gui.h index 47580a9aa..29fb7df74 100644 --- a/src/modules/gui.h +++ b/src/modules/gui.h @@ -23,6 +23,7 @@ #include #include "ase_exception.h" #include "jinete/jbase.h" +#include "jinete/jwidget.h" ////////////////////////////////////////////////////////////////////// @@ -115,7 +116,7 @@ public: m_widget = NULL; } - JWidgetPtr(JWidget widget) { + explicit JWidgetPtr(JWidget widget) { m_widget = widget; }