mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Fixed compilations problems with ase_exception and JWidgetPtr with g++
This commit is contained in:
parent
3885f37f45
commit
8ac979667c
@ -7,7 +7,6 @@ ASE = aseprite$(EXE)
|
|||||||
|
|
||||||
COMMON_SOURCES = \
|
COMMON_SOURCES = \
|
||||||
src/ase/context.cpp \
|
src/ase/context.cpp \
|
||||||
src/ase/current_sprite.cpp \
|
|
||||||
src/ase/ui_context.cpp \
|
src/ase/ui_context.cpp \
|
||||||
src/commands/cmd_about.cpp \
|
src/commands/cmd_about.cpp \
|
||||||
src/commands/cmd_advanced_mode.cpp \
|
src/commands/cmd_advanced_mode.cpp \
|
||||||
|
@ -39,6 +39,10 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~ase_exception() throw()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void show()
|
void show()
|
||||||
{
|
{
|
||||||
Console console;
|
Console console;
|
||||||
|
@ -56,7 +56,7 @@ static void cmd_advanced_mode_execute(const char *argument)
|
|||||||
char key[1024];
|
char key[1024];
|
||||||
char buf[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 warning_label = find_widget(window, "warning_label");
|
||||||
JWidget donot_show = find_widget(window, "donot_show");
|
JWidget donot_show = find_widget(window, "donot_show");
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ static void cmd_canvas_size_execute(const char *argument)
|
|||||||
CurrentSpriteWriter sprite;
|
CurrentSpriteWriter sprite;
|
||||||
|
|
||||||
// load the window widget
|
// load the window widget
|
||||||
JWidgetPtr window = load_widget("canvas.jid", "canvas_size");
|
JWidgetPtr window(load_widget("canvas.jid", "canvas_size"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"left", &left,
|
"left", &left,
|
||||||
"top", &top,
|
"top", &top,
|
||||||
|
@ -62,7 +62,7 @@ static void cmd_cel_properties_execute(const char *argument)
|
|||||||
/* get current cel (can be NULL) */
|
/* get current cel (can be NULL) */
|
||||||
cel = layer_get_cel(layer, sprite->frame);
|
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,
|
get_widgets(window,
|
||||||
"frame", &label_frame,
|
"frame", &label_frame,
|
||||||
"pos", &label_pos,
|
"pos", &label_pos,
|
||||||
|
@ -77,7 +77,7 @@ static void show_dialog()
|
|||||||
JWidget resolution, color_depth, pixel_scale, fullscreen;
|
JWidget resolution, color_depth, pixel_scale, fullscreen;
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
|
||||||
JWidgetPtr window = load_widget("confscr.jid", "configure_screen");
|
JWidgetPtr window(load_widget("confscr.jid", "configure_screen"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"resolution", &resolution,
|
"resolution", &resolution,
|
||||||
"color_depth", &color_depth,
|
"color_depth", &color_depth,
|
||||||
@ -133,10 +133,10 @@ static void show_dialog()
|
|||||||
|
|
||||||
/* setup graphics mode */
|
/* setup graphics mode */
|
||||||
if (try_new_gfx_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?"
|
"<<Do you want to keep this screen resolution?"
|
||||||
"<<In 10 seconds the screen will be restored."
|
"<<In 10 seconds the screen will be restored."
|
||||||
"||&Yes||&No");
|
"||&Yes||&No"));
|
||||||
jwidget_add_hook(alert_window, -1, alert_msg_proc, NULL);
|
jwidget_add_hook(alert_window, -1, alert_msg_proc, NULL);
|
||||||
|
|
||||||
seconds_to_accept = 10;
|
seconds_to_accept = 10;
|
||||||
|
@ -73,9 +73,6 @@ static void cmd_configure_tools_execute(const char *argument)
|
|||||||
|
|
||||||
if (!window) {
|
if (!window) {
|
||||||
window = load_widget("toolconf.jid", "configure_tool");
|
window = load_widget("toolconf.jid", "configure_tool");
|
||||||
if (!window)
|
|
||||||
return;
|
|
||||||
|
|
||||||
first_time = TRUE;
|
first_time = TRUE;
|
||||||
}
|
}
|
||||||
/* if the window is opened, close it */
|
/* if the window is opened, close it */
|
||||||
|
@ -43,7 +43,7 @@ static void cmd_duplicate_sprite_execute(const char *argument)
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
/* load the window widget */
|
/* 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");
|
src_name = jwidget_find_name(window, "src_name");
|
||||||
dst_name = jwidget_find_name(window, "dst_name");
|
dst_name = jwidget_find_name(window, "dst_name");
|
||||||
|
@ -48,7 +48,7 @@ void dialogs_frame_length(const SpriteReader& sprite, int sprite_frame)
|
|||||||
JWidget frame, frlen, ok;
|
JWidget frame, frlen, ok;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
JWidgetPtr window = load_widget("frlen.jid", "frame_duration");
|
JWidgetPtr window(load_widget("frlen.jid", "frame_duration"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"frame", &frame,
|
"frame", &frame,
|
||||||
"frlen", &frlen,
|
"frlen", &frlen,
|
||||||
|
@ -42,7 +42,7 @@ static void cmd_layer_properties_execute(const char *argument)
|
|||||||
CurrentSpriteWriter sprite;
|
CurrentSpriteWriter sprite;
|
||||||
Layer *layer = sprite->layer;
|
Layer *layer = sprite->layer;
|
||||||
|
|
||||||
JWidgetPtr window = jwindow_new(_("Layer Properties"));
|
JWidgetPtr window(jwindow_new(_("Layer Properties")));
|
||||||
box1 = jbox_new(JI_VERTICAL);
|
box1 = jbox_new(JI_VERTICAL);
|
||||||
box2 = jbox_new(JI_HORIZONTAL);
|
box2 = jbox_new(JI_HORIZONTAL);
|
||||||
box3 = jbox_new(JI_HORIZONTAL + JI_HOMOGENEOUS);
|
box3 = jbox_new(JI_HORIZONTAL + JI_HOMOGENEOUS);
|
||||||
|
@ -62,7 +62,7 @@ static void cmd_new_file_execute(const char *argument)
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* load the window widget */
|
/* 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");
|
width = jwidget_find_name(window, "width");
|
||||||
height = jwidget_find_name(window, "height");
|
height = jwidget_find_name(window, "height");
|
||||||
|
@ -41,7 +41,7 @@ static void cmd_new_layer_execute(const char* argument)
|
|||||||
{
|
{
|
||||||
CurrentSpriteWriter sprite;
|
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");
|
JWidget name_widget = find_widget(window, "name");
|
||||||
{
|
{
|
||||||
char* name = get_unique_layer_name(sprite);
|
char* name = get_unique_layer_name(sprite);
|
||||||
|
@ -39,7 +39,7 @@ static void cmd_new_layer_set_execute(const char *argument)
|
|||||||
CurrentSpriteWriter sprite;
|
CurrentSpriteWriter sprite;
|
||||||
|
|
||||||
// load the window widget
|
// 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);
|
jwindow_open_fg(window);
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ static void cmd_palette_editor_execute(const char *argument)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* load widgets */
|
/* load widgets */
|
||||||
JWidgetPtr window = load_widget("paledit.jid", "palette_editor");
|
JWidgetPtr window(load_widget("paledit.jid", "palette_editor"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"red", &slider_R,
|
"red", &slider_R,
|
||||||
"green", &slider_G,
|
"green", &slider_G,
|
||||||
|
@ -49,7 +49,7 @@ static void cmd_sprite_properties_execute(const char *argument)
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
/* load the window widget */
|
/* load the window widget */
|
||||||
JWidgetPtr window = load_widget("sprprop.jid", "sprite_properties");
|
JWidgetPtr window(load_widget("sprprop.jid", "sprite_properties"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"name", &name,
|
"name", &name,
|
||||||
"type", &type,
|
"type", &type,
|
||||||
|
@ -137,7 +137,7 @@ static void cmd_sprite_size_execute(const char *argument)
|
|||||||
const CurrentSpriteReader sprite;
|
const CurrentSpriteReader sprite;
|
||||||
|
|
||||||
// load the window widget
|
// load the window widget
|
||||||
JWidgetPtr window = load_widget("sprsize.jid", "sprite_size");
|
JWidgetPtr window(load_widget("sprsize.jid", "sprite_size"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"width_px", &width_px,
|
"width_px", &width_px,
|
||||||
"height_px", &height_px,
|
"height_px", &height_px,
|
||||||
|
@ -70,7 +70,7 @@ static void cmd_color_curve_execute(const char *argument)
|
|||||||
the_curve);
|
the_curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
JWidgetPtr window = load_widget("colcurv.jid", "color_curve");
|
JWidgetPtr window(load_widget("colcurv.jid", "color_curve"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"preview", &check_preview,
|
"preview", &check_preview,
|
||||||
"button_ok", &button_ok,
|
"button_ok", &button_ok,
|
||||||
|
@ -82,7 +82,7 @@ static void cmd_convolution_matrix_execute(const char *argument)
|
|||||||
JWidget box_target;
|
JWidget box_target;
|
||||||
JWidget reload, generate;
|
JWidget reload, generate;
|
||||||
|
|
||||||
JWidgetPtr window = load_widget("convmatr.jid", "convolution_matrix");
|
JWidgetPtr window(load_widget("convmatr.jid", "convolution_matrix"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"preview", &check_preview,
|
"preview", &check_preview,
|
||||||
"tiled", &check_tiled,
|
"tiled", &check_tiled,
|
||||||
@ -221,7 +221,7 @@ static bool generate_select_hook(JWidget widget, void *data)
|
|||||||
JWidget div, div_auto;
|
JWidget div, div_auto;
|
||||||
JWidget bias, bias_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,
|
get_widgets(window,
|
||||||
"view_x", &view_x,
|
"view_x", &view_x,
|
||||||
"view_y", &view_y,
|
"view_y", &view_y,
|
||||||
|
@ -67,7 +67,7 @@ static void cmd_despeckle_execute(const char *argument)
|
|||||||
JWidget box_target, target_button, button_ok;
|
JWidget box_target, target_button, button_ok;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
JWidgetPtr window = load_widget("median.jid", "median");
|
JWidgetPtr window(load_widget("median.jid", "median"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"width", &entry_width,
|
"width", &entry_width,
|
||||||
"height", &entry_height,
|
"height", &entry_height,
|
||||||
|
@ -61,7 +61,7 @@ static void cmd_invert_color_execute(const char *argument)
|
|||||||
JWidget box_target, target_button, button_ok;
|
JWidget box_target, target_button, button_ok;
|
||||||
const CurrentSpriteReader sprite;
|
const CurrentSpriteReader sprite;
|
||||||
|
|
||||||
JWidgetPtr window = load_widget("invrtcol.jid", "invert_color");
|
JWidgetPtr window(load_widget("invrtcol.jid", "invert_color"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"target", &box_target,
|
"target", &box_target,
|
||||||
"preview", &check_preview,
|
"preview", &check_preview,
|
||||||
|
@ -66,7 +66,7 @@ static void cmd_replace_color_execute(const char *argument)
|
|||||||
JWidget box_target, target_button;
|
JWidget box_target, target_button;
|
||||||
JWidget button_ok;
|
JWidget button_ok;
|
||||||
|
|
||||||
JWidgetPtr window = load_widget("replcol.jid", "replace_color");
|
JWidgetPtr window(load_widget("replcol.jid", "replace_color"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"color_buttons_box", &color_buttons_box,
|
"color_buttons_box", &color_buttons_box,
|
||||||
"preview", &check_preview,
|
"preview", &check_preview,
|
||||||
|
@ -60,7 +60,7 @@ void dialogs_options()
|
|||||||
old_y = y;
|
old_y = y;
|
||||||
|
|
||||||
/* load the window widget */
|
/* load the window widget */
|
||||||
JWidgetPtr window = load_widget("options.jid", "options");
|
JWidgetPtr window(load_widget("options.jid", "options"));
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"mouse_x", &slider_x,
|
"mouse_x", &slider_x,
|
||||||
"mouse_y", &slider_y,
|
"mouse_y", &slider_y,
|
||||||
|
@ -360,7 +360,7 @@ static FormatOptions *get_options_JPEG(FileOp *fop)
|
|||||||
return (FormatOptions*)jpeg_options;
|
return (FormatOptions*)jpeg_options;
|
||||||
|
|
||||||
/* widgets */
|
/* widgets */
|
||||||
JWidgetPtr window = load_widget("jpeg_options.jid", "jpeg_options");
|
JWidgetPtr window(load_widget("jpeg_options.jid", "jpeg_options"));
|
||||||
JWidget slider_quality, ok;
|
JWidget slider_quality, ok;
|
||||||
get_widgets(window,
|
get_widgets(window,
|
||||||
"quality", &slider_quality,
|
"quality", &slider_quality,
|
||||||
|
@ -37,13 +37,13 @@ public:
|
|||||||
~Allegro() { allegro_exit(); }
|
~Allegro() { allegro_exit(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined MEMLEAK
|
||||||
class MemLeaks {
|
class MemLeaks {
|
||||||
public:
|
public:
|
||||||
#if defined MEMLEAK
|
|
||||||
MemLeaks() { jmemleak_init(); }
|
MemLeaks() { jmemleak_init(); }
|
||||||
~MemLeaks() { jmemleak_exit(); }
|
~MemLeaks() { jmemleak_exit(); }
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Main Routine
|
// Main Routine
|
||||||
@ -52,7 +52,9 @@ public:
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Allegro allegro;
|
Allegro allegro;
|
||||||
|
#if defined MEMLEAK
|
||||||
MemLeaks memleaks;
|
MemLeaks memleaks;
|
||||||
|
#endif
|
||||||
|
|
||||||
set_uformat(U_ASCII);
|
set_uformat(U_ASCII);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "ase_exception.h"
|
#include "ase_exception.h"
|
||||||
#include "jinete/jbase.h"
|
#include "jinete/jbase.h"
|
||||||
|
#include "jinete/jwidget.h"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -115,7 +116,7 @@ public:
|
|||||||
m_widget = NULL;
|
m_widget = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
JWidgetPtr(JWidget widget) {
|
explicit JWidgetPtr(JWidget widget) {
|
||||||
m_widget = widget;
|
m_widget = widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user