mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
xzoom: fix patch's whitespace
This commit is contained in:
parent
48268981bb
commit
2f2bda71bb
1 changed files with 110 additions and 111 deletions
|
@ -1,21 +1,21 @@
|
||||||
--- xzoom-0.3.orig/Imakefile
|
--- xzoom-0.3.orig/Imakefile
|
||||||
+++ xzoom-0.3/Imakefile
|
+++ xzoom-0.3/Imakefile
|
||||||
@@ -15,11 +15,11 @@
|
@@ -15,11 +15,11 @@ XCOMM DEFINES = -DFRAME -DXSHM -DTIMER -
|
||||||
|
|
||||||
DEFINES = -DFRAME -DXSHM
|
DEFINES = -DFRAME -DXSHM
|
||||||
|
|
||||||
-LOCAL_LIBRARIES = -lXext -lX11
|
-LOCAL_LIBRARIES = -lXext -lX11
|
||||||
+LOCAL_LIBRARIES = -lXext -lX11 -lXt
|
+LOCAL_LIBRARIES = -lXext -lX11 -lXt
|
||||||
|
|
||||||
NAME = xzoom
|
NAME = xzoom
|
||||||
|
|
||||||
-BINDIR = /usr/local/bin
|
-BINDIR = /usr/local/bin
|
||||||
-MANPATH = /usr/local/man
|
-MANPATH = /usr/local/man
|
||||||
+BINDIR = /usr/bin
|
+BINDIR = /usr/bin
|
||||||
+MANPATH = /usr/share/man
|
+MANPATH = /usr/share/man
|
||||||
|
|
||||||
SimpleProgramTarget($(NAME))
|
SimpleProgramTarget($(NAME))
|
||||||
--- xzoom-0.3.orig/scale.h
|
--- /dev/null
|
||||||
+++ xzoom-0.3/scale.h
|
+++ xzoom-0.3/scale.h
|
||||||
@@ -0,0 +1,102 @@
|
@@ -0,0 +1,102 @@
|
||||||
+/* scale image from SRC to DST - parameterized by type T */
|
+/* scale image from SRC to DST - parameterized by type T */
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
+++ xzoom-0.3/xzoom.c
|
+++ xzoom-0.3/xzoom.c
|
||||||
@@ -12,13 +12,22 @@
|
@@ -12,13 +12,22 @@
|
||||||
exact location where the source code can be obtained.
|
exact location where the source code can be obtained.
|
||||||
|
|
||||||
Changelist:
|
Changelist:
|
||||||
-Author Description
|
-Author Description
|
||||||
------- -----------
|
------- -----------
|
||||||
|
@ -150,130 +150,130 @@
|
||||||
+tony mancill 2002/02/13 <tmancill@debian.org>
|
+tony mancill 2002/02/13 <tmancill@debian.org>
|
||||||
+ hacked in support for WM_DELETE_WINDOW
|
+ hacked in support for WM_DELETE_WINDOW
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -48,6 +57,9 @@
|
@@ -48,6 +57,9 @@ Itai Nahshon Version 0.2, Apr. 17 199
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
Screen *scr;
|
Screen *scr;
|
||||||
Window win;
|
Window win;
|
||||||
+Atom wm_delete_window;
|
+Atom wm_delete_window;
|
||||||
+Atom wm_protocols;
|
+Atom wm_protocols;
|
||||||
+Status status;
|
+Status status;
|
||||||
|
|
||||||
GC gc;
|
GC gc;
|
||||||
#ifdef FRAME
|
#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 xzoom_flag = False; /* next mag change only to magx */
|
||||||
int yzoom_flag = False; /* next mag change only to magy */
|
int yzoom_flag = False; /* next mag change only to magy */
|
||||||
|
|
||||||
+int gridx = False;
|
+int gridx = False;
|
||||||
+int gridy = False;
|
+int gridy = False;
|
||||||
+
|
+
|
||||||
int width[2] = { 0, WIDTH };
|
int width[2] = { 0, WIDTH };
|
||||||
int height[2] = { 0, HEIGHT };
|
int height[2] = { 0, HEIGHT };
|
||||||
+unsigned depth = 0;
|
+unsigned depth = 0;
|
||||||
|
|
||||||
#ifdef XSHM
|
#ifdef XSHM
|
||||||
XShmSegmentInfo shminfo[2]; /* Segment info. */
|
XShmSegmentInfo shminfo[2]; /* Segment info. */
|
||||||
@@ -106,6 +122,7 @@
|
@@ -106,6 +122,7 @@ int delay = 200000; /* 0.2 second betw
|
||||||
void
|
void
|
||||||
timeout_func(int signum) {
|
timeout_func(int signum) {
|
||||||
set_title = True;
|
set_title = True;
|
||||||
+ signum = signum; /* UNUSED */
|
+ signum = signum; /* UNUSED */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FRAME
|
#ifdef FRAME
|
||||||
@@ -116,9 +133,6 @@
|
@@ -116,9 +133,6 @@ timeout_func(int signum) {
|
||||||
void
|
void
|
||||||
allocate_images(void) {
|
allocate_images(void) {
|
||||||
int i;
|
int i;
|
||||||
-#ifndef XSHM
|
-#ifndef XSHM
|
||||||
- char *data;
|
- char *data;
|
||||||
-#endif
|
-#endif
|
||||||
|
|
||||||
for(i = 0; i < 2; i++) {
|
for(i = 0; i < 2; i++) {
|
||||||
|
|
||||||
@@ -137,7 +151,7 @@
|
@@ -137,7 +151,7 @@ allocate_images(void) {
|
||||||
shminfo[i].shmid = shmget(IPC_PRIVATE,
|
shminfo[i].shmid = shmget(IPC_PRIVATE,
|
||||||
(unsigned int)(ximage[i]->bytes_per_line * ximage[i]->height),
|
(unsigned int)(ximage[i]->bytes_per_line * ximage[i]->height),
|
||||||
IPC_CREAT | 0777);
|
IPC_CREAT | 0777);
|
||||||
-
|
-
|
||||||
+
|
+
|
||||||
if(shminfo[i].shmid < 0) {
|
if(shminfo[i].shmid < 0) {
|
||||||
perror("shmget");
|
perror("shmget");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@@ -163,20 +177,21 @@
|
@@ -163,20 +177,21 @@ allocate_images(void) {
|
||||||
|
|
||||||
shmctl(shminfo[i].shmid, IPC_RMID, 0);
|
shmctl(shminfo[i].shmid, IPC_RMID, 0);
|
||||||
#else
|
#else
|
||||||
- data = malloc(width[i] * height[i]);
|
- data = malloc(width[i] * height[i]);
|
||||||
+ char *data;
|
+ char *data;
|
||||||
+ data = malloc(BitmapUnit(dpy) / 8 * width[i] * height[i]);
|
+ data = malloc(BitmapUnit(dpy) / 8 * width[i] * height[i]);
|
||||||
|
|
||||||
ximage[i] = XCreateImage(dpy,
|
ximage[i] = XCreateImage(dpy,
|
||||||
DefaultVisualOfScreen(scr),
|
DefaultVisualOfScreen(scr),
|
||||||
DefaultDepthOfScreen(scr),
|
DefaultDepthOfScreen(scr),
|
||||||
ZPixmap, 0, data,
|
ZPixmap, 0, data,
|
||||||
- width[i], height[i], 8, width[i]);
|
- width[i], height[i], 8, width[i]);
|
||||||
+ width[i], height[i], 32, 0);
|
+ width[i], height[i], 32, 0);
|
||||||
|
|
||||||
if(ximage[i] == NULL) {
|
if(ximage[i] == NULL) {
|
||||||
perror("XCreateImage");
|
perror("XCreateImage");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
-#endif XSHM
|
-#endif XSHM
|
||||||
+#endif /* XSHM */
|
+#endif /* XSHM */
|
||||||
}
|
}
|
||||||
created_images = True;
|
created_images = True;
|
||||||
}
|
}
|
||||||
@@ -185,6 +200,9 @@
|
@@ -185,6 +200,9 @@ void
|
||||||
destroy_images(void) {
|
destroy_images(void) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
+ if (!created_images)
|
+ if (!created_images)
|
||||||
+ return;
|
+ return;
|
||||||
+
|
+
|
||||||
for(i = 0; i < 2; i++) {
|
for(i = 0; i < 2; i++) {
|
||||||
#ifdef XSHM
|
#ifdef XSHM
|
||||||
XShmDetach(dpy, &shminfo[i]); /* ask X11 to detach shared segment */
|
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 */
|
ximage[i]->data = NULL; /* remove refrence to that address */
|
||||||
XDestroyImage(ximage[i]); /* and destroy image */
|
XDestroyImage(ximage[i]); /* and destroy image */
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ created_images = False;
|
+ created_images = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -230,8 +250,7 @@
|
@@ -230,8 +250,7 @@ Usage(void) {
|
||||||
void
|
void
|
||||||
resize(int new_width, int new_height) {
|
resize(int new_width, int new_height) {
|
||||||
|
|
||||||
- if(created_images)
|
- if(created_images)
|
||||||
- destroy_images(); /* we can get rid of these */
|
- destroy_images(); /* we can get rid of these */
|
||||||
+ destroy_images(); /* we can get rid of these */
|
+ destroy_images(); /* we can get rid of these */
|
||||||
|
|
||||||
/* find new dimensions for source */
|
/* 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;
|
height[SRC] = (new_height+magy-1) / magy;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ if(width[SRC] < 1)
|
+ if(width[SRC] < 1)
|
||||||
+ width[SRC] = 1;
|
+ width[SRC] = 1;
|
||||||
if(width[SRC] > WidthOfScreen(scr))
|
if(width[SRC] > WidthOfScreen(scr))
|
||||||
width[SRC] = WidthOfScreen(scr);
|
width[SRC] = WidthOfScreen(scr);
|
||||||
|
|
||||||
+ if(height[SRC] < 1)
|
+ if(height[SRC] < 1)
|
||||||
+ height[SRC] = 1;
|
+ height[SRC] = 1;
|
||||||
if(height[SRC] > HeightOfScreen(scr))
|
if(height[SRC] > HeightOfScreen(scr))
|
||||||
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;
|
height[DST] = new_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
+
|
+
|
||||||
+void scale8(void)
|
+void scale8(void)
|
||||||
+{
|
+{
|
||||||
|
@ -308,39 +308,39 @@
|
||||||
XEvent event;
|
XEvent event;
|
||||||
int buttonpressed = False;
|
int buttonpressed = False;
|
||||||
int unmapped = True;
|
int unmapped = True;
|
||||||
@@ -286,8 +331,9 @@
|
@@ -286,8 +331,9 @@ main(int argc, char **argv) {
|
||||||
int source_geom_mask = NoValue,
|
int source_geom_mask = NoValue,
|
||||||
dest_geom_mask = NoValue,
|
dest_geom_mask = NoValue,
|
||||||
copy_from_src_mask;
|
copy_from_src_mask;
|
||||||
- int xpos = 0, ypos = 0;
|
- int xpos = 0, ypos = 0;
|
||||||
+ int xpos = 0, ypos = 0;
|
+ int xpos = 0, ypos = 0;
|
||||||
|
|
||||||
+ atexit(destroy_images);
|
+ atexit(destroy_images);
|
||||||
progname = strrchr(argv[0], '/');
|
progname = strrchr(argv[0], '/');
|
||||||
if(progname)
|
if(progname)
|
||||||
++progname;
|
++progname;
|
||||||
@@ -312,7 +358,7 @@
|
@@ -312,7 +358,7 @@ main(int argc, char **argv) {
|
||||||
|
|
||||||
if(magx <= 0)
|
if(magx <= 0)
|
||||||
Usage();
|
Usage();
|
||||||
-
|
-
|
||||||
+
|
+
|
||||||
|
|
||||||
magy = argc > 1 ? atoi(argv[1]) : -1;
|
magy = argc > 1 ? atoi(argv[1]) : -1;
|
||||||
|
|
||||||
@@ -340,7 +386,7 @@
|
@@ -340,7 +386,7 @@ main(int argc, char **argv) {
|
||||||
flipxy = True;
|
flipxy = True;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
-
|
-
|
||||||
+
|
+
|
||||||
if(!strcmp(argv[0], "-source")) {
|
if(!strcmp(argv[0], "-source")) {
|
||||||
++argv; --argc;
|
++argv; --argc;
|
||||||
|
|
||||||
@@ -438,23 +484,24 @@
|
@@ -438,23 +484,24 @@ main(int argc, char **argv) {
|
||||||
|
|
||||||
scr = DefaultScreenOfDisplay(dpy);
|
scr = DefaultScreenOfDisplay(dpy);
|
||||||
|
|
||||||
- if(DefaultDepthOfScreen(scr) != 8) {
|
- if(DefaultDepthOfScreen(scr) != 8) {
|
||||||
- fprintf(stderr, "%s: can work only with 8 bits/pixel\n", progname);
|
- fprintf(stderr, "%s: can work only with 8 bits/pixel\n", progname);
|
||||||
+ depth = DefaultDepthOfScreen(scr);
|
+ depth = DefaultDepthOfScreen(scr);
|
||||||
|
@ -348,47 +348,47 @@
|
||||||
+ fprintf(stderr, "%s: need at least 8 bits/pixel\n", progname);
|
+ fprintf(stderr, "%s: need at least 8 bits/pixel\n", progname);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(source_geom_mask & XNegative)
|
if(source_geom_mask & XNegative)
|
||||||
xgrab += WidthOfScreen(scr);
|
xgrab += WidthOfScreen(scr);
|
||||||
-
|
-
|
||||||
+
|
+
|
||||||
if(source_geom_mask & YNegative)
|
if(source_geom_mask & YNegative)
|
||||||
ygrab += HeightOfScreen(scr);
|
ygrab += HeightOfScreen(scr);
|
||||||
|
|
||||||
if(dest_geom_mask & XNegative)
|
if(dest_geom_mask & XNegative)
|
||||||
xpos += WidthOfScreen(scr);
|
xpos += WidthOfScreen(scr);
|
||||||
-
|
-
|
||||||
+
|
+
|
||||||
if(source_geom_mask & YNegative)
|
if(source_geom_mask & YNegative)
|
||||||
ypos += HeightOfScreen(scr);
|
ypos += HeightOfScreen(scr);
|
||||||
-
|
-
|
||||||
+
|
+
|
||||||
/* printf("=%dx%d+%d+%d\n", width[DST], height[DST], xpos, ypos); */
|
/* printf("=%dx%d+%d+%d\n", width[DST], height[DST], xpos, ypos); */
|
||||||
|
|
||||||
xswa.event_mask = ButtonPressMask|ButtonReleaseMask|ButtonMotionMask;
|
xswa.event_mask = ButtonPressMask|ButtonReleaseMask|ButtonMotionMask;
|
||||||
@@ -463,24 +510,33 @@
|
@@ -463,24 +510,33 @@ main(int argc, char **argv) {
|
||||||
xswa.background_pixel = BlackPixelOfScreen(scr);
|
xswa.background_pixel = BlackPixelOfScreen(scr);
|
||||||
|
|
||||||
win = XCreateWindow(dpy, RootWindowOfScreen(scr),
|
win = XCreateWindow(dpy, RootWindowOfScreen(scr),
|
||||||
- xpos, ypos, width[DST], height[DST], 0,
|
- xpos, ypos, width[DST], height[DST], 0,
|
||||||
+ xpos, ypos, width[DST], height[DST], 0,
|
+ xpos, ypos, width[DST], height[DST], 0,
|
||||||
DefaultDepthOfScreen(scr), InputOutput,
|
DefaultDepthOfScreen(scr), InputOutput,
|
||||||
DefaultVisualOfScreen(scr),
|
DefaultVisualOfScreen(scr),
|
||||||
CWEventMask | CWBackPixel, &xswa);
|
CWEventMask | CWBackPixel, &xswa);
|
||||||
|
|
||||||
- XChangeProperty(dpy, win, XA_WM_ICON_NAME, XA_STRING, 8,
|
- XChangeProperty(dpy, win, XA_WM_ICON_NAME, XA_STRING, 8,
|
||||||
+ XChangeProperty(dpy, win, XA_WM_ICON_NAME, XA_STRING, 8,
|
+ XChangeProperty(dpy, win, XA_WM_ICON_NAME, XA_STRING, 8,
|
||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char *)progname, strlen(progname));
|
(unsigned char *)progname, strlen(progname));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
- XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
||||||
+ XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
+ XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char *)progname, strlen(progname));
|
(unsigned char *)progname, strlen(progname));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
+
|
+
|
||||||
+ /*** 20020213
|
+ /*** 20020213
|
||||||
+ code added by <tmancill@debian.org> to handle
|
+ code added by <tmancill@debian.org> to handle
|
||||||
|
@ -399,33 +399,32 @@
|
||||||
+ status = XSetWMProtocols(dpy, win, &wm_delete_window, 1);
|
+ status = XSetWMProtocols(dpy, win, &wm_delete_window, 1);
|
||||||
+
|
+
|
||||||
set_title = True;
|
set_title = True;
|
||||||
|
|
||||||
- XMapWindow(dpy, win);
|
- XMapWindow(dpy, win);
|
||||||
+ status = XMapWindow(dpy, win);
|
+ status = XMapWindow(dpy, win);
|
||||||
|
|
||||||
gcv.plane_mask = AllPlanes;
|
gcv.plane_mask = AllPlanes;
|
||||||
gcv.subwindow_mode = IncludeInferiors;
|
gcv.subwindow_mode = IncludeInferiors;
|
||||||
@@ -512,7 +568,7 @@
|
@@ -512,7 +568,7 @@ main(int argc, char **argv) {
|
||||||
{
|
{
|
||||||
static char bitmap_data[] = { 0 };
|
static char bitmap_data[] = { 0 };
|
||||||
static XColor col = { 0 };
|
static XColor col = { 0 };
|
||||||
- Pixmap curs = XCreatePixmapFromBitmapData(dpy,
|
- Pixmap curs = XCreatePixmapFromBitmapData(dpy,
|
||||||
+ Pixmap curs = XCreatePixmapFromBitmapData(dpy,
|
+ Pixmap curs = XCreatePixmapFromBitmapData(dpy,
|
||||||
RootWindowOfScreen(scr), bitmap_data, 1, 1, 0, 0, 1);
|
RootWindowOfScreen(scr), bitmap_data, 1, 1, 0, 0, 1);
|
||||||
|
|
||||||
when_button = XCreatePixmapCursor(dpy, curs, curs, &col, &col, 0, 0);
|
when_button = XCreatePixmapCursor(dpy, curs, curs, &col, &col, 0, 0);
|
||||||
@@ -526,11 +582,22 @@
|
@@ -526,11 +582,22 @@ main(int argc, char **argv) {
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
|
||||||
+ /*****
|
+ /*****
|
||||||
+ old event loop updated to support WM messages
|
+ old event loop updated to support WM messages
|
||||||
while(unmapped?
|
while(unmapped?
|
||||||
(XWindowEvent(dpy, win, (long)-1, &event), 1):
|
(XWindowEvent(dpy, win, (long)-1, &event), 1):
|
||||||
XCheckWindowEvent(dpy, win, (long)-1, &event)) {
|
XCheckWindowEvent(dpy, win, (long)-1, &event)) {
|
||||||
-
|
|
||||||
+ ******/
|
+ ******/
|
||||||
+
|
|
||||||
+ while(XPending(dpy)) {
|
+ while(XPending(dpy)) {
|
||||||
+ XNextEvent(dpy, &event);
|
+ XNextEvent(dpy, &event);
|
||||||
switch(event.type) {
|
switch(event.type) {
|
||||||
|
@ -438,58 +437,58 @@
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
if(event.xconfigure.width != width[DST] ||
|
if(event.xconfigure.width != width[DST] ||
|
||||||
event.xconfigure.height != height[DST]) {
|
event.xconfigure.height != height[DST]) {
|
||||||
@@ -567,6 +634,7 @@
|
@@ -567,6 +634,7 @@ main(int argc, char **argv) {
|
||||||
|
|
||||||
case '+':
|
case '+':
|
||||||
case '=':
|
case '=':
|
||||||
+ case XK_KP_Add:
|
+ case XK_KP_Add:
|
||||||
if(!yzoom_flag) ++magx;
|
if(!yzoom_flag) ++magx;
|
||||||
if(!xzoom_flag) ++magy;
|
if(!xzoom_flag) ++magy;
|
||||||
xzoom_flag = yzoom_flag = False;
|
xzoom_flag = yzoom_flag = False;
|
||||||
@@ -575,6 +643,7 @@
|
@@ -575,6 +643,7 @@ main(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
+ case XK_KP_Subtract:
|
+ case XK_KP_Subtract:
|
||||||
if(!yzoom_flag) --magx;
|
if(!yzoom_flag) --magx;
|
||||||
if(!xzoom_flag) --magy;
|
if(!xzoom_flag) --magy;
|
||||||
xzoom_flag = yzoom_flag = False;
|
xzoom_flag = yzoom_flag = False;
|
||||||
@@ -585,6 +654,7 @@
|
@@ -585,6 +654,7 @@ main(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XK_Left:
|
case XK_Left:
|
||||||
+ case XK_KP_Left:
|
+ case XK_KP_Left:
|
||||||
if(flipxy)
|
if(flipxy)
|
||||||
if(flipx)
|
if(flipx)
|
||||||
ygrab += scroll;
|
ygrab += scroll;
|
||||||
@@ -598,6 +668,7 @@
|
@@ -598,6 +668,7 @@ main(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XK_Right:
|
case XK_Right:
|
||||||
+ case XK_KP_Right:
|
+ case XK_KP_Right:
|
||||||
if(flipxy)
|
if(flipxy)
|
||||||
if(flipx)
|
if(flipx)
|
||||||
ygrab -= scroll;
|
ygrab -= scroll;
|
||||||
@@ -611,6 +682,7 @@
|
@@ -611,6 +682,7 @@ main(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XK_Up:
|
case XK_Up:
|
||||||
+ case XK_KP_Up:
|
+ case XK_KP_Up:
|
||||||
if(flipxy)
|
if(flipxy)
|
||||||
if(flipy)
|
if(flipy)
|
||||||
xgrab -= scroll;
|
xgrab -= scroll;
|
||||||
@@ -624,6 +696,7 @@
|
@@ -624,6 +696,7 @@ main(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XK_Down:
|
case XK_Down:
|
||||||
+ case XK_KP_Down:
|
+ case XK_KP_Down:
|
||||||
if(flipxy)
|
if(flipxy)
|
||||||
if(flipy)
|
if(flipy)
|
||||||
xgrab += scroll;
|
xgrab += scroll;
|
||||||
@@ -666,12 +739,17 @@
|
@@ -666,12 +739,17 @@ main(int argc, char **argv) {
|
||||||
xzoom_flag = False;
|
xzoom_flag = False;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
+ case 'g':
|
+ case 'g':
|
||||||
+ gridx = !gridx;
|
+ gridx = !gridx;
|
||||||
+ gridy = !gridy;
|
+ gridy = !gridy;
|
||||||
|
@ -500,31 +499,31 @@
|
||||||
delay_index = 0;
|
delay_index = 0;
|
||||||
delay = delays[delay_index];
|
delay = delays[delay_index];
|
||||||
sprintf(title, "delay = %d ms", delay/1000);
|
sprintf(title, "delay = %d ms", delay/1000);
|
||||||
- XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
- XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
||||||
+ XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
+ XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char *)title, strlen(title));
|
(unsigned char *)title, strlen(title));
|
||||||
signal(SIGALRM, timeout_func);
|
signal(SIGALRM, timeout_func);
|
||||||
@@ -717,6 +795,7 @@
|
@@ -717,6 +795,7 @@ main(int argc, char **argv) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
+
|
+
|
||||||
}
|
}
|
||||||
|
|
||||||
/* trying XShmGetImage when part of the rect is
|
/* 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])
|
if(ygrab > HeightOfScreen(scr)-height[SRC])
|
||||||
ygrab = HeightOfScreen(scr)-height[SRC];
|
ygrab = HeightOfScreen(scr)-height[SRC];
|
||||||
+
|
+
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XSHM
|
#ifdef XSHM
|
||||||
@@ -753,63 +833,12 @@
|
@@ -753,63 +833,12 @@ main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
- /* copy scaled lines from src to dst */
|
- /* copy scaled lines from src to dst */
|
||||||
- for(j = flipxy?width[SRC]:height[SRC]; --j >= 0; ) {
|
- for(j = flipxy?width[SRC]:height[SRC]; --j >= 0; ) {
|
||||||
- /* p1 point to begining of scanline j*magy in DST */
|
- /* p1 point to begining of scanline j*magy in DST */
|
||||||
|
@ -549,7 +548,7 @@
|
||||||
- p2 += p2step;
|
- p2 += p2step;
|
||||||
- for(k = magx; --k > 0; )
|
- for(k = magx; --k > 0; )
|
||||||
- *p1++ = c;
|
- *p1++ = c;
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
- else if(flipx) {
|
- else if(flipx) {
|
||||||
- p2 += width[SRC];
|
- p2 += width[SRC];
|
||||||
|
@ -557,14 +556,14 @@
|
||||||
- c = *p1++ = *--p2;
|
- c = *p1++ = *--p2;
|
||||||
- for(k = magx; --k > 0; )
|
- for(k = magx; --k > 0; )
|
||||||
- *p1++ = c;
|
- *p1++ = c;
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
- else {
|
- else {
|
||||||
- for(i = width[SRC]; --i >= 0;) {
|
- for(i = width[SRC]; --i >= 0;) {
|
||||||
- c = *p1++ = *p2++;
|
- c = *p1++ = *p2++;
|
||||||
- for(k = magx; --k > 0; )
|
- for(k = magx; --k > 0; )
|
||||||
- *p1++ = c;
|
- *p1++ = c;
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- /* p1 point to begining of scanline j*magy in DST */
|
- /* p1 point to begining of scanline j*magy in DST */
|
||||||
|
@ -588,14 +587,14 @@
|
||||||
+ scale16();
|
+ scale16();
|
||||||
+ else if (depth <= 8*sizeof(int))
|
+ else if (depth <= 8*sizeof(int))
|
||||||
+ scale32();
|
+ scale32();
|
||||||
|
|
||||||
#ifdef XSHM
|
#ifdef XSHM
|
||||||
XShmPutImage(dpy, win, gc, ximage[DST], 0, 0, 0, 0, width[DST], height[DST], False);
|
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,
|
flipx?"-":"", magx,
|
||||||
flipxy?" <=>":";",
|
flipxy?" <=>":";",
|
||||||
flipy?"-":"", magy);
|
flipy?"-":"", magy);
|
||||||
- XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
- XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
||||||
+ XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
+ XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
|
||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char *)title, strlen(title));
|
(unsigned char *)title, strlen(title));
|
||||||
|
@ -609,12 +608,12 @@
|
||||||
-.TH XZOOM 1X
|
-.TH XZOOM 1X
|
||||||
+.TH XZOOM 1x
|
+.TH XZOOM 1x
|
||||||
.SH NAME
|
.SH NAME
|
||||||
-xzoom \-
|
-xzoom \-
|
||||||
+xzoom \- magnify part of the screen, with fast updates
|
+xzoom \- magnify part of the screen, with fast updates
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B xzoom
|
.B xzoom
|
||||||
[ \-display \fIdisplayname\fP ] [ \-mag \fImag\fP [ \fImag\fP ] ]
|
[ \-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
|
.TP 5
|
||||||
.B \-mag \fImag\fP [ \fImag\fP ]
|
.B \-mag \fImag\fP [ \fImag\fP ]
|
||||||
What magnification to use. If two number arguments are supplied the
|
What magnification to use. If two number arguments are supplied the
|
||||||
|
@ -623,8 +622,8 @@
|
||||||
Magnification should be greater than 0.
|
Magnification should be greater than 0.
|
||||||
.TP 5
|
.TP 5
|
||||||
.B \-x
|
.B \-x
|
||||||
@@ -85,6 +85,9 @@
|
@@ -85,6 +85,9 @@ key is pressed the zoomed area will scro
|
||||||
sets the delay between frame updates.
|
sets the delay between frame updates.
|
||||||
Built-in delays are 200, 100, 50, 10 and 0 ms.
|
Built-in delays are 200, 100, 50, 10 and 0 ms.
|
||||||
.TP 5
|
.TP 5
|
||||||
+.B g
|
+.B g
|
||||||
|
@ -633,7 +632,7 @@
|
||||||
.B Mouse buttons
|
.B Mouse buttons
|
||||||
To set the location of the magnified are click the left mouse
|
To set the location of the magnified are click the left mouse
|
||||||
button inside xzoom's window and then move it (keep the button
|
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.
|
display is not on the local host.
|
||||||
.LP 5
|
.LP 5
|
||||||
\(dg
|
\(dg
|
||||||
|
|
Loading…
Add table
Reference in a new issue