1 --- xzoom-0.3.orig/Imakefile
2 +++ xzoom-0.3/Imakefile
5 DEFINES = -DFRAME -DXSHM
7 -LOCAL_LIBRARIES = -lXext -lX11
8 +LOCAL_LIBRARIES = -lXext -lX11 -lXt
12 -BINDIR = /usr/local/bin
13 -MANPATH = /usr/local/man
15 +MANPATH = /usr/share/man
17 SimpleProgramTarget($(NAME))
18 --- xzoom-0.3.orig/scale.h
21 +/* scale image from SRC to DST - parameterized by type T */
23 +/* get pixel address of point (x,y) in image t */
24 +#define getP(t,x,y) \
25 + (T *) (&ximage[t]->data[(ximage[t]->xoffset+(x))*sizeof(T) + \
26 + (y)*ximage[t]->bytes_per_line])
31 + /* copy scaled lines from SRC to DST */
32 + j = flipxy ? width[SRC] - 1 : height[SRC] - 1;
39 + /* p1 point to begining of scanline j*magy in DST */
40 + p1 = getP(DST,0,j*magy);
42 + /* p2 point to begining of scanline j in SRC */
43 + /* if flipy then line height[SRC]-1-j */
44 + p2 = getP(SRC,0,flipy ? (height[SRC]-1-j) : j);
48 + p2 = getP(SRC,flipy ? j : (width[SRC]-1-j),0);
49 + p2step = ximage[SRC]->bytes_per_line / sizeof(T);
53 + p2 += p2step * (height[SRC]-1);
59 + T c = *p2; p2 += p2step;
60 + k = magx; do *p1++ = c; while (--k > 0);
69 + k = magx; do *p1++ = c; while (--k > 0);
77 + k = magx; do *p1++ = c; while (--k > 0);
81 + /* draw vertical grid */
82 + if (gridy && magx >= 2)
86 + k = flipxy ? height[SRC] : width[SRC];
93 + /* duplicate that line as needed */
96 + /* p1 point to begining of scanline j*magy in DST */
98 + /* p2 points to begining of next line */
100 + p2step = ximage[DST]->bytes_per_line / sizeof(T);
102 + i = width[DST] * sizeof(T);
109 + /* draw horizontal grid */
110 + if (gridx && magy >= 2)
118 + } while (--j >= 0);
123 --- xzoom-0.3.orig/xzoom.c
124 +++ xzoom-0.3/xzoom.c
126 exact location where the source code can be obtained.
131 -Itai Nahshon Version 0.1, Nov. 21 1995
132 -Itai Nahshon Version 0.2, Apr. 17 1996
133 - include <sys/types.h>
134 - Use memmove() instead of memcopy()
135 - Optional macro to replace call to usleep().
138 +Itai Nahshon Version 0.1, Nov. 21 1995
139 +Itai Nahshon Version 0.2, Apr. 17 1996
140 + include <sys/types.h>
141 + Use memmove() instead of memcopy()
142 + Optional macro to replace call to usleep().
143 +Markus F.X.J. Oberhumer Version 0.4, Feb. 18 1998
144 + split into 2 files (scale.h)
145 + added support for 15, 16, 24 and 32 bpp displays
146 + added a grid (press key 'g')
147 + optimized scaling routines
148 + use memcpy() instead of memmove() ;-)
149 + some other minor changes/fixes
150 +tony mancill 2002/02/13 <tmancill@debian.org>
151 + hacked in support for WM_DELETE_WINDOW
159 +Atom wm_delete_window;
166 int xzoom_flag = False; /* next mag change only to magx */
167 int yzoom_flag = False; /* next mag change only to magy */
172 int width[2] = { 0, WIDTH };
173 int height[2] = { 0, HEIGHT };
177 XShmSegmentInfo shminfo[2]; /* Segment info. */
180 timeout_func(int signum) {
182 + signum = signum; /* UNUSED */
188 allocate_images(void) {
194 for(i = 0; i < 2; i++) {
197 shminfo[i].shmid = shmget(IPC_PRIVATE,
198 (unsigned int)(ximage[i]->bytes_per_line * ximage[i]->height),
202 if(shminfo[i].shmid < 0) {
205 @@ -163,20 +177,21 @@
207 shmctl(shminfo[i].shmid, IPC_RMID, 0);
209 - data = malloc(width[i] * height[i]);
211 + data = malloc(BitmapUnit(dpy) / 8 * width[i] * height[i]);
213 ximage[i] = XCreateImage(dpy,
214 DefaultVisualOfScreen(scr),
215 DefaultDepthOfScreen(scr),
217 - width[i], height[i], 8, width[i]);
218 + width[i], height[i], 32, 0);
220 if(ximage[i] == NULL) {
221 perror("XCreateImage");
228 created_images = True;
231 destroy_images(void) {
234 + if (!created_images)
237 for(i = 0; i < 2; i++) {
239 XShmDetach(dpy, &shminfo[i]); /* ask X11 to detach shared segment */
241 ximage[i]->data = NULL; /* remove refrence to that address */
242 XDestroyImage(ximage[i]); /* and destroy image */
245 + created_images = False;
251 resize(int new_width, int new_height) {
254 - destroy_images(); /* we can get rid of these */
255 + destroy_images(); /* we can get rid of these */
257 /* find new dimensions for source */
260 height[SRC] = (new_height+magy-1) / magy;
265 if(width[SRC] > WidthOfScreen(scr))
266 width[SRC] = WidthOfScreen(scr);
268 + if(height[SRC] < 1)
270 if(height[SRC] > HeightOfScreen(scr))
271 height[SRC] = HeightOfScreen(scr);
273 @@ -270,12 +293,34 @@
274 height[DST] = new_height;
280 +#define T unsigned char
288 +#define T unsigned short
296 +#define T unsigned int
303 main(int argc, char **argv) {
304 XSetWindowAttributes xswa;
309 int buttonpressed = False;
312 int source_geom_mask = NoValue,
313 dest_geom_mask = NoValue,
315 - int xpos = 0, ypos = 0;
316 + int xpos = 0, ypos = 0;
318 + atexit(destroy_images);
319 progname = strrchr(argv[0], '/');
329 magy = argc > 1 ? atoi(argv[1]) : -1;
337 if(!strcmp(argv[0], "-source")) {
340 @@ -438,23 +484,24 @@
342 scr = DefaultScreenOfDisplay(dpy);
344 - if(DefaultDepthOfScreen(scr) != 8) {
345 - fprintf(stderr, "%s: can work only with 8 bits/pixel\n", progname);
346 + depth = DefaultDepthOfScreen(scr);
348 + fprintf(stderr, "%s: need at least 8 bits/pixel\n", progname);
352 if(source_geom_mask & XNegative)
353 xgrab += WidthOfScreen(scr);
356 if(source_geom_mask & YNegative)
357 ygrab += HeightOfScreen(scr);
359 if(dest_geom_mask & XNegative)
360 xpos += WidthOfScreen(scr);
363 if(source_geom_mask & YNegative)
364 ypos += HeightOfScreen(scr);
367 /* printf("=%dx%d+%d+%d\n", width[DST], height[DST], xpos, ypos); */
369 xswa.event_mask = ButtonPressMask|ButtonReleaseMask|ButtonMotionMask;
370 @@ -463,24 +510,33 @@
371 xswa.background_pixel = BlackPixelOfScreen(scr);
373 win = XCreateWindow(dpy, RootWindowOfScreen(scr),
374 - xpos, ypos, width[DST], height[DST], 0,
375 + xpos, ypos, width[DST], height[DST], 0,
376 DefaultDepthOfScreen(scr), InputOutput,
377 DefaultVisualOfScreen(scr),
378 CWEventMask | CWBackPixel, &xswa);
380 - XChangeProperty(dpy, win, XA_WM_ICON_NAME, XA_STRING, 8,
381 + XChangeProperty(dpy, win, XA_WM_ICON_NAME, XA_STRING, 8,
383 (unsigned char *)progname, strlen(progname));
386 - XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
387 + XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
389 (unsigned char *)progname, strlen(progname));
394 + code added by <tmancill@debian.org> to handle
395 + window manager "close" event
397 + wm_delete_window = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
398 + wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False);
399 + status = XSetWMProtocols(dpy, win, &wm_delete_window, 1);
403 - XMapWindow(dpy, win);
404 + status = XMapWindow(dpy, win);
406 gcv.plane_mask = AllPlanes;
407 gcv.subwindow_mode = IncludeInferiors;
410 static char bitmap_data[] = { 0 };
411 static XColor col = { 0 };
412 - Pixmap curs = XCreatePixmapFromBitmapData(dpy,
413 + Pixmap curs = XCreatePixmapFromBitmapData(dpy,
414 RootWindowOfScreen(scr), bitmap_data, 1, 1, 0, 0, 1);
416 when_button = XCreatePixmapCursor(dpy, curs, curs, &col, &col, 0, 0);
417 @@ -526,11 +582,22 @@
422 + old event loop updated to support WM messages
424 (XWindowEvent(dpy, win, (long)-1, &event), 1):
425 XCheckWindowEvent(dpy, win, (long)-1, &event)) {
429 + while(XPending(dpy)) {
430 + XNextEvent(dpy, &event);
432 + case ClientMessage:
433 + if ((event.xclient.message_type == wm_protocols) &&
434 + (event.xclient.data.l[0] == wm_delete_window)) {
438 case ConfigureNotify:
439 if(event.xconfigure.width != width[DST] ||
440 event.xconfigure.height != height[DST]) {
446 if(!yzoom_flag) ++magx;
447 if(!xzoom_flag) ++magy;
448 xzoom_flag = yzoom_flag = False;
453 + case XK_KP_Subtract:
454 if(!yzoom_flag) --magx;
455 if(!xzoom_flag) --magy;
456 xzoom_flag = yzoom_flag = False;
489 @@ -666,12 +739,17 @@
499 if(++delay_index >= NDELAYS)
501 delay = delays[delay_index];
502 sprintf(title, "delay = %d ms", delay/1000);
503 - XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
504 + XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
506 (unsigned char *)title, strlen(title));
507 signal(SIGALRM, timeout_func);
515 /* trying XShmGetImage when part of the rect is
518 if(ygrab > HeightOfScreen(scr)-height[SRC])
519 ygrab = HeightOfScreen(scr)-height[SRC];
524 @@ -753,63 +833,12 @@
528 - /* copy scaled lines from src to dst */
529 - for(j = flipxy?width[SRC]:height[SRC]; --j >= 0; ) {
530 - /* p1 point to begining of scanline j*magy in DST */
531 - p1 = &ximage[DST]->data[ximage[DST]->xoffset +
532 - j*magy*ximage[DST]->bytes_per_line ];
533 - /* p2 point to begining of scanline j in SRC */
534 - /* if flipy then line height[SRC]-1-j */
535 - p2 = &ximage[SRC]->data[ximage[SRC]->xoffset +
536 - (flipy?(height[SRC]-1-j):j)*ximage[SRC]->bytes_per_line ];
539 - int p2step = ximage[SRC]->bytes_per_line;
540 - p2 = &ximage[SRC]->data[ximage[SRC]->xoffset + (flipy?j:(width[SRC]-1-j))];
543 - p2 += p2step * (height[SRC]-1);
547 - for(i = height[SRC]; --i >= 0;) {
550 - for(k = magx; --k > 0; )
556 - for(i = width[SRC]; --i >= 0;) {
558 - for(k = magx; --k > 0; )
563 - for(i = width[SRC]; --i >= 0;) {
565 - for(k = magx; --k > 0; )
570 - /* p1 point to begining of scanline j*magy in DST */
571 - p1 = &ximage[DST]->data[ximage[DST]->xoffset +
572 - j*magy*ximage[DST]->bytes_per_line ];
573 - /* p2 points to begining of next line */
574 - p2 = p1 + ximage[DST]->bytes_per_line;
575 - /* duplicate that line as needed */
576 - for(k = magy; --k > 0; ) {
578 - bcopy(p1, p2, width[DST]);
580 - memmove(p2, p1, width[DST]);
582 - p2 += ximage[DST]->bytes_per_line;
587 + else if (depth <= 8*sizeof(short))
589 + else if (depth <= 8*sizeof(int))
593 XShmPutImage(dpy, win, gc, ximage[DST], 0, 0, 0, 0, width[DST], height[DST], False);
598 - XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
599 + XChangeProperty(dpy, win, XA_WM_NAME, XA_STRING, 8,
601 (unsigned char *)title, strlen(title));
603 --- xzoom-0.3.orig/xzoom.man
604 +++ xzoom-0.3/xzoom.man
607 .\" Copyright Itai Nahshon
613 +xzoom \- magnify part of the screen, with fast updates
616 [ \-display \fIdisplayname\fP ] [ \-mag \fImag\fP [ \fImag\fP ] ]
619 .B \-mag \fImag\fP [ \fImag\fP ]
620 What magnification to use. If two number arguments are supplied the
621 -first is used for X magniications and the second is used for Y magnification.
622 +first is used for X magnifications and the second is used for Y magnification.
623 Magnification should be greater than 0.
627 sets the delay between frame updates.
628 Built-in delays are 200, 100, 50, 10 and 0 ms.
631 +toggle grid on and off.
634 To set the location of the magnified are click the left mouse
635 button inside xzoom's window and then move it (keep the button
637 display is not on the local host.
640 -The Ximage data is accessed directly, in a way which may
641 -not be portable. Xzoom will not run with display depth other
642 -than 8 bits per pixel.
645 Xzoom is given with no warranty. It was tested only under
646 Linux with Xfree86 release 3.1.2 (X11R6).
648 --- xzoom-0.3.orig/copyright
649 +++ xzoom-0.3/copyright
651 +This package was maintained by tony mancill <tmancill@debian.org>, for a
652 +while, and then picked up by Junichi Uekawa <dancer@debian.org>. Since Sun, 15 Jun 2008 maintained by Anibal Avelar <aavelar@cofradia.org>.
654 +This package was put together by Joey Hess <joeyh@debian.org>, using
656 + ftp://sunsite.unc.edu/pub/linux/libs/X/xzoom-0.3.tgz
658 +Copyright: 1995-2008 Itai Nahshon
662 + This program is distributed with no warranty.
664 + Source files for this program may be distributed freely.
665 + Modifications to this file are okay as long as:
666 + a. This copyright notice and comment are preserved and
667 + left at the top of the file.
668 + b. The man page is fixed to reflect the change.
669 + c. The author of this change adds his name and change
670 + description to the list of changes below.
671 + Executable files may be distributed with sources, or with
672 + exact location where the source code can be obtained.
673 --- xzoom-0.3.orig/changelog
674 +++ xzoom-0.3/changelog
676 +xzoom (0.3-23) unstable; urgency=low
680 + * Fixed the FTBFS bug added the xutils-dev dependency.
682 + * Bumped to Standards-version 3.8.0.
683 + * Added the Homepage field in the debian/control file.
684 + * Cleaned the debian/copyright file with cosmetic changes.
686 + [ Piotr Ożarowski ]
687 + * debian/watch file added
689 + -- Anibal Avelar <aavelar@cofradia.org> Sun, 15 Jun 2008 22:27:53 -0400
691 +xzoom (0.3-22) unstable; urgency=low
693 + * Cap menu item. Closes: #438103
695 + -- Joey Hess <joeyh@debian.org> Wed, 15 Aug 2007 13:29:53 -0400
697 +xzoom (0.3-21) unstable; urgency=low
699 + * Maintaining this package again.
700 + * Improve description, fix typos.
701 + * Remove debian/pbuild-test directory, seems to be added by accident.
702 + * De-dpatchify (personal preference).
703 + * Clean up rules file.
704 + * Remove various autogenerated files from source package, seems they were
707 + * The Apps/Tools menu is obsolete. Use Applications/Accessibility,
708 + hope that's not too big a stretch.
709 + * Remove CVS dirs from debian patch.
711 + -- Joey Hess <joeyh@debian.org> Tue, 07 Aug 2007 22:01:43 -0700
713 +xzoom (0.3-20) unstable; urgency=low
717 + -- Junichi Uekawa <dancer@debian.org> Sat, 04 Aug 2007 09:37:51 +0900
719 +xzoom (0.3-19) unstable; urgency=low
721 + * Standards-version: 3.7.2
724 + -- Junichi Uekawa <dancer@debian.org> Sat, 2 Sep 2006 19:42:17 +0900
726 +xzoom (0.3-18) unstable; urgency=low
728 + * support for X11R7, and install to standard FHS locations.
731 + * quote menu item string.
732 + * Standards-version: 3.6.2
734 + -- Junichi Uekawa <dancer@debian.org> Sat, 22 Apr 2006 12:50:12 +0900
736 +xzoom (0.3-17) unstable; urgency=low
738 + * Bug fix: "xzoom: FTBFS: build-depends on removed xlibs-dev"
739 + Changed to x-dev, libxext-dev, libxt-dev (Closes: #346867).
740 + * Bug fix: "'man xzoom' typo: "magniications"", thanks to A
741 + Costa (Closes: #306710).
742 + * add simple test for resulting binary.
744 + -- Junichi Uekawa <dancer@debian.org> Mon, 9 Jan 2006 13:10:09 +0900
746 +xzoom (0.3-16) unstable; urgency=low
748 + * New maintainer (closes: #202330)
749 + * Standards-version: 3.6.0
750 + * Modified the package description.
752 + -- Junichi Uekawa <dancer@debian.org> Sat, 9 Aug 2003 07:38:11 +0900
754 +xzoom (0.3-15) unstable; urgency=low
756 + * orphaned; set maintainer to packages@qa.debian.org
758 + -- tony mancill <tmancill@debian.org> Mon, 21 Jul 2003 15:46:51 -0700
760 +xzoom (0.3-14) unstable; urgency=low
762 + * updated build-depends for sid (closes: #170185)
764 + -- tony mancill <tmancill@debian.org> Sat, 23 Nov 2002 16:04:04 -0800
766 +xzoom (0.3-13) unstable; urgency=low
768 + * updated manpage (closes: #93253)
769 + * hacked in WM_DELETE_WINDOW support (closes: #93250)
770 + (you can now use standard window manager methods to close the client)
772 + -- tony mancill <tmancill@debian.org> Tue, 12 Feb 2002 22:59:09 -0800
774 +xzoom (0.3-12) unstable; urgency=low
776 + * binaries built against xfree 4.x for woody release
778 + -- tony mancill <tmancill@debian.org> Mon, 26 Nov 2001 20:08:29 -0800
780 +xzoom (0.3-11) unstable; urgency=low
782 + * new maintainer <tmancill@debian.org> (Closes: bug#69658)
784 + -- tony mancill <tmancill@debian.org> Mon, 28 Aug 2000 17:43:02 -0700
786 +xzoom (0.3-10) unstable; urgency=low
790 + -- Joey Hess <joeyh@debian.org> Sat, 4 Dec 1999 18:42:28 -0800
792 +xzoom (0.3-9) unstable; urgency=low
796 + -- Joey Hess <joeyh@debian.org> Sun, 12 Sep 1999 14:27:43 -0700
798 +xzoom (0.3-8) unstable; urgency=low
800 + * Fixed package description: no longer limited to 8bpp.
801 + * Documented the 'g' key in the man page.
803 + -- Joey Hess <joeyh@debian.org> Wed, 25 Feb 1998 11:09:59 -0800
805 +xzoom (0.3-7) unstable; urgency=low
807 + * Added changes from Markus F.X.J. Oberhumer
808 + <k3040e4@c210.edvz.uni-linz.ac.at>, for greater than 8 bpp support
809 + plus some other features.
811 + -- Joey Hess <joeyh@debian.org> Thu, 19 Feb 1998 10:59:43 -0800
813 +xzoom (0.3-6) unstable; urgency=low
815 + * Moved binary to /usr/X11R6/bin.
817 + -- Joey Hess <joeyh@debian.org> Mon, 9 Feb 1998 12:44:08 -0800
819 +xzoom (0.3-5) unstable; urgency=low
823 + -- Joey Hess <joeyh@debian.org> Sat, 7 Feb 1998 20:48:22 -0800
825 +xzoom (0.3-4) unstable; urgency=low
828 + * Routine update of debian/rules:
829 + Fixed binary-indep target.
831 + -- Joey Hess <joeyh@debian.org> Mon, 8 Sep 1997 14:08:03 -0400
833 +xzoom (0.3-3) unstable; urgency=low
835 + * Added note to description that it only works at 8bpp.
837 + -- Joey Hess <joeyh@debian.org> Thu, 5 Jun 1997 19:36:27 -0400
839 +xzoom (0.3-2) unstable; urgency=low
841 + * Fixed man page permissions. (#10275)
842 + * Moved man page to X11R6.
843 + * Updated menu file to menu-1 format.
844 + * Routine update of debian/rules:
845 + Run dpkg-gencontrol after debstd, and delete substvars during clean.
847 + -- Joey Hess <joeyh@debian.org> Sun, 1 Jun 1997 14:12:42 -0400
849 +xzoom (0.3-1) unstable; urgency=low
853 + -- Joey Hess <joeyh@debian.org> Sat, 8 Mar 1997 15:30:09 -0500