forked from openlp/openlp
dos2unix run on trunk r535
This commit is contained in:
parent
91acf64cb7
commit
df7016c22d
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Theme>
|
||||
<Name>openlp.org 2.0 Demo Theme</Name>
|
||||
<BackgroundType>2</BackgroundType>
|
||||
<BackgroundParameter1>./openlp/core/test/data_for_tests/treesbig.jpg</BackgroundParameter1>
|
||||
<BackgroundParameter2>clBlack</BackgroundParameter2>
|
||||
<BackgroundParameter3/>
|
||||
<FontName>Tahoma</FontName>
|
||||
<FontColor>clWhite</FontColor>
|
||||
<FontProportion>16</FontProportion>
|
||||
<Shadow>-1</Shadow>
|
||||
<ShadowColor>$00000001</ShadowColor>
|
||||
<Outline>-1</Outline>
|
||||
<OutlineColor>clRed</OutlineColor>
|
||||
<HorizontalAlign>2</HorizontalAlign>
|
||||
<VerticalAlign>2</VerticalAlign>
|
||||
</Theme>
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Theme>
|
||||
<Name>openlp.org 2.0 Demo Theme</Name>
|
||||
<BackgroundType>2</BackgroundType>
|
||||
<BackgroundParameter1>./openlp/core/test/data_for_tests/treesbig.jpg</BackgroundParameter1>
|
||||
<BackgroundParameter2>clBlack</BackgroundParameter2>
|
||||
<BackgroundParameter3/>
|
||||
<FontName>Tahoma</FontName>
|
||||
<FontColor>clWhite</FontColor>
|
||||
<FontProportion>16</FontProportion>
|
||||
<Shadow>-1</Shadow>
|
||||
<ShadowColor>$00000001</ShadowColor>
|
||||
<Outline>-1</Outline>
|
||||
<OutlineColor>clRed</OutlineColor>
|
||||
<HorizontalAlign>2</HorizontalAlign>
|
||||
<VerticalAlign>2</VerticalAlign>
|
||||
</Theme>
|
||||
|
@ -1,58 +1,58 @@
|
||||
This content can be found at this URL:
|
||||
http://netsuperbrain.com/Postmodern%20PostgreSQL%20Application%20Development.pdf
|
||||
|
||||
Page 11-15: QtDesigner
|
||||
Page 18-20: SQLAlchemy
|
||||
Page 21-23: PyQt - widget
|
||||
Page 24 : main
|
||||
Page 28 : py2exe and release
|
||||
|
||||
|
||||
==============================
|
||||
This is the destilled content.
|
||||
==============================
|
||||
|
||||
----------------
|
||||
** sqlalchemy **
|
||||
----------------
|
||||
from sqlalchemy import create_engine, MetaData, Table
|
||||
from sqlalchemy.orm import sessionmaker, mapper
|
||||
engine = create_engine( 'postgres://postgres@localhost/customers' )
|
||||
metadata = MetaData( bind=engine, reflect=True)
|
||||
Session = sessionmaker(bind=engine, autoflush=True,
|
||||
transactional=True)
|
||||
|
||||
class Customer(object): pass
|
||||
mapper( Customer, Table('customers', metadata ) )
|
||||
|
||||
session = Session()
|
||||
customer = Customer( businessName=“Jamb Safety”,
|
||||
website=“www.jamb.com” )
|
||||
session.save( customer )
|
||||
for customer in Session.query(Customer).filter(
|
||||
Customer.businessName.like(“Jamb%”)):
|
||||
print customer.businessName
|
||||
session.commit()
|
||||
|
||||
------------------------
|
||||
** release and py2exe **
|
||||
------------------------
|
||||
|
||||
from distutils.core import setup
|
||||
import py2exe
|
||||
import glob
|
||||
setup(
|
||||
name="Customers",
|
||||
author="Sankel Software",
|
||||
author_email="david@sankelsoftware.com",
|
||||
url="http://sankelsoftware.com",
|
||||
license=“GPL",
|
||||
version=“1.0.0",
|
||||
windows=[ { "script":"main.py“,}],
|
||||
options={"py2exe":{"includes":["sip”]}},
|
||||
data_files=[
|
||||
("forms",glob.glob("forms/*.ui")),
|
||||
] )
|
||||
|
||||
release:
|
||||
python setup.py py2exe --quiet --dist-dir=dist
|
||||
This content can be found at this URL:
|
||||
http://netsuperbrain.com/Postmodern%20PostgreSQL%20Application%20Development.pdf
|
||||
|
||||
Page 11-15: QtDesigner
|
||||
Page 18-20: SQLAlchemy
|
||||
Page 21-23: PyQt - widget
|
||||
Page 24 : main
|
||||
Page 28 : py2exe and release
|
||||
|
||||
|
||||
==============================
|
||||
This is the destilled content.
|
||||
==============================
|
||||
|
||||
----------------
|
||||
** sqlalchemy **
|
||||
----------------
|
||||
from sqlalchemy import create_engine, MetaData, Table
|
||||
from sqlalchemy.orm import sessionmaker, mapper
|
||||
engine = create_engine( 'postgres://postgres@localhost/customers' )
|
||||
metadata = MetaData( bind=engine, reflect=True)
|
||||
Session = sessionmaker(bind=engine, autoflush=True,
|
||||
transactional=True)
|
||||
|
||||
class Customer(object): pass
|
||||
mapper( Customer, Table('customers', metadata ) )
|
||||
|
||||
session = Session()
|
||||
customer = Customer( businessName=“Jamb Safety”,
|
||||
website=“www.jamb.com” )
|
||||
session.save( customer )
|
||||
for customer in Session.query(Customer).filter(
|
||||
Customer.businessName.like(“Jamb%”)):
|
||||
print customer.businessName
|
||||
session.commit()
|
||||
|
||||
------------------------
|
||||
** release and py2exe **
|
||||
------------------------
|
||||
|
||||
from distutils.core import setup
|
||||
import py2exe
|
||||
import glob
|
||||
setup(
|
||||
name="Customers",
|
||||
author="Sankel Software",
|
||||
author_email="david@sankelsoftware.com",
|
||||
url="http://sankelsoftware.com",
|
||||
license=“GPL",
|
||||
version=“1.0.0",
|
||||
windows=[ { "script":"main.py“,}],
|
||||
options={"py2exe":{"includes":["sip”]}},
|
||||
data_files=[
|
||||
("forms",glob.glob("forms/*.ui")),
|
||||
] )
|
||||
|
||||
release:
|
||||
python setup.py py2exe --quiet --dist-dir=dist
|
||||
|
@ -1,19 +1,19 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Theme>
|
||||
<Name>openlp.org Packaged Theme</Name>
|
||||
<BackgroundType>0</BackgroundType>
|
||||
<BackgroundParameter1>clWhite</BackgroundParameter1>
|
||||
<BackgroundParameter2/>
|
||||
<BackgroundParameter3/>
|
||||
<FontName>Tahoma</FontName>
|
||||
<FontColor>$00007F</FontColor>
|
||||
<FontProportion>53</FontProportion>
|
||||
<FontUnits>pixels</FontUnits>
|
||||
<Shadow>0</Shadow>
|
||||
<ShadowColor>$000000</ShadowColor>
|
||||
<Outline>0</Outline>
|
||||
<OutlineColor>$000000</OutlineColor>
|
||||
<HorizontalAlign>0</HorizontalAlign>
|
||||
<VerticalAlign>0</VerticalAlign>
|
||||
<WrapStyle>1</WrapStyle>
|
||||
</Theme>
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Theme>
|
||||
<Name>openlp.org Packaged Theme</Name>
|
||||
<BackgroundType>0</BackgroundType>
|
||||
<BackgroundParameter1>clWhite</BackgroundParameter1>
|
||||
<BackgroundParameter2/>
|
||||
<BackgroundParameter3/>
|
||||
<FontName>Tahoma</FontName>
|
||||
<FontColor>$00007F</FontColor>
|
||||
<FontProportion>53</FontProportion>
|
||||
<FontUnits>pixels</FontUnits>
|
||||
<Shadow>0</Shadow>
|
||||
<ShadowColor>$000000</ShadowColor>
|
||||
<Outline>0</Outline>
|
||||
<OutlineColor>$000000</OutlineColor>
|
||||
<HorizontalAlign>0</HorizontalAlign>
|
||||
<VerticalAlign>0</VerticalAlign>
|
||||
<WrapStyle>1</WrapStyle>
|
||||
</Theme>
|
||||
|
@ -1,18 +1,18 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Theme>
|
||||
<Name>openlp.org Packaged Theme</Name>
|
||||
<BackgroundType>2</BackgroundType>
|
||||
<BackgroundParameter1>sunset1.jpg</BackgroundParameter1>
|
||||
<BackgroundParameter2/>
|
||||
<BackgroundParameter3/>
|
||||
<FontName>Tahoma</FontName>
|
||||
<FontColor>clWhite</FontColor>
|
||||
<FontProportion>16</FontProportion>
|
||||
<FontUnits>pixels</FontUnits>
|
||||
<Shadow>-1</Shadow>
|
||||
<ShadowColor>$00000001</ShadowColor>
|
||||
<Outline>-1</Outline>
|
||||
<OutlineColor>clRed</OutlineColor>
|
||||
<HorizontalAlign>2</HorizontalAlign>
|
||||
<VerticalAlign>0</VerticalAlign>
|
||||
</Theme>
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Theme>
|
||||
<Name>openlp.org Packaged Theme</Name>
|
||||
<BackgroundType>2</BackgroundType>
|
||||
<BackgroundParameter1>sunset1.jpg</BackgroundParameter1>
|
||||
<BackgroundParameter2/>
|
||||
<BackgroundParameter3/>
|
||||
<FontName>Tahoma</FontName>
|
||||
<FontColor>clWhite</FontColor>
|
||||
<FontProportion>16</FontProportion>
|
||||
<FontUnits>pixels</FontUnits>
|
||||
<Shadow>-1</Shadow>
|
||||
<ShadowColor>$00000001</ShadowColor>
|
||||
<Outline>-1</Outline>
|
||||
<OutlineColor>clRed</OutlineColor>
|
||||
<HorizontalAlign>2</HorizontalAlign>
|
||||
<VerticalAlign>0</VerticalAlign>
|
||||
</Theme>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,462 +1,462 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2009 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
|
||||
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program 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; version 2 of the License. #
|
||||
# #
|
||||
# This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import os
|
||||
import sys
|
||||
import zipfile
|
||||
import shutil
|
||||
import logging
|
||||
|
||||
from xml.etree.ElementTree import ElementTree, XML
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.ui import AmendThemeForm, ServiceManager
|
||||
from openlp.core.theme import Theme
|
||||
from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, Renderer, \
|
||||
translate, str_to_bool, file_to_xml, buildIcon, Receiver
|
||||
from openlp.core.utils import ConfigHelper
|
||||
|
||||
class ThemeManager(QtGui.QWidget):
|
||||
"""
|
||||
Manages the orders of Theme.
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'ThemeManager')
|
||||
|
||||
def __init__(self, parent):
|
||||
QtGui.QWidget.__init__(self, parent)
|
||||
self.parent = parent
|
||||
self.Layout = QtGui.QVBoxLayout(self)
|
||||
self.Layout.setSpacing(0)
|
||||
self.Layout.setMargin(0)
|
||||
self.amendThemeForm = AmendThemeForm(self)
|
||||
self.Toolbar = OpenLPToolbar(self)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'New Theme'), u':/themes/theme_new.png',
|
||||
translate(u'ThemeManager', u'Create a new theme'), self.onAddTheme)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Edit Theme'),
|
||||
u':/themes/theme_edit.png',
|
||||
translate(u'ThemeManager', u'Edit a theme'), self.onEditTheme)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Delete Theme'),
|
||||
u':/themes/theme_delete.png',
|
||||
translate(u'ThemeManager', u'Delete a theme'), self.onDeleteTheme)
|
||||
self.Toolbar.addSeparator()
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Import Theme'),
|
||||
u':/themes/theme_import.png',
|
||||
translate(u'ThemeManager', u'Import a theme'), self.onImportTheme)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Export Theme'),
|
||||
u':/themes/theme_export.png',
|
||||
translate(u'ThemeManager', u'Export a theme'), self.onExportTheme)
|
||||
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
|
||||
self.Layout.addWidget(self.Toolbar)
|
||||
self.ThemeListWidget = QtGui.QListWidget(self)
|
||||
self.ThemeListWidget.setAlternatingRowColors(True)
|
||||
self.ThemeListWidget.setIconSize(QtCore.QSize(88,50))
|
||||
self.Layout.addWidget(self.ThemeListWidget)
|
||||
#Signals
|
||||
QtCore.QObject.connect(self.ThemeListWidget,
|
||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||
self.changeGlobalFromScreen)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'update_global_theme'), self.changeGlobalFromTab)
|
||||
#Variables
|
||||
self.themelist = []
|
||||
self.path = os.path.join(ConfigHelper.get_data_path(), u'themes')
|
||||
self.checkThemesExists(self.path)
|
||||
self.amendThemeForm.path = self.path
|
||||
# Last little bits of setting up
|
||||
self.config = PluginConfig(u'themes')
|
||||
self.servicePath = self.config.get_data_path()
|
||||
self.global_theme = unicode(
|
||||
self.config.get_config(u'theme global theme', u''))
|
||||
|
||||
def changeGlobalFromTab(self, themeName):
|
||||
log.debug(u'changeGlobalFromTab %s', themeName)
|
||||
for count in range (0, self.ThemeListWidget.count()):
|
||||
#reset the old name
|
||||
item = self.ThemeListWidget.item(count)
|
||||
oldName = item.text()
|
||||
newName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||
if oldName != newName:
|
||||
self.ThemeListWidget.item(count).setText(newName)
|
||||
#Set the new name
|
||||
if themeName == newName:
|
||||
name = u'%s (%s)' % (newName, translate(u'ThemeManager',
|
||||
u'default'))
|
||||
self.ThemeListWidget.item(count).setText(name)
|
||||
|
||||
def changeGlobalFromScreen(self, index):
|
||||
log.debug(u'changeGlobalFromScreen %s', index)
|
||||
for count in range (0, self.ThemeListWidget.count()):
|
||||
item = self.ThemeListWidget.item(count)
|
||||
oldName = item.text()
|
||||
#reset the old name
|
||||
if oldName != unicode(item.data(QtCore.Qt.UserRole).toString()):
|
||||
self.ThemeListWidget.item(count).setText(
|
||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||
#Set the new name
|
||||
if count == index.row():
|
||||
self.global_theme = unicode(
|
||||
self.ThemeListWidget.item(count).text())
|
||||
name = u'%s (%s)' % (self.global_theme,
|
||||
translate(u'ThemeManager', u'default'))
|
||||
self.ThemeListWidget.item(count).setText(name)
|
||||
self.config.set_config(u'theme global theme', self.global_theme)
|
||||
Receiver().send_message(u'update_global_theme',
|
||||
self.global_theme)
|
||||
self.pushThemes()
|
||||
|
||||
def onAddTheme(self):
|
||||
self.amendThemeForm.theme.parse(self.baseTheme())
|
||||
self.amendThemeForm.loadTheme(None)
|
||||
self.amendThemeForm.exec_()
|
||||
|
||||
def onEditTheme(self):
|
||||
item = self.ThemeListWidget.currentItem()
|
||||
if item is not None:
|
||||
self.amendThemeForm.loadTheme(
|
||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||
self.amendThemeForm.exec_()
|
||||
|
||||
def onDeleteTheme(self):
|
||||
self.global_theme = unicode(
|
||||
self.config.get_config(u'theme global theme', u''))
|
||||
item = self.ThemeListWidget.currentItem()
|
||||
if item is not None:
|
||||
theme = unicode(item.text())
|
||||
# should be the same unless default
|
||||
if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):
|
||||
QtGui.QMessageBox.critical(self,
|
||||
translate(u'ThemeManager', u'Error'),
|
||||
translate(u'ThemeManager',
|
||||
u'You are unable to delete the default theme!'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||
else:
|
||||
self.themelist.remove(theme)
|
||||
th = theme + u'.png'
|
||||
row = self.ThemeListWidget.row(item)
|
||||
self.ThemeListWidget.takeItem(row)
|
||||
try:
|
||||
os.remove(os.path.join(self.path, th))
|
||||
except:
|
||||
#if not present do not worry
|
||||
pass
|
||||
try:
|
||||
shutil.rmtree(os.path.join(self.path, theme))
|
||||
except:
|
||||
#if not present do not worry
|
||||
pass
|
||||
# As we do not reload the themes push out the change
|
||||
# Reaload the list as the internal lists and events need
|
||||
# to be triggered
|
||||
self.pushThemes()
|
||||
|
||||
def onExportTheme(self):
|
||||
pass
|
||||
|
||||
def onImportTheme(self):
|
||||
files = QtGui.QFileDialog.getOpenFileNames(None,
|
||||
translate(u'ThemeManager', u'Select Theme Import File'),
|
||||
self.path, u'Theme (*.*)')
|
||||
log.info(u'New Themes %s', unicode(files))
|
||||
if len(files) > 0:
|
||||
for file in files:
|
||||
self.unzipTheme(file, self.path)
|
||||
self.loadThemes()
|
||||
|
||||
def loadThemes(self):
|
||||
"""
|
||||
Loads the theme lists and triggers updates accross
|
||||
the whole system using direct calls or core functions
|
||||
and events for the plugins.
|
||||
The plugins will call back in to get the real list if they want it.
|
||||
"""
|
||||
log.debug(u'Load themes from dir')
|
||||
self.themelist = []
|
||||
self.ThemeListWidget.clear()
|
||||
for root, dirs, files in os.walk(self.path):
|
||||
for name in files:
|
||||
if name.endswith(u'.png'):
|
||||
#check to see file is in theme root directory
|
||||
theme = os.path.join(self.path, name)
|
||||
if os.path.exists(theme):
|
||||
(path, filename) = os.path.split(unicode(file))
|
||||
textName = os.path.splitext(name)[0]
|
||||
if textName == self.global_theme:
|
||||
name = u'%s (%s)' % (textName,
|
||||
translate(u'ThemeManager', u'default'))
|
||||
else:
|
||||
name = textName
|
||||
item_name = QtGui.QListWidgetItem(name)
|
||||
item_name.setIcon(buildIcon(theme))
|
||||
item_name.setData(QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(textName))
|
||||
self.ThemeListWidget.addItem(item_name)
|
||||
self.themelist.append(textName)
|
||||
self.pushThemes()
|
||||
|
||||
def pushThemes(self):
|
||||
Receiver().send_message(u'update_themes', self.getThemes() )
|
||||
|
||||
def getThemes(self):
|
||||
return self.themelist
|
||||
|
||||
def getThemeData(self, themename):
|
||||
log.debug(u'getthemedata for theme %s', themename)
|
||||
xml_file = os.path.join(self.path, unicode(themename),
|
||||
unicode(themename) + u'.xml')
|
||||
try:
|
||||
xml = file_to_xml(xml_file)
|
||||
except:
|
||||
newtheme = ThemeXML()
|
||||
newtheme.new_document(u'New Theme')
|
||||
newtheme.add_background_solid(unicode(u'#000000'))
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()),
|
||||
unicode(u'#FFFFFF'), unicode(30), u'False')
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()),
|
||||
unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
|
||||
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
|
||||
unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0))
|
||||
xml = newtheme.extract_xml()
|
||||
theme = ThemeXML()
|
||||
theme.parse(xml)
|
||||
theme.extend_image_filename(self.path)
|
||||
self.cleanTheme(theme)
|
||||
return theme
|
||||
|
||||
def checkThemesExists(self, dir):
|
||||
log.debug(u'check themes')
|
||||
if os.path.exists(dir) == False:
|
||||
os.mkdir(dir)
|
||||
|
||||
def unzipTheme(self, filename, dir):
|
||||
"""
|
||||
Unzip the theme, remove the preview file if stored
|
||||
Generate a new preview fileCheck the XML theme version and upgrade if
|
||||
necessary.
|
||||
"""
|
||||
log.debug(u'Unzipping theme %s', filename)
|
||||
zip = zipfile.ZipFile(unicode(filename))
|
||||
filexml = None
|
||||
themename = None
|
||||
for file in zip.namelist():
|
||||
if file.endswith(os.path.sep):
|
||||
theme_dir = os.path.join(dir, file)
|
||||
if os.path.exists(theme_dir) == False:
|
||||
os.mkdir(os.path.join(dir, file))
|
||||
else:
|
||||
fullpath = os.path.join(dir, file)
|
||||
names = file.split(os.path.sep)
|
||||
if len(names) > 1:
|
||||
# not preview file
|
||||
if themename is None:
|
||||
themename = names[0]
|
||||
xml_data = zip.read(file)
|
||||
if os.path.splitext(file)[1].lower() in [u'.xml']:
|
||||
if self.checkVersion1(xml_data):
|
||||
# upgrade theme xml
|
||||
filexml = self.migrateVersion122(filename,
|
||||
fullpath, xml_data)
|
||||
else:
|
||||
filexml = xml_data
|
||||
outfile = open(fullpath, u'w')
|
||||
outfile.write(filexml)
|
||||
outfile.close()
|
||||
else:
|
||||
outfile = open(fullpath, u'w')
|
||||
outfile.write(zip.read(file))
|
||||
outfile.close()
|
||||
self.generateAndSaveImage(dir, themename, filexml)
|
||||
|
||||
def checkVersion1(self, xmlfile):
|
||||
"""
|
||||
Am I a version 1 theme
|
||||
"""
|
||||
log.debug(u'checkVersion1 ')
|
||||
theme = xmlfile
|
||||
tree = ElementTree(element=XML(theme)).getroot()
|
||||
if tree.find(u'BackgroundType') is None:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def migrateVersion122(self, filename, fullpath, xml_data):
|
||||
"""
|
||||
Called by convert the xml data from version 1 format
|
||||
to the current format.
|
||||
New fields are defaulted but the new theme is useable
|
||||
"""
|
||||
log.debug(u'migrateVersion122 %s %s', filename, fullpath)
|
||||
theme = Theme(xml_data)
|
||||
newtheme = ThemeXML()
|
||||
newtheme.new_document(theme.Name)
|
||||
if theme.BackgroundType == 0:
|
||||
newtheme.add_background_solid(unicode(
|
||||
theme.BackgroundParameter1.name()))
|
||||
elif theme.BackgroundType == 1:
|
||||
direction = u'vertical'
|
||||
if theme.BackgroundParameter3.name() == 1:
|
||||
direction = u'horizontal'
|
||||
newtheme.add_background_gradient(
|
||||
unicode(theme.BackgroundParameter1.name()),
|
||||
unicode(theme.BackgroundParameter2.name()), direction)
|
||||
else:
|
||||
newtheme.add_background_image(unicode(theme.BackgroundParameter1))
|
||||
|
||||
newtheme.add_font(unicode(theme.FontName),
|
||||
unicode(theme.FontColor.name()),
|
||||
unicode(theme.FontProportion * 2), u'False')
|
||||
newtheme.add_font(unicode(theme.FontName),
|
||||
unicode(theme.FontColor.name()),
|
||||
unicode(12), u'False', u'footer')
|
||||
outline = False
|
||||
shadow = False
|
||||
if theme.Shadow == 1:
|
||||
shadow = True
|
||||
if theme.Outline == 1:
|
||||
outline = True
|
||||
newtheme.add_display(unicode(shadow), unicode(theme.ShadowColor.name()),
|
||||
unicode(outline), unicode(theme.OutlineColor.name()),
|
||||
unicode(theme.HorizontalAlign), unicode(theme.VerticalAlign),
|
||||
unicode(theme.WrapStyle))
|
||||
return newtheme.extract_xml()
|
||||
|
||||
def saveTheme(self, name, theme_xml, theme_pretty_xml, image_from,
|
||||
image_to) :
|
||||
"""
|
||||
Called by thememaintenance Dialog to save the theme
|
||||
and to trigger the reload of the theme list
|
||||
"""
|
||||
log.debug(u'saveTheme %s %s', name, theme_xml)
|
||||
theme_dir = os.path.join(self.path, name)
|
||||
if os.path.exists(theme_dir) == False:
|
||||
os.mkdir(os.path.join(self.path, name))
|
||||
theme_file = os.path.join(theme_dir, name + u'.xml')
|
||||
log.debug(theme_file)
|
||||
|
||||
result = QtGui.QMessageBox.Yes
|
||||
if os.path.exists(theme_file):
|
||||
result = QtGui.QMessageBox.question(
|
||||
self,
|
||||
translate(u'ThemeManager', u'Theme Exists'),
|
||||
translate(u'ThemeManager', u'A theme with this name already exists, would you like to overwrite it?'),
|
||||
(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
|
||||
QtGui.QMessageBox.No)
|
||||
if result == QtGui.QMessageBox.Yes:
|
||||
# Save the theme, overwriting the existing theme if necessary.
|
||||
outfile = open(theme_file, u'w')
|
||||
outfile.write(theme_pretty_xml)
|
||||
outfile.close()
|
||||
if image_from is not None and image_from != image_to:
|
||||
shutil.copyfile(image_from, image_to)
|
||||
|
||||
self.generateAndSaveImage(self.path, name, theme_xml)
|
||||
self.loadThemes()
|
||||
else:
|
||||
# Don't close the dialog - allow the user to change the name of
|
||||
# the theme or to cancel the theme dialog completely.
|
||||
return False
|
||||
|
||||
def generateAndSaveImage(self, dir, name, theme_xml):
|
||||
log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml)
|
||||
theme = ThemeXML()
|
||||
theme.parse(theme_xml)
|
||||
theme.extend_image_filename(dir)
|
||||
frame = self.generateImage(theme)
|
||||
samplepathname = os.path.join(self.path, name + u'.png')
|
||||
if os.path.exists(samplepathname):
|
||||
os.unlink(samplepathname)
|
||||
frame.save(samplepathname, u'png')
|
||||
log.debug(u'Theme image written to %s', samplepathname)
|
||||
|
||||
def generateImage(self, themedata):
|
||||
"""
|
||||
Call the RenderManager to build a Sample Image
|
||||
"""
|
||||
log.debug(u'generateImage %s ', themedata)
|
||||
frame = self.parent.RenderManager.generate_preview(themedata)
|
||||
return frame
|
||||
|
||||
def getPreviewImage(self, theme):
|
||||
log.debug(u'getPreviewImage %s ', theme)
|
||||
image = os.path.join(self.path, theme + u'.png')
|
||||
return image
|
||||
|
||||
def baseTheme(self):
|
||||
log.debug(u'base theme created')
|
||||
newtheme = ThemeXML()
|
||||
newtheme.new_document(u'New Theme')
|
||||
newtheme.add_background_solid(unicode(u'#000000'))
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
|
||||
unicode(30), u'False')
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
|
||||
unicode(12), u'False', u'footer')
|
||||
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
|
||||
unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0))
|
||||
return newtheme.extract_xml()
|
||||
|
||||
def cleanTheme(self, theme):
|
||||
theme.background_color = theme.background_color.strip()
|
||||
theme.background_direction = theme.background_direction.strip()
|
||||
theme.background_endColor = theme.background_endColor.strip()
|
||||
if theme.background_filename:
|
||||
theme.background_filename = theme.background_filename.strip()
|
||||
#theme.background_mode
|
||||
theme.background_startColor = theme.background_startColor.strip()
|
||||
#theme.background_type
|
||||
if theme.display_display:
|
||||
theme.display_display = theme.display_display.strip()
|
||||
theme.display_horizontalAlign = theme.display_horizontalAlign.strip()
|
||||
theme.display_outline = str_to_bool(theme.display_outline)
|
||||
#theme.display_outline_color
|
||||
theme.display_shadow = str_to_bool(theme.display_shadow)
|
||||
#theme.display_shadow_color
|
||||
theme.display_verticalAlign = theme.display_verticalAlign.strip()
|
||||
theme.display_wrapStyle = theme.display_wrapStyle.strip()
|
||||
theme.font_footer_color = theme.font_footer_color.strip()
|
||||
theme.font_footer_height = theme.font_footer_height.strip()
|
||||
theme.font_footer_italics = str_to_bool(theme.font_footer_italics)
|
||||
theme.font_footer_name = theme.font_footer_name.strip()
|
||||
#theme.font_footer_override
|
||||
theme.font_footer_proportion = theme.font_footer_proportion.strip()
|
||||
theme.font_footer_weight = theme.font_footer_weight.strip()
|
||||
theme.font_footer_width = theme.font_footer_width.strip()
|
||||
theme.font_footer_x = theme.font_footer_x.strip()
|
||||
theme.font_footer_y = theme.font_footer_y.strip()
|
||||
theme.font_main_color = theme.font_main_color.strip()
|
||||
theme.font_main_height = theme.font_main_height.strip()
|
||||
theme.font_main_italics = str_to_bool(theme.font_main_italics)
|
||||
theme.font_main_name = theme.font_main_name.strip()
|
||||
#theme.font_main_override
|
||||
theme.font_main_proportion = theme.font_main_proportion.strip()
|
||||
theme.font_main_weight = theme.font_main_weight.strip()
|
||||
theme.font_main_x = theme.font_main_x.strip()
|
||||
theme.font_main_y = theme.font_main_y.strip()
|
||||
#theme.theme_mode
|
||||
theme.theme_name = theme.theme_name.strip()
|
||||
#theme.theme_version
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2009 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
|
||||
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program 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; version 2 of the License. #
|
||||
# #
|
||||
# This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import os
|
||||
import sys
|
||||
import zipfile
|
||||
import shutil
|
||||
import logging
|
||||
|
||||
from xml.etree.ElementTree import ElementTree, XML
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.ui import AmendThemeForm, ServiceManager
|
||||
from openlp.core.theme import Theme
|
||||
from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, Renderer, \
|
||||
translate, str_to_bool, file_to_xml, buildIcon, Receiver
|
||||
from openlp.core.utils import ConfigHelper
|
||||
|
||||
class ThemeManager(QtGui.QWidget):
|
||||
"""
|
||||
Manages the orders of Theme.
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'ThemeManager')
|
||||
|
||||
def __init__(self, parent):
|
||||
QtGui.QWidget.__init__(self, parent)
|
||||
self.parent = parent
|
||||
self.Layout = QtGui.QVBoxLayout(self)
|
||||
self.Layout.setSpacing(0)
|
||||
self.Layout.setMargin(0)
|
||||
self.amendThemeForm = AmendThemeForm(self)
|
||||
self.Toolbar = OpenLPToolbar(self)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'New Theme'), u':/themes/theme_new.png',
|
||||
translate(u'ThemeManager', u'Create a new theme'), self.onAddTheme)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Edit Theme'),
|
||||
u':/themes/theme_edit.png',
|
||||
translate(u'ThemeManager', u'Edit a theme'), self.onEditTheme)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Delete Theme'),
|
||||
u':/themes/theme_delete.png',
|
||||
translate(u'ThemeManager', u'Delete a theme'), self.onDeleteTheme)
|
||||
self.Toolbar.addSeparator()
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Import Theme'),
|
||||
u':/themes/theme_import.png',
|
||||
translate(u'ThemeManager', u'Import a theme'), self.onImportTheme)
|
||||
self.Toolbar.addToolbarButton(
|
||||
translate(u'ThemeManager', u'Export Theme'),
|
||||
u':/themes/theme_export.png',
|
||||
translate(u'ThemeManager', u'Export a theme'), self.onExportTheme)
|
||||
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
|
||||
self.Layout.addWidget(self.Toolbar)
|
||||
self.ThemeListWidget = QtGui.QListWidget(self)
|
||||
self.ThemeListWidget.setAlternatingRowColors(True)
|
||||
self.ThemeListWidget.setIconSize(QtCore.QSize(88,50))
|
||||
self.Layout.addWidget(self.ThemeListWidget)
|
||||
#Signals
|
||||
QtCore.QObject.connect(self.ThemeListWidget,
|
||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||
self.changeGlobalFromScreen)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'update_global_theme'), self.changeGlobalFromTab)
|
||||
#Variables
|
||||
self.themelist = []
|
||||
self.path = os.path.join(ConfigHelper.get_data_path(), u'themes')
|
||||
self.checkThemesExists(self.path)
|
||||
self.amendThemeForm.path = self.path
|
||||
# Last little bits of setting up
|
||||
self.config = PluginConfig(u'themes')
|
||||
self.servicePath = self.config.get_data_path()
|
||||
self.global_theme = unicode(
|
||||
self.config.get_config(u'theme global theme', u''))
|
||||
|
||||
def changeGlobalFromTab(self, themeName):
|
||||
log.debug(u'changeGlobalFromTab %s', themeName)
|
||||
for count in range (0, self.ThemeListWidget.count()):
|
||||
#reset the old name
|
||||
item = self.ThemeListWidget.item(count)
|
||||
oldName = item.text()
|
||||
newName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||
if oldName != newName:
|
||||
self.ThemeListWidget.item(count).setText(newName)
|
||||
#Set the new name
|
||||
if themeName == newName:
|
||||
name = u'%s (%s)' % (newName, translate(u'ThemeManager',
|
||||
u'default'))
|
||||
self.ThemeListWidget.item(count).setText(name)
|
||||
|
||||
def changeGlobalFromScreen(self, index):
|
||||
log.debug(u'changeGlobalFromScreen %s', index)
|
||||
for count in range (0, self.ThemeListWidget.count()):
|
||||
item = self.ThemeListWidget.item(count)
|
||||
oldName = item.text()
|
||||
#reset the old name
|
||||
if oldName != unicode(item.data(QtCore.Qt.UserRole).toString()):
|
||||
self.ThemeListWidget.item(count).setText(
|
||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||
#Set the new name
|
||||
if count == index.row():
|
||||
self.global_theme = unicode(
|
||||
self.ThemeListWidget.item(count).text())
|
||||
name = u'%s (%s)' % (self.global_theme,
|
||||
translate(u'ThemeManager', u'default'))
|
||||
self.ThemeListWidget.item(count).setText(name)
|
||||
self.config.set_config(u'theme global theme', self.global_theme)
|
||||
Receiver().send_message(u'update_global_theme',
|
||||
self.global_theme)
|
||||
self.pushThemes()
|
||||
|
||||
def onAddTheme(self):
|
||||
self.amendThemeForm.theme.parse(self.baseTheme())
|
||||
self.amendThemeForm.loadTheme(None)
|
||||
self.amendThemeForm.exec_()
|
||||
|
||||
def onEditTheme(self):
|
||||
item = self.ThemeListWidget.currentItem()
|
||||
if item is not None:
|
||||
self.amendThemeForm.loadTheme(
|
||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||
self.amendThemeForm.exec_()
|
||||
|
||||
def onDeleteTheme(self):
|
||||
self.global_theme = unicode(
|
||||
self.config.get_config(u'theme global theme', u''))
|
||||
item = self.ThemeListWidget.currentItem()
|
||||
if item is not None:
|
||||
theme = unicode(item.text())
|
||||
# should be the same unless default
|
||||
if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):
|
||||
QtGui.QMessageBox.critical(self,
|
||||
translate(u'ThemeManager', u'Error'),
|
||||
translate(u'ThemeManager',
|
||||
u'You are unable to delete the default theme!'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||
else:
|
||||
self.themelist.remove(theme)
|
||||
th = theme + u'.png'
|
||||
row = self.ThemeListWidget.row(item)
|
||||
self.ThemeListWidget.takeItem(row)
|
||||
try:
|
||||
os.remove(os.path.join(self.path, th))
|
||||
except:
|
||||
#if not present do not worry
|
||||
pass
|
||||
try:
|
||||
shutil.rmtree(os.path.join(self.path, theme))
|
||||
except:
|
||||
#if not present do not worry
|
||||
pass
|
||||
# As we do not reload the themes push out the change
|
||||
# Reaload the list as the internal lists and events need
|
||||
# to be triggered
|
||||
self.pushThemes()
|
||||
|
||||
def onExportTheme(self):
|
||||
pass
|
||||
|
||||
def onImportTheme(self):
|
||||
files = QtGui.QFileDialog.getOpenFileNames(None,
|
||||
translate(u'ThemeManager', u'Select Theme Import File'),
|
||||
self.path, u'Theme (*.*)')
|
||||
log.info(u'New Themes %s', unicode(files))
|
||||
if len(files) > 0:
|
||||
for file in files:
|
||||
self.unzipTheme(file, self.path)
|
||||
self.loadThemes()
|
||||
|
||||
def loadThemes(self):
|
||||
"""
|
||||
Loads the theme lists and triggers updates accross
|
||||
the whole system using direct calls or core functions
|
||||
and events for the plugins.
|
||||
The plugins will call back in to get the real list if they want it.
|
||||
"""
|
||||
log.debug(u'Load themes from dir')
|
||||
self.themelist = []
|
||||
self.ThemeListWidget.clear()
|
||||
for root, dirs, files in os.walk(self.path):
|
||||
for name in files:
|
||||
if name.endswith(u'.png'):
|
||||
#check to see file is in theme root directory
|
||||
theme = os.path.join(self.path, name)
|
||||
if os.path.exists(theme):
|
||||
(path, filename) = os.path.split(unicode(file))
|
||||
textName = os.path.splitext(name)[0]
|
||||
if textName == self.global_theme:
|
||||
name = u'%s (%s)' % (textName,
|
||||
translate(u'ThemeManager', u'default'))
|
||||
else:
|
||||
name = textName
|
||||
item_name = QtGui.QListWidgetItem(name)
|
||||
item_name.setIcon(buildIcon(theme))
|
||||
item_name.setData(QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(textName))
|
||||
self.ThemeListWidget.addItem(item_name)
|
||||
self.themelist.append(textName)
|
||||
self.pushThemes()
|
||||
|
||||
def pushThemes(self):
|
||||
Receiver().send_message(u'update_themes', self.getThemes() )
|
||||
|
||||
def getThemes(self):
|
||||
return self.themelist
|
||||
|
||||
def getThemeData(self, themename):
|
||||
log.debug(u'getthemedata for theme %s', themename)
|
||||
xml_file = os.path.join(self.path, unicode(themename),
|
||||
unicode(themename) + u'.xml')
|
||||
try:
|
||||
xml = file_to_xml(xml_file)
|
||||
except:
|
||||
newtheme = ThemeXML()
|
||||
newtheme.new_document(u'New Theme')
|
||||
newtheme.add_background_solid(unicode(u'#000000'))
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()),
|
||||
unicode(u'#FFFFFF'), unicode(30), u'False')
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()),
|
||||
unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
|
||||
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
|
||||
unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0))
|
||||
xml = newtheme.extract_xml()
|
||||
theme = ThemeXML()
|
||||
theme.parse(xml)
|
||||
theme.extend_image_filename(self.path)
|
||||
self.cleanTheme(theme)
|
||||
return theme
|
||||
|
||||
def checkThemesExists(self, dir):
|
||||
log.debug(u'check themes')
|
||||
if os.path.exists(dir) == False:
|
||||
os.mkdir(dir)
|
||||
|
||||
def unzipTheme(self, filename, dir):
|
||||
"""
|
||||
Unzip the theme, remove the preview file if stored
|
||||
Generate a new preview fileCheck the XML theme version and upgrade if
|
||||
necessary.
|
||||
"""
|
||||
log.debug(u'Unzipping theme %s', filename)
|
||||
zip = zipfile.ZipFile(unicode(filename))
|
||||
filexml = None
|
||||
themename = None
|
||||
for file in zip.namelist():
|
||||
if file.endswith(os.path.sep):
|
||||
theme_dir = os.path.join(dir, file)
|
||||
if os.path.exists(theme_dir) == False:
|
||||
os.mkdir(os.path.join(dir, file))
|
||||
else:
|
||||
fullpath = os.path.join(dir, file)
|
||||
names = file.split(os.path.sep)
|
||||
if len(names) > 1:
|
||||
# not preview file
|
||||
if themename is None:
|
||||
themename = names[0]
|
||||
xml_data = zip.read(file)
|
||||
if os.path.splitext(file)[1].lower() in [u'.xml']:
|
||||
if self.checkVersion1(xml_data):
|
||||
# upgrade theme xml
|
||||
filexml = self.migrateVersion122(filename,
|
||||
fullpath, xml_data)
|
||||
else:
|
||||
filexml = xml_data
|
||||
outfile = open(fullpath, u'w')
|
||||
outfile.write(filexml)
|
||||
outfile.close()
|
||||
else:
|
||||
outfile = open(fullpath, u'w')
|
||||
outfile.write(zip.read(file))
|
||||
outfile.close()
|
||||
self.generateAndSaveImage(dir, themename, filexml)
|
||||
|
||||
def checkVersion1(self, xmlfile):
|
||||
"""
|
||||
Am I a version 1 theme
|
||||
"""
|
||||
log.debug(u'checkVersion1 ')
|
||||
theme = xmlfile
|
||||
tree = ElementTree(element=XML(theme)).getroot()
|
||||
if tree.find(u'BackgroundType') is None:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def migrateVersion122(self, filename, fullpath, xml_data):
|
||||
"""
|
||||
Called by convert the xml data from version 1 format
|
||||
to the current format.
|
||||
New fields are defaulted but the new theme is useable
|
||||
"""
|
||||
log.debug(u'migrateVersion122 %s %s', filename, fullpath)
|
||||
theme = Theme(xml_data)
|
||||
newtheme = ThemeXML()
|
||||
newtheme.new_document(theme.Name)
|
||||
if theme.BackgroundType == 0:
|
||||
newtheme.add_background_solid(unicode(
|
||||
theme.BackgroundParameter1.name()))
|
||||
elif theme.BackgroundType == 1:
|
||||
direction = u'vertical'
|
||||
if theme.BackgroundParameter3.name() == 1:
|
||||
direction = u'horizontal'
|
||||
newtheme.add_background_gradient(
|
||||
unicode(theme.BackgroundParameter1.name()),
|
||||
unicode(theme.BackgroundParameter2.name()), direction)
|
||||
else:
|
||||
newtheme.add_background_image(unicode(theme.BackgroundParameter1))
|
||||
|
||||
newtheme.add_font(unicode(theme.FontName),
|
||||
unicode(theme.FontColor.name()),
|
||||
unicode(theme.FontProportion * 2), u'False')
|
||||
newtheme.add_font(unicode(theme.FontName),
|
||||
unicode(theme.FontColor.name()),
|
||||
unicode(12), u'False', u'footer')
|
||||
outline = False
|
||||
shadow = False
|
||||
if theme.Shadow == 1:
|
||||
shadow = True
|
||||
if theme.Outline == 1:
|
||||
outline = True
|
||||
newtheme.add_display(unicode(shadow), unicode(theme.ShadowColor.name()),
|
||||
unicode(outline), unicode(theme.OutlineColor.name()),
|
||||
unicode(theme.HorizontalAlign), unicode(theme.VerticalAlign),
|
||||
unicode(theme.WrapStyle))
|
||||
return newtheme.extract_xml()
|
||||
|
||||
def saveTheme(self, name, theme_xml, theme_pretty_xml, image_from,
|
||||
image_to) :
|
||||
"""
|
||||
Called by thememaintenance Dialog to save the theme
|
||||
and to trigger the reload of the theme list
|
||||
"""
|
||||
log.debug(u'saveTheme %s %s', name, theme_xml)
|
||||
theme_dir = os.path.join(self.path, name)
|
||||
if os.path.exists(theme_dir) == False:
|
||||
os.mkdir(os.path.join(self.path, name))
|
||||
theme_file = os.path.join(theme_dir, name + u'.xml')
|
||||
log.debug(theme_file)
|
||||
|
||||
result = QtGui.QMessageBox.Yes
|
||||
if os.path.exists(theme_file):
|
||||
result = QtGui.QMessageBox.question(
|
||||
self,
|
||||
translate(u'ThemeManager', u'Theme Exists'),
|
||||
translate(u'ThemeManager', u'A theme with this name already exists, would you like to overwrite it?'),
|
||||
(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
|
||||
QtGui.QMessageBox.No)
|
||||
if result == QtGui.QMessageBox.Yes:
|
||||
# Save the theme, overwriting the existing theme if necessary.
|
||||
outfile = open(theme_file, u'w')
|
||||
outfile.write(theme_pretty_xml)
|
||||
outfile.close()
|
||||
if image_from is not None and image_from != image_to:
|
||||
shutil.copyfile(image_from, image_to)
|
||||
|
||||
self.generateAndSaveImage(self.path, name, theme_xml)
|
||||
self.loadThemes()
|
||||
else:
|
||||
# Don't close the dialog - allow the user to change the name of
|
||||
# the theme or to cancel the theme dialog completely.
|
||||
return False
|
||||
|
||||
def generateAndSaveImage(self, dir, name, theme_xml):
|
||||
log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml)
|
||||
theme = ThemeXML()
|
||||
theme.parse(theme_xml)
|
||||
theme.extend_image_filename(dir)
|
||||
frame = self.generateImage(theme)
|
||||
samplepathname = os.path.join(self.path, name + u'.png')
|
||||
if os.path.exists(samplepathname):
|
||||
os.unlink(samplepathname)
|
||||
frame.save(samplepathname, u'png')
|
||||
log.debug(u'Theme image written to %s', samplepathname)
|
||||
|
||||
def generateImage(self, themedata):
|
||||
"""
|
||||
Call the RenderManager to build a Sample Image
|
||||
"""
|
||||
log.debug(u'generateImage %s ', themedata)
|
||||
frame = self.parent.RenderManager.generate_preview(themedata)
|
||||
return frame
|
||||
|
||||
def getPreviewImage(self, theme):
|
||||
log.debug(u'getPreviewImage %s ', theme)
|
||||
image = os.path.join(self.path, theme + u'.png')
|
||||
return image
|
||||
|
||||
def baseTheme(self):
|
||||
log.debug(u'base theme created')
|
||||
newtheme = ThemeXML()
|
||||
newtheme.new_document(u'New Theme')
|
||||
newtheme.add_background_solid(unicode(u'#000000'))
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
|
||||
unicode(30), u'False')
|
||||
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
|
||||
unicode(12), u'False', u'footer')
|
||||
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
|
||||
unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0))
|
||||
return newtheme.extract_xml()
|
||||
|
||||
def cleanTheme(self, theme):
|
||||
theme.background_color = theme.background_color.strip()
|
||||
theme.background_direction = theme.background_direction.strip()
|
||||
theme.background_endColor = theme.background_endColor.strip()
|
||||
if theme.background_filename:
|
||||
theme.background_filename = theme.background_filename.strip()
|
||||
#theme.background_mode
|
||||
theme.background_startColor = theme.background_startColor.strip()
|
||||
#theme.background_type
|
||||
if theme.display_display:
|
||||
theme.display_display = theme.display_display.strip()
|
||||
theme.display_horizontalAlign = theme.display_horizontalAlign.strip()
|
||||
theme.display_outline = str_to_bool(theme.display_outline)
|
||||
#theme.display_outline_color
|
||||
theme.display_shadow = str_to_bool(theme.display_shadow)
|
||||
#theme.display_shadow_color
|
||||
theme.display_verticalAlign = theme.display_verticalAlign.strip()
|
||||
theme.display_wrapStyle = theme.display_wrapStyle.strip()
|
||||
theme.font_footer_color = theme.font_footer_color.strip()
|
||||
theme.font_footer_height = theme.font_footer_height.strip()
|
||||
theme.font_footer_italics = str_to_bool(theme.font_footer_italics)
|
||||
theme.font_footer_name = theme.font_footer_name.strip()
|
||||
#theme.font_footer_override
|
||||
theme.font_footer_proportion = theme.font_footer_proportion.strip()
|
||||
theme.font_footer_weight = theme.font_footer_weight.strip()
|
||||
theme.font_footer_width = theme.font_footer_width.strip()
|
||||
theme.font_footer_x = theme.font_footer_x.strip()
|
||||
theme.font_footer_y = theme.font_footer_y.strip()
|
||||
theme.font_main_color = theme.font_main_color.strip()
|
||||
theme.font_main_height = theme.font_main_height.strip()
|
||||
theme.font_main_italics = str_to_bool(theme.font_main_italics)
|
||||
theme.font_main_name = theme.font_main_name.strip()
|
||||
#theme.font_main_override
|
||||
theme.font_main_proportion = theme.font_main_proportion.strip()
|
||||
theme.font_main_weight = theme.font_main_weight.strip()
|
||||
theme.font_main_x = theme.font_main_x.strip()
|
||||
theme.font_main_y = theme.font_main_y.strip()
|
||||
#theme.theme_mode
|
||||
theme.theme_name = theme.theme_name.strip()
|
||||
#theme.theme_version
|
||||
|
@ -1,8 +1,8 @@
|
||||
1,1,"Genesis","GEN"
|
||||
2,1,"Exodus","EXOD"
|
||||
3,1,"Leviticus","LEV"
|
||||
4,1,"Numbers","NUM"
|
||||
47,2,"Matthew","MATT"
|
||||
48,2,"Mark","MARK"
|
||||
49,2,"Luke","LUKE"
|
||||
50,2,"John","JOHN"
|
||||
1,1,"Genesis","GEN"
|
||||
2,1,"Exodus","EXOD"
|
||||
3,1,"Leviticus","LEV"
|
||||
4,1,"Numbers","NUM"
|
||||
47,2,"Matthew","MATT"
|
||||
48,2,"Mark","MARK"
|
||||
49,2,"Luke","LUKE"
|
||||
50,2,"John","JOHN"
|
||||
|
|
@ -1,9 +1,9 @@
|
||||
1,1,"Genesis","GEN"
|
||||
2,1,"Exodus","EXOD"
|
||||
3,1,"Leviticus","LEV"
|
||||
4,1,"Numbers","NUM"
|
||||
46,1,"Malachi","MAL"
|
||||
47,2,"Matthew","MATT"
|
||||
48,2,"Mark","MARK"
|
||||
49,2,"Luke","LUKE"
|
||||
50,2,"John","JOHN"
|
||||
1,1,"Genesis","GEN"
|
||||
2,1,"Exodus","EXOD"
|
||||
3,1,"Leviticus","LEV"
|
||||
4,1,"Numbers","NUM"
|
||||
46,1,"Malachi","MAL"
|
||||
47,2,"Matthew","MATT"
|
||||
48,2,"Mark","MARK"
|
||||
49,2,"Luke","LUKE"
|
||||
50,2,"John","JOHN"
|
||||
|
|
@ -1,35 +1,35 @@
|
||||
"Genesis",1,1,"First this: God created the Heavens and Earth - all you see, all you don't see."
|
||||
"Genesis",1,2,"Earth was a soup of nothingness, a bottomless emptiness, an inky blackness. God's Spirit brooded like a bird above the watery abyss."
|
||||
"Exodus",1,1,"These are the names of the Israelites who went to Egypt with Jacob, each bringing his family members:"
|
||||
"Exodus",1,2,"Reuben, Simeon, Levi, and Judah,"
|
||||
"Exodus",2,1,"A man from the family of Levi married a Levite woman."
|
||||
"Exodus",2,2,"The woman became pregnant and had a son. She saw there was something special about him and hid him. She hid him for three months."
|
||||
"Leviticus",1,1,"God called Moses and spoke to him from the Tent of Meeting:"
|
||||
"Leviticus",1,2,"""Speak to the People of Israel. Tell them, When anyone presents an offering to God, present an animal from either the herd or the flock."
|
||||
"Leviticus",1,3,"""If the offering is a Whole-Burnt-Offering from the herd, present a male without a defect at the entrance to the Tent of Meeting that it may be accepted by God."
|
||||
"Numbers",1,1,"God spoke to Moses in the Wilderness of Sinai at the Tent of Meeting on the first day of the second month in the second year after they had left Egypt. He said,"
|
||||
"Numbers",1,2,"""Number the congregation of the People of Israel by clans and families, writing down the names of every male."
|
||||
"Matthew",1,1,"The family tree of Jesus Christ, David's son, Abraham's son:"
|
||||
"Matthew",1,2,"Abraham had Isaac, Isaac had Jacob, Jacob had Judah and his brothers,"
|
||||
"Matthew",1,3,"Judah had Perez and Zerah (the mother was Tamar), Perez had Hezron, Hezron had Aram,"
|
||||
"Matthew",1,4,"Aram had Amminadab, Amminadab had Nahshon, Nahshon had Salmon,"
|
||||
"Matthew",1,5,"Salmon had Boaz (his mother was Rahab), Boaz had Obed (Ruth was the mother), Obed had Jesse,"
|
||||
"Matthew",1,6,"Jesse had David, and David became king. David had Solomon (Uriah's wife was the mother),"
|
||||
"Matthew",1,7,"Solomon had Rehoboam, Rehoboam had Abijah, Abijah had Asa,"
|
||||
"Matthew",1,8,"Asa had Jehoshaphat, Jehoshaphat had Joram, Joram had Uzziah,"
|
||||
"Matthew",2,1,"After Jesus was born in Bethlehem village, Judah territory - this was during Herod's kingship - a band of scholars arrived in Jerusalem from the East."
|
||||
"Matthew",2,2,"They asked around, ""Where can we find and pay homage to the newborn King of the Jews? We observed a star in the eastern sky that "Matthew",3,1,"While Jesus was living in the Galilean hills, John, called ""the Baptizer,"" was preaching in the desert country of Judea."
|
||||
"Matthew",3,2,"His message was simple and austere, like his desert surroundings: ""Change your life. God's kingdom is here."""
|
||||
"Matthew",3,3,"John and his message were authorized by Isaiah's prophecy: Thunder in the desert! Prepare for God's arrival! Make the road smooth and straight!"
|
||||
"Mark",1,1,"The good news of Jesus Christ - the Message! - begins here,"
|
||||
"Mark",1,2,"following to the letter the scroll of the prophet Isaiah. Watch closely: I'm sending my preacher ahead of you; He'll make the road smooth for you."
|
||||
"Mark",1,3,"Thunder in the desert! Prepare for God's arrival! Make the road smooth and straight!"
|
||||
"Luke",1,1,"So many others have tried their hand at putting together a story of the wonderful harvest of Scripture and history that took place among us,"
|
||||
"Luke",1,2,"using reports handed down by the original eyewitnesses who served this Word with their very lives."
|
||||
"Luke",1,3,"Since I have investigated all the reports in close detail, starting from the story's beginning, I decided to write it all out for you, most honorable Theophilus,"
|
||||
"John",1,1,"The Word was first, the Word present to God, God present to the Word. The Word was God,"
|
||||
"John",1,2,"in readiness for God from day one."
|
||||
"John",1,3,"Everything was created through him; nothing - not one thing! - came into being without him."
|
||||
"John",2,1,"Three days later there was a wedding in the village of Cana in Galilee. Jesus' mother was there."
|
||||
"John",2,2,"Jesus and his disciples were guests also."
|
||||
"John",2,3,"When they started running low on wine at the wedding banquet, Jesus' mother told him, ""They're just about out of wine."""
|
||||
"Genesis",1,1,"First this: God created the Heavens and Earth - all you see, all you don't see."
|
||||
"Genesis",1,2,"Earth was a soup of nothingness, a bottomless emptiness, an inky blackness. God's Spirit brooded like a bird above the watery abyss."
|
||||
"Exodus",1,1,"These are the names of the Israelites who went to Egypt with Jacob, each bringing his family members:"
|
||||
"Exodus",1,2,"Reuben, Simeon, Levi, and Judah,"
|
||||
"Exodus",2,1,"A man from the family of Levi married a Levite woman."
|
||||
"Exodus",2,2,"The woman became pregnant and had a son. She saw there was something special about him and hid him. She hid him for three months."
|
||||
"Leviticus",1,1,"God called Moses and spoke to him from the Tent of Meeting:"
|
||||
"Leviticus",1,2,"""Speak to the People of Israel. Tell them, When anyone presents an offering to God, present an animal from either the herd or the flock."
|
||||
"Leviticus",1,3,"""If the offering is a Whole-Burnt-Offering from the herd, present a male without a defect at the entrance to the Tent of Meeting that it may be accepted by God."
|
||||
"Numbers",1,1,"God spoke to Moses in the Wilderness of Sinai at the Tent of Meeting on the first day of the second month in the second year after they had left Egypt. He said,"
|
||||
"Numbers",1,2,"""Number the congregation of the People of Israel by clans and families, writing down the names of every male."
|
||||
"Matthew",1,1,"The family tree of Jesus Christ, David's son, Abraham's son:"
|
||||
"Matthew",1,2,"Abraham had Isaac, Isaac had Jacob, Jacob had Judah and his brothers,"
|
||||
"Matthew",1,3,"Judah had Perez and Zerah (the mother was Tamar), Perez had Hezron, Hezron had Aram,"
|
||||
"Matthew",1,4,"Aram had Amminadab, Amminadab had Nahshon, Nahshon had Salmon,"
|
||||
"Matthew",1,5,"Salmon had Boaz (his mother was Rahab), Boaz had Obed (Ruth was the mother), Obed had Jesse,"
|
||||
"Matthew",1,6,"Jesse had David, and David became king. David had Solomon (Uriah's wife was the mother),"
|
||||
"Matthew",1,7,"Solomon had Rehoboam, Rehoboam had Abijah, Abijah had Asa,"
|
||||
"Matthew",1,8,"Asa had Jehoshaphat, Jehoshaphat had Joram, Joram had Uzziah,"
|
||||
"Matthew",2,1,"After Jesus was born in Bethlehem village, Judah territory - this was during Herod's kingship - a band of scholars arrived in Jerusalem from the East."
|
||||
"Matthew",2,2,"They asked around, ""Where can we find and pay homage to the newborn King of the Jews? We observed a star in the eastern sky that "Matthew",3,1,"While Jesus was living in the Galilean hills, John, called ""the Baptizer,"" was preaching in the desert country of Judea."
|
||||
"Matthew",3,2,"His message was simple and austere, like his desert surroundings: ""Change your life. God's kingdom is here."""
|
||||
"Matthew",3,3,"John and his message were authorized by Isaiah's prophecy: Thunder in the desert! Prepare for God's arrival! Make the road smooth and straight!"
|
||||
"Mark",1,1,"The good news of Jesus Christ - the Message! - begins here,"
|
||||
"Mark",1,2,"following to the letter the scroll of the prophet Isaiah. Watch closely: I'm sending my preacher ahead of you; He'll make the road smooth for you."
|
||||
"Mark",1,3,"Thunder in the desert! Prepare for God's arrival! Make the road smooth and straight!"
|
||||
"Luke",1,1,"So many others have tried their hand at putting together a story of the wonderful harvest of Scripture and history that took place among us,"
|
||||
"Luke",1,2,"using reports handed down by the original eyewitnesses who served this Word with their very lives."
|
||||
"Luke",1,3,"Since I have investigated all the reports in close detail, starting from the story's beginning, I decided to write it all out for you, most honorable Theophilus,"
|
||||
"John",1,1,"The Word was first, the Word present to God, God present to the Word. The Word was God,"
|
||||
"John",1,2,"in readiness for God from day one."
|
||||
"John",1,3,"Everything was created through him; nothing - not one thing! - came into being without him."
|
||||
"John",2,1,"Three days later there was a wedding in the village of Cana in Galilee. Jesus' mother was there."
|
||||
"John",2,2,"Jesus and his disciples were guests also."
|
||||
"John",2,3,"When they started running low on wine at the wedding banquet, Jesus' mother told him, ""They're just about out of wine."""
|
||||
|
Can't render this file because it contains an unexpected character in line 21 and column 146.
|
@ -1,116 +1,116 @@
|
||||
|
||||
PPTVIEWLIB - Control PowerPoint Viewer 2003/2007 (for openlp.org)
|
||||
Copyright (C) 2008 Jonathan Corwin (j@corwin.co.uk)
|
||||
|
||||
This library wrappers the free Microsoft PowerPoint Viewer (2003/2007) program,
|
||||
allowing it to be more easily controlled from another program.
|
||||
|
||||
The PowerPoint Viewer must already be installed on the destination machine, and is
|
||||
freely available at microsoft.com.
|
||||
|
||||
The full Microsoft Office PowerPoint and PowerPoint Viewer 97 have a COM interface allowing
|
||||
automation. This ability was removed from the 2003+ viewer offerings.
|
||||
|
||||
To developers: I am not a C/C++ or Win32 API programmer as you can probably tell.
|
||||
The code and API of this DLL could certainly do with some tidying up, and the
|
||||
error trapping, where it exists, is very basic. I'll happily accept patches!
|
||||
|
||||
This library is covered by the GPL (http://www.gnu.org/licenses/)
|
||||
It is NOT covered by the LGPL, so can only be used in GPL compatable programs.
|
||||
(http://www.gnu.org/licenses/why-not-lgpl.html)
|
||||
|
||||
This README.TXT must be distributed with the pptviewlib.dll
|
||||
|
||||
This library has a limit of 50 PowerPoints which can be opened simultaneously.
|
||||
|
||||
USAGE
|
||||
-----
|
||||
int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewpath);
|
||||
|
||||
Opens the PowerPoint file, counts the number of slides, sizes and positions accordingly
|
||||
and creates preview images of each slide. Note PowerPoint Viewer only allows the
|
||||
slideshow to be resized whilst it is being loaded. It can be moved at any time however.
|
||||
|
||||
The only way to count the number of slides is to step through the entire show. Therefore
|
||||
there will be a delay whilst opening large presentations for the first time.
|
||||
For pre XP/2003 systems, the slideshow will flicker as the screen snapshots are taken.
|
||||
|
||||
filename: The PowerPoint file to be opened. Full path
|
||||
hParentWnd: The window which will become the parent of the slideshow window.
|
||||
Can be NULL.
|
||||
rect: The location/dimensions of the slideshow window.
|
||||
If all properties of this structure are zero, the dimensions of the hParentWnd
|
||||
are used.
|
||||
previewpath If specified, the prefix to use for snapshot images of each slide, in the
|
||||
form: previewpath + n + ".bmp", where n is the slide number.
|
||||
A file called previewpath + "info.txt" will also be created containing information
|
||||
about the PPT file, to speed up future openings of the unmodified file.
|
||||
Note it is up the calling program to directly access these images if they
|
||||
are required.
|
||||
|
||||
RETURNS: An unique identifier to pass to other methods in this library.
|
||||
If < 0, then the PPT failed to open.
|
||||
If >=0, ClosePPT must be called when the PPT is no longer being used
|
||||
or when the calling program is closed to release resources/hooks.
|
||||
|
||||
void ClosePPT(int id);
|
||||
Closes the presentation, releasing any resources and hooks.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
int GetCurrentSlide(int id);
|
||||
Returns the current slide number (from 1)
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
int GetSlideCount(int id);
|
||||
Returns the total number of slides.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void NextStep(int id);
|
||||
Advances one step (animation) through the slideshow.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void PrevStep(int id);
|
||||
Goes backwards one step (animation) through the slideshow.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void GotoSlide(int id, int slideno);
|
||||
Goes directly to a specific slide in the slideshow
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
slideno: The number of the slide (from 1) to go directly to.
|
||||
|
||||
If the slide has already been displayed, then the completed slide with animations performed
|
||||
will be shown. This is how the PowerPoint Viewer works so have no control over this.
|
||||
|
||||
void RestartShow(int id);
|
||||
Restarts the show from the beginning. To reset animations, behind the scenes it
|
||||
has to travel to the end and step backwards though the entire show. Therefore
|
||||
for large presentations there might be a delay.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Blank(int id);
|
||||
Blanks the screen, colour black.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Unblank(int id)
|
||||
Unblanks the screen, restoring it to it's pre-blank state.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Stop(int id)
|
||||
Moves the slideshow off the screen. (There is no concept of stop show in the PowerPoint Viewer)
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Resume(int id)
|
||||
Moves the slideshow display back onto the screen following a Stop()
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
|
||||
PPTVIEWLIB - Control PowerPoint Viewer 2003/2007 (for openlp.org)
|
||||
Copyright (C) 2008 Jonathan Corwin (j@corwin.co.uk)
|
||||
|
||||
This library wrappers the free Microsoft PowerPoint Viewer (2003/2007) program,
|
||||
allowing it to be more easily controlled from another program.
|
||||
|
||||
The PowerPoint Viewer must already be installed on the destination machine, and is
|
||||
freely available at microsoft.com.
|
||||
|
||||
The full Microsoft Office PowerPoint and PowerPoint Viewer 97 have a COM interface allowing
|
||||
automation. This ability was removed from the 2003+ viewer offerings.
|
||||
|
||||
To developers: I am not a C/C++ or Win32 API programmer as you can probably tell.
|
||||
The code and API of this DLL could certainly do with some tidying up, and the
|
||||
error trapping, where it exists, is very basic. I'll happily accept patches!
|
||||
|
||||
This library is covered by the GPL (http://www.gnu.org/licenses/)
|
||||
It is NOT covered by the LGPL, so can only be used in GPL compatable programs.
|
||||
(http://www.gnu.org/licenses/why-not-lgpl.html)
|
||||
|
||||
This README.TXT must be distributed with the pptviewlib.dll
|
||||
|
||||
This library has a limit of 50 PowerPoints which can be opened simultaneously.
|
||||
|
||||
USAGE
|
||||
-----
|
||||
int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewpath);
|
||||
|
||||
Opens the PowerPoint file, counts the number of slides, sizes and positions accordingly
|
||||
and creates preview images of each slide. Note PowerPoint Viewer only allows the
|
||||
slideshow to be resized whilst it is being loaded. It can be moved at any time however.
|
||||
|
||||
The only way to count the number of slides is to step through the entire show. Therefore
|
||||
there will be a delay whilst opening large presentations for the first time.
|
||||
For pre XP/2003 systems, the slideshow will flicker as the screen snapshots are taken.
|
||||
|
||||
filename: The PowerPoint file to be opened. Full path
|
||||
hParentWnd: The window which will become the parent of the slideshow window.
|
||||
Can be NULL.
|
||||
rect: The location/dimensions of the slideshow window.
|
||||
If all properties of this structure are zero, the dimensions of the hParentWnd
|
||||
are used.
|
||||
previewpath If specified, the prefix to use for snapshot images of each slide, in the
|
||||
form: previewpath + n + ".bmp", where n is the slide number.
|
||||
A file called previewpath + "info.txt" will also be created containing information
|
||||
about the PPT file, to speed up future openings of the unmodified file.
|
||||
Note it is up the calling program to directly access these images if they
|
||||
are required.
|
||||
|
||||
RETURNS: An unique identifier to pass to other methods in this library.
|
||||
If < 0, then the PPT failed to open.
|
||||
If >=0, ClosePPT must be called when the PPT is no longer being used
|
||||
or when the calling program is closed to release resources/hooks.
|
||||
|
||||
void ClosePPT(int id);
|
||||
Closes the presentation, releasing any resources and hooks.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
int GetCurrentSlide(int id);
|
||||
Returns the current slide number (from 1)
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
int GetSlideCount(int id);
|
||||
Returns the total number of slides.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void NextStep(int id);
|
||||
Advances one step (animation) through the slideshow.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void PrevStep(int id);
|
||||
Goes backwards one step (animation) through the slideshow.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void GotoSlide(int id, int slideno);
|
||||
Goes directly to a specific slide in the slideshow
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
slideno: The number of the slide (from 1) to go directly to.
|
||||
|
||||
If the slide has already been displayed, then the completed slide with animations performed
|
||||
will be shown. This is how the PowerPoint Viewer works so have no control over this.
|
||||
|
||||
void RestartShow(int id);
|
||||
Restarts the show from the beginning. To reset animations, behind the scenes it
|
||||
has to travel to the end and step backwards though the entire show. Therefore
|
||||
for large presentations there might be a delay.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Blank(int id);
|
||||
Blanks the screen, colour black.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Unblank(int id)
|
||||
Unblanks the screen, restoring it to it's pre-blank state.
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Stop(int id)
|
||||
Moves the slideshow off the screen. (There is no concept of stop show in the PowerPoint Viewer)
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
void Resume(int id)
|
||||
Moves the slideshow display back onto the screen following a Stop()
|
||||
|
||||
id: The value returned from OpenPPT.
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,54 +1,54 @@
|
||||
|
||||
#define DllExport extern "C" __declspec( dllexport )
|
||||
|
||||
enum PPTVIEWSTATE { PPT_CLOSED, PPT_STARTED, PPT_OPENED, PPT_LOADED, PPT_CLOSING};
|
||||
|
||||
DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewpath);
|
||||
DllExport void ClosePPT(int id);
|
||||
DllExport int GetCurrentSlide(int id);
|
||||
DllExport int GetSlideCount(int id);
|
||||
DllExport void NextStep(int id);
|
||||
DllExport void PrevStep(int id);
|
||||
DllExport void GotoSlide(int id, int slideno);
|
||||
DllExport void RestartShow(int id);
|
||||
DllExport void Blank(int id);
|
||||
DllExport void Unblank(int id);
|
||||
DllExport void Stop(int id);
|
||||
DllExport void Resume(int id);
|
||||
DllExport void SetDebug(BOOL onoff);
|
||||
|
||||
LRESULT CALLBACK CbtProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK CwpProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
BOOL GetPPTViewerPath(char *pptviewerpath, int strsize);
|
||||
HBITMAP CaptureWindow (HWND hWnd);
|
||||
VOID SaveBitmap (CHAR* filename, HBITMAP hBmp) ;
|
||||
VOID CaptureAndSaveWindow(HWND hWnd, CHAR* filename);
|
||||
BOOL GetPPTInfo(int id);
|
||||
BOOL SavePPTInfo(int id);
|
||||
|
||||
|
||||
void Unhook(int id);
|
||||
|
||||
#define MAX_PPTOBJS 50
|
||||
|
||||
struct PPTVIEWOBJ
|
||||
{
|
||||
HHOOK hook;
|
||||
HHOOK mhook;
|
||||
HWND hWnd;
|
||||
HWND hWnd2;
|
||||
HWND hParentWnd;
|
||||
HANDLE hProcess;
|
||||
HANDLE hThread;
|
||||
DWORD dwProcessId;
|
||||
DWORD dwThreadId;
|
||||
RECT rect;
|
||||
int slideCount;
|
||||
int currentSlide;
|
||||
int firstSlideSteps;
|
||||
int steps;
|
||||
char filename[MAX_PATH];
|
||||
char previewpath[MAX_PATH];
|
||||
PPTVIEWSTATE state;
|
||||
|
||||
#define DllExport extern "C" __declspec( dllexport )
|
||||
|
||||
enum PPTVIEWSTATE { PPT_CLOSED, PPT_STARTED, PPT_OPENED, PPT_LOADED, PPT_CLOSING};
|
||||
|
||||
DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewpath);
|
||||
DllExport void ClosePPT(int id);
|
||||
DllExport int GetCurrentSlide(int id);
|
||||
DllExport int GetSlideCount(int id);
|
||||
DllExport void NextStep(int id);
|
||||
DllExport void PrevStep(int id);
|
||||
DllExport void GotoSlide(int id, int slideno);
|
||||
DllExport void RestartShow(int id);
|
||||
DllExport void Blank(int id);
|
||||
DllExport void Unblank(int id);
|
||||
DllExport void Stop(int id);
|
||||
DllExport void Resume(int id);
|
||||
DllExport void SetDebug(BOOL onoff);
|
||||
|
||||
LRESULT CALLBACK CbtProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK CwpProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
BOOL GetPPTViewerPath(char *pptviewerpath, int strsize);
|
||||
HBITMAP CaptureWindow (HWND hWnd);
|
||||
VOID SaveBitmap (CHAR* filename, HBITMAP hBmp) ;
|
||||
VOID CaptureAndSaveWindow(HWND hWnd, CHAR* filename);
|
||||
BOOL GetPPTInfo(int id);
|
||||
BOOL SavePPTInfo(int id);
|
||||
|
||||
|
||||
void Unhook(int id);
|
||||
|
||||
#define MAX_PPTOBJS 50
|
||||
|
||||
struct PPTVIEWOBJ
|
||||
{
|
||||
HHOOK hook;
|
||||
HHOOK mhook;
|
||||
HWND hWnd;
|
||||
HWND hWnd2;
|
||||
HWND hParentWnd;
|
||||
HANDLE hProcess;
|
||||
HANDLE hThread;
|
||||
DWORD dwProcessId;
|
||||
DWORD dwThreadId;
|
||||
RECT rect;
|
||||
int slideCount;
|
||||
int currentSlide;
|
||||
int firstSlideSteps;
|
||||
int steps;
|
||||
char filename[MAX_PATH];
|
||||
char previewpath[MAX_PATH];
|
||||
PPTVIEWSTATE state;
|
||||
};
|
@ -1,203 +1,203 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="pptviewlib"
|
||||
ProjectGUID="{04CC20D1-DC5A-4189-8181-4011E3C21DCF}"
|
||||
RootNamespace="pptviewlib"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PPTVIEWLIB_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PPTVIEWLIB_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
ModuleDefinitionFile="pptviewlib.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\pptviewlib.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\README.TXT"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\pptviewlib.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="pptviewlib"
|
||||
ProjectGUID="{04CC20D1-DC5A-4189-8181-4011E3C21DCF}"
|
||||
RootNamespace="pptviewlib"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PPTVIEWLIB_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PPTVIEWLIB_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
ModuleDefinitionFile="pptviewlib.def"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\pptviewlib.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\README.TXT"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\pptviewlib.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
|
@ -1,56 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><song><title>På en fjern ensom høj</title><author></author><copyright></copyright><ccli></ccli><lyrics>[V1]
|
||||
På en fjern ensom høj,
|
||||
Jesu kors dyrest stod,
|
||||
symbolet på smerte og skam.
|
||||
O, jeg elsker det kors,
|
||||
hvor Guds søn gjorde bod,
|
||||
da forbandelsen blev lagt på ham.
|
||||
|
||||
[C1]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
[V2]
|
||||
O, det urgamle kors,
|
||||
med sin hvile og fred,
|
||||
tilhyllet i verdens foragt.
|
||||
Se, det hellige lam,
|
||||
som på Golgatha stred,
|
||||
og til jorden Guds nåde har bragt.
|
||||
|
||||
[C2]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
[V3]
|
||||
I det urgamle kors,
|
||||
i hans blod farvet rødt,
|
||||
en underfuld skønhed jeg ser.
|
||||
Ja, det var på det kors,
|
||||
at han selv blev forstødt,
|
||||
nu skal aldrig for dommen jeg mer.
|
||||
|
||||
[C3]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
[V4]
|
||||
For det urgamle kors,
|
||||
står mit hjerte i brand,
|
||||
min plads jeg nu har ved dets fod.
|
||||
Til han kalder en dag,
|
||||
mig til himmelens land,
|
||||
og til hvilen hos Faderen god.
|
||||
|
||||
[C4]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
<?xml version="1.0" encoding="utf-8"?><song><title>På en fjern ensom høj</title><author></author><copyright></copyright><ccli></ccli><lyrics>[V1]
|
||||
På en fjern ensom høj,
|
||||
Jesu kors dyrest stod,
|
||||
symbolet på smerte og skam.
|
||||
O, jeg elsker det kors,
|
||||
hvor Guds søn gjorde bod,
|
||||
da forbandelsen blev lagt på ham.
|
||||
|
||||
[C1]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
[V2]
|
||||
O, det urgamle kors,
|
||||
med sin hvile og fred,
|
||||
tilhyllet i verdens foragt.
|
||||
Se, det hellige lam,
|
||||
som på Golgatha stred,
|
||||
og til jorden Guds nåde har bragt.
|
||||
|
||||
[C2]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
[V3]
|
||||
I det urgamle kors,
|
||||
i hans blod farvet rødt,
|
||||
en underfuld skønhed jeg ser.
|
||||
Ja, det var på det kors,
|
||||
at han selv blev forstødt,
|
||||
nu skal aldrig for dommen jeg mer.
|
||||
|
||||
[C3]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
[V4]
|
||||
For det urgamle kors,
|
||||
står mit hjerte i brand,
|
||||
min plads jeg nu har ved dets fod.
|
||||
Til han kalder en dag,
|
||||
mig til himmelens land,
|
||||
og til hvilen hos Faderen god.
|
||||
|
||||
[C4]
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
</lyrics><presentation>V1 C1 V2 C2 V3 C3 V4 C4</presentation></song>
|
@ -1,36 +1,36 @@
|
||||
Song Title Here
|
||||
|
||||
|
||||
Chorus 1
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
Verse 1
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
Verse 2
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
Misc 1
|
||||
(BRIDGE)
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
|
||||
CCLI Song No. 1234567
|
||||
© 1996 Publisher Info
|
||||
Author/artist name
|
||||
For use solely in accordance with the SongSelect Advanced Terms of Agreement. All rights Reserved.
|
||||
Song Title Here
|
||||
|
||||
|
||||
Chorus 1
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
Verse 1
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
Verse 2
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
Misc 1
|
||||
(BRIDGE)
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
Lyrics
|
||||
|
||||
|
||||
|
||||
CCLI Song No. 1234567
|
||||
© 1996 Publisher Info
|
||||
Author/artist name
|
||||
For use solely in accordance with the SongSelect Advanced Terms of Agreement. All rights Reserved.
|
||||
CCLI License No. 1234567
|
@ -1,61 +1,61 @@
|
||||
På en fjern ensom høj
|
||||
|
||||
Verse 1
|
||||
På en fjern ensom høj,
|
||||
Jesu kors dyrest stod,
|
||||
symbolet på smerte og skam.
|
||||
O, jeg elsker det kors,
|
||||
hvor Guds søn gjorde bod,
|
||||
da forbandelsen blev lagt på ham.
|
||||
|
||||
Chorus 1
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
Verse 2
|
||||
O, det urgamle kors,
|
||||
med sin hvile og fred,
|
||||
tilhyllet i verdens foragt.
|
||||
Se, det hellige lam,
|
||||
som på Golgatha stred,
|
||||
og til jorden Guds nåde har bragt.
|
||||
|
||||
Chorus 2
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
Verse 3
|
||||
I det urgamle kors,
|
||||
i hans blod farvet rødt,
|
||||
en underfuld skønhed jeg ser.
|
||||
Ja, det var på det kors,
|
||||
at han selv blev forstødt,
|
||||
nu skal aldrig for dommen jeg mer.
|
||||
|
||||
Chorus 3
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
Verse 4
|
||||
For det urgamle kors,
|
||||
står mit hjerte i brand,
|
||||
min plads jeg nu har ved dets fod.
|
||||
Til han kalder en dag,
|
||||
mig til himmelens land,
|
||||
og til hvilen hos Faderen god.
|
||||
|
||||
Chorus 4
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
CCLI Song No.
|
||||
©
|
||||
Georg Bennard
|
||||
På en fjern ensom høj
|
||||
|
||||
Verse 1
|
||||
På en fjern ensom høj,
|
||||
Jesu kors dyrest stod,
|
||||
symbolet på smerte og skam.
|
||||
O, jeg elsker det kors,
|
||||
hvor Guds søn gjorde bod,
|
||||
da forbandelsen blev lagt på ham.
|
||||
|
||||
Chorus 1
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
Verse 2
|
||||
O, det urgamle kors,
|
||||
med sin hvile og fred,
|
||||
tilhyllet i verdens foragt.
|
||||
Se, det hellige lam,
|
||||
som på Golgatha stred,
|
||||
og til jorden Guds nåde har bragt.
|
||||
|
||||
Chorus 2
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
Verse 3
|
||||
I det urgamle kors,
|
||||
i hans blod farvet rødt,
|
||||
en underfuld skønhed jeg ser.
|
||||
Ja, det var på det kors,
|
||||
at han selv blev forstødt,
|
||||
nu skal aldrig for dommen jeg mer.
|
||||
|
||||
Chorus 3
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
Verse 4
|
||||
For det urgamle kors,
|
||||
står mit hjerte i brand,
|
||||
min plads jeg nu har ved dets fod.
|
||||
Til han kalder en dag,
|
||||
mig til himmelens land,
|
||||
og til hvilen hos Faderen god.
|
||||
|
||||
Chorus 4
|
||||
Jeg vil elske det urgamle kors,
|
||||
i det kraft er der sejer og sang.
|
||||
Lad mig favne det hellige kors,
|
||||
det med kronen ombyttes engang.
|
||||
|
||||
CCLI Song No.
|
||||
©
|
||||
Georg Bennard
|
||||
|
@ -1,32 +1,32 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Song>
|
||||
<lyrics lang="en_US">
|
||||
<title>Amazing Grace</title>
|
||||
<verse name="v1">
|
||||
<theme>name of verse specific theme</theme>
|
||||
<comment>any text</comment>
|
||||
<part name="men">
|
||||
Amazing grace, how ...
|
||||
</part>
|
||||
<part name="women">
|
||||
A b c
|
||||
D e f
|
||||
</part>
|
||||
...
|
||||
</verse>
|
||||
<verse name="c">
|
||||
<comment>any text</comment>
|
||||
...
|
||||
</verse>
|
||||
</lyrics>
|
||||
<lyrics lang="de_DE">
|
||||
<title>Erstaunliche Anmut</title>
|
||||
<verse name="v1">
|
||||
Erstaunliche Anmut, wie
|
||||
...
|
||||
</verse>
|
||||
<verse name="c">
|
||||
...
|
||||
</verse>
|
||||
</lyrics>
|
||||
</Song>
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Song>
|
||||
<lyrics lang="en_US">
|
||||
<title>Amazing Grace</title>
|
||||
<verse name="v1">
|
||||
<theme>name of verse specific theme</theme>
|
||||
<comment>any text</comment>
|
||||
<part name="men">
|
||||
Amazing grace, how ...
|
||||
</part>
|
||||
<part name="women">
|
||||
A b c
|
||||
D e f
|
||||
</part>
|
||||
...
|
||||
</verse>
|
||||
<verse name="c">
|
||||
<comment>any text</comment>
|
||||
...
|
||||
</verse>
|
||||
</lyrics>
|
||||
<lyrics lang="de_DE">
|
||||
<title>Erstaunliche Anmut</title>
|
||||
<verse name="v1">
|
||||
Erstaunliche Anmut, wie
|
||||
...
|
||||
</verse>
|
||||
<verse name="c">
|
||||
...
|
||||
</verse>
|
||||
</lyrics>
|
||||
</Song>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(23.976, 44100)
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(23.976, 44100)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(25, 48000)
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(25, 48000)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(29.97, 32000)
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(29.97, 32000)
|
||||
|
@ -1,7 +1,7 @@
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(29.97, 22050)
|
||||
BicubicResize(640,360)
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
Import("synctest.avsi")
|
||||
SyncClip(29.97, 22050)
|
||||
BicubicResize(640,360)
|
||||
|
@ -1,47 +1,47 @@
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
#
|
||||
# This code is part of OpenLP's testsuite
|
||||
# OpenLP - Open Source Lyrics Projection
|
||||
# Copyright (c) 2009 Andrew Lok
|
||||
#
|
||||
# This program 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; version 2 of the License.
|
||||
#
|
||||
# This program 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
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
function SyncClip(float framerate, int audiorate)
|
||||
{
|
||||
frames=30
|
||||
seconds=frames/framerate
|
||||
|
||||
silence = Tone(seconds, 440, audiorate, 1, "silence", 1.0)
|
||||
tone = Tone(seconds, 440, audiorate, 1, "sine", 1.0)
|
||||
|
||||
silence2 = MonoToStereo(silence, silence)
|
||||
left = MonoToStereo(tone, silence)
|
||||
right = MonoToStereo(silence, tone)
|
||||
|
||||
leftvid=ImageSource("left-720.png",end = frames, fps=framerate, use_DevIL=true)
|
||||
rightvid=ImageSource("right-720.png",end = frames, fps=framerate, use_DevIL=true)
|
||||
normalvid=ImageSource("normal-720.png",end = frames, fps=framerate, use_DevIL=true)
|
||||
|
||||
cycle = AudioDub(leftvid,left) ++ AudioDub(normalvid,silence2) ++ AudioDub(rightvid,right) ++ AudioDub(normalvid,silence2)
|
||||
|
||||
final = loop(cycle,times=5)
|
||||
|
||||
final = final.ConvertToYV12()
|
||||
final = final.info()
|
||||
|
||||
return final
|
||||
}
|
||||
# audio/video sync test
|
||||
# by: Andrew Lok
|
||||
# 2009-06-22
|
||||
|
||||
#
|
||||
# This code is part of OpenLP's testsuite
|
||||
# OpenLP - Open Source Lyrics Projection
|
||||
# Copyright (c) 2009 Andrew Lok
|
||||
#
|
||||
# This program 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; version 2 of the License.
|
||||
#
|
||||
# This program 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
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
function SyncClip(float framerate, int audiorate)
|
||||
{
|
||||
frames=30
|
||||
seconds=frames/framerate
|
||||
|
||||
silence = Tone(seconds, 440, audiorate, 1, "silence", 1.0)
|
||||
tone = Tone(seconds, 440, audiorate, 1, "sine", 1.0)
|
||||
|
||||
silence2 = MonoToStereo(silence, silence)
|
||||
left = MonoToStereo(tone, silence)
|
||||
right = MonoToStereo(silence, tone)
|
||||
|
||||
leftvid=ImageSource("left-720.png",end = frames, fps=framerate, use_DevIL=true)
|
||||
rightvid=ImageSource("right-720.png",end = frames, fps=framerate, use_DevIL=true)
|
||||
normalvid=ImageSource("normal-720.png",end = frames, fps=framerate, use_DevIL=true)
|
||||
|
||||
cycle = AudioDub(leftvid,left) ++ AudioDub(normalvid,silence2) ++ AudioDub(rightvid,right) ++ AudioDub(normalvid,silence2)
|
||||
|
||||
final = loop(cycle,times=5)
|
||||
|
||||
final = final.ConvertToYV12()
|
||||
final = final.info()
|
||||
|
||||
return final
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user