|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <gulicon.h> |
|
20 #include <liwbufferextension.h> |
|
21 #include "hnextbmpiconholder.h" |
|
22 |
|
23 // --------------------------------------------------------------------------- |
|
24 // |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 EXPORT_C void CHnExtBmpIconHolder::SetGulIcon( CGulIcon* aGulIcon, |
|
28 CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer ) |
|
29 { |
|
30 __ASSERT_DEBUG( aGulIcon && aBmpBuffer, User::Invariant() ); |
|
31 |
|
32 if ( aGulIcon ) |
|
33 { |
|
34 __ASSERT_DEBUG( aGulIcon->BitmapsOwnedExternally(), User::Invariant() ); |
|
35 CHnIconHolder::SetGulIcon( aGulIcon ); |
|
36 aGulIcon->SetBitmapsOwnedExternally( ETrue ); |
|
37 if ( aBmpBuffer ) |
|
38 { |
|
39 iBmpBuffer = aBmpBuffer; |
|
40 iBmpBuffer->IncRef(); |
|
41 } |
|
42 if ( aMaskBuffer ) |
|
43 { |
|
44 iMaskBuffer = aMaskBuffer; |
|
45 iMaskBuffer->IncRef(); |
|
46 } |
|
47 } |
|
48 } |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 // --------------------------------------------------------------------------- |
|
53 // |
|
54 CHnExtBmpIconHolder::~CHnExtBmpIconHolder() |
|
55 { |
|
56 if ( iBmpBuffer ) |
|
57 { |
|
58 iBmpBuffer->DecRef(); |
|
59 } |
|
60 if ( iMaskBuffer ) |
|
61 { |
|
62 iMaskBuffer->DecRef(); |
|
63 } |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 void CHnExtBmpIconHolder::CleanBmpBuffer() |
|
71 { |
|
72 if ( iBmpBuffer ) |
|
73 { |
|
74 iBmpBuffer->DecRef(); |
|
75 iBmpBuffer = NULL; |
|
76 } |
|
77 if ( iMaskBuffer ) |
|
78 { |
|
79 iMaskBuffer->DecRef(); |
|
80 iMaskBuffer = NULL; |
|
81 } |
|
82 } |