3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2011-2013 Cool Dude 2k - http://idb.berlios.de/
12 Copyright 2011-2013 Game Maker 2k - http://intdb.sourceforge.net/
13 Copyright 2011-2013 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
15 $FileInfo: xv-alt.py - Last Update: 04/01/2013 Ver. 1.0.0 - Author: cooldude2k $
22 parser
= argparse
.ArgumentParser()
23 parser
.add_argument("-name", help="title name")
24 parser
.add_argument("file", help="file name")
25 getargs
= parser
.parse_args()
27 if(getargs
.file != None):
31 if(not os
.path
.exists(getargs
.file) or not os
.path
.isfile(getargs
.file)):
37 pyicon
= pygame
.image
.load("/mnt/utmp/upctest/old_icon.png")
38 pygame
.display
.set_icon(pyicon
)
39 ppmimg
= pygame
.image
.load(getargs
.file)
40 width
, height
= ppmimg
.get_size()
41 screen
= pygame
.display
.set_mode((width
, height
))
42 if(getargs
.name
!= None):
43 pygame
.display
.set_caption("PyXV - "+str(getargs
.name
))
44 if(getargs
.name
== None):
45 pygame
.display
.set_caption("PyXV - "+str(os
.path
.basename(getargs
.file)))
46 pygame
.display
.get_active()
47 pygame
.mouse
.set_visible(0)
49 screen
.blit(ppmimg
, (0, 0))
53 for event
in pygame
.event
.get():
54 if (event
.type == pygame
.QUIT
):
56 if (event
.type == pygame
.KEYDOWN
):
57 if (event
.key
== pygame
.K_t
) or (event
.key
== pygame
.K_w
):
58 pygame
.display
.toggle_fullscreen()
59 if (event
.key
== pygame
.K_i
) or (event
.key
== pygame
.K_m
):
60 pygame
.display
.iconify()
61 if (event
.key
== pygame
.K_ESCAPE
) or (event
.key
== pygame
.K_q
):