aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--XWindow.c41
-rw-r--r--lcd4linux.c8
2 files changed, 30 insertions, 19 deletions
diff --git a/XWindow.c b/XWindow.c
index d0bfa0d..3be7f30 100644
--- a/XWindow.c
+++ b/XWindow.c
@@ -1,4 +1,4 @@
-/* $Id: XWindow.c,v 1.12 2000/04/01 19:33:45 herp Exp $
+/* $Id: XWindow.c,v 1.13 2000/04/01 22:40:42 herp Exp $
*
* X11 Driver for LCD4Linux
*
@@ -20,6 +20,10 @@
*
*
* $Log: XWindow.c,v $
+ * Revision 1.13 2000/04/01 22:40:42 herp
+ * geometric correction (too many pixelgaps)
+ * lcd4linux main should return int, not void
+ *
* Revision 1.12 2000/04/01 19:33:45 herp
*
* colors in format \#RRGGBB in config-file now understood
@@ -58,6 +62,7 @@
/*
+ * Sun Apr 2 01:32:48 MET 2000 geometric correction (too many pixelgaps)
* Sat Apr 1 22:18:04 MET 2000 colors in format \#RRGGBB in config-file
* Fri Mar 31 01:42:11 MET 2000 semaphore bug fixed
* Sun Mar 26 15:28:23 MET 2000 various rewrites
@@ -237,10 +242,10 @@ XEvent ev;
rgbhg);
return -1;
}
- boxw=xres*(pixel+pgap)+cgap;
- boxh=yres*(pixel+pgap)+rgap;
- dimx=(cols-1)*cgap+cols*xres*(pixel+pgap);
- dimy=(rows-1)*rgap+rows*yres*(pixel+pgap);
+ boxw=xres*pixel+(xres-1)*pgap+cgap;
+ boxh=yres*pixel+(yres-1)*pgap+rgap;
+ dimx=cols*xres*pixel+cols*(xres-1)*pgap+(cols-1)*cgap;
+ dimy=rows*yres*pixel+rows*(yres-1)*pgap+(rows-1)*rgap;
wa.event_mask=ExposureMask|ButtonPressMask|ButtonReleaseMask;
w=XCreateWindow(dp,rw,0,0,dimx+2*border,dimy+2*border,0,0,
InputOutput,vi,CWEventMask,&wa);
@@ -351,11 +356,11 @@ int x,y;
dirty=1;
}
x+=pixel+pgap;
- if (++jgap==xres) { x+=cgap; jgap=0; }
+ if (++jgap==xres) { x+=cgap-pgap; jgap=0; }
pos++;
}
y+=pixel+pgap;
- if (++igap==yres) { y+=rgap; igap=0; }
+ if (++igap==yres) { y+=rgap-pgap; igap=0; }
}
if (dirty) XFlush(dp);
release_lock();
@@ -393,7 +398,7 @@ int dx,wx,wy;
/* upper left corner */
xfrom=xres*(x/boxw); /*start at col.no*/
i=(x%boxw); /*pixelpos rel. char*/
- if (i>xres*(pixel+pgap)) /*in cgap zone*/
+ if (i>xres*pixel+(xres-1)*pgap) /*in cgap zone*/
xfrom+=xres;
else {
xfrom+=i/(pixel+pgap); /*character element*/
@@ -402,7 +407,7 @@ int dx,wx,wy;
}
yfrom=yres*(y/boxh); /*start at row.no*/
i=(y%boxh); /*pixelpos rel. char*/
- if (i>yres*(pixel+pgap)) /*in rgap zone*/
+ if (i>yres*pixel+(yres-1)*pgap) /*in rgap zone*/
yfrom+=yres;
else {
yfrom+=i/(pixel+pgap); /*character element*/
@@ -412,12 +417,14 @@ int dx,wx,wy;
/*lower right corner*/
x+=width-1;
y+=height-1;
- xto=xres*(x/boxw)+(x%boxw)/(pixel+pgap);
- yto=yres*(y/boxh)+(y%boxh)/(pixel+pgap);
-
+ xto=xres*(x/boxw)+(x%boxw)/(pixel+pgap)
+ -((x%boxw>xres*pixel+(xres-1)*pgap)?1:0);
+ yto=yres*(y/boxh)+(y%boxh)/(pixel+pgap)
+ -((y%boxh>yres*pixel+(yres-1)*pgap)?1:0);
+
pos=yfrom*xres*cols+xfrom;
- wy=border+yfrom*(pixel+pgap)+rgap*(yfrom/yres);
- wx=border+xfrom*(pixel+pgap)+cgap*(xfrom/xres);
+ wy=border+yfrom*(pixel+pgap)+(yfrom/yres)*(rgap-pgap);
+ wx=border+xfrom*(pixel+pgap)+(xfrom/xres)*(cgap-pgap);
wpos=pos; xpix=xres*cols;
igap=yfrom%yres; wjgap=xfrom%xres;
for(i=yfrom;i<=yto;i++) {
@@ -429,10 +436,10 @@ int dx,wx,wy;
dx,wy,
pixel,pixel);
dx+=pixel+pgap;
- if (++jgap==xres) { dx+=cgap; jgap=0; }
+ if (++jgap==xres) { dx+=cgap-pgap; jgap=0; }
}
wy+=pixel+pgap;
- if (++igap==yres) { wy+=rgap; igap=0; }
+ if (++igap==yres) { wy+=rgap-pgap; igap=0; }
pos+=xpix;
wpos=pos;
}
@@ -443,7 +450,7 @@ XEvent ev;
for(;;) {
XWindowEvent(dp,w,
- ExposureMask,
+ ExposureMask|ButtonPressMask|ButtonReleaseMask,
&ev);
if (ev.type==Expose) {
acquire_lock();
diff --git a/lcd4linux.c b/lcd4linux.c
index 88cbf6b..9bbd28f 100644
--- a/lcd4linux.c
+++ b/lcd4linux.c
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux.c,v 1.14 2000/03/26 18:46:28 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.15 2000/04/01 22:40:42 herp Exp $
*
* LCD4Linux
*
@@ -20,6 +20,10 @@
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.15 2000/04/01 22:40:42 herp
+ * geometric correction (too many pixelgaps)
+ * lcd4linux main should return int, not void
+ *
* Revision 1.14 2000/03/26 18:46:28 reinelt
*
* bug in pixmap.c that leaded to empty bars fixed
@@ -107,7 +111,7 @@ static void usage(void)
printf ("usage: lcd4linux [-h] [-l] [-f config-file] [-o output-file]\n");
}
-void main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
char *cfg="/etc/lcd4linux.conf";
char *driver;
am/0%2bgit20151202.3864e0a'>upstream/0+git20151202.3864e0aJonathan McCrohan840-4057/+18230 2015-05-05d/control: various fixes found by libconfig-model-dpkg-perlJonathan McCrohan2-5/+13 2015-04-01Release 0+git20150208.f2053b3-1Jonathan McCrohan1-2/+2 2015-04-01Describe changes made in snapshotJonathan McCrohan1-0/+3 2015-04-01New Upstream Snapshot (commit f2053b3)Jonathan McCrohan1-0/+6 2015-04-01Imported Upstream version 0+git20150208.f2053b3upstream/0+git20150208.f2053b3Jonathan McCrohan32-333/+483 2014-12-28Release 0+git20141218.b46a22c-1debian/0+git20141218.b46a22c-1Jonathan McCrohan1-2/+2 2014-12-28Updated AU DVB-T files; Thanks Brian Burch! (Closes LP: #1393280)Jonathan McCrohan1-0/+1 2014-12-28New Upstream Snapshot (commit b46a22c)Jonathan McCrohan1-0/+6 2014-12-28Imported Upstream version 0+git20141218.b46a22cupstream/0+git20141218.b46a22cJonathan McCrohan535-639/+317 2014-10-20Release 0+git20141009.d26b627-1debian/0+git20141009.d26b627-1Jonathan McCrohan1-2/+2 2014-10-20Fix up packaging to account for move to DVBv5Jonathan McCrohan2-2/+6 2014-10-20delete d/dtv-scan-files.install; Upstream now supplies a MakefileJonathan McCrohan2-4/+1 2014-10-15d/control: update Standards Version to 3.9.6Jonathan McCrohan2-1/+3 2014-10-15d/control: add Build-Depends on dvb-toolsJonathan McCrohan2-1/+2 2014-10-15New Upstream Snapshot (commit d26b627)Jonathan McCrohan1-0/+10 2014-10-15Imported Upstream version 0+git20141009.d26b627upstream/0+git20141009.d26b627Jonathan McCrohan2010-11120/+159271 2014-07-23Release 0+git20140611.14bd6c7-1debian/0+git20140611.14bd6c7-1Jonathan McCrohan1-2/+2 2014-07-23New Upstream Snapshot (commit 14bd6c7)Jonathan McCrohan1-2/+3 2014-07-23Imported Upstream version 0+git20140611.14bd6c7upstream/0+git20140611.14bd6c7Jonathan McCrohan7-11/+60 2014-05-13New Upstream Snapshot (commit 1246b27)Jonathan McCrohan1-0/+6 2014-05-13Imported Upstream version 0+git20140512.1246b27upstream/0+git20140512.1246b27Jonathan McCrohan391-301/+3983 2014-04-05Release 0+git20140326.cfc2975-1debian/0+git20140326.cfc2975-1Jonathan McCrohan1-2/+2 2014-04-05d/control: update Homepage (upstream has moved from Gitweb to cgit)Jonathan McCrohan2-1/+2 2014-04-05New Upstream Snapshot (commit cfc2975)Jonathan McCrohan1-0/+6 2014-04-05Imported Upstream version 0+git20140326.cfc2975upstream/0+git20140326.cfc2975Jonathan McCrohan118-656/+877 2014-01-16Release 0+git20140107.1850cf8-1debian/0+git20140107.1850cf8-1Jonathan McCrohan1-2/+2 2014-01-16Update Standards Version to 3.9.5Jonathan McCrohan2-1/+9 No changes required