2007-11-16 18:25:45 +00:00
|
|
|
|
/* ASE - Allegro Sprite Editor
|
2009-01-24 00:41:01 +00:00
|
|
|
|
* Copyright (C) 2001-2009 David Capello
|
2007-09-18 23:57:02 +00:00
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
2008-02-29 19:29:49 +00:00
|
|
|
|
#include <assert.h>
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include <allegro.h>
|
|
|
|
|
/* #include <allegro/internal/aintern.h> */
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
2007-12-05 01:30:50 +00:00
|
|
|
|
#include "jinete/jinete.h"
|
|
|
|
|
#include "jinete/jintern.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-08-05 01:53:02 +00:00
|
|
|
|
#include "ase_exception.h"
|
2009-08-09 21:24:32 +00:00
|
|
|
|
#include "ui_context.h"
|
2007-09-23 20:13:58 +00:00
|
|
|
|
#include "commands/commands.h"
|
2009-10-09 01:34:06 +00:00
|
|
|
|
#include "commands/params.h"
|
2009-08-17 19:32:09 +00:00
|
|
|
|
#include "console.h"
|
2009-12-11 14:53:05 +00:00
|
|
|
|
#include "app.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include "core/cfg.h"
|
|
|
|
|
#include "core/core.h"
|
2009-01-24 00:41:01 +00:00
|
|
|
|
#include "core/drop_files.h"
|
2008-02-04 02:37:26 +00:00
|
|
|
|
#include "core/file_system.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include "core/modules.h"
|
|
|
|
|
#include "dialogs/options.h"
|
|
|
|
|
#include "dialogs/tips.h"
|
|
|
|
|
#include "file/file.h"
|
|
|
|
|
#include "intl/intl.h"
|
|
|
|
|
#include "modules/editors.h"
|
|
|
|
|
#include "modules/gfx.h"
|
|
|
|
|
#include "modules/gui.h"
|
2008-03-22 18:43:56 +00:00
|
|
|
|
#include "modules/palettes.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include "modules/recent.h"
|
|
|
|
|
#include "modules/rootmenu.h"
|
|
|
|
|
#include "raster/image.h"
|
2008-03-27 14:29:33 +00:00
|
|
|
|
#include "raster/layer.h"
|
2008-03-22 18:43:56 +00:00
|
|
|
|
#include "raster/palette.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include "raster/sprite.h"
|
2008-03-22 18:43:56 +00:00
|
|
|
|
#include "util/boundary.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include "util/recscr.h"
|
|
|
|
|
#include "widgets/colbar.h"
|
|
|
|
|
#include "widgets/editor.h"
|
2007-09-23 20:13:58 +00:00
|
|
|
|
#include "widgets/menuitem.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include "widgets/statebar.h"
|
2007-11-28 14:19:36 +00:00
|
|
|
|
#include "widgets/tabs.h"
|
2007-09-18 23:57:02 +00:00
|
|
|
|
#include "widgets/toolbar.h"
|
|
|
|
|
|
2009-01-24 00:41:01 +00:00
|
|
|
|
#ifdef ALLEGRO_WINDOWS
|
2009-08-17 21:38:00 +00:00
|
|
|
|
#include <winalleg.h>
|
2009-01-24 00:41:01 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
class Option
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-10-14 14:09:59 +00:00
|
|
|
|
int m_type;
|
|
|
|
|
jstring m_data;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
OpenSprite,
|
|
|
|
|
};
|
2009-06-11 15:11:11 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
Option(int type, const char* data)
|
|
|
|
|
{
|
|
|
|
|
m_type = type;
|
|
|
|
|
m_data = data;
|
2009-06-11 15:11:11 +00:00
|
|
|
|
}
|
2009-10-14 14:09:59 +00:00
|
|
|
|
|
|
|
|
|
int type() const { return m_type; }
|
|
|
|
|
const char* data() const { return m_data.c_str(); }
|
|
|
|
|
|
2009-06-11 15:11:11 +00:00
|
|
|
|
};
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
class App::Pimpl
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const char* m_exe_name;
|
|
|
|
|
std::vector<Option*> m_options;
|
|
|
|
|
CommandsModule m_commands_modules;
|
|
|
|
|
UIContext m_ui_context;
|
|
|
|
|
int m_return_code;
|
|
|
|
|
std::vector<std::vector<IAppHook*> > m_apphooks;
|
2009-10-09 01:34:06 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
Pimpl() { }
|
|
|
|
|
~Pimpl() { }
|
|
|
|
|
};
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
App* App::m_instance = NULL;
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
2010-01-26 00:38:05 +00:00
|
|
|
|
static Frame* top_window = NULL; /* top level window (the desktop) */
|
|
|
|
|
static Widget* box_menubar = NULL; /* box where the menu bar is */
|
|
|
|
|
static Widget* box_colorbar = NULL; /* box where the color bar is */
|
|
|
|
|
static Widget* box_toolbar = NULL; /* box where the tools bar is */
|
|
|
|
|
static Widget* box_statusbar = NULL; /* box where the status bar is */
|
|
|
|
|
static Widget* box_tabsbar = NULL; /* box where the tabs bar is */
|
|
|
|
|
static Widget* menubar = NULL; /* the menu bar widget */
|
|
|
|
|
static Widget* statusbar = NULL; /* the status bar widget */
|
|
|
|
|
static Widget* colorbar = NULL; /* the color bar widget */
|
|
|
|
|
static Widget* toolbar = NULL; /* the tool bar widget */
|
|
|
|
|
static Widget* tabsbar = NULL; /* the tabs bar widget */
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
static char *palette_filename = NULL;
|
|
|
|
|
|
2008-10-16 02:19:00 +00:00
|
|
|
|
static void tabsbar_select_callback(JWidget tabs, void *data, int button);
|
2008-02-29 19:29:49 +00:00
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Initializes the application loading the modules, setting the
|
|
|
|
|
* graphics mode, loading the configuration and resources, etc.
|
|
|
|
|
*/
|
2009-10-09 01:34:06 +00:00
|
|
|
|
App::App(int argc, char *argv[])
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-10-09 01:34:06 +00:00
|
|
|
|
assert(m_instance == NULL);
|
|
|
|
|
m_instance = this;
|
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
// create private implementation data
|
|
|
|
|
m_pimpl = new Pimpl;
|
|
|
|
|
m_pimpl->m_exe_name = argv[0];
|
|
|
|
|
m_pimpl->m_return_code = 0;
|
|
|
|
|
m_pimpl->m_apphooks.resize(AppEvent::NumEvents);
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
|
|
|
|
/* initialize language suppport */
|
2007-09-23 20:13:58 +00:00
|
|
|
|
intl_init();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* install the `core' of ASE application */
|
2009-08-05 01:53:02 +00:00
|
|
|
|
core_init();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2008-02-04 02:37:26 +00:00
|
|
|
|
/* install the file-system access module */
|
2009-08-05 01:53:02 +00:00
|
|
|
|
file_system_init();
|
2008-02-04 02:37:26 +00:00
|
|
|
|
|
2007-09-18 23:57:02 +00:00
|
|
|
|
/* init configuration */
|
2007-09-23 20:13:58 +00:00
|
|
|
|
ase_config_init();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
// load the language file
|
2007-09-23 20:13:58 +00:00
|
|
|
|
intl_load_lang();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* search options in the arguments */
|
2009-08-05 01:53:02 +00:00
|
|
|
|
check_args(argc, argv);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* GUI is the default mode */
|
|
|
|
|
if (!(ase_mode & MODE_BATCH))
|
|
|
|
|
ase_mode |= MODE_GUI;
|
|
|
|
|
|
2008-02-04 02:37:26 +00:00
|
|
|
|
/* install 'raster' stuff */
|
2009-08-05 01:53:02 +00:00
|
|
|
|
gfxobj_init();
|
2008-02-04 02:37:26 +00:00
|
|
|
|
|
2009-10-09 01:34:06 +00:00
|
|
|
|
// install the modules
|
2009-10-14 14:09:59 +00:00
|
|
|
|
modules_init(ase_mode & MODE_GUI ? REQUIRE_INTERFACE: 0);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* custom default palette? */
|
|
|
|
|
if (palette_filename) {
|
2008-03-22 18:43:56 +00:00
|
|
|
|
Palette *pal;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
PRINTF("Loading custom palette file: %s\n", palette_filename);
|
|
|
|
|
|
2008-03-22 18:43:56 +00:00
|
|
|
|
pal = palette_load(palette_filename);
|
2009-08-05 01:53:02 +00:00
|
|
|
|
if (pal == NULL)
|
|
|
|
|
throw ase_exception(std::string("Error loading default palette from: ")
|
|
|
|
|
+ palette_filename);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2008-01-07 15:10:17 +00:00
|
|
|
|
set_default_palette(pal);
|
2008-03-22 18:43:56 +00:00
|
|
|
|
palette_free(pal);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* set system palette to the default one */
|
2008-01-07 15:10:17 +00:00
|
|
|
|
set_current_palette(NULL, TRUE);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Runs the ASE application. In GUI mode it's the top-level window, in
|
|
|
|
|
* console/scripting it just runs the specified scripts.
|
|
|
|
|
*/
|
2009-10-14 14:09:59 +00:00
|
|
|
|
int App::run()
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
|
|
|
|
/* initialize GUI interface */
|
|
|
|
|
if (ase_mode & MODE_GUI) {
|
2010-01-27 02:52:30 +00:00
|
|
|
|
Widget* view;
|
|
|
|
|
Editor* editor;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
PRINTF("GUI mode\n");
|
|
|
|
|
|
|
|
|
|
/* setup the GUI screen */
|
2007-09-26 19:34:06 +00:00
|
|
|
|
jmouse_set_cursor(JI_CURSOR_NORMAL);
|
2007-09-20 00:32:35 +00:00
|
|
|
|
jmanager_refresh_screen();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2010-01-26 00:38:05 +00:00
|
|
|
|
// load main window
|
|
|
|
|
top_window = static_cast<Frame*>(load_widget("main.jid", "main_window"));
|
2008-03-15 01:54:45 +00:00
|
|
|
|
if (!top_window) {
|
|
|
|
|
allegro_message("Error loading data data/jids/main.jid file.\n"
|
|
|
|
|
"You have to reinstall the program.\n");
|
2009-10-14 14:09:59 +00:00
|
|
|
|
return 1;
|
2008-03-15 01:54:45 +00:00
|
|
|
|
}
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2008-02-29 19:29:49 +00:00
|
|
|
|
box_menubar = jwidget_find_name(top_window, "menubar");
|
2007-09-20 00:32:35 +00:00
|
|
|
|
box_editors = jwidget_find_name(top_window, "editor");
|
2008-02-29 19:29:49 +00:00
|
|
|
|
box_colorbar = jwidget_find_name(top_window, "colorbar");
|
|
|
|
|
box_toolbar = jwidget_find_name(top_window, "toolbar");
|
|
|
|
|
box_statusbar = jwidget_find_name(top_window, "statusbar");
|
|
|
|
|
box_tabsbar = jwidget_find_name(top_window, "tabsbar");
|
|
|
|
|
|
|
|
|
|
menubar = jmenubar_new();
|
|
|
|
|
statusbar = statusbar_new();
|
2010-01-26 00:38:05 +00:00
|
|
|
|
colorbar = colorbar_new(box_colorbar->getAlign());
|
2008-03-27 14:29:33 +00:00
|
|
|
|
toolbar = toolbar_new();
|
2008-02-29 19:29:49 +00:00
|
|
|
|
tabsbar = tabs_new(tabsbar_select_callback);
|
2007-09-20 00:32:35 +00:00
|
|
|
|
view = editor_view_new();
|
|
|
|
|
editor = create_new_editor();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-11-22 02:15:40 +00:00
|
|
|
|
// configure all widgets to expansives
|
2008-02-29 19:29:49 +00:00
|
|
|
|
jwidget_expansive(menubar, TRUE);
|
|
|
|
|
jwidget_expansive(statusbar, TRUE);
|
|
|
|
|
jwidget_expansive(colorbar, TRUE);
|
|
|
|
|
jwidget_expansive(toolbar, TRUE);
|
|
|
|
|
jwidget_expansive(tabsbar, TRUE);
|
2007-09-20 00:32:35 +00:00
|
|
|
|
jwidget_expansive(view, TRUE);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* prepare the first editor */
|
2007-09-20 00:32:35 +00:00
|
|
|
|
jview_attach(view, editor);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* setup the menus */
|
2008-02-29 19:29:49 +00:00
|
|
|
|
jmenubar_set_menu(menubar, get_root_menu());
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* start text of status bar */
|
2008-02-29 19:29:49 +00:00
|
|
|
|
app_default_statusbar_message();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* add the widgets in the boxes */
|
2008-02-29 19:29:49 +00:00
|
|
|
|
if (box_menubar) jwidget_add_child(box_menubar, menubar);
|
2007-11-28 14:19:36 +00:00
|
|
|
|
if (box_editors) jwidget_add_child(box_editors, view);
|
2008-02-29 19:29:49 +00:00
|
|
|
|
if (box_colorbar) jwidget_add_child(box_colorbar, colorbar);
|
|
|
|
|
if (box_toolbar) jwidget_add_child(box_toolbar, toolbar);
|
|
|
|
|
if (box_statusbar) jwidget_add_child(box_statusbar, statusbar);
|
|
|
|
|
if (box_tabsbar) jwidget_add_child(box_tabsbar, tabsbar);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* prepare the window */
|
2010-01-26 00:38:05 +00:00
|
|
|
|
top_window->remap_window();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* rebuild menus */
|
2007-09-20 00:32:35 +00:00
|
|
|
|
app_realloc_sprite_list();
|
|
|
|
|
app_realloc_recent_list();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* set current editor */
|
2007-09-20 00:32:35 +00:00
|
|
|
|
set_current_editor(editor);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* open the window */
|
2010-01-26 00:38:05 +00:00
|
|
|
|
top_window->open_window();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* refresh the screen */
|
2007-09-20 00:32:35 +00:00
|
|
|
|
jmanager_refresh_screen();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* set background mode for non-GUI modes */
|
2007-09-30 15:32:21 +00:00
|
|
|
|
/* if (!(ase_mode & MODE_GUI)) */
|
|
|
|
|
/* set_display_switch_mode(SWITCH_BACKAMNESIA); */
|
|
|
|
|
set_display_switch_mode(SWITCH_BACKGROUND);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
// procress options
|
2007-09-23 20:13:58 +00:00
|
|
|
|
PRINTF("Processing options...\n");
|
2009-10-14 14:09:59 +00:00
|
|
|
|
|
|
|
|
|
for (std::vector<Option*>::iterator
|
|
|
|
|
it = m_pimpl->m_options.begin(); it != m_pimpl->m_options.end(); ++it) {
|
|
|
|
|
Option* option = *it;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
switch (option->type()) {
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
case Option::OpenSprite: {
|
2007-09-18 23:57:02 +00:00
|
|
|
|
/* load the sprite */
|
2009-10-14 14:09:59 +00:00
|
|
|
|
Sprite *sprite = sprite_load(option->data());
|
2007-09-18 23:57:02 +00:00
|
|
|
|
if (!sprite) {
|
|
|
|
|
/* error */
|
|
|
|
|
if (ase_mode & MODE_GUI)
|
2009-10-14 14:09:59 +00:00
|
|
|
|
jalert(_("Error<<Error loading file \"%s\"||&Close"), option->data());
|
2007-09-18 23:57:02 +00:00
|
|
|
|
else
|
2009-10-14 14:09:59 +00:00
|
|
|
|
user_printf(_("Error loading file \"%s\"\n"), option->data());
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* mount and select the sprite */
|
2009-06-01 02:59:15 +00:00
|
|
|
|
UIContext* context = UIContext::instance();
|
|
|
|
|
context->add_sprite(sprite);
|
|
|
|
|
context->set_current_sprite(sprite);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
if (ase_mode & MODE_GUI) {
|
|
|
|
|
/* show it */
|
2009-06-01 02:59:15 +00:00
|
|
|
|
set_sprite_in_more_reliable_editor(context->get_first_sprite());
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* recent file */
|
2009-10-14 14:09:59 +00:00
|
|
|
|
recent_file(option->data());
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-10-14 14:09:59 +00:00
|
|
|
|
delete option;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
2009-10-14 14:09:59 +00:00
|
|
|
|
m_pimpl->m_options.clear();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* just batch mode */
|
|
|
|
|
if (ase_mode & MODE_BATCH) {
|
|
|
|
|
PRINTF("Batch mode\n");
|
|
|
|
|
}
|
|
|
|
|
/* run the GUI */
|
|
|
|
|
else if (ase_mode & MODE_GUI) {
|
|
|
|
|
/* select language */
|
2007-09-20 00:32:35 +00:00
|
|
|
|
dialogs_select_language(FALSE);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-06-11 15:11:11 +00:00
|
|
|
|
// show tips only if there are not a current sprite
|
|
|
|
|
if (!UIContext::instance()->get_current_sprite())
|
|
|
|
|
dialogs_tips(FALSE);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-01-24 00:41:01 +00:00
|
|
|
|
// support to drop files from Windows explorer
|
|
|
|
|
install_drop_files();
|
|
|
|
|
|
2007-09-20 00:32:35 +00:00
|
|
|
|
gui_run();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-01-24 00:41:01 +00:00
|
|
|
|
uninstall_drop_files();
|
|
|
|
|
|
2007-09-18 23:57:02 +00:00
|
|
|
|
/* stop recording */
|
|
|
|
|
if (is_rec_screen())
|
|
|
|
|
rec_screen_off();
|
|
|
|
|
|
|
|
|
|
/* remove the root-menu from the menu-bar (because the rootmenu
|
|
|
|
|
module should destroy it) */
|
2008-02-29 19:29:49 +00:00
|
|
|
|
jmenubar_set_menu(menubar, NULL);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2010-01-26 00:38:05 +00:00
|
|
|
|
// destroy the top-window
|
2007-09-18 23:57:02 +00:00
|
|
|
|
jwidget_free(top_window);
|
|
|
|
|
top_window = NULL;
|
|
|
|
|
}
|
2009-10-14 14:09:59 +00:00
|
|
|
|
return 0;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Finishes the ASE application.
|
|
|
|
|
*/
|
2009-10-09 01:34:06 +00:00
|
|
|
|
App::~App()
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-10-14 14:09:59 +00:00
|
|
|
|
try {
|
|
|
|
|
assert(m_instance == this);
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
// remove ase handlers
|
|
|
|
|
PRINTF("Uninstalling ASE\n");
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
App::trigger_event(AppEvent::Exit);
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
// destroy application hooks
|
|
|
|
|
for (int c=0; c<AppEvent::NumEvents; ++c) {
|
|
|
|
|
for (std::vector<IAppHook*>::iterator
|
|
|
|
|
it = m_pimpl->m_apphooks[c].begin();
|
|
|
|
|
it != m_pimpl->m_apphooks[c].end(); ++it) {
|
|
|
|
|
IAppHook* apphook = *it;
|
2009-06-11 15:11:11 +00:00
|
|
|
|
delete apphook;
|
2008-03-22 18:43:56 +00:00
|
|
|
|
}
|
2009-10-14 14:09:59 +00:00
|
|
|
|
|
|
|
|
|
// clear the list of hooks (so nobody can call the deleted hooks)
|
|
|
|
|
m_pimpl->m_apphooks[c].clear();
|
2008-03-22 18:43:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
// finalize modules, configuration and core
|
|
|
|
|
modules_exit();
|
|
|
|
|
delete m_pimpl;
|
2010-01-27 02:52:30 +00:00
|
|
|
|
Editor::editor_cursor_exit();
|
2009-10-14 14:09:59 +00:00
|
|
|
|
boundary_exit();
|
|
|
|
|
|
|
|
|
|
gfxobj_exit();
|
|
|
|
|
ase_config_exit();
|
|
|
|
|
file_system_exit();
|
|
|
|
|
core_exit();
|
|
|
|
|
intl_exit();
|
2009-10-09 01:34:06 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
m_instance = NULL;
|
|
|
|
|
}
|
|
|
|
|
catch (...) {
|
|
|
|
|
allegro_message("Uncaught exception in ~App");
|
|
|
|
|
// no throw
|
|
|
|
|
}
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
void App::add_hook(AppEvent::Type event, IAppHook* hook)
|
2008-03-22 18:43:56 +00:00
|
|
|
|
{
|
2009-10-14 14:09:59 +00:00
|
|
|
|
assert(event >= 0 && event < AppEvent::NumEvents);
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
m_pimpl->m_apphooks[event].push_back(hook);
|
2008-03-22 18:43:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
void App::trigger_event(AppEvent::Type event)
|
2008-03-22 18:43:56 +00:00
|
|
|
|
{
|
2009-10-14 14:09:59 +00:00
|
|
|
|
assert(event >= 0 && event < AppEvent::NumEvents);
|
2008-03-22 18:43:56 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
for (std::vector<IAppHook*>::iterator
|
|
|
|
|
it = m_pimpl->m_apphooks[event].begin();
|
|
|
|
|
it != m_pimpl->m_apphooks[event].end(); ++it) {
|
|
|
|
|
IAppHook* apphook = *it;
|
|
|
|
|
apphook->on_event();
|
2008-03-22 18:43:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Updates palette and redraw the screen.
|
|
|
|
|
*/
|
2009-06-11 15:11:11 +00:00
|
|
|
|
void app_refresh_screen(const Sprite* sprite)
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-06-11 15:11:11 +00:00
|
|
|
|
assert(screen != NULL);
|
2009-06-01 02:59:15 +00:00
|
|
|
|
|
2009-06-11 15:11:11 +00:00
|
|
|
|
if (sprite)
|
|
|
|
|
set_current_palette(sprite_get_palette(sprite, sprite->frame), false);
|
|
|
|
|
else
|
|
|
|
|
set_current_palette(NULL, false);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-06-11 15:11:11 +00:00
|
|
|
|
// redraw the screen
|
|
|
|
|
jmanager_refresh_screen();
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Regenerates the label for each tab in the @em tabsbar.
|
|
|
|
|
*/
|
2008-10-01 01:27:51 +00:00
|
|
|
|
void app_realloc_sprite_list()
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-06-01 02:59:15 +00:00
|
|
|
|
UIContext* context = UIContext::instance();
|
|
|
|
|
const SpriteList& list = context->get_sprite_list();
|
2007-11-28 14:19:36 +00:00
|
|
|
|
|
|
|
|
|
/* insert all other sprites */
|
2009-06-01 02:59:15 +00:00
|
|
|
|
for (SpriteList::const_iterator
|
|
|
|
|
it = list.begin(); it != list.end(); ++it) {
|
|
|
|
|
Sprite* sprite = *it;
|
|
|
|
|
tabs_set_text_for_tab(tabsbar, get_filename(sprite->filename), sprite);
|
2007-11-28 14:19:36 +00:00
|
|
|
|
}
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Updates the recent list menu.
|
|
|
|
|
*
|
|
|
|
|
* @warning This routine can't be used when a menu callback was
|
|
|
|
|
* called, because, it destroy the menus, you should use
|
2008-03-29 03:43:19 +00:00
|
|
|
|
* schedule_rebuild_recent_list() instead (src/modules/gui.c).
|
2008-03-15 01:54:45 +00:00
|
|
|
|
*/
|
2008-10-01 01:27:51 +00:00
|
|
|
|
bool app_realloc_recent_list()
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2010-01-26 00:38:05 +00:00
|
|
|
|
Widget* list_menuitem = get_recent_list_menuitem();
|
|
|
|
|
Widget* menuitem;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* update the recent file list menu item */
|
|
|
|
|
if (list_menuitem) {
|
2008-02-04 02:37:26 +00:00
|
|
|
|
if (jmenuitem_has_submenu_opened(list_menuitem))
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2009-10-09 01:34:06 +00:00
|
|
|
|
Command *cmd_open_file = CommandsModule::instance()->get_command_by_name(CommandId::open_file);
|
2008-02-04 02:37:26 +00:00
|
|
|
|
|
2010-01-26 00:38:05 +00:00
|
|
|
|
Widget* submenu = jmenuitem_get_submenu(list_menuitem);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
if (submenu) {
|
2007-11-28 14:19:36 +00:00
|
|
|
|
jmenuitem_set_submenu(list_menuitem, NULL);
|
|
|
|
|
jwidget_free(submenu);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-09-23 20:13:58 +00:00
|
|
|
|
submenu = jmenu_new();
|
|
|
|
|
jmenuitem_set_submenu(list_menuitem, submenu);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
if (jlist_first(get_recent_files_list())) {
|
2007-09-23 20:13:58 +00:00
|
|
|
|
const char *filename;
|
2009-10-09 01:34:06 +00:00
|
|
|
|
Params params;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
JLink link;
|
|
|
|
|
|
|
|
|
|
JI_LIST_FOR_EACH(get_recent_files_list(), link) {
|
2008-09-30 21:01:54 +00:00
|
|
|
|
filename = reinterpret_cast<const char*>(link->data);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-09 01:34:06 +00:00
|
|
|
|
params.set("filename", filename);
|
|
|
|
|
|
|
|
|
|
menuitem = menuitem_new(get_filename(filename), cmd_open_file, ¶ms);
|
2007-09-23 20:13:58 +00:00
|
|
|
|
jwidget_add_child(submenu, menuitem);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
2007-09-23 20:13:58 +00:00
|
|
|
|
menuitem = menuitem_new(_("Nothing"), NULL, NULL);
|
|
|
|
|
jwidget_disable(menuitem);
|
|
|
|
|
jwidget_add_child(submenu, menuitem);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2008-02-04 02:37:26 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
|
int app_get_current_image_type()
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-06-11 15:11:11 +00:00
|
|
|
|
Context* context = UIContext::instance();
|
|
|
|
|
assert(context != NULL);
|
|
|
|
|
|
|
|
|
|
Sprite* sprite = context->get_current_sprite();
|
|
|
|
|
if (sprite != NULL)
|
2009-06-01 02:59:15 +00:00
|
|
|
|
return sprite->imgtype;
|
2008-03-22 18:43:56 +00:00
|
|
|
|
else if (screen != NULL && bitmap_color_depth(screen) == 8)
|
2007-09-18 23:57:02 +00:00
|
|
|
|
return IMAGE_INDEXED;
|
2008-03-22 18:43:56 +00:00
|
|
|
|
else
|
|
|
|
|
return IMAGE_RGB;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-01-26 00:38:05 +00:00
|
|
|
|
Frame* app_get_top_window() { return top_window; }
|
|
|
|
|
Widget* app_get_menubar() { return menubar; }
|
|
|
|
|
Widget* app_get_statusbar() { return statusbar; }
|
|
|
|
|
Widget* app_get_colorbar() { return colorbar; }
|
|
|
|
|
Widget* app_get_toolbar() { return toolbar; }
|
|
|
|
|
Widget* app_get_tabsbar() { return tabsbar; }
|
2008-02-29 19:29:49 +00:00
|
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
|
void app_default_statusbar_message()
|
2008-02-29 19:29:49 +00:00
|
|
|
|
{
|
|
|
|
|
statusbar_set_text(app_get_statusbar(), 250,
|
|
|
|
|
"ASE " VERSION ", " COPYRIGHT);
|
|
|
|
|
}
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2008-03-27 14:29:33 +00:00
|
|
|
|
int app_get_fg_color(Sprite *sprite)
|
|
|
|
|
{
|
2008-04-12 03:09:53 +00:00
|
|
|
|
color_t c = colorbar_get_fg_color(colorbar);
|
2008-03-27 14:29:33 +00:00
|
|
|
|
assert(sprite != NULL);
|
|
|
|
|
|
2008-04-12 03:09:53 +00:00
|
|
|
|
if (sprite->layer != NULL)
|
|
|
|
|
return get_color_for_layer(sprite->layer, c);
|
|
|
|
|
else
|
|
|
|
|
return get_color_for_image(sprite->imgtype, c);
|
2008-03-27 14:29:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int app_get_bg_color(Sprite *sprite)
|
|
|
|
|
{
|
2008-04-12 03:09:53 +00:00
|
|
|
|
color_t c = colorbar_get_bg_color(colorbar);
|
2008-03-27 14:29:33 +00:00
|
|
|
|
assert(sprite != NULL);
|
|
|
|
|
|
2008-04-12 03:09:53 +00:00
|
|
|
|
if (sprite->layer != NULL)
|
|
|
|
|
return get_color_for_layer(sprite->layer, c);
|
|
|
|
|
else
|
|
|
|
|
return get_color_for_image(sprite->imgtype, c);
|
2008-03-27 14:29:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int app_get_color_to_clear_layer(Layer *layer)
|
|
|
|
|
{
|
|
|
|
|
/* all transparent layers are cleared with the mask color */
|
|
|
|
|
color_t color = color_mask();
|
|
|
|
|
|
|
|
|
|
/* the `Background' is erased with the `Background Color' */
|
2009-11-17 13:12:26 +00:00
|
|
|
|
if (layer != NULL && layer->is_background())
|
2008-03-27 14:29:33 +00:00
|
|
|
|
color = colorbar_get_bg_color(colorbar);
|
|
|
|
|
|
2008-04-12 03:09:53 +00:00
|
|
|
|
return get_color_for_layer(layer, color);
|
2008-03-27 14:29:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-01-26 00:38:05 +00:00
|
|
|
|
static void tabsbar_select_callback(Widget* tabs, void *data, int button)
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2008-10-16 02:19:00 +00:00
|
|
|
|
// Note: data can be NULL (the "Nothing" tab)
|
2009-06-01 02:59:15 +00:00
|
|
|
|
Sprite* sprite = (Sprite*)data;
|
2008-10-16 02:19:00 +00:00
|
|
|
|
|
|
|
|
|
// put as current sprite
|
2009-10-09 01:34:06 +00:00
|
|
|
|
set_sprite_in_more_reliable_editor(sprite);
|
|
|
|
|
|
|
|
|
|
// middle-button: close the sprite
|
|
|
|
|
if (data && (button & 4)) {
|
|
|
|
|
Command* close_file_cmd =
|
|
|
|
|
CommandsModule::instance()->get_command_by_name(CommandId::close_file);
|
2008-10-16 02:19:00 +00:00
|
|
|
|
|
2009-10-09 01:34:06 +00:00
|
|
|
|
UIContext::instance()->execute_command(close_file_cmd, NULL);
|
|
|
|
|
}
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Looks the inpunt arguments in the command line.
|
|
|
|
|
*/
|
2009-10-14 14:09:59 +00:00
|
|
|
|
void App::check_args(int argc, char *argv[])
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-06-11 15:11:11 +00:00
|
|
|
|
Console console;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
int i, n, len;
|
|
|
|
|
char *arg;
|
|
|
|
|
|
|
|
|
|
for (i=1; i<argc; i++) {
|
|
|
|
|
arg = argv[i];
|
|
|
|
|
|
|
|
|
|
for (n=0; arg[n] == '-'; n++);
|
2007-09-26 19:34:06 +00:00
|
|
|
|
len = strlen(arg+n);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* option */
|
|
|
|
|
if ((n > 0) && (len > 0)) {
|
|
|
|
|
/* use other palette file */
|
2008-09-27 23:24:27 +00:00
|
|
|
|
if (strncmp(arg+n, "palette", len) == 0) {
|
2007-09-18 23:57:02 +00:00
|
|
|
|
if (++i < argc)
|
|
|
|
|
palette_filename = argv[i];
|
|
|
|
|
else
|
2009-10-14 14:09:59 +00:00
|
|
|
|
usage(false);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
/* video resolution */
|
2007-09-26 19:34:06 +00:00
|
|
|
|
else if (strncmp(arg+n, "resolution", len) == 0) {
|
2007-09-18 23:57:02 +00:00
|
|
|
|
if (++i < argc) {
|
|
|
|
|
int c, num1=0, num2=0, num3=0;
|
|
|
|
|
char *tok;
|
|
|
|
|
|
|
|
|
|
/* el pr<70>ximo argumento debe indicar un formato de
|
|
|
|
|
resoluci<EFBFBD>n algo como esto: 320x240[x8] o [8] */
|
|
|
|
|
c = 0;
|
|
|
|
|
|
2007-09-26 19:34:06 +00:00
|
|
|
|
for (tok=ustrtok(argv[i], "x"); tok;
|
|
|
|
|
tok=ustrtok(NULL, "x")) {
|
2007-09-18 23:57:02 +00:00
|
|
|
|
switch (c) {
|
2007-09-26 19:34:06 +00:00
|
|
|
|
case 0: num1 = ustrtol(tok, NULL, 10); break;
|
|
|
|
|
case 1: num2 = ustrtol(tok, NULL, 10); break;
|
|
|
|
|
case 2: num3 = ustrtol(tok, NULL, 10); break;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
c++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (c) {
|
|
|
|
|
case 1:
|
2007-09-26 19:34:06 +00:00
|
|
|
|
set_config_int("GfxMode", "Depth", num1);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
case 3:
|
2007-09-26 19:34:06 +00:00
|
|
|
|
set_config_int("GfxMode", "Width", num1);
|
|
|
|
|
set_config_int("GfxMode", "Height", num2);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
if (c == 3)
|
2007-09-26 19:34:06 +00:00
|
|
|
|
set_config_int("GfxMode", "Depth", num3);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
2009-10-14 14:09:59 +00:00
|
|
|
|
console.printf(_("%s: option \"res\" requires an argument\n"),
|
|
|
|
|
m_pimpl->m_exe_name);
|
|
|
|
|
usage(false);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* verbose mode */
|
|
|
|
|
else if (strncmp(arg+n, "verbose", len) == 0) {
|
|
|
|
|
ase_mode |= MODE_VERBOSE;
|
|
|
|
|
}
|
|
|
|
|
/* show help */
|
|
|
|
|
else if (strncmp(arg+n, "help", len) == 0) {
|
2009-10-14 14:09:59 +00:00
|
|
|
|
usage(true);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
/* show version */
|
|
|
|
|
else if (strncmp(arg+n, "version", len) == 0) {
|
|
|
|
|
ase_mode |= MODE_BATCH;
|
|
|
|
|
|
2009-06-11 15:11:11 +00:00
|
|
|
|
console.printf("ase %s\n", VERSION);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
/* invalid argument */
|
|
|
|
|
else {
|
2009-10-14 14:09:59 +00:00
|
|
|
|
usage(false);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* graphic file to open */
|
|
|
|
|
else if (n == 0)
|
2009-10-14 14:09:59 +00:00
|
|
|
|
m_pimpl->m_options.push_back(new Option(Option::OpenSprite, argv[i]));
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/**
|
|
|
|
|
* Shows the available options for the program
|
|
|
|
|
*/
|
2009-10-14 14:09:59 +00:00
|
|
|
|
void App::usage(bool show_help)
|
2007-09-18 23:57:02 +00:00
|
|
|
|
{
|
2009-06-11 15:11:11 +00:00
|
|
|
|
Console console;
|
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
ase_mode |= MODE_BATCH;
|
|
|
|
|
if (!show_help)
|
|
|
|
|
m_pimpl->m_return_code = 1;
|
|
|
|
|
|
|
|
|
|
// show options
|
|
|
|
|
if (show_help) {
|
|
|
|
|
// copyright
|
2009-06-11 15:11:11 +00:00
|
|
|
|
console.printf
|
2009-10-14 14:09:59 +00:00
|
|
|
|
("ase %s -- Allegro Sprite Editor, %s\n"
|
2007-09-20 00:32:35 +00:00
|
|
|
|
COPYRIGHT "\n\n",
|
2009-10-14 14:09:59 +00:00
|
|
|
|
VERSION, _("Just another tool to create sprites"));
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
2009-10-14 14:09:59 +00:00
|
|
|
|
// usage
|
2009-06-11 15:11:11 +00:00
|
|
|
|
console.printf
|
2007-09-18 23:57:02 +00:00
|
|
|
|
("%s\n %s [%s] [%s]...\n\n",
|
2009-10-14 14:09:59 +00:00
|
|
|
|
_("Usage:"), m_pimpl->m_exe_name, _("OPTION"), _("FILE"));
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
|
|
/* options */
|
2009-06-11 15:11:11 +00:00
|
|
|
|
console.printf
|
2007-09-18 23:57:02 +00:00
|
|
|
|
("%s:\n"
|
|
|
|
|
" -palette GFX-FILE %s\n"
|
|
|
|
|
" -resolution WxH[xBPP] %s\n"
|
|
|
|
|
" -verbose %s\n"
|
|
|
|
|
" -help %s\n"
|
|
|
|
|
" -version %s\n"
|
|
|
|
|
"\n",
|
|
|
|
|
_("Options"),
|
2008-09-27 23:24:27 +00:00
|
|
|
|
_("Use a specific palette by default"),
|
2007-09-18 23:57:02 +00:00
|
|
|
|
_("Change the resolution to use"),
|
|
|
|
|
_("Explain what is being done (in stderr or a log file)"),
|
|
|
|
|
_("Display this help and exits"),
|
|
|
|
|
_("Output version information and exit"));
|
|
|
|
|
|
2008-03-15 01:54:45 +00:00
|
|
|
|
/* web-site */
|
2009-06-11 15:11:11 +00:00
|
|
|
|
console.printf
|
2009-10-14 14:09:59 +00:00
|
|
|
|
("%s: %s\n\n",
|
2007-09-18 23:57:02 +00:00
|
|
|
|
_("Find more information in the ASE's official web site at:"), WEBSITE);
|
|
|
|
|
}
|
|
|
|
|
/* how to show options */
|
|
|
|
|
else {
|
2009-10-14 14:09:59 +00:00
|
|
|
|
console.printf(_("Try \"%s --help\" for more information.\n"),
|
|
|
|
|
m_pimpl->m_exe_name);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
}
|
2008-03-22 18:43:56 +00:00
|
|
|
|
}
|