File: flush.c

package info (click to toggle)
xslideshow 3.1-7
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 792 kB
  • ctags: 1,375
  • sloc: ansic: 14,006; makefile: 897; sh: 1
file content (84 lines) | stat: -rw-r--r-- 1,698 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
	flush.c - animate flush

	Author:	Susumu Shiohara (shiohara@tpp.epson.co.jp)

		Copyright 1993-1997 by Susumu Shiohara

			All Rights Reserved

*/

#include "xslideshow.h"
#include "animproto.h"

extern void myevent();

void FlushColors()
{
int i,j,k;
dword r,g,b;

	k = gim.subImageList->mapsize;

	/* 383 is adequately number */
	for(j = 383; j > 0; j -= app_data.flushSteps){

		for(i=0;i<k;i++){
			r =(dword)((int)xcolors[i].red   * j / 255); if(r >= 0x10000) r=0xffff;
			g =(dword)((int)xcolors[i].green * j / 255); if(g >= 0x10000) g=0xffff;
			b =(dword)((int)xcolors[i].blue  * j / 255); if(b >= 0x10000) b=0xffff;
			fcolors[i].red	=(word)r;
			fcolors[i].green=(word)g;
			fcolors[i].blue =(word)b;
			fcolors[i].flags=xcolors[i].flags;
			fcolors[i].pixel=xcolors[i].pixel;
		}
		StoreColors(fcolors,gim.subImageList->mapsize);
		myusleep(app_data.flushTicks);
		if(gotSomeAction == True)
			return;
	}

}

#if defined(__STDC__) || defined(__cplusplus)
ActionStatus xflushshow(char *fname)	/* Flush in,Flush out */
#else
ActionStatus xflushshow(fname)
char *fname;
#endif
{
int i;

	PreDisplay();

	if(app_data.showFileName)
		createFileNameWindow(fname);

	ShowImage(	(windowWidth - gim.subImageList->width) / 2,
				(windowHeight - gim.subImageList->height) / 2,
				gim.subImageList->width, gim.subImageList->height);

	if(app_data.showFileName)
		raiseFileNameWindow();

	for(i = 0; i < app_data.flushCount; i++)
		FlushColors(False);

	if(app_data.showFileName)
		removeFileNameWindow();

	return(mynowait());
}

#if defined(__STDC__) || defined(__cplusplus)
void postxflushshow(char *fname) 
#else
void postxflushshow(fname) 
char *fname;
#endif
{
	/* No post action */ ;
}