Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6723
Modified Files:
skin.py
Log Message:
copy all needed function from the skin implementation to this module
Index: skin.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skin.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** skin.py 6 Dec 2003 16:49:09 -0000 1.9
--- skin.py 14 Feb 2004 13:01:08 -0000 1.10
***************
*** 6,29 ****
#
# Notes:
# Todo:
#
# -----------------------------------------------------------------------
# $Log$
# Revision 1.9 2003/12/06 16:49:09 dischi
# do not create a skin object for helpers
#
- # Revision 1.8 2003/11/28 19:26:36 dischi
- # renamed some config variables
- #
- # Revision 1.7 2003/09/23 13:42:01 outlyer
- # Removed more chatter.
- #
- # Revision 1.6 2003/09/14 20:09:36 dischi
- # removed some TRUE=1 and FALSE=0 add changed some debugs to _debug_
- #
- # Revision 1.5 2003/08/23 12:51:41 dischi
- # removed some old CVS log messages
- #
- #
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
--- 6,32 ----
#
# Notes:
+ # Works as a middle layer between the users preferred skin and rest of
+ # the system.
+ #
+ # Which skin you want to use is set in freevo_config.py. This small
+ # module gets your skin preferences from the configuration file and loads
+ # the correct skin implementation into the system.
+ #
+ # The path to the skin implementation is also added to the system path.
+ #
+ # get_singleton() returns an initialized skin object which is kept unique
+ # and consistent throughout.
+ #
+ #
# Todo:
#
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.10 2004/02/14 13:01:08 dischi
+ # copy all needed function from the skin implementation to this module
+ #
# Revision 1.9 2003/12/06 16:49:09 dischi
# do not create a skin object for helpers
#
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
***************
*** 47,69 ****
# ----------------------------------------------------------------------- */
#endif
- """
- Works as a middle layer between the users preferred skin and rest of
- the system.
-
- Which skin you want to use is set in freevo_config.py. This small
- module gets your skin preferences from the configuration file and loads
- the correct skin implementation into the system.
-
- The path to the skin implementation is also added to the system path.
-
- get_singleton() returns an initialized skin object which is kept unique
- and consistent throughout.
- """
- __version__ = "$Revision$"
- __date__ = "$Date$"
- __author__ = """Krister Lagerstrom <[EMAIL PROTECTED]>,
- Thomas malt <[EMAIL PROTECTED]>""" # See, I snuck it in again ;)
! import config # Freevo configuration.
import sys
import os.path
--- 50,55 ----
# ----------------------------------------------------------------------- */
#endif
! import config
import sys
import os.path
***************
*** 71,74 ****
--- 57,67 ----
_singleton = None
+ # a list of all functions the skin needs to have
+ __all__ = ( 'Rectange', 'Image', 'Area', 'register', 'delete', 'set_base_fxd',
+ 'load', 'get_skins', 'get_settings', 'toggle_display_style',
+ 'get_display_style', 'get_popupbox_style', 'get_font', 'get_icon',
+ 'items_per_page', 'clear', 'redraw', 'prepare', 'draw' )
+
+
def get_singleton():
"""
***************
*** 92,93 ****
--- 85,111 ----
return _singleton
+
+ if __freevo_app__ == 'main':
+ # init the skin
+ get_singleton()
+
+ # the all function to this module
+ for i in __all__:
+ exec('%s = _singleton.%s' % (i,i))
+
+ else:
+ # set all skin functions to the dummy function so nothing
+ # bad happens when we call it from inside a helper
+ class dummy_class:
+ def __init__(*arg1, **arg2):
+ pass
+
+ def dummy_function(*arg1, **arg2):
+ pass
+
+ for i in __all__:
+ if i[0] == i[0].upper():
+ exec('%s = dummy_class' % i)
+ else:
+ exec('%s = dummy_function' % i)
+
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog