xmag_multivis.c revision 1068
2464bd58eb0b2e8564557fbad43778f03a958418Automatic Updater * xmag - simple magnifying glass application
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * $XConsortium: xmag.c,v 1.29 89/12/10 17:23:58 rws Exp $
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * Copyright 1988 Massachusetts Institute of Technology
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * Permission to use, copy, modify, and distribute this software and its
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * documentation for any purpose and without fee is hereby granted, provided
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * that the above copyright notice appear in all copies and that both that
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * copyright notice and this permission notice appear in supporting
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * documentation, and that the name of M.I.T. not be used in advertising or
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * publicity pertaining to distribution of the software without specific,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * written prior permission. M.I.T. makes no representations about the
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * suitability of this software for any purpose. It is provided "as is"
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * without express or implied warranty.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * Author: Jim Fulton, MIT X Consortium
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * Revision History:
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * 11-15-90 MultiVis changes made by: Milind M. Pansare
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * milind@Eng.Sun.COM
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * Copyright (c) 1990, 2011, Oracle and/or its affiliates. All rights reserved.
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * Permission is hereby granted, free of charge, to any person obtaining a
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * copy of this software and associated documentation files (the "Software"),
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * to deal in the Software without restriction, including without limitation
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * the rights to use, copy, modify, merge, publish, distribute, sublicense,
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * and/or sell copies of the Software, and to permit persons to whom the
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * Software is furnished to do so, subject to the following conditions:
3a30493983df83a3184dd1ecd39cf31ccdac3badEvan Hunt * The above copyright notice and this permission notice (including the next
3a30493983df83a3184dd1ecd39cf31ccdac3badEvan Hunt * paragraph) shall be included in all copies or substantial portions of the
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
669e9657c731176df235832367f61435f7b83ddfAndreas Gustafsson * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * DEALINGS IN THE SOFTWARE.
#include <stdio.h>
#include <stdlib.h>
#ifdef ALLPLANES
#include "multivis.h"
#ifdef SYSV
#ifndef bzero
int num_vis;
#ifdef ALLPLANES
int status;
if (dpy) {
Usage ()
static char *help_message[] = {
}, **cpp;
int argc;
char **argv;
Usage ();
Usage ();
Usage ();
if (!dpy) {
#ifdef ALLPLANES
int tmp;
if (!source_geometry)
if (!source_geometry)
if (border_width < 0) {
if (!border_color)
if (!border_color)
if (!back_color)
if (!back_color)
== NULL)
Exit (0);
* magnification = window.geometry.height / source_geometry.height
#define valNothing 0
if (window_geometry) {
if (tmp) {
if (source_geometry) {
if (tmp) {
magnification = 0;
switch (params) {
case valMagnification:
goto mag_and_cur;
case valWindow:
case valNothing:
case valSource:
case XNegative:
case YNegative:
if (back_color) {
if (!*s) Usage ();
if (def_vis_is_ok) {
if (w1) {
if (w1) {
&gcv);
if (w1)
&gcv);
if (do_grab) {
if (do_grab) {
back_pixel));
unsigned int mask;
if (!invGC) {
case ButtonRelease:
#ifdef ALLPLANES
if (allplanes) {
#ifdef ALLPLANES
shp->x = x;
shp->y = y;
int magnification;
unsigned long back_pixel;
#ifdef SHAPE
if (multiVis) {
if (do_grab) {
return (False);
if (multiVis) {
mw = w;
case ClientMessage:
exit(0);
case Expose:
case ButtonRelease:
case ButtonPress:
unsigned int mask;
if (multiVis) {
UnmapPixWindow ();
case KeyPress:
mvReset();
if (!multiVis) {
return (domore);
int magnification;
unsigned long back_pixel;
r_width = 0;
int bot;
if (!pixfinfo) {
if (!pixfinfo) {
&gcv);
char *str;
XImage *
for (y = 0; y < ht; y++) {
for (x=0; x < wd; x++) {
unsigned long pixel;
<<red_shift)
<<blue_shift)
<<green_shift);
return image;
int multivisFromMvLib;
switch (multivisFromMvLib) {