From ae820b8d591580b84629eca93244664b731f50c2 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Fri, 10 Feb 2006 19:06:14 +0000 Subject: [PATCH] moved the public constants from WidgetFactory to a separate class; this solves some circular reference isssues --- .../LiveSupport/Widgets/DialogWindow.h | 1 + .../include/LiveSupport/Widgets/WhiteWindow.h | 5 +- .../LiveSupport/Widgets/WidgetConstants.h | 105 ++++++++++++++++++ .../LiveSupport/Widgets/WidgetFactory.h | 51 ++------- .../LiveSupport/Widgets/ZebraTreeView.h | 4 +- .../src/modules/widgets/src/MessageWindow.h | 1 + .../src/modules/widgets/src/Notebook.cxx | 4 +- .../src/modules/widgets/src/TestWindow.cxx | 6 +- .../src/modules/widgets/src/WhiteWindow.cxx | 12 +- .../src/modules/widgets/src/WidgetFactory.cxx | 63 +++++------ .../src/modules/widgets/src/ZebraTreeView.cxx | 3 +- .../gLiveSupport/src/AdvancedSearchItem.cxx | 5 +- .../products/gLiveSupport/src/CuePlayer.cxx | 6 +- .../gLiveSupport/src/LiveModeWindow.cxx | 6 +- .../src/MasterPanelUserInfoWidget.cxx | 2 +- .../products/gLiveSupport/src/NowPlaying.cxx | 6 +- .../src/SchedulePlaylistWindow.cxx | 2 +- .../gLiveSupport/src/SchedulerWindow.cxx | 2 +- .../gLiveSupport/src/ScratchpadWindow.cxx | 12 +- .../gLiveSupport/src/SearchWindow.cxx | 6 +- .../src/SimplePlaylistManagementWindow.cxx | 2 +- 21 files changed, 192 insertions(+), 112 deletions(-) create mode 100644 livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetConstants.h diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h index 0bb4ef6f4..f9fee0da9 100644 --- a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h @@ -48,6 +48,7 @@ #include "LiveSupport/Core/LocalizedObject.h" #include "LiveSupport/Widgets/WhiteWindow.h" +#include "LiveSupport/Widgets/Button.h" namespace LiveSupport { namespace Widgets { diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h index 6caa1d048..cd5bfee5f 100644 --- a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WhiteWindow.h @@ -40,6 +40,7 @@ #include "configure.h" #endif +#include #include #include #include @@ -49,11 +50,11 @@ #include #include "LiveSupport/Core/Ptr.h" +#include "LiveSupport/Widgets/WidgetConstants.h" #include "LiveSupport/Widgets/CornerImages.h" #include "LiveSupport/Widgets/Colors.h" #include "LiveSupport/Widgets/ImageButton.h" #include "LiveSupport/Widgets/BlueBin.h" -#include "LiveSupport/Widgets/WidgetFactory.h" namespace LiveSupport { @@ -341,7 +342,7 @@ class WhiteWindow : public Gtk::Window, * @param cornerImages the corner images. * @param properties some WindowProperties flags */ - WhiteWindow(WidgetFactory::ImageType title, + WhiteWindow(WidgetConstants::ImageType title, Colors::ColorName backgroundColor, Ptr::Ref cornerImages, int properties = isResizable) diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetConstants.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetConstants.h new file mode 100644 index 000000000..cb314a18c --- /dev/null +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetConstants.h @@ -0,0 +1,105 @@ +/*------------------------------------------------------------------------------ + + Copyright (c) 2004 Media Development Loan Fund + + This file is part of the LiveSupport project. + http://livesupport.campware.org/ + To report bugs, send an e-mail to bugs@campware.org + + LiveSupport 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. + + LiveSupport 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 LiveSupport; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Author : $Author $ + Version : $Revision $ + Location : $URL $ + +------------------------------------------------------------------------------*/ +#ifndef LiveSupport_Widgets_WidgetConstants_h +#define LiveSupport_Widgets_WidgetConstants_h + +#ifndef __cplusplus +#error This is a C++ include file +#endif + + +/* ============================================================ include files */ + +namespace LiveSupport { +namespace Widgets { + +/* ================================================================ constants */ + + +/* =================================================================== macros */ + + +/* =============================================================== data types */ + +/** + * A collection of constants used by the widgets. + * + * Constants which are either used by more than one widget or used by + * the WidgetFactory class are collected here. This way widget headers + * do not need to include each other's or WidgetFactory's header. + * + * @author $Author $ + * @version $Revision $ + */ +class WidgetConstants +{ + public: + /** + * The types of available buttons. + */ + typedef enum { pushButton, tabButton } ButtonType; + + /** + * The types of available image buttons. + */ + typedef enum { deleteButton, plusButton, minusButton, + smallPlayButton, smallPauseButton, smallStopButton, + hugePlayButton, + cuePlayButton, cueStopButton, + masterPlayButton, masterPauseButton, masterStopButton, + windowMinimizeButton, windowMaximizeButton, + windowCloseButton } + ImageButtonType; + + /** + * The list of available miscellaneous images. + */ + typedef enum { resizeImage, + scratchpadWindowTitleImage, + searchWindowTitleImage, + liveModeWindowTitleImage, + playlistsWindowTitleImage, + schedulerWindowTitleImage, + audioClipIconImage, + playlistIconImage } + ImageType; +}; + + +/* ================================================= external data structures */ + + +/* ====================================================== function prototypes */ + + +} // namespace Widgets +} // namespace LiveSupport + +#endif // LiveSupport_Widgets_WidgetConstants_h + diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h index cef856ccb..d6dd857f7 100644 --- a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h @@ -46,6 +46,7 @@ #include "LiveSupport/Core/Configurable.h" #include "LiveSupport/Core/MetadataTypeContainer.h" +#include "LiveSupport/Widgets/WidgetConstants.h" #include "LiveSupport/Widgets/CornerImages.h" #include "LiveSupport/Widgets/ButtonImages.h" #include "LiveSupport/Widgets/Button.h" @@ -55,6 +56,8 @@ #include "LiveSupport/Widgets/OperatorComboBoxText.h" #include "LiveSupport/Widgets/BlueBin.h" #include "LiveSupport/Widgets/EntryBin.h" +#include "LiveSupport/Widgets/DialogWindow.h" +#include "LiveSupport/Widgets/ZebraTreeView.h" namespace LiveSupport { @@ -70,9 +73,6 @@ using namespace LiveSupport::Core; /* =============================================================== data types */ -class WhiteWindow; -class ZebraTreeView; - /** * A factory to provide access to LiveSupport Widgets. * @@ -97,38 +97,6 @@ class ZebraTreeView; class WidgetFactory : virtual public Configurable { - public: - /** - * The types of available buttons. - */ - typedef enum { pushButton, tabButton } ButtonType; - - /** - * The types of available image buttons. - */ - typedef enum { deleteButton, plusButton, minusButton, - smallPlayButton, smallPauseButton, smallStopButton, - hugePlayButton, - cuePlayButton, cueStopButton, - masterPlayButton, masterPauseButton, masterStopButton, - windowMinimizeButton, windowMaximizeButton, - windowCloseButton } - ImageButtonType; - - /** - * The list of available miscellaneous images. - */ - typedef enum { resizeImage, - scratchpadWindowTitleImage, - searchWindowTitleImage, - liveModeWindowTitleImage, - playlistsWindowTitleImage, - schedulerWindowTitleImage, - audioClipIconImage, - playlistIconImage } - ImageType; - - private: /** * The name of the configuration XML elmenent used by this object. @@ -193,7 +161,7 @@ class WidgetFactory : /** * A container holding the miscallenous image pixbuf references. */ - std::map > + std::map > imageTypePixbufs; /** @@ -268,8 +236,9 @@ class WidgetFactory : * @return a button with the specified label. */ Button * - createButton(const Glib::ustring & label, - ButtonType type = pushButton) + createButton( + const Glib::ustring & label, + WidgetConstants::ButtonType type = WidgetConstants::pushButton) throw (); /** @@ -281,7 +250,7 @@ class WidgetFactory : * @return a button of the requested type, or 0 */ ImageButton * - createButton(ImageButtonType type) throw (); + createButton(WidgetConstants::ImageButtonType type) throw (); /** * Create a combo box that holds text entries. @@ -366,7 +335,7 @@ class WidgetFactory : * @return the image. */ Glib::RefPtr - getPixbuf(ImageType imageName) throw (); + getPixbuf(WidgetConstants::ImageType imageName) throw (); /** * Create and return a container holding an image. @@ -376,7 +345,7 @@ class WidgetFactory : * @return the container holding the requested image. */ Gtk::Image * - createImage(ImageType imageName) throw (); + createImage(WidgetConstants::ImageType imageName) throw (); /** * Create and return a ZebraTreeView instance. diff --git a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h index cee5065f4..fdc120164 100644 --- a/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h +++ b/livesupport/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h @@ -50,7 +50,7 @@ #include #include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Widgets/WidgetFactory.h" +#include "LiveSupport/Widgets/WidgetConstants.h" #include "LiveSupport/Widgets/CornerImages.h" #include "LiveSupport/Widgets/ImageButton.h" #include "LiveSupport/Widgets/BlueBin.h" @@ -269,7 +269,7 @@ class ZebraTreeView : public Gtk::TreeView */ int appendColumn(const Glib::ustring& title, - WidgetFactory::ImageButtonType buttonType, + WidgetConstants::ImageButtonType buttonType, int minimumWidth = 0) throw (); diff --git a/livesupport/src/modules/widgets/src/MessageWindow.h b/livesupport/src/modules/widgets/src/MessageWindow.h index 1a9abd553..a72df4908 100644 --- a/livesupport/src/modules/widgets/src/MessageWindow.h +++ b/livesupport/src/modules/widgets/src/MessageWindow.h @@ -45,6 +45,7 @@ #include "LiveSupport/Core/Ptr.h" +#include "LiveSupport/Widgets/Button.h" #include "LiveSupport/Widgets/WhiteWindow.h" namespace LiveSupport { diff --git a/livesupport/src/modules/widgets/src/Notebook.cxx b/livesupport/src/modules/widgets/src/Notebook.cxx index 3662d27ce..c01d9ae28 100644 --- a/livesupport/src/modules/widgets/src/Notebook.cxx +++ b/livesupport/src/modules/widgets/src/Notebook.cxx @@ -58,8 +58,6 @@ using namespace LiveSupport::Widgets; *----------------------------------------------------------------------------*/ Notebook :: Notebook(void) throw () { - Ptr::Ref wf = WidgetFactory::getInstance(); - layout = Gtk::manage(new Gtk::VBox()); tabBox = Gtk::manage(new Gtk::HBox()); pageHolder = Gtk::manage(new Gtk::Alignment()); @@ -216,7 +214,7 @@ Notebook :: appendPage(Gtk::Widget & widget, { Ptr::Ref wf = WidgetFactory::getInstance(); Button * button = wf->createButton(label, - WidgetFactory::tabButton); + WidgetConstants::tabButton); Page * page = new Page(this, pageList.size(), &widget, button); pageList.push_back(page); diff --git a/livesupport/src/modules/widgets/src/TestWindow.cxx b/livesupport/src/modules/widgets/src/TestWindow.cxx index aeaeb38c0..32b7b6e05 100644 --- a/livesupport/src/modules/widgets/src/TestWindow.cxx +++ b/livesupport/src/modules/widgets/src/TestWindow.cxx @@ -72,13 +72,13 @@ TestWindow :: TestWindow (void) // init the imageButtons hugeImageButton = Gtk::manage( - widgetFactory->createButton(WidgetFactory::hugePlayButton)); + widgetFactory->createButton(WidgetConstants::hugePlayButton)); cuePlayImageButton = Gtk::manage( - widgetFactory->createButton(WidgetFactory::cuePlayButton)); + widgetFactory->createButton(WidgetConstants::cuePlayButton)); cuePlayImageButton->signal_clicked().connect(sigc::mem_fun(*this, &TestWindow::onPlayButtonClicked)); cueStopImageButton = Gtk::manage( - widgetFactory->createButton(WidgetFactory::cueStopButton)); + widgetFactory->createButton(WidgetConstants::cueStopButton)); cueStopImageButton->signal_clicked().connect(sigc::mem_fun(*this, &TestWindow::onStopButtonClicked)); diff --git a/livesupport/src/modules/widgets/src/WhiteWindow.cxx b/livesupport/src/modules/widgets/src/WhiteWindow.cxx index 550b33caa..124c19ab6 100644 --- a/livesupport/src/modules/widgets/src/WhiteWindow.cxx +++ b/livesupport/src/modules/widgets/src/WhiteWindow.cxx @@ -35,6 +35,8 @@ #include +#include "LiveSupport/Widgets/WidgetFactory.h" + #include "LiveSupport/Widgets/WhiteWindow.h" @@ -55,7 +57,7 @@ using namespace LiveSupport::Widgets; /*------------------------------------------------------------------------------ * Constructor for windows with image titles. *----------------------------------------------------------------------------*/ -WhiteWindow :: WhiteWindow(WidgetFactory::ImageType title, +WhiteWindow :: WhiteWindow(WidgetConstants::ImageType title, Colors::ColorName backgroundColor, Ptr::Ref cornerImages, int properties) @@ -133,7 +135,7 @@ WhiteWindow :: constructWindow(Colors::ColorName backgroundColor, int padding = 5; if (!(properties & isModal)) { closeButton = Gtk::manage(wf->createButton( - WidgetFactory::windowCloseButton)); + WidgetConstants::windowCloseButton)); cornerButtonBox->pack_end(*closeButton, Gtk::PACK_SHRINK, padding); padding = 0; closeButton->signal_clicked().connect(sigc::mem_fun(*this, @@ -141,14 +143,14 @@ WhiteWindow :: constructWindow(Colors::ColorName backgroundColor, } if (properties & isResizable) { maximizeButton = Gtk::manage(wf->createButton( - WidgetFactory::windowMaximizeButton)); + WidgetConstants::windowMaximizeButton)); cornerButtonBox->pack_end(*maximizeButton, Gtk::PACK_SHRINK, padding); padding = (padding == 0) ? 5 : 0; maximizeButton->signal_clicked().connect(sigc::mem_fun(*this, &WhiteWindow::onMaximizeButtonClicked)); minimizeButton = Gtk::manage(wf->createButton( - WidgetFactory::windowMinimizeButton)); + WidgetConstants::windowMinimizeButton)); cornerButtonBox->pack_end(*minimizeButton, Gtk::PACK_SHRINK, padding); minimizeButton->signal_clicked().connect(sigc::mem_fun(*this, &WhiteWindow::onMinimizeButtonClicked)); @@ -167,7 +169,7 @@ WhiteWindow :: constructWindow(Colors::ColorName backgroundColor, // create the resize image if (properties & isResizable) { - resizeImage = Gtk::manage(wf->createImage(WidgetFactory::resizeImage)); + resizeImage = Gtk::manage(wf->createImage(WidgetConstants::resizeImage)); resizeEventBox = Gtk::manage(new Gtk::EventBox()); resizeEventBox->modify_bg(Gtk::STATE_NORMAL, bgColor); resizeEventBox->add(*resizeImage); diff --git a/livesupport/src/modules/widgets/src/WidgetFactory.cxx b/livesupport/src/modules/widgets/src/WidgetFactory.cxx index 3f7068dc2..90e3ca874 100644 --- a/livesupport/src/modules/widgets/src/WidgetFactory.cxx +++ b/livesupport/src/modules/widgets/src/WidgetFactory.cxx @@ -37,7 +37,6 @@ #include #include "LiveSupport/Widgets/Colors.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" #include "MessageWindow.h" #include "LiveSupport/Widgets/WidgetFactory.h" @@ -389,20 +388,21 @@ WidgetFactory :: configure(const xmlpp::Element & element) whiteWindowImages.reset(new CornerImages(path + whiteWindowPath)); // load the miscellaneous images - imageTypePixbufs[resizeImage] = loadImage(resizeImageName); - imageTypePixbufs[scratchpadWindowTitleImage] + imageTypePixbufs[WidgetConstants::resizeImage] + = loadImage(resizeImageName); + imageTypePixbufs[WidgetConstants::scratchpadWindowTitleImage] = loadImage(scratchpadWindowTitleImageName); - imageTypePixbufs[searchWindowTitleImage] + imageTypePixbufs[WidgetConstants::searchWindowTitleImage] = loadImage(searchWindowTitleImageName); - imageTypePixbufs[liveModeWindowTitleImage] + imageTypePixbufs[WidgetConstants::liveModeWindowTitleImage] = loadImage(liveModeWindowTitleImageName); - imageTypePixbufs[playlistsWindowTitleImage] + imageTypePixbufs[WidgetConstants::playlistsWindowTitleImage] = loadImage(playlistsWindowTitleImageName); - imageTypePixbufs[schedulerWindowTitleImage] + imageTypePixbufs[WidgetConstants::schedulerWindowTitleImage] = loadImage(schedulerWindowTitleImageName); - imageTypePixbufs[audioClipIconImage] + imageTypePixbufs[WidgetConstants::audioClipIconImage] = loadImage(audioClipIconImageName); - imageTypePixbufs[playlistIconImage] + imageTypePixbufs[WidgetConstants::playlistIconImage] = loadImage(playlistIconImageName); } @@ -437,14 +437,14 @@ WidgetFactory :: loadImage(const std::string imageName) * Create a button *----------------------------------------------------------------------------*/ Button * -WidgetFactory :: createButton(const Glib::ustring & label, - ButtonType type) throw () +WidgetFactory :: createButton(const Glib::ustring & label, + WidgetConstants::ButtonType type) throw () { switch (type) { - case pushButton: + case WidgetConstants::pushButton: return new Button(label, buttonImages); - case tabButton: + case WidgetConstants::tabButton: return new Button(label, tabButtonImages); default: @@ -529,83 +529,84 @@ WidgetFactory :: createEntryBin(void) throw () * Create a stock button *----------------------------------------------------------------------------*/ ImageButton * -WidgetFactory :: createButton(ImageButtonType type) throw () +WidgetFactory :: createButton(WidgetConstants::ImageButtonType type) + throw () { Glib::RefPtr passiveImage; Glib::RefPtr rollImage; switch (type) { - case deleteButton: + case WidgetConstants::deleteButton: passiveImage = loadImage(deleteButtonPassiveName); rollImage = loadImage(deleteButtonRollName); break; - case plusButton: + case WidgetConstants::plusButton: passiveImage = loadImage(plusButtonPassiveName); rollImage = loadImage(plusButtonRollName); break; - case minusButton: + case WidgetConstants::minusButton: passiveImage = loadImage(minusButtonPassiveName); rollImage = loadImage(minusButtonRollName); break; - case smallPlayButton: + case WidgetConstants::smallPlayButton: passiveImage = loadImage(smallPlayButtonPassiveName); rollImage = loadImage(smallPlayButtonRollName); break; - case smallPauseButton: + case WidgetConstants::smallPauseButton: passiveImage = loadImage(smallPauseButtonPassiveName); rollImage = loadImage(smallPauseButtonRollName); break; - case smallStopButton: + case WidgetConstants::smallStopButton: passiveImage = loadImage(smallStopButtonPassiveName); rollImage = loadImage(smallStopButtonRollName); break; - case hugePlayButton: + case WidgetConstants::hugePlayButton: passiveImage = loadImage(hugePlayButtonPassiveName); rollImage = loadImage(hugePlayButtonRollName); break; - case cuePlayButton: + case WidgetConstants::cuePlayButton: passiveImage = loadImage(cuePlayButtonPassiveName); rollImage = loadImage(cuePlayButtonRollName); break; - case cueStopButton: + case WidgetConstants::cueStopButton: passiveImage = loadImage(cueStopButtonPassiveName); rollImage = loadImage(cueStopButtonRollName); break; - case masterPlayButton: + case WidgetConstants::masterPlayButton: passiveImage = loadImage(masterPlayButtonPassiveName); rollImage = loadImage(masterPlayButtonRollName); break; - case masterPauseButton: + case WidgetConstants::masterPauseButton: passiveImage = loadImage(masterPauseButtonPassiveName); rollImage = loadImage(masterPauseButtonRollName); break; - case masterStopButton: + case WidgetConstants::masterStopButton: passiveImage = loadImage(masterStopButtonPassiveName); rollImage = loadImage(masterStopButtonRollName); break; - case windowMinimizeButton: + case WidgetConstants::windowMinimizeButton: passiveImage = loadImage(windowMinimizeButtonPassiveName); rollImage = loadImage(windowMinimizeButtonRollName); break; - case windowMaximizeButton: + case WidgetConstants::windowMaximizeButton: passiveImage = loadImage(windowMaximizeButtonPassiveName); rollImage = loadImage(windowMaximizeButtonRollName); break; - case windowCloseButton: + case WidgetConstants::windowCloseButton: passiveImage = loadImage(windowCloseButtonPassiveName); rollImage = loadImage(windowCloseButtonRollName); break; @@ -622,7 +623,7 @@ WidgetFactory :: createButton(ImageButtonType type) throw () * Return a Gdk::Pixbuf reference to a named image *----------------------------------------------------------------------------*/ Glib::RefPtr -WidgetFactory :: getPixbuf(ImageType imageName) throw () +WidgetFactory :: getPixbuf(WidgetConstants::ImageType imageName) throw () { return imageTypePixbufs[imageName]; } @@ -632,7 +633,7 @@ WidgetFactory :: getPixbuf(ImageType imageName) throw () * Create a Gtk::Image *----------------------------------------------------------------------------*/ Gtk::Image * -WidgetFactory :: createImage(ImageType imageName) throw () +WidgetFactory :: createImage(WidgetConstants::ImageType imageName) throw () { return new Gtk::Image(getPixbuf(imageName)); } diff --git a/livesupport/src/modules/widgets/src/ZebraTreeView.cxx b/livesupport/src/modules/widgets/src/ZebraTreeView.cxx index 507f45c16..749a5d3a9 100644 --- a/livesupport/src/modules/widgets/src/ZebraTreeView.cxx +++ b/livesupport/src/modules/widgets/src/ZebraTreeView.cxx @@ -36,6 +36,7 @@ #include #include +#include "LiveSupport/Widgets/WidgetFactory.h" #include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" #include "LiveSupport/Widgets/ZebraTreeView.h" @@ -155,7 +156,7 @@ ZebraTreeView :: appendColumn( int ZebraTreeView :: appendColumn( const Glib::ustring & title, - WidgetFactory::ImageButtonType buttonType, + WidgetConstants::ImageButtonType buttonType, int minimumWidth) throw () { diff --git a/livesupport/src/products/gLiveSupport/src/AdvancedSearchItem.cxx b/livesupport/src/products/gLiveSupport/src/AdvancedSearchItem.cxx index 6d6281855..1bd4c476f 100644 --- a/livesupport/src/products/gLiveSupport/src/AdvancedSearchItem.cxx +++ b/livesupport/src/products/gLiveSupport/src/AdvancedSearchItem.cxx @@ -89,12 +89,13 @@ AdvancedSearchItem :: AdvancedSearchItem( pack_start(*valueEntry, Gtk::PACK_EXPAND_WIDGET, 5); if (isFirst) { - plusButton = Gtk::manage(wf->createButton(WidgetFactory::plusButton)); + plusButton = Gtk::manage(wf->createButton(WidgetConstants::plusButton)); pack_start(*plusButton, Gtk::PACK_SHRINK, 5); plusButton->signal_clicked().connect(sigc::mem_fun(*this, &AdvancedSearchItem::onPlusButtonClicked )); } else { - closeButton = Gtk::manage(wf->createButton(WidgetFactory::minusButton)); + closeButton = Gtk::manage(wf->createButton( + WidgetConstants::minusButton)); closeButton->signal_clicked().connect(sigc::mem_fun(*this, &AdvancedSearchItem::destroy_ )); pack_start(*closeButton, Gtk::PACK_SHRINK, 5); diff --git a/livesupport/src/products/gLiveSupport/src/CuePlayer.cxx b/livesupport/src/products/gLiveSupport/src/CuePlayer.cxx index 8c569e7d2..ecc8e0bc7 100644 --- a/livesupport/src/products/gLiveSupport/src/CuePlayer.cxx +++ b/livesupport/src/products/gLiveSupport/src/CuePlayer.cxx @@ -69,11 +69,11 @@ CuePlayer :: CuePlayer(Ptr::Ref gLiveSupport, Ptr::Ref wf = WidgetFactory::getInstance(); playButton = Gtk::manage(wf->createButton( - WidgetFactory::smallPlayButton )); + WidgetConstants::smallPlayButton )); pauseButton = Gtk::manage(wf->createButton( - WidgetFactory::smallPauseButton )); + WidgetConstants::smallPauseButton )); stopButton = Gtk::manage(wf->createButton( - WidgetFactory::smallStopButton )); + WidgetConstants::smallStopButton )); playButton->signal_clicked().connect(sigc::mem_fun(*this, &CuePlayer::onPlayButtonClicked )); diff --git a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx index a8ab4005f..110283204 100644 --- a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx @@ -71,7 +71,7 @@ static const Glib::ustring windowName = "liveModeWindow"; LiveModeWindow :: LiveModeWindow (Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () - : WhiteWindow(WidgetFactory::liveModeWindowTitleImage, + : WhiteWindow(WidgetConstants::liveModeWindowTitleImage, Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle), @@ -98,7 +98,7 @@ LiveModeWindow :: LiveModeWindow (Ptr::Ref gLiveSupport, // Add the TreeView's view columns: try { treeView->appendLineNumberColumn("", 2 /* offset */, 50); -// treeView->appendColumn("", WidgetFactory::hugePlayButton, 82); +// treeView->appendColumn("", WidgetConstants::hugePlayButton, 82); treeView->appendColumn("", modelColumns.infoColumn, 200); } catch (std::invalid_argument &e) { std::cerr << e.what() << std::endl; @@ -124,7 +124,7 @@ LiveModeWindow :: LiveModeWindow (Ptr::Ref gLiveSupport, // Create the play etc buttons: Gtk::HBox * buttonBox = Gtk::manage(new Gtk::HBox); ImageButton * outputPlayButton = Gtk::manage(wf->createButton( - WidgetFactory::hugePlayButton )); + WidgetConstants::hugePlayButton )); Gtk::VBox * cueAudioBox = Gtk::manage(new Gtk::VBox); Gtk::HBox * cueAudioLabelBox = Gtk::manage(new Gtk::HBox); Gtk::Label * cueAudioLabel; diff --git a/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx b/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx index f51b7431d..80a42fa83 100644 --- a/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx +++ b/livesupport/src/products/gLiveSupport/src/MasterPanelUserInfoWidget.cxx @@ -75,7 +75,7 @@ MasterPanelUserInfoWidget :: MasterPanelUserInfoWidget ( logInOutButton->signal_clicked().connect(sigc::mem_fun(*this, &MasterPanelUserInfoWidget::onLoginButtonClicked)); - closeButton = Gtk::manage(wf->createButton(WidgetFactory::deleteButton)); + closeButton = Gtk::manage(wf->createButton(WidgetConstants::deleteButton)); closeButton->signal_clicked().connect(sigc::mem_fun(*this, &MasterPanelUserInfoWidget::onCloseButtonClicked)); diff --git a/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx b/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx index fd6f43296..70b72bc3f 100644 --- a/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx +++ b/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx @@ -74,11 +74,11 @@ NowPlaying :: NowPlaying(Ptr::Ref gLiveSupport, Ptr::Ref wf = WidgetFactory::getInstance(); playButton = Gtk::manage(wf->createButton( - WidgetFactory::masterPlayButton )); + WidgetConstants::masterPlayButton )); pauseButton = Gtk::manage(wf->createButton( - WidgetFactory::masterPauseButton )); + WidgetConstants::masterPauseButton )); stopButton = Gtk::manage(wf->createButton( - WidgetFactory::masterStopButton )); + WidgetConstants::masterStopButton )); playButton->signal_clicked().connect(sigc::mem_fun(*this, &NowPlaying::onPlayButtonClicked )); diff --git a/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx b/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx index 8d56fa853..40f94a1f2 100644 --- a/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx @@ -66,7 +66,7 @@ SchedulePlaylistWindow :: SchedulePlaylistWindow ( Ptr::Ref bundle, Ptr::Ref playlist) throw () - : WhiteWindow(WidgetFactory::schedulerWindowTitleImage, + : WhiteWindow(WidgetConstants::schedulerWindowTitleImage, Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle), diff --git a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx index a044c7ec5..57616d016 100644 --- a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx @@ -68,7 +68,7 @@ static const Glib::ustring windowName = "schedulerWindow"; SchedulerWindow :: SchedulerWindow (Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () - : WhiteWindow(WidgetFactory::schedulerWindowTitleImage, + : WhiteWindow(WidgetConstants::schedulerWindowTitleImage, Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle), diff --git a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx index fa1184ce8..ea98802eb 100644 --- a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx @@ -70,7 +70,7 @@ static const Glib::ustring windowName = "scratchpadWindow"; ScratchpadWindow :: ScratchpadWindow (Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () - : WhiteWindow(WidgetFactory::scratchpadWindowTitleImage, + : WhiteWindow(WidgetConstants::scratchpadWindowTitleImage, Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle), @@ -575,17 +575,17 @@ ScratchpadWindow :: addItem(Ptr::Ref playable) switch (playable->getType()) { case Playable::AudioClipType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetFactory::audioClipIconImage); + row[modelColumns.typeColumn] = widgetFactory->getPixbuf( + WidgetConstants::audioClipIconImage); break; case Playable::PlaylistType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetFactory::playlistIconImage); + row[modelColumns.typeColumn] = widgetFactory->getPixbuf( + WidgetConstants::playlistIconImage); break; } - row[modelColumns.titleColumn] = Glib::Markup::escape_text( + row[modelColumns.titleColumn] = Glib::Markup::escape_text( *playable->getTitle()); // cache the item if it hasn't been cached yet diff --git a/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx b/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx index be37eed08..cb35b1ec8 100644 --- a/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SearchWindow.cxx @@ -69,7 +69,7 @@ using namespace LiveSupport::GLiveSupport; SearchWindow :: SearchWindow (Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () - : WhiteWindow(WidgetFactory::searchWindowTitleImage, + : WhiteWindow(WidgetConstants::searchWindowTitleImage, Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle), @@ -373,11 +373,11 @@ SearchWindow :: onSearch(Ptr::Ref criteria) switch (playable->getType()) { case Playable::AudioClipType: row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetFactory::audioClipIconImage); + WidgetConstants::audioClipIconImage); break; case Playable::PlaylistType: row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetFactory::playlistIconImage); + WidgetConstants::playlistIconImage); break; default: break; diff --git a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx index 632598d23..1d301d271 100644 --- a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx @@ -70,7 +70,7 @@ SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow ( Ptr::Ref gLiveSupport, Ptr::Ref bundle) throw () - : WhiteWindow(WidgetFactory::playlistsWindowTitleImage, + : WhiteWindow(WidgetConstants::playlistsWindowTitleImage, Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners()), LocalizedObject(bundle),