Back to index

kdeartwork  4.3.2
Classes | Defines | Functions | Variables
xlock.h File Reference
#include <qapplication.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xresource.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <stdio.h>
#include <string.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  perscreen
struct  argtype
struct  OptionStruct
struct  ModeSpecOpt


#define MAXSCREENS   1
#define NUMCOLORS   64
#define PASSLENGTH   64
#define FALLBACK_FONTNAME   "fixed"
#define DEF_MFONT   "-*-times-*-*-*-*-18-*-*-*-*-*-*-*"
#define DEF_PROGRAM   "fortune -s"
#define ICONW   64
#define ICONH   64
#define min(a, b)   ((a)<(b)?(a):(b))
#define M_E   2.7182818284590452354
#define M_PI   3.14159265358979323846
#define M_PI_2   1.57079632679489661923
#define t_String   0
#define t_Float   1
#define t_Int   2
#define t_Bool   3
#define SINF(n)   ((float)sin((double)(n)))
#define COSF(n)   ((float)cos((double)(n)))
#define FABSF(n)   ((float)fabs((double)(n)))


void initXLock (GC gc)
void GetResources ()
void set_colormap ()
void fix_colormap ()
void error ()
void alarm_ctl ()
long seconds ()
XFontStruct * get_font ()
char * get_words ()
void init_words ()
int is_ribbon ()


perscreen Scr [MAXSCREENS]
Display * dsp
int screen
char * ProgramName
char * fontname
char * background
char * foreground
char * text_name
char * text_pass
char * text_info
char * text_valid
char * text_invalid
char * geometry
float saturation
int nicelevel
int delay
int batchcount
int cycles
int timeout
int lockdelay
Bool usefirst
Bool mono
Bool nolock
Bool allowroot
Bool enablesaver
Bool allowaccess
Bool grabmouse
Bool echokeys
Bool verbose
Bool inwindow
Bool inroot
Bool timeelapsed
Bool install
int onepause
char * program
char * messagesfile
char * messagefile
char * message
char * mfont
void(* callback )()
void(* init )()

Class Documentation

struct perscreen

Definition at line 98 of file xlock.h.

Class Members
unsigned long bgcol
unsigned long bothcol
Colormap cmap
unsigned long fgcol
GC gc
unsigned long leftcol
unsigned long nonecol
int npixels
unsigned long pixels
unsigned long rightcol
struct argtype

Definition at line 112 of file xlock.h.

Class Members
char * arg_class
char * classname
char * def
char * name
int type
caddr_t * var
struct OptionStruct

Definition at line 120 of file xlock.h.

Class Members
char * desc
char * opt
struct ModeSpecOpt

Definition at line 125 of file xlock.h.

Collaboration diagram for ModeSpecOpt:
Class Members
OptionStruct * desc
int numopts
int numvarsdesc
XrmOptionDescRec * opts
argtype * vars

Define Documentation

#define COSF (   n)    ((float)cos((double)(n)))

Definition at line 229 of file xlock.h.

#define DEF_MFONT   "-*-times-*-*-*-*-18-*-*-*-*-*-*-*"

Definition at line 56 of file xlock.h.

#define DEF_PROGRAM   "fortune -s"

Definition at line 59 of file xlock.h.

#define FABSF (   n)    ((float)fabs((double)(n)))

Definition at line 230 of file xlock.h.

#define FALLBACK_FONTNAME   "fixed"

Definition at line 54 of file xlock.h.

#define ICONH   64

Definition at line 63 of file xlock.h.

#define ICONW   64

Definition at line 62 of file xlock.h.

#define M_E   2.7182818284590452354

Definition at line 79 of file xlock.h.

#define M_PI   3.14159265358979323846

Definition at line 82 of file xlock.h.

#define M_PI_2   1.57079632679489661923

Definition at line 85 of file xlock.h.

#define MAXSCREENS   1

Definition at line 47 of file xlock.h.

#define min (   a,
)    ((a)<(b)?(a):(b))

Definition at line 66 of file xlock.h.

#define NUMCOLORS   64

Definition at line 48 of file xlock.h.

#define PASSLENGTH   64

Definition at line 50 of file xlock.h.

#define SINF (   n)    ((float)sin((double)(n)))

Definition at line 228 of file xlock.h.

#define t_Bool   3

Definition at line 110 of file xlock.h.

#define t_Float   1

Definition at line 108 of file xlock.h.

#define t_Int   2

Definition at line 109 of file xlock.h.

#define t_String   0

Definition at line 107 of file xlock.h.

Function Documentation

void alarm_ctl ( )
void error ( )
void fix_colormap ( )
XFontStruct* get_font ( )
char* get_words ( )
void GetResources ( )
void init_words ( )
void initXLock ( GC  gc)

Definition at line 64 of file xlock.cpp.

       SetRNG( time(NULL) );

       dsp = QX11Info::display();
       screen = QX11Info::appScreen();

       Screen *scr = ScreenOfDisplay(dsp, screen);

       Scr[0].gc = gc;
       Scr[0].npixels = NUMCOLORS;
       Scr[0].cmap = None;

       Colormap    cmap = DefaultColormapOfScreen(scr);
       Scr[0].bgcol = allocpixel(cmap, "background", "White");
       Scr[0].bgcol = allocpixel(cmap, "foreground", "Black");

       QColor color;
       QColormap colormap(QColormap::instance());

       for ( int i = 0; i < NUMCOLORS; i++ )
              color.setHsv( i * 360 / NUMCOLORS, 255, 255 );
              Scr[0].pixels[i] = colormap.pixel(color);

Here is the call graph for this function:

Here is the caller graph for this function:

int is_ribbon ( )
long seconds ( )
void set_colormap ( )

Variable Documentation

Bool allowroot
char* background

Definition at line 44 of file XScreenSaver_ad.h.

Definition at line 17 of file xlock.cpp.

void(* callback)()
int cycles

Definition at line 18 of file xlock.cpp.

int delay
Display* dsp

Definition at line 15 of file xlock.cpp.

Bool echokeys
char* fontname
char* foreground

Definition at line 44 of file XScreenSaver_ad.h.

char* geometry
Bool grabmouse
void(* init)()
Bool inroot
Bool install
Bool inwindow
int lockdelay
char* message
char* messagefile
char* messagesfile
char* mfont
Bool mono

Definition at line 19 of file xlock.cpp.

int nicelevel
Bool nolock
int onepause
char* program
char* ProgramName

Definition at line 21 of file xlock.cpp.

float saturation

Definition at line 16 of file xlock.cpp.

int screen

Definition at line 14 of file xlock.cpp.

char* text_info
char* text_invalid
char* text_name
char* text_pass
char* text_valid
int timeout

Definition at line 4 of file XScreenSaver_ad.h.

Bool usefirst
Bool verbose

Definition at line 4 of file XScreenSaver_ad.h.