mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-01 10:13:22 +00:00
Converted all TRUE/FALSE to C++ true/false
This commit is contained in:
parent
0c6765fb88
commit
96759c9c17
22
src/app.cpp
22
src/app.cpp
@ -143,7 +143,7 @@ App::App(int argc, char* argv[])
|
||||
}
|
||||
|
||||
/* set system palette to the default one */
|
||||
set_current_palette(NULL, TRUE);
|
||||
set_current_palette(NULL, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,12 +187,12 @@ int App::run()
|
||||
editor = create_new_editor();
|
||||
|
||||
// configure all widgets to expansives
|
||||
jwidget_expansive(menubar, TRUE);
|
||||
jwidget_expansive(statusbar, TRUE);
|
||||
jwidget_expansive(colorbar, TRUE);
|
||||
jwidget_expansive(toolbar, TRUE);
|
||||
jwidget_expansive(tabsbar, TRUE);
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(menubar, true);
|
||||
jwidget_expansive(statusbar, true);
|
||||
jwidget_expansive(colorbar, true);
|
||||
jwidget_expansive(toolbar, true);
|
||||
jwidget_expansive(tabsbar, true);
|
||||
jwidget_expansive(view, true);
|
||||
|
||||
/* prepare the first editor */
|
||||
jview_attach(view, editor);
|
||||
@ -280,11 +280,11 @@ int App::run()
|
||||
/* run the GUI */
|
||||
else if (ase_mode & MODE_GUI) {
|
||||
/* select language */
|
||||
dialogs_select_language(FALSE);
|
||||
dialogs_select_language(false);
|
||||
|
||||
// show tips only if there are not a current sprite
|
||||
if (!UIContext::instance()->get_current_sprite())
|
||||
dialogs_tips(FALSE);
|
||||
dialogs_tips(false);
|
||||
|
||||
// support to drop files from Windows explorer
|
||||
install_drop_files();
|
||||
@ -416,7 +416,7 @@ bool app_realloc_recent_list()
|
||||
/* update the recent file list menu item */
|
||||
if (list_menuitem) {
|
||||
if (jmenuitem_has_submenu_opened(list_menuitem))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
Command *cmd_open_file = CommandsModule::instance()->get_command_by_name(CommandId::open_file);
|
||||
|
||||
@ -450,7 +450,7 @@ bool app_realloc_recent_list()
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int app_get_current_image_type()
|
||||
|
@ -85,18 +85,18 @@ void AboutCommand::execute(Context* context)
|
||||
box4 = jbox_new(JI_HORIZONTAL);
|
||||
button1 = jbutton_new(_("&Close"));
|
||||
|
||||
jwidget_magnetic(button1, TRUE);
|
||||
jwidget_magnetic(button1, true);
|
||||
|
||||
jwidget_set_border(box1, 4, 4, 4, 4);
|
||||
jwidget_add_children(box1, label1, label2, separator1, NULL);
|
||||
if (textbox) {
|
||||
jview_attach(view, textbox);
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
jwidget_set_min_size(view, JI_SCREEN_W/3, JI_SCREEN_H/4);
|
||||
jwidget_add_children(box1, view, separator2, NULL);
|
||||
}
|
||||
jwidget_expansive(box3, TRUE);
|
||||
jwidget_expansive(box4, TRUE);
|
||||
jwidget_expansive(box3, true);
|
||||
jwidget_expansive(box4, true);
|
||||
jwidget_add_children(box2, box3, button1, box4, NULL);
|
||||
jwidget_add_children(box1, label3, label4, NULL);
|
||||
jwidget_add_child(box1, box2);
|
||||
|
@ -314,7 +314,7 @@ static bool alert_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -100,11 +100,11 @@ void ConfigureTools::execute(Context* context)
|
||||
JWidget brush_type_box, brush_type;
|
||||
JWidget check_onionskin;
|
||||
JWidget brush_preview;
|
||||
bool first_time = FALSE;
|
||||
bool first_time = false;
|
||||
|
||||
if (!window) {
|
||||
window = static_cast<Frame*>(load_widget("toolconf.jid", "configure_tool"));
|
||||
first_time = TRUE;
|
||||
first_time = true;
|
||||
}
|
||||
/* if the window is opened, close it */
|
||||
else if (jwidget_is_visible(window)) {
|
||||
@ -241,11 +241,11 @@ static bool brush_preview_msg_proc(JWidget widget, JMessage msg)
|
||||
blit(bmp, ji_screen, 0, 0, widget->rc->x1, widget->rc->y1,
|
||||
bmp->w, bmp->h);
|
||||
destroy_bitmap(bmp);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool window_close_hook(JWidget widget, void *data)
|
||||
@ -256,21 +256,21 @@ static bool window_close_hook(JWidget widget, void *data)
|
||||
/* save window configuration */
|
||||
save_window_pos(widget, "ConfigureTool");
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool brush_size_slider_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_brush_size(jslider_get_value(widget));
|
||||
jwidget_dirty((JWidget)data);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool brush_angle_slider_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_brush_angle(jslider_get_value(widget));
|
||||
jwidget_dirty((JWidget)data);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool brush_type_change_hook(JWidget widget, void *data)
|
||||
@ -286,31 +286,31 @@ static bool brush_type_change_hook(JWidget widget, void *data)
|
||||
type == BRUSH_SQUARE ? "Square":
|
||||
type == BRUSH_LINE ? "Line": "Unknown");
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool glass_dirty_slider_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_glass_dirty(jslider_get_value(widget));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool spray_width_slider_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_spray_width(jslider_get_value(widget));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool air_speed_slider_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_air_speed(jslider_get_value(widget));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool filled_check_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_filled_mode(jwidget_is_selected(widget));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool tiled_check_change_hook(JWidget widget, void *data)
|
||||
@ -319,7 +319,7 @@ static bool tiled_check_change_hook(JWidget widget, void *data)
|
||||
set_tiled_mode(flag ? TILED_BOTH: TILED_NONE);
|
||||
widget->findSibling("tiled_x")->setSelected(flag);
|
||||
widget->findSibling("tiled_y")->setSelected(flag);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool tiled_xy_check_change_hook(JWidget widget, void *data)
|
||||
@ -335,20 +335,20 @@ static bool tiled_xy_check_change_hook(JWidget widget, void *data)
|
||||
widget->findSibling("tiled")->setSelected(tiled_mode != TILED_NONE);
|
||||
|
||||
set_tiled_mode((tiled_t)tiled_mode);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool use_grid_check_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_use_grid(jwidget_is_selected(widget));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool view_grid_check_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_view_grid(jwidget_is_selected(widget));
|
||||
refresh_all_editors();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool set_grid_button_select_hook(JWidget widget, void *data)
|
||||
@ -379,7 +379,7 @@ static bool set_grid_button_select_hook(JWidget widget, void *data)
|
||||
e.show();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cursor_button_change_hook(JWidget widget, void *data)
|
||||
@ -392,7 +392,7 @@ static bool onionskin_check_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_onionskin(jwidget_is_selected(widget));
|
||||
refresh_all_editors();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -76,7 +76,7 @@ void DuplicateSpriteCommand::execute(Context* context)
|
||||
sprintf(buf, "%s %s", sprite->filename, _("Copy"));
|
||||
dst_name->setText(buf);
|
||||
|
||||
if (get_config_bool("DuplicateSprite", "Flatten", FALSE))
|
||||
if (get_config_bool("DuplicateSprite", "Flatten", false))
|
||||
jwidget_select(flatten);
|
||||
|
||||
/* open the window */
|
||||
|
@ -101,7 +101,7 @@ void LayerPropertiesCommand::execute(Context* context)
|
||||
|
||||
jview_attach(view_bm, list_bm);
|
||||
jwidget_set_min_size(view_bm, 128*guiscale(), 64*guiscale());
|
||||
jwidget_expansive(view_bm, TRUE);
|
||||
jwidget_expansive(view_bm, true);
|
||||
}
|
||||
|
||||
jwidget_set_min_size(entry_name, 128, 0);
|
||||
|
@ -116,7 +116,7 @@ void NewFileCommand::execute(Context* context)
|
||||
window->open_window_fg();
|
||||
|
||||
if (window->get_killer() == ok) {
|
||||
bool ok = FALSE;
|
||||
bool ok = false;
|
||||
|
||||
/* get the options */
|
||||
if (jwidget_is_selected(radio1)) imgtype = IMAGE_RGB;
|
||||
@ -135,7 +135,7 @@ void NewFileCommand::execute(Context* context)
|
||||
|
||||
if (bg >= 0 && bg <= 4) {
|
||||
color = bg_table[bg];
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
|
@ -99,7 +99,7 @@ void PaletteEditorCommand::execute(Context* context)
|
||||
const CurrentSpriteReader sprite(context);
|
||||
int imgtype = sprite ? sprite->imgtype: IMAGE_INDEXED;
|
||||
int frame_bak = sprite ? sprite->frame : 0;
|
||||
bool all_frames_same_palette = TRUE;
|
||||
bool all_frames_same_palette = true;
|
||||
|
||||
if (imgtype == IMAGE_GRAYSCALE) {
|
||||
jalert(_("Error<<You can't edit grayscale palette||&OK"));
|
||||
@ -145,7 +145,7 @@ void PaletteEditorCommand::execute(Context* context)
|
||||
|
||||
if (frame > 0 &&
|
||||
palette_count_diff(palettes[frame-1], palettes[frame], NULL, NULL) > 0) {
|
||||
all_frames_same_palette = FALSE;
|
||||
all_frames_same_palette = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -163,9 +163,9 @@ void PaletteEditorCommand::execute(Context* context)
|
||||
|
||||
/* custom widgets */
|
||||
colorviewer = colorviewer_new(color_index(0), IMAGE_INDEXED);
|
||||
palette_editor = paledit_new(palette, TRUE, 6);
|
||||
palette_editor = paledit_new(palette, true, 6);
|
||||
|
||||
jwidget_expansive(colorviewer, TRUE);
|
||||
jwidget_expansive(colorviewer, true);
|
||||
jwidget_add_child(colorviewer_box, colorviewer);
|
||||
|
||||
jwidget_disable(button_undo);
|
||||
@ -237,7 +237,7 @@ void PaletteEditorCommand::execute(Context* context)
|
||||
palette_copy_colors(palettes[0],
|
||||
get_current_palette());
|
||||
|
||||
sprite_set_palette(sprite_writer, palettes[0], TRUE);
|
||||
sprite_set_palette(sprite_writer, palettes[0], true);
|
||||
}
|
||||
/* various palettes */
|
||||
else {
|
||||
@ -249,7 +249,7 @@ void PaletteEditorCommand::execute(Context* context)
|
||||
if (frame == 0 ||
|
||||
palette_count_diff(palettes[frame],
|
||||
palettes[frame-1], NULL, NULL) > 0) {
|
||||
sprite_set_palette(sprite_writer, palettes[frame], TRUE);
|
||||
sprite_set_palette(sprite_writer, palettes[frame], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -258,7 +258,7 @@ void PaletteEditorCommand::execute(Context* context)
|
||||
else
|
||||
set_default_palette(palette);
|
||||
|
||||
set_current_palette(palette, TRUE);
|
||||
set_current_palette(palette, true);
|
||||
}
|
||||
/* cancel or ESC */
|
||||
else {
|
||||
@ -267,10 +267,10 @@ void PaletteEditorCommand::execute(Context* context)
|
||||
SpriteWriter sprite_writer(sprite);
|
||||
sprite_writer->frame = frame_bak;
|
||||
|
||||
set_current_palette(sprite_get_palette(sprite, frame_bak), TRUE);
|
||||
set_current_palette(sprite_get_palette(sprite, frame_bak), true);
|
||||
}
|
||||
else {
|
||||
set_current_palette(NULL, TRUE);
|
||||
set_current_palette(NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -422,7 +422,7 @@ static bool sliderRGB_change_hook(JWidget widget, void *data)
|
||||
jslider_set_value(slider_S, 255.0 * s);
|
||||
|
||||
jwidget_dirty(palette_editor);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool sliderHSV_change_hook(JWidget widget, void *data)
|
||||
@ -449,14 +449,14 @@ static bool sliderHSV_change_hook(JWidget widget, void *data)
|
||||
jslider_set_value(slider_B, b);
|
||||
|
||||
jwidget_dirty(palette_editor);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool slider_columns_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
paledit_set_columns(palette_editor,
|
||||
(int)jslider_get_value(widget));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool slider_frame_change_hook(JWidget widget, void *data)
|
||||
@ -475,7 +475,7 @@ static bool slider_frame_change_hook(JWidget widget, void *data)
|
||||
}
|
||||
set_new_palette(palettes[new_frame]);
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool check_all_frames_change_hook(JWidget widget, void *data)
|
||||
@ -489,12 +489,12 @@ static bool check_all_frames_change_hook(JWidget widget, void *data)
|
||||
get_current_palette());
|
||||
|
||||
if (jwidget_is_selected(check_all_frames)) {
|
||||
bool has_two_or_more_palettes = FALSE;
|
||||
bool has_two_or_more_palettes = false;
|
||||
int c;
|
||||
|
||||
for (c=1; c<sprite->frames; c++) {
|
||||
if (palette_count_diff(palettes[c-1], palettes[c], NULL, NULL) > 0) {
|
||||
has_two_or_more_palettes = TRUE;
|
||||
has_two_or_more_palettes = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -506,7 +506,7 @@ static bool check_all_frames_change_hook(JWidget widget, void *data)
|
||||
"<<Do you want to continue?"
|
||||
"||&Yes||&No") != 1) {
|
||||
jwidget_deselect(check_all_frames);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -515,7 +515,7 @@ static bool check_all_frames_change_hook(JWidget widget, void *data)
|
||||
else
|
||||
jwidget_enable(slider_frame);
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool palette_editor_change_hook(JWidget widget, void *data)
|
||||
@ -537,7 +537,7 @@ static bool palette_editor_change_hook(JWidget widget, void *data)
|
||||
jslider_set_value(slider_H, 255.0 * h / 360.0);
|
||||
jslider_set_value(slider_V, 255.0 * v);
|
||||
jslider_set_value(slider_S, 255.0 * s);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void set_new_palette(Palette *palette)
|
||||
@ -547,7 +547,7 @@ static void set_new_palette(Palette *palette)
|
||||
palette);
|
||||
|
||||
/* set the palette calling the hooks */
|
||||
set_current_palette(palette, FALSE);
|
||||
set_current_palette(palette, false);
|
||||
|
||||
/* redraw the entire screen */
|
||||
jmanager_refresh_screen();
|
||||
|
@ -73,7 +73,7 @@ void PlayAnimationCommand::execute(Context* context)
|
||||
{
|
||||
CurrentSpriteWriter sprite(context);
|
||||
int old_frame, msecs;
|
||||
bool done = FALSE;
|
||||
bool done = false;
|
||||
bool onionskin = get_onionskin();
|
||||
Palette *oldpal, *newpal;
|
||||
PALETTE rgbpal;
|
||||
@ -82,7 +82,7 @@ void PlayAnimationCommand::execute(Context* context)
|
||||
return;
|
||||
|
||||
/* desactivate the onion-skin */
|
||||
set_onionskin(FALSE);
|
||||
set_onionskin(false);
|
||||
|
||||
jmouse_hide();
|
||||
|
||||
@ -115,7 +115,7 @@ void PlayAnimationCommand::execute(Context* context)
|
||||
poll_mouse();
|
||||
poll_keyboard();
|
||||
if (keypressed() || mouse_b)
|
||||
done = TRUE;
|
||||
done = true;
|
||||
gui_feedback();
|
||||
} while (!done && (speed_timer <= 0));
|
||||
|
||||
@ -138,7 +138,7 @@ void PlayAnimationCommand::execute(Context* context)
|
||||
|
||||
/* refresh all */
|
||||
newpal = sprite_get_palette(sprite, sprite->frame);
|
||||
set_current_palette(newpal, TRUE);
|
||||
set_current_palette(newpal, true);
|
||||
jmanager_refresh_screen();
|
||||
gui_feedback();
|
||||
|
||||
|
@ -136,7 +136,7 @@ void PreviewCommand::preview_sprite(Context* context, int flags)
|
||||
w = sprite->w << editor->editor_get_zoom();
|
||||
h = sprite->h << editor->editor_get_zoom();
|
||||
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
do {
|
||||
/* update scroll */
|
||||
if (jmouse_poll()) {
|
||||
@ -145,11 +145,11 @@ void PreviewCommand::preview_sprite(Context* context, int flags)
|
||||
jmouse_set_position(JI_SCREEN_W/2, JI_SCREEN_H/2);
|
||||
jmouse_poll();
|
||||
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
if (redraw) {
|
||||
redraw = FALSE;
|
||||
redraw = false;
|
||||
|
||||
/* fit on screen */
|
||||
if (flags & PREVIEW_FIT_ON_SCREEN) {
|
||||
@ -257,7 +257,7 @@ void PreviewCommand::preview_sprite(Context* context, int flags)
|
||||
context->execute_command(command);
|
||||
|
||||
/* redraw */
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
|
||||
/* render the sprite in the bitmap */
|
||||
image = render_sprite(sprite, 0, 0, sprite->w, sprite->h,
|
||||
@ -276,13 +276,13 @@ void PreviewCommand::preview_sprite(Context* context, int flags)
|
||||
else if ((readkey_value>>8) == KEY_PLUS_PAD) {
|
||||
if (index_bg_color < 255) {
|
||||
bg_color = palette_color[++index_bg_color];
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
}
|
||||
else if ((readkey_value>>8) == KEY_MINUS_PAD) {
|
||||
if (index_bg_color > 0) {
|
||||
bg_color = palette_color[--index_bg_color];
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -59,7 +59,7 @@ void ScreenShotCommand::execute(Context* context)
|
||||
old_flag = freeze_mouse_flag;
|
||||
|
||||
/* freeze the mouse obligatory */
|
||||
freeze_mouse_flag = TRUE;
|
||||
freeze_mouse_flag = true;
|
||||
|
||||
/* get the active palette color */
|
||||
get_palette(rgbpal);
|
||||
@ -86,7 +86,7 @@ void ScreenShotCommand::execute(Context* context)
|
||||
|
||||
Palette *pal = palette_new(0, MAX_PALETTE_COLORS);
|
||||
palette_from_allegro(pal, rgbpal);
|
||||
sprite_set_palette(sprite, pal, TRUE);
|
||||
sprite_set_palette(sprite, pal, true);
|
||||
palette_free(pal);
|
||||
|
||||
/* convert Allegro "BITMAP" to ASE "Image" */
|
||||
|
@ -115,10 +115,10 @@ void ColorCurveCommand::execute(Context* context)
|
||||
set_color_curve(the_curve);
|
||||
|
||||
curve_editor = curve_editor_new(the_curve, 0, 0, 255, 255);
|
||||
target_button = target_button_new(sprite->imgtype, TRUE);
|
||||
target_button = target_button_new(sprite->imgtype, true);
|
||||
target_button_set_target(target_button, effect.target);
|
||||
|
||||
if (get_config_bool("ColorCurve", "Preview", TRUE))
|
||||
if (get_config_bool("ColorCurve", "Preview", true))
|
||||
jwidget_select(check_preview);
|
||||
|
||||
jview_attach(view_curve, curve_editor);
|
||||
@ -175,7 +175,7 @@ static bool window_msg_proc(JWidget widget, JMessage msg)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void make_preview()
|
||||
|
@ -118,10 +118,10 @@ void ConvolutionMatrixCommand::execute(Context* context)
|
||||
list_convmatr = jlistbox_new();
|
||||
listbox_fill_convmatg(list_convmatr);
|
||||
|
||||
target_button = target_button_new(sprite->imgtype, TRUE);
|
||||
target_button = target_button_new(sprite->imgtype, true);
|
||||
target_button_set_target(target_button, effect.target);
|
||||
|
||||
if (get_config_bool("ConvolutionMatrix", "Preview", TRUE))
|
||||
if (get_config_bool("ConvolutionMatrix", "Preview", true))
|
||||
jwidget_select(check_preview);
|
||||
|
||||
if (get_tiled_mode() != TILED_NONE)
|
||||
@ -226,7 +226,7 @@ static bool reload_select_hook(JWidget widget, void *data)
|
||||
listbox_select_current_convmatr(listbox);
|
||||
jview_update(jwidget_get_view(listbox));
|
||||
|
||||
return TRUE; /* do not close */
|
||||
return true; /* do not close */
|
||||
}
|
||||
|
||||
static bool generate_select_hook(JWidget widget, void *data)
|
||||
@ -284,7 +284,7 @@ static bool generate_select_hook(JWidget widget, void *data)
|
||||
curve_free(curve_x);
|
||||
curve_free(curve_y);
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool list_change_hook(JWidget widget, void *data)
|
||||
@ -301,7 +301,7 @@ static bool list_change_hook(JWidget widget, void *data)
|
||||
effect_set_target(preview_get_effect(preview), new_target);
|
||||
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool target_change_hook(JWidget widget, void *data)
|
||||
@ -309,7 +309,7 @@ static bool target_change_hook(JWidget widget, void *data)
|
||||
effect_set_target(preview_get_effect(preview),
|
||||
target_button_get_target(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool preview_change_hook(JWidget widget, void *data)
|
||||
@ -317,14 +317,14 @@ static bool preview_change_hook(JWidget widget, void *data)
|
||||
set_config_bool("ConvolutionMatrix", "Preview",
|
||||
jwidget_is_selected(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool tiled_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_tiled_mode(jwidget_is_selected(widget) ? TILED_BOTH: TILED_NONE);
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void make_preview()
|
||||
|
@ -102,13 +102,13 @@ void DespeckleCommand::execute(Context* context)
|
||||
|
||||
preview = preview_new(&effect);
|
||||
|
||||
target_button = target_button_new(sprite->imgtype, TRUE);
|
||||
target_button = target_button_new(sprite->imgtype, true);
|
||||
target_button_set_target(target_button, effect.target);
|
||||
|
||||
entry_width->setTextf("%d", get_config_int("Median", "Width", 3));
|
||||
entry_height->setTextf("%d", get_config_int("Median", "Height", 3));
|
||||
|
||||
if (get_config_bool("Median", "Preview", TRUE))
|
||||
if (get_config_bool("Median", "Preview", true))
|
||||
jwidget_select(check_preview);
|
||||
|
||||
if (get_tiled_mode() != TILED_NONE)
|
||||
@ -150,14 +150,14 @@ static bool width_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_config_int("Median", "Width", widget->getTextInt());
|
||||
make_preview();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool height_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_config_int("Median", "Height", widget->getTextInt());
|
||||
make_preview();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool target_change_hook(JWidget widget, void *data)
|
||||
@ -165,7 +165,7 @@ static bool target_change_hook(JWidget widget, void *data)
|
||||
effect_set_target(preview_get_effect(preview),
|
||||
target_button_get_target(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool preview_change_hook(JWidget widget, void *data)
|
||||
@ -179,7 +179,7 @@ static bool tiled_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_tiled_mode(jwidget_is_selected(widget) ? TILED_BOTH: TILED_NONE);
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void make_preview()
|
||||
|
@ -93,10 +93,10 @@ void InvertColorCommand::execute(Context* context)
|
||||
TARGET_BLUE_CHANNEL);
|
||||
|
||||
preview = preview_new(&effect);
|
||||
target_button = target_button_new(sprite->imgtype, TRUE);
|
||||
target_button = target_button_new(sprite->imgtype, true);
|
||||
target_button_set_target(target_button, effect.target);
|
||||
|
||||
if (get_config_bool("InvertColor", "Preview", TRUE))
|
||||
if (get_config_bool("InvertColor", "Preview", true))
|
||||
jwidget_select(check_preview);
|
||||
|
||||
jwidget_add_child(box_target, target_button);
|
||||
@ -133,14 +133,14 @@ static bool target_change_hook(JWidget widget, void *data)
|
||||
effect_set_target(preview_get_effect(preview),
|
||||
target_button_get_target(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool preview_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_config_bool("InvertColor", "Preview", jwidget_is_selected(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void make_preview()
|
||||
|
@ -111,12 +111,12 @@ void ReplaceColorCommand::execute(Context* context)
|
||||
colorbar_get_bg_color(app_get_colorbar())),
|
||||
sprite->imgtype);
|
||||
|
||||
target_button = target_button_new(sprite->imgtype, FALSE);
|
||||
target_button = target_button_new(sprite->imgtype, false);
|
||||
target_button_set_target(target_button, effect.target);
|
||||
|
||||
jslider_set_value(slider_fuzziness,
|
||||
get_config_int("ReplaceColor", "Fuzziness", 0));
|
||||
if (get_config_bool("ReplaceColor", "Preview", TRUE))
|
||||
if (get_config_bool("ReplaceColor", "Preview", true))
|
||||
jwidget_select(check_preview);
|
||||
|
||||
jwidget_add_child(color_buttons_box, button_color1);
|
||||
@ -161,7 +161,7 @@ static bool color_change_hook(JWidget widget, void *data)
|
||||
set_config_color("ReplaceColor", buf, colorbutton_get_color(widget));
|
||||
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool target_change_hook(JWidget widget, void *data)
|
||||
@ -169,21 +169,21 @@ static bool target_change_hook(JWidget widget, void *data)
|
||||
effect_set_target(preview_get_effect(preview),
|
||||
target_button_get_target(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool slider_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_config_int("ReplaceColor", "Fuzziness", jslider_get_value(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool preview_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_config_bool("ReplaceColor", "Preview", jwidget_is_selected(widget));
|
||||
make_preview();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void make_preview()
|
||||
|
@ -100,7 +100,7 @@ static void effect_bg(void *_data)
|
||||
|
||||
/* mark the work as 'done' */
|
||||
jmutex_lock(data->mutex);
|
||||
data->done = TRUE;
|
||||
data->done = true;
|
||||
jmutex_unlock(data->mutex);
|
||||
}
|
||||
|
||||
@ -158,8 +158,8 @@ void effect_apply_to_target_with_progressbar(Effect* effect)
|
||||
data->mutex = jmutex_new();
|
||||
data->effect = effect;
|
||||
data->pos = 0.0;
|
||||
data->done = FALSE;
|
||||
data->cancelled = FALSE;
|
||||
data->done = false;
|
||||
data->cancelled = false;
|
||||
data->progress = progress_new(app_get_statusbar());
|
||||
data->thread = jthread_new(effect_bg, data);
|
||||
data->alert_window = jalert_new(PACKAGE
|
||||
@ -174,7 +174,7 @@ void effect_apply_to_target_with_progressbar(Effect* effect)
|
||||
jmutex_lock(data->mutex);
|
||||
if (!data->done) {
|
||||
remove_gui_monitor(data->monitor);
|
||||
data->cancelled = TRUE;
|
||||
data->cancelled = true;
|
||||
}
|
||||
jmutex_unlock(data->mutex);
|
||||
|
||||
|
@ -36,7 +36,7 @@ static Widget* wid_textbox = NULL;
|
||||
static Widget* wid_cancel = NULL;
|
||||
static int console_counter = 0;
|
||||
static bool console_locked;
|
||||
static bool want_close_flag = FALSE;
|
||||
static bool want_close_flag = false;
|
||||
|
||||
Console::Console()
|
||||
{
|
||||
@ -49,7 +49,7 @@ Console::Console()
|
||||
return;
|
||||
else {
|
||||
Frame* window = new Frame(false, _("Errors Console"));
|
||||
Widget* grid = jgrid_new(1, FALSE);
|
||||
Widget* grid = jgrid_new(1, false);
|
||||
Widget* view = jview_new();
|
||||
Widget* textbox = jtextbox_new(NULL, JI_WORDWRAP);
|
||||
Widget* button = jbutton_new(_("&Cancel"));
|
||||
@ -66,18 +66,18 @@ Console::Console()
|
||||
jwidget_add_child(window, grid);
|
||||
|
||||
jwidget_hide(view);
|
||||
jwidget_magnetic(button, TRUE);
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_magnetic(button, true);
|
||||
jwidget_expansive(view, true);
|
||||
|
||||
/* force foreground mode */
|
||||
/* ji_find_widget(window)->in_foreground = TRUE; */
|
||||
/* ji_find_widget(window)->in_foreground = true; */
|
||||
|
||||
wid_console = window;
|
||||
wid_view = view;
|
||||
wid_textbox = textbox;
|
||||
wid_cancel = button;
|
||||
console_locked = FALSE;
|
||||
want_close_flag = FALSE;
|
||||
console_locked = false;
|
||||
want_close_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ Console::~Console()
|
||||
|
||||
delete wid_console; // window
|
||||
wid_console = NULL;
|
||||
want_close_flag = FALSE;
|
||||
want_close_flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ void Console::printf(const char *format, ...)
|
||||
/* update the textbox */
|
||||
if (!console_locked) {
|
||||
JRect rect = jrect_new(0, 0, JI_SCREEN_W*9/10, JI_SCREEN_H*6/10);
|
||||
console_locked = TRUE;
|
||||
console_locked = true;
|
||||
|
||||
jwidget_show(wid_view);
|
||||
|
||||
|
@ -208,7 +208,7 @@ int color_get_red(int imgtype, color_t color)
|
||||
|
||||
}
|
||||
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ int color_get_green(int imgtype, color_t color)
|
||||
|
||||
}
|
||||
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ int color_get_blue(int imgtype, color_t color)
|
||||
|
||||
}
|
||||
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ int color_get_hue(int imgtype, color_t color)
|
||||
|
||||
}
|
||||
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ int color_get_saturation(int imgtype, color_t color)
|
||||
|
||||
}
|
||||
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -392,7 +392,7 @@ int color_get_value(int imgtype, color_t color)
|
||||
|
||||
}
|
||||
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -405,12 +405,12 @@ int color_get_index(int imgtype, color_t color)
|
||||
|
||||
case COLOR_TYPE_RGB:
|
||||
PRINTF("Getting `index' from a RGB color\n"); /* TODO */
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
case COLOR_TYPE_HSV:
|
||||
PRINTF("Getting `index' from a HSV color\n"); /* TODO */
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
case COLOR_TYPE_GRAY:
|
||||
@ -421,7 +421,7 @@ int color_get_index(int imgtype, color_t color)
|
||||
|
||||
}
|
||||
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -751,7 +751,7 @@ void color_to_formalstring(int imgtype, color_t color,
|
||||
}
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -812,7 +812,7 @@ void color_to_formalstring(int imgtype, color_t color,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ static CONFIG *system_config = NULL;
|
||||
|
||||
static CONFIG_HOOK *config_hook = NULL;
|
||||
|
||||
static int config_installed = FALSE;
|
||||
static int config_installed = false;
|
||||
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ static void flush_config(CONFIG *cfg)
|
||||
}
|
||||
|
||||
pack_fclose(f);
|
||||
cfg->dirty = FALSE;
|
||||
cfg->dirty = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -208,7 +208,7 @@ static void config_cleanup()
|
||||
}
|
||||
|
||||
_remove_exit_func(config_cleanup);
|
||||
config_installed = FALSE;
|
||||
config_installed = false;
|
||||
}
|
||||
|
||||
|
||||
@ -224,7 +224,7 @@ static void init_config(int loaddata)
|
||||
|
||||
if (!config_installed) {
|
||||
_add_exit_func(config_cleanup);
|
||||
config_installed = TRUE;
|
||||
config_installed = true;
|
||||
}
|
||||
|
||||
if ((loaddata) && (!config[0])) {
|
||||
@ -244,7 +244,7 @@ static void init_config(int loaddata)
|
||||
if (system_config) {
|
||||
system_config->head = NULL;
|
||||
system_config->filename = NULL;
|
||||
system_config->dirty = FALSE;
|
||||
system_config->dirty = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -378,7 +378,7 @@ static void set_config(CONFIG **config, AL_CONST char *data, int length, AL_CONS
|
||||
char *name, *val;
|
||||
int ret, pos;
|
||||
|
||||
init_config(FALSE);
|
||||
init_config(false);
|
||||
|
||||
if (*config) {
|
||||
destroy_config(*config);
|
||||
@ -392,7 +392,7 @@ static void set_config(CONFIG **config, AL_CONST char *data, int length, AL_CONS
|
||||
}
|
||||
|
||||
(*config)->head = NULL;
|
||||
(*config)->dirty = FALSE;
|
||||
(*config)->dirty = false;
|
||||
|
||||
if (filename) {
|
||||
(*config)->filename = ustrdup(filename);
|
||||
@ -638,7 +638,7 @@ void hook_config_section(AL_CONST char *section, int (*intgetter)(AL_CONST char
|
||||
CONFIG_HOOK *hook, **prev;
|
||||
char section_name[256];
|
||||
|
||||
init_config(FALSE);
|
||||
init_config(false);
|
||||
|
||||
prettify_section_name(section, section_name, sizeof(section_name));
|
||||
|
||||
@ -700,12 +700,12 @@ int config_is_hooked(AL_CONST char *section)
|
||||
|
||||
while (hook) {
|
||||
if (ustricmp(section_name, hook->section) == 0)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
hook = hook->next;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -725,9 +725,9 @@ static CONFIG_ENTRY *find_config_string(CONFIG *config, AL_CONST char *section,
|
||||
*prev = NULL;
|
||||
|
||||
if (section && ugetc(section))
|
||||
in_section = FALSE;
|
||||
in_section = false;
|
||||
else
|
||||
in_section = TRUE;
|
||||
in_section = true;
|
||||
|
||||
while (p) {
|
||||
if (p->name) {
|
||||
@ -763,7 +763,7 @@ AL_CONST char *get_config_string(AL_CONST char *section, AL_CONST char *name, AL
|
||||
CONFIG_HOOK *hook;
|
||||
CONFIG_ENTRY *p;
|
||||
|
||||
init_config(TRUE);
|
||||
init_config(true);
|
||||
|
||||
prettify_section_name(section, section_name, sizeof(section_name));
|
||||
|
||||
@ -1027,7 +1027,7 @@ void set_config_string(AL_CONST char *section, AL_CONST char *name, AL_CONST cha
|
||||
CONFIG_ENTRY *p, *prev;
|
||||
char section_name[256];
|
||||
|
||||
init_config(TRUE);
|
||||
init_config(true);
|
||||
|
||||
prettify_section_name(section, section_name, sizeof(section_name));
|
||||
|
||||
@ -1113,7 +1113,7 @@ void set_config_string(AL_CONST char *section, AL_CONST char *name, AL_CONST cha
|
||||
}
|
||||
}
|
||||
|
||||
the_config->dirty = TRUE;
|
||||
the_config->dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1236,7 +1236,7 @@ void reload_config_texts(AL_CONST char *new_language)
|
||||
if (config_language ) {
|
||||
config_language ->head = NULL;
|
||||
config_language ->filename = NULL;
|
||||
config_language ->dirty = FALSE;
|
||||
config_language ->dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1260,7 +1260,7 @@ AL_CONST char *get_config_text(AL_CONST char *msg)
|
||||
int c, pos, size;
|
||||
ASSERT(msg);
|
||||
|
||||
init_config(TRUE);
|
||||
init_config(true);
|
||||
|
||||
/* allocate memory and convert message to current encoding format */
|
||||
if (need_uconvert(msg, U_ASCII, U_CURRENT)) {
|
||||
|
@ -324,13 +324,13 @@ FileItem* get_fileitem_from_path(const jstring& path)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fileitem = get_fileitem_by_fullpidl(fullpidl, TRUE);
|
||||
fileitem = get_fileitem_by_fullpidl(fullpidl, true);
|
||||
free_pidl(fullpidl);
|
||||
}
|
||||
#else
|
||||
{
|
||||
jstring buf = remove_backslash_if_needed(path);
|
||||
fileitem = get_fileitem_by_path(buf, TRUE);
|
||||
fileitem = get_fileitem_by_path(buf, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -461,7 +461,7 @@ const FileItemList& fileitem_get_children(FileItem* fileitem)
|
||||
LPITEMIDLIST fullpidl = concat_pidl(fileitem->fullpidl,
|
||||
itempidl[c]);
|
||||
|
||||
child = get_fileitem_by_fullpidl(fullpidl, FALSE);
|
||||
child = get_fileitem_by_fullpidl(fullpidl, false);
|
||||
if (!child) {
|
||||
child = new FileItem(fileitem);
|
||||
|
||||
@ -927,7 +927,7 @@ static FileItem* get_fileitem_by_fullpidl(LPITEMIDLIST fullpidl, bool create_if_
|
||||
remove_last_pidl(parent_fullpidl);
|
||||
|
||||
fileitem->pidl = get_last_pidl(fileitem->fullpidl);
|
||||
fileitem->parent = get_fileitem_by_fullpidl(parent_fullpidl, TRUE);
|
||||
fileitem->parent = get_fileitem_by_fullpidl(parent_fullpidl, true);
|
||||
|
||||
free_pidl(parent_fullpidl);
|
||||
}
|
||||
@ -990,7 +990,7 @@ static FileItem* get_fileitem_by_path(const jstring& path, bool create_if_not)
|
||||
// get the parent
|
||||
{
|
||||
jstring parent_path = remove_backslash_if_needed(path.filepath() / "");
|
||||
fileitem->parent = get_fileitem_by_path(parent_path, TRUE);
|
||||
fileitem->parent = get_fileitem_by_path(parent_path, true);
|
||||
}
|
||||
|
||||
put_fileitem(fileitem);
|
||||
@ -1013,7 +1013,7 @@ static void for_each_child_callback(const char *filename, int attrib, int param)
|
||||
ustrcmp(filename_without_path, "..") == 0))
|
||||
return;
|
||||
|
||||
child = get_fileitem_by_path(filename, FALSE);
|
||||
child = get_fileitem_by_path(filename, false);
|
||||
if (!child) {
|
||||
assert(fileitem != NULL);
|
||||
child = new FileItem(fileitem);
|
||||
|
@ -210,10 +210,10 @@ static JWidget anieditor_new(const Sprite* sprite)
|
||||
anieditor->separator_w = 1;
|
||||
anieditor->hot_part = PART_NOTHING;
|
||||
anieditor->clk_part = PART_NOTHING;
|
||||
anieditor->space_pressed = FALSE;
|
||||
anieditor->space_pressed = false;
|
||||
|
||||
jwidget_add_hook(widget, anieditor_type(), anieditor_msg_proc, anieditor);
|
||||
jwidget_focusrest(widget, TRUE);
|
||||
jwidget_focusrest(widget, true);
|
||||
|
||||
anieditor_regenerate_layers(widget);
|
||||
|
||||
@ -250,7 +250,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
anyway */
|
||||
msg->reqsize.w = 32;
|
||||
msg->reqsize.h = 32;
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
/* case JM_CLOSE: */
|
||||
/* break; */
|
||||
@ -284,25 +284,25 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
anieditor_draw_layer_padding(widget);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_TIMER:
|
||||
break;
|
||||
|
||||
case JM_MOUSEENTER:
|
||||
if (key[KEY_SPACE]) anieditor->space_pressed = TRUE;
|
||||
if (key[KEY_SPACE]) anieditor->space_pressed = true;
|
||||
break;
|
||||
|
||||
case JM_MOUSELEAVE:
|
||||
if (anieditor->space_pressed) anieditor->space_pressed = FALSE;
|
||||
if (anieditor->space_pressed) anieditor->space_pressed = false;
|
||||
break;
|
||||
|
||||
case JM_BUTTONPRESSED:
|
||||
if (msg->mouse.middle || anieditor->space_pressed) {
|
||||
jwidget_hard_capture_mouse(widget);
|
||||
anieditor->state = STATE_SCROLLING;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* clicked-part = hot-part */
|
||||
@ -421,10 +421,10 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
if (anieditor->state == STATE_SCROLLING) {
|
||||
anieditor_set_scroll(widget,
|
||||
anieditor->scroll_x+jmouse_x(1)-jmouse_x(0),
|
||||
anieditor->scroll_y+jmouse_y(1)-jmouse_y(0), TRUE);
|
||||
anieditor->scroll_y+jmouse_y(1)-jmouse_y(0), true);
|
||||
|
||||
jmouse_control_infinite_scroll(widget->rc);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
/* if the mouse pressed the mouse's button in the separator, we
|
||||
shouldn't change the hot (so the separator can be tracked to
|
||||
@ -433,7 +433,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
hot_part = anieditor->clk_part;
|
||||
anieditor->separator_x = mx;
|
||||
jwidget_dirty(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -498,7 +498,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
/* set the new 'hot' thing */
|
||||
anieditor_hot_this(widget, hot_part, hot_layer, hot_frame);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_BUTTONRELEASED:
|
||||
@ -507,7 +507,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
if (anieditor->state == STATE_SCROLLING) {
|
||||
anieditor->state = STATE_STANDBY;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (anieditor->hot_part) {
|
||||
@ -682,7 +682,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
/* restore the cursor */
|
||||
anieditor->state = STATE_STANDBY;
|
||||
anieditor_setcursor(widget, msg->mouse.x, msg->mouse.y);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -693,7 +693,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
if ((command && (strcmp(command->short_name(), CommandId::film_editor) == 0)) ||
|
||||
(msg->key.scancode == KEY_ESC)) {
|
||||
jwidget_close_window(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* undo */
|
||||
@ -708,7 +708,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
anieditor_show_current_cel(widget);
|
||||
jwidget_dirty(widget);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* redo */
|
||||
@ -723,7 +723,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
anieditor_show_current_cel(widget);
|
||||
jwidget_dirty(widget);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* new_frame, remove_frame, new_cel, remove_cel */
|
||||
@ -742,7 +742,7 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
anieditor_show_current_cel(widget);
|
||||
jwidget_dirty(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strcmp(command->short_name(), CommandId::new_layer) == 0 ||
|
||||
@ -753,15 +753,15 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
anieditor_regenerate_layers(widget);
|
||||
anieditor_show_current_cel(widget);
|
||||
jwidget_dirty(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
switch (msg->key.scancode) {
|
||||
case KEY_SPACE:
|
||||
anieditor->space_pressed = TRUE;
|
||||
anieditor->space_pressed = true;
|
||||
anieditor_setcursor(widget, jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -775,9 +775,9 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
/* we have to clear all the KEY_SPACE in buffer */
|
||||
clear_keybuf();
|
||||
|
||||
anieditor->space_pressed = FALSE;
|
||||
anieditor->space_pressed = false;
|
||||
anieditor_setcursor(widget, jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -800,17 +800,17 @@ static bool anieditor_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
anieditor_set_scroll(widget,
|
||||
anieditor->scroll_x+dx,
|
||||
anieditor->scroll_y+dy, TRUE);
|
||||
anieditor->scroll_y+dy, true);
|
||||
break;
|
||||
}
|
||||
|
||||
case JM_SETCURSOR:
|
||||
anieditor_setcursor(widget, msg->mouse.x, msg->mouse.y);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void anieditor_setcursor(JWidget widget, int x, int y)
|
||||
@ -890,7 +890,7 @@ static void anieditor_draw_header(JWidget widget, JRect clip)
|
||||
/* draw the header for the layers */
|
||||
anieditor_draw_header_part(widget, clip, x1, y1, x2, y2,
|
||||
/* is_hot, is_clk, */
|
||||
FALSE, FALSE,
|
||||
false, false,
|
||||
"Frames >>", 1,
|
||||
"Layers", -1);
|
||||
}
|
||||
@ -982,7 +982,7 @@ static void anieditor_draw_header_part(JWidget widget, JRect clip, int x1, int y
|
||||
|
||||
jdraw_text(widget->getFont(), line1,
|
||||
x, y1+3,
|
||||
fg, face, TRUE);
|
||||
fg, face, true);
|
||||
}
|
||||
|
||||
if (line2 != NULL) {
|
||||
@ -995,7 +995,7 @@ static void anieditor_draw_header_part(JWidget widget, JRect clip, int x1, int y
|
||||
|
||||
jdraw_text(widget->getFont(), line2,
|
||||
x, y1+3+ji_font_get_size(widget->getFont())+3,
|
||||
fg, face, TRUE);
|
||||
fg, face, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1101,7 +1101,7 @@ static void anieditor_draw_layer(JWidget widget, JRect clip, int layer_index)
|
||||
/* draw the layer's name */
|
||||
jdraw_text(widget->getFont(), layer->get_name().c_str(),
|
||||
u, y_mid - ji_font_get_size(widget->getFont())/2,
|
||||
fg, bg, TRUE);
|
||||
fg, bg, true);
|
||||
|
||||
/* the background should be underlined */
|
||||
if (layer->is_background()) {
|
||||
@ -1255,17 +1255,17 @@ static bool anieditor_draw_part(JWidget widget, int part, int layer, int frame)
|
||||
switch (part) {
|
||||
case PART_NOTHING:
|
||||
/* do nothing */
|
||||
return TRUE;
|
||||
return true;
|
||||
case PART_SEPARATOR:
|
||||
anieditor_draw_separator(widget, widget->rc);
|
||||
return TRUE;
|
||||
return true;
|
||||
case PART_HEADER_LAYER:
|
||||
anieditor_draw_header(widget, widget->rc);
|
||||
return TRUE;
|
||||
return true;
|
||||
case PART_HEADER_FRAME:
|
||||
if (frame >= 0 && frame < anieditor->sprite->frames) {
|
||||
anieditor_draw_header_frame(widget, widget->rc, frame);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case PART_LAYER:
|
||||
@ -1273,19 +1273,19 @@ static bool anieditor_draw_part(JWidget widget, int part, int layer, int frame)
|
||||
case PART_LAYER_LOCK_ICON:
|
||||
if (layer >= 0 && layer < anieditor->nlayers) {
|
||||
anieditor_draw_layer(widget, widget->rc, layer);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case PART_CEL:
|
||||
if (layer >= 0 && layer < anieditor->nlayers &&
|
||||
frame >= 0 && frame < anieditor->sprite->frames) {
|
||||
anieditor_draw_cel(widget, widget->rc, layer, frame);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void anieditor_regenerate_layers(JWidget widget)
|
||||
@ -1351,7 +1351,7 @@ static void anieditor_center_cel(JWidget widget, int layer, int frame)
|
||||
int scroll_x = widget->rc->x1 + anieditor->separator_x + anieditor->separator_w + FRMSIZE*frame - target_x;
|
||||
int scroll_y = widget->rc->y1 + HDRSIZE + LAYSIZE*layer - target_y;
|
||||
|
||||
anieditor_set_scroll(widget, scroll_x, scroll_y, FALSE);
|
||||
anieditor_set_scroll(widget, scroll_x, scroll_y, false);
|
||||
}
|
||||
|
||||
static void anieditor_show_cel(JWidget widget, int layer, int frame)
|
||||
@ -1384,7 +1384,7 @@ static void anieditor_show_cel(JWidget widget, int layer, int frame)
|
||||
|
||||
if (scroll_x != anieditor->scroll_x ||
|
||||
scroll_y != anieditor->scroll_y)
|
||||
anieditor_set_scroll(widget, scroll_x, scroll_y, TRUE);
|
||||
anieditor_set_scroll(widget, scroll_x, scroll_y, true);
|
||||
}
|
||||
|
||||
static void anieditor_show_current_cel(JWidget widget)
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
/* Variables used only to maintain the history of navigation. */
|
||||
static JLink navigation_position = NULL; /* current position in the navigation history */
|
||||
static JList navigation_history = NULL; /* set of FileItems navigated */
|
||||
static bool navigation_locked = FALSE; /* if TRUE the navigation_history isn't
|
||||
static bool navigation_locked = false; /* if true the navigation_history isn't
|
||||
modified if the current folder
|
||||
changes (used when the back/forward
|
||||
buttons are pushed) */
|
||||
@ -155,9 +155,9 @@ jstring ase_file_selector(const jstring& message,
|
||||
filetype = jwidget_find_name(window, "filetype");
|
||||
filename_entry = jwidget_find_name(window, "filename");
|
||||
|
||||
jwidget_focusrest(goback, FALSE);
|
||||
jwidget_focusrest(goforward, FALSE);
|
||||
jwidget_focusrest(goup, FALSE);
|
||||
jwidget_focusrest(goback, false);
|
||||
jwidget_focusrest(goforward, false);
|
||||
jwidget_focusrest(goup, false);
|
||||
|
||||
add_gfxicon_to_button(goback, GFX_ARROW_LEFT, JI_CENTER | JI_MIDDLE);
|
||||
add_gfxicon_to_button(goforward, GFX_ARROW_RIGHT, JI_CENTER | JI_MIDDLE);
|
||||
@ -178,7 +178,7 @@ jstring ase_file_selector(const jstring& message,
|
||||
fileview->setName("fileview");
|
||||
|
||||
jview_attach(view, fileview);
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
|
||||
jwidget_add_child(box, view);
|
||||
|
||||
@ -500,10 +500,10 @@ static void goback_command(JWidget widget)
|
||||
if (navigation_position->prev != navigation_history->end) {
|
||||
navigation_position = navigation_position->prev;
|
||||
|
||||
navigation_locked = TRUE;
|
||||
navigation_locked = true;
|
||||
fileview_set_current_folder(fileview,
|
||||
reinterpret_cast<FileItem*>(navigation_position->data));
|
||||
navigation_locked = FALSE;
|
||||
navigation_locked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -519,10 +519,10 @@ static void goforward_command(JWidget widget)
|
||||
if (navigation_position->next != navigation_history->end) {
|
||||
navigation_position = navigation_position->next;
|
||||
|
||||
navigation_locked = TRUE;
|
||||
navigation_locked = true;
|
||||
fileview_set_current_folder(fileview,
|
||||
reinterpret_cast<FileItem*>(navigation_position->data));
|
||||
navigation_locked = FALSE;
|
||||
navigation_locked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -572,7 +572,7 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* hook for the 'location' combo-box */
|
||||
@ -601,7 +601,7 @@ static bool location_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* hook for the 'filetype' combo-box */
|
||||
@ -631,7 +631,7 @@ static bool filetype_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool filename_msg_proc(JWidget widget, JMessage msg)
|
||||
@ -640,13 +640,13 @@ static bool filename_msg_proc(JWidget widget, JMessage msg)
|
||||
// check if all keys are released
|
||||
for (int c=0; c<KEY_MAX; ++c) {
|
||||
if (key[c])
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// string to be autocompleted
|
||||
jstring left_part = widget->getText();
|
||||
if (left_part.empty())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// first we'll need the fileview widget
|
||||
Widget* fileview = widget->findSibling("fileview");
|
||||
@ -674,10 +674,10 @@ static bool filename_msg_proc(JWidget widget, JMessage msg)
|
||||
child_name.size(),
|
||||
left_part.size());
|
||||
clear_keybuf();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ void dialogs_mask_color(Sprite* sprite)
|
||||
button_ok = jbutton_new(_("&OK"));
|
||||
button_cancel = jbutton_new(_("&Cancel"));
|
||||
|
||||
if (get_config_bool("MaskColor", "Preview", TRUE))
|
||||
if (get_config_bool("MaskColor", "Preview", true))
|
||||
jwidget_select(check_preview);
|
||||
|
||||
button_1->user_data[1] = sprite;
|
||||
@ -98,10 +98,10 @@ void dialogs_mask_color(Sprite* sprite)
|
||||
HOOK(slider_fuzziness, JI_SIGNAL_SLIDER_CHANGE, slider_change_hook, sprite);
|
||||
HOOK(check_preview, JI_SIGNAL_CHECK_CHANGE, preview_change_hook, sprite);
|
||||
|
||||
jwidget_magnetic(button_ok, TRUE);
|
||||
jwidget_expansive(button_color, TRUE);
|
||||
jwidget_expansive(slider_fuzziness, TRUE);
|
||||
jwidget_expansive(box2, TRUE);
|
||||
jwidget_magnetic(button_ok, true);
|
||||
jwidget_expansive(button_color, true);
|
||||
jwidget_expansive(slider_fuzziness, true);
|
||||
jwidget_expansive(box2, true);
|
||||
|
||||
jwidget_add_child(window, box1);
|
||||
jwidget_add_children(box1, box2, box3, check_preview, box4, NULL);
|
||||
@ -171,19 +171,19 @@ static void button_2_command(JWidget widget)
|
||||
static bool color_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
mask_preview((Sprite*)data);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool slider_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
mask_preview((Sprite*)data);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool preview_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
mask_preview((Sprite*)data);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static Mask *gen_mask(Sprite* sprite)
|
||||
|
@ -32,7 +32,7 @@ void dialogs_select_language(bool force)
|
||||
{
|
||||
/* only english */
|
||||
intl_set_lang("en");
|
||||
set_config_bool("Options", "SelectLanguage", FALSE);
|
||||
set_config_bool("Options", "SelectLanguage", false);
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
@ -73,17 +73,17 @@ void dialogs_options()
|
||||
|
||||
jslider_set_value(slider_x, x);
|
||||
jslider_set_value(slider_y, y);
|
||||
if (get_config_bool("Options", "LockMouse", TRUE))
|
||||
if (get_config_bool("Options", "LockMouse", true))
|
||||
jwidget_select(check_lockmouse);
|
||||
if (get_config_bool("Options", "MoveClick2", FALSE))
|
||||
if (get_config_bool("Options", "MoveClick2", false))
|
||||
jwidget_select(move_click2);
|
||||
if (get_config_bool("Options", "DrawClick2", FALSE))
|
||||
if (get_config_bool("Options", "DrawClick2", false))
|
||||
jwidget_select(draw_click2);
|
||||
|
||||
if (get_config_bool("Options", "MoveSmooth", TRUE))
|
||||
if (get_config_bool("Options", "MoveSmooth", true))
|
||||
jwidget_select(check_smooth);
|
||||
|
||||
if (get_config_bool("Options", "Dither", FALSE))
|
||||
if (get_config_bool("Options", "Dither", false))
|
||||
jwidget_select(check_dither);
|
||||
|
||||
undo_size_limit->setTextf("%d", get_config_int("Options", "UndoSizeLimit", 8));
|
||||
@ -102,7 +102,7 @@ void dialogs_options()
|
||||
set_config_bool("Options", "MoveClick2", jwidget_is_selected(move_click2));
|
||||
set_config_bool("Options", "DrawClick2", jwidget_is_selected(draw_click2));
|
||||
|
||||
if (get_config_bool("Options", "Dither", FALSE) != jwidget_is_selected(check_dither)) {
|
||||
if (get_config_bool("Options", "Dither", false) != jwidget_is_selected(check_dither)) {
|
||||
set_config_bool("Options", "Dither", jwidget_is_selected(check_dither));
|
||||
refresh_all_editors();
|
||||
}
|
||||
@ -143,7 +143,7 @@ static bool slider_mouse_hook(JWidget widget, void *data)
|
||||
set_config_int("Options", "MouseX", x);
|
||||
set_config_int("Options", "MouseY", y);
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
@ -124,7 +124,7 @@ static void my_play_fli(const char *filename, bool loop, bool fullscreen,
|
||||
|
||||
/* stretch routine doesn't support bitmaps of different color depths */
|
||||
if (bitmap_color_depth(ji_screen) != 8)
|
||||
fullscreen = FALSE;
|
||||
fullscreen = false;
|
||||
|
||||
w = fli_header.width;
|
||||
h = fli_header.height;
|
||||
@ -151,7 +151,7 @@ static void my_play_fli(const char *filename, bool loop, bool fullscreen,
|
||||
install_int_ex(speed_timer_callback, MSEC_TO_TIMER(fli_header.speed));
|
||||
|
||||
frpos = 0;
|
||||
done = FALSE;
|
||||
done = false;
|
||||
|
||||
while (!done) {
|
||||
/* read the frame */
|
||||
@ -180,7 +180,7 @@ static void my_play_fli(const char *filename, bool loop, bool fullscreen,
|
||||
|
||||
do {
|
||||
if ((*callback) ()) {
|
||||
done = TRUE;
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
} while (speed_timer <= 0);
|
||||
|
@ -58,9 +58,9 @@ void ji_show_repo_dlg(RepoDlg *repo_dlg)
|
||||
jbutton_add_command_data(repo_dlg->button_add, add_command, repo_dlg);
|
||||
jbutton_add_command_data(repo_dlg->button_delete, delete_command, repo_dlg);
|
||||
|
||||
jwidget_magnetic(repo_dlg->button_use, TRUE);
|
||||
jwidget_magnetic(repo_dlg->button_use, true);
|
||||
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
jview_attach(view, repo_dlg->listbox);
|
||||
jwidget_set_min_size(view, JI_SCREEN_W*25/100, JI_SCREEN_H*25/100);
|
||||
|
||||
@ -176,7 +176,7 @@ static bool repo_listbox_msg_proc(JWidget widget, JMessage msg)
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void use_command(JWidget widget, void *data)
|
||||
@ -195,7 +195,7 @@ static void add_command(JWidget widget, void *data)
|
||||
int ret, added;
|
||||
|
||||
if (repo_dlg->add_listitem) {
|
||||
added = FALSE;
|
||||
added = false;
|
||||
ret = (*repo_dlg->add_listitem)(repo_dlg, &added);
|
||||
|
||||
if (added) {
|
||||
@ -218,7 +218,7 @@ static void delete_command(JWidget widget, void *data)
|
||||
int ret, kill, index, last;
|
||||
|
||||
if (repo_dlg->delete_listitem) {
|
||||
kill = FALSE;
|
||||
kill = false;
|
||||
ret = (*repo_dlg->delete_listitem) (repo_dlg, &kill);
|
||||
|
||||
if (kill) {
|
||||
|
@ -42,7 +42,7 @@ typedef struct RepoDlg { /* a window to shows repositories
|
||||
jwidget_free(), it's called automatically */
|
||||
void (*free_listitem)(struct RepoDlg *repo_dlg);
|
||||
|
||||
/* return FALSE if to close the window, TRUE to continue (use the
|
||||
/* return false if to close the window, true to continue (use the
|
||||
"repo_dlg->listitem") */
|
||||
bool (*use_listitem)(struct RepoDlg *repo_dlg);
|
||||
bool (*add_listitem)(struct RepoDlg *repo_dlg, int *added);
|
||||
|
@ -61,7 +61,7 @@ void dialogs_tips(bool forced)
|
||||
Palette *old_pal;
|
||||
|
||||
/* don't show it? */
|
||||
if (!forced && !get_config_bool("Tips", "Show", TRUE))
|
||||
if (!forced && !get_config_bool("Tips", "Show", true))
|
||||
return;
|
||||
|
||||
/* next page */
|
||||
@ -103,13 +103,13 @@ void dialogs_tips(bool forced)
|
||||
|
||||
HOOK(check, JI_SIGNAL_CHECK_CHANGE, check_change_hook, 0);
|
||||
|
||||
if (get_config_bool("Tips", "Show", TRUE))
|
||||
if (get_config_bool("Tips", "Show", true))
|
||||
jwidget_select(check);
|
||||
|
||||
jview_attach(view, tips);
|
||||
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(box, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
jwidget_expansive(box, true);
|
||||
|
||||
jwidget_add_child(vbox, view);
|
||||
jwidget_add_child(hbox, button_close);
|
||||
@ -140,7 +140,7 @@ void dialogs_tips(bool forced)
|
||||
jwidget_free(window);
|
||||
|
||||
/* restore the palette */
|
||||
set_current_palette(old_pal, TRUE);
|
||||
set_current_palette(old_pal, true);
|
||||
palette_free(old_pal);
|
||||
|
||||
jmanager_refresh_screen();
|
||||
@ -155,7 +155,7 @@ static Widget* tips_new()
|
||||
Widget* widget = new Widget(tips_type());
|
||||
|
||||
jwidget_add_hook(widget, tips_type(), tips_msg_proc, NULL);
|
||||
jwidget_focusrest(widget, TRUE);
|
||||
jwidget_focusrest(widget, true);
|
||||
jwidget_noborders(widget);
|
||||
|
||||
return widget;
|
||||
@ -175,7 +175,7 @@ static bool tips_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
case JM_REQSIZE:
|
||||
tips_request_size(widget, &msg->reqsize.w, &msg->reqsize.h);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_WHEEL:
|
||||
{
|
||||
@ -193,7 +193,7 @@ static bool tips_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void tips_request_size(JWidget widget, int *w, int *h)
|
||||
@ -238,7 +238,7 @@ static bool tips_image_msg_proc(JWidget widget, JMessage msg)
|
||||
if (msg->type == JM_DESTROY)
|
||||
destroy_bitmap(reinterpret_cast<BITMAP*>(jwidget_get_data(widget, tips_image_type())));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static FILE *tips_open_file()
|
||||
@ -297,7 +297,7 @@ static void tips_load_page(JWidget widget)
|
||||
int use_page = get_config_int("Tips", "Page", 0);
|
||||
char buf[1024];
|
||||
int page = 0;
|
||||
int take = TRUE;
|
||||
int take = true;
|
||||
FILE *f;
|
||||
|
||||
/* destroy old page */
|
||||
@ -308,7 +308,7 @@ static void tips_load_page(JWidget widget)
|
||||
}
|
||||
|
||||
/* set default palette */
|
||||
set_current_palette(NULL, FALSE);
|
||||
set_current_palette(NULL, false);
|
||||
|
||||
f = tips_open_file();
|
||||
if (!f) {
|
||||
@ -349,7 +349,7 @@ static JWidget tips_load_box(FILE *f, char *buf, int sizeof_buf, int *take)
|
||||
break;
|
||||
}
|
||||
else
|
||||
*take = TRUE;
|
||||
*take = true;
|
||||
|
||||
if (*buf == 12)
|
||||
break;
|
||||
@ -385,7 +385,7 @@ static JWidget tips_load_box(FILE *f, char *buf, int sizeof_buf, int *take)
|
||||
} while (ustrncmp(buf, "\\next", 5) == 0);
|
||||
|
||||
jwidget_add_child(vbox, hbox);
|
||||
*take = TRUE;
|
||||
*take = true;
|
||||
}
|
||||
/* \next and \done */
|
||||
else if ((ustrncmp(buf+1, "next", 4) == 0) ||
|
||||
@ -419,7 +419,7 @@ static JWidget tips_load_box(FILE *f, char *buf, int sizeof_buf, int *take)
|
||||
bmp = tips_load_image(filename, rgbpal);
|
||||
if (bmp) {
|
||||
Palette *pal = palette_new(0, MAX_PALETTE_COLORS);
|
||||
set_current_palette(palette_from_allegro(pal, rgbpal), FALSE);
|
||||
set_current_palette(palette_from_allegro(pal, rgbpal), false);
|
||||
palette_free(pal);
|
||||
|
||||
destroy_bitmap(bmp);
|
||||
@ -439,7 +439,7 @@ static JWidget tips_load_box(FILE *f, char *buf, int sizeof_buf, int *take)
|
||||
if (*text != '*') {
|
||||
while (fgets(buf, sizeof_buf, f)) {
|
||||
if (*buf == 12 || *buf == '\\') {
|
||||
*take = FALSE;
|
||||
*take = false;
|
||||
break;
|
||||
}
|
||||
/* comment */
|
||||
@ -452,7 +452,7 @@ static JWidget tips_load_box(FILE *f, char *buf, int sizeof_buf, int *take)
|
||||
|
||||
/* empty? */
|
||||
if (!*buf) {
|
||||
*take = FALSE;
|
||||
*take = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -519,5 +519,5 @@ static void next_command(JWidget widget, void *data)
|
||||
static bool check_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
set_config_bool("Tips", "Show", jwidget_is_selected(widget));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@ -226,16 +226,16 @@ bool effect_apply_step(Effect *effect)
|
||||
|
||||
(*effect->apply)(effect);
|
||||
effect->row++;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void effect_apply(Effect *effect)
|
||||
{
|
||||
bool cancelled = FALSE;
|
||||
bool cancelled = false;
|
||||
|
||||
effect_begin(effect);
|
||||
while (!cancelled && effect_apply_step(effect)) {
|
||||
@ -297,10 +297,10 @@ void effect_flush(Effect *effect)
|
||||
void effect_apply_to_target(Effect *effect)
|
||||
{
|
||||
ImageRef *p, *images;
|
||||
bool cancelled = FALSE;
|
||||
bool cancelled = false;
|
||||
int nimages;
|
||||
|
||||
images = images_ref_get_from_sprite(effect->sprite, effect->target, TRUE);
|
||||
images = images_ref_get_from_sprite(effect->sprite, effect->target, true);
|
||||
if (images == NULL)
|
||||
return;
|
||||
|
||||
|
@ -135,12 +135,12 @@ static bool load_ASE(FileOp *fop)
|
||||
|
||||
f = fopen(fop->filename, "rb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (!ase_file_read_header(f, &header)) {
|
||||
fop_error(fop, _("Error reading header\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* create the new sprite */
|
||||
@ -150,7 +150,7 @@ static bool load_ASE(FileOp *fop)
|
||||
if (!sprite) {
|
||||
fop_error(fop, _("Error creating sprite with file spec\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* set frames and speed */
|
||||
@ -201,7 +201,7 @@ static bool load_ASE(FileOp *fop)
|
||||
ase_file_read_color2_chunk(f, sprite, frame);
|
||||
|
||||
if (palette_count_diff(prev_pal, pal, NULL, NULL) > 0) {
|
||||
sprite_set_palette(sprite, pal, TRUE);
|
||||
sprite_set_palette(sprite, pal, true);
|
||||
}
|
||||
|
||||
palette_free(pal);
|
||||
@ -271,11 +271,11 @@ static bool load_ASE(FileOp *fop)
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error reading file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ static bool save_ASE(FileOp *fop)
|
||||
|
||||
f = fopen(fop->filename, "wb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
/* prepare the header */
|
||||
ase_file_prepare_header(f, &header, sprite);
|
||||
@ -343,11 +343,11 @@ static bool save_ASE(FileOp *fop)
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error writing file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ static bool ase_file_read_header(FILE *f, ASE_Header *header)
|
||||
header->size = fgetl(f);
|
||||
header->magic = fgetw(f);
|
||||
if (header->magic != ASE_FILE_MAGIC)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
header->frames = fgetw(f);
|
||||
header->width = fgetw(f);
|
||||
@ -370,7 +370,7 @@ static bool ase_file_read_header(FILE *f, ASE_Header *header)
|
||||
header->frit = fgetl(f);
|
||||
|
||||
fseek(f, header->pos+128, SEEK_SET);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ase_file_prepare_header(FILE *f, ASE_Header *header, Sprite *sprite)
|
||||
|
@ -579,11 +579,11 @@ static bool load_BMP(FileOp *fop)
|
||||
|
||||
f = fopen(fop->filename, "rb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (read_bmfileheader(f, &fileheader) != 0) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
biSize = fgetl(f);
|
||||
@ -593,25 +593,25 @@ static bool load_BMP(FileOp *fop)
|
||||
|
||||
if (read_win_bminfoheader(f, &infoheader) != 0) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (infoheader.biCompression != BI_BITFIELDS)
|
||||
read_bmicolors(fop, fileheader.bfOffBits - 54, f, TRUE);
|
||||
read_bmicolors(fop, fileheader.bfOffBits - 54, f, true);
|
||||
}
|
||||
else if (biSize == OS2INFOHEADERSIZE) {
|
||||
format = BMP_OPTIONS_FORMAT_OS2;
|
||||
|
||||
if (read_os2_bminfoheader(f, &infoheader) != 0) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/* compute number of colors recorded */
|
||||
if (infoheader.biCompression != BI_BITFIELDS)
|
||||
read_bmicolors(fop, fileheader.bfOffBits - 26, f, FALSE);
|
||||
read_bmicolors(fop, fileheader.bfOffBits - 26, f, false);
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((infoheader.biBitCount == 32) ||
|
||||
@ -635,7 +635,7 @@ static bool load_BMP(FileOp *fop)
|
||||
ABS((int)infoheader.biHeight));
|
||||
if (!image) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type == IMAGE_RGB)
|
||||
@ -662,20 +662,20 @@ static bool load_BMP(FileOp *fop)
|
||||
image_free(image);
|
||||
fop_error(fop, _("Unsupported bitfields in the BMP file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fop_error(fop, _("Unsupported BMP compression.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error reading file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* setup the file-data */
|
||||
@ -693,7 +693,7 @@ static bool load_BMP(FileOp *fop)
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool save_BMP(FileOp *fop)
|
||||
@ -720,7 +720,7 @@ static bool save_BMP(FileOp *fop)
|
||||
f = fopen(fop->filename, "wb");
|
||||
if (!f) {
|
||||
fop_error(fop, _("Error creating file.\n"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* file_header */
|
||||
@ -789,10 +789,10 @@ static bool save_BMP(FileOp *fop)
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error writing file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ FileOp *fop_to_load_sprite(const char *filename, int flags)
|
||||
|
||||
/* load just one frame */
|
||||
if (flags & FILE_LOAD_ONE_FRAME)
|
||||
fop->oneframe = TRUE;
|
||||
fop->oneframe = true;
|
||||
|
||||
done:;
|
||||
jfree(extension);
|
||||
@ -271,7 +271,7 @@ FileOp *fop_to_save_sprite(Sprite *sprite)
|
||||
|
||||
/* warnings */
|
||||
ustrcpy(buf, empty_string);
|
||||
fatal = FALSE;
|
||||
fatal = false;
|
||||
|
||||
/* check image type support */
|
||||
switch (fop->sprite->imgtype) {
|
||||
@ -279,7 +279,7 @@ FileOp *fop_to_save_sprite(Sprite *sprite)
|
||||
case IMAGE_RGB:
|
||||
if (!(fop->format->flags & FILE_SUPPORT_RGB)) {
|
||||
usprintf(buf+ustrlen(buf), "<<- %s", _("RGB format"));
|
||||
fatal = TRUE;
|
||||
fatal = true;
|
||||
}
|
||||
if (!(fop->format->flags & FILE_SUPPORT_RGBA) &&
|
||||
sprite_need_alpha(fop->sprite)) {
|
||||
@ -290,7 +290,7 @@ FileOp *fop_to_save_sprite(Sprite *sprite)
|
||||
case IMAGE_GRAYSCALE:
|
||||
if (!(fop->format->flags & FILE_SUPPORT_GRAY)) {
|
||||
usprintf(buf+ustrlen(buf), "<<- %s", _("Grayscale format"));
|
||||
fatal = TRUE;
|
||||
fatal = true;
|
||||
}
|
||||
if (!(fop->format->flags & FILE_SUPPORT_GRAYA) &&
|
||||
sprite_need_alpha(fop->sprite)) {
|
||||
@ -301,7 +301,7 @@ FileOp *fop_to_save_sprite(Sprite *sprite)
|
||||
case IMAGE_INDEXED:
|
||||
if (!(fop->format->flags & FILE_SUPPORT_INDEXED)) {
|
||||
usprintf(buf+ustrlen(buf), "<<- %s", _("Indexed format"));
|
||||
fatal = TRUE;
|
||||
fatal = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -475,7 +475,7 @@ void fop_operate(FileOp *fop)
|
||||
if (palette_count_diff(sprite_get_palette(fop->sprite, frame), \
|
||||
fop->seq.palette, NULL, NULL) > 0) { \
|
||||
fop->seq.palette->frame = frame; \
|
||||
sprite_set_palette(fop->sprite, fop->seq.palette, TRUE); \
|
||||
sprite_set_palette(fop->sprite, fop->seq.palette, true); \
|
||||
} \
|
||||
\
|
||||
old_image = fop->seq.image; \
|
||||
@ -488,7 +488,7 @@ void fop_operate(FileOp *fop)
|
||||
frame = 0;
|
||||
old_image = NULL;
|
||||
|
||||
fop->seq.has_alpha = FALSE;
|
||||
fop->seq.has_alpha = false;
|
||||
fop->seq.progress_offset = 0.0f;
|
||||
fop->seq.progress_fraction = 1.0f / (float)frames;
|
||||
|
||||
@ -673,7 +673,7 @@ void fop_done(FileOp *fop)
|
||||
/* finally done */
|
||||
jmutex_lock(fop->mutex);
|
||||
{
|
||||
fop->done = TRUE;
|
||||
fop->done = true;
|
||||
}
|
||||
jmutex_unlock(fop->mutex);
|
||||
}
|
||||
@ -683,7 +683,7 @@ void fop_stop(FileOp *fop)
|
||||
jmutex_lock(fop->mutex);
|
||||
{
|
||||
if (!fop->done)
|
||||
fop->stop = TRUE;
|
||||
fop->stop = true;
|
||||
}
|
||||
jmutex_unlock(fop->mutex);
|
||||
}
|
||||
@ -884,9 +884,9 @@ static FileOp *fop_new(FileOpType type)
|
||||
fop->mutex = jmutex_new();
|
||||
fop->progress = 0.0f;
|
||||
fop->error = NULL;
|
||||
fop->done = FALSE;
|
||||
fop->stop = FALSE;
|
||||
fop->oneframe = FALSE;
|
||||
fop->done = false;
|
||||
fop->stop = false;
|
||||
fop->oneframe = false;
|
||||
|
||||
fop->seq.filename_list = NULL;
|
||||
fop->seq.palette = NULL;
|
||||
|
@ -54,7 +54,7 @@ static bool load_FLI(FileOp *fop)
|
||||
cmap[c*3+2], 255)); \
|
||||
} \
|
||||
pal->frame = frpos_out; \
|
||||
sprite_set_palette(sprite, pal, TRUE); \
|
||||
sprite_set_palette(sprite, pal, true); \
|
||||
} while (0)
|
||||
|
||||
unsigned char cmap[768];
|
||||
@ -74,7 +74,7 @@ static bool load_FLI(FileOp *fop)
|
||||
/* open the file to read in binary mode */
|
||||
f = fopen(fop->filename, "rb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
fli_read_header(f, &fli_header);
|
||||
fseek(f, 128, SEEK_SET);
|
||||
@ -82,7 +82,7 @@ static bool load_FLI(FileOp *fop)
|
||||
if (fli_header.magic == NO_HEADER) {
|
||||
fop_error(fop, _("The file doesn't have a FLIC header\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* size by frame */
|
||||
@ -99,7 +99,7 @@ static bool load_FLI(FileOp *fop)
|
||||
if (old) image_free(old);
|
||||
if (pal) palette_free(pal);
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* create the image */
|
||||
@ -205,7 +205,7 @@ static bool load_FLI(FileOp *fop)
|
||||
palette_free(pal);
|
||||
|
||||
fop->sprite = sprite;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* saves a FLC file */
|
||||
@ -243,7 +243,7 @@ static bool save_FLI(FileOp *fop)
|
||||
/* open the file to write in binary mode */
|
||||
f = fopen(fop->filename, "wb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
fseek(f, 128, SEEK_SET);
|
||||
|
||||
@ -255,7 +255,7 @@ static bool save_FLI(FileOp *fop)
|
||||
if (bmp) image_free(bmp);
|
||||
if (old) image_free(old);
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* write frame by frame */
|
||||
@ -305,7 +305,7 @@ static bool save_FLI(FileOp *fop)
|
||||
image_free(bmp);
|
||||
image_free(old);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static int get_time_precision(Sprite *sprite)
|
||||
|
@ -370,7 +370,7 @@ load_object(FILE* file, long size, void(*progress)(void*, float), void* dp)
|
||||
return gif;
|
||||
}
|
||||
}
|
||||
while (TRUE);
|
||||
while (true);
|
||||
error:
|
||||
if (file)
|
||||
fclose (file);
|
||||
|
@ -84,7 +84,7 @@ static bool load_GIF(FileOp *fop)
|
||||
Image *current_image = NULL;
|
||||
Palette *opal = NULL;
|
||||
Palette *npal = NULL;
|
||||
bool ret = FALSE;
|
||||
bool ret = false;
|
||||
int i, c;
|
||||
|
||||
gif = gif_load_animation(fop->filename,
|
||||
@ -150,7 +150,7 @@ static bool load_GIF(FileOp *fop)
|
||||
/* first frame or palette changes */
|
||||
if (i == 0 || palette_count_diff(opal, npal, NULL, NULL)) {
|
||||
npal->frame = i;
|
||||
sprite_set_palette(sprite, npal, TRUE);
|
||||
sprite_set_palette(sprite, npal, true);
|
||||
}
|
||||
|
||||
/* copy new palette to old palette */
|
||||
@ -246,7 +246,7 @@ static bool load_GIF(FileOp *fop)
|
||||
|
||||
fop->sprite = sprite;
|
||||
sprite = NULL;
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
|
||||
error:;
|
||||
if (gif) gif_destroy_animation(gif);
|
||||
@ -297,7 +297,7 @@ static bool save_GIF(FileOp *fop)
|
||||
if (bmp) image_free(bmp);
|
||||
if (old) image_free(old);
|
||||
fop_error(fop, _("Not enough memory for temporary bitmaps.\n"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
gif = gif_create_animation(sprite->frames);
|
||||
@ -305,7 +305,7 @@ static bool save_GIF(FileOp *fop)
|
||||
image_free(bmp);
|
||||
image_free(old);
|
||||
fop_error(fop, _("Error creating GIF structure.\n"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
gif->width = sprite->w;
|
||||
|
@ -56,7 +56,7 @@ static bool save_ICO(FileOp *fop)
|
||||
|
||||
f = fopen(fop->filename, "wb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
offset = 6 + num * 16; /* ICONDIR + ICONDIRENTRYs */
|
||||
|
||||
@ -180,5 +180,5 @@ static bool save_ICO(FileOp *fop)
|
||||
image_free(bmp);
|
||||
fclose(f);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ static bool load_JPEG(FileOp *fop)
|
||||
|
||||
file = fopen(fop->filename, "rb");
|
||||
if (!file)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
/* initialize the JPEG decompression object with error handling */
|
||||
jerr.fop = fop;
|
||||
@ -105,7 +105,7 @@ static bool load_JPEG(FileOp *fop)
|
||||
if (setjmp(jerr.setjmp_buffer)) {
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(file);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
jpeg_create_decompress(&cinfo);
|
||||
@ -114,7 +114,7 @@ static bool load_JPEG(FileOp *fop)
|
||||
jpeg_stdio_src(&cinfo, file);
|
||||
|
||||
/* read file header, set default decompression parameters */
|
||||
jpeg_read_header(&cinfo, TRUE);
|
||||
jpeg_read_header(&cinfo, true);
|
||||
|
||||
if (cinfo.jpeg_color_space == JCS_GRAYSCALE)
|
||||
cinfo.out_color_space = JCS_GRAYSCALE;
|
||||
@ -133,7 +133,7 @@ static bool load_JPEG(FileOp *fop)
|
||||
if (!image) {
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(file);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* create the buffer */
|
||||
@ -142,7 +142,7 @@ static bool load_JPEG(FileOp *fop)
|
||||
if (!buffer) {
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(file);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (c=0; c<(int)buffer_height; c++) {
|
||||
@ -154,7 +154,7 @@ static bool load_JPEG(FileOp *fop)
|
||||
jfree(buffer);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(file);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ static bool load_JPEG(FileOp *fop)
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
|
||||
fclose(file);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool save_JPEG(FileOp *fop)
|
||||
@ -236,7 +236,7 @@ static bool save_JPEG(FileOp *fop)
|
||||
file = fopen(fop->filename, "wb");
|
||||
if (!file) {
|
||||
fop_error(fop, _("Error creating file.\n"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Allocate and initialize JPEG compression object. */
|
||||
@ -261,12 +261,12 @@ static bool save_JPEG(FileOp *fop)
|
||||
}
|
||||
|
||||
jpeg_set_defaults(&cinfo);
|
||||
jpeg_set_quality(&cinfo, (int)MID(0, 100.0f * jpeg_options->quality, 100), TRUE);
|
||||
jpeg_set_quality(&cinfo, (int)MID(0, 100.0f * jpeg_options->quality, 100), true);
|
||||
cinfo.dct_method = JDCT_ISLOW;
|
||||
cinfo.smoothing_factor = 0;
|
||||
|
||||
/* Start compressor. */
|
||||
jpeg_start_compress(&cinfo, TRUE);
|
||||
jpeg_start_compress(&cinfo, true);
|
||||
|
||||
/* Create the buffer. */
|
||||
buffer_height = 1;
|
||||
@ -275,7 +275,7 @@ static bool save_JPEG(FileOp *fop)
|
||||
fop_error(fop, _("Not enough memory for the buffer.\n"));
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
fclose(file);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (c=0; c<(int)buffer_height; c++) {
|
||||
@ -288,7 +288,7 @@ static bool save_JPEG(FileOp *fop)
|
||||
jfree(buffer);
|
||||
jpeg_destroy_compress(&cinfo);
|
||||
fclose(file);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ static bool save_JPEG(FileOp *fop)
|
||||
fclose(file);
|
||||
|
||||
/* All fine. */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +54,7 @@ static bool load_PCX(FileOp *fop)
|
||||
|
||||
f = fopen(fop->filename, "rb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
fgetc(f); /* skip manufacturer ID */
|
||||
fgetc(f); /* skip version flag */
|
||||
@ -63,7 +63,7 @@ static bool load_PCX(FileOp *fop)
|
||||
if (fgetc(f) != 8) { /* we like 8 bit color planes */
|
||||
fop_error(fop, _("This PCX doesn't have 8 bit color planes.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
width = -(fgetw(f)); /* xmin */
|
||||
@ -85,7 +85,7 @@ static bool load_PCX(FileOp *fop)
|
||||
bpp = fgetc(f) * 8; /* how many color planes? */
|
||||
if ((bpp != 8) && (bpp != 24)) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bytes_per_line = fgetw(f);
|
||||
@ -99,7 +99,7 @@ static bool load_PCX(FileOp *fop)
|
||||
width, height);
|
||||
if (!image) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bpp == 24)
|
||||
@ -168,11 +168,11 @@ static bool load_PCX(FileOp *fop)
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error reading file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ static bool save_PCX(FileOp *fop)
|
||||
f = fopen(fop->filename, "wb");
|
||||
if (!f) {
|
||||
fop_error(fop, _("Error creating file.\n"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (image->imgtype == IMAGE_RGB) {
|
||||
@ -294,10 +294,10 @@ static bool save_PCX(FileOp *fop)
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error writing file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ static bool load_PNG(FileOp *fop)
|
||||
|
||||
fp = fopen(fop->filename, "rb");
|
||||
if (!fp)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
/* Create and initialize the png_struct with the desired error handler
|
||||
* functions. If you want to use the default stderr and longjump method,
|
||||
@ -83,7 +83,7 @@ static bool load_PNG(FileOp *fop)
|
||||
if (png_ptr == NULL) {
|
||||
fop_error(fop, "png_create_read_struct\n");
|
||||
fclose(fp);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Allocate/initialize the memory for image information. */
|
||||
@ -92,7 +92,7 @@ static bool load_PNG(FileOp *fop)
|
||||
fop_error(fop, "png_create_info_struct\n");
|
||||
fclose(fp);
|
||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set error handling if you are using the setjmp/longjmp method (this is
|
||||
@ -104,7 +104,7 @@ static bool load_PNG(FileOp *fop)
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
fclose(fp);
|
||||
/* If we get here, we had a problem reading the file */
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set up the input control if you are using standard C streams */
|
||||
@ -155,13 +155,13 @@ static bool load_PNG(FileOp *fop)
|
||||
switch (info_ptr->color_type) {
|
||||
|
||||
case PNG_COLOR_TYPE_RGB_ALPHA:
|
||||
fop->seq.has_alpha = TRUE;
|
||||
fop->seq.has_alpha = true;
|
||||
case PNG_COLOR_TYPE_RGB:
|
||||
imgtype = IMAGE_RGB;
|
||||
break;
|
||||
|
||||
case PNG_COLOR_TYPE_GRAY_ALPHA:
|
||||
fop->seq.has_alpha = TRUE;
|
||||
fop->seq.has_alpha = true;
|
||||
case PNG_COLOR_TYPE_GRAY:
|
||||
imgtype = IMAGE_GRAYSCALE;
|
||||
break;
|
||||
@ -174,7 +174,7 @@ static bool load_PNG(FileOp *fop)
|
||||
fop_error(fop, "Color type not supported\n)");
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
fclose(fp);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
image = fop_sequence_image(fop, imgtype, info_ptr->width, info_ptr->height);
|
||||
@ -182,7 +182,7 @@ static bool load_PNG(FileOp *fop)
|
||||
fop_error(fop, "file_sequence_image %dx%d\n", info_ptr->width, info_ptr->height);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
fclose(fp);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* read palette */
|
||||
@ -288,7 +288,7 @@ static bool load_PNG(FileOp *fop)
|
||||
|
||||
/* close the file */
|
||||
fclose(fp);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool save_PNG(FileOp *fop)
|
||||
@ -306,7 +306,7 @@ static bool save_PNG(FileOp *fop)
|
||||
/* open the file */
|
||||
fp = fopen(fop->filename, "wb");
|
||||
if (fp == NULL)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
/* Create and initialize the png_struct with the desired error handler
|
||||
* functions. If you want to use the default stderr and longjump method,
|
||||
@ -318,7 +318,7 @@ static bool save_PNG(FileOp *fop)
|
||||
report_png_error, report_png_error);
|
||||
if (png_ptr == NULL) {
|
||||
fclose(fp);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Allocate/initialize the image information data. REQUIRED */
|
||||
@ -326,7 +326,7 @@ static bool save_PNG(FileOp *fop)
|
||||
if (info_ptr == NULL) {
|
||||
fclose(fp);
|
||||
png_destroy_write_struct(&png_ptr, png_infopp_NULL);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Set error handling. REQUIRED if you aren't supplying your own
|
||||
@ -336,7 +336,7 @@ static bool save_PNG(FileOp *fop)
|
||||
/* If we get here, we had a problem reading the file */
|
||||
fclose(fp);
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* set up the output control if you are using standard C streams */
|
||||
@ -501,5 +501,5 @@ static bool save_PNG(FileOp *fop)
|
||||
fclose(fp);
|
||||
|
||||
/* all right */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ static bool load_TGA(FileOp *fop)
|
||||
|
||||
f = fopen(fop->filename, "rb");
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
id_length = fgetc(f);
|
||||
palette_type = fgetc(f);
|
||||
@ -242,7 +242,7 @@ static bool load_TGA(FileOp *fop)
|
||||
}
|
||||
else if (palette_type != 0) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Image type:
|
||||
@ -263,7 +263,7 @@ static bool load_TGA(FileOp *fop)
|
||||
case 1:
|
||||
if ((palette_type != 1) || (bpp != 8)) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i=0; i<palette_colors; i++) {
|
||||
@ -282,7 +282,7 @@ static bool load_TGA(FileOp *fop)
|
||||
((bpp != 15) && (bpp != 16) &&
|
||||
(bpp != 24) && (bpp != 32))) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
type = IMAGE_RGB;
|
||||
@ -292,7 +292,7 @@ static bool load_TGA(FileOp *fop)
|
||||
case 3:
|
||||
if ((palette_type != 0) || (bpp != 8)) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i=0; i<256; i++)
|
||||
@ -305,13 +305,13 @@ static bool load_TGA(FileOp *fop)
|
||||
/* TODO add support for more TGA types? */
|
||||
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
image = fop_sequence_image(fop, type, image_width, image_height);
|
||||
if (!image) {
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (y=image_height; y; y--) {
|
||||
@ -384,11 +384,11 @@ static bool load_TGA(FileOp *fop)
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error reading file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -408,7 +408,7 @@ static bool save_TGA(FileOp *fop)
|
||||
f = fopen(fop->filename, "wb");
|
||||
if (!f) {
|
||||
fop_error(fop, _("Error creating file.\n"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
fputc(0, f); /* id length (no id saved) */
|
||||
@ -477,10 +477,10 @@ static bool save_TGA(FileOp *fop)
|
||||
if (ferror(f)) {
|
||||
fop_error(fop, _("Error writing file.\n"));
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fclose(f);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ void intl_set_lang(const char *lang)
|
||||
/* setlocale(LC_MESSAGES, ""); */
|
||||
/* bindtextdomain(PACKAGE, locale_path); */
|
||||
/* textdomain(PACKAGE); */
|
||||
/* setenv("OUTPUT_CHARSET", "ISO-8859-1", TRUE); */
|
||||
/* setenv("OUTPUT_CHARSET", "ISO-8859-1", true); */
|
||||
/* #endif */
|
||||
|
||||
/* /\* Set current language. *\/ */
|
||||
|
@ -34,7 +34,7 @@ int msgids_load(const char *filename)
|
||||
{
|
||||
char buf[4096], leavings[4096];
|
||||
char id[4096], trans[4096];
|
||||
int donotread = FALSE;
|
||||
int donotread = false;
|
||||
FILE *f;
|
||||
|
||||
f = fopen(filename, "r");
|
||||
@ -48,7 +48,7 @@ int msgids_load(const char *filename)
|
||||
strcpy(leavings, "");
|
||||
|
||||
while (donotread || tok_read (f, buf, leavings, sizeof (leavings))) {
|
||||
donotread = FALSE;
|
||||
donotread = false;
|
||||
|
||||
/* new msgid */
|
||||
if (strncmp ("msgid", buf, 5) == 0) {
|
||||
@ -65,7 +65,7 @@ int msgids_load(const char *filename)
|
||||
strcat(trans, buf);
|
||||
|
||||
if (strncmp("msgid", buf, 5) == 0)
|
||||
donotread = TRUE;
|
||||
donotread = true;
|
||||
|
||||
if (strlen(id) > 0 && strlen(trans) > 0)
|
||||
hash_insert(msgids, id, jstrdup(trans));
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
Allegro() {
|
||||
#ifdef HAVE_RESIZE_PATCH
|
||||
// resize window ability
|
||||
allegro_resizable_window_flag = TRUE;
|
||||
allegro_resizable_window_flag = true;
|
||||
#endif
|
||||
|
||||
allegro_init();
|
||||
|
@ -136,7 +136,7 @@ static int monitor_timer = -1;
|
||||
static MonitorList* monitors = NULL;
|
||||
static std::vector<Shortcut*>* shortcuts = NULL;
|
||||
|
||||
static bool ji_screen_created = FALSE;
|
||||
static bool ji_screen_created = false;
|
||||
|
||||
static volatile int next_idle_flags = 0;
|
||||
static JList icon_buttons;
|
||||
@ -202,9 +202,9 @@ int init_module_gui()
|
||||
|
||||
/* disable Ctrl+Shift+End in non-DOS */
|
||||
#if !defined(ALLEGRO_DOS)
|
||||
three_finger_flag = FALSE;
|
||||
three_finger_flag = false;
|
||||
#endif
|
||||
three_finger_flag = TRUE; /* TODO remove this line */
|
||||
three_finger_flag = true; /* TODO remove this line */
|
||||
|
||||
/* set the graphics mode... */
|
||||
load_gui_config(w, h, bpp, fullscreen, maximized);
|
||||
@ -214,7 +214,7 @@ int init_module_gui()
|
||||
|
||||
/* default resolution */
|
||||
if (!w || !h) {
|
||||
bool has_desktop = FALSE;
|
||||
bool has_desktop = false;
|
||||
int dsk_w, dsk_h;
|
||||
|
||||
has_desktop = get_desktop_resolution(&dsk_w, &dsk_h) == 0;
|
||||
@ -229,7 +229,7 @@ int init_module_gui()
|
||||
if (try_resolutions[c].width <= dsk_w &&
|
||||
try_resolutions[c].height <= dsk_h) {
|
||||
min_possible_dsk_res = c;
|
||||
fullscreen = FALSE;
|
||||
fullscreen = false;
|
||||
w = try_resolutions[c].width;
|
||||
h = try_resolutions[c].height;
|
||||
screen_scaling = try_resolutions[c].scale;
|
||||
@ -239,7 +239,7 @@ int init_module_gui()
|
||||
}
|
||||
/* full screen */
|
||||
else {
|
||||
fullscreen = TRUE;
|
||||
fullscreen = true;
|
||||
w = 320;
|
||||
h = 200;
|
||||
screen_scaling = 1;
|
||||
@ -362,7 +362,7 @@ void exit_module_gui()
|
||||
|
||||
if (ji_screen_created)
|
||||
destroy_bitmap(old_bmp);
|
||||
ji_screen_created = FALSE;
|
||||
ji_screen_created = false;
|
||||
}
|
||||
|
||||
jlist_free(icon_buttons);
|
||||
@ -445,7 +445,7 @@ void update_screen_for_sprite(const Sprite* sprite)
|
||||
/* without sprite */
|
||||
if (!sprite) {
|
||||
/* well, change to the default palette */
|
||||
if (set_current_palette(NULL, FALSE)) {
|
||||
if (set_current_palette(NULL, false)) {
|
||||
/* if the palette changes, refresh the whole screen */
|
||||
jmanager_refresh_screen();
|
||||
}
|
||||
@ -453,7 +453,7 @@ void update_screen_for_sprite(const Sprite* sprite)
|
||||
/* with a sprite */
|
||||
else {
|
||||
/* select the palette of the sprite */
|
||||
if (set_current_palette(sprite_get_palette(sprite, sprite->frame), FALSE)) {
|
||||
if (set_current_palette(sprite_get_palette(sprite, sprite->frame), false)) {
|
||||
/* if the palette changes, refresh the whole screen */
|
||||
jmanager_refresh_screen();
|
||||
}
|
||||
@ -539,11 +539,11 @@ void gui_setup_screen(bool reload_font)
|
||||
if (ji_screen_created)
|
||||
destroy_bitmap(old_bmp);
|
||||
|
||||
ji_screen_created = TRUE;
|
||||
ji_screen_created = true;
|
||||
}
|
||||
else {
|
||||
ji_set_screen(screen);
|
||||
ji_screen_created = FALSE;
|
||||
ji_screen_created = false;
|
||||
}
|
||||
|
||||
if (reload_font)
|
||||
@ -710,7 +710,7 @@ static bool hook_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -796,7 +796,7 @@ static bool button_with_icon_msg_proc(JWidget widget, JMessage msg)
|
||||
{
|
||||
if (msg->type == JM_DESTROY)
|
||||
jlist_remove(icon_buttons, widget);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
@ -48,7 +48,7 @@ static Palette *ase_current_palette = NULL;
|
||||
|
||||
/* current rgb map */
|
||||
static RGB_MAP *my_rgb_map = NULL;
|
||||
static int regen_my_rgb_map = FALSE;
|
||||
static int regen_my_rgb_map = false;
|
||||
|
||||
/* system color (in order of importance) */
|
||||
static ase_uint32 ase_system_color[] =
|
||||
@ -155,13 +155,13 @@ bool set_current_palette(Palette *_palette, bool forced)
|
||||
|
||||
/* first of all, we can search for system colors in the palette */
|
||||
for (i=0; i<SYSTEM_COLORS; i++) {
|
||||
found[i] = FALSE;
|
||||
found[i] = false;
|
||||
|
||||
for (j=1; j<256; j++) {
|
||||
if ((_rgba_getr(ase_system_color[i])>>2) == (_rgba_getr(palette->color[j])>>2) &&
|
||||
(_rgba_getg(ase_system_color[i])>>2) == (_rgba_getg(palette->color[j])>>2) &&
|
||||
(_rgba_getb(ase_system_color[i])>>2) == (_rgba_getb(palette->color[j])>>2)) {
|
||||
found[i] = TRUE;
|
||||
found[i] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -198,7 +198,7 @@ bool set_current_palette(Palette *_palette, bool forced)
|
||||
// call hooks
|
||||
App::instance()->trigger_event(AppEvent::PaletteChange);
|
||||
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -207,7 +207,7 @@ bool set_current_palette(Palette *_palette, bool forced)
|
||||
void set_black_palette()
|
||||
{
|
||||
Palette *p = palette_new(0, MAX_PALETTE_COLORS);
|
||||
set_current_palette(p, TRUE);
|
||||
set_current_palette(p, true);
|
||||
palette_free(p);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "modules/gui.h"
|
||||
#include "modules/recent.h"
|
||||
|
||||
static int installed = FALSE;
|
||||
static int installed = false;
|
||||
|
||||
static JList recent_files;
|
||||
static int recent_files_limit = 16;
|
||||
@ -39,7 +39,7 @@ int init_module_recent()
|
||||
char buf[512];
|
||||
int c;
|
||||
|
||||
installed = TRUE;
|
||||
installed = true;
|
||||
recent_files = jlist_new();
|
||||
|
||||
for (c=recent_files_limit-1; c>=0; c--) {
|
||||
@ -68,7 +68,7 @@ void exit_module_recent()
|
||||
}
|
||||
|
||||
jlist_free(recent_files);
|
||||
installed = FALSE;
|
||||
installed = false;
|
||||
}
|
||||
|
||||
JList get_recent_files_list()
|
||||
|
@ -186,11 +186,11 @@ int init_module_tools()
|
||||
glass_dirty = get_config_int("Tools", "GlassDirty", 255);
|
||||
spray_width = get_config_int("Tools", "SprayWidth", 16);
|
||||
air_speed = get_config_int("Tools", "AirSpeed", 75);
|
||||
filled_mode = get_config_bool("Tools", "Filled", FALSE);
|
||||
filled_mode = get_config_bool("Tools", "Filled", false);
|
||||
tiled_mode = (tiled_t)get_config_int("Tools", "Tiled", (int)TILED_NONE);
|
||||
use_grid = get_config_bool("Tools", "UseGrid", FALSE);
|
||||
view_grid = get_config_bool("Tools", "ViewGrid", FALSE);
|
||||
onionskin = get_config_bool("Tools", "Onionskin", FALSE);
|
||||
use_grid = get_config_bool("Tools", "UseGrid", false);
|
||||
view_grid = get_config_bool("Tools", "ViewGrid", false);
|
||||
onionskin = get_config_bool("Tools", "Onionskin", false);
|
||||
|
||||
grid = jrect_new(0, 0, 16, 16);
|
||||
get_config_rect("Tools", "GridRect", grid);
|
||||
@ -828,11 +828,11 @@ void control_tool(Editor* editor, Tool *tool,
|
||||
const char *_start = _("Start");
|
||||
const char *_end = _("End");
|
||||
const char *_size = _("Size");
|
||||
bool click2 = get_config_bool("Options", "DrawClick2", FALSE);
|
||||
bool click2 = get_config_bool("Options", "DrawClick2", false);
|
||||
Cel *cel = NULL;
|
||||
Image *cel_image = NULL;
|
||||
bool cel_created = FALSE;
|
||||
bool destroy_cel = FALSE;
|
||||
bool cel_created = false;
|
||||
bool destroy_cel = false;
|
||||
int curve_pts = 0; /* to iterate points in the 'curve' tool */
|
||||
ToolData tool_data;
|
||||
|
||||
@ -885,7 +885,7 @@ void control_tool(Editor* editor, Tool *tool,
|
||||
cel = cel_new(sprite->frame, 0);
|
||||
((LayerImage*)sprite->layer)->add_cel(cel);
|
||||
|
||||
cel_created = TRUE;
|
||||
cel_created = true;
|
||||
}
|
||||
|
||||
old_cel_x = cel->x;
|
||||
@ -945,9 +945,9 @@ void control_tool(Editor* editor, Tool *tool,
|
||||
offset_x = -x1;
|
||||
offset_y = -y1;
|
||||
|
||||
update = FALSE;
|
||||
forced_update = TRUE;
|
||||
first_time = TRUE;
|
||||
update = false;
|
||||
forced_update = true;
|
||||
first_time = true;
|
||||
old_key_shifts = key_shifts & (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG);
|
||||
spray_time = ji_clock;
|
||||
old_x1 = old_y1 = old_x2 = old_y2 = 0;
|
||||
@ -970,7 +970,7 @@ next_pts:;
|
||||
y1 = mouse_y[0];
|
||||
|
||||
if (use_grid)
|
||||
apply_grid(&x1, &y1, TRUE);
|
||||
apply_grid(&x1, &y1, true);
|
||||
|
||||
x1 += offset_x;
|
||||
y1 += offset_y;
|
||||
@ -1004,8 +1004,8 @@ next_pts:;
|
||||
|
||||
/* grid */
|
||||
if (use_grid) {
|
||||
apply_grid(&x1, &y1, TRUE);
|
||||
apply_grid(&x2, &y2, TRUE);
|
||||
apply_grid(&x1, &y1, true);
|
||||
apply_grid(&x2, &y2, true);
|
||||
}
|
||||
|
||||
/* square aspect */
|
||||
@ -1079,8 +1079,8 @@ next_pts:;
|
||||
|
||||
/* grid */
|
||||
if (use_grid && (tool != tools_list[TOOL_FLOODFILL])) {
|
||||
apply_grid(&x1, &y1, TRUE);
|
||||
apply_grid(&x2, &y2, TRUE);
|
||||
apply_grid(&x1, &y1, true);
|
||||
apply_grid(&x2, &y2, true);
|
||||
}
|
||||
|
||||
x1 += offset_x;
|
||||
@ -1099,7 +1099,7 @@ next_pts:;
|
||||
|
||||
/* grid */
|
||||
if (use_grid)
|
||||
apply_grid(&pts[c*2], &pts[c*2+1], TRUE);
|
||||
apply_grid(&pts[c*2], &pts[c*2+1], true);
|
||||
|
||||
pts[c*2 ] += offset_x;
|
||||
pts[c*2+1] += offset_y;
|
||||
@ -1114,7 +1114,7 @@ next_pts:;
|
||||
y1 = mouse_y[0];
|
||||
|
||||
if (use_grid)
|
||||
apply_grid(&x1, &y1, TRUE);
|
||||
apply_grid(&x1, &y1, true);
|
||||
|
||||
x1 += offset_x;
|
||||
y1 += offset_y;
|
||||
@ -1382,8 +1382,8 @@ next_pts:;
|
||||
}
|
||||
|
||||
release_bitmap(ji_screen);
|
||||
forced_update = FALSE;
|
||||
first_time = FALSE;
|
||||
forced_update = false;
|
||||
first_time = false;
|
||||
}
|
||||
|
||||
/* draw mask */
|
||||
@ -1393,7 +1393,7 @@ next_pts:;
|
||||
if (current_tool == tools_list[TOOL_SPRAY]) {
|
||||
if (ji_clock-spray_time > (1000/20)*(100-air_speed)/100) {
|
||||
spray_time = ji_clock;
|
||||
forced_update = TRUE;
|
||||
forced_update = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1403,7 +1403,7 @@ next_pts:;
|
||||
KB_CTRL_FLAG | KB_ALT_FLAG);
|
||||
if (old_key_shifts != new_shifts) {
|
||||
old_key_shifts = new_shifts;
|
||||
forced_update = TRUE;
|
||||
forced_update = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1448,7 +1448,7 @@ next_pts:;
|
||||
sprite_generate_mask_boundaries(sprite);
|
||||
update_screen_for_sprite(sprite);
|
||||
|
||||
destroy_cel = TRUE;
|
||||
destroy_cel = true;
|
||||
}
|
||||
|
||||
/* draw trace ***************************************************/
|
||||
@ -1540,7 +1540,7 @@ next_pts:;
|
||||
/* if the user canceled the operation we have to restore the cel
|
||||
position */
|
||||
else
|
||||
destroy_cel = TRUE;
|
||||
destroy_cel = true;
|
||||
|
||||
if (destroy_cel) {
|
||||
cel->x = old_cel_x;
|
||||
|
@ -197,7 +197,7 @@ static int check_flood_line(Image *image, int y, int left, int right,
|
||||
{
|
||||
int c;
|
||||
FLOODED_LINE *p;
|
||||
int ret = FALSE;
|
||||
int ret = false;
|
||||
|
||||
while (left <= right) {
|
||||
c = y;
|
||||
@ -214,7 +214,7 @@ static int check_flood_line(Image *image, int y, int left, int right,
|
||||
|
||||
if (!c) {
|
||||
left = flooder (image, left, y, src_color, data, proc);
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -259,7 +259,7 @@ void algo_floodfill(Image *image, int x, int y, void *data, AlgoHLine proc)
|
||||
|
||||
/* continue as long as there are some segments still to test */
|
||||
do {
|
||||
done = TRUE;
|
||||
done = true;
|
||||
|
||||
/* for each line on the screen */
|
||||
for (c=0; c<flood_count; c++) {
|
||||
@ -271,7 +271,7 @@ void algo_floodfill(Image *image, int x, int y, void *data, AlgoHLine proc)
|
||||
p->flags &= ~FLOOD_TODO_BELOW;
|
||||
if (check_flood_line(image, p->y+1, p->lpos, p->rpos,
|
||||
src_color, data, proc)) {
|
||||
done = FALSE;
|
||||
done = false;
|
||||
p = FLOOD_LINE(c);
|
||||
}
|
||||
}
|
||||
@ -281,7 +281,7 @@ void algo_floodfill(Image *image, int x, int y, void *data, AlgoHLine proc)
|
||||
p->flags &= ~FLOOD_TODO_ABOVE;
|
||||
if (check_flood_line(image, p->y-1, p->lpos, p->rpos,
|
||||
src_color, data, proc)) {
|
||||
done = FALSE;
|
||||
done = false;
|
||||
/* special case shortcut for going backwards */
|
||||
if ((c < image->h) && (c > 0))
|
||||
c -= 2;
|
||||
|
@ -162,7 +162,7 @@ static void regenerate_brush(Brush *brush)
|
||||
|
||||
brush->scanline = jnew(BrushScanline, brush->size);
|
||||
for (y=0; y<brush->size; y++) {
|
||||
brush->scanline[y].state = FALSE;
|
||||
brush->scanline[y].state = false;
|
||||
|
||||
for (x=0; x<brush->size; x++) {
|
||||
if (image_getpixel(brush->image, x, y)) {
|
||||
@ -173,7 +173,7 @@ static void regenerate_brush(Brush *brush)
|
||||
break;
|
||||
|
||||
brush->scanline[y].x2 = x-1;
|
||||
brush->scanline[y].state = TRUE;
|
||||
brush->scanline[y].state = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ Dirty* dirty_new_copy(Dirty* src)
|
||||
|
||||
Dirty* dirty_new_from_differences(Image* image, Image* image_diff)
|
||||
{
|
||||
Dirty* dirty = dirty_new(image, 0, 0, image->w, image->h, FALSE);
|
||||
Dirty* dirty = dirty_new(image, 0, 0, image->w, image->h, false);
|
||||
int x, y, x1, x2;
|
||||
|
||||
for (y=0; y<image->h; y++) {
|
||||
@ -349,7 +349,7 @@ void dirty_hline(Dirty* dirty, int x1, int y, int x2)
|
||||
if (x1 > x2)
|
||||
return;
|
||||
|
||||
dirty->tiled = FALSE;
|
||||
dirty->tiled = false;
|
||||
|
||||
if (y < 0)
|
||||
y = dirty->image->h - (-(y+1) % dirty->image->h) - 1;
|
||||
@ -374,7 +374,7 @@ void dirty_hline(Dirty* dirty, int x1, int y, int x2)
|
||||
}
|
||||
}
|
||||
|
||||
dirty->tiled = TRUE;
|
||||
dirty->tiled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -332,13 +332,13 @@ void mask_crop(Mask* mask, const Image *image)
|
||||
{
|
||||
#define ADVANCE(beg, end, o_end, cmp, op, getpixel1, getpixel) \
|
||||
{ \
|
||||
done = TRUE; \
|
||||
done = true; \
|
||||
for (beg=beg_##beg; beg cmp beg_##end; beg op) { \
|
||||
old_color = getpixel1; \
|
||||
done = TRUE; \
|
||||
done = true; \
|
||||
for (c++; c<=beg_##o_end; c++) { \
|
||||
if (getpixel != old_color) { \
|
||||
done = FALSE; \
|
||||
done = false; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
|
@ -183,12 +183,12 @@ void path_move(Path* path, double x, double y)
|
||||
|
||||
void path_stroke(Path* path, Image *image, int color, double brush_size)
|
||||
{
|
||||
draw_path (path, image, color, brush_size, FALSE);
|
||||
draw_path (path, image, color, brush_size, false);
|
||||
}
|
||||
|
||||
void path_fill(Path* path, Image *image, int color)
|
||||
{
|
||||
draw_path (path, image, color, 0, TRUE);
|
||||
draw_path (path, image, color, 0, true);
|
||||
}
|
||||
|
||||
static int path_get_element(Path* path, double x, double y)
|
||||
|
@ -96,7 +96,7 @@ void image_rotate (Image *dst, Image *src, int x, int y, int w, int h,
|
||||
ftofix (256 * angle / PI),
|
||||
fixdiv (itofix (w), itofix (src->w)),
|
||||
fixdiv (itofix (h), itofix (src->h)),
|
||||
FALSE, FALSE, xs, ys);
|
||||
false, false, xs, ys);
|
||||
|
||||
ase_parallelogram_map_standard (dst, src, xs, ys);
|
||||
}
|
||||
@ -213,10 +213,10 @@ SCANLINE_DRAWER(32,
|
||||
* bitmap. With the default scanline drawer, a pixel in the destination
|
||||
* bitmap is drawn if and only if its center is covered by any pixel in the
|
||||
* sprite. The color of this covering sprite pixel is used to draw.
|
||||
* If sub_pixel_accuracy=FALSE, then the scanline drawer will be called with
|
||||
* If sub_pixel_accuracy=false, then the scanline drawer will be called with
|
||||
* *_bmp_x being a fixed point representation of the integers representing
|
||||
* the x coordinate of the first and last point in bmp whose centre is
|
||||
* covered by the sprite. If sub_pixel_accuracy=TRUE, then the scanline
|
||||
* covered by the sprite. If sub_pixel_accuracy=true, then the scanline
|
||||
* drawer will be called with the exact fixed point position of the first
|
||||
* and last point in which the horizontal line passing through the centre is
|
||||
* at least partly covered by the sprite. This is useful for doing
|
||||
@ -636,15 +636,15 @@ static void ase_parallelogram_map_standard (Image *bmp, Image *sprite,
|
||||
switch (bmp->imgtype) {
|
||||
|
||||
case IMAGE_RGB:
|
||||
ase_parallelogram_map (bmp, sprite, xs, ys, draw_scanline_32, FALSE);
|
||||
ase_parallelogram_map (bmp, sprite, xs, ys, draw_scanline_32, false);
|
||||
break;
|
||||
|
||||
case IMAGE_GRAYSCALE:
|
||||
ase_parallelogram_map (bmp, sprite, xs, ys, draw_scanline_16, FALSE);
|
||||
ase_parallelogram_map (bmp, sprite, xs, ys, draw_scanline_16, false);
|
||||
break;
|
||||
|
||||
case IMAGE_INDEXED:
|
||||
ase_parallelogram_map (bmp, sprite, xs, ys, draw_scanline_8, FALSE);
|
||||
ase_parallelogram_map (bmp, sprite, xs, ys, draw_scanline_8, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ Sprite::Sprite(int imgtype, int w, int h)
|
||||
|
||||
/* main properties */
|
||||
strcpy(this->filename, "Sprite");
|
||||
this->associated_to_file = FALSE;
|
||||
this->associated_to_file = false;
|
||||
this->imgtype = imgtype;
|
||||
this->w = w;
|
||||
this->h = h;
|
||||
@ -87,7 +87,7 @@ Sprite::Sprite(int imgtype, int w, int h)
|
||||
palette_set_entry(pal, c, _rgba(c, c, c, 255));
|
||||
break;
|
||||
}
|
||||
sprite_set_palette(this, pal, TRUE);
|
||||
sprite_set_palette(this, pal, true);
|
||||
sprite_set_speed(this, 100);
|
||||
|
||||
/* multiple access */
|
||||
@ -288,7 +288,7 @@ void sprite_mark_as_saved(Sprite* sprite)
|
||||
assert(sprite != NULL);
|
||||
|
||||
sprite->undo->diff_saved = sprite->undo->diff_count;
|
||||
sprite->associated_to_file = TRUE;
|
||||
sprite->associated_to_file = true;
|
||||
}
|
||||
|
||||
bool sprite_need_alpha(const Sprite* sprite)
|
||||
@ -302,7 +302,7 @@ bool sprite_need_alpha(const Sprite* sprite)
|
||||
return sprite_get_background_layer(sprite) == NULL;
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -819,7 +819,7 @@ static Sprite* general_copy(const Sprite* src_sprite)
|
||||
/* copy color palettes */
|
||||
JI_LIST_FOR_EACH(src_sprite->palettes, link) {
|
||||
Palette* pal = reinterpret_cast<Palette*>(link->data);
|
||||
sprite_set_palette(dst_sprite, pal, TRUE);
|
||||
sprite_set_palette(dst_sprite, pal, true);
|
||||
}
|
||||
|
||||
/* copy path */
|
||||
|
@ -271,7 +271,7 @@ Undo::Undo(Sprite* sprite)
|
||||
this->redo_stream = undo_stream_new(this);
|
||||
this->diff_count = 0;
|
||||
this->diff_saved = 0;
|
||||
this->enabled = TRUE;
|
||||
this->enabled = true;
|
||||
this->label = NULL;
|
||||
}
|
||||
|
||||
@ -1727,7 +1727,7 @@ static Dirty *read_raw_dirty(ase_uint8* raw_data)
|
||||
read_raw_uint16(x2);
|
||||
read_raw_uint16(y2);
|
||||
|
||||
dirty = dirty_new(image, x1, y1, x2, y2, FALSE);
|
||||
dirty = dirty_new(image, x1, y1, x2, y2, false);
|
||||
read_raw_uint16(dirty->rows);
|
||||
|
||||
if (dirty->rows > 0) {
|
||||
|
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
||||
button = jbutton_new("&Close");
|
||||
|
||||
/* a expansive widget can get more space that other ones */
|
||||
jwidget_expansive(label, TRUE);
|
||||
jwidget_expansive(label, true);
|
||||
|
||||
/* put the label and button in the box and that box in the window */
|
||||
jwidget_add_child(box, label);
|
||||
|
@ -62,7 +62,7 @@ int main (int argc, char *argv[])
|
||||
button_cancel = jbutton_new ("&Cancel");
|
||||
|
||||
label->set_align(JI_CENTER | JI_MIDDLE);
|
||||
jwidget_expansive (label, TRUE);
|
||||
jwidget_expansive (label, true);
|
||||
|
||||
jwidget_add_child (window, box1);
|
||||
jwidget_add_child (box1, label);
|
||||
|
@ -69,11 +69,11 @@ int main(int argc, char *argv[])
|
||||
jwidget_set_min_size(slider4, 128, 0);
|
||||
jwidget_set_min_size(slider5, 128, 0);
|
||||
|
||||
jwidget_expansive(slider1, TRUE);
|
||||
jwidget_expansive(slider2, TRUE);
|
||||
jwidget_expansive(slider3, TRUE);
|
||||
jwidget_expansive(slider4, TRUE);
|
||||
jwidget_expansive(slider5, TRUE);
|
||||
jwidget_expansive(slider1, true);
|
||||
jwidget_expansive(slider2, true);
|
||||
jwidget_expansive(slider3, true);
|
||||
jwidget_expansive(slider4, true);
|
||||
jwidget_expansive(slider5, true);
|
||||
|
||||
jwidget_add_child(window, box);
|
||||
jwidget_add_children(box,
|
||||
|
@ -67,9 +67,9 @@ int main (int argc, char *argv[])
|
||||
button1 = jbutton_new ("&OK");
|
||||
button2 = jbutton_new ("&Cancel");
|
||||
|
||||
jwidget_expansive (box4, TRUE);
|
||||
jwidget_expansive (box5, TRUE);
|
||||
jwidget_magnetic (button1, TRUE);
|
||||
jwidget_expansive (box4, true);
|
||||
jwidget_expansive (box5, true);
|
||||
jwidget_magnetic (button1, true);
|
||||
|
||||
/* hierarchy */
|
||||
jwidget_add_child (window1, box1);
|
||||
|
@ -58,9 +58,9 @@ int main (int argc, char *argv[])
|
||||
view2 = jview_new();
|
||||
button = jbutton_new("&Close");
|
||||
|
||||
jwidget_expansive(view1, TRUE);
|
||||
jwidget_expansive(view2, TRUE);
|
||||
jwidget_expansive(box2, TRUE);
|
||||
jwidget_expansive(view1, true);
|
||||
jwidget_expansive(view2, true);
|
||||
jwidget_expansive(box2, true);
|
||||
|
||||
jwidget_add_child(window, box1);
|
||||
jwidget_add_children(box1, box2, button, NULL);
|
||||
|
@ -69,9 +69,9 @@ void do_text(const char *title, int align)
|
||||
jview_attach(view1, text_box1);
|
||||
jview_attach(view2, text_box2);
|
||||
|
||||
jwidget_expansive(view1, TRUE);
|
||||
jwidget_expansive(view2, TRUE);
|
||||
jwidget_expansive(box2, TRUE);
|
||||
jwidget_expansive(view1, true);
|
||||
jwidget_expansive(view2, true);
|
||||
jwidget_expansive(box2, true);
|
||||
|
||||
jwidget_set_min_size(view1, 64, 64);
|
||||
jwidget_set_min_size(view2, 64, 64);
|
||||
|
@ -87,7 +87,7 @@ JRect test1()
|
||||
|
||||
jlistbox_select_index(listbox, 0);
|
||||
|
||||
jwidget_expansive(listbox, TRUE);
|
||||
jwidget_expansive(listbox, true);
|
||||
|
||||
jwidget_add_child (window, box);
|
||||
jwidget_add_child (box, listbox);
|
||||
@ -123,7 +123,7 @@ void test2(JRect pos)
|
||||
|
||||
jview_attach(view, listbox);
|
||||
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
|
||||
jwidget_add_child (window, box);
|
||||
jwidget_add_child (box, view);
|
||||
@ -157,7 +157,7 @@ void test3(JRect pos)
|
||||
|
||||
jview_attach(view, listbox);
|
||||
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
|
||||
jwidget_add_child (window, box);
|
||||
jwidget_add_child (box, view);
|
||||
@ -193,7 +193,7 @@ void test4(JRect pos)
|
||||
|
||||
jview_attach(view, listbox);
|
||||
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
|
||||
jwidget_add_child (window, box);
|
||||
jwidget_add_child (box, view);
|
||||
|
@ -105,7 +105,7 @@ int main (int argc, char *argv[])
|
||||
jwidget_add_child (box3, radio[10]);
|
||||
jwidget_add_child (box3, radio[11]);
|
||||
|
||||
jwidget_expansive (check, TRUE);
|
||||
jwidget_expansive (check, true);
|
||||
update_radios ();
|
||||
|
||||
window->open_window_bg();
|
||||
@ -167,8 +167,8 @@ static bool hooked_check_msg_proc (JWidget widget, JMessage msg)
|
||||
if (icon_align != ji_generic_button_get_icon_align(check))
|
||||
ji_generic_button_set_icon_align(check, icon_align);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
@ -162,6 +162,6 @@ static bool hooked_menuitem_msg_proc(JWidget widget, JMessage msg)
|
||||
if (msg->type == JM_SIGNAL &&
|
||||
msg->signal.num == JI_SIGNAL_MENUITEM_SELECT)
|
||||
printf("Selected item: %s\n", widget->text);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ int main (int argc, char *argv[])
|
||||
button = jbutton_new("&Close All");
|
||||
|
||||
jview_attach(view, sub_manager);
|
||||
jwidget_expansive(view, TRUE);
|
||||
jwidget_expansive(view, true);
|
||||
|
||||
jwidget_add_child(desktop, box);
|
||||
jwidget_add_child(box, view);
|
||||
|
@ -155,10 +155,10 @@ static bool my_button_msg_proc(JWidget widget, JMessage msg)
|
||||
jdraw_rectfill (rect, bg);
|
||||
|
||||
/* text */
|
||||
jdraw_widget_text (widget, makecol (255, 255, 255), bg, FALSE);
|
||||
jdraw_widget_text (widget, makecol (255, 255, 255), bg, false);
|
||||
|
||||
jrect_free (rect);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
/* button select signal */
|
||||
else if (msg->type == JM_SIGNAL &&
|
||||
@ -176,11 +176,11 @@ static bool my_button_msg_proc(JWidget widget, JMessage msg)
|
||||
jwidget_add_hook(alert, JI_WIDGET, hooked_window_bg_msg_proc, NULL);
|
||||
alert->open_window_bg();
|
||||
|
||||
/* return TRUE to avoid close the window */
|
||||
return TRUE;
|
||||
/* return true to avoid close the window */
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void new_palette_window(JWidget widget)
|
||||
@ -209,12 +209,12 @@ static bool hooked_window1_msg_proc(JWidget widget, JMessage msg)
|
||||
JI_LIST_FOR_EACH_SAFE(windows, link, next) /* close all windows */
|
||||
reinterpret_cast<Window*>(link->data)->close_window(NULL);
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool hooked_window_bg_msg_proc(JWidget widget, JMessage msg)
|
||||
{
|
||||
if (msg->type == JM_CLOSE)
|
||||
jlist_remove(windows, widget);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
@ -312,9 +312,9 @@ static void theme_draw_button(JWidget widget, JRect clip)
|
||||
jwidget_get_texticon_info(widget, NULL, &text, NULL, 0, 0, 0);
|
||||
|
||||
jdraw_text(widget->text_font, widget->text,
|
||||
text.x1+s+1, text.y1+s+1, makecol (0, 0, 0), bg, FALSE);
|
||||
text.x1+s+1, text.y1+s+1, makecol (0, 0, 0), bg, false);
|
||||
jdraw_text(widget->text_font, widget->text,
|
||||
text.x1+s, text.y1+s, fg, bg, FALSE);
|
||||
text.x1+s, text.y1+s, fg, bg, false);
|
||||
}
|
||||
|
||||
jrect_free(pos);
|
||||
@ -325,7 +325,7 @@ static void theme_draw_label(JWidget widget, JRect clip)
|
||||
/* draw background as Box */
|
||||
theme_draw_box(widget, clip);
|
||||
|
||||
jdraw_widget_text(widget, makecol(0, 0, 0), makecol(196, 196, 196), FALSE);
|
||||
jdraw_widget_text(widget, makecol(0, 0, 0), makecol(196, 196, 196), false);
|
||||
}
|
||||
|
||||
static void theme_draw_window(JWidget widget, JRect clip)
|
||||
@ -343,7 +343,7 @@ static void theme_draw_window(JWidget widget, JRect clip)
|
||||
pos->x1 += 1;
|
||||
jdraw_text(widget->text_font, widget->text, pos->x1, pos->y1+4,
|
||||
makecol(255, 255, 255),
|
||||
makecol(196, 196, 0), FALSE);
|
||||
makecol(196, 196, 0), false);
|
||||
|
||||
jrect_free(pos);
|
||||
}
|
||||
|
@ -87,9 +87,9 @@ int main(int argc, char *argv[])
|
||||
button1 = jbutton_new("&OK");
|
||||
button2 = jbutton_new("&Cancel");
|
||||
|
||||
jentry_password(entry_password, TRUE);
|
||||
jwidget_magnetic(entry_username, TRUE);
|
||||
jwidget_magnetic(button1, TRUE);
|
||||
jentry_password(entry_password, true);
|
||||
jwidget_magnetic(entry_username, true);
|
||||
jwidget_magnetic(button1, true);
|
||||
|
||||
jwidget_add_child(window, box1);
|
||||
jwidget_add_child(box1, box2);
|
||||
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
||||
jwidget_add_child(box5, button1);
|
||||
jwidget_add_child(box5, button2);
|
||||
|
||||
jwindow_sizeable(window, FALSE);
|
||||
jwindow_sizeable(window, false);
|
||||
|
||||
again:;
|
||||
window->open_window_fg();
|
||||
@ -296,9 +296,9 @@ static void theme_draw_box(JWidget widget, JRect clip)
|
||||
JWidget window = jwidget_get_window(widget);
|
||||
if (window) {
|
||||
JRect pos = jwidget_get_child_rect(window);
|
||||
draw_edge(pos, makecol(255, 196, 64), FALSE);
|
||||
draw_edge(pos, makecol(255, 196, 64), false);
|
||||
jrect_shrink(pos, 1);
|
||||
draw_rect(pos, makecol(255, 196, 64), FALSE);
|
||||
draw_rect(pos, makecol(255, 196, 64), false);
|
||||
jrect_free(pos);
|
||||
}
|
||||
}
|
||||
@ -318,11 +318,11 @@ static void theme_draw_button(JWidget widget, JRect clip)
|
||||
makecol(0, 196, 255);
|
||||
}
|
||||
|
||||
draw_edge(pos, makecol(255, 196, 64), TRUE);
|
||||
draw_edge(pos, makecol(255, 196, 64), true);
|
||||
|
||||
if (jwidget_has_focus (widget)) {
|
||||
jrect_shrink(pos, 1);
|
||||
draw_edge(pos, makecol(0, 0, 0), FALSE);
|
||||
draw_edge(pos, makecol(0, 0, 0), false);
|
||||
}
|
||||
|
||||
jrect_shrink(pos, 1);
|
||||
@ -343,9 +343,9 @@ static void theme_draw_button(JWidget widget, JRect clip)
|
||||
jrect_displace(&text, 1, 1);
|
||||
|
||||
jdraw_text(widget->text_font, widget->text, text.x1+1, text.y1+1,
|
||||
makecol(255, 255, 255), bg, FALSE);
|
||||
makecol(255, 255, 255), bg, false);
|
||||
jdraw_text(widget->text_font, widget->text,
|
||||
text.x1, text.y1, fg, bg, FALSE);
|
||||
text.x1, text.y1, fg, bg, false);
|
||||
}
|
||||
|
||||
jrect_free(pos);
|
||||
@ -365,7 +365,7 @@ static void theme_draw_entry(JWidget widget, JRect clip)
|
||||
bg = makecol(255, 255, 255);
|
||||
|
||||
/* 1st border */
|
||||
draw_edge(pos, makecol (255, 196, 64), TRUE);
|
||||
draw_edge(pos, makecol (255, 196, 64), true);
|
||||
|
||||
/* 2nd border */
|
||||
jrect_shrink(pos, 1);
|
||||
@ -373,7 +373,7 @@ static void theme_draw_entry(JWidget widget, JRect clip)
|
||||
jdraw_rect(pos, makecol(0, 0, 0));
|
||||
jrect_shrink(pos, 1);
|
||||
}
|
||||
draw_edge(pos, makecol(192, 192, 192), FALSE);
|
||||
draw_edge(pos, makecol(192, 192, 192), false);
|
||||
|
||||
/* background */
|
||||
jrect_shrink(pos, 1);
|
||||
@ -440,9 +440,9 @@ static void theme_draw_label(JWidget widget, JRect clip)
|
||||
jwidget_get_texticon_info(widget, NULL, &text, NULL, 0, 0, 0);
|
||||
|
||||
jdraw_text(widget->text_font, widget->text, text.x1+1, text.y1+1,
|
||||
makecol(0, 0, 0), makecol(196, 128, 0), FALSE);
|
||||
makecol(0, 0, 0), makecol(196, 128, 0), false);
|
||||
jdraw_text(widget->text_font, widget->text, text.x1, text.y1,
|
||||
makecol(255, 255, 255), makecol(196, 128, 0), FALSE);
|
||||
makecol(255, 255, 255), makecol(196, 128, 0), false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,15 +462,15 @@ static void theme_draw_window(JWidget widget, JRect clip)
|
||||
}
|
||||
|
||||
/* background */
|
||||
draw_rect(pos, makecol(0, 127, 255), FALSE);
|
||||
draw_rect(pos, makecol(0, 127, 255), false);
|
||||
|
||||
/* title bar */
|
||||
pos->x1 += 8;
|
||||
pos->y1 += 6;
|
||||
jdraw_text(widget->text_font, widget->text, pos->x1+1, pos->y1+1,
|
||||
makecol(0, 0, 0), makecol(0, 127, 255), FALSE);
|
||||
makecol(0, 0, 0), makecol(0, 127, 255), false);
|
||||
jdraw_text(widget->text_font, widget->text, pos->x1, pos->y1,
|
||||
makecol(255, 255, 255), makecol(0, 127, 255), FALSE);
|
||||
makecol(255, 255, 255), makecol(0, 127, 255), false);
|
||||
|
||||
/* border to client area */
|
||||
jrect_free(pos);
|
||||
|
@ -154,7 +154,7 @@ static bool tip_hook(JWidget widget, JMessage msg)
|
||||
break;
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static JWidget tip_window_new(const char *text)
|
||||
@ -162,8 +162,8 @@ static JWidget tip_window_new(const char *text)
|
||||
JWidget window = jwindow_new(text);
|
||||
JLink link, next;
|
||||
|
||||
jwindow_sizeable(window, FALSE);
|
||||
jwindow_moveable(window, FALSE);
|
||||
jwindow_sizeable(window, false);
|
||||
jwindow_moveable(window, false);
|
||||
|
||||
window->set_align(JI_CENTER | JI_MIDDLE);
|
||||
|
||||
@ -188,7 +188,7 @@ static bool tip_window_hook(JWidget widget, JMessage msg)
|
||||
widget->border_width.t = 3+jwidget_get_text_height(widget);
|
||||
widget->border_width.r = 3;
|
||||
widget->border_width.b = 3;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -206,9 +206,9 @@ static bool tip_window_hook(JWidget widget, JMessage msg)
|
||||
jdraw_rectfill(pos, makecol(255, 255, 140));
|
||||
|
||||
jdraw_widget_text(widget, makecol(0, 0, 0),
|
||||
makecol(255, 255, 140), FALSE);
|
||||
return TRUE;
|
||||
makecol(255, 255, 140), false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
@ -107,8 +107,8 @@ void init_gui()
|
||||
check = jcheck_new("AI/Center after hit");
|
||||
button = jbutton_new("&Game Over");
|
||||
|
||||
jwidget_expansive(box2, TRUE);
|
||||
jwidget_expansive(entry, TRUE);
|
||||
jwidget_expansive(box2, true);
|
||||
jwidget_expansive(entry, true);
|
||||
|
||||
jwidget_add_child(window, box1);
|
||||
jwidget_add_children(box1, box2, check, button, NULL);
|
||||
@ -162,19 +162,19 @@ static bool my_manager_hook(JWidget widget, JMessage msg)
|
||||
case JM_KEYPRESSED:
|
||||
/* don't use UP & DOWN keys for focus movement */
|
||||
if (msg->key.scancode == KEY_UP || msg->key.scancode == KEY_DOWN) {
|
||||
/* returning TRUE means that we use that keys (we don't use
|
||||
/* returning true means that we use that keys (we don't use
|
||||
that keys here, but the game use them) */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case JM_DRAW:
|
||||
/* draw nothing (this avoid the default behavior: paint with the
|
||||
desktop color of the current manager's theme) */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
@ -202,8 +202,8 @@ static void calc_ball_dest(float *y);
|
||||
|
||||
void play_game()
|
||||
{
|
||||
bool gameover = FALSE;
|
||||
bool trans_mode = FALSE;
|
||||
bool gameover = false;
|
||||
bool trans_mode = false;
|
||||
BITMAP *bmp, *bmp2;
|
||||
|
||||
/* create a temporary bitmap to make double-buffered technique */
|
||||
@ -235,13 +235,13 @@ void play_game()
|
||||
/* use transparent bitmap */
|
||||
if (jwidget_pick(manager, mouse_x, mouse_y) == manager) {
|
||||
if (!trans_mode) {
|
||||
trans_mode = TRUE;
|
||||
trans_mode = true;
|
||||
ji_set_screen(bmp2);
|
||||
show_mouse(NULL);
|
||||
}
|
||||
}
|
||||
else if (trans_mode) {
|
||||
trans_mode = FALSE;
|
||||
trans_mode = false;
|
||||
ji_set_screen(bmp);
|
||||
show_mouse(NULL);
|
||||
}
|
||||
@ -256,11 +256,11 @@ void play_game()
|
||||
|
||||
/* blit to screen (with the mouse on it) */
|
||||
show_mouse(ji_screen);
|
||||
freeze_mouse_flag = TRUE;
|
||||
freeze_mouse_flag = true;
|
||||
if (trans_mode)
|
||||
draw_trans_sprite (bmp, bmp2, 0, 0);
|
||||
blit(bmp, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
|
||||
freeze_mouse_flag = FALSE;
|
||||
freeze_mouse_flag = false;
|
||||
show_mouse(NULL);
|
||||
}
|
||||
|
||||
@ -371,9 +371,9 @@ static bool move_ball(float *x, float *y, float *dx, float *dy)
|
||||
|
||||
/* ball goes out of screen */
|
||||
if (*x < 0 || *x > SCREEN_W-1)
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void calc_ball_dest(float *y)
|
||||
|
@ -67,8 +67,8 @@ int main (int argc, char *argv[])
|
||||
button_ok = jbutton_new("&OK");
|
||||
button_cancel = jbutton_new("&Cancel");
|
||||
|
||||
jwidget_expansive(label1, TRUE);
|
||||
jwidget_expansive(label2, TRUE);
|
||||
jwidget_expansive(label1, true);
|
||||
jwidget_expansive(label2, true);
|
||||
|
||||
for (c=0; c<16; c++) {
|
||||
usprintf(buf, "Option %d", c);
|
||||
@ -81,7 +81,7 @@ int main (int argc, char *argv[])
|
||||
jcombobox_add_string(combobox2, "Fourth", NULL);
|
||||
jcombobox_add_string(combobox2, "Fifth", NULL);
|
||||
jcombobox_add_string(combobox2, "Sixth", NULL);
|
||||
jcombobox_editable(combobox2, TRUE);
|
||||
jcombobox_editable(combobox2, true);
|
||||
|
||||
jwidget_add_child(window, box1);
|
||||
jwidget_add_children(box1, label1, combobox1, label2, combobox2, box2, 0);
|
||||
|
@ -75,9 +75,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
jbutton_add_command(button, read_xml);
|
||||
|
||||
jwidget_expansive(hbox, TRUE);
|
||||
jwidget_expansive(textsrc, TRUE);
|
||||
jwidget_expansive(textdst, TRUE);
|
||||
jwidget_expansive(hbox, true);
|
||||
jwidget_expansive(textsrc, true);
|
||||
jwidget_expansive(textdst, true);
|
||||
jwidget_set_min_size(textsrc, 600, 200);
|
||||
jwidget_set_min_size(textdst, 600, 200);
|
||||
|
||||
|
@ -55,8 +55,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
JWidget grid, label1, label2, label3, entry1, entry2, entry3;
|
||||
JWidget grid2, button1, button2;
|
||||
grid = jgrid_new(2, FALSE);
|
||||
grid2 = jgrid_new(2, TRUE);
|
||||
grid = jgrid_new(2, false);
|
||||
grid2 = jgrid_new(2, true);
|
||||
label1 = jlabel_new("A:");
|
||||
label2 = jlabel_new("BB:");
|
||||
label3 = jlabel_new("CCC:");
|
||||
|
@ -48,10 +48,10 @@ int main (int argc, char *argv[])
|
||||
gfxobj_init();
|
||||
|
||||
bmp = create_bitmap(320, 240);
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
|
||||
image = image_new(IMAGE_INDEXED, bmp->w, bmp->h);
|
||||
dirty = dirty_new(image, 0, 0, image->w-1, image->h-1, FALSE);
|
||||
dirty = dirty_new(image, 0, 0, image->w-1, image->h-1, false);
|
||||
brush1 = brush_new();
|
||||
brush2 = brush_new();
|
||||
|
||||
@ -83,7 +83,7 @@ int main (int argc, char *argv[])
|
||||
if (mb) {
|
||||
dirty_line_brush(dirty, (mb & 2) ? brush2: brush1,
|
||||
ox, oy, mx, my);
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
dirty_save_image_data(dirty);
|
||||
@ -98,20 +98,20 @@ int main (int argc, char *argv[])
|
||||
if (key[KEY_R]) {
|
||||
dirty_restore_image_data(dirty);
|
||||
dirty_free(dirty);
|
||||
dirty = dirty_new(image, 0, 0, image->w-1, image->h-1, FALSE);
|
||||
dirty = dirty_new(image, 0, 0, image->w-1, image->h-1, false);
|
||||
while (key[KEY_R]);
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
/* with S swap */
|
||||
if (key[KEY_S]) {
|
||||
dirty_swap(dirty);
|
||||
while (key[KEY_S]);
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
if (redraw) {
|
||||
redraw = FALSE;
|
||||
redraw = false;
|
||||
|
||||
scare_mouse();
|
||||
clear(bmp);
|
||||
|
@ -37,7 +37,7 @@ int main(int argc, char *argv[])
|
||||
set_mouse_sprite_focus(0, 0);
|
||||
show_mouse(screen);
|
||||
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
do {
|
||||
if (mouse_b) {
|
||||
int xbeg, ybeg, xend, yend, xold, yold;
|
||||
@ -57,14 +57,14 @@ int main(int argc, char *argv[])
|
||||
scare_mouse();
|
||||
|
||||
if (xold >= 0) {
|
||||
xor_mode (TRUE);
|
||||
xor_mode (true);
|
||||
rect (screen, xbeg, ybeg, xold, yold, 0xff);
|
||||
xor_mode (FALSE);
|
||||
xor_mode (false);
|
||||
}
|
||||
|
||||
xor_mode (TRUE);
|
||||
xor_mode (true);
|
||||
rect (screen, xbeg, ybeg, xold = xend, yold = yend, 0xff);
|
||||
xor_mode (FALSE);
|
||||
xor_mode (false);
|
||||
|
||||
unscare_mouse();
|
||||
}
|
||||
@ -102,20 +102,20 @@ int main(int argc, char *argv[])
|
||||
MAX (ybeg, yend) - MIN (ybeg, yend) + 1);
|
||||
}
|
||||
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
if (key[KEY_SPACE]) {
|
||||
while (key[KEY_SPACE]);
|
||||
mask_invert (mask);
|
||||
redraw = TRUE;
|
||||
redraw = true;
|
||||
}
|
||||
|
||||
if (redraw || key[KEY_R]) {
|
||||
BITMAP *bmp;
|
||||
int x, y;
|
||||
|
||||
redraw = FALSE;
|
||||
redraw = false;
|
||||
|
||||
bmp = create_bitmap (SCREEN_W, SCREEN_H);
|
||||
clear (bmp);
|
||||
|
@ -329,7 +329,7 @@ int main()
|
||||
case 4:
|
||||
if (mouse_b & 1) {
|
||||
BEZIER_NODE *node;
|
||||
node = create_bezier_node(TRUE,
|
||||
node = create_bezier_node(true,
|
||||
x[1], y[1],
|
||||
x[3], y[3],
|
||||
x[3] + x[3] - x[2], y[3] + y[3] - y[2]);
|
||||
@ -414,10 +414,10 @@ int main()
|
||||
old_y = mouse_y;
|
||||
|
||||
if (key[KEY_S])
|
||||
node->tangent = FALSE;
|
||||
node->tangent = false;
|
||||
|
||||
if (key[KEY_T])
|
||||
node->tangent = TRUE;
|
||||
node->tangent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ static void test()
|
||||
for (x=0; x<256; ++x)
|
||||
for (y=0; y<256; ++y)
|
||||
if (_int_mult(x, y) != INT_MULT(x, y, t)) {
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
static void test_grid_2x1()
|
||||
{
|
||||
JWidget grid = jgrid_new(2, FALSE);
|
||||
JWidget grid = jgrid_new(2, false);
|
||||
JWidget w1 = jwidget_new(JI_WIDGET);
|
||||
JWidget w2 = jwidget_new(JI_WIDGET);
|
||||
int req_w, req_h;
|
||||
@ -60,7 +60,7 @@ static void test_grid_2x1()
|
||||
|
||||
static void test_grid_2x1_expand2nd()
|
||||
{
|
||||
JWidget grid = jgrid_new(2, FALSE);
|
||||
JWidget grid = jgrid_new(2, false);
|
||||
JWidget w1 = jwidget_new(JI_WIDGET);
|
||||
JWidget w2 = jwidget_new(JI_WIDGET);
|
||||
JRect rect;
|
||||
@ -96,7 +96,7 @@ static void test_grid_2x1_expand2nd()
|
||||
|
||||
static void test_grid_2x1_samewidth()
|
||||
{
|
||||
JWidget grid = jgrid_new(2, TRUE);
|
||||
JWidget grid = jgrid_new(2, true);
|
||||
JWidget w1 = jwidget_new(JI_WIDGET);
|
||||
JWidget w2 = jwidget_new(JI_WIDGET);
|
||||
JRect rect;
|
||||
@ -165,7 +165,7 @@ static void test_grid_2x1_samewidth()
|
||||
*/
|
||||
static void test_grid_3x3_intrincate()
|
||||
{
|
||||
JWidget grid = jgrid_new(3, FALSE);
|
||||
JWidget grid = jgrid_new(3, false);
|
||||
JWidget w1 = jwidget_new(JI_WIDGET);
|
||||
JWidget w2 = jwidget_new(JI_WIDGET);
|
||||
JWidget w3 = jwidget_new(JI_WIDGET);
|
||||
|
@ -61,9 +61,9 @@ bool get_shrink_rect(int *x1, int *y1, int *x2, int *y2,
|
||||
0, <, image->w, ++, v, u, (*y2)--);
|
||||
|
||||
if ((*x1 > *x2) || (*y1 > *y2))
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
#undef SHRINK_SIDE
|
||||
}
|
||||
@ -106,9 +106,9 @@ bool get_shrink_rect2(int *x1, int *y1, int *x2, int *y2,
|
||||
0, <, image->w, ++, v, u, (*y2)--);
|
||||
|
||||
if ((*x1 > *x2) || (*y1 > *y2))
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
#undef SHRINK_SIDE
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ find_segment (BoundSeg *segs,
|
||||
|
||||
for (index = 0; index < ns; index++)
|
||||
if (((segs[index].x1 == x && segs[index].y1 == y) || (segs[index].x2 == x && segs[index].y2 == y)) &&
|
||||
segs[index].visited == FALSE)
|
||||
segs[index].visited == false)
|
||||
return index;
|
||||
|
||||
return -1;
|
||||
@ -471,20 +471,20 @@ sort_boundary (BoundSeg *segs,
|
||||
new_segs = NULL;
|
||||
|
||||
for (i = 0; i < ns; i++)
|
||||
segs[i].visited = FALSE;
|
||||
segs[i].visited = false;
|
||||
|
||||
num_segs = 0;
|
||||
*num_groups = 0;
|
||||
while (! empty)
|
||||
{
|
||||
empty = TRUE;
|
||||
empty = true;
|
||||
|
||||
/* find the index of a non-visited segment to start a group */
|
||||
for (i = 0; i < ns; i++)
|
||||
if (segs[i].visited == FALSE)
|
||||
if (segs[i].visited == false)
|
||||
{
|
||||
index = i;
|
||||
empty = FALSE;
|
||||
empty = false;
|
||||
i = ns;
|
||||
}
|
||||
|
||||
@ -493,7 +493,7 @@ sort_boundary (BoundSeg *segs,
|
||||
make_seg (segs[index].x1, segs[index].y1,
|
||||
segs[index].x2, segs[index].y2,
|
||||
segs[index].open);
|
||||
segs[index].visited = TRUE;
|
||||
segs[index].visited = true;
|
||||
|
||||
startx = segs[index].x1;
|
||||
starty = segs[index].y1;
|
||||
@ -520,7 +520,7 @@ sort_boundary (BoundSeg *segs,
|
||||
y = segs[index].y1;
|
||||
}
|
||||
|
||||
segs[index].visited = TRUE;
|
||||
segs[index].visited = true;
|
||||
}
|
||||
|
||||
if (x != startx || y != starty)
|
||||
|
@ -240,11 +240,11 @@ static void remove_cel(Sprite* sprite, LayerImage *layer, Cel *cel)
|
||||
if (sprite != NULL && layer->is_image() && cel != NULL) {
|
||||
/* find if the image that use the cel to remove, is used by
|
||||
another cels */
|
||||
used = FALSE;
|
||||
used = false;
|
||||
for (frame=0; frame<sprite->frames; ++frame) {
|
||||
it = layer->get_cel(frame);
|
||||
if (it != NULL && it != cel && it->image == cel->image) {
|
||||
used = TRUE;
|
||||
used = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ static bool interactive_transform(Editor* editor,
|
||||
/* TODO */
|
||||
|
||||
jview_get_scroll(view, &scroll_x, &scroll_y);
|
||||
editor->editor_set_scroll(scroll_x-x, scroll_y-y, TRUE);
|
||||
editor->editor_set_scroll(scroll_x-x, scroll_y-y, true);
|
||||
|
||||
/* editor_to_screen (widget, x1, y1, &x1, &y1); */
|
||||
/* editor_to_screen (widget, x2, y2, &x2, &y2); */
|
||||
@ -640,7 +640,7 @@ static bool interactive_transform(Editor* editor,
|
||||
if (get_use_grid() && angle == 0) {
|
||||
int ox = x1;
|
||||
int oy = y1;
|
||||
apply_grid(&x1, &y1, FALSE);
|
||||
apply_grid(&x1, &y1, false);
|
||||
x2 += x1 - ox;
|
||||
y2 += y1 - oy;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ Palette *load_col_file(const char *filename)
|
||||
#else
|
||||
int size = file_size_ex(filename);
|
||||
#endif
|
||||
int pro = (size == 768)? FALSE: TRUE; /* is Animator Pro format? */
|
||||
int pro = (size == 768)? false: true; /* is Animator Pro format? */
|
||||
div_t d = div(size-8, 3);
|
||||
Palette *pal = NULL;
|
||||
int c, r, g, b;
|
||||
|
@ -97,7 +97,7 @@ void LoadPalette(Sprite* sprite, const char *filename)
|
||||
Palette *pal = palette_load(dir->path);
|
||||
if (pal != NULL) {
|
||||
/* set the palette calling the hooks */
|
||||
set_current_palette(pal, FALSE);
|
||||
set_current_palette(pal, false);
|
||||
|
||||
/* just one palette */
|
||||
sprite_reset_palettes(sprite);
|
||||
@ -157,7 +157,7 @@ Image* NewImageFromMask(const Sprite* src_sprite)
|
||||
}
|
||||
|
||||
/* Gives to the user the possibility to move the sprite's layer in the
|
||||
current editor, returns TRUE if the position was changed. */
|
||||
current editor, returns true if the position was changed. */
|
||||
int interactive_move_layer(int mode, bool use_undo, int (*callback)())
|
||||
{
|
||||
Editor* editor = current_editor;
|
||||
@ -171,14 +171,14 @@ int interactive_move_layer(int mode, bool use_undo, int (*callback)())
|
||||
int start_y, new_y;
|
||||
int start_b;
|
||||
int ret;
|
||||
int update = FALSE;
|
||||
int update = false;
|
||||
int quiet_clock = -1;
|
||||
int first_time = TRUE;
|
||||
int first_time = true;
|
||||
int begin_x;
|
||||
int begin_y;
|
||||
|
||||
if (!cel)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
begin_x = cel->x;
|
||||
begin_y = cel->y;
|
||||
@ -207,7 +207,7 @@ int interactive_move_layer(int mode, bool use_undo, int (*callback)())
|
||||
|
||||
/* update clock */
|
||||
quiet_clock = ji_clock;
|
||||
first_time = FALSE;
|
||||
first_time = false;
|
||||
}
|
||||
|
||||
/* call the user's routine */
|
||||
@ -236,11 +236,11 @@ int interactive_move_layer(int mode, bool use_undo, int (*callback)())
|
||||
}
|
||||
|
||||
cel_set_position(cel, new_x, new_y);
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
}
|
||||
/* the position wasn't changed */
|
||||
else {
|
||||
ret = FALSE;
|
||||
ret = false;
|
||||
}
|
||||
|
||||
/* redraw the sprite in all editors */
|
||||
|
@ -38,7 +38,7 @@ void sprite_quantize(Sprite *sprite)
|
||||
|
||||
/* just one palette */
|
||||
sprite_reset_palettes(sprite);
|
||||
sprite_set_palette(sprite, palette, FALSE);
|
||||
sprite_set_palette(sprite, palette, false);
|
||||
|
||||
palette_free(palette);
|
||||
}
|
||||
@ -52,7 +52,7 @@ void sprite_quantize_ex(Sprite *sprite, Palette *palette)
|
||||
int c, nimage;
|
||||
|
||||
images = images_ref_get_from_sprite(sprite, TARGET_ALL_LAYERS |
|
||||
TARGET_ALL_FRAMES, FALSE);
|
||||
TARGET_ALL_FRAMES, false);
|
||||
if (images != NULL) {
|
||||
/* add a flat image with the current sprite's frame rendered */
|
||||
flat_image = image_new(sprite->imgtype, sprite->w, sprite->h);
|
||||
@ -86,7 +86,7 @@ void sprite_quantize_ex(Sprite *sprite, Palette *palette)
|
||||
for (c=0; c<nimage; c++)
|
||||
ibmp[c] = 128;
|
||||
|
||||
quantize_bitmaps(image_array, nimage, rgbpal, ibmp, TRUE);
|
||||
quantize_bitmaps(image_array, nimage, rgbpal, ibmp, true);
|
||||
|
||||
palette_from_allegro(palette, rgbpal);
|
||||
|
||||
|
@ -134,7 +134,7 @@ void rec_screen_poll()
|
||||
old_flag = freeze_mouse_flag;
|
||||
|
||||
/* freeze the mouse obligatory */
|
||||
freeze_mouse_flag = TRUE;
|
||||
freeze_mouse_flag = true;
|
||||
|
||||
/* get the active palette color */
|
||||
for (c=i=0; c<256; c++) {
|
||||
|
@ -376,26 +376,26 @@ Image *render_sprite(Sprite *sprite,
|
||||
global_opacity = 255;
|
||||
|
||||
render_layer(sprite, sprite->get_folder(), image, source_x, source_y,
|
||||
frame, zoom, zoomed_func, TRUE, FALSE);
|
||||
frame, zoom, zoomed_func, true, false);
|
||||
|
||||
/* draw transparent layers of the previous frame with opacity=128 */
|
||||
color_map = orig_trans_map;
|
||||
global_opacity = 128;
|
||||
|
||||
render_layer(sprite, sprite->get_folder(), image, source_x, source_y,
|
||||
frame-1, zoom, zoomed_func, FALSE, TRUE);
|
||||
frame-1, zoom, zoomed_func, false, true);
|
||||
|
||||
/* draw transparent layers of the current frame with opacity=255 */
|
||||
color_map = NULL;
|
||||
global_opacity = 255;
|
||||
|
||||
render_layer(sprite, sprite->get_folder(), image, source_x, source_y,
|
||||
frame, zoom, zoomed_func, FALSE, TRUE);
|
||||
frame, zoom, zoomed_func, false, true);
|
||||
}
|
||||
// just draw the current frame
|
||||
else {
|
||||
render_layer(sprite, sprite->get_folder(), image, source_x, source_y,
|
||||
frame, zoom, zoomed_func, TRUE, TRUE);
|
||||
frame, zoom, zoomed_func, true, true);
|
||||
}
|
||||
|
||||
return image;
|
||||
|
@ -278,7 +278,7 @@ static bool colorbar_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
case JM_REQSIZE:
|
||||
msg->reqsize.w = msg->reqsize.h = 24;
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_DRAW: {
|
||||
SkinneableTheme* theme = static_cast<SkinneableTheme*>(widget->theme);
|
||||
@ -362,7 +362,7 @@ static bool colorbar_msg_proc(JWidget widget, JMessage msg)
|
||||
doublebuffer->w,
|
||||
doublebuffer->h);
|
||||
destroy_bitmap(doublebuffer);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_BUTTONPRESSED:
|
||||
@ -448,7 +448,7 @@ static bool colorbar_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_MOUSELEAVE:
|
||||
@ -491,11 +491,11 @@ static bool colorbar_msg_proc(JWidget widget, JMessage msg)
|
||||
if (colorbar->hot_drag != HOTCOLOR_NONE &&
|
||||
colorbar->hot_drag != colorbar->hot_drop) {
|
||||
jmouse_set_cursor(JI_CURSOR_MOVE);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (colorbar->hot != HOTCOLOR_NONE) {
|
||||
jmouse_set_cursor(JI_CURSOR_EYEDROPPER);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -518,7 +518,7 @@ static bool colorbar_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static color_t colorbar_get_hotcolor(JWidget widget, hotcolor_t hot)
|
||||
@ -541,7 +541,7 @@ static void colorbar_set_hotcolor(JWidget widget, hotcolor_t hot, color_t color)
|
||||
|
||||
switch (hot) {
|
||||
case HOTCOLOR_NONE:
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
break;
|
||||
case HOTCOLOR_FGCOLOR:
|
||||
colorbar->fgcolor = color;
|
||||
@ -597,7 +597,7 @@ static void colorbar_open_tooltip(JWidget widget, int x1, int x2, int y1, int y2
|
||||
|
||||
switch (colorbar->hot) {
|
||||
case HOTCOLOR_NONE:
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
break;
|
||||
case HOTCOLOR_FGCOLOR: {
|
||||
ustrcpy(buf, _("Foreground Color"));
|
||||
@ -696,8 +696,8 @@ static bool tooltip_window_msg_proc(JWidget widget, JMessage msg)
|
||||
the current palette in
|
||||
this point... */
|
||||
|
||||
sprite_set_palette(sprite_writer, pal, FALSE);
|
||||
set_current_palette(pal, TRUE);
|
||||
sprite_set_palette(sprite_writer, pal, false);
|
||||
set_current_palette(pal, true);
|
||||
}
|
||||
|
||||
update_editors_with_sprite(sprite);
|
||||
@ -768,8 +768,8 @@ static bool tooltip_window_msg_proc(JWidget widget, JMessage msg)
|
||||
the current palette in
|
||||
this point... */
|
||||
|
||||
sprite_set_palette(sprite, pal, FALSE);
|
||||
set_current_palette(pal, TRUE);
|
||||
sprite_set_palette(sprite, pal, false);
|
||||
set_current_palette(pal, true);
|
||||
|
||||
jmanager_start_timer(colorbar->refresh_timer_id);
|
||||
}
|
||||
@ -787,7 +787,7 @@ static bool tooltip_window_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void update_status_bar(color_t color, int msecs)
|
||||
|
@ -56,7 +56,7 @@ JWidget colorbutton_new(color_t color, int imgtype)
|
||||
|
||||
jwidget_add_hook(widget, colorbutton_type(),
|
||||
colorbutton_msg_proc, colorbutton);
|
||||
jwidget_focusrest(widget, TRUE);
|
||||
jwidget_focusrest(widget, true);
|
||||
|
||||
return widget;
|
||||
}
|
||||
@ -119,7 +119,7 @@ static bool colorbutton_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
msg->reqsize.w = jrect_w(&box) + widget->border_width.l + widget->border_width.r;
|
||||
msg->reqsize.h = jrect_h(&box) + widget->border_width.t + widget->border_width.b;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_MOUSEENTER:
|
||||
@ -128,20 +128,20 @@ static bool colorbutton_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
case JM_DRAW:
|
||||
colorbutton_draw(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_SIGNAL:
|
||||
if (msg->signal.num == JI_SIGNAL_BUTTON_SELECT) {
|
||||
colorbutton_close_tooltip(widget);
|
||||
jwidget_hard_capture_mouse(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case JM_BUTTONPRESSED:
|
||||
if (jwidget_has_capture(widget) &&
|
||||
widget->flags & JI_HARDCAPTURE) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -190,7 +190,7 @@ static bool colorbutton_msg_proc(JWidget widget, JMessage msg)
|
||||
jwidget_emit_signal(widget, SIGNAL_COLORBUTTON_CHANGE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -205,13 +205,13 @@ static bool colorbutton_msg_proc(JWidget widget, JMessage msg)
|
||||
if (jwidget_has_capture(widget) &&
|
||||
widget->flags & JI_HARDCAPTURE) {
|
||||
jmouse_set_cursor(JI_CURSOR_EYEDROPPER);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void colorbutton_draw(JWidget widget)
|
||||
@ -230,11 +230,11 @@ static void colorbutton_draw(JWidget widget)
|
||||
colorbutton->imgtype,
|
||||
colorbutton->color,
|
||||
jwidget_has_mouse(widget),
|
||||
FALSE, ji_color_face());
|
||||
false, ji_color_face());
|
||||
|
||||
/* draw text */
|
||||
color_to_formalstring(colorbutton->imgtype,
|
||||
colorbutton->color, buf, sizeof(buf), FALSE);
|
||||
colorbutton->color, buf, sizeof(buf), false);
|
||||
|
||||
widget->setTextQuiet(buf);
|
||||
jwidget_get_texticon_info(widget, &box, &text, &icon, 0, 0, 0);
|
||||
@ -242,7 +242,7 @@ static void colorbutton_draw(JWidget widget)
|
||||
rectfill(ji_screen, text.x1, text.y1, text.x2-1, text.y2-1, makecol(0, 0, 0));
|
||||
jdraw_text(widget->getFont(), widget->getText(), text.x1, text.y1,
|
||||
makecol(255, 255, 255),
|
||||
makecol(0, 0, 0), FALSE);
|
||||
makecol(0, 0, 0), false);
|
||||
}
|
||||
|
||||
static void colorbutton_open_tooltip(JWidget widget)
|
||||
@ -315,5 +315,5 @@ static bool tooltip_window_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
@ -89,10 +89,10 @@ static Model models[] = {
|
||||
Frame* colorselector_new(bool editable_palette)
|
||||
{
|
||||
Frame* window = new TipWindow("");
|
||||
JWidget grid1 = jgrid_new(3, FALSE);
|
||||
JWidget grid2 = jgrid_new(5, FALSE);
|
||||
JWidget grid1 = jgrid_new(3, false);
|
||||
JWidget grid2 = jgrid_new(5, false);
|
||||
JWidget tabs = tabs_new(select_tab_callback);
|
||||
JWidget pal = paledit_new(get_current_palette(), FALSE, 1);
|
||||
JWidget pal = paledit_new(get_current_palette(), false, 1);
|
||||
JWidget idx = jlabel_new("None");
|
||||
JWidget lock = jbutton_new("");
|
||||
JWidget child;
|
||||
@ -107,7 +107,7 @@ Frame* colorselector_new(bool editable_palette)
|
||||
|
||||
/* color selector */
|
||||
colorselector->color = color_mask();
|
||||
colorselector->palette_locked = TRUE;
|
||||
colorselector->palette_locked = true;
|
||||
colorselector->editable_palette = editable_palette;
|
||||
|
||||
/* palette */
|
||||
@ -122,7 +122,7 @@ Frame* colorselector_new(bool editable_palette)
|
||||
/* data for a better layout */
|
||||
grid1->child_spacing = 0;
|
||||
grid2->border_width.t = 3;
|
||||
jwidget_expansive(grid2, TRUE);
|
||||
jwidget_expansive(grid2, true);
|
||||
|
||||
/* append a tab for each color-model */
|
||||
for (m=models; m->text!=NULL; ++m) {
|
||||
@ -158,7 +158,7 @@ Frame* colorselector_new(bool editable_palette)
|
||||
|
||||
void colorselector_set_color(JWidget widget, color_t color)
|
||||
{
|
||||
colorselector_set_color2(widget, color, TRUE, TRUE, NULL);
|
||||
colorselector_set_color2(widget, color, true, true, NULL);
|
||||
}
|
||||
|
||||
color_t colorselector_get_color(JWidget widget)
|
||||
@ -175,7 +175,7 @@ JWidget colorselector_get_paledit(JWidget widget)
|
||||
|
||||
static JWidget create_rgb_container()
|
||||
{
|
||||
JWidget grid = jgrid_new(2, FALSE);
|
||||
JWidget grid = jgrid_new(2, false);
|
||||
JWidget rlabel = jlabel_new("R");
|
||||
JWidget glabel = jlabel_new("G");
|
||||
JWidget blabel = jlabel_new("B");
|
||||
@ -202,7 +202,7 @@ static JWidget create_rgb_container()
|
||||
|
||||
static JWidget create_hsv_container()
|
||||
{
|
||||
JWidget grid = jgrid_new(2, FALSE);
|
||||
JWidget grid = jgrid_new(2, false);
|
||||
JWidget hlabel = jlabel_new("H");
|
||||
JWidget slabel = jlabel_new("S");
|
||||
JWidget vlabel = jlabel_new("V");
|
||||
@ -229,7 +229,7 @@ static JWidget create_hsv_container()
|
||||
|
||||
static JWidget create_gray_container()
|
||||
{
|
||||
JWidget grid = jgrid_new(2, FALSE);
|
||||
JWidget grid = jgrid_new(2, false);
|
||||
JWidget klabel = jlabel_new("V");
|
||||
JWidget vslider = jslider_new(0, 255, 0);
|
||||
jgrid_add_child(grid, klabel, 1, 1, JI_RIGHT);
|
||||
@ -288,7 +288,7 @@ static bool colorselector_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void colorselector_update_lock_button(JWidget widget)
|
||||
@ -359,7 +359,7 @@ static void colorselector_set_color2(JWidget widget, color_t color,
|
||||
m = models+MODEL_GRAY;
|
||||
break;
|
||||
default:
|
||||
assert(FALSE);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
tabs_select_tab(tabs, m);
|
||||
@ -372,7 +372,7 @@ static void colorselector_set_color2(JWidget widget, color_t color,
|
||||
select_index_entry);
|
||||
break;
|
||||
case COLOR_TYPE_MASK:
|
||||
colorselector_set_paledit_index(widget, 0, TRUE);
|
||||
colorselector_set_paledit_index(widget, 0, true);
|
||||
break;
|
||||
default: {
|
||||
int r = color_get_red (IMAGE_RGB, color);
|
||||
@ -380,9 +380,9 @@ static void colorselector_set_color2(JWidget widget, color_t color,
|
||||
int b = color_get_blue (IMAGE_RGB, color);
|
||||
int i = palette_find_bestfit(get_current_palette(), r, g, b);
|
||||
if (i >= 0 && i < 256)
|
||||
colorselector_set_paledit_index(widget, i, TRUE);
|
||||
colorselector_set_paledit_index(widget, i, true);
|
||||
else
|
||||
colorselector_set_paledit_index(widget, -1, TRUE);
|
||||
colorselector_set_paledit_index(widget, -1, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -426,7 +426,7 @@ static void select_tab_callback(JWidget tabs, void* data, int button)
|
||||
Model* selected_model = (Model*)data;
|
||||
JWidget child;
|
||||
Model* m;
|
||||
bool something_change = FALSE;
|
||||
bool something_change = false;
|
||||
|
||||
for (m=models; m->text!=NULL; ++m) {
|
||||
child = jwidget_find_name(window, m->text);
|
||||
@ -434,13 +434,13 @@ static void select_tab_callback(JWidget tabs, void* data, int button)
|
||||
if (m == selected_model) {
|
||||
if (child->flags & JI_HIDDEN) {
|
||||
jwidget_show(child);
|
||||
something_change = TRUE;
|
||||
something_change = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!(child->flags & JI_HIDDEN)) {
|
||||
jwidget_hide(child);
|
||||
something_change = TRUE;
|
||||
something_change = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -497,7 +497,7 @@ static bool slider_change_hook(JWidget widget, void* data)
|
||||
if (colorselector->palette_locked) {
|
||||
i = palette_find_bestfit(get_current_palette(), r, g, b);
|
||||
if (i >= 0 && i < 256)
|
||||
colorselector_set_paledit_index(window, i, TRUE);
|
||||
colorselector_set_paledit_index(window, i, true);
|
||||
}
|
||||
/* the palette is unlocked, we have to modify the select entries */
|
||||
else {
|
||||
@ -515,7 +515,7 @@ static bool slider_change_hook(JWidget widget, void* data)
|
||||
color = color_index(i);
|
||||
}
|
||||
|
||||
colorselector_set_color2(window, color, FALSE, FALSE, m);
|
||||
colorselector_set_color2(window, color, false, false, m);
|
||||
jwidget_emit_signal(window, SIGNAL_COLORSELECTOR_COLOR_CHANGED);
|
||||
return 0;
|
||||
}
|
||||
@ -525,7 +525,7 @@ static bool button_mask_select_hook(JWidget widget, void* data)
|
||||
Frame* window = static_cast<Frame*>(widget->getRoot());
|
||||
colorselector_set_color(window, color_mask());
|
||||
jwidget_emit_signal(window, SIGNAL_COLORSELECTOR_COLOR_CHANGED);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool paledit_change_hook(JWidget widget, void* data)
|
||||
@ -542,7 +542,7 @@ static bool paledit_change_hook(JWidget widget, void* data)
|
||||
break;
|
||||
}
|
||||
|
||||
colorselector_set_color2(window, color, TRUE, FALSE, NULL);
|
||||
colorselector_set_color2(window, color, true, false, NULL);
|
||||
jwidget_emit_signal(window, SIGNAL_COLORSELECTOR_COLOR_CHANGED);
|
||||
return 0;
|
||||
}
|
||||
@ -554,5 +554,5 @@ static bool lock_button_select_hook(JWidget widget, void* data)
|
||||
|
||||
colorselector->palette_locked = !colorselector->palette_locked;
|
||||
colorselector_update_lock_button(window);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ JWidget colorviewer_new(color_t color, int imgtype)
|
||||
|
||||
jwidget_add_hook(widget, colorviewer_type(),
|
||||
colorviewer_msg_proc, colorviewer);
|
||||
jwidget_focusrest(widget, TRUE);
|
||||
jwidget_focusrest(widget, true);
|
||||
jwidget_set_border(widget, 2, 2, 2, 2);
|
||||
widget->setAlign(JI_CENTER | JI_MIDDLE);
|
||||
|
||||
@ -110,7 +110,7 @@ static bool colorviewer_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
msg->reqsize.w += widget->border_width.l + widget->border_width.r;
|
||||
msg->reqsize.h += widget->border_width.t + widget->border_width.b;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_DRAW: {
|
||||
@ -135,24 +135,24 @@ static bool colorviewer_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
/* draw text */
|
||||
color_to_formalstring(colorviewer->imgtype,
|
||||
colorviewer->color, buf, sizeof(buf), FALSE);
|
||||
colorviewer->color, buf, sizeof(buf), false);
|
||||
|
||||
widget->setTextQuiet(buf);
|
||||
jwidget_get_texticon_info(widget, &box, &text, &icon, 0, 0, 0);
|
||||
|
||||
jdraw_rectfill(&text, makecol(0, 0, 0));
|
||||
jdraw_text(widget->getFont(), widget->getText(), text.x1, text.y1,
|
||||
makecol(255, 255, 255), makecol(0, 0, 0), FALSE);
|
||||
makecol(255, 255, 255), makecol(0, 0, 0), false);
|
||||
|
||||
jrect_free(rect);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_BUTTONPRESSED:
|
||||
jwidget_emit_signal(widget, SIGNAL_COLORVIEWER_SELECT);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg)
|
||||
msg->reqsize.w = widget->border_width.l + 1 + widget->border_width.r;
|
||||
msg->reqsize.h = widget->border_width.t + 1 + widget->border_width.b;
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_KEYPRESSED: {
|
||||
@ -197,9 +197,9 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_DRAW: {
|
||||
@ -259,7 +259,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg)
|
||||
blit(bmp, ji_screen,
|
||||
0, 0, widget->rc->x1, widget->rc->y1, bmp->w, bmp->h);
|
||||
destroy_bitmap(bmp);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_BUTTONPRESSED:
|
||||
@ -291,7 +291,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg)
|
||||
jwidget_dirty(widget);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
/* edit node */
|
||||
else {
|
||||
@ -379,7 +379,7 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg)
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#if 0 /* TODO */
|
||||
/* if the mouse move above a curve_editor, the focus change to
|
||||
@ -414,12 +414,12 @@ static bool curve_editor_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
|
||||
curve_editor->status = STATUS_STANDBY;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static CurvePoint* curve_editor_get_more_close_point(JWidget widget,
|
||||
@ -489,12 +489,12 @@ static int edit_node_manual(CurvePoint* point)
|
||||
if (window->get_killer() == button_ok) {
|
||||
point->x = entry_x->getTextDouble();
|
||||
point->y = entry_y->getTextDouble();
|
||||
res = TRUE;
|
||||
res = true;
|
||||
}
|
||||
else {
|
||||
point->x = point_copy.x;
|
||||
point->y = point_copy.y;
|
||||
res = FALSE;
|
||||
res = false;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -51,7 +51,7 @@ static int click_prev_last_b;
|
||||
void Editor::editor_click_start(int mode, int *x, int *y, int *b)
|
||||
{
|
||||
click_mode = mode;
|
||||
click_first = TRUE;
|
||||
click_first = true;
|
||||
|
||||
click_start_x = click_last_x = jmouse_x(0);
|
||||
click_start_y = click_last_y = jmouse_y(0);
|
||||
@ -68,7 +68,7 @@ void Editor::editor_click_start(int mode, int *x, int *y, int *b)
|
||||
void Editor::editor_click_continue(int mode, int *x, int *y)
|
||||
{
|
||||
click_mode = mode;
|
||||
click_first = TRUE;
|
||||
click_first = true;
|
||||
|
||||
click_start_x = click_last_x = jmouse_x(0);
|
||||
click_start_y = click_last_y = jmouse_y(0);
|
||||
@ -83,7 +83,7 @@ void Editor::editor_click_done()
|
||||
clear_keybuf();
|
||||
}
|
||||
|
||||
/* returns FALSE when the user stop the click-loop: releases the
|
||||
/* returns false when the user stop the click-loop: releases the
|
||||
button or press the second click (depend of the mode) */
|
||||
int Editor::editor_click(int *x, int *y, int *update,
|
||||
void (*scroll_callback) (int before_change))
|
||||
@ -93,7 +93,7 @@ int Editor::editor_click(int *x, int *y, int *update,
|
||||
poll_keyboard();
|
||||
|
||||
if (click_first) {
|
||||
click_first = FALSE;
|
||||
click_first = false;
|
||||
|
||||
if (click_mode == MODE_CLICKANDCLICK) {
|
||||
do {
|
||||
@ -129,10 +129,10 @@ int Editor::editor_click(int *x, int *y, int *update,
|
||||
int scroll_x, scroll_y;
|
||||
|
||||
if (scroll_callback)
|
||||
(*scroll_callback)(TRUE);
|
||||
(*scroll_callback)(true);
|
||||
|
||||
/* smooth scroll movement */
|
||||
if (get_config_bool("Options", "MoveSmooth", TRUE)) {
|
||||
if (get_config_bool("Options", "MoveSmooth", true)) {
|
||||
jmouse_set_position(MID(vp->x1+1, click_last_x, vp->x2-2),
|
||||
MID(vp->y1+1, click_last_y, vp->y2-2));
|
||||
}
|
||||
@ -147,13 +147,13 @@ int Editor::editor_click(int *x, int *y, int *update,
|
||||
|
||||
jview_get_scroll(view, &scroll_x, &scroll_y);
|
||||
editor_set_scroll(scroll_x+click_last_x-jmouse_x(0),
|
||||
scroll_y+click_last_y-jmouse_y(0), TRUE);
|
||||
scroll_y+click_last_y-jmouse_y(0), true);
|
||||
|
||||
click_last_x = jmouse_x(0);
|
||||
click_last_y = jmouse_y(0);
|
||||
|
||||
if (scroll_callback)
|
||||
(*scroll_callback)(FALSE);
|
||||
(*scroll_callback)(false);
|
||||
}
|
||||
|
||||
/* if the cursor hasn't subpixel movement */
|
||||
@ -182,15 +182,15 @@ int Editor::editor_click(int *x, int *y, int *update,
|
||||
jmouse_set_position(click_last_x, click_last_y);
|
||||
clear_keybuf();
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* click-and-release mode */
|
||||
else {
|
||||
return (click_last_b) ? TRUE: FALSE;
|
||||
return (click_last_b) ? true: false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,7 +600,7 @@ void Editor::editor_update_statusbar_for_standby()
|
||||
color_to_formalstring(m_sprite->imgtype,
|
||||
color,
|
||||
buf+ustrlen(buf),
|
||||
sizeof(buf)-ustrlen(buf), TRUE);
|
||||
sizeof(buf)-ustrlen(buf), true);
|
||||
}
|
||||
else {
|
||||
usprintf(buf, "%s", _("Transparent"));
|
||||
@ -668,7 +668,7 @@ static bool editor_view_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
jrect_copy(widget->rc, &msg->setpos.rect);
|
||||
jview_update(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_DRAW:
|
||||
{
|
||||
@ -684,10 +684,10 @@ static bool editor_view_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
jrect_free(pos);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
@ -702,7 +702,7 @@ bool Editor::msg_proc(JMessage msg)
|
||||
|
||||
case JM_REQSIZE:
|
||||
editor_request_size(&msg->reqsize.w, &msg->reqsize.h);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_CLOSE:
|
||||
// if (m_refresh_region)
|
||||
@ -771,7 +771,7 @@ bool Editor::msg_proc(JMessage msg)
|
||||
if (msg->draw.count == 0)
|
||||
m_old_cursor_thick = 0;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_TIMER:
|
||||
@ -838,12 +838,12 @@ bool Editor::msg_proc(JMessage msg)
|
||||
"||&Close"));
|
||||
}
|
||||
else {
|
||||
bool click2 = get_config_bool("Options", "MoveClick2", FALSE);
|
||||
bool click2 = get_config_bool("Options", "MoveClick2", false);
|
||||
interactive_move_layer(click2 ? MODE_CLICKANDCLICK:
|
||||
MODE_CLICKANDRELEASE,
|
||||
TRUE, NULL);
|
||||
true, NULL);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* call the eyedropper command */
|
||||
@ -878,7 +878,7 @@ bool Editor::msg_proc(JMessage msg)
|
||||
|
||||
jview_get_scroll(view, &scroll_x, &scroll_y);
|
||||
editor_set_scroll(scroll_x+jmouse_x(1)-jmouse_x(0),
|
||||
scroll_y+jmouse_y(1)-jmouse_y(0), TRUE);
|
||||
scroll_y+jmouse_y(1)-jmouse_y(0), true);
|
||||
|
||||
jmouse_control_infinite_scroll(vp);
|
||||
jrect_free(vp);
|
||||
@ -931,7 +931,7 @@ bool Editor::msg_proc(JMessage msg)
|
||||
m_sprite->w, m_sprite->h);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_BUTTONRELEASED:
|
||||
@ -942,32 +942,32 @@ bool Editor::msg_proc(JMessage msg)
|
||||
editor_setcursor(msg->mouse.x, msg->mouse.y);
|
||||
|
||||
jwidget_release_mouse(this);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_KEYPRESSED:
|
||||
if (editor_keys_toset_zoom(msg->key.scancode) ||
|
||||
editor_keys_toset_brushsize(msg->key.scancode))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (jwidget_has_mouse(this)) {
|
||||
switch (msg->key.scancode) {
|
||||
|
||||
/* eye-dropper is activated with ALT key */
|
||||
case KEY_ALT:
|
||||
m_alt_pressed = TRUE;
|
||||
m_alt_pressed = true;
|
||||
editor_setcursor(jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case KEY_LCONTROL:
|
||||
case KEY_RCONTROL:
|
||||
m_ctrl_pressed = TRUE;
|
||||
m_ctrl_pressed = true;
|
||||
editor_setcursor(jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case KEY_SPACE:
|
||||
m_space_pressed = TRUE;
|
||||
m_space_pressed = true;
|
||||
editor_setcursor(jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -978,18 +978,18 @@ bool Editor::msg_proc(JMessage msg)
|
||||
/* eye-dropper is deactivated with ALT key */
|
||||
case KEY_ALT:
|
||||
if (m_alt_pressed) {
|
||||
m_alt_pressed = FALSE;
|
||||
m_alt_pressed = false;
|
||||
editor_setcursor(jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case KEY_LCONTROL:
|
||||
case KEY_RCONTROL:
|
||||
if (m_ctrl_pressed) {
|
||||
m_ctrl_pressed = FALSE;
|
||||
m_ctrl_pressed = false;
|
||||
editor_setcursor(jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -998,9 +998,9 @@ bool Editor::msg_proc(JMessage msg)
|
||||
/* we have to clear all the KEY_SPACE in buffer */
|
||||
clear_keybuf();
|
||||
|
||||
m_space_pressed = FALSE;
|
||||
m_space_pressed = false;
|
||||
editor_setcursor(jmouse_x(0), jmouse_y(0));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1038,7 +1038,7 @@ bool Editor::msg_proc(JMessage msg)
|
||||
|
||||
if ((m_cursor_editor_x != (vp->x1+vp->x2)/2) ||
|
||||
(m_cursor_editor_y != (vp->y1+vp->y2)/2)) {
|
||||
int use_refresh_region = (m_zoom == zoom) ? TRUE: FALSE;
|
||||
int use_refresh_region = (m_zoom == zoom) ? true: false;
|
||||
|
||||
m_zoom = zoom;
|
||||
|
||||
@ -1078,7 +1078,7 @@ bool Editor::msg_proc(JMessage msg)
|
||||
jmouse_hide();
|
||||
if (thick)
|
||||
editor_clean_cursor();
|
||||
editor_set_scroll(scroll_x+dx, scroll_y+dy, TRUE);
|
||||
editor_set_scroll(scroll_x+dx, scroll_y+dy, true);
|
||||
if (thick)
|
||||
editor_draw_cursor(jmouse_x(0), jmouse_y(0));
|
||||
jmouse_show();
|
||||
@ -1091,7 +1091,7 @@ bool Editor::msg_proc(JMessage msg)
|
||||
|
||||
case JM_SETCURSOR:
|
||||
editor_setcursor(msg->mouse.x, msg->mouse.y);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ bool Editor::editor_keys_toset_zoom(int scancode)
|
||||
if ((m_zoom != zoom) ||
|
||||
(m_cursor_editor_x != (vp->x1+vp->x2)/2) ||
|
||||
(m_cursor_editor_y != (vp->y1+vp->y2)/2)) {
|
||||
int use_refresh_region = (m_zoom == zoom) ? TRUE: FALSE;
|
||||
int use_refresh_region = (m_zoom == zoom) ? true: false;
|
||||
|
||||
m_zoom = zoom;
|
||||
|
||||
@ -98,14 +98,14 @@ bool Editor::editor_keys_toset_brushsize(int scancode)
|
||||
if (scancode == KEY_MINUS_PAD) {
|
||||
if (get_brush_size () > 1)
|
||||
set_brush_size (get_brush_size ()-1);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (scancode == KEY_PLUS_PAD) {
|
||||
if (get_brush_size () < 32)
|
||||
set_brush_size (get_brush_size ()+1);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
@ -105,10 +105,10 @@ JWidget fileview_new(FileItem *start_folder, const jstring& exts)
|
||||
|
||||
jwidget_add_hook(widget, fileview_type(),
|
||||
fileview_msg_proc, fileview);
|
||||
jwidget_focusrest(widget, TRUE);
|
||||
jwidget_focusrest(widget, true);
|
||||
|
||||
fileview->current_folder = start_folder;
|
||||
fileview->req_valid = FALSE;
|
||||
fileview->req_valid = false;
|
||||
fileview->selected = NULL;
|
||||
fileview->exts = exts;
|
||||
|
||||
@ -149,7 +149,7 @@ void fileview_set_current_folder(JWidget widget, FileItem *folder)
|
||||
assert(fileitem_is_browsable(folder));
|
||||
|
||||
fileview->current_folder = folder;
|
||||
fileview->req_valid = FALSE;
|
||||
fileview->req_valid = false;
|
||||
fileview->selected = NULL;
|
||||
|
||||
fileview_regenerate_list(widget);
|
||||
@ -223,14 +223,14 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
h += ih;
|
||||
}
|
||||
|
||||
fileview->req_valid = TRUE;
|
||||
fileview->req_valid = true;
|
||||
fileview->req_w = w;
|
||||
fileview->req_h = h;
|
||||
}
|
||||
|
||||
msg->reqsize.w = fileview->req_w;
|
||||
msg->reqsize.h = fileview->req_h;
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_DRAW: {
|
||||
JWidget view = jwidget_get_view(widget);
|
||||
@ -273,7 +273,7 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
jdraw_text(widget->getFont(),
|
||||
"[+]", x, y+2,
|
||||
fgcolor, bgcolor, TRUE);
|
||||
fgcolor, bgcolor, true);
|
||||
|
||||
// background for the icon
|
||||
jrectexclude(ji_screen,
|
||||
@ -300,7 +300,7 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
// item name
|
||||
jdraw_text(widget->getFont(),
|
||||
fileitem_get_displayname(fi).c_str(), x, y+2,
|
||||
fgcolor, bgcolor, TRUE);
|
||||
fgcolor, bgcolor, true);
|
||||
|
||||
// background for the item name
|
||||
jrectexclude(ji_screen,
|
||||
@ -472,23 +472,23 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
if (fileview->selected) {
|
||||
if (fileitem_is_browsable(fileview->selected)) {
|
||||
fileview_set_current_folder(widget, fileview->selected);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (fileitem_is_folder(fileview->selected)) {
|
||||
// do nothing (is a folder but not browseable
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
// a file was selected
|
||||
jwidget_emit_signal(widget, SIGNAL_FILEVIEW_FILE_ACCEPT);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
case KEY_BACKSPACE:
|
||||
fileview_goup(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
default:
|
||||
if (msg->key.ascii == ' ' ||
|
||||
(utolower(msg->key.ascii) >= 'a' &&
|
||||
@ -520,12 +520,12 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
/* go to fileview_select_index... */
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bottom > 0)
|
||||
fileview_select_index(widget, MID(0, select, bottom-1));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -548,11 +548,11 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
if (fileview->selected) {
|
||||
if (fileitem_is_browsable(fileview->selected)) {
|
||||
fileview_set_current_folder(widget, fileview->selected);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
jwidget_emit_signal(widget, SIGNAL_FILEVIEW_FILE_ACCEPT);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -571,7 +571,7 @@ static bool fileview_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void fileview_get_fileitem_size(JWidget widget, FileItem *fi, int *w, int *h)
|
||||
|
@ -139,20 +139,20 @@ static int select_button(JWidget widget, int index)
|
||||
if (widget->type == JI_RADIO) {
|
||||
if ((size_t)widget->user_data[1] == index) {
|
||||
jwidget_select(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
JI_LIST_FOR_EACH(widget->children, link)
|
||||
if (select_button(reinterpret_cast<JWidget>(link->data), index))
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool radio_change_hook(JWidget widget, void *data)
|
||||
{
|
||||
jwidget_emit_signal((JWidget)data, SIGNAL_GROUP_BUTTON_CHANGE);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ JWidget paledit_new(Palette *palette, bool editable, int boxsize)
|
||||
paledit->color[1] = -1;
|
||||
|
||||
jwidget_add_hook(widget, paledit_type(), paledit_msg_proc, paledit);
|
||||
jwidget_focusrest(widget, TRUE);
|
||||
jwidget_focusrest(widget, true);
|
||||
|
||||
widget->border_width.l = widget->border_width.r = 1;
|
||||
widget->border_width.t = widget->border_width.b = 1;
|
||||
@ -305,7 +305,7 @@ void paledit_move_selection(JWidget widget, int x, int y)
|
||||
paledit_update_scroll(widget, paledit->color[1]);
|
||||
|
||||
/* set the palette */
|
||||
set_current_palette(paledit->palette, FALSE);
|
||||
set_current_palette(paledit->palette, false);
|
||||
|
||||
/* refresh the screen */
|
||||
jmanager_refresh_screen();
|
||||
@ -327,13 +327,13 @@ void paledit_get_selected_entries(JWidget widget, bool array[256])
|
||||
{
|
||||
PalEdit *paledit = paledit_data(widget);
|
||||
|
||||
memset(array, FALSE, sizeof(bool)*256);
|
||||
memset(array, false, sizeof(bool)*256);
|
||||
|
||||
switch (paledit->range_type) {
|
||||
|
||||
case PALETTE_EDITOR_RANGE_NONE:
|
||||
if (paledit->color[1] >= 0)
|
||||
array[paledit->color[1]] = TRUE;
|
||||
array[paledit->color[1]] = true;
|
||||
break;
|
||||
|
||||
case PALETTE_EDITOR_RANGE_LINEAL: {
|
||||
@ -342,7 +342,7 @@ void paledit_get_selected_entries(JWidget widget, bool array[256])
|
||||
int c;
|
||||
|
||||
for (c=c1; c<=c2; c++)
|
||||
array[c] = TRUE;
|
||||
array[c] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ void paledit_get_selected_entries(JWidget widget, bool array[256])
|
||||
|
||||
for (y=y1; y<=y2; y++)
|
||||
for (x=x1; x<=x2; x++)
|
||||
array[y*cols + x] = TRUE;
|
||||
array[y*cols + x] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -392,7 +392,7 @@ static bool paledit_msg_proc(JWidget widget, JMessage msg)
|
||||
|
||||
case JM_REQSIZE:
|
||||
paledit_request_size(widget, &msg->reqsize.w, &msg->reqsize.h);
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
case JM_KEYPRESSED:
|
||||
if (jwidget_has_focus(widget)) {
|
||||
@ -406,9 +406,9 @@ static bool paledit_msg_proc(JWidget widget, JMessage msg)
|
||||
case KEY_DOWN: paledit_move_selection(widget, 0, +1); break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -613,16 +613,16 @@ static bool paledit_msg_proc(JWidget widget, JMessage msg)
|
||||
}
|
||||
|
||||
jrect_free(cpos);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case JM_BUTTONRELEASED:
|
||||
jwidget_release_mouse(widget);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void paledit_request_size(JWidget widget, int *w, int *h)
|
||||
|
@ -116,5 +116,5 @@ static bool preview_msg_proc(JWidget widget, JMessage msg)
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user