Skip to content

Commit

Permalink
refactor: export all user interface
Browse files Browse the repository at this point in the history
add export before class

Log:
Change-Id: I82fcd1e2b507e038d97e2255da058dbb44c8e341
  • Loading branch information
deepin-mozart committed Jul 9, 2024
1 parent 263e71c commit 49870b1
Show file tree
Hide file tree
Showing 53 changed files with 144 additions and 56 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ if (NOT VERSION)
endif()

message(STATUS "build version ${VERSION}")
option(ENABLE_SANITIZE_CHECK "Enable Sanitize Check " OFF)

set(CMAKE_VERBOSE_MAKEFILE ON)

if ((NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "sw_64")
AND (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "loongarch64")
AND (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "mips64")
AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
if (ENABLE_SANITIZE_CHECK AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
message("debug type open sanitize check")
set(CMAKE_CXX_FLAGS "-fsanitize=undefined,address,leak -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS "-fsanitize=undefined,address,leak -fno-omit-frame-pointer")
Expand Down
2 changes: 1 addition & 1 deletion src/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FILE(GLOB_RECURSE PROJECT_SOURCES

add_library(
${PROJECT_NAME}
SHARED
STATIC
${PROJECT_SOURCES}
)

Expand Down
9 changes: 9 additions & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ find_package(Qt5Network)

set(CMAKE_CXX_STANDARD 17)

add_definitions(
-DCOMMON_LIBRARY
)

FILE(GLOB COMMON_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
Expand All @@ -27,6 +31,11 @@ add_library(
${COMMON_FILES}
resource/common.qrc
)

target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

target_link_libraries(
${PROJECT_NAME}
Expand Down
3 changes: 2 additions & 1 deletion src/common/actionmanager/actionmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
#ifndef ACTIONMANAGER_H
#define ACTIONMANAGER_H

#include "common/common_global.h"
#include "command.h"

#include <QObject>
#include <QHash>

class ActionManagerPrivate;
class ActionManager : public QObject
class COMMON_EXPORT ActionManager : public QObject
{
Q_OBJECT
public:
Expand Down
4 changes: 3 additions & 1 deletion src/common/actionmanager/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
#ifndef COMMAND_H
#define COMMAND_H

#include "common/common_global.h"

#include <QObject>
#include <QKeySequence>

class QAction;
class QKeySequence;
class ActionPrivate;
class Command : public QObject
class COMMON_EXPORT Command : public QObject
{
Q_OBJECT
public:
Expand Down
16 changes: 16 additions & 0 deletions src/common/common_global.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#ifndef COMMON_GLOBAL_H
#define COMMON_GLOBAL_H


#if defined(COMMON_LIBRARY)
# define COMMON_EXPORT Q_DECL_EXPORT
#else
# define COMMON_EXPORT Q_DECL_IMPORT
#endif


#endif // COMMON_GLOBAL_H
3 changes: 2 additions & 1 deletion src/common/dialog/commondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define COMMONDIALOG_H

#include "common/widget/singlechoicebox.h"
#include "common/common_global.h"

#include <DMessageBox>

Expand All @@ -18,7 +19,7 @@

DWIDGET_USE_NAMESPACE

class CommonDialog final
class COMMON_EXPORT CommonDialog final
{
Q_DISABLE_COPY(CommonDialog)
CommonDialog() = delete;
Expand Down
3 changes: 2 additions & 1 deletion src/common/dialog/pip3dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
#define PIP3DIALOG_H

#include "processdialog.h"
#include "common/common_global.h"

class Pip3Dialog : public ProcessDialog
class COMMON_EXPORT Pip3Dialog : public ProcessDialog
{
Q_OBJECT
public:
Expand Down
4 changes: 3 additions & 1 deletion src/common/dialog/processdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef PROCESSDIALOG_H
#define PROCESSDIALOG_H

#include "common/common_global.h"

#include <DAbstractDialog>
#include <DProgressBar>
#include <DTextBrowser>
Expand All @@ -14,7 +16,7 @@

DWIDGET_USE_NAMESPACE

class ProcessDialog : public DAbstractDialog
class COMMON_EXPORT ProcessDialog : public DAbstractDialog
{
Q_OBJECT
public:
Expand Down
4 changes: 3 additions & 1 deletion src/common/dialog/propertiesdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef PROPERTIESDIALOG_H
#define PROPERTIESDIALOG_H

#include "common/common_global.h"

#include <DAbstractDialog>
#include <DDialog>
#include <DLineEdit>
Expand All @@ -28,7 +30,7 @@ class QStringListModel;
class QStackedWidget;
class PageWidget;

class PropertiesDialog : public DAbstractDialog
class COMMON_EXPORT PropertiesDialog : public DAbstractDialog
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/common/dialog/wgetdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#ifndef WGETDIALOG_H
#define WGETDIALOG_H

#include "common/common_global.h"
#include "processdialog.h"

class WGetDialog : public ProcessDialog
class COMMON_EXPORT WGetDialog : public ProcessDialog
{
Q_OBJECT
public:
Expand Down
4 changes: 3 additions & 1 deletion src/common/find/abstractdocumentfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
#ifndef ABSTRACTDOCUMENTFIND_H
#define ABSTRACTDOCUMENTFIND_H

#include "common/common_global.h"

#include <QObject>

class AbstractDocumentFind : public QObject
class COMMON_EXPORT AbstractDocumentFind : public QObject
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/common/find/outputdocumentfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
#ifndef OUTPUTDOCUMENTFIND_H
#define OUTPUTDOCUMENTFIND_H

#include "common/common_global.h"
#include "abstractdocumentfind.h"

class OutputPane;
class OutputDocumentFindPrivate;
class OutputDocumentFind : public AbstractDocumentFind
class COMMON_EXPORT OutputDocumentFind : public AbstractDocumentFind
{
Q_OBJECT
public:
Expand Down
4 changes: 3 additions & 1 deletion src/common/inotify/inotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#ifndef INOTIFY_H
#define INOTIFY_H

#include "common/common_global.h"

#include <QObject>

class InotifyPrivate;
class Inotify : public QObject
class COMMON_EXPORT Inotify : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(Inotify)
Expand Down
3 changes: 2 additions & 1 deletion src/common/lsp/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef CLIENT_H
#define CLIENT_H

#include "common/common_global.h"
#include "common/lsp/protocol/protocol.h"
#include "common/lsp/protocol/newprotocol.h"

Expand All @@ -13,7 +14,7 @@
namespace newlsp {

class ClientPrivate;
class Client : public QProcess
class COMMON_EXPORT Client : public QProcess
{
Q_OBJECT
ClientPrivate *const d;
Expand Down
4 changes: 3 additions & 1 deletion src/common/lsp/client/stdoutjsonrpcparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
#ifndef STDOUTJSONRPCPARSER_H
#define STDOUTJSONRPCPARSER_H

#include "common_global.h"

#include <QThread>

namespace newlsp {

class JsonRpcParser;
class StdoutJsonRpcParser : public QObject
class COMMON_EXPORT StdoutJsonRpcParser : public QObject
{
Q_OBJECT
JsonRpcParser *const d;
Expand Down
3 changes: 2 additions & 1 deletion src/common/lsp/protocol/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define LANGUAGESERVERPROTOCOL_H

#include "common/type/menuext.h"
#include "common/common_global.h"

#include <QUrl>
#include <QString>
Expand Down Expand Up @@ -408,7 +409,7 @@ struct WorkDoneProgressParams
std::any value; // any
};

struct WorkspaceEditClientCapabilities
struct COMMON_EXPORT WorkspaceEditClientCapabilities
{
struct changeAnnotationSupport
{
Expand Down
3 changes: 2 additions & 1 deletion src/common/lsp/server/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#define ROUTE_H

#include "common/lsp/protocol/newprotocol.h"
#include "common/common_global.h"

#include <QObject>
#include <QProcess>

namespace newlsp {
class Route : public QObject
class COMMON_EXPORT Route : public QObject
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion src/common/lsp/server/serverapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef SERVERAPPLICATION_H
#define SERVERAPPLICATION_H

#include "common/common_global.h"
#include "common/lsp/server/servercmdparse.h"
#include "common/lsp/server/stdinjsonrpcparser.h"

Expand All @@ -16,7 +17,7 @@
namespace newlsp {

class ServerApplicationPrivate;
class ServerApplication : public QObject, ServerCmdParse
class COMMON_EXPORT ServerApplication : public QObject, ServerCmdParse
{
Q_OBJECT
ServerApplicationPrivate *const d;
Expand Down
4 changes: 3 additions & 1 deletion src/common/lsp/server/servercmdparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef SERVERCMDPARSE_H
#define SERVERCMDPARSE_H

#include "common/common_global.h"

#include <QCoreApplication>
#include <QCommandLineParser>
#include <optional>
Expand All @@ -18,7 +20,7 @@ extern const QString tcp;
extern const QString portDefault;
extern const QString parentPidDefault;
class ServerCmdParsePrivate;
class ServerCmdParse : QCommandLineParser
class COMMON_EXPORT ServerCmdParse : QCommandLineParser
{
ServerCmdParsePrivate *const d;
public:
Expand Down
3 changes: 2 additions & 1 deletion src/common/lsp/server/stdinjsonrpcparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#define STDINJSONRPCPARSER_H

#include "stdinreadloop.h"
#include "common/common_global.h"

namespace newlsp {

class JsonRpcParser;
class StdinJsonRpcParserPrivate;
class StdinJsonRpcParser : public StdinReadLoop
class COMMON_EXPORT StdinJsonRpcParser : public StdinReadLoop
{
Q_OBJECT
JsonRpcParser *const d;
Expand Down
4 changes: 3 additions & 1 deletion src/common/lsp/server/stdinreadloop.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#ifndef STDINREADLOOP_H
#define STDINREADLOOP_H

#include "common/common_global.h"

#include <QThread>

class StdinReadLoopPrivate;
class StdinReadLoop : public QThread
class COMMON_EXPORT StdinReadLoop : public QThread
{
Q_OBJECT
StdinReadLoopPrivate *const d;
Expand Down
4 changes: 3 additions & 1 deletion src/common/project/projectinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef PROJECTINFO_H
#define PROJECTINFO_H

#include "common/common_global.h"

#include <QSet>
#include <QVariantHash>
#include <QStandardItem>
Expand All @@ -16,7 +18,7 @@ enum
ProjectInfoRole = Qt::ItemDataRole::UserRole,
};

class ProjectInfo
class COMMON_EXPORT ProjectInfo
{
public:
ProjectInfo() : data({}) {}
Expand Down
4 changes: 3 additions & 1 deletion src/common/supportfile/dapconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef DAPCONFIG_H
#define DAPCONFIG_H

#include "common_global.h"

#include <QString>

namespace support_file {
Expand All @@ -17,7 +19,7 @@ struct JavaDapPluginConfig {
QString jreExecute;
};

class DapSupportConfig final
class COMMON_EXPORT DapSupportConfig final
{
public:
static QString globalPath();
Expand Down
4 changes: 3 additions & 1 deletion src/common/supportfile/editorstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
#ifndef EDITORSTYLE_H
#define EDITORSTYLE_H

#include "common/common_global.h"

#include <QString>

namespace support_file {

struct EditorStyle
struct COMMON_EXPORT EditorStyle
{
static QString globalPath(const QString &languageID);
static QString userPath(const QString &languageID);
Expand Down
Loading

0 comments on commit 49870b1

Please sign in to comment.