Kaydet (Commit) e515b8b1 authored tarafından Matúš Kukan's avatar Matúš Kukan

tk: Constructor feature for last tk_ implementations.

Change-Id: I55fee30e64cdb591d73cfcadfd7a9efb10485ba9
üst b7e51c20
...@@ -36,7 +36,6 @@ core_factory_list = [ ...@@ -36,7 +36,6 @@ core_factory_list = [
("libsotlo.a", "sot_component_getFactory"), ("libsotlo.a", "sot_component_getFactory"),
("libspelllo.a", "spell_component_getFactory"), ("libspelllo.a", "spell_component_getFactory"),
("libsrtrs1.a", "srtrs1_component_getFactory"), ("libsrtrs1.a", "srtrs1_component_getFactory"),
("libtklo.a", "tk_component_getFactory"),
("libucb1.a", "ucb_component_getFactory"), ("libucb1.a", "ucb_component_getFactory"),
("libucpfile1.a", "ucpfile_component_getFactory"), ("libucpfile1.a", "ucpfile_component_getFactory"),
("libucphier1.a", "ucphier1_component_getFactory"), ("libucphier1.a", "ucphier1_component_getFactory"),
......
...@@ -105,7 +105,6 @@ $(eval $(call gb_Library_add_exception_objects,tk,\ ...@@ -105,7 +105,6 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
toolkit/source/helper/imagealign \ toolkit/source/helper/imagealign \
toolkit/source/helper/listenermultiplexer \ toolkit/source/helper/listenermultiplexer \
toolkit/source/helper/property \ toolkit/source/helper/property \
toolkit/source/helper/registerservices \
toolkit/source/helper/servicenames \ toolkit/source/helper/servicenames \
toolkit/source/helper/tkresmgr \ toolkit/source/helper/tkresmgr \
toolkit/source/helper/unopropertyarrayhelper \ toolkit/source/helper/unopropertyarrayhelper \
......
...@@ -456,4 +456,20 @@ namespace toolkit ...@@ -456,4 +456,20 @@ namespace toolkit
} // namespace toolkit } // namespace toolkit
//........................................................................ //........................................................................
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
stardiv_Toolkit_UnoControlFormattedFieldModel_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new toolkit::UnoControlFormattedFieldModel(context));
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
stardiv_Toolkit_UnoFormattedFieldControl_get_implementation(
css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new toolkit::UnoFormattedFieldControl());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <toolkit/controls/geometrycontrolmodel.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/weak.hxx>
#include <osl/mutex.hxx>
#include <toolkit/helper/servicenames.hxx>
#include <toolkit/helper/macros.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <toolkit/awt/vclxpointer.hxx>
#include <toolkit/awt/vclxprinter.hxx>
#include <toolkit/controls/dialogcontrol.hxx>
#include <toolkit/controls/unocontrolcontainer.hxx>
#include <toolkit/controls/unocontrolcontainermodel.hxx>
#include <toolkit/controls/stdtabcontroller.hxx>
#include <toolkit/controls/stdtabcontrollermodel.hxx>
#include <toolkit/controls/formattedcontrol.hxx>
#include <toolkit/controls/roadmapcontrol.hxx>
#include <toolkit/controls/tkscrollbar.hxx>
#include "toolkit/dllapi.h"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
namespace toolkit
{
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::registry;
//.........................................................................
void* tryCreateFactory( const sal_Char* _pRequiredImplName, const sal_Char* _pComponentImplName,
const sal_Char* _pAsciiServiceName1, const sal_Char* _pAsciiServiceName2,
::cppu::ComponentInstantiation _pInstantiation, const Reference< XMultiServiceFactory >& _rxServiceFactory )
{
void* pReturn = NULL;
if ( rtl_str_compare( _pRequiredImplName, _pComponentImplName ) == 0 )
{
Sequence< OUString > aServiceNames( _pAsciiServiceName2 ? 2 : 1 );
aServiceNames.getArray()[ 0 ] = OUString::createFromAscii( _pAsciiServiceName1 );
if ( _pAsciiServiceName2 )
aServiceNames.getArray()[ 1 ] = OUString::createFromAscii( _pAsciiServiceName2 );
Reference< XSingleServiceFactory > xFactory( ::cppu::createSingleFactory(
_rxServiceFactory, OUString::createFromAscii( _pComponentImplName ),
_pInstantiation, aServiceNames
) );
if ( xFactory.is() )
{
xFactory->acquire();
pReturn = xFactory.get();
}
}
return pReturn;
}
}
#define IMPL_CREATEINSTANCE( ImplName ) \
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) \
{ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName ); }
#define IMPL_CREATEINSTANCE_CTX( ImplName ) \
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \
{ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( comphelper::getComponentContext(i_factory) ) ); }
#define GET_FACTORY_WITH_IMPL_PREFIX( ClassName, ImplNamePrefix, ServiceName1, ServiceName2 ) \
pRet = tryCreateFactory( sImplementationName, ImplNamePrefix "." #ClassName, \
ServiceName1, ServiceName2, \
ClassName##_CreateInstance, xServiceFactory \
); \
if ( pRet ) \
return pRet; \
#define GET_FACTORY( ImplName, ServiceName1, ServiceName2 ) \
GET_FACTORY_WITH_IMPL_PREFIX( ImplName, "stardiv.Toolkit", ServiceName1, ServiceName2 )
using namespace toolkit;
IMPL_CREATEINSTANCE_CTX( UnoControlFormattedFieldModel )
IMPL_CREATEINSTANCE( UnoFormattedFieldControl )
extern "C"
{
TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* )
{
void* pRet = NULL;
if ( _pServiceManager )
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory =
static_cast< ::com::sun::star::lang::XMultiServiceFactory* >( _pServiceManager );
GET_FACTORY( UnoFormattedFieldControl, szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField )
GET_FACTORY( UnoControlFormattedFieldModel, szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel )
}
return pRet;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
--> -->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="tk" xmlns="http://openoffice.org/2010/uno-components"> xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.awt.comp.AsyncCallback" <implementation name="com.sun.star.awt.comp.AsyncCallback"
constructor="com_sun_star_awt_comp_AsyncCallback_get_implementation"> constructor="com_sun_star_awt_comp_AsyncCallback_get_implementation">
<service name="com.sun.star.awt.AsyncCallback"/> <service name="com.sun.star.awt.AsyncCallback"/>
...@@ -168,7 +168,8 @@ ...@@ -168,7 +168,8 @@
<service name="com.sun.star.awt.UnoControlFixedTextModel"/> <service name="com.sun.star.awt.UnoControlFixedTextModel"/>
<service name="stardiv.vcl.controlmodel.FixedText"/> <service name="stardiv.vcl.controlmodel.FixedText"/>
</implementation> </implementation>
<implementation name="stardiv.Toolkit.UnoControlFormattedFieldModel"> <implementation name="stardiv.Toolkit.UnoControlFormattedFieldModel"
constructor="stardiv_Toolkit_UnoControlFormattedFieldModel_get_implementation">
<service name="com.sun.star.awt.UnoControlFormattedFieldModel"/> <service name="com.sun.star.awt.UnoControlFormattedFieldModel"/>
<service name="stardiv.vcl.controlmodel.FormattedField"/> <service name="stardiv.vcl.controlmodel.FormattedField"/>
</implementation> </implementation>
...@@ -263,7 +264,8 @@ ...@@ -263,7 +264,8 @@
<service name="com.sun.star.awt.UnoControlFixedText"/> <service name="com.sun.star.awt.UnoControlFixedText"/>
<service name="stardiv.vcl.control.FixedText"/> <service name="stardiv.vcl.control.FixedText"/>
</implementation> </implementation>
<implementation name="stardiv.Toolkit.UnoFormattedFieldControl"> <implementation name="stardiv.Toolkit.UnoFormattedFieldControl"
constructor="stardiv_Toolkit_UnoFormattedFieldControl_get_implementation">
<service name="com.sun.star.awt.UnoControlFormattedField"/> <service name="com.sun.star.awt.UnoControlFormattedField"/>
<service name="stardiv.vcl.control.FormattedField"/> <service name="stardiv.vcl.control.FormattedField"/>
</implementation> </implementation>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment