1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "officecfg/Office/Common.hxx"
22 #include <vcl/print.hxx>
23 #include <sal/macros.h>
25 #include "osx/salinst.h"
26 #include "osx/salprn.h"
27 #include "osx/printview.h"
28 #include "quartz/salgdi.h"
29 #include "osx/saldata.hxx"
30 #include "quartz/utils.h"
33 #include "salptype.hxx"
35 #include "com/sun/star/beans/PropertyValue.hpp"
36 #include "com/sun/star/awt/Size.hpp"
37 #include "com/sun/star/uno/Sequence.hxx"
43 using namespace com::sun::star
;
44 using namespace com::sun::star::beans
;
46 AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo
& i_rQueue
) :
47 mpGraphics( nullptr ),
52 mePageOrientation( Orientation::Portrait
),
53 mnStartPageOffsetX( 0 ),
54 mnStartPageOffsetY( 0 ),
55 mnCurPageRangeStart( 0 ),
56 mnCurPageRangeCount( 0 )
58 NSString
* pStr
= CreateNSString( i_rQueue
.maPrinterName
);
59 mpPrinter
= [NSPrinter printerWithName
: pStr
];
62 NSPrintInfo
* pShared
= [NSPrintInfo sharedPrintInfo
];
65 mpPrintInfo
= [pShared copy
];
66 [mpPrintInfo setPrinter
: mpPrinter
];
67 #if MACOSX_SDK_VERSION >= 1090
68 mePageOrientation
= ([mpPrintInfo orientation
] == NSPaperOrientationPortrait
) ? Orientation::Landscape
: Orientation::Portrait
;
69 [mpPrintInfo setOrientation
: NSPaperOrientationPortrait
];
71 mePageOrientation
= ([mpPrintInfo orientation
] == NSLandscapeOrientation
) ? Orientation::Landscape
: Orientation::Portrait
;
72 [mpPrintInfo setOrientation
: NSPortraitOrientation
];
76 mpGraphics
= new AquaSalGraphics();
78 const int nWidth
= 100, nHeight
= 100;
79 mpContextMemory
.reset(static_cast<sal_uInt8
*>(rtl_allocateMemory(nWidth
* 4 * nHeight
)),
84 mrContext
= CGBitmapContextCreate(mpContextMemory
.get(),
85 nWidth
, nHeight
, 8, nWidth
* 4,
86 GetSalData()->mxRGBSpace
, kCGImageAlphaNoneSkipFirst
);
88 SetupPrinterGraphics( mrContext
);
92 AquaSalInfoPrinter::~AquaSalInfoPrinter()
96 [mpPrintInfo release
];
98 CFRelease( mrContext
);
101 void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext
) const
107 // FIXME: get printer resolution
108 long nDPIX
= 720, nDPIY
= 720;
109 NSSize aPaperSize
= [mpPrintInfo paperSize
];
111 NSRect aImageRect
= [mpPrintInfo imageablePageBounds
];
112 if( mePageOrientation
== Orientation::Portrait
)
114 // move mirrored CTM back into paper
115 double dX
= 0, dY
= aPaperSize
.height
;
116 // move CTM to reflect imageable area
117 dX
+= aImageRect
.origin
.x
;
118 dY
-= aPaperSize
.height
- aImageRect
.size
.height
- aImageRect
.origin
.y
;
119 CGContextTranslateCTM( i_rContext
, dX
+ mnStartPageOffsetX
, dY
- mnStartPageOffsetY
);
120 // scale to be top/down and reflect our "virtual" DPI
121 CGContextScaleCTM( i_rContext
, 72.0/double(nDPIX
), -(72.0/double(nDPIY
)) );
125 // move CTM to reflect imageable area
126 double dX
= aImageRect
.origin
.x
, dY
= aPaperSize
.height
- aImageRect
.size
.height
- aImageRect
.origin
.y
;
127 CGContextTranslateCTM( i_rContext
, -dX
, -dY
);
129 CGContextRotateCTM( i_rContext
, M_PI
/2 );
130 // move turned CTM back into paper
131 dX
= aPaperSize
.height
;
132 dY
= -aPaperSize
.width
;
133 CGContextTranslateCTM( i_rContext
, dX
+ mnStartPageOffsetY
, dY
- mnStartPageOffsetX
);
134 // scale to be top/down and reflect our "virtual" DPI
135 CGContextScaleCTM( i_rContext
, -(72.0/double(nDPIY
)), (72.0/double(nDPIX
)) );
137 mpGraphics
->SetPrinterGraphics( i_rContext
, nDPIX
, nDPIY
);
140 OSL_FAIL( "no print info in SetupPrinterGraphics" );
144 SalGraphics
* AquaSalInfoPrinter::AcquireGraphics()
146 SalGraphics
* pGraphics
= mbGraphics
? nullptr : mpGraphics
;
151 void AquaSalInfoPrinter::ReleaseGraphics( SalGraphics
* )
156 bool AquaSalInfoPrinter::Setup( SalFrame
*, ImplJobSetup
* )
161 bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup
* io_pSetupData
)
163 // FIXME: implement driver data
164 if( io_pSetupData
&& io_pSetupData
->GetDriverData() )
165 return SetData( JobSetFlags::ALL
, io_pSetupData
);
167 bool bSuccess
= true;
170 io_pSetupData
->SetSystem( JOBSETUP_SYSTEM_MAC
);
175 NSSize aPaperSize
= [mpPrintInfo paperSize
];
176 double width
= aPaperSize
.width
, height
= aPaperSize
.height
;
178 PaperInfo
aInfo( PtTo10Mu( width
), PtTo10Mu( height
) );
180 io_pSetupData
->SetPaperFormat( aInfo
.getPaper() );
181 if( io_pSetupData
->GetPaperFormat() == PAPER_USER
)
183 io_pSetupData
->SetPaperWidth( PtTo10Mu( width
) );
184 io_pSetupData
->SetPaperHeight( PtTo10Mu( height
) );
188 io_pSetupData
->SetPaperWidth( 0 );
189 io_pSetupData
->SetPaperHeight( 0 );
193 io_pSetupData
->SetOrientation( mePageOrientation
);
195 io_pSetupData
->SetPaperBin( 0 );
196 io_pSetupData
->SetDriverData( static_cast<sal_uInt8
*>(rtl_allocateMemory( 4 )) );
197 io_pSetupData
->SetDriverDataLen( 4 );
205 void AquaSalInfoPrinter::setPaperSize( long i_nWidth
, long i_nHeight
, Orientation i_eSetOrientation
)
208 Orientation ePaperOrientation
= Orientation::Portrait
;
209 const PaperInfo
* pPaper
= matchPaper( i_nWidth
, i_nHeight
, ePaperOrientation
);
213 NSString
* pPaperName
= [CreateNSString( OStringToOUString(PaperInfo::toPSName(pPaper
->getPaper()), RTL_TEXTENCODING_ASCII_US
) ) autorelease
];
214 [mpPrintInfo setPaperName
: pPaperName
];
216 else if( i_nWidth
> 0 && i_nHeight
> 0 )
218 NSSize aPaperSize
= { static_cast<CGFloat
>(TenMuToPt(i_nWidth
)), static_cast<CGFloat
>(TenMuToPt(i_nHeight
)) };
219 [mpPrintInfo setPaperSize
: aPaperSize
];
221 // this seems counterintuitive
222 mePageOrientation
= i_eSetOrientation
;
225 bool AquaSalInfoPrinter::SetData( JobSetFlags i_nFlags
, ImplJobSetup
* io_pSetupData
)
227 if( ! io_pSetupData
|| io_pSetupData
->GetSystem() != JOBSETUP_SYSTEM_MAC
)
232 if( i_nFlags
& JobSetFlags::ORIENTATION
)
233 mePageOrientation
= io_pSetupData
->GetOrientation();
235 if( i_nFlags
& JobSetFlags::PAPERSIZE
)
238 long width
= 21000, height
= 29700;
239 if( io_pSetupData
->GetPaperFormat() == PAPER_USER
)
241 // #i101108# sanity check
242 if( io_pSetupData
->GetPaperWidth() && io_pSetupData
->GetPaperHeight() )
244 width
= io_pSetupData
->GetPaperWidth();
245 height
= io_pSetupData
->GetPaperHeight();
250 PaperInfo
aInfo( io_pSetupData
->GetPaperFormat() );
251 width
= aInfo
.getWidth();
252 height
= aInfo
.getHeight();
255 setPaperSize( width
, height
, mePageOrientation
);
259 return mpPrintInfo
!= nil
;
262 sal_uInt16
AquaSalInfoPrinter::GetPaperBinCount( const ImplJobSetup
* )
267 OUString
AquaSalInfoPrinter::GetPaperBinName( const ImplJobSetup
*, sal_uInt16
)
272 sal_uInt32
AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup
*, PrinterCapType i_nType
)
276 case PrinterCapType::SupportDialog
:
278 case PrinterCapType::Copies
:
280 case PrinterCapType::CollateCopies
:
282 case PrinterCapType::SetOrientation
:
284 case PrinterCapType::SetPaperSize
:
286 case PrinterCapType::SetPaper
:
288 case PrinterCapType::ExternalDialog
:
289 return officecfg::Office::Common::Misc::UseSystemPrintDialog::get()
291 case PrinterCapType::PDF
:
293 case PrinterCapType::UsePullModel
:
300 void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup
*,
301 long& o_rOutWidth
, long& o_rOutHeight
,
302 long& o_rPageOffX
, long& o_rPageOffY
,
303 long& o_rPageWidth
, long& o_rPageHeight
)
307 sal_Int32 nDPIX
= 72, nDPIY
= 72;
308 mpGraphics
->GetResolution( nDPIX
, nDPIY
);
309 const double fXScaling
= static_cast<double>(nDPIX
)/72.0,
310 fYScaling
= static_cast<double>(nDPIY
)/72.0;
312 NSSize aPaperSize
= [mpPrintInfo paperSize
];
313 o_rPageWidth
= static_cast<long>( double(aPaperSize
.width
) * fXScaling
);
314 o_rPageHeight
= static_cast<long>( double(aPaperSize
.height
) * fYScaling
);
316 NSRect aImageRect
= [mpPrintInfo imageablePageBounds
];
317 o_rPageOffX
= static_cast<long>( aImageRect
.origin
.x
* fXScaling
);
318 o_rPageOffY
= static_cast<long>( (aPaperSize
.height
- aImageRect
.size
.height
- aImageRect
.origin
.y
) * fYScaling
);
319 o_rOutWidth
= static_cast<long>( aImageRect
.size
.width
* fXScaling
);
320 o_rOutHeight
= static_cast<long>( aImageRect
.size
.height
* fYScaling
);
322 if( mePageOrientation
== Orientation::Landscape
)
324 std::swap( o_rOutWidth
, o_rOutHeight
);
325 std::swap( o_rPageWidth
, o_rPageHeight
);
326 std::swap( o_rPageOffX
, o_rPageOffY
);
331 static Size
getPageSize( vcl::PrinterController
& i_rController
, sal_Int32 i_nPage
)
334 uno::Sequence
< PropertyValue
> aPageParms( i_rController
.getPageParameters( i_nPage
) );
335 for( sal_Int32 nProperty
= 0, nPropertyCount
= aPageParms
.getLength(); nProperty
< nPropertyCount
; ++nProperty
)
337 if ( aPageParms
[ nProperty
].Name
== "PageSize" )
340 aPageParms
[ nProperty
].Value
>>= aSize
;
341 aPageSize
.Width() = aSize
.Width
;
342 aPageSize
.Height() = aSize
.Height
;
349 bool AquaSalInfoPrinter::StartJob( const OUString
* i_pFileName
,
350 const OUString
& i_rJobName
,
351 const OUString
& /*i_rAppName*/,
352 ImplJobSetup
* i_pSetupData
,
353 vcl::PrinterController
& i_rController
359 bool bSuccess
= false;
360 bool bWasAborted
= false;
361 AquaSalInstance
* pInst
= GetSalData()->mpFirstInstance
;
362 PrintAccessoryViewState aAccViewState
;
363 sal_Int32 nAllPages
= 0;
366 i_rController
.setLastPage( false );
370 SetData( JobSetFlags::ALL
, i_pSetupData
);
372 // do we want a progress panel ?
373 bool bShowProgressPanel
= true;
374 beans::PropertyValue
* pMonitor
= i_rController
.getValue( OUString( "MonitorVisible" ) );
376 pMonitor
->Value
>>= bShowProgressPanel
;
377 if( ! i_rController
.isShowDialogs() )
378 bShowProgressPanel
= false;
380 // possibly create one job for collated output
381 bool bSinglePrintJobs
= false;
382 beans::PropertyValue
* pSingleValue
= i_rController
.getValue( OUString( "PrintCollateAsSingleJobs" ) );
385 pSingleValue
->Value
>>= bSinglePrintJobs
;
388 // FIXME: jobStarted() should be done after the print dialog has ended (if there is one)
389 // how do I know when that might be ?
390 i_rController
.jobStarted();
392 int nCopies
= i_rController
.getPrinter()->GetCopyCount();
394 if( bSinglePrintJobs
)
400 for( int nCurJob
= 0; nCurJob
< nJobs
; nCurJob
++ )
402 aAccViewState
.bNeedRestart
= true;
405 if( aAccViewState
.bNeedRestart
)
407 mnCurPageRangeStart
= 0;
408 mnCurPageRangeCount
= 0;
409 nAllPages
= i_rController
.getFilteredPageCount();
412 aAccViewState
.bNeedRestart
= false;
414 Size
aCurSize( 21000, 29700 );
417 mnCurPageRangeCount
= 1;
418 aCurSize
= getPageSize( i_rController
, mnCurPageRangeStart
);
419 Size
aNextSize( aCurSize
);
421 // print pages up to a different size
422 while( mnCurPageRangeCount
+ mnCurPageRangeStart
< nAllPages
)
424 aNextSize
= getPageSize( i_rController
, mnCurPageRangeStart
+ mnCurPageRangeCount
);
425 if( aCurSize
== aNextSize
// same page size
427 (aCurSize
.Width() == aNextSize
.Height() && aCurSize
.Height() == aNextSize
.Width()) // same size, but different orientation
430 mnCurPageRangeCount
++;
437 mnCurPageRangeCount
= 0;
439 // now for the current run
440 mnStartPageOffsetX
= mnStartPageOffsetY
= 0;
441 // setup the paper size and orientation
442 // do this on our associated Printer object, since that is
443 // out interface to the applications which occasionally rely on the paper
444 // information (e.g. brochure printing scales to the found paper size)
445 // also SetPaperSizeUser has the advantage that we can share a
446 // platform independent paper matching algorithm
447 VclPtr
<Printer
> pPrinter( i_rController
.getPrinter() );
448 pPrinter
->SetMapMode( MapMode( MapUnit::Map100thMM
) );
449 pPrinter
->SetPaperSizeUser( aCurSize
, true );
452 NSView
* pPrintView
= [[AquaPrintView alloc
] initWithController
: &i_rController withInfoPrinter
: this];
454 NSMutableDictionary
* pPrintDict
= [mpPrintInfo dictionary
];
459 [mpPrintInfo setJobDisposition
: NSPrintSaveJob
];
460 NSString
* pPath
= CreateNSString( *i_pFileName
);
461 [pPrintDict setObject
:[NSURL fileURLWithPath
:pPath
] forKey
:NSPrintJobSavingURL
];
465 [pPrintDict setObject
: [[NSNumber numberWithInt
: nCopies
] autorelease
] forKey
: NSPrintCopies
];
467 [pPrintDict setObject
: [[NSNumber numberWithBool
: pPrinter
->IsCollateCopy()] autorelease
] forKey
: NSPrintMustCollate
];
468 [pPrintDict setObject
: [[NSNumber numberWithBool
: YES
] autorelease
] forKey
: NSPrintDetailedErrorReporting
];
469 [pPrintDict setObject
: [[NSNumber numberWithInt
: 1] autorelease
] forKey
: NSPrintFirstPage
];
470 // #i103253# weird: for some reason, autoreleasing the value below like the others above
471 // leads do a double free malloc error. Why this value should behave differently from all the others
473 [pPrintDict setObject
: [NSNumber numberWithInt
: mnCurPageRangeCount
] forKey
: NSPrintLastPage
];
475 // create print operation
476 NSPrintOperation
* pPrintOperation
= [NSPrintOperation printOperationWithView
: pPrintView printInfo
: mpPrintInfo
];
478 if( pPrintOperation
)
480 NSObject
* pReleaseAfterUse
= nil
;
481 bool bShowPanel
= !i_rController
.isDirectPrint()
482 && (officecfg::Office::Common::Misc::UseSystemPrintDialog::
484 && i_rController
.isShowDialogs();
485 [pPrintOperation setShowsPrintPanel
: bShowPanel
? YES
: NO
];
486 [pPrintOperation setShowsProgressPanel
: bShowProgressPanel
? YES
: NO
];
488 // set job title (since MacOSX 10.5)
489 if( [pPrintOperation respondsToSelector
: @
selector(setJobTitle
:)] )
490 [pPrintOperation performSelector
: @
selector(setJobTitle
:) withObject
: [CreateNSString( i_rJobName
) autorelease
]];
492 if( bShowPanel
&& mnCurPageRangeStart
== 0 && nCurJob
== 0) // only the first range of pages (in the first job) gets the accessory view
493 pReleaseAfterUse
= [AquaPrintAccessoryView setupPrinterPanel
: pPrintOperation withController
: &i_rController withState
: &aAccViewState
];
497 pInst
->startedPrintJob();
498 BOOL wasSuccessful
= [pPrintOperation runOperation
];
499 pInst
->endedPrintJob();
500 bSuccess
= wasSuccessful
;
501 bWasAborted
= [[[pPrintOperation printInfo
] jobDisposition
] compare
: NSPrintCancelJob
] == NSOrderedSame
;
503 if( pReleaseAfterUse
)
504 [pReleaseAfterUse release
];
507 mnCurPageRangeStart
+= mnCurPageRangeCount
;
508 mnCurPageRangeCount
= 1;
509 } while( aAccViewState
.bNeedRestart
|| mnCurPageRangeStart
+ mnCurPageRangeCount
< nAllPages
);
512 // inform application that it can release its data
513 // this is awkward, but the XRenderable interface has no method for this,
514 // so we need to call XRenderadble::render one last time with IsLastPage = true
515 i_rController
.setLastPage( true );
516 GDIMetaFile aPageFile
;
518 SetupPrinterGraphics( mrContext
);
519 i_rController
.getFilteredPageFile( 0, aPageFile
);
521 i_rController
.setJobState( bWasAborted
522 ? view::PrintableState_JOB_ABORTED
523 : view::PrintableState_JOB_SPOOLED
);
525 mnCurPageRangeStart
= mnCurPageRangeCount
= 0;
530 bool AquaSalInfoPrinter::EndJob()
532 mnStartPageOffsetX
= mnStartPageOffsetY
= 0;
537 bool AquaSalInfoPrinter::AbortJob()
541 // FIXME: implementation
545 SalGraphics
* AquaSalInfoPrinter::StartPage( ImplJobSetup
* i_pSetupData
, bool i_bNewJobData
)
547 if( i_bNewJobData
&& i_pSetupData
)
548 SetPrinterData( i_pSetupData
);
550 CGContextRef rContext
= static_cast<CGContextRef
>([[NSGraphicsContext currentContext
] graphicsPort
]);
552 SetupPrinterGraphics( rContext
);
557 bool AquaSalInfoPrinter::EndPage()
559 mpGraphics
->InvalidateContext();
563 sal_uLong
AquaSalInfoPrinter::GetErrorCode()
568 AquaSalPrinter::AquaSalPrinter( AquaSalInfoPrinter
* i_pInfoPrinter
) :
569 mpInfoPrinter( i_pInfoPrinter
)
573 AquaSalPrinter::~AquaSalPrinter()
577 bool AquaSalPrinter::StartJob( const OUString
* i_pFileName
,
578 const OUString
& i_rJobName
,
579 const OUString
& i_rAppName
,
580 ImplJobSetup
* i_pSetupData
,
581 vcl::PrinterController
& i_rController
)
583 return mpInfoPrinter
->StartJob( i_pFileName
, i_rJobName
, i_rAppName
, i_pSetupData
, i_rController
);
586 bool AquaSalPrinter::StartJob( const OUString
* /*i_pFileName*/,
587 const OUString
& /*i_rJobName*/,
588 const OUString
& /*i_rAppName*/,
589 sal_uInt32
/*i_nCopies*/,
594 OSL_FAIL( "should never be called" );
598 bool AquaSalPrinter::EndJob()
600 return mpInfoPrinter
->EndJob();
603 SalGraphics
* AquaSalPrinter::StartPage( ImplJobSetup
* i_pSetupData
, bool i_bNewJobData
)
605 return mpInfoPrinter
->StartPage( i_pSetupData
, i_bNewJobData
);
608 void AquaSalPrinter::EndPage()
610 mpInfoPrinter
->EndPage();
613 sal_uLong
AquaSalPrinter::GetErrorCode()
615 return AquaSalInfoPrinter::GetErrorCode();
618 void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup
* )
620 m_aPaperFormats
.clear();
621 m_bPapersInit
= true;
625 SAL_WNODEPRECATED_DECLARATIONS_PUSH
626 //TODO: 10.9 statusForTable:, stringListForKey:inTable:
627 if( [mpPrinter statusForTable
: @
"PPD"] == NSPrinterTableOK
)
629 NSArray
* pPaperNames
= [mpPrinter stringListForKey
: @
"PageSize" inTable
: @
"PPD"];
632 unsigned int nPapers
= [pPaperNames count
];
633 for( unsigned int i
= 0; i
< nPapers
; i
++ )
635 NSString
* pPaper
= [pPaperNames objectAtIndex
: i
];
636 // first try to match the name
637 OString
aPaperName( [pPaper UTF8String
] );
638 Paper ePaper
= PaperInfo::fromPSName( aPaperName
);
639 if( ePaper
!= PAPER_USER
)
641 m_aPaperFormats
.push_back( PaperInfo( ePaper
) );
645 NSSize aPaperSize
= [mpPrinter pageSizeForPaper
: pPaper
];
646 if( aPaperSize
.width
> 0 && aPaperSize
.height
> 0 )
648 PaperInfo
aInfo( PtTo10Mu( aPaperSize
.width
),
649 PtTo10Mu( aPaperSize
.height
) );
650 if( aInfo
.getPaper() == PAPER_USER
)
652 m_aPaperFormats
.push_back( aInfo
);
658 SAL_WNODEPRECATED_DECLARATIONS_POP
662 const PaperInfo
* AquaSalInfoPrinter::matchPaper( long i_nWidth
, long i_nHeight
, Orientation
& o_rOrientation
) const
664 if( ! m_bPapersInit
)
665 const_cast<AquaSalInfoPrinter
*>(this)->InitPaperFormats( nullptr );
667 const PaperInfo
* pMatch
= nullptr;
668 o_rOrientation
= Orientation::Portrait
;
669 for( int n
= 0; n
< 2 ; n
++ )
671 for( size_t i
= 0; i
< m_aPaperFormats
.size(); i
++ )
673 if( std::abs( m_aPaperFormats
[i
].getWidth() - i_nWidth
) < 50 &&
674 std::abs( m_aPaperFormats
[i
].getHeight() - i_nHeight
) < 50 )
676 pMatch
= &m_aPaperFormats
[i
];
680 o_rOrientation
= Orientation::Landscape
;
681 std::swap( i_nWidth
, i_nHeight
);
686 int AquaSalInfoPrinter::GetLandscapeAngle( const ImplJobSetup
* )
691 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */