xzoom: fix patch's whitespace

This commit is contained in:
Đoàn Trần Công Danh 2022-08-26 23:19:31 +07:00
parent 48268981bb
commit 2f2bda71bb

View file

@ -1,6 +1,6 @@
--- xzoom-0.3.orig/Imakefile
+++ xzoom-0.3/Imakefile
@@ -15,11 +15,11 @@
@@ -15,11 +15,11 @@ XCOMM DEFINES = -DFRAME -DXSHM -DTIMER -
DEFINES = -DFRAME -DXSHM
@ -15,7 +15,7 @@
+MANPATH = /usr/share/man
SimpleProgramTarget($(NAME))
--- xzoom-0.3.orig/scale.h
--- /dev/null
+++ xzoom-0.3/scale.h
@@ -0,0 +1,102 @@
+/* scale image from SRC to DST - parameterized by type T */
@ -152,7 +152,7 @@
*/
#include <stdio.h>
@@ -48,6 +57,9 @@
@@ -48,6 +57,9 @@ Itai Nahshon Version 0.2, Apr. 17 199
Display *dpy;
Screen *scr;
Window win;
@ -162,7 +162,7 @@
GC gc;
#ifdef FRAME
@@ -87,8 +99,12 @@
@@ -87,8 +99,12 @@ int flipy = False; /* flip display ab
int xzoom_flag = False; /* next mag change only to magx */
int yzoom_flag = False; /* next mag change only to magy */
@ -175,7 +175,7 @@
#ifdef XSHM
XShmSegmentInfo shminfo[2]; /* Segment info. */
@@ -106,6 +122,7 @@
@@ -106,6 +122,7 @@ int delay = 200000; /* 0.2 second betw
void
timeout_func(int signum) {
set_title = True;
@ -183,7 +183,7 @@
}
#ifdef FRAME
@@ -116,9 +133,6 @@
@@ -116,9 +133,6 @@ timeout_func(int signum) {
void
allocate_images(void) {
int i;
@ -193,7 +193,7 @@
for(i = 0; i < 2; i++) {
@@ -137,7 +151,7 @@
@@ -137,7 +151,7 @@ allocate_images(void) {
shminfo[i].shmid = shmget(IPC_PRIVATE,
(unsigned int)(ximage[i]->bytes_per_line * ximage[i]->height),
IPC_CREAT | 0777);
@ -202,7 +202,7 @@
if(shminfo[i].shmid < 0) {
perror("shmget");
exit(-1);
@@ -163,20 +177,21 @@
@@ -163,20 +177,21 @@ allocate_images(void) {
shmctl(shminfo[i].shmid, IPC_RMID, 0);
#else
@ -227,7 +227,7 @@
}
created_images = True;
}
@@ -185,6 +200,9 @@
@@ -185,6 +200,9 @@ void
destroy_images(void) {
int i;
@ -237,7 +237,7 @@
for(i = 0; i < 2; i++) {
#ifdef XSHM
XShmDetach(dpy, &shminfo[i]); /* ask X11 to detach shared segment */
@@ -195,6 +213,8 @@
@@ -195,6 +213,8 @@ destroy_images(void) {
ximage[i]->data = NULL; /* remove refrence to that address */
XDestroyImage(ximage[i]); /* and destroy image */
}
@ -246,7 +246,7 @@
}
void
@@ -230,8 +250,7 @@
@@ -230,8 +250,7 @@ Usage(void) {
void
resize(int new_width, int new_height) {
@ -256,7 +256,7 @@
/* find new dimensions for source */
@@ -244,9 +263,13 @@
@@ -244,9 +263,13 @@ resize(int new_width, int new_height) {
height[SRC] = (new_height+magy-1) / magy;
}
@ -270,7 +270,7 @@
if(height[SRC] > HeightOfScreen(scr))
height[SRC] = HeightOfScreen(scr);
@@ -270,12 +293,34 @@
@@ -270,12 +293,34 @@ resize(int new_width, int new_height) {
height[DST] = new_height;
}
@ -308,7 +308,7 @@
XEvent event;
int buttonpressed = False;
int unmapped = True;
@@ -286,8 +331,9 @@
@@ -286,8 +331,9 @@ main(int argc, char **argv) {
int source_geom_mask = NoValue,
dest_geom_mask = NoValue,
copy_from_src_mask;
@ -319,7 +319,7 @@
progname = strrchr(argv[0], '/');
if(progname)
++progname;
@@ -312,7 +358,7 @@
@@ -312,7 +358,7 @@ main(int argc, char **argv) {
if(magx <= 0)
Usage();
@ -328,7 +328,7 @@
magy = argc > 1 ? atoi(argv[1]) : -1;
@@ -340,7 +386,7 @@
@@ -340,7 +386,7 @@ main(int argc, char **argv) {
flipxy = True;
continue;
}
@ -337,7 +337,7 @@
if(!strcmp(argv[0], "-source")) {
++argv; --argc;
@@ -438,23 +484,24 @@
@@ -438,23 +484,24 @@ main(int argc, char **argv) {
scr = DefaultScreenOfDisplay(dpy);
@ -367,7 +367,7 @@
/* printf("=%dx%d+%d+%d\n", width[DST], height[DST], xpos, ypos); */
xswa.event_mask = ButtonPressMask|ButtonReleaseMask|ButtonMotionMask;
@@ -463,24 +510,33 @@
@@ -463,24 +510,33 @@ main(int argc, char **argv) {
xswa.background_pixel = BlackPixelOfScreen(scr);
win = XCreateWindow(dpy, RootWindowOfScreen(scr),
@ -405,7 +405,7 @@
gcv.plane_mask = AllPlanes;
gcv.subwindow_mode = IncludeInferiors;
@@ -512,7 +568,7 @@
@@ -512,7 +568,7 @@ main(int argc, char **argv) {
{
static char bitmap_data[] = { 0 };
static XColor col = { 0 };
@ -414,7 +414,7 @@
RootWindowOfScreen(scr), bitmap_data, 1, 1, 0, 0, 1);
when_button = XCreatePixmapCursor(dpy, curs, curs, &col, &col, 0, 0);
@@ -526,11 +582,22 @@
@@ -526,11 +582,22 @@ main(int argc, char **argv) {
for(;;) {
@ -423,9 +423,8 @@
while(unmapped?
(XWindowEvent(dpy, win, (long)-1, &event), 1):
XCheckWindowEvent(dpy, win, (long)-1, &event)) {
-
+ ******/
+
+ while(XPending(dpy)) {
+ XNextEvent(dpy, &event);
switch(event.type) {
@ -438,7 +437,7 @@
case ConfigureNotify:
if(event.xconfigure.width != width[DST] ||
event.xconfigure.height != height[DST]) {
@@ -567,6 +634,7 @@
@@ -567,6 +634,7 @@ main(int argc, char **argv) {
case '+':
case '=':
@ -446,7 +445,7 @@
if(!yzoom_flag) ++magx;
if(!xzoom_flag) ++magy;
xzoom_flag = yzoom_flag = False;
@@ -575,6 +643,7 @@
@@ -575,6 +643,7 @@ main(int argc, char **argv) {
break;
case '-':
@ -454,7 +453,7 @@
if(!yzoom_flag) --magx;
if(!xzoom_flag) --magy;
xzoom_flag = yzoom_flag = False;
@@ -585,6 +654,7 @@
@@ -585,6 +654,7 @@ main(int argc, char **argv) {
break;
case XK_Left:
@ -462,7 +461,7 @@
if(flipxy)
if(flipx)
ygrab += scroll;
@@ -598,6 +668,7 @@
@@ -598,6 +668,7 @@ main(int argc, char **argv) {
break;
case XK_Right:
@ -470,7 +469,7 @@
if(flipxy)
if(flipx)
ygrab -= scroll;
@@ -611,6 +682,7 @@
@@ -611,6 +682,7 @@ main(int argc, char **argv) {
break;
case XK_Up:
@ -478,7 +477,7 @@
if(flipxy)
if(flipy)
xgrab -= scroll;
@@ -624,6 +696,7 @@
@@ -624,6 +696,7 @@ main(int argc, char **argv) {
break;
case XK_Down:
@ -486,7 +485,7 @@
if(flipxy)
if(flipy)
xgrab += scroll;
@@ -666,12 +739,17 @@
@@ -666,12 +739,17 @@ main(int argc, char **argv) {
xzoom_flag = False;
break;
@ -505,7 +504,7 @@
PropModeReplace,
(unsigned char *)title, strlen(title));
signal(SIGALRM, timeout_func);
@@ -717,6 +795,7 @@
@@ -717,6 +795,7 @@ main(int argc, char **argv) {
#endif
}
break;
@ -513,7 +512,7 @@
}
/* trying XShmGetImage when part of the rect is
@@ -736,6 +815,7 @@
@@ -736,6 +815,7 @@ main(int argc, char **argv) {
if(ygrab > HeightOfScreen(scr)-height[SRC])
ygrab = HeightOfScreen(scr)-height[SRC];
@ -521,7 +520,7 @@
}
#ifdef XSHM
@@ -753,63 +833,12 @@
@@ -753,63 +833,12 @@ main(int argc, char **argv) {
}
#endif
@ -591,7 +590,7 @@
#ifdef XSHM
XShmPutImage(dpy, win, gc, ximage[DST], 0, 0, 0, 0, width[DST], height[DST], False);
@@ -825,7 +854,7 @@
@@ -825,7 +854,7 @@ main(int argc, char **argv) {
flipx?"-":"", magx,
flipxy?" <=>":";",
flipy?"-":"", magy);
@ -614,7 +613,7 @@
.SH SYNOPSIS
.B xzoom
[ \-display \fIdisplayname\fP ] [ \-mag \fImag\fP [ \fImag\fP ] ]
@@ -18,7 +18,7 @@
@@ -18,7 +18,7 @@ The name of the display to use
.TP 5
.B \-mag \fImag\fP [ \fImag\fP ]
What magnification to use. If two number arguments are supplied the
@ -623,7 +622,7 @@
Magnification should be greater than 0.
.TP 5
.B \-x
@@ -85,6 +85,9 @@
@@ -85,6 +85,9 @@ key is pressed the zoomed area will scro
sets the delay between frame updates.
Built-in delays are 200, 100, 50, 10 and 0 ms.
.TP 5
@ -633,7 +632,7 @@
.B Mouse buttons
To set the location of the magnified are click the left mouse
button inside xzoom's window and then move it (keep the button
@@ -147,11 +150,6 @@
@@ -147,11 +150,6 @@ used. Xzoom will fail if it is compiled
display is not on the local host.
.LP 5
\(dg