From 8645db73581c77c641d65397ae7148f8c96fcf4c Mon Sep 17 00:00:00 2001 From: fgerlits Date: Wed, 30 Aug 2006 16:05:48 +0000 Subject: [PATCH] Created taskbar icons for all windows. This fixes #1751. --- livesupport/etc/debian/rules | 1 + .../src/products/gLiveSupport/etc/Makefile.in | 4 +- .../gLiveSupport/etc/gLiveSupport.xml | 6 + .../etc/gLiveSupport.xml.template | 6 + .../etc/gLiveSupport.xml.user-template | 6 + .../gLiveSupport/src/GLiveSupport.cxx | 17 ++ .../products/gLiveSupport/src/GLiveSupport.h | 6 + .../gLiveSupport/src/TaskbarIcons.cxx | 108 +++++++++++ .../products/gLiveSupport/src/TaskbarIcons.h | 171 ++++++++++++++++++ .../src/products/gLiveSupport/var/icon16.png | Bin 0 -> 480 bytes .../src/products/gLiveSupport/var/icon32.png | Bin 0 -> 692 bytes .../src/products/gLiveSupport/var/icon48.png | Bin 0 -> 2605 bytes 12 files changed, 324 insertions(+), 1 deletion(-) create mode 100644 livesupport/src/products/gLiveSupport/src/TaskbarIcons.cxx create mode 100644 livesupport/src/products/gLiveSupport/src/TaskbarIcons.h create mode 100644 livesupport/src/products/gLiveSupport/var/icon16.png create mode 100644 livesupport/src/products/gLiveSupport/var/icon32.png create mode 100644 livesupport/src/products/gLiveSupport/var/icon48.png diff --git a/livesupport/etc/debian/rules b/livesupport/etc/debian/rules index 0c40eb0e0..8fbaa23e1 100755 --- a/livesupport/etc/debian/rules +++ b/livesupport/etc/debian/rules @@ -138,6 +138,7 @@ install-arch: mv -f $(CURDIR)/debian/livesupport/opt/livesupport/var/LiveSupport/Widgets \ $(CURDIR)/debian/livesupport/opt/livesupport/var/LiveSupport/gLiveSupport*.res \ $(CURDIR)/debian/livesupport/opt/livesupport/var/LiveSupport/livesupport.png \ + $(CURDIR)/debian/livesupport/opt/livesupport/var/LiveSupport/icon*.png \ $(CURDIR)/debian/livesupport/opt/livesupport/var/LiveSupport/stationLogo.png \ $(CURDIR)/debian/livesupport/opt/livesupport/var/LiveSupport/testAudio.ogg \ $(CURDIR)/debian/livesupport/opt/livesupport/var/LiveSupport/testAudio.ogg.license \ diff --git a/livesupport/src/products/gLiveSupport/etc/Makefile.in b/livesupport/src/products/gLiveSupport/etc/Makefile.in index 52286a009..4c36a3ccf 100644 --- a/livesupport/src/products/gLiveSupport/etc/Makefile.in +++ b/livesupport/src/products/gLiveSupport/etc/Makefile.in @@ -269,7 +269,8 @@ G_LIVESUPPORT_OBJS = ${TMP_DIR}/GLiveSupport.o \ ${TMP_DIR}/ExportPlaylistWindow.o \ ${TMP_DIR}/ExportFormatRadioButtons.o \ ${TMP_DIR}/TransportList.o \ - ${TMP_DIR}/RestoreBackupWindow.o + ${TMP_DIR}/RestoreBackupWindow.o \ + ${TMP_DIR}/TaskbarIcons.o G_LIVESUPPORT_RES = ${TMP_DIR}/${PACKAGE_NAME}_root.res \ ${TMP_DIR}/${PACKAGE_NAME}_en.res \ @@ -352,6 +353,7 @@ install: all ${CP} ${TMP_DIR}/*.res ${USR_VAR_DIR}/LiveSupport ${CP} ${VAR_DIR}/livesupport.png \ ${VAR_DIR}/stationLogo.png \ + ${VAR_DIR}/icon*.png \ ${VAR_DIR}/testAudio.ogg \ ${VAR_DIR}/testAudio.ogg.license ${USR_VAR_DIR}/LiveSupport ${CP} ${BIN_DIR}/gLiveSupport.sh ${USR_BIN_DIR} diff --git a/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml b/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml index 8425be700..b1d5c4236 100644 --- a/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml +++ b/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml @@ -169,6 +169,12 @@ + + + + + + diff --git a/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.template b/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.template index c431f9814..1fb649073 100644 --- a/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.template +++ b/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.template @@ -168,6 +168,12 @@ + + + + + + diff --git a/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.user-template b/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.user-template index 17032397a..9ffa102a2 100644 --- a/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.user-template +++ b/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.user-template @@ -168,6 +168,12 @@ + + + + + + diff --git a/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx b/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx index eebfa9ac2..e1a7017b0 100644 --- a/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx +++ b/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx @@ -141,6 +141,11 @@ const std::string cuePlayerElementName = "cuePlayer"; *----------------------------------------------------------------------------*/ const std::string stationLogoConfigElementName = "stationLogo"; +/*------------------------------------------------------------------------------ + * The name of the config element for the taskbar icon images + *----------------------------------------------------------------------------*/ +const std::string taskbarIconsConfigElementName = "taskbarIcons"; + /*------------------------------------------------------------------------------ * The name of the config element for the test audio file location *----------------------------------------------------------------------------*/ @@ -335,6 +340,15 @@ GLiveSupport :: configure(const xmlpp::Element & element) throw std::invalid_argument("could not open station logo image file"); } + // configure the taskbar icon images + nodes = element.get_children(taskbarIconsConfigElementName); + if (nodes.size() < 1) { + throw std::invalid_argument("no taskbar icons element"); + } + taskbarIcons.reset(new TaskbarIcons()); + taskbarIcons->configure( + *dynamic_cast(nodes.front()) ); + // configure the MetadataTypeContainer nodes = element.get_children(MetadataTypeContainer::getConfigElementName()); if (nodes.size() < 1) { @@ -504,6 +518,9 @@ GLiveSupport :: show(void) throw () { masterPanel.reset(new MasterPanelWindow(shared_from_this(), getBundle())); + masterPanel->set_icon_list(taskbarIcons->getIconList()); + masterPanel->set_default_icon_list(taskbarIcons->getIconList()); + // Shows the window and returns when it is closed. Gtk::Main::run(*masterPanel); diff --git a/livesupport/src/products/gLiveSupport/src/GLiveSupport.h b/livesupport/src/products/gLiveSupport/src/GLiveSupport.h index 9b5788ef8..054f59488 100644 --- a/livesupport/src/products/gLiveSupport/src/GLiveSupport.h +++ b/livesupport/src/products/gLiveSupport/src/GLiveSupport.h @@ -56,6 +56,7 @@ #include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" #include "LiveSupport/Widgets/WidgetFactory.h" #include "KeyboardShortcutList.h" +#include "TaskbarIcons.h" #include "ContentsStorable.h" @@ -250,6 +251,11 @@ class GLiveSupport : public LocalizedConfigurable, */ Glib::RefPtr stationLogoPixbuf; + /** + * The wrapper class containing the taskbar icon images. + */ + Ptr::Ref taskbarIcons; + /** * The location of the test audio file. */ diff --git a/livesupport/src/products/gLiveSupport/src/TaskbarIcons.cxx b/livesupport/src/products/gLiveSupport/src/TaskbarIcons.cxx new file mode 100644 index 000000000..3b37cf29d --- /dev/null +++ b/livesupport/src/products/gLiveSupport/src/TaskbarIcons.cxx @@ -0,0 +1,108 @@ +/*------------------------------------------------------------------------------ + + 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$ + +------------------------------------------------------------------------------*/ + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include "TaskbarIcons.h" + + +using namespace LiveSupport::Core; +using namespace LiveSupport::GLiveSupport; + +/* =================================================== local data structures */ + + +/* ================================================ local constants & macros */ + +/** + * The name of the config element for this class + */ +const std::string TaskbarIcons::configElementName = "taskbarIcons"; + +namespace { + +/** + * The name of the icon sub-element. + */ +const std::string iconElementName = "icon"; + +/** + * The name of the path attribute. + */ +const std::string pathAttributeName = "path"; + +} + +/* =============================================== local function prototypes */ + + +/* ============================================================= module code */ + +/*------------------------------------------------------------------------------ + * Create a taskbar icons object based on an XML element. + *----------------------------------------------------------------------------*/ +void +TaskbarIcons :: configure(const xmlpp::Element & element) + throw (std::invalid_argument) +{ + if (element.get_name() != configElementName) { + throw std::invalid_argument("bad coniguration element " + + element.get_name()); + } + + xmlpp::Node::NodeList childNodes = element.get_children(iconElementName); + xmlpp::Node::NodeList::const_iterator it; + + for (it = childNodes.begin(); it != childNodes.end(); ++it) { + const xmlpp::Element * iconElement + = dynamic_cast (*it); + xmlpp::Attribute * pathAttr = iconElement->get_attribute( + pathAttributeName ); + if (pathAttr) { + Glib::ustring path = pathAttr->get_value(); + try { + Glib::RefPtr + image = Gdk::Pixbuf::create_from_file(path); + taskbarIconList.push_back(image); + + } catch (Gdk::PixbufError &e) { + Glib::ustring errorMsg = "could not open icon image file: "; + errorMsg.append(path); + throw std::invalid_argument(errorMsg); + } + } else { + throw std::invalid_argument("missing path attribute in " + "taskbarIcons/icon"); + } + } +} diff --git a/livesupport/src/products/gLiveSupport/src/TaskbarIcons.h b/livesupport/src/products/gLiveSupport/src/TaskbarIcons.h new file mode 100644 index 000000000..876939786 --- /dev/null +++ b/livesupport/src/products/gLiveSupport/src/TaskbarIcons.h @@ -0,0 +1,171 @@ +/*------------------------------------------------------------------------------ + + 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_GLiveSupport_TaskbarIcons_h +#define LiveSupport_GLiveSupport_TaskbarIcons_h + +#ifndef __cplusplus +#error This is a C++ include file +#endif + + +/* ============================================================ include files */ + +#ifdef HAVE_CONFIG_H +#include "configure.h" +#endif + +#include +#include +#include + +#include "LiveSupport/Core/Ptr.h" +#include "LiveSupport/Core/Configurable.h" + + +namespace LiveSupport { +namespace GLiveSupport { + +using namespace LiveSupport::Core; + +/* ================================================================ constants */ + + +/* =================================================================== macros */ + + +/* =============================================================== data types */ + +/** + * Container holding taskbar icon images. + * + * This object has to be configured with an XML configuration element + * called taskbarIcons. This may look like the following: + * + *

+ *  <taskbarIcons>
+ *      <icon path="..." />
+ *      <icon path="..." />
+ *      ...
+ *      <icon path="..." />
+ *  </taskbarIcons>
+ *  
+ * + * The DTD for the expected XML element is the following: + * + *

+ *  
+ *  
+ *  
+ *  
+ * + * @author $Author$ + * @version $Revision$ + * @see TaskbarIcon + */ +class TaskbarIcons : public Configurable +{ + private: + /** + * The name of the configuration XML element used by TaskbarIcons. + */ + static const std::string configElementName; + + /** + * A vector type holding the taskbar icon images. + */ + typedef std::vector > + PixbufListType; + + /** + * The list of all taskbar icon images. + */ + PixbufListType taskbarIconList; + + + public: + /** + * Constructor. + */ + TaskbarIcons() throw () + { + } + + /** + * A virtual destructor, as this class has virtual functions. + */ + virtual + ~TaskbarIcons(void) throw () + { + } + + /** + * Return the name of the XML element this object expects + * to be sent to a call to configure(). + * + * @return the name of the expected XML configuration element. + */ + static const std::string + getConfigElementName(void) throw () + { + return configElementName; + } + + /** + * Configure the metadata object based on an XML configuration element. + * + * @param elemen the XML configuration element. + * @exception std::invalid_argument of the supplied XML element + * contains bad configuration information + */ + virtual void + configure(const xmlpp::Element &element) + throw (std::invalid_argument); + + /** + * Return a Glib::ListHandle to the list of taskbar icon images. + */ + const Glib::ListHandle > + getIconList(void) const throw () + { + return taskbarIconList; + } +}; + + +/* ================================================= external data structures */ + + +/* ====================================================== function prototypes */ + + +} // namespace GLiveSupport +} // namespace LiveSupport + +#endif // LiveSupport_GLiveSupport_TaskbarIcons_h + diff --git a/livesupport/src/products/gLiveSupport/var/icon16.png b/livesupport/src/products/gLiveSupport/var/icon16.png new file mode 100644 index 0000000000000000000000000000000000000000..d6a8fa8ee863ecc4edbc8685923ea350e9f723ac GIT binary patch literal 480 zcmV<60U!Q}P)z+lh7z)=5RN;U7lra1%i%&U%!x6g$C+cK@; z$If{Ua07llysFRm>sJ*^YM&5;W9gE@2JK_xbVkjy~g>-u=w4?hF1G5I@EA>9ye>LCL4T zt%3r0EW9uNx^YJ5zmUX7b}^a97_RvB?zz_Qme5tuC`5Lh{qL5Lr9WRiH6BgjI7?nBCg;{vIG7;y78Z(HJE|ict%PiZy7Tu2{0Krvk>j_KbH^v z|C_G;|8KhX|6k8;O~z#bGXC-Q>27@Le(qoNpQsS{b$ZKx<~ijI|4QcWVO6z23A*18 zE>Hfybw&>Jr31L*J}{4g#Uq^&n?rsF6*F+SCo$r5z_0VW{xjY^&%hc|&d9*P!0`Fi zOCDY^@h=Pv3=F@f=KW{Bw3p~m{2klCz+n@LV#l9X5B@W}ddk3}V~y$gUk|VD{(bet z8;t0e+C|*tL%~rI>_Qbp5EEb+T`y7kL$o9hQET6y)4Wu{ER=p1TrnE6^4cW_r$LA zJQm)rRI9bV-nqO27Su#U-Jied+HZawTy=#imj8P9d<8KUV{yoppRb;t9&L1tf>AIE a@BskIQY2x}dZV=f0000y20|tR2?PQeNCH$qh7}eHwM(Q*7248j9gv7c5M8d- zl2%(*m#Z#a4uBPDWr+iV;>;|AAc4pf1TtWPKuAJ>ybN!?@7{ZMf4mTr8ZcN~?T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