2012-04-02 19:33:05 +02:00
|
|
|
/* ============================================================
|
2017-08-25 17:11:29 +02:00
|
|
|
* Falkon - Qt web browser
|
2018-01-02 16:42:56 +01:00
|
|
|
* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
|
2012-04-02 19:33:05 +02:00
|
|
|
*
|
|
|
|
* 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, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2014-02-26 20:03:20 +01:00
|
|
|
#ifndef QZCOMMON_H
|
|
|
|
#define QZCOMMON_H
|
2012-01-21 23:19:38 +01:00
|
|
|
|
2014-03-16 13:22:41 +01:00
|
|
|
#include <QDebug>
|
2013-05-10 22:34:51 +02:00
|
|
|
#include <QFlags>
|
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
#ifdef FALKON_SHAREDLIBRARY
|
|
|
|
#define FALKON_EXPORT Q_DECL_EXPORT
|
2012-02-29 18:33:50 +01:00
|
|
|
#else
|
2017-08-25 17:11:29 +02:00
|
|
|
#define FALKON_EXPORT Q_DECL_IMPORT
|
2012-02-29 18:33:50 +01:00
|
|
|
#endif
|
|
|
|
|
2013-05-10 13:12:02 +02:00
|
|
|
#ifndef Q_UNLIKELY
|
|
|
|
#define Q_UNLIKELY(x) x
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef Q_LIKELY
|
|
|
|
#define Q_LIKELY(x) x
|
|
|
|
#endif
|
|
|
|
|
2014-03-10 16:55:11 +01:00
|
|
|
#ifndef QSL
|
|
|
|
#define QSL(x) QStringLiteral(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef QL1S
|
|
|
|
#define QL1S(x) QLatin1String(x)
|
|
|
|
#endif
|
|
|
|
|
[AdBlock] Improved performance of loading rules
Don't use regexps for parsing rules.
Added benchmark for loading subscriptions
Before:
********* Start testing of AdBlockParseRule *********
Config: Using QTest library 4.8.6, Qt 4.8.6
PASS : AdBlockParseRule::initTestCase()
RESULT : AdBlockParseRule::parseEasyList():
596.3 msecs per iteration (total: 2,982, iterations: 5)
PASS : AdBlockParseRule::parseEasyList()
PASS : AdBlockParseRule::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of AdBlockParseRule *********
After:
********* Start testing of AdBlockParseRule *********
Config: Using QTest library 4.8.6, Qt 4.8.6
PASS : AdBlockParseRule::initTestCase()
RESULT : AdBlockParseRule::parseEasyList():
481.8 msecs per iteration (total: 2,409, iterations: 5)
PASS : AdBlockParseRule::parseEasyList()
PASS : AdBlockParseRule::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of AdBlockParseRule *********
2014-04-06 13:34:01 +02:00
|
|
|
#ifndef QL1C
|
|
|
|
#define QL1C(x) QLatin1Char(x)
|
|
|
|
#endif
|
|
|
|
|
2012-01-21 23:19:38 +01:00
|
|
|
namespace Qz
|
|
|
|
{
|
2012-12-20 15:22:14 +01:00
|
|
|
// Version of session.dat file
|
2014-04-17 15:20:54 +02:00
|
|
|
extern const int sessionVersion;
|
2012-01-21 23:19:38 +01:00
|
|
|
|
2014-02-06 17:07:19 +01:00
|
|
|
// Version of bookmarks.json file
|
2014-04-17 15:20:54 +02:00
|
|
|
extern const int bookmarksVersion;
|
2014-02-06 17:07:19 +01:00
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
FALKON_EXPORT extern const char* APPNAME;
|
|
|
|
FALKON_EXPORT extern const char* VERSION;
|
|
|
|
FALKON_EXPORT extern const char* AUTHOR;
|
|
|
|
FALKON_EXPORT extern const char* COPYRIGHT;
|
|
|
|
FALKON_EXPORT extern const char* WWWADDRESS;
|
|
|
|
FALKON_EXPORT extern const char* WIKIADDRESS;
|
2014-02-19 22:07:21 +01:00
|
|
|
|
|
|
|
enum BrowserWindowType {
|
2012-01-21 23:19:38 +01:00
|
|
|
BW_FirstAppWindow,
|
|
|
|
BW_OtherRestoredWindow,
|
2013-02-07 14:01:01 +01:00
|
|
|
BW_NewWindow,
|
|
|
|
BW_MacFirstWindow
|
2012-01-21 23:19:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum CommandLineAction {
|
|
|
|
CL_NoAction,
|
|
|
|
CL_OpenUrl,
|
2012-04-03 20:41:07 +02:00
|
|
|
CL_OpenUrlInCurrentTab,
|
2012-07-10 00:36:05 +02:00
|
|
|
CL_OpenUrlInNewWindow,
|
2012-01-21 23:19:38 +01:00
|
|
|
CL_StartWithProfile,
|
|
|
|
CL_StartWithoutAddons,
|
|
|
|
CL_NewTab,
|
|
|
|
CL_NewWindow,
|
|
|
|
CL_ShowDownloadManager,
|
2014-01-22 17:34:25 +01:00
|
|
|
CL_ToggleFullScreen,
|
2012-01-21 23:19:38 +01:00
|
|
|
CL_StartPrivateBrowsing,
|
2012-09-01 15:59:27 +02:00
|
|
|
CL_StartNewInstance,
|
2014-01-23 13:02:07 +01:00
|
|
|
CL_StartPortable,
|
2012-01-21 23:19:38 +01:00
|
|
|
CL_ExitAction
|
|
|
|
};
|
|
|
|
|
2012-02-19 17:50:02 +01:00
|
|
|
enum ObjectName {
|
|
|
|
ON_WebView,
|
|
|
|
ON_TabBar,
|
2014-02-26 19:55:49 +01:00
|
|
|
ON_BrowserWindow
|
2012-02-19 17:50:02 +01:00
|
|
|
};
|
|
|
|
|
2012-01-21 23:19:38 +01:00
|
|
|
enum NewTabPositionFlag {
|
|
|
|
NT_SelectedTab = 1,
|
|
|
|
NT_NotSelectedTab = 2,
|
|
|
|
NT_CleanTab = 4,
|
2012-01-26 20:19:56 +01:00
|
|
|
NT_TabAtTheEnd = 8,
|
2013-01-25 23:49:46 +01:00
|
|
|
NT_NewEmptyTab = 16,
|
2012-01-21 23:19:38 +01:00
|
|
|
|
2013-01-25 23:49:46 +01:00
|
|
|
NT_SelectedNewEmptyTab = NT_SelectedTab | NT_TabAtTheEnd | NT_NewEmptyTab,
|
2012-01-26 20:19:56 +01:00
|
|
|
NT_SelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd,
|
|
|
|
NT_NotSelectedTabAtTheEnd = NT_NotSelectedTab | NT_TabAtTheEnd,
|
2012-02-19 17:50:02 +01:00
|
|
|
NT_CleanSelectedTabAtTheEnd = NT_SelectedTab | NT_TabAtTheEnd | NT_CleanTab,
|
2012-01-21 23:19:38 +01:00
|
|
|
NT_CleanSelectedTab = NT_CleanTab | NT_SelectedTab,
|
|
|
|
NT_CleanNotSelectedTab = NT_CleanTab | NT_NotSelectedTab
|
|
|
|
};
|
|
|
|
|
|
|
|
Q_DECLARE_FLAGS(NewTabPositionFlags, NewTabPositionFlag)
|
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Qz::NewTabPositionFlags)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-03-03 14:47:47 +01:00
|
|
|
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
2012-04-05 10:27:35 +02:00
|
|
|
#define DEFAULT_THEME_NAME "windows"
|
2017-02-10 19:00:58 +01:00
|
|
|
#elif defined(Q_OS_MACOS)
|
2012-04-05 10:27:35 +02:00
|
|
|
#define DEFAULT_THEME_NAME "mac"
|
2014-03-03 14:47:47 +01:00
|
|
|
#elif defined(Q_OS_UNIX)
|
|
|
|
#define DEFAULT_THEME_NAME "linux"
|
2012-04-05 10:27:35 +02:00
|
|
|
#else
|
|
|
|
#define DEFAULT_THEME_NAME "default"
|
|
|
|
#endif
|
|
|
|
|
2012-09-03 22:48:52 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2016-04-05 10:18:49 +02:00
|
|
|
#define DISABLE_CHECK_UPDATES false
|
2012-04-05 10:27:35 +02:00
|
|
|
#else
|
2016-04-05 10:18:49 +02:00
|
|
|
#define DISABLE_CHECK_UPDATES true
|
2012-04-05 10:27:35 +02:00
|
|
|
#endif
|
|
|
|
|
2013-01-29 20:34:14 +01:00
|
|
|
#define DEFAULT_CHECK_DEFAULTBROWSER false
|
|
|
|
|
2012-09-03 22:48:52 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2012-04-05 10:27:35 +02:00
|
|
|
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG false
|
|
|
|
#else
|
|
|
|
#define DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG true
|
|
|
|
#endif
|
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#endif // QZCOMMON_H
|