|
1 /* |
|
2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of CHuiAnimatedTexture base class, the base class |
|
15 * for application-specific animated textures. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #include "uiacceltk/HuiAnimatedTexture.h" // Class definition |
|
22 #include "uiacceltk/HuiTextureManager.h" |
|
23 #include "uiacceltk/HuiTextureHandle.h" |
|
24 #include "HuiRenderPlugin.h" |
|
25 #include "uiacceltk/HuiStatic.h" |
|
26 |
|
27 |
|
28 EXPORT_C CHuiAnimatedTexture::CHuiAnimatedTexture(CHuiTextureManager& aManager) |
|
29 : iManager(aManager) |
|
30 { |
|
31 } |
|
32 |
|
33 |
|
34 EXPORT_C void CHuiAnimatedTexture::BaseConstructL() |
|
35 { |
|
36 iTexture = CHuiStatic::Renderer().CreateTextureL(); |
|
37 |
|
38 // Register automatically for time updates. |
|
39 iManager.iAnimatedTextures.AppendL(*this); |
|
40 } |
|
41 |
|
42 |
|
43 EXPORT_C CHuiAnimatedTexture::~CHuiAnimatedTexture() |
|
44 { |
|
45 iManager.iAnimatedTextures.RemoveIfFound(*this); |
|
46 |
|
47 delete iTexture; |
|
48 } |
|
49 |
|
50 |
|
51 EXPORT_C CHuiTexture& CHuiAnimatedTexture::Texture() |
|
52 { |
|
53 return *iTexture; |
|
54 } |
|
55 |
|
56 |
|
57 EXPORT_C MHuiSegmentedTexture* CHuiAnimatedTexture::SegmentedTexture() |
|
58 { |
|
59 return this; |
|
60 } |
|
61 |
|
62 |
|
63 EXPORT_C MHuiShadowedTexture* CHuiAnimatedTexture::ShadowedTexture() |
|
64 { |
|
65 return NULL; |
|
66 } |
|
67 |
|
68 |
|
69 EXPORT_C const MHuiSegmentedTexture* CHuiAnimatedTexture::SegmentedTexture() const |
|
70 { |
|
71 return this; |
|
72 } |
|
73 |
|
74 |
|
75 EXPORT_C const MHuiShadowedTexture* CHuiAnimatedTexture::ShadowedTexture() const |
|
76 { |
|
77 return NULL; |
|
78 } |
|
79 |
|
80 |
|
81 EXPORT_C TBool CHuiAnimatedTexture::HasContent() const |
|
82 { |
|
83 return iTexture->HasContent(); |
|
84 } |
|
85 |
|
86 |
|
87 EXPORT_C TSize CHuiAnimatedTexture::Size() const |
|
88 { |
|
89 return iTexture->Size(); |
|
90 } |
|
91 |
|
92 |
|
93 EXPORT_C TInt CHuiAnimatedTexture::SegmentCount() const |
|
94 { |
|
95 return iTexture->SegmentCount(); |
|
96 } |
|
97 |
|
98 |
|
99 EXPORT_C TUint CHuiAnimatedTexture::SegmentName(TInt aSegment) const |
|
100 { |
|
101 return iTexture->SegmentName(aSegment); |
|
102 } |
|
103 |
|
104 |
|
105 EXPORT_C TSize CHuiAnimatedTexture::SegmentSize(TInt aSegment) const |
|
106 { |
|
107 return iTexture->SegmentSize(aSegment); |
|
108 } |
|
109 |
|
110 |
|
111 EXPORT_C TSize CHuiAnimatedTexture::SegmentTextureSize(TInt aSegment) const |
|
112 { |
|
113 return iTexture->SegmentTextureSize(aSegment); |
|
114 } |
|
115 |
|
116 |
|
117 EXPORT_C TPoint CHuiAnimatedTexture::SegmentOffset(TInt aSegment) const |
|
118 { |
|
119 return iTexture->SegmentOffset(aSegment); |
|
120 } |
|
121 |
|
122 EXPORT_C TBool CHuiAnimatedTexture::TextureChanged() const |
|
123 { |
|
124 if (iTexture) |
|
125 { |
|
126 return iTexture->TextureChanged(); |
|
127 } |
|
128 return EFalse; |
|
129 } |
|
130 |
|
131 EXPORT_C void CHuiAnimatedTexture::TextureClearChanged() const |
|
132 { |
|
133 if (iTexture) |
|
134 { |
|
135 iTexture->TextureClearChanged(); |
|
136 } |
|
137 return; |
|
138 } |
|
139 |
|
140 EXPORT_C void CHuiAnimatedTexture::TextureExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParameters*/) |
|
141 { |
|
142 |
|
143 } |