parent
ad86e22ac3
commit
8645db7358
|
@ -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 \
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -169,6 +169,12 @@
|
|||
|
||||
<stationLogo path = "var/stationLogo.png" />
|
||||
|
||||
<taskbarIcons>
|
||||
<icon path = "var/icon16.png" />
|
||||
<icon path = "var/icon32.png" />
|
||||
<icon path = "var/icon48.png" />
|
||||
</taskbarIcons>
|
||||
|
||||
<testAudioUrl path = "file://var/testAudio.ogg" />
|
||||
|
||||
<metadataTypeContainer>
|
||||
|
|
|
@ -168,6 +168,12 @@
|
|||
|
||||
<stationLogo path = "ls_var_dir/LiveSupport/stationLogo.png" />
|
||||
|
||||
<taskbarIcons>
|
||||
<icon path = "ls_var_dir/LiveSupport/icon16.png" />
|
||||
<icon path = "ls_var_dir/LiveSupport/icon32.png" />
|
||||
<icon path = "ls_var_dir/LiveSupport/icon48.png" />
|
||||
</taskbarIcons>
|
||||
|
||||
<testAudioUrl path = "file://ls_var_dir/LiveSupport/testAudio.ogg" />
|
||||
|
||||
<metadataTypeContainer>
|
||||
|
|
|
@ -168,6 +168,12 @@
|
|||
|
||||
<stationLogo path = "var/stationLogo.png" />
|
||||
|
||||
<taskbarIcons>
|
||||
<icon path = "var/icon16.png" />
|
||||
<icon path = "var/icon32.png" />
|
||||
<icon path = "var/icon48.png" />
|
||||
</taskbarIcons>
|
||||
|
||||
<testAudioUrl path = "file:var/testAudio.ogg" />
|
||||
|
||||
<metadataTypeContainer>
|
||||
|
|
|
@ -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<const xmlpp::Element*>(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);
|
||||
|
||||
|
|
|
@ -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<Gdk::Pixbuf> stationLogoPixbuf;
|
||||
|
||||
/**
|
||||
* The wrapper class containing the taskbar icon images.
|
||||
*/
|
||||
Ptr<TaskbarIcons>::Ref taskbarIcons;
|
||||
|
||||
/**
|
||||
* The location of the test audio file.
|
||||
*/
|
||||
|
|
|
@ -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<const xmlpp::Element*> (*it);
|
||||
xmlpp::Attribute * pathAttr = iconElement->get_attribute(
|
||||
pathAttributeName );
|
||||
if (pathAttr) {
|
||||
Glib::ustring path = pathAttr->get_value();
|
||||
try {
|
||||
Glib::RefPtr<Gdk::Pixbuf>
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 <vector>
|
||||
#include <gdkmm/pixbuf.h>
|
||||
#include <glibmm/listhandle.h>
|
||||
|
||||
#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:
|
||||
*
|
||||
* <pre><code>
|
||||
* <taskbarIcons>
|
||||
* <icon path="..." />
|
||||
* <icon path="..." />
|
||||
* ...
|
||||
* <icon path="..." />
|
||||
* </taskbarIcons>
|
||||
* </code></pre>
|
||||
*
|
||||
* The DTD for the expected XML element is the following:
|
||||
*
|
||||
* <pre><code>
|
||||
* <!ELEMENT taskbarIcons (icon*) >
|
||||
* <!ELEMENT icon EMPTY >
|
||||
* <!ATTLIST icon path CDATA #REQUIRED >
|
||||
* </code></pre>
|
||||
*
|
||||
* @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<Glib::RefPtr<Gdk::Pixbuf> >
|
||||
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<Glib::RefPtr<Gdk::Pixbuf> >
|
||||
getIconList(void) const throw ()
|
||||
{
|
||||
return taskbarIconList;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace GLiveSupport
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // LiveSupport_GLiveSupport_TaskbarIcons_h
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 480 B |
Binary file not shown.
After Width: | Height: | Size: 692 B |
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
Loading…
Reference in New Issue