/* * Copyright (C) 2012-2017 Canonical, Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ // Qt #include #include #include #include // self #include "plugin.h" // local #include "activefocuslogger.h" #include "easingcurve.h" #include "WindowInputMonitor.h" #include "inputwatcher.h" #include "qlimitproxymodelqml.h" #include "unitysortfilterproxymodelqml.h" #include "unitymenumodelpaths.h" #include "windowinputfilter.h" #include "windowstatestorage.h" #include "constants.h" #include "timezoneFormatter.h" #include "applicationsfiltermodel.h" #include "inputeventgenerator.h" #include "deviceconfigparser.h" #include "globalfunctions.h" #include "URLDispatcher.h" #include "appdrawerproxymodel.h" #include "tabfocusfence.h" #include "expressionfiltermodel.h" #include "quicklistproxymodel.h" static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new WindowStateStorage(); } static QObject *createConstants(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new Constants(); } static QObject *createGlobalFunctions(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new GlobalFunctions(); } void UtilsPlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("Utils")); qmlRegisterType(uri, 0, 1, "WindowInputMonitor"); qmlRegisterType(); qmlRegisterType(uri, 0, 1, "LimitProxyModel"); qmlRegisterType(uri, 0, 1, "UnitySortFilterProxyModel"); qmlRegisterType(uri, 0, 1, "UnityMenuModelPaths"); qmlRegisterType(uri, 0, 1, "WindowInputFilter"); qmlRegisterType(uri, 0, 1, "EasingCurve"); qmlRegisterSingletonType(uri, 0, 1, "WindowStateStorage", createWindowStateStorage); qmlRegisterType(uri, 0, 1, "InputWatcher"); qmlRegisterSingletonType(uri, 0, 1, "Constants", createConstants); qmlRegisterSingletonType(uri, 0, 1, "TimezoneFormatter", [](QQmlEngine*, QJSEngine*) -> QObject* { return new TimezoneFormatter; }); qmlRegisterType(uri, 0, 1, "ActiveFocusLogger"); qmlRegisterType(uri, 0, 1, "ApplicationsFilterModel"); qmlRegisterType(uri, 0, 1, "InputEventGenerator"); qmlRegisterType(uri, 0, 1, "DeviceConfigParser"); qmlRegisterSingletonType(uri, 0, 1, "Functions", createGlobalFunctions); qmlRegisterType(uri, 0, 1, "URLDispatcher"); qmlRegisterType(uri, 0, 1, "AppDrawerProxyModel"); qmlRegisterType(uri, 0, 1, "TabFocusFence"); qmlRegisterType(uri, 0, 1, "ExpressionFilterModel"); qmlRegisterType(uri, 0, 1, "QuickListProxyModel"); }