| 1 |
// ---------------------------------------------------------------------------- |
| 2 |
// |
| 3 |
// Copyright (C) 2003-2013 Fons Adriaensen <[email protected]> |
| 4 |
// |
| 5 |
// This program is free software; you can redistribute it and/or modify |
| 6 |
// it under the terms of the GNU General Public License as published by |
| 7 |
// the Free Software Foundation; either version 3 of the License, or |
| 8 |
// (at your option) any later version. |
| 9 |
// |
| 10 |
// This program is distributed in the hope that it will be useful, |
| 11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
// GNU General Public License for more details. |
| 14 |
// |
| 15 |
// You should have received a copy of the GNU General Public License |
| 16 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
// |
| 18 |
// ---------------------------------------------------------------------------- |
| 19 |
|
| 20 |
|
| 21 |
#include <stdlib.h> |
| 22 |
#include <stdio.h> |
| 23 |
#include "styles.h" |
| 24 |
#include "splashwin.h" |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
Splashwin::Splashwin (X_window *parent, int xp, int yp, int xs, int ys) : |
| 29 |
X_window (parent, xp, yp, xs, ys, Colors.spla_bg, Colors.spla_bd, 1), |
| 30 |
_xs (xs), _ys (ys) |
| 31 |
{ |
| 32 |
x_add_events (ExposureMask); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
Splashwin::~Splashwin (void) |
| 37 |
{ |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
void Splashwin::handle_event (XEvent *E) |
| 42 |
{ |
| 43 |
switch (E->type) |
| 44 |
{ |
| 45 |
case Expose: |
| 46 |
expose ((XExposeEvent *) E); |
| 47 |
break; |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
void Splashwin::expose (XExposeEvent *E) |
| 53 |
{ |
| 54 |
int x, y; |
| 55 |
char s [256]; |
| 56 |
X_draw D (dpy (), win (), dgc (), xft ()); |
| 57 |
|
| 58 |
if (E->count) return; |
| 59 |
x = _xs / 2; |
| 60 |
y = _ys / 2; |
| 61 |
sprintf (s, "Aliki-%s", VERSION); |
| 62 |
D.setfunc (GXcopy); |
| 63 |
D.setfont (XftFonts.spla1); |
| 64 |
D.setcolor (XftColors.spla_fg); |
| 65 |
D.move (x, y - 50); |
| 66 |
D.drawstring (s, 0); |
| 67 |
D.setfont (XftFonts.spla2); |
| 68 |
D.move (x, y); |
| 69 |
D.drawstring ("(C) 2003-2013 Fons Adriaensen <[email protected]>", 0); |
| 70 |
D.move (x, y + 50); |
| 71 |
D.drawstring ("This is free software, and you are welcome", 0); |
| 72 |
D.move (x, y + 70); |
| 73 |
D.drawstring ("to distribute it under certain conditions.", 0); |
| 74 |
D.move (x, y + 90); |
| 75 |
D.drawstring ("See the file COPYING for details.", 0); |
| 76 |
} |
| 77 |
|
| 78 |
|
| 79 |
|