README
1sol - X11 solitaire card game
2=============================
3
4Sol is a card game for lonely persons, highly inspired by the game
5bundeled with a well known non-Unix "operating system".
6
7I assume the motive of the game is well known, so I won't go into any
8details here, but rather explain the controls of this particular
9implementation.
10
11To select new cards from the upper left pile, click on the back of the
12pile. When the pile is empty, click on the outline to turn it. The
13number of cards to draw may be either one or three, selectable from
14the Options menu. You may turn the pile as many times you like.
15
16Cards may be moved in a drag--drop fashion. Click on a card with
17button 1 (normally the left button), drag the card to the destination
18pile, and release the button. You may drag several cards at once:
19Pointing at a card not at the top of a pile, will move the chosen
20card, and all cards above (or below, depending on how you see it) it.
21
22You may double-click on a card to move it to one of the four upper
23right target piles. The program will locate the correct pile, if any.
24You may also use button 2 or 3 for the same purpose.
25
26The game features a site-wide highscore file, containing the top 200
27players. Each user may appear only once in the highscore table. The
28highscore list is sorted on the time taken to bring the game to a
29solution. Chose the Highscores menu to bring up a window containing
30the list. The window is updated every now and then. If you don't
31want to be part of the race, you may avoid being included in the
32highscore list from the Options menu.
33
34All options are stored in .solrc in your home directory, along with a
35count of games played, and the time used for playing. The latter two
36may be viewed from the About menu.
37
38
39Author
40------
41
42The program is written by
43
44 Sverre H. Huseby shh@thathost.com
45 Lofthusvn. 11 B http://shh.thathost.com/
46 N-0587 Oslo
47 Norway
48
49
50License
51-------
52
53This program is released under the Artistic License:
54
55 http://www.opensource.org/licenses/artistic-license.html
56
57Comments (even as simple as "I use your program") are very welcome.
58If you insist on paying something, please donate some money to an
59organization that strives to make the world a better place for
60everyone.
61
62I don't like bugs, so please help me removing them by reporting
63whatever you find!
64
65
readme.c
1 /* $Id: readme.c,v 1.3 2002/03/02 21:02:21 sverrehu Exp $ */
2 /**************************************************************************
3 *
4 * FILE readme.c
5 * MODULE OF Card game.
6 *
7 * DESCRIPTION REAME file viewer.
8 *
9 * WRITTEN BY Sverre H. Huseby <shh@thathost.com>
10 *
11 **************************************************************************/
12
13 #include <stdlib.h>
14
15 #include <X11/Xlib.h>
16 #include <X11/Intrinsic.h>
17 #include <X11/StringDefs.h>
18 #include <X11/Shell.h>
19 #include <X11/Xaw/Command.h>
20 #include <X11/Xaw/AsciiText.h>
21 #include <X11/Xaw/Form.h>
22
23 #include "win.h"
24 #include "readme.h"
25
26 /**************************************************************************
27 * *
28 * P R I V A T E D A T A *
29 * *
30 **************************************************************************/
31
32 static Widget readmeWidget, readmeParent, textWidget;
33 static int isPoppedUp = 0;
34 #include "readme.var"
35
36
37
38 /**************************************************************************
39 * *
40 * P R I V A T E F U N C T I O N S *
41 * *
42 **************************************************************************/
43
44 static void
callbackOk(Widget w,XtPointer clientData,XtPointer callData)45 callbackOk(Widget w, XtPointer clientData, XtPointer callData)
46 {
47 XtPopdown(readmeWidget);
48 XtSetSensitive(readmeButton, 1);
49 isPoppedUp = 0;
50 }
51
52
53
54 /**************************************************************************
55 * *
56 * P U B L I C F U N C T I O N S *
57 * *
58 **************************************************************************/
59
60 void
readmeInit(Widget parent)61 readmeInit(Widget parent)
62 {
63 Widget form, button;
64
65 readmeParent = parent;
66 readmeWidget
67 = XtVaCreatePopupShell("readmeWindow",
68 topLevelShellWidgetClass, parent,
69 XtNtitle, "Sol Help",
70 XtNallowShellResize, 1,
71 NULL);
72 form
73 = XtVaCreateManagedWidget("readmeFrom",
74 formWidgetClass, readmeWidget,
75 NULL);
76 textWidget
77 = XtVaCreateManagedWidget("readme",
78 asciiTextWidgetClass, form,
79 XtNwidth, 66,
80 XtNheight, 25 * 10 + 4,
81 XtNdisplayCaret, 0,
82 XtNscrollVertical, XawtextScrollWhenNeeded,
83 XtNresizable, 1,
84 XtNresize, XawtextResizeWidth,
85 NULL);
86 button
87 = XtVaCreateManagedWidget("ok",
88 commandWidgetClass, form,
89 XtNlabel, "It's all clear to me now.",
90 XtNfromVert, textWidget,
91 NULL);
92 XtAddCallback(button, XtNcallback, callbackOk, 0);
93 }
94
95 void
readmeFinish(void)96 readmeFinish(void)
97 {
98 }
99
100 void
readmePopup(void)101 readmePopup(void)
102 {
103 if (isPoppedUp)
104 return;
105 XtSetSensitive(readmeButton, 0);
106 isPoppedUp = 1;
107
108 XtVaSetValues(textWidget, XtNstring, readmeText, NULL);
109 XtPopup(readmeWidget, XtGrabNone);
110 }
111
readme.h
readme.var
1static char *readmeText =
2"sol - X11 solitaire card game\n"
3"=============================\n"
4"\n"
5"Sol is a card game for lonely persons, highly inspired by the game\n"
6"bundeled with a well known non-Unix \"operating system\".\n"
7"\n"
8"I assume the motive of the game is well known, so I won't go into any\n"
9"details here, but rather explain the controls of this particular\n"
10"implementation.\n"
11"\n"
12"To select new cards from the upper left pile, click on the back of the\n"
13"pile. When the pile is empty, click on the outline to turn it. The\n"
14"number of cards to draw may be either one or three, selectable from\n"
15"the Options menu. You may turn the pile as many times you like.\n"
16"\n"
17"Cards may be moved in a drag--drop fashion. Click on a card with\n"
18"button 1 (normally the left button), drag the card to the destination\n"
19"pile, and release the button. You may drag several cards at once:\n"
20"Pointing at a card not at the top of a pile, will move the chosen\n"
21"card, and all cards above (or below, depending on how you see it) it.\n"
22"\n"
23"You may double-click on a card to move it to one of the four upper\n"
24"right target piles. The program will locate the correct pile, if any.\n"
25"You may also use button 2 or 3 for the same purpose.\n"
26"\n"
27"The game features a site-wide highscore file, containing the top 200\n"
28"players. Each user may appear only once in the highscore table. The\n"
29"highscore list is sorted on the time taken to bring the game to a\n"
30"solution. Chose the Highscores menu to bring up a window containing\n"
31"the list. The window is updated every now and then. If you don't\n"
32"want to be part of the race, you may avoid being included in the\n"
33"highscore list from the Options menu.\n"
34"\n"
35"All options are stored in .solrc in your home directory, along with a\n"
36"count of games played, and the time used for playing. The latter two\n"
37"may be viewed from the About menu.\n"
38"\n"
39"\n"
40"Author\n"
41"------\n"
42"\n"
43"The program is written by\n"
44"\n"
45" Sverre H. Huseby shh@thathost.com\n"
46" Lofthusvn. 11 B http://shh.thathost.com/\n"
47" N-0587 Oslo\n"
48" Norway\n"
49"\n"
50"\n"
51"License\n"
52"-------\n"
53"\n"
54"This program is released under the Artistic License:\n"
55"\n"
56" http://www.opensource.org/licenses/artistic-license.html\n"
57"\n"
58"Comments (even as simple as \"I use your program\") are very welcome.\n"
59"If you insist on paying something, please donate some money to an\n"
60"organization that strives to make the world a better place for\n"
61"everyone.\n"
62"\n"
63"I don't like bugs, so please help me removing them by reporting\n"
64"whatever you find!\n"
65"\n"
66;
67