"""
import pygame
+from pgu.gui import Theme
from pgu.gui import Desktop
from pgu.gui import QUIT
from minwii.widgets.launch import LaunchScreen
from minwii.config import SCREEN_RESOLUTION
from minwii.globals import PLAYING_MODES_DICT
from minwii.log import console, LOG_FORMAT_VERSION, envLogger
+import os.path
+
class MinWii(object):
self.wiimoteSupport = wiimoteSupport
self.fullscreen = fullscreen
LaunchScreen()
- self.app = Desktop()
+ themedir = __file__.split(os.path.sep)[:-1] + ['widgets', 'data', 'minwii_theme']
+ themedir = os.path.sep.join(themedir)
+ theme = Theme(themedir)
+ self.app = Desktop(theme=theme)
self.synth = Synth()
self.screenResolution = SCREEN_RESOLUTION
envLogger.info('résolution écran : %s', self.screenResolution)
--- /dev/null
+desktop background desktop.png
+
+input font Vera.ttf 16
+input background input.normal.png
+input color #000000
+input:focus background input.focus.png
+input padding_left 6
+input padding_right 6
+input padding_top 3
+input padding_bottom 3
+
+link font Vera.ttf 24
+link color #0000FF
+link:hover color #FF0000
+link:down color #00FF00
+
+label font Vera.ttf 16
+label color #000000
+
+document font Vera.ttf 16
+document color #000000
+div font Vera.ttf 16
+div color #000000
+
+td font Vera.ttf 16
+td color #000000
+th font Vera.ttf 16
+th color #000000
+
+h1 font Vera.ttf 24
+h1 color #000000
+h2 font Vera.ttf 20
+h2 color #000000
+h3 font Vera.ttf 16
+h3 color #000000
+h4 font Vera.ttf 14
+h4 color #000000
+h5 font Vera.ttf 12
+h5 color #000000
+h6 font Vera.ttf 10
+h6 color #000000
+
+ul font Vera.ttf 16
+ul color #000000
+ol font Vera.ttf 16
+ol color #000000
+li font Vera.ttf 16
+li color #000000
+li padding_left 32
+
+pre font mono 16
+pre color #000000
+code font mono 16
+code color #000000
+
+checkbox off checkbox.off.normal.tga
+checkbox on checkbox.on.normal.tga
+checkbox:hover off checkbox.off.hover.tga
+checkbox:hover on checkbox.on.hover.tga
+checkbox:down off checkbox.off.hover.tga
+checkbox:down on checkbox.on.hover.tga
+
+switch off checkbox.off.normal.tga
+switch on checkbox.on.normal.tga
+switch:hover off checkbox.off.hover.tga
+switch:hover on checkbox.on.hover.tga
+switch:down off checkbox.off.hover.tga
+switch:down on checkbox.on.hover.tga
+
+radio off radio.off.normal.tga
+radio on radio.on.normal.tga
+radio:hover off radio.off.hover.tga
+radio:hover on radio.on.hover.tga
+radio:down off radio.off.hover.tga
+radio:down on radio.on.hover.tga
+
+button background button.normal.tga
+button:hover background button.hover.tga
+button:down background button.down.tga
+button padding_left 8
+button padding_right 8
+button padding_top 1
+button padding_bottom 1
+button.label font Vera.ttf 16
+button.label color #000000
+
+slider background slider.tga
+slider bar slider.bar.normal.tga
+slider:hover bar slider.bar.hover.tga
+slider width 16
+slider height 16
+
+hslider background hslider.tga
+hslider bar hslider.bar.normal.tga
+hslider:hover bar hslider.bar.hover.tga
+hslider:down bar hslider.bar.hover.tga
+hslider width 16
+hslider height 16
+
+vslider background vslider.tga
+vslider bar vslider.bar.normal.tga
+vslider:hover bar vslider.bar.hover.tga
+vslider:down bar vslider.bar.hover.tga
+vslider width 16
+vslider height 16
+
+xhscrollbar height 16
+xhscrollbar background scroller.slide.h.tga
+xhscrollbar bar scroller.slide.bar.normal.tga
+xhscrollbar:hover bar scroller.slide.bar.hover.tga
+
+xvscrollbar width 16
+xvscrollbar background scroller.slide.v.tga
+xvscrollbar bar scroller.slide.bar.normal.tga
+xvscrollbar:hover bar scroller.slide.bar.hover.tga
+
+hscrollbar.slider background hslider.tga
+hscrollbar.slider bar hslider.bar.normal.tga
+hscrollbar.slider:hover bar hslider.bar.hover.tga
+hscrollbar.slider:down bar hslider.bar.hover.tga
+hscrollbar.slider width 16
+hscrollbar.slider height 16
+hscrollbar minus hslider.left.tga
+hscrollbar plus hslider.right.tga
+
+vscrollbar.slider background vslider.tga
+vscrollbar.slider bar vslider.bar.normal.tga
+vscrollbar.slider:hover bar vslider.bar.hover.tga
+vscrollbar.slider:down bar vslider.bar.hover.tga
+vscrollbar.slider width 16
+vscrollbar.slider height 16
+vscrollbar minus vslider.up.tga
+vscrollbar plus vslider.down.tga
+
+
+select.selected background select.selected.normal.tga
+select.selected:hover background select.selected.hover.tga
+select.selected:down background select.selected.down.tga
+select.selected padding_left 4
+select.selected padding_right 4
+select.selected padding_top 1
+select.selected padding_bottom 1
+select.arrow background select.arrow.normal.tga
+select.arrow:hover background select.arrow.hover.tga
+select.arrow:down background select.arrow.down.tga
+select.arrow padding_left 1
+select.arrow padding_right 1
+
+select.options background select.options.png
+select.option background select.option.normal.png
+select.option:hover background select.option.hover.png
+select.option:down background select.option.hover.png
+select.option padding_left 4
+select.option padding_right 4
+select.option padding_top 1
+select.option padding_bottom 1
+#select.option border_top 1
+#select.option border_right 1
+#select.option border_bottom 1
+#select.option border_left 1
+
+select.option.label font Vera.ttf 16
+select.option.label color #000000
+select.options padding_left 1
+select.options padding_right 1
+select.options padding_top 1
+select.options padding_bottom 1
+select arrow select.arrow.png
+
+
+dialog background dialog.bar.png
+xdialog.bar background dialog.bar.png
+dialog.bar padding_left 8
+dialog.bar padding_right 8
+dialog.bar padding_top 2
+dialog.bar padding_bottom 1
+dialog.bar.close image dialog.close.normal.tga
+dialog.bar.close:hover image dialog.close.hover.tga
+dialog.bar.close:down image dialog.close.down.tga
+dialog.main background dialog.png
+dialog.main padding_left 8
+dialog.main padding_right 8
+dialog.main padding_top 4
+dialog.main padding_bottom 4
+
+keysym font Vera.ttf 16
+keysym background input.normal.png
+keysym color #000000
+keysym:focus background input.focus.png
+keysym padding_left 6
+keysym padding_right 6
+keysym padding_top 3
+keysym padding_bottom 3
+
+tool background tool.normal.tga
+tool:hover background tool.hover.tga
+tool:down background tool.down.tga
+tool padding_left 4
+tool padding_right 4
+tool padding_top 1
+tool padding_bottom 1
+tool.label font Vera.ttf 16
+tool.label color #000000
+
+menu background menu.normal.tga
+menu:hover background menu.hover.tga
+menu:down background menu.down.tga
+menu padding_left 6
+menu padding_right 6
+menu padding_top 3
+menu padding_bottom 3
+menu.label font Vera.ttf 16
+menu.label color #000000
+
+menu-open background menu.down.tga
+menu-open:hover background menu.down.tga
+menu-open:down background menu.down.tga
+menu-open padding_left 6
+menu-open padding_right 6
+menu-open padding_top 3
+menu-open padding_bottom 3
+
+menu.options background select.options.png
+menu.option background select.option.normal.png
+menu.option:hover background select.option.hover.png
+menu.option:down background select.option.hover.png
+menu.option padding_left 6
+menu.option padding_right 6
+menu.option padding_top 1
+menu.option padding_bottom 1
+menu.option.label font Vera.ttf 16
+menu.option.label color #000000
+menu.options padding_left 1
+menu.options padding_right 1
+menu.options padding_top 1
+menu.options padding_bottom 1
+menu arrow select.arrow.tga
+
+
+scrollarea.content background #ffffff
+scrollarea.content padding_left 1
+scrollarea.content padding_right 1
+scrollarea.content padding_top 1
+scrollarea.content padding_bottom 1
+
+
+list.item background list.item.normal.png
+list.item:hover background list.item.down.png
+list.item:down background list.item.down.png
+list.item padding_left 4
+list.item padding_right 4
+list.item padding_top 2
+list.item padding_bottom 2
+list.item margin_bottom 1
+list.item align -1
+list.item.label font Vera.ttf 14
+list.item.label color #000000
+
+list background list.png
+list padding_left 1
+list padding_right 1
+list padding_top 1
+list padding_bottom 1
+list.content background #eeeeee
+list.content padding_left 1
+list.content padding_right 1
+list.content padding_top 1
+list.content padding_bottom 1
+
+filedialog.folder image filebrowser.folder.png
+filedialog.label font Vera.ttf 14
+filedialog.label color #000000
+filedialog.title.label font Vera.ttf 16
+filedialog.title.label color #000000
+filedialog.input font Vera.ttf 14
+filedialog.input background input.normal.png
+filedialog.input color #000000
+filedialog.input:focus background input.focus.png
+filedialog.input padding_left 6
+filedialog.input padding_right 6
+filedialog.input padding_top 3
+filedialog.input padding_bottom 3
+
+dialog.title.label font Vera.ttf 16
+dialog.title.label color #000000
+
+
+progressbar background progressbar.tga
+progressbar bar progressbar.bar.tga
+progressbar width 16
+progressbar height 16
--- /dev/null
+import pygame
+from pygame.locals import *
+pygame.display.init()
+pygame.display.set_mode((80,80),32)
+
+def prep(name):
+ fname = name+".png"
+ img = pygame.image.load(fname)
+ w,h = img.get_width()/2,img.get_height()/2
+
+ out = pygame.Surface((w*3,h*3),SWSURFACE|SRCALPHA,32)
+ out.fill((0,0,0,0))
+ out.blit(img.subsurface(0,0,w,h),(0,0))
+ out.blit(img.subsurface(w,0,w,h),(w*2,0))
+ out.blit(img.subsurface(0,h,w,h),(0,h*2))
+ out.blit(img.subsurface(w,h,w,h),(w*2,h*2))
+ for i in range(0,w):
+ img = out.subsurface((w-1,0,1,h*3)).convert_alpha()
+ out.blit(img,(w+i,0))
+ for i in range(0,h):
+ img = out.subsurface((0,h-1,w*3,1)).convert_alpha()
+ out.blit(img,(0,h+i))
+
+ return out,w,h
+
+todo = [
+ ('button.normal','dot.normal',None,3,3,'789456123'),
+ ('button.hover','dot.hover',None,3,3,'789456123'),
+ ('button.down','dot.down',None,3,3,'789456123'),
+
+ ('checkbox.off.normal','box.normal',None,2,2,'7913'),
+ ('checkbox.on.normal','box.down','check',2,2,'7913'),
+ ('checkbox.off.hover','box.hover',None,2,2,'7913'),
+ ('checkbox.on.hover','box.hover','check',2,2,'7913'),
+
+ ('radio.off.normal','dot.normal',None,2,2,'7913'),
+ ('radio.on.normal','dot.down','radio',2,2,'7913'),
+ ('radio.off.hover','dot.hover',None,2,2,'7913'),
+ ('radio.on.hover','dot.hover','radio',2,2,'7913'),
+
+ ('tool.normal','box.normal',None,3,3,'789456123'),
+ ('tool.hover','box.hover',None,3,3,'789456123'),
+ ('tool.down','box.down',None,3,3,'789456123'),
+
+ ('hslider','idot.normal',None,3,3,'789456123'),
+ ('hslider.bar.normal','dot.normal',None,3,3,'789456123'),
+ ('hslider.bar.hover','dot.hover',None,3,3,'789456123'),
+ ('hslider.left','sbox.normal','left',2,2,'7913'),
+ ('hslider.right','sbox.normal','right',2,2,'7913'),
+
+
+ ('vslider','idot.normal',None,3,3,'789456123'),
+ ('vslider.bar.normal','vdot.normal',None,3,3,'789456123'),
+ ('vslider.bar.hover','vdot.hover',None,3,3,'789456123'),
+ ('vslider.up','vsbox.normal','up',2,2,'7913'),
+ ('vslider.down','vsbox.normal','down',2,2,'7913'),
+
+ ('dialog.close.normal','rdot.hover',None,2,2,'7913'),
+ ('dialog.close.hover','rdot.hover','x',2,2,'7913'),
+ ('dialog.close.down','rdot.down','x',2,2,'7913'),
+
+ ('menu.normal','desktop',None,1,1,'7'),
+ ('menu.hover','box.normal',None,3,3,'789456123'),
+ ('menu.down','box.down',None,3,3,'789456123'),
+
+ ('select.selected.normal','box.normal',None,3,3,'788455122'),
+ ('select.selected.hover','box.hover',None,3,3,'788455122'),
+ ('select.selected.down','box.down',None,3,3,'788455122'),
+
+ ('select.arrow.normal','box.hover',None,3,3,'889556223'),
+ ('select.arrow.hover','box.hover',None,3,3,'889556223'),
+ ('select.arrow.down','box.down',None,3,3,'889556223'),
+
+ ('progressbar','sbox.normal',None,3,3,'789456123'),
+ ('progressbar.bar','box.hover',None,3,3,'789456123'),
+ ]
+
+for fname,img,over,ww,hh,s in todo:
+ print fname
+ img,w,h = prep(img)
+ out = pygame.Surface((ww*w,hh*h),SWSURFACE|SRCALPHA,32)
+ out.fill((0,0,0,0))
+ n = 0
+ for y in range(0,hh):
+ for x in range(0,ww):
+ c = int(s[n])
+ xx,yy = (c-1)%3,2-(c-1)/3
+ out.blit(img.subsurface((xx*w,yy*h,w,h)),(x*w,y*h))
+ n += 1
+ if over != None:
+ over = pygame.image.load(over+".png")
+ out.blit(over,(0,0))
+ pygame.image.save(out,fname+".tga")
+
+
+
+
+
--- /dev/null
+dot and box.xcf:
+
+color -170
+
+.down
+.hover +64 brightness
+.normal, grayscale +127 brightness, +48 contrast
+