Advertisement
here2share

# app_icon2home_screen.py

Jun 3rd, 2015
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # app_icon2home_screen.py -- have not tested this out myself as of yet
  2.  
  3. from appuifw import app,e32
  4. import fgimage
  5. import sysinfo
  6. import applist
  7. import appswitch,graphics
  8. try:
  9.     from geticon import get
  10. except ImportError,e:
  11.     raise ImportError("no module name"+e)
  12.  
  13. w,h=sysinfo.display_pixels()
  14.  
  15. ICON_SIZE=(50,50)
  16. CENTERX=(w/2)-(ICON_SIZE[0]/2)
  17. CENTERY=(h/2)-(ICON_SIZE[1]/2)
  18. im=graphics.Image.new(ICON_SIZE)
  19.  
  20. def onExit():
  21.     lock=false
  22.     app.set_exit()
  23.  
  24. fg=fgimage.FGImage()
  25. lock=1
  26. apps=applist.applist()
  27.  
  28. def getUidFromName(n):
  29.     for uid,name,path in apps:
  30.         if name==n:return uid
  31.  
  32. def getIconFromUid(uid):
  33.     return get(uid,ICON_SIZE)
  34.  
  35. img,mask=getIconFromUid("X-plore")
  36. app.exit_key_handler=onExit
  37. while lock:
  38.     try:im.blit(img,mask=mask)
  39.     except:im.blit(img)
  40.     if appswitch.application_list(1)[0] in [u"Telephone"]:fg.set(CENTERX,CENTERY,im._bitmapapi())
  41.     else:fg.unset()
  42.     e32.ao_sleep(1E-3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement