FreeBurn.h
上传用户:cnxinhai
上传日期:2013-08-06
资源大小:265k
文件大小:17k
- /* This is the main class description for the FreeBurn application.
- *
- * Copyright (C) 2001, 2002 Adam Schlag
- */
- /*
- * FreeBurn Software License
- * (based on the Apache Software License)
- *
- * Version 1.1
- *
- * Copyright (c) 2001, 2002 The FreeBurn Project. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment:
- *
- * "This product includes software developed by the FreeBurn
- * Project (http://freeburn.sourceforge.net/)."
- *
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FreeBurn" and "FreeBurn Project" must not be
- * used to endorse or promote products derived from this software
- * without prior written permission. For written permission, please
- * contact aschlag@users.sourceforge.net.
- *
- * 5. Products derived from this software may not be called "FreeBurn",
- * nor may "FreeBurn" appear in their name, without prior written
- * permission of the FreeBurn Project.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE FREEBURN PROJECT OR ITS
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the FreeBurn Project. For more
- * information on the FreeBurn Project and FreeBurn, please see
- * <http://freeburn.sourceforge.net/>.
- *
- * This software is distributed with software that is released under the GNU
- * General Public License (GPL). You can find the terms of this license in the
- * file GPL.txt distributed in this package. You can find information on the
- * software distributed with this package in the file PROGRAMS.txt.
- */
-
- /* This is the main class for FreeBurn
- * (C represents Class, Freeburn is obvious)
- */
- #ifndef FREEBURN_H
- #define FREEBURN_H
- class HelpWindow;
- class CFreeburnSystem;
- class CFreeburnCommandDialog;
- class CFreeburnDisc;
- class FBSpinner;
- class CFreeBurn : public FXMainWindow
- {
- FXDECLARE(CFreeBurn)
- // public members
- public:
- // Methods for handling messages from the
- // various controls in the program. They
- // are named to be self-explanitory.
-
- // these handle the thread events
- long getThreadBuffer (FXObject*, FXSelector, void*);
- long threadComplete (FXObject*, FXSelector, void*);
-
- // these handle color updating
- long onCmdColor (FXObject*, FXSelector, void*);
- long onUpdColor (FXObject*, FXSelector, void*);
- long onCmdColorDefault (FXObject*, FXSelector, void*);
-
- // these handle updating the main program controls
- long updMainControls (FXObject*, FXSelector, void*);
- long updCatalogNum (FXObject*, FXSelector, void*);
- long cmdUseCdText (FXObject*, FXSelector, void*);
- long cmdEditCdText (FXObject*, FXSelector, void*);
- long cmdTrackType (FXObject*, FXSelector, void*);
- long cmdAddTrack (FXObject*, FXSelector, void*);
- long cmdModTrackCommand (FXObject*, FXSelector, void*);
- long cmdModifyTrack (FXObject*, FXSelector, void*);
-
- // these handle executing the various program dialogs
- long newDiscLayout (FXObject*, FXSelector, void*);
- long openDiscToc (FXObject*, FXSelector, void*);
- long saveDiscToc (FXObject*, FXSelector, void*);
- long updSave (FXObject*, FXSelector, void*);
- long closeDiscLayout (FXObject*, FXSelector, void*);
- long updClose (FXObject*, FXSelector, void*);
- long burnDisc (FXObject*, FXSelector, void*);
- long updBurnDisc (FXObject*, FXSelector, void*);
- long imageDisc (FXObject*, FXSelector, void*);
- long editPreferences (FXObject*, FXSelector, void*);
- long showHelp (FXObject*, FXSelector, void*);
- long showHelpCdrecord (FXObject*, FXSelector, void*);
- long showHelpMkisofs (FXObject*, FXSelector, void*);
- long showHelpCdrdao (FXObject*, FXSelector, void*);
- long aboutFreeburn (FXObject*, FXSelector, void*);
-
- // this handles exiting the application
- long exitApp (FXObject*, FXSelector, void*);
-
- // these handles getting and setting of application settings
- long onCmdIconTheme (FXObject*, FXSelector, void*);
- long onUpdIconTheme (FXObject*, FXSelector, void*);
-
- // methods to get the handles used for recieving thread messages
- FXInputHandle getReadOutputHandle() { return m_ReadOutputHandle; }
- FXInputHandle getThreadCompleteHandle() { return m_ThreadCompleteHandle; }
-
- // The new message ID's used in the application
- enum{
- ID_TITLE=FXMainWindow::ID_LAST,
- ID_NEW,
- ID_OPEN,
- ID_SAVE,
- ID_CLOSE,
- ID_BURN_CD,
- ID_CD_IMAGE,
- ID_GET_THREAD_BUFFER,
- ID_THREAD_COMPLETE,
- ID_DISC_SIZE,
- ID_DISC_TYPE,
- ID_CAT_NUM,
- ID_USE_CD_TEXT,
- ID_EDIT_CD_TEXT,
- ID_TRACK_TYPE,
- ID_ADD_TRACK,
- ID_MODIFY_TRACK_OPT,
- ID_TRACK_NUM,
- ID_MODIFY_TRACK,
- ID_USED_SPACE,
- ID_FREE_SPACE,
- ID_PERCENT_FULL,
- ID_AUDIO_TRACK,
- ID_DATA_TRACK,
- ID_RAW_TRACK,
- ID_XA_DATA_TRACK,
- ID_XA_AUDIO_TRACK,
- ID_XA_RAW_TRACK,
- ID_EDIT_TRACK,
- ID_DELETE_TRACK,
- ID_PREFERENCES,
- ID_HELP,
- ID_HELP_CDRECORD,
- ID_HELP_MKISOFS,
- ID_HELP_CDRDAO,
- ID_ABOUT,
- ID_EXIT,
- ID_ICONTHEME,
- ID_BASECOLOR,
- ID_BACKCOLOR,
- ID_FORECOLOR,
- ID_BORDCOLOR,
- ID_BASECOLOR_DEFAULT,
- ID_BACKCOLOR_DEFAULT,
- ID_FORECOLOR_DEFAULT,
- ID_BORDCOLOR_DEFAULT,
- ID_LAST
- };
-
- // enum for the disc burning types
- enum{
- TRACK_AT_ONCE = 0,
- DISC_AT_ONCE
- };
-
- // enum for the program to run
- enum{
- RUN_CDRECORD = 0,
- RUN_CDRDAO,
- RUN_MKISOFS
- };
- // enum for the track modification command to run
- enum{
- EDIT_TRACK = 0,
- DELETE_TRACK
- };
- // CFreeBurn's constructor
- CFreeBurn(FXApp* app);
- // CFreeBurn's destructor
- ~CFreeBurn();
- // Initialize
- virtual void create();
- protected:
- // Empty Constructor for later use in FOX
- CFreeBurn(){}
-
- // Methods for reading/writing from the registry
- void readThemeSettings();
- void readProgramSettings();
- void writeProgramSettings();
-
- // Method to execute an external program
- void runProgram();
-
- // Methods for setting the program theme settings
- void loadThemeIcons();
- void setThemeIcons();
- void changeToolBarIcons();
- void changeMenuIcons();
-
- // Methods for setting up the main program GUI controls
- void setupProgramMenus();
- void setupToolBar();
- void setupContentFrame();
-
- // Methods for getting and setting colors in the program
- void setBaseColor(FXColor color);
- FXColor getBaseColor() const;
- void setBackgroundColor(FXColor color);
- FXColor getBackgroundColor() const;
- void setForegroundColor(FXColor color);
- FXColor getForegroundColor() const;
- void setBorderColor(FXColor color);
- FXColor getBorderColor() const;
- void setMainControlsBaseColor (FXColor color, FXColor hilite, FXColor shadow);
- void setMainControlsBackgroundColor(FXColor color);
- void setMainControlsForegroundColor(FXColor color);
- void setMainControlsBorderColor (FXColor color);
-
- // Methods for setting the program colors back to defaults
- void setDefaultBaseColor();
- void setDefaultBackgroundColor();
- void setDefaultForegroundColor();
- void setDefaultBorderColor();
-
- // methods for loading/saving the disc layout to a .toc
- // Save changes, prompt for new m_fileName
- FXbool saveChanges();
- FXbool closeDisc();
-
- private:
- // Layout Frame for the main application contents
- FXVerticalFrame* m_contents;
- // The application menu bar
- FXMenubar* m_menuBar;
- // The menu bar's grip
- FXToolbarGrip* m_menuBarGrip;
- // The File menu
- FXMenuPane* m_fileMenu;
- // The Options menu
- FXMenuPane* m_optionsMenu;
- // The Help menu
- FXMenuPane* m_helpMenu;
- // The application toolbar
- FXToolbar* m_toolBar;
- // The toolbar's grip
- FXToolbarGrip* m_toolBarGrip;
- // The application status bar
- FXStatusbar* m_statusBar;
-
- // Toolbar Buttons (we need to have pointers
- // to these so we can change thier icons & colors)
- FXButton* m_NewDiscButton;
- FXButton* m_OpenDiscButton;
- FXButton* m_SaveDiscButton;
- FXButton* m_BurnCdButton;
- FXButton* m_CdImageButton;
- FXButton* m_PrefsButton;
- FXButton* m_HelpButton;
- FXButton* m_ExitButton;
-
- // separators used in the toolbar
- FXVerticalSeparator* m_ToolSeparator1;
- FXVerticalSeparator* m_ToolSeparator2;
- FXVerticalSeparator* m_ToolSeparator3;
-
- // Menu command objects (we need to track these
- // as well for changing their icons/colors...)
-
- // File menu title
- FXMenuTitle* m_FileMenuTitle;
- // Options menu title
- FXMenuTitle* m_OptionsMenuTitle;
- // Help menu title
- FXMenuTitle* m_HelpMenuTitle;
- // Menu Separators
- FXMenuSeparator* m_FileMenuSeparator;
- FXMenuSeparator* m_HelpMenuSeparator;
- // Commands in the File menu
- FXMenuCommand* m_NewMenuCommand;
- FXMenuCommand* m_OpenMenuCommand;
- FXMenuCommand* m_SaveMenuCommand;
- FXMenuCommand* m_CloseMenuCommand;
- FXMenuCommand* m_ExitMenuCommand;
- // Commands in the Options menu
- FXMenuCommand* m_PrefsMenuCommand;
- // Commands in the Help menu
- FXMenuCommand* m_HelpMenuCommand;
- FXMenuCommand* m_CdrecordHelpMenuCommand;
- FXMenuCommand* m_MkisofsHelpMenuCommand;
- FXMenuCommand* m_CdrdaoHelpMenuCommand;
- FXMenuCommand* m_AboutMenuCommand;
-
- // Stuff for the main window controls
- FXVerticalFrame* m_mainFrame;
- FXGroupBox* m_Group1;
- FXGroupBox* m_Group2;
- FXMatrix* m_contentMatrix;
- FXMatrix* m_secondMatrix;
-
- FXLabel* m_DiscSizeLabel;
- FXTextField* m_sizeField;
- FXLabel* m_DiscTypeLabel;
- FXTextField* m_typeField;
-
- FXLabel* m_catalogLabel;
- FXTextField* m_catalogField;
- FXCheckButton* m_cdTextButton;
- FXButton* m_editTextBut;
-
- FXLabel* m_addTrackLabel;
- FXOptionMenu* m_trackOptions;
- FXPopup* m_cddaPopup;
- FXPopup* m_cdromPopup;
- FXPopup* m_cdxaPopup;
- FXOption* m_cddaAudio;
- FXOption* m_cdromData;
- FXOption* m_cdromAudio;
- FXOption* m_cdromRaw;
- FXOption* m_cdxaAudio;
- FXOption* m_cdxaData;
- FXOption* m_cdxaAudio2;
- FXOption* m_cdxaRaw;
- FXLabel* m_trackLabel1;
- FXButton* m_addTrackBut;
-
- FXOptionMenu* m_modTrackOpts;
- FXPopup* m_modTrackPopup;
- FXOption* m_editTrack;
- FXOption* m_deleteTrack;
- FXLabel* m_modTrackLabel;
- FBSpinner* m_modTrackNum;
- FXButton* m_modTrackBut;
-
- FXHorizontalFrame* m_spaceFrame;
- FXLabel* m_usedSpaceLabel;
- FXTextField* m_usedSpaceField;
- FXLabel* m_freeSpaceLabel;
- FXTextField* m_freeSpaceField;
- FXProgressBar* m_percentFull;
-
- // Default Theme Icons for use in the app buttons
- FXIcon* m_DefaultNewIcon;
- FXIcon* m_DefaultOpenIcon;
- FXIcon* m_DefaultSaveIcon;
- FXIcon* m_DefaultCloseIcon;
- FXIcon* m_DefaultBurnCdIcon;
- FXIcon* m_DefaultCdImageIcon;
- FXIcon* m_DefaultPreferencesIcon;
- FXIcon* m_DefaultHelpIcon;
- FXIcon* m_DefaultExitIcon;
- FXIcon* m_DefaultThemePreviewIcon;
- FXIcon* m_DefaultFindIcon;
-
- // GNOME Theme Icons for use in the app buttons
- FXIcon* m_GnomeNewIcon;
- FXIcon* m_GnomeOpenIcon;
- FXIcon* m_GnomeSaveIcon;
- FXIcon* m_GnomeCloseIcon;
- FXIcon* m_GnomeBurnCdIcon;
- FXIcon* m_GnomeCdImageIcon;
- FXIcon* m_GnomePreferencesIcon;
- FXIcon* m_GnomeHelpIcon;
- FXIcon* m_GnomeExitIcon;
- FXIcon* m_GnomeThemePreviewIcon;
- FXIcon* m_GnomeFindIcon;
-
- // KDE Theme Icons for use in the app buttons
- FXIcon* m_KdeNewIcon;
- FXIcon* m_KdeOpenIcon;
- FXIcon* m_KdeSaveIcon;
- FXIcon* m_KdeCloseIcon;
- FXIcon* m_KdeBurnCdIcon;
- FXIcon* m_KdeCdImageIcon;
- FXIcon* m_KdePreferencesIcon;
- FXIcon* m_KdeHelpIcon;
- FXIcon* m_KdeExitIcon;
- FXIcon* m_KdeThemePreviewIcon;
- FXIcon* m_KdeFindIcon;
-
- // XP Theme Icons for use in the app buttons
- FXIcon* m_XpNewIcon;
- FXIcon* m_XpOpenIcon;
- FXIcon* m_XpSaveIcon;
- FXIcon* m_XpCloseIcon;
- FXIcon* m_XpBurnCdIcon;
- FXIcon* m_XpCdImageIcon;
- FXIcon* m_XpPreferencesIcon;
- FXIcon* m_XpHelpIcon;
- FXIcon* m_XpExitIcon;
- FXIcon* m_XpThemePreviewIcon;
- FXIcon* m_XpFindIcon;
-
- // default icons for building the application...
- FXIcon* m_NewIcon;
- FXIcon* m_OpenIcon;
- FXIcon* m_SaveIcon;
- FXIcon* m_CloseIcon;
- FXIcon* m_burnCdIcon;
- FXIcon* m_cdImageIcon;
- FXIcon* m_preferencesIcon;
- FXIcon* m_helpIcon;
- FXIcon* m_exitIcon;
- FXIcon* m_ThemePreviewIcon;
- FXIcon* m_FindIcon;
-
- // Icons for the application itself
- FXIcon* m_bigIcon;
- FXIcon* m_smallIcon;
-
- // Label that will contain the preview icon
- FXLabel* m_PreviewLabel;
-
- // Program Settings (loaded/saved in registry)
- FXint m_xpos;
- FXint m_ypos;
- FXint m_width;
- FXint m_height;
- FXint m_theme;
- FXString m_shellPath;
- FXString m_cdrecordPath;
- FXString m_mkisofsPath;
- FXString m_cdrdaoPath;
-
- // Help window items
- HelpWindow* m_HelpWindow;
- HelpWindow* m_CdrecordHelpWindow;
- HelpWindow* m_MkisofsHelpWindow;
- HelpWindow* m_CdrdaoHelpWindow;
-
- // Command execution settings
- FXint m_programToExecute;
- FXDataTarget m_programToExecuteDataTarget;
- FXbool m_useUnixShell;
- FXString m_commandLineOptions;
-
- // Handles to use for notifying our application when the
- // external program has output for us, or to notify us
- // of when our program is complete.
- FXInputHandle m_ReadOutputHandle;
- FXInputHandle m_ThreadCompleteHandle;
-
- // The system class to handle process execution and
- // threaded output buffering
- CFreeburnSystem* m_SystemClass;
-
- // A pointer to the command dialog so we can use it later
- CFreeburnCommandDialog* m_CommandDialog;
-
- // A CFreeburnDisc Pointer - pointer to the class representing
- // the disc layout and settings. A complete interface to the disc
- CFreeburnDisc* m_mainDisc;
-
- // Boolean if the disc has been created yet or not
- FXbool m_discExists;
-
- // Boolean if the disc layout has been saved or not
- FXbool m_discSaved;
-
- // Int to hold the track type to add
- FXint m_trackAddType;
-
- // int to hold the track modification command to run
- FXint m_modTrackCommand;
- };
- #endif