summaryrefslogtreecommitdiff
path: root/svx/source/sdr/contact/viewcontactofgraphic.cxx
blob: 9b3953754108fc768d81ce022229177d058563af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: viewcontactofgraphic.cxx,v $
 *
 *  $Revision: 1.12 $
 *
 *  last change: $Author: ihi $ $Date: 2007-11-26 14:52:14 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"

#ifndef _SDR_CONTACT_VIEWCONTACTOFGRAPHIC_HXX
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
#endif

#ifndef _SVDOGRAF_HXX
#include <svx/svdograf.hxx>
#endif

#ifndef _SDR_ANIMATION_AINFOGRAPHIC_HXX
#include <svx/sdr/animation/ainfographic.hxx>
#endif

#ifndef _SDR_CONTACT_DISPLAYINFO_HXX
#include <svx/sdr/contact/displayinfo.hxx>
#endif

#ifndef _SDR_CONTACT_VIEWOBJECTCONTACT_HXX
#include <svx/sdr/contact/viewobjectcontact.hxx>
#endif

#ifndef _SDR_CONTACT_OBJECTCONTACT_HXX
#include <svx/sdr/contact/objectcontact.hxx>
#endif

#ifndef _SDR_EVENT_EVENTHANDLER_HXX
#include <svx/sdr/event/eventhandler.hxx>
#endif

#include "svdstr.hrc"

#ifndef _SVDGLOB_HXX
#include <svdglob.hxx>
#endif

//////////////////////////////////////////////////////////////////////////////

namespace sdr
{
    namespace event
    {
        class AsynchGraphicLoadingEvent : public BaseEvent
        {
            // the ViewContactOfGraphic to work with
            sdr::contact::ViewContactOfGraphic&     mrVCOGraphic;

        public:
            // basic constructor.
            AsynchGraphicLoadingEvent(
                EventHandler& rEventHandler, sdr::contact::ViewContactOfGraphic& rVCOGraphic);

            // destructor
            virtual ~AsynchGraphicLoadingEvent();

            // the called method if the event is triggered
            virtual void ExecuteEvent();
        };

        AsynchGraphicLoadingEvent::AsynchGraphicLoadingEvent(
            EventHandler& rEventHandler, sdr::contact::ViewContactOfGraphic& rVCOGraphic)
        :   BaseEvent(rEventHandler),
            mrVCOGraphic(rVCOGraphic)
        {
        }

        AsynchGraphicLoadingEvent::~AsynchGraphicLoadingEvent()
        {
            mrVCOGraphic.ForgetAsynchGraphicLoadingEvent(this);
        }

        void AsynchGraphicLoadingEvent::ExecuteEvent()
        {
            mrVCOGraphic.DoAsynchGraphicLoading();
        }
    } // end of namespace event
} // end of namespace sdr

//////////////////////////////////////////////////////////////////////////////

namespace sdr
{
    namespace contact
    {
        // Test graphics state and eventually trigger a SwapIn event or an Asynchronous
        // load event. Return value gives info if SwapIn was triggered.
        sal_Bool ViewContactOfGraphic::ImpPrepareForPaint(
            DisplayInfo& rDisplayInfo, const ViewObjectContact& rAssociatedVOC)
        {
            sal_Bool bRetval(sal_False);
            SdrGrafObj& rGrafObj = GetGrafObject();

            // 2nd part should not be necessary when all graphics creationg instances set
            // the SwapState correctly. It was there for historical reasons since before
            // the SwapState could be set it was simply 'tried' to SwapIn a GRAPHIC_NONE
            if(rGrafObj.IsSwappedOut() /*|| (GRAPHIC_NONE == rGrafObj.GetGraphicType())*/)
            {
                if(rGrafObj.IsLinkedGraphic())
                {
                    // update graphic link
                    rGrafObj.ImpUpdateGraphicLink();
                }
                else
                {
                    // SwapIn needs to be done. Decide if it can be done asynchronious.
                    sal_Bool bSwapInAsynchronious(sal_False);
                    ObjectContact& rObjectContact = rAssociatedVOC.GetObjectContact();

                    // only when allowed from configuration
                    if(rObjectContact.IsAsynchronGraphicsLoadingAllowed())
                    {
                        // direct output or vdev output (PageView buffering)
                        if(rDisplayInfo.OutputToWindow() || rDisplayInfo.OutputToVirtualDevice())
                        {
                            // only when no metafile recording
                            if(!rDisplayInfo.OutputToRecordingMetaFile())
                            {
                                // allow asynchronious loading
                                bSwapInAsynchronious = sal_True;
                            }
                        }
                    }

                    if(bSwapInAsynchronious)
                    {
                        // maybe it's on the way, then do nothing
                        if(!mpAsynchLoadEvent)
                        {
                            // Trigger asynchronious SwapIn.
                            sdr::event::TimerEventHandler& rEventHandler = rObjectContact.GetEventHandler();

                            mpAsynchLoadEvent = new sdr::event::AsynchGraphicLoadingEvent(
                                rEventHandler, *this);
                        }
                    }
                    else
                    {
                        if ( rDisplayInfo.OutputToPrinter() )   // #i76395# preview mechanism is only active if
                            rGrafObj.ForceSwapIn();             // swapin is called from inside paint, so mbInsidePaint
                        else                                    // has to be false to be able to print with high resolution
                        {
                            // SwapIn direct
                            rGrafObj.mbInsidePaint = sal_True;
                            rGrafObj.ForceSwapIn();
                            rGrafObj.mbInsidePaint = sal_False;
                        }
                        bRetval = sal_True;
                    }
                }
            }
            else
            {
                // it is not swapped out, somehow it was loaded. In that case, forget
                // about an existing triggered event
                if(mpAsynchLoadEvent)
                {
                    // just delete it, this will remove it from the EventHandler and
                    // will trigger ForgetAsynchGraphicLoadingEvent from the destructor
                    delete mpAsynchLoadEvent;
                }
            }

            return bRetval;
        }

        // method to create a AnimationInfo. Needs to give a result if
        // SupportsAnimation() is overloaded and returns sal_True.
        sdr::animation::AnimationInfo* ViewContactOfGraphic::CreateAnimationInfo()
        {
            sdr::animation::AnimationInfo* pRetval = 0L;
            SdrGrafObj& rGrafObj = GetGrafObject();

            if(GRAPHIC_BITMAP == rGrafObj.GetGraphicType() && rGrafObj.IsAnimated())
            {
                pRetval = new sdr::animation::AInfoGraphic(GetGrafObject());
            }

            if(!pRetval)
            {
                // something went wrong
                DBG_ERROR("ViewContactOfGraphic::CreateAnimationInfo(): no anim, but SupportsAnimation (!)");
                pRetval = new sdr::animation::AInfoDummy();
            }

            return pRetval;
        }

        // For draft object display
        sal_Bool ViewContactOfGraphic::PaintGraphicDraft(
            DisplayInfo& rDisplayInfo, Rectangle& rPaintRectangle, const ViewObjectContact& /*rAssociatedVOC*/)
        {
            sal_Bool bRetval(sal_False);
            SdrGrafObj& rGrafObj = GetGrafObject();

            // paint a shadowed frame in object size, not filled
            Rectangle aUnrotatedRectangle;
            rGrafObj.TakeUnrotatedSnapRect(aUnrotatedRectangle);
            const GeoStat& rGeometric = rGrafObj.GetGeoStat();
            bRetval = PaintShadowedFrame(rDisplayInfo, rPaintRectangle, aUnrotatedRectangle, rGeometric, sal_False);

            // draw a draft bitmap
            Bitmap aDraftBitmap(ResId(BMAP_GrafikEi, *ImpGetResMgr()));
            Rectangle aBitmapOutRect;
            bRetval |= PaintDraftBitmap(rDisplayInfo, aBitmapOutRect, aUnrotatedRectangle, rGeometric, aDraftBitmap);
            rPaintRectangle.Union(aBitmapOutRect);

            // Build the text for the draft object
            XubString aDraftText = rGrafObj.GetFileName();

            if(!aDraftText.Len())
            {
                aDraftText = rGrafObj.GetName();

                // if loading add a hint for that
                if(mpAsynchLoadEvent)
                {
                    aDraftText.AppendAscii(" ...");
                }
            }

            if(aDraftText.Len())
            {
                OutputDevice* pOutDev = rDisplayInfo.GetOutputDevice();
                const Size aBitmapSize(pOutDev->PixelToLogic(aDraftBitmap.GetSizePixel()));

                if(aUnrotatedRectangle.GetWidth() > aBitmapSize.Width())
                {
                    // calc a rectangle right from graphic
                    Rectangle aRightRectangle(aUnrotatedRectangle);
                    aRightRectangle.Left() += aBitmapSize.Width();

                    // Paint DraftText
                    Rectangle aTextOutRect;
                    bRetval |= PaintDraftText(rDisplayInfo, aTextOutRect, aRightRectangle, rGeometric, aDraftText, rGrafObj.IsLinkedGraphic());
                    rPaintRectangle.Union(aTextOutRect);
                }
            }

            // If there is text in the object below, render it, too.
            if(rGrafObj.HasText())
            {
                // force only text paint at SdrObject
                rGrafObj.SdrTextObj::DoPaintObject(
                    *rDisplayInfo.GetExtendedOutputDevice(),
                    *rDisplayInfo.GetPaintInfoRec());
                bRetval = sal_True;
                rPaintRectangle.Union(rGrafObj.SdrTextObj::GetCurrentBoundRect());
            }

            return bRetval;
        }

        // For empty Graphic PresObj display
        sal_Bool ViewContactOfGraphic::PaintGraphicPresObj(
            DisplayInfo& rDisplayInfo, Rectangle& rPaintRectangle, const ViewObjectContact& /*rAssociatedVOC*/)
        {
            sal_Bool bRetval(sal_False);
            OutputDevice* pOutDev = rDisplayInfo.GetOutputDevice();
            MapMode aDstMapMode(pOutDev->GetMapMode().GetMapUnit());
            rPaintRectangle = GetPaintRectangle();
            Point aPos(rPaintRectangle.Center());
            Size aSize;

            // get size of the graphic in output device units
            SdrGrafObj& rGrafObj = GetGrafObject();
            const MapMode& rGrafMapMode = rGrafObj.GetGrafPrefMapMode();
            const Size& rGrafPrefSize = rGrafObj.GetGrafPrefSize();

            if(MAP_PIXEL == rGrafMapMode.GetMapUnit())
            {
                aSize = pOutDev->PixelToLogic(rGrafPrefSize, aDstMapMode);
            }
            else
            {
                aSize = pOutDev->LogicToLogic(rGrafPrefSize, rGrafMapMode, aDstMapMode);
            }

            // calculate upper left position for painting the graphic
            aPos.X() -= (aSize.Width() >> 1);
            aPos.Y() -= (aSize.Height() >> 1);

            if(aPos.X() >= rPaintRectangle.Left() && aPos.Y() >= rPaintRectangle.Top())
            {
                // centered graphic fits inside object
                if(GRAPHIC_BITMAP == rGrafObj.GetGraphicType())
                {
                    rGrafObj.DrawGraphic(pOutDev, aPos, aSize);
                }
                else
                {
                    const sal_uInt32 nOldDrawMode(pOutDev->GetDrawMode());

                    if(0L != (nOldDrawMode & DRAWMODE_GRAYBITMAP ))
                    {
                        // If GRAYBITMAP is used, render MetaFiles with gray, too
                        sal_uInt32 nNewDrawMode(nOldDrawMode);

                        nNewDrawMode &= ~(DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_WHITEFILL | DRAWMODE_NOFILL);
                        nNewDrawMode |= DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL;

                        pOutDev->SetDrawMode(nNewDrawMode);
                    }

                    // paint graphic
                    rGrafObj.DrawGraphic(pOutDev, aPos, aSize);

                    // restore DrawMode
                    pOutDev->SetDrawMode(nOldDrawMode);
                }

                // set parameters
                bRetval = sal_True;
            }
            else
            {
                // paint a shadowed frame in object size, filled
                Rectangle aUnrotatedRectangle;
                rGrafObj.TakeUnrotatedSnapRect(aUnrotatedRectangle);
                const GeoStat& rGeometric = rGrafObj.GetGeoStat();
                bRetval = PaintShadowedFrame(rDisplayInfo, rPaintRectangle, aUnrotatedRectangle, rGeometric, sal_True);
            }

            // If there is text in the object below, render it, too.
            if(rGrafObj.HasText())
            {
                // force only text paint at SdrObject
                rGrafObj.SdrTextObj::DoPaintObject(
                    *rDisplayInfo.GetExtendedOutputDevice(),
                    *rDisplayInfo.GetPaintInfoRec());
                bRetval = sal_True;
                rPaintRectangle.Union(rGrafObj.SdrTextObj::GetCurrentBoundRect());
            }

            return bRetval;
        }

        // Decide if graphic should be painted as draft
        sal_Bool ViewContactOfGraphic::DoPaintGraphicDraft() const
        {
            SdrGrafObj& rGrafObj = GetGrafObject();

            if( !rGrafObj.mbIsPreview && rGrafObj.IsSwappedOut())
            {
                return sal_True;
            }

            if(GRAPHIC_DEFAULT == rGrafObj.GetGraphicType() || GRAPHIC_NONE == rGrafObj.GetGraphicType())
            {
                return sal_True;
            }

            if(rGrafObj.IsEmptyPresObj())
            {
                return sal_True;
            }

            return sal_False;
        }

        void ViewContactOfGraphic::StopGettingViewed()
        {
            // call parent
            ViewContactOfTextObj::StopGettingViewed();

            // If there is an event triggered and no one is visualizing this object,
            // get rid of the event
            if(mpAsynchLoadEvent)
            {
                // just delete it, this will remove it from the EventHandler and
                // will trigger ForgetAsynchGraphicLoadingEvent from the destructor
                delete mpAsynchLoadEvent;
            }
        }

        ViewContactOfGraphic::ViewContactOfGraphic(SdrGrafObj& rGrafObj)
        :   ViewContactOfTextObj(rGrafObj),
            mpAsynchLoadEvent(0L)
        {
        }

        ViewContactOfGraphic::~ViewContactOfGraphic()
        {
            DBG_ASSERT(0L == mpAsynchLoadEvent,
                "ViewContactOfGraphic destructor: mpAsynchLoadEvent is not empty, call PrepareDelete() before deleting (!)");
        }

        // Prepare deletion of this object. Tghis needs to be called always
        // before really deleting this objects. This is necessary since in a c++
        // destructor no virtual function calls are allowed. To avoid this problem,
        // it is required to first call PrepareDelete().
        void ViewContactOfGraphic::PrepareDelete()
        {
            // call parent
            ViewContactOfTextObj::PrepareDelete();

            // evtl. delete the asynch loading event
            if(mpAsynchLoadEvent)
            {
                // just delete it, this will remove it from the EventHandler and
                // will trigger ForgetAsynchGraphicLoadingEvent from the destructor
                delete mpAsynchLoadEvent;
            }
        }

        // When ShouldPaintObject() returns sal_True, the object itself is painted and
        // PaintObject() is called.
        sal_Bool ViewContactOfGraphic::ShouldPaintObject(
            DisplayInfo& rDisplayInfo, const ViewObjectContact& rAssociatedVOC)
        {
            // Test if its a empty presobj, those should not be printed
            if(GetGrafObject().IsEmptyPresObj() && rDisplayInfo.OutputToPrinter())
            {
                return sal_False;
            }

            // return parent
            return ViewContactOfTextObj::ShouldPaintObject(rDisplayInfo, rAssociatedVOC);
        }

        sal_Bool ViewContactOfGraphic::PaintObject(
            DisplayInfo& rDisplayInfo, Rectangle& rPaintRectangle,
            const ViewObjectContact& rAssociatedVOC)
        {
            sal_Bool bRetval(sal_False);

            // Test graphics state and eventually trigger a SwapIn event or an Asynchronous
            // load event. Return value gives info if SwapIn was triggered.
            sal_Bool bSwapInDone = ImpPrepareForPaint(rDisplayInfo, rAssociatedVOC);
            sal_Bool bSwapInExclusiveForPrinting = (bSwapInDone && rDisplayInfo.OutputToPrinter());

            if(DoPaintGraphicDraft())
            {
                if(GetGrafObject().IsEmptyPresObj())
                {
                    // Draw empty Graphic PresObj
                    bRetval = PaintGraphicPresObj(rDisplayInfo, rPaintRectangle, rAssociatedVOC);
                }
                else
                {
                    // Draw as draft
                    bRetval = PaintGraphicDraft(rDisplayInfo, rPaintRectangle, rAssociatedVOC);
                }
            }
            else
            {
                // call parent
                bRetval = ViewContactOfTextObj::PaintObject(rDisplayInfo, rPaintRectangle, rAssociatedVOC);
            }

            // If graphic was only swapped in for printing, swap  out again
            if(bSwapInExclusiveForPrinting)
            {
                GetGrafObject().ForceSwapOut();
            }
            else
            {
                // if was swapped in, animation may be possible now.
                if(bSwapInDone)
                {
                    // check existing animation. This may create or delete an AnimationInfo.
                    CheckAnimationFeatures();

                    if(maVOCList.Count() > 1L)
                    {
                        // more VOCs then only rAssociatedVOC use this object. Tell them about the
                        // change. Since we want no extra-redraw of rAssociatedVOC, i do not call
                        // ActionCanged() here, but invalidate the single VOCs except the current one.
                        for(sal_uInt32 a(0L); a < maVOCList.Count(); a++)
                        {
                            ViewObjectContact* pCandidate = maVOCList.GetObject(a);
                            DBG_ASSERT(pCandidate, "ViewContact::GetViewObjectContact() invalid ViewObjectContactList (!)");

                            if(pCandidate != &rAssociatedVOC)
                            {
                                pCandidate->ActionChanged();
                            }
                        }
                    }
                }
            }

            return bRetval;
        }

        // React on removal of the object of this ViewContact,
        // DrawHierarchy needs to be changed
        void ViewContactOfGraphic::ActionRemoved()
        {
            // call parent
            ViewContactOfTextObj::ActionRemoved();

            // If an event is triggered, get rid of it since object is no longer
            // visible
            if(mpAsynchLoadEvent)
            {
                // just delete it, this will remove it from the EventHandler and
                // will trigger ForgetAsynchGraphicLoadingEvent from the destructor
                delete mpAsynchLoadEvent;
            }
        }

        sal_Bool ViewContactOfGraphic::SupportsAnimation() const
        {
            // #116168# If object is in destruction, force animation support to sal_False
            if(GetGrafObject().IsInDestruction())
            {
                return sal_False;
            }

            // Is animation allowed?
            if(!GetGrafObject().IsGrafAnimationAllowed())
            {
                return sal_False;
            }

            // Is the graphica animated at all?
            if(!GetGrafObject().IsAnimated())
            {
                return sal_False;
            }

            // Is bitmap type?
            if(GRAPHIC_BITMAP != GetGrafObject().GetGraphicType())
            {
                return sal_False;
            }

            // It's a bitmap and it's animated and animation is allowed.
            return sal_True;
        }

        // This is the call from the asynch graphic loading. This may only be called from
        // AsynchGraphicLoadingEvent::ExecuteEvent(). Do load the graphics. The event will
        // be deleted (consumed) and ForgetAsynchGraphicLoadingEvent will be called.
        void ViewContactOfGraphic::DoAsynchGraphicLoading()
        {
            DBG_ASSERT(mpAsynchLoadEvent,
                "ViewContactOfGraphic::DoAsynchGraphicLoading: I did not trigger a event, why am i called (?)");

            // swap it in
            SdrGrafObj& rGrafObj = GetGrafObject();
            rGrafObj.ForceSwapIn();

            // Invalidate paint area and check existing animation (which may have changed).
            ActionChanged();
        }

        // This is the call from the destructor of the asynch graphic loading event.
        // No one else has to call this. It is needed to let this object forget about
        // the event. The parameter allows checking for the correct event.
        void ViewContactOfGraphic::ForgetAsynchGraphicLoadingEvent(sdr::event::AsynchGraphicLoadingEvent* pEvent)
        {
            (void) pEvent; // suppress warning
            DBG_ASSERT(mpAsynchLoadEvent,
                "ViewContactOfGraphic::ForgetAsynchGraphicLoadingEvent: I did not trigger a event, why am i called (?)");
            DBG_ASSERT(mpAsynchLoadEvent == pEvent,
                "ViewContactOfGraphic::ForgetAsynchGraphicLoadingEvent: Forced to forget another event then i have scheduled (?)");

            // forget event
            mpAsynchLoadEvent = 0L;
        }
    } // end of namespace contact
} // end of namespace sdr

//////////////////////////////////////////////////////////////////////////////
// eof