Adonthell  0.4
win_theme.cc
Go to the documentation of this file.
1 /*
2  (C) Copyright 2000 Joel Vennin
3  Part of the Adonthell Project <http://adonthell.nongnu.org>
4 
5  Adonthell 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 2 of the License, or
8  (at your option) any later version.
9 
10  Adonthell 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 Adonthell. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "win_theme.h"
20 
21 win_theme::win_theme()
22 {
23  normal = NULL;
24 
25  mini = NULL;
26 
27  background = NULL;
28 
29  scrollbar = NULL;
30 }
31 
32 win_theme::win_theme(char * theme)
33 {
34  string strtheme = string (theme) + "/";
35 
36  normal=new win_border((char *) strtheme.c_str(), WIN_BORDER_NORMAL_SIZE);
37 
38  mini=new win_border((char *) strtheme.c_str(), WIN_BORDER_MINI_SIZE);
39 
40  background=new win_background((char *) strtheme.c_str() );
41 
42  scrollbar=new win_scrollbar((char *) strtheme.c_str() );
43 }
44 
45 win_theme::win_theme(win_theme & th)
46 {
47  normal=NULL;
48 
49  mini=NULL;
50 
51  background=NULL;
52 
53  scrollbar=NULL;
54 
55  *this=th;
56 }
57 
58 win_theme::~win_theme()
59 {
60  destroy();
61 }
62 
63 win_theme & win_theme::operator=(win_theme & th)
64 {
65  destroy();
66 
67  normal = new win_border(*(th.normal));
68 
69  mini = new win_border(*(th.mini));
70 
71  background = new win_background(*(th.background));
72 
73  scrollbar=new win_scrollbar(*(th.scrollbar));
74 
75  return *this;
76 }
77 
78 void win_theme::destroy()
79 {
80  if(normal)delete normal;
81 
82  if(mini) delete mini;
83 
84  if(background) delete background;
85 
86  if(scrollbar) delete scrollbar;
87 }
88 
89 
90 
91 
92 
93 
94