546N/A/*
546N/A * Copyright (c) 1988-91 by Patrick J. Naughton.
546N/A *
546N/A * Permission to use, copy, modify, and distribute this software and its
546N/A * documentation for any purpose and without fee is hereby granted,
546N/A * provided that the above copyright notice appear in all copies and that
546N/A * both that copyright notice and this permission notice appear in
546N/A * supporting documentation.
546N/A *
546N/A * This file is provided AS IS with no warranties of any kind. The author
546N/A * shall have no liability with respect to the infringement of copyrights,
546N/A * trade secrets or any patents by this file or any part thereof. In no
546N/A * event will the author be liable for any lost revenue or profits or
546N/A * other special, indirect and consequential damages.
546N/A */
546N/A
546N/A/*
1233N/A * Copyright (c) 1990, 2011, Oracle and/or its affiliates. All rights reserved.
546N/A *
546N/A * Permission is hereby granted, free of charge, to any person obtaining a
919N/A * copy of this software and associated documentation files (the "Software"),
919N/A * to deal in the Software without restriction, including without limitation
919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A * and/or sell copies of the Software, and to permit persons to whom the
919N/A * Software is furnished to do so, subject to the following conditions:
546N/A *
919N/A * The above copyright notice and this permission notice (including the next
919N/A * paragraph) shall be included in all copies or substantial portions of the
919N/A * Software.
546N/A *
919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A * DEALINGS IN THE SOFTWARE.
546N/A */
546N/A
546N/A/*-
546N/A *
546N/A * xlock.h - external interfaces for new modes and SYSV OS defines.
546N/A */
546N/A
546N/A#include <X11/Xlib.h>
546N/A#include <X11/Xutil.h>
546N/A#include <X11/Xos.h>
546N/A#include <stdlib.h>
546N/A
546N/A#define MAXSCREENS 16
546N/A#define NUMCOLORS 64
546N/A
546N/Atypedef struct {
546N/A GC gc; /* graphics context for animation */
546N/A int npixels; /* number of valid entries in pixels */
546N/A u_long pixels[NUMCOLORS]; /* pixel values in the colormap */
546N/A} perscreen;
546N/A
546N/Aextern perscreen Scr[MAXSCREENS];
546N/Aextern Display *dsp;
546N/Aextern int screen;
546N/A
546N/Aextern char *ProgramName;
1233N/Aextern const char *display;
1233N/Aextern const char *mode;
546N/Aextern char *fontname;
546N/Aextern char *background;
546N/Aextern char *foreground;
546N/Aextern char *text_name;
546N/Aextern char *text_pass;
546N/Aextern char *text_info;
546N/Aextern char *text_valid;
546N/Aextern char *text_invalid;
546N/Aextern float saturation;
546N/Aextern int nicelevel;
546N/Aextern int delay;
546N/Aextern int batchcount;
546N/Aextern int reinittime;
546N/Aextern int timeout;
546N/Aextern Bool usefirst;
546N/Aextern Bool mono;
546N/Aextern Bool nolock;
546N/Aextern Bool allowroot;
546N/Aextern Bool enablesaver;
546N/Aextern Bool allowaccess;
546N/Aextern Bool echokeys;
546N/Aextern Bool verbose;
1233N/Aextern void (*callback) (Window);
1233N/Aextern void (*init) (Window);
1233N/A
1233N/Aextern void GetResources(int argc, char *argv[]);
1233N/Aextern void CheckResources(void);
1233N/Aextern void hsbramp(double h1, double s1, double b1,
1233N/A double h2, double s2, double b2,
1233N/A int count, u_char *red, u_char *green, u_char *blue);
1233N/Aextern long seconds(void);
1233N/A
1233N/A/* PRINTFLIKE1 */
1233N/Aextern void error(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,2);
1233N/A
1233N/A/*
1233N/A * Declare external interface routines for supported screen savers.
1233N/A */
1233N/A
1233N/Aextern void inithop(Window);
1233N/Aextern void drawhop(Window);
546N/A
1233N/Aextern void initlife(Window);
1233N/Aextern void drawlife(Window);
1233N/A
1233N/Aextern void initqix(Window);
1233N/Aextern void drawqix(Window);
1233N/A
1233N/Aextern void initimage(Window);
1233N/Aextern void drawimage(Window);
1233N/A
1233N/Aextern void initblank(Window);
1233N/Aextern void drawblank(Window);
1233N/A
1233N/Aextern void initswarm(Window);
1233N/Aextern void drawswarm(Window);
1233N/A
1233N/Aextern void initrotor(Window);
1233N/Aextern void drawrotor(Window);
1233N/A
1233N/Aextern void initpyro(Window);
1233N/Aextern void drawpyro(Window);
1233N/A
1233N/Aextern void initflame(Window);
1233N/Aextern void drawflame(Window);
546N/A
546N/A/* System V Release 4 redefinitions of BSD functions and structures */
546N/A
546N/A#ifdef SYSV
546N/A
546N/A#include <sys/time.h>
546N/A#include <poll.h>
546N/A#include <shadow.h>
546N/A/*
546N/A#define srandom srand
546N/A#define random rand
546N/A#define MAXRAND (32767.0)
546N/A*/
546N/A#define MAXRAND (2147483648.0)
546N/A
546N/A#else
546N/A
546N/A#define MAXRAND (2147483648.0)
546N/A
546N/A#endif