Fixed compilations problems with ase_exception and JWidgetPtr with g++

This commit is contained in:
David Capello 2009-06-11 15:50:10 +00:00
parent 3885f37f45
commit 8ac979667c
25 changed files with 35 additions and 32 deletions

View File

@ -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 \

View File

@ -39,6 +39,10 @@ public:
{
}
virtual ~ase_exception() throw()
{
}
void show()
{
Console console;

View File

@ -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");

View File

@ -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,

View File

@ -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,

View File

@ -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"
JWidgetPtr alert_window(jalert_new("Confirm Screen"
"<<Do you want to keep this screen resolution?"
"<<In 10 seconds the screen will be restored."
"||&Yes||&No");
"||&Yes||&No"));
jwidget_add_hook(alert_window, -1, alert_msg_proc, NULL);
seconds_to_accept = 10;

View File

@ -73,9 +73,6 @@ static void cmd_configure_tools_execute(const char *argument)
if (!window) {
window = load_widget("toolconf.jid", "configure_tool");
if (!window)
return;
first_time = TRUE;
}
/* if the window is opened, close it */

View File

@ -43,7 +43,7 @@ static void cmd_duplicate_sprite_execute(const char *argument)
char buf[1024];
/* load the window widget */
JWidgetPtr window = load_widget("dupspr.jid", "duplicate_sprite");
JWidgetPtr window(load_widget("dupspr.jid", "duplicate_sprite"));
src_name = jwidget_find_name(window, "src_name");
dst_name = jwidget_find_name(window, "dst_name");

View File

@ -48,7 +48,7 @@ void dialogs_frame_length(const SpriteReader& sprite, int sprite_frame)
JWidget frame, frlen, ok;
char buf[64];
JWidgetPtr window = load_widget("frlen.jid", "frame_duration");
JWidgetPtr window(load_widget("frlen.jid", "frame_duration"));
get_widgets(window,
"frame", &frame,
"frlen", &frlen,

View File

@ -42,7 +42,7 @@ static void cmd_layer_properties_execute(const char *argument)
CurrentSpriteWriter sprite;
Layer *layer = sprite->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);

View File

@ -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");

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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);

View File

@ -23,6 +23,7 @@
#include <string>
#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;
}