#ifndef UE_H #define UE_H #include #include "../include/osw-x.h" #include "../include/widget.h" #include "../include/imgrefs.h" #include "clipboard.h" #include "cdlg.h" #include "uetypes.h" /* * Program name and version: */ #define PROG_NAME_FULL "Universe Editor" #define PROG_NAME "UnvEdit" #define PROG_VERSION "2.5.4" #define PROG_VERSION_MAJOR 2 #define PROG_VERSION_MINOR 5 #define PROG_VERSION_RELEASE 4 #define PROG_URL "\ http://wolfpack.twu.net/ShipWars/" /* * Program help message: */ #define PROG_USAGE_MESSAGE "\ Usage: unvedit [file] [options] [GUI_options]\n\ \n\ [file] specifies the name of the universe file to open at\n\ startup.\n\ \n\ [options] can be any of the following:\n\ \n\ --help Prints (this) help screen and exits.\n\ --version Prints version information and exits.\n\ \n\ Most customizations can be performed in the options menu.\n\ \n\ Command line options override any options in the\n\ configuration file.\n\ \n\ [GUI_options] can be any options standard to your GUI, consult\n\ your GUI's manual for available options.\n\ \n" /* * Program copyright message: */ #define PROG_COPYRIGHT "\ Copyright (C) 1997-2006 WolfPack Entertainment.\n\ This program is protected by international copyright laws and treaties,\n\ distribution and/or modification of this software in violation of the\n\ GNU Public License is strictly prohibited. Violators will be prosecuted\n\ to the fullest extent of the law." /* * Icon Codes: */ #define UE_ICON_NONE 0 #define UE_ICON_DEFAULT 1 #define UE_ICON_INFO 2 #define UE_ICON_WARNING 3 #define UE_ICON_ERROR 4 #define UE_ICON_QUESTION 5 typedef struct _ue_fname_struct ue_fname_struct; typedef struct _ue_dname_struct ue_dname_struct; typedef struct _ue_color_struct ue_color_struct; typedef struct _ue_font_struct ue_font_struct; typedef struct _ue_cursor_struct ue_cursor_struct; typedef struct _ue_image_struct ue_image_struct; typedef struct _ue_option_struct ue_option_struct; /* * Files: */ struct _ue_fname_struct { char cfg[PATH_MAX + NAME_MAX], opm[PATH_MAX + NAME_MAX]; }; /* * Directories: */ struct _ue_dname_struct { char toplevel[PATH_MAX], /* XSW toplevel data dir */ etc[PATH_MAX], images[PATH_MAX], sounds[PATH_MAX], server[PATH_MAX]; }; /* * Colors: */ struct _ue_color_struct { pixel_t view_bg; pixel_t *view_grid; int nview_grids; pixel_t view_cursor, view_label, view_obj_selected, view_obj_static, view_obj_dynamic, view_obj_controlled, view_obj_player, view_obj_weapon, view_obj_home, view_obj_area, view_obj_wormhole; }; /* * Fonts: */ struct _ue_font_struct { font_t *object_label, *geometry_label; }; /* * Cursors: */ struct _ue_cursor_struct { cursor_t busy; WCursor *scanner_lock_wcur, *translate_wcur, *zoom_wcur; }; /* * Images: */ struct _ue_image_struct { image_t *icon_unvedit, *unvedit_logo, *icon_info, *icon_warning, *icon_error, *icon_question; pixmap_t icon_about_pixmap; bitmap_t icon_about_mask; pixmap_t icon_close_pixmap; bitmap_t icon_close_mask; pixmap_t icon_copy_pixmap; bitmap_t icon_copy_mask; pixmap_t icon_cut_pixmap; bitmap_t icon_cut_mask; pixmap_t icon_delete_pixmap; bitmap_t icon_delete_mask; pixmap_t icon_economy_pixmap; bitmap_t icon_economy_mask; pixmap_t icon_export_pixmap; bitmap_t icon_export_mask; pixmap_t icon_import_pixmap; bitmap_t icon_import_mask; pixmap_t icon_legend_pixmap; bitmap_t icon_legend_mask; pixmap_t icon_new_pixmap; bitmap_t icon_new_mask; pixmap_t icon_new_object_pixmap; bitmap_t icon_new_object_mask; pixmap_t icon_object_properties_pixmap; bitmap_t icon_object_properties_mask; pixmap_t icon_open_pixmap; bitmap_t icon_open_mask; pixmap_t icon_opm_file_pixmap; bitmap_t icon_opm_file_mask; pixmap_t icon_paste_pixmap; bitmap_t icon_paste_mask; pixmap_t icon_print_pixmap; bitmap_t icon_print_mask; pixmap_t icon_remodel_object_pixmap; bitmap_t icon_remodel_object_mask; pixmap_t icon_save_pixmap; bitmap_t icon_save_mask; pixmap_t icon_save_as_pixmap; bitmap_t icon_save_as_mask; pixmap_t icon_select_pixmap; bitmap_t icon_select_mask; pixmap_t icon_screenshot_pixmap; bitmap_t icon_screenshot_mask; pixmap_t icon_unvedit_pixmap; bitmap_t icon_unvedit_mask; pixmap_t icon_weapons_pixmap; bitmap_t icon_weapons_mask; }; /* * Options: */ struct _ue_option_struct { int rc_version_major, rc_version_minor, rc_version_release; bool_t record_window_geometry, show_object_labels, show_geometry_labels, show_grid, show_contact_bounds, animate_object_display; float grid_spacing; /* In real units */ int object_marker_radius; /* In pixels */ rectangle_t uew_geometry; char *object_label_font_name, *geometry_label_font_name; }; extern int runlevel; extern time_t cur_millitime; extern ue_fname_struct fname; extern ue_dname_struct dname; extern ue_color_struct ue_color; extern ue_font_struct ue_font; extern ue_cursor_struct ue_cursor; extern ue_image_struct ue_image; extern ue_option_struct option; extern ue_clipboard_struct *ue_clipboard; extern dialog_struct *ue_dlg; extern cdlg_struct *ue_cdlg; extern fb_struct *ue_file_sel; extern uew_struct **ue_uew; extern int total_uews; extern optwin_struct *optwin; extern about_dlg_struct *about_dlg; /* In main.cpp */ extern int UEDoEmergencySaveAll(void); extern mode_t UECurrentFileMode(void); extern const char *UECurrentDirectory(void); extern bool_t UECheckFileExists(const char *path, char **error_msg_rtn); extern int UECreateUEW(const char *unv_file); extern void UEResetTimmers(void); extern void UEMaintainImgRefs( void *data, imgref_struct **list, const int total, const time_t cur_ms, const time_t cur_sec, const float tc ); extern int UEInit(int argc, char **argv); extern void UEMainIteration(void *data); extern void UEMain(void *data); extern void UEMainPop(void *data); extern void UEMainPopAll(void *data); extern void UEShutdown(void); /* In imgrefs.cpp */ extern int ImgRefIsLoaded(imgref_struct *imgref); extern int ImgRefLoad(imgref_struct *imgref); extern void ImgRefUnload(imgref_struct *imgref); extern void ImgRefDelete(imgref_struct *imgref); extern void ImgRefClear(imgref_struct ***list, int *total); /* ueprint.cpp */ extern void UEDialog( const char *title, const int icon_code, /* One of UE_ICON_* */ const char *msg, win_t toplevel ); extern int UEGetResponse( const char *title, const int icon_code, /* One of UE_ICON_* */ const char *msg, unsigned int btn_flags, /* Any of CDlgBtn* */ win_t toplevel ); extern void UEPrint(const char *msg); extern void UEPrintWarning(const char *msg); extern void UEPrintError(const char *msg); extern void UEPrintBold(const char *msg); extern void UEPrintHelpStdout(void); extern void UEPrintVersionStdout(void); extern dialog_struct *UEDialogNew(void); extern void UEDialogDelete(dialog_struct *d); extern cdlg_struct *UEConfirmationDialogNew(void); extern void UEConfirmationDialogDelete(cdlg_struct *d); /* ueselectfile.cpp */ extern bool_t UESelectFile( const char *title, const char *ok_label, const char *cancel_label, const char *path, char ***paths_rtn, int *npaths_rtn, win_t toplevel ); extern fb_struct *UEFileSelectorNew(void); extern void UEFileSelectorDelete(fb_struct *file_sel); #endif /* UE_H */