Skip to content

Commit

Permalink
Unify the #include style for fcitx headers
Browse files Browse the repository at this point in the history
1. library header: <>
2. source code & other header: ""
3. *_export.h, use <> instead of old "".
  • Loading branch information
wengxt committed Dec 31, 2024
1 parent 7dede8b commit c299885
Show file tree
Hide file tree
Showing 68 changed files with 125 additions and 123 deletions.
2 changes: 1 addition & 1 deletion src/lib/fcitx-config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set_target_properties(Fcitx5Config
)
target_include_directories(Fcitx5Config PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_INCLUDEDIR}/Fcitx5/Config>)
target_link_libraries(Fcitx5Config PUBLIC Fcitx5::Utils)

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-config/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include <memory>
#include <string>
#include <vector>
#include <fcitx-config/fcitxconfig_export.h>
#include <fcitx-config/option.h>
#include <fcitx-config/optiontypename.h>
#include <fcitx-config/rawconfig.h>
#include <fcitx-utils/macros.h>
#include "fcitxconfig_export.h"

#define FCITX_CONFIGURATION_EXTEND(NAME, SUBCLASS, ...) \
class NAME; \
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-config/dbushelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <string>
#include <vector>
#include <fcitx-config/configuration.h>
#include <fcitx-config/fcitxconfig_export.h>
#include <fcitx-config/rawconfig.h>
#include <fcitx-utils/dbus/message.h>
#include "fcitxconfig_export.h"

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-config/iniparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include <cstdio>
#include <string>
#include <fcitx-config/fcitxconfig_export.h>
#include <fcitx-config/rawconfig.h>
#include <fcitx-utils/standardpath.h>
#include "fcitxconfig_export.h"

namespace fcitx {
class Configuration;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/fcitx-config/marshallfunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#include <cstddef>
#include <string>
#include <vector>
#include <fcitx-config/fcitxconfig_export.h>
#include <fcitx-config/rawconfig.h>
#include <fcitx-utils/color.h>
#include <fcitx-utils/i18nstring.h>
#include <fcitx-utils/key.h>
#include <fcitx-utils/semver.h>
#include "fcitx-utils/key.h"
#include "fcitxconfig_export.h"
#include "rawconfig.h"

namespace fcitx {

Expand Down
4 changes: 2 additions & 2 deletions src/lib/fcitx-config/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
#include <type_traits>
#include <utility>
#include <vector>
#include <fcitx-config/fcitxconfig_export.h>
#include <fcitx-config/marshallfunction.h>
#include <fcitx-config/option_details.h> // IWYU pragma: export
#include <fcitx-config/optiontypename.h>
#include <fcitx-config/rawconfig.h>
#include <fcitx-utils/flags.h>
#include "fcitx-utils/key.h"
#include "fcitxconfig_export.h"
#include <fcitx-utils/key.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-config/option_details.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <memory>
#include <string>
#include <vector>
#include <fcitx-config/fcitxconfig_export.h>
#include <fcitx-config/rawconfig.h>
#include "fcitxconfig_export.h"

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-config/rawconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include <string>
#include <utility>
#include <vector>
#include <fcitx-config/fcitxconfig_export.h>
#include <fcitx-utils/log.h>
#include <fcitx-utils/macros.h>
#include "fcitxconfig_export.h"

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-utils/handlertable_details.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef _FCITX_UTILS_HANDLERTABLE_DETAILS_H_
#define _FCITX_UTILS_HANDLERTABLE_DETAILS_H_

// IWYU pragma: private, include "handlertable.h"
// IWYU pragma: private, include <fcitx-utils/handlertable.h>

#include <cstddef>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-utils/intrusivelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <type_traits>
#include <utility>
#include <fcitx-utils/macros.h>
#include "misc.h"
#include <fcitx-utils/misc.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-utils/misc_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <string>
#include <unordered_map>
#include <utility>
#include <fcitx-utils/endian_p.h>
#include "config.h"
#include "endian_p.h"

namespace fcitx {

Expand Down
4 changes: 2 additions & 2 deletions src/lib/fcitx-utils/semver.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <variant>
#include <vector>
#include <fcitx-utils/fcitxutils_export.h>
#include "log.h"
#include "macros.h"
#include <fcitx-utils/log.h>
#include <fcitx-utils/macros.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-utils/stringutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <utility>
#include <vector>
#include <fcitx-utils/fcitxutils_export.h>
#include "stringutils_details.h"
#include <fcitx-utils/stringutils_details.h> // IWYU pragma: export

namespace fcitx::stringutils {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx-utils/stringutils_details.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef _FCITX_UTILS_STRINGUTILS_DETAIL_H_
#define _FCITX_UTILS_STRINGUTILS_DETAIL_H_

// IWYU pragma: private, include "stringutils.h"
// IWYU pragma: private, include <fcitx/stringutils.h>

#include <cassert>
#include <cstdio>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/fcitx-utils/uuid_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
#include <unistd.h>
#include <cstdint>
#include <cstring>
#include "charutils.h"
#include "eventloopinterface.h"
#include "fs.h"
#include "unixfd.h"
#include <fcitx-utils/charutils.h>
#include <fcitx-utils/eventloopinterface.h>
#include <fcitx-utils/fs.h>
#include <fcitx-utils/unixfd.h>

#ifdef TEST_DISABLE_LIBUUID
#undef ENABLE_LIBUUID
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ set_target_properties(Fcitx5Core
)
target_include_directories(Fcitx5Core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_INCLUDEDIR}/Fcitx5/Core>)
target_link_libraries(Fcitx5Core PUBLIC Fcitx5::Config Fcitx5::Utils PRIVATE LibIntl::LibIntl ${FMT_TARGET})
if (ENABLE_KEYBOARD)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <fcitx-utils/element.h>
#include <fcitx-utils/key.h>
#include <fcitx-utils/macros.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

namespace fcitx {
class ActionPrivate;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/addonfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define _FCITX_ADDONFACTORY_H_

#include <fcitx/addoninstance.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

/// \addtogroup FcitxCore
/// \{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/addoninfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <fcitx-utils/i18nstring.h>
#include <fcitx-utils/macros.h>
#include <fcitx-utils/semver.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/addoninstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <fcitx-utils/metastring.h>
#include <fcitx/addoninfo.h>
#include <fcitx/addoninstance_details.h> // IWYU pragma: export
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

/// \addtogroup FcitxCore
/// \{
Expand Down
4 changes: 2 additions & 2 deletions src/lib/fcitx/addoninstance_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include <string>
#include <unordered_map>
#include "addoninfo.h"
#include "addoninstance.h"
#include <fcitx/addoninfo.h>
#include <fcitx/addoninstance.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/addonloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <unordered_map>
#include <fcitx/addoninfo.h>
#include <fcitx/addoninstance.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

namespace fcitx {

Expand Down
14 changes: 7 additions & 7 deletions src/lib/fcitx/addonloader_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#include <string_view>
#include <unordered_map>
#include <utility>
#include "fcitx-utils/library.h"
#include "fcitx-utils/standardpath.h"
#include "fcitx-utils/stringutils.h"
#include "addonfactory.h"
#include "addoninfo.h"
#include "addoninstance.h"
#include "addonloader.h"
#include <fcitx-utils/library.h>
#include <fcitx-utils/standardpath.h>
#include <fcitx-utils/stringutils.h>
#include <fcitx/addonfactory.h>
#include <fcitx/addoninfo.h>
#include <fcitx/addoninstance.h>
#include <fcitx/addonloader.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/addonmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <vector>
#include <fcitx-utils/macros.h>
#include <fcitx/addonloader.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

/// \addtogroup FcitxCore
/// \{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/candidateaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <memory>
#include <string>
#include <fcitx-utils/macros.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/candidatelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <fcitx-utils/key.h>
#include <fcitx-utils/macros.h>
#include <fcitx/candidateaction.h>
#include <fcitx/fcitxcore_export.h>
#include <fcitx/text.h>
#include "fcitxcore_export.h"

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <cstdint>
#include <fcitx-utils/capabilityflags.h>
#include <fcitx-utils/key.h>
#include <fcitx/fcitxcore_export.h>
#include <fcitx/userinterface.h>
#include "fcitxcore_export.h"

/// \addtogroup FcitxCore
/// \{
Expand Down
6 changes: 3 additions & 3 deletions src/lib/fcitx/focusgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include <memory>
#include <fcitx-utils/macros.h>
#include "fcitxcore_export.h"
#include "inputcontext.h"
#include "inputpanel.h"
#include <fcitx/fcitxcore_export.h>
#include <fcitx/inputcontext.h>
#include <fcitx/inputpanel.h>

namespace fcitx {

Expand Down
4 changes: 2 additions & 2 deletions src/lib/fcitx/focusgroup_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#define _FCITX_FOCUSGROUP_P_H_

#include <unordered_set>
#include "fcitx-utils/intrusivelist.h"
#include "focusgroup.h"
#include <fcitx-utils/intrusivelist.h>
#include <fcitx/focusgroup.h>

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/globalconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <fcitx-config/rawconfig.h>
#include <fcitx-utils/key.h>
#include <fcitx-utils/macros.h>
#include <fcitx/fcitxcore_export.h>
#include <fcitx/inputcontextmanager.h>
#include "fcitxcore_export.h"

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/icontheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <fcitx-utils/macros.h>
#include <fcitx-utils/misc.h>
#include <fcitx-utils/standardpath.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

/// \addtogroup FcitxCore
/// \{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/inputcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <fcitx-utils/rect.h>
#include <fcitx-utils/trackableobject.h>
#include <fcitx/event.h>
#include <fcitx/fcitxcore_export.h>
#include <fcitx/inputcontextproperty.h>
#include <fcitx/surroundingtext.h>
#include "fcitxcore_export.h"

/// \addtogroup FcitxCore
/// \{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/inputcontext_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
#include <unordered_map>
#include <fcitx-utils/intrusivelist.h>
#include <fcitx-utils/uuid_p.h>
#include <fcitx/event.h>
#include <fcitx/inputcontext.h>
#include <fcitx/inputcontextmanager.h>
#include <fcitx/inputcontextproperty.h>
#include <fcitx/inputpanel.h>
#include <fcitx/instance.h>
#include <fcitx/statusarea.h>
#include "fcitx/event.h"

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/inputcontextmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <memory>
#include <fcitx-config/enum.h>
#include <fcitx-utils/macros.h>
#include <fcitx/fcitxcore_export.h>
#include <fcitx/inputcontext.h>
#include "fcitxcore_export.h"

namespace fcitx {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/fcitx/inputcontextproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <memory>
#include <fcitx-utils/macros.h>
#include <fcitx-utils/trackableobject.h>
#include "fcitxcore_export.h"
#include <fcitx/fcitxcore_export.h>

/// \addtogroup FcitxCore
/// \{
Expand Down
4 changes: 3 additions & 1 deletion src/lib/fcitx/inputcontextproperty_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#define _FCITX_INPUTCONTEXTPROPERTY_P_H_

#include <string>
#include "inputcontextproperty.h"
#include <fcitx/inputcontextproperty.h>
#include "fcitx-utils/macros.h"
#include "fcitx/inputcontextmanager.h"

namespace fcitx {
class InputContextManagerPrivate;
Expand Down
Loading

0 comments on commit c299885

Please sign in to comment.