Lines 189-205
CCosmos::CCosmos()
Link Here
|
189 |
cyclecolor=1; |
189 |
cyclecolor=1; |
190 |
color=248; |
190 |
color=248; |
191 |
ncolors=256; |
191 |
ncolors=256; |
192 |
showstars = get_boolean_resource("showstars","Boolean"); |
|
|
193 |
showflame = get_boolean_resource("showflame","Boolean"); |
194 |
sparkle = get_boolean_resource("sparkle","Boolean"); |
195 |
stars = get_integer_resource("stars","Integer"); |
196 |
actorcount = get_integer_resource("actors","Integer"); |
197 |
castcount = get_integer_resource("casts","Integer"); |
198 |
resetcount = get_integer_resource("resetcount","Integer"); |
199 |
} |
192 |
} |
200 |
|
193 |
|
201 |
void CCosmos::InitDisplay(Display* dpy, Window win) |
194 |
void CCosmos::InitDisplay(Display* dpy, Window win) |
202 |
{ |
195 |
{ |
|
|
196 |
showstars = get_boolean_resource(dpy, "showstars","Boolean"); |
197 |
showflame = get_boolean_resource(dpy, "showflame","Boolean"); |
198 |
sparkle = get_boolean_resource(dpy, "sparkle","Boolean"); |
199 |
stars = get_integer_resource(dpy, "stars","Integer"); |
200 |
actorcount = get_integer_resource(dpy, "actors","Integer"); |
201 |
castcount = get_integer_resource(dpy, "casts","Integer"); |
202 |
resetcount = get_integer_resource(dpy, "resetcount","Integer"); |
203 |
|
203 |
|
204 |
GetXInfo(dpy,win); |
204 |
GetXInfo(dpy,win); |
205 |
InitColors(); |
205 |
InitColors(); |
Lines 663-671
void CCosmos::Run()
Link Here
|
663 |
|
663 |
|
664 |
|
664 |
|
665 |
|
665 |
|
666 |
char *progclass = "Cosmos"; |
666 |
static void * |
|
|
667 |
cosmos_init (Display *disp, Window win) |
668 |
{ |
669 |
CCosmos *ccosmos = new CCosmos(); |
670 |
CCosmos::m_instance = ccosmos; |
671 |
ccosmos->InitDisplay(disp,win); |
672 |
return ccosmos; |
673 |
} |
674 |
|
675 |
static unsigned long |
676 |
cosmos_draw (Display *disp, Window win, void *closure) |
677 |
{ |
678 |
CCosmos *ccosmos = (CCosmos *) closure; |
679 |
ccosmos->Run(); |
680 |
return 1000l; |
681 |
} |
667 |
|
682 |
|
668 |
char *defaults [] = { |
683 |
static void |
|
|
684 |
cosmos_reshape (Display *disp, Window win, void *closure, |
685 |
unsigned int width, unsigned int height) |
686 |
{ |
687 |
CCosmos *ccosmos = (CCosmos *) closure; |
688 |
} |
689 |
|
690 |
static Bool |
691 |
cosmos_event (Display *disp, Window win, void *closure, XEvent *event) |
692 |
{ |
693 |
return False; |
694 |
} |
695 |
|
696 |
static void |
697 |
cosmos_free (Display *, Window, void *closure) |
698 |
{ |
699 |
CCosmos *ccosmos = (CCosmos *) closure; |
700 |
delete ccosmos; |
701 |
} |
702 |
|
703 |
static char *cosmos_defaults [] = { |
669 |
".background: black", |
704 |
".background: black", |
670 |
".foreground: #FFAF5F", |
705 |
".foreground: #FFAF5F", |
671 |
"*bitmap: (default)", |
706 |
"*bitmap: (default)", |
Lines 695-701
char *defaults [] = {
Link Here
|
695 |
0 |
730 |
0 |
696 |
}; |
731 |
}; |
697 |
|
732 |
|
698 |
XrmOptionDescRec options [] = { |
733 |
XrmOptionDescRec cosmos_options [] = { |
699 |
{ "-delay", ".delay", XrmoptionSepArg, 0 }, |
734 |
{ "-delay", ".delay", XrmoptionSepArg, 0 }, |
700 |
{ "-bitmap", ".bitmap", XrmoptionSepArg, 0 }, |
735 |
{ "-bitmap", ".bitmap", XrmoptionSepArg, 0 }, |
701 |
{ "-baseline", ".bitmapBaseline", XrmoptionSepArg, 0 }, |
736 |
{ "-baseline", ".bitmapBaseline", XrmoptionSepArg, 0 }, |
Lines 720-734
XrmOptionDescRec options [] = {
Link Here
|
720 |
{ 0, 0, XrmoptionNoArg, 0 } |
755 |
{ 0, 0, XrmoptionNoArg, 0 } |
721 |
}; |
756 |
}; |
722 |
|
757 |
|
723 |
void |
758 |
XSCREENSAVER_MODULE ("Cosmos", cosmos) |
724 |
screenhack (Display *disp, Window win) |
|
|
725 |
{ |
726 |
CCosmos::GetInstance()->InitDisplay(disp,win); |
727 |
while (1) { |
728 |
CCosmos::GetInstance()->Run(); |
729 |
XSync(disp,False); |
730 |
screenhack_handle_events(disp); |
731 |
//if (delay) |
732 |
// usleep (delay); |
733 |
} |
734 |
} |