-
-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Big change! Using code based on the little-known xzoom program, so no…
… need for XFCE The big problem with XFCE's zoom was that it follwed the mouse. So there was no way to have the terminal representation of the desktop map to a smaller segment of the real desktop without the terminal mouse position being able to exactly 'hover' over the real mouse position. The xzoom program is a window that displays a zoom of a portion of the desktop. So double the width of the desktop and place the xzoom window on the right, but have it watch only the half of the desktop on the left. What's more xzoom is small and it's C code is easily incuded in the Golang code so they act as one, even sharing state such as mouse coords, viewport position, current zoom level, etc. WIP. Still contains old XFCE zoom code.
- Loading branch information
Showing
9 changed files
with
409 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ build/ | |
*.out | ||
blank.png | ||
stdin_forward | ||
xzoom/xzoom_debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
This package was maintained by tony mancill <[email protected]>, for a | ||
while, and then picked up by Junichi Uekawa <[email protected]>. Since Sun, 15 Jun 2008 maintained by Anibal Avelar <[email protected]>. | ||
|
||
This package was put together by Joey Hess <[email protected]>, using | ||
sources from: | ||
ftp://sunsite.unc.edu/pub/linux/libs/X/xzoom-0.3.tgz | ||
|
||
Copyright: 1995-2008 Itai Nahshon | ||
|
||
License: | ||
|
||
This program is distributed with no warranty. | ||
|
||
Source files for this program may be distributed freely. | ||
Modifications to this file are okay as long as: | ||
a. This copyright notice and comment are preserved and | ||
left at the top of the file. | ||
b. The man page is fixed to reflect the change. | ||
c. The author of this change adds his name and change | ||
description to the list of changes below. | ||
Executable files may be distributed with sources, or with | ||
exact location where the source code can be obtained. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
all: | ||
gcc xzoom_debug.c -lXext -lX11 -lXt -Wall -o xzoom_debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* scale image from SRC to DST - parameterized by type T */ | ||
|
||
/* get pixel address of point (x,y) in image t */ | ||
#define getP(t,x,y) \ | ||
(T *) (&ximage[t]->data[(ximage[t]->xoffset+(x))*sizeof(T) + \ | ||
(y)*ximage[t]->bytes_per_line]) | ||
|
||
{ | ||
int i, j, k; | ||
|
||
/* copy scaled lines from SRC to DST */ | ||
j = height[SRC] - 1; | ||
do { | ||
T *p1; | ||
T *p2; | ||
int p2step; | ||
T *p1_save; | ||
|
||
/* p1 point to begining of scanline j*magy in DST */ | ||
p1 = getP(DST, 0, j * magy); | ||
p1_save = p1; | ||
/* p2 point to begining of scanline j in SRC */ | ||
p2 = getP(SRC, 0, j); | ||
|
||
i = width[SRC]; | ||
do { | ||
T c = *p2++; | ||
k = magx; do *p1++ = c; while (--k > 0); | ||
} while (--i > 0); | ||
|
||
/* draw vertical grid */ | ||
if (gridy && magx >= 2) | ||
{ | ||
p1 = p1_save - 1; | ||
i = magx; | ||
k = width[SRC]; | ||
do { | ||
p1 += i; | ||
*p1 ^= ~((T)0); | ||
} while (--k > 0); | ||
} | ||
|
||
/* duplicate that line as needed */ | ||
if (magy > 1) | ||
{ | ||
/* p1 point to begining of scanline j*magy in DST */ | ||
p1 = p1_save; | ||
/* p2 points to begining of next line */ | ||
p2 = p1; | ||
p2step = ximage[DST]->bytes_per_line / sizeof(T); | ||
|
||
i = width[DST] * sizeof(T); | ||
k = magy - 1; | ||
do { | ||
p2 += p2step; | ||
memcpy(p2, p1, i); | ||
} while (--k > 0); | ||
|
||
/* draw horizontal grid */ | ||
if (gridx && magy >= 2) | ||
{ | ||
k = width[DST]; | ||
do { | ||
*p2++ ^= ~((T)0); | ||
} while (--k > 0); | ||
} | ||
} | ||
} while (--j >= 0); | ||
} | ||
|
||
#undef getP |
Oops, something went wrong.