Adonthell  0.4
win_theme.cc
Go to the documentation of this file.
1 /*
2  $Id: win_theme.cc,v 1.5 2002/04/25 15:34:11 gnurou Exp $
3 
4  (C) Copyright 2000 Joel Vennin
5  Part of the Adonthell Project http://adonthell.linuxgames.com
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details
13 */
14 
15 #include "win_theme.h"
16 
17 win_theme::win_theme()
18 {
19  normal = NULL;
20 
21  mini = NULL;
22 
23  background = NULL;
24 
25  scrollbar = NULL;
26 }
27 
28 win_theme::win_theme(char * theme)
29 {
30  string strtheme = string (theme) + "/";
31 
32  normal=new win_border((char *) strtheme.c_str(), WIN_BORDER_NORMAL_SIZE);
33 
34  mini=new win_border((char *) strtheme.c_str(), WIN_BORDER_MINI_SIZE);
35 
36  background=new win_background((char *) strtheme.c_str() );
37 
38  scrollbar=new win_scrollbar((char *) strtheme.c_str() );
39 }
40 
41 win_theme::win_theme(win_theme & th)
42 {
43  normal=NULL;
44 
45  mini=NULL;
46 
47  background=NULL;
48 
49  scrollbar=NULL;
50 
51  *this=th;
52 }
53 
54 win_theme::~win_theme()
55 {
56  destroy();
57 }
58 
59 win_theme & win_theme::operator=(win_theme & th)
60 {
61  destroy();
62 
63  normal = new win_border(*(th.normal));
64 
65  mini = new win_border(*(th.mini));
66 
67  background = new win_background(*(th.background));
68 
69  scrollbar=new win_scrollbar(*(th.scrollbar));
70 
71  return *this;
72 }
73 
74 void win_theme::destroy()
75 {
76  if(normal)delete normal;
77 
78  if(mini) delete mini;
79 
80  if(background) delete background;
81 
82  if(scrollbar) delete scrollbar;
83 }
84 
85 
86 
87 
88 
89 
90