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 $
23 parser
= argparse
.ArgumentParser()
24 parser
.add_argument("-name", help="title name")
25 parser
.add_argument("file", help="file name")
26 getargs
= parser
.parse_args()
28 if (getargs
.file is not None):
32 if (not os
.path
.exists(getargs
.file) or not os
.path
.isfile(getargs
.file)):
38 pyicon
= pygame
.image
.load("/mnt/utmp/upctest/old_icon.png")
39 pygame
.display
.set_icon(pyicon
)
40 ppmimg
= pygame
.image
.load(getargs
.file)
41 width
, height
= ppmimg
.get_size()
42 screen
= pygame
.display
.set_mode((width
, height
))
43 if (getargs
.name
is not None):
44 pygame
.display
.set_caption("PyXV - " + str(getargs
.name
))
45 if (getargs
.name
is None):
46 pygame
.display
.set_caption("PyXV - " + str(os
.path
.basename(getargs
.file)))
47 pygame
.display
.get_active()
48 pygame
.mouse
.set_visible(0)
50 screen
.blit(ppmimg
, (0, 0))
54 for event
in pygame
.event
.get():
55 if (event
.type == pygame
.QUIT
):
57 if (event
.type == pygame
.KEYDOWN
):
58 if (event
.key
== pygame
.K_t
) or (event
.key
== pygame
.K_w
):
59 pygame
.display
.toggle_fullscreen()
60 if (event
.key
== pygame
.K_i
) or (event
.key
== pygame
.K_m
):
61 pygame
.display
.iconify()
62 if (event
.key
== pygame
.K_ESCAPE
) or (event
.key
== pygame
.K_q
):