diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,6 +372,9 @@ ########### global ############### set(kwin_effects_dbus_xml ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.kwin.Effects.xml) +qt5_add_dbus_interface(effects_interface_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) +add_library(KWinEffectsInterface OBJECT ${effects_interface_SRCS}) +target_link_libraries(KWinEffectsInterface Qt5::DBus) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/libkwineffects diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt --- a/autotests/integration/CMakeLists.txt +++ b/autotests/integration/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(helper) -add_library(KWinIntegrationTestFramework STATIC kwin_wayland_test.cpp test_helpers.cpp ${kwin_XWAYLAND_SRCS}) +add_library(KWinIntegrationTestFramework STATIC kwin_wayland_test.cpp test_helpers.cpp generic_scene_opengl_test.cpp ${kwin_XWAYLAND_SRCS}) target_link_libraries(KWinIntegrationTestFramework kwin Qt5::Test) function(integrationTest) @@ -36,9 +36,9 @@ integrationTest(WAYLAND_ONLY NAME testXdgShellClient SRCS xdgshellclient_test.cpp) integrationTest(WAYLAND_ONLY NAME testDontCrashNoBorder SRCS dont_crash_no_border.cpp) integrationTest(NAME testXwaylandSelections SRCS xwayland_selections_test.cpp) -integrationTest(WAYLAND_ONLY NAME testSceneOpenGL SRCS scene_opengl_test.cpp generic_scene_opengl_test.cpp) +integrationTest(WAYLAND_ONLY NAME testSceneOpenGL SRCS scene_opengl_test.cpp ) integrationTest(WAYLAND_ONLY NAME testSceneOpenGLShadow SRCS scene_opengl_shadow_test.cpp) -integrationTest(WAYLAND_ONLY NAME testSceneOpenGLES SRCS scene_opengl_es_test.cpp generic_scene_opengl_test.cpp) +integrationTest(WAYLAND_ONLY NAME testSceneOpenGLES SRCS scene_opengl_es_test.cpp ) integrationTest(WAYLAND_ONLY NAME testNoXdgRuntimeDir SRCS no_xdg_runtime_dir_test.cpp) integrationTest(WAYLAND_ONLY NAME testScreenChanges SRCS screen_changes_test.cpp) integrationTest(NAME testModiferOnlyShortcut SRCS modifier_only_shortcut_test.cpp) @@ -57,7 +57,7 @@ integrationTest(WAYLAND_ONLY NAME testDontCrashCursorPhysicalSizeEmpty SRCS dont_crash_cursor_physical_size_empty.cpp) integrationTest(WAYLAND_ONLY NAME testDontCrashReinitializeCompositor SRCS dont_crash_reinitialize_compositor.cpp) integrationTest(WAYLAND_ONLY NAME testNoGlobalShortcuts SRCS no_global_shortcuts_test.cpp) -integrationTest(WAYLAND_ONLY NAME testBufferSizeChange SRCS buffer_size_change_test.cpp generic_scene_opengl_test.cpp) +integrationTest(WAYLAND_ONLY NAME testBufferSizeChange SRCS buffer_size_change_test.cpp ) integrationTest(WAYLAND_ONLY NAME testPlacement SRCS placement_test.cpp) integrationTest(WAYLAND_ONLY NAME testActivation SRCS activation_test.cpp) diff --git a/autotests/libinput/CMakeLists.txt b/autotests/libinput/CMakeLists.txt --- a/autotests/libinput/CMakeLists.txt +++ b/autotests/libinput/CMakeLists.txt @@ -1,99 +1,71 @@ include_directories(${Libinput_INCLUDE_DIRS}) include_directories(${UDEV_INCLUDE_DIR}) + +add_library(LibInputTestObjects OBJECT ../../libinput/device.cpp ../../libinput/events.cpp mock_libinput.cpp) +target_link_libraries(LibInputTestObjects Qt5::Test Qt5::Widgets Qt5::DBus Qt5::Gui KF5::ConfigCore) + ######################################################## # Test Devices ######################################################## -set(testLibinputDevice_SRCS device_test.cpp mock_libinput.cpp ../../libinput/device.cpp ) -add_executable(testLibinputDevice ${testLibinputDevice_SRCS}) -target_link_libraries(testLibinputDevice Qt5::Test Qt5::DBus Qt5::Gui KF5::ConfigCore) +add_executable(testLibinputDevice device_test.cpp) +target_link_libraries(testLibinputDevice Qt5::Test Qt5::DBus Qt5::Gui KF5::ConfigCore LibInputTestObjects) add_test(NAME kwin-testLibinputDevice COMMAND testLibinputDevice) ecm_mark_as_test(testLibinputDevice) ######################################################## # Test Key Event ######################################################## -set(testLibinputKeyEvent_SRCS - ../../libinput/device.cpp - ../../libinput/events.cpp - key_event_test.cpp - mock_libinput.cpp -) -add_executable(testLibinputKeyEvent ${testLibinputKeyEvent_SRCS}) -target_link_libraries(testLibinputKeyEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore) +add_executable(testLibinputKeyEvent key_event_test.cpp) +target_link_libraries(testLibinputKeyEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore LibInputTestObjects) add_test(NAME kwin-testLibinputKeyEvent COMMAND testLibinputKeyEvent) ecm_mark_as_test(testLibinputKeyEvent) ######################################################## # Test Pointer Event ######################################################## -set(testLibinputPointerEvent_SRCS - ../../libinput/device.cpp - ../../libinput/events.cpp - mock_libinput.cpp - pointer_event_test.cpp -) -add_executable(testLibinputPointerEvent ${testLibinputPointerEvent_SRCS}) -target_link_libraries(testLibinputPointerEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore) +add_executable(testLibinputPointerEvent pointer_event_test.cpp) +target_link_libraries(testLibinputPointerEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore LibInputTestObjects) add_test(NAME kwin-testLibinputPointerEvent COMMAND testLibinputPointerEvent) ecm_mark_as_test(testLibinputPointerEvent) ######################################################## # Test Touch Event ######################################################## -set(testLibinputTouchEvent_SRCS - ../../libinput/device.cpp - ../../libinput/events.cpp - mock_libinput.cpp - touch_event_test.cpp -) -add_executable(testLibinputTouchEvent ${testLibinputTouchEvent_SRCS}) -target_link_libraries(testLibinputTouchEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore) +add_executable(testLibinputTouchEvent touch_event_test.cpp) +target_link_libraries(testLibinputTouchEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore LibInputTestObjects) add_test(NAME kwin-testLibinputTouchEvent COMMAND testLibinputTouchEvent) ecm_mark_as_test(testLibinputTouchEvent) ######################################################## # Test Gesture Event ######################################################## -set(testLibinputGestureEvent_SRCS - ../../libinput/device.cpp - ../../libinput/events.cpp - gesture_event_test.cpp - mock_libinput.cpp -) -add_executable(testLibinputGestureEvent ${testLibinputGestureEvent_SRCS}) -target_link_libraries(testLibinputGestureEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore) +add_executable(testLibinputGestureEvent gesture_event_test.cpp) +target_link_libraries(testLibinputGestureEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore LibInputTestObjects) add_test(NAME kwin-testLibinputGestureEvent COMMAND testLibinputGestureEvent) ecm_mark_as_test(testLibinputGestureEvent) ######################################################## # Test Switch Event ######################################################## -set(testLibinputSwitchEvent_SRCS - ../../libinput/device.cpp - ../../libinput/events.cpp - mock_libinput.cpp - switch_event_test.cpp -) -add_executable(testLibinputSwitchEvent ${testLibinputSwitchEvent_SRCS}) -target_link_libraries(testLibinputSwitchEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore) +add_executable(testLibinputSwitchEvent switch_event_test.cpp) +target_link_libraries(testLibinputSwitchEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore LibInputTestObjects) add_test(NAME kwin-testLibinputSwitchEvent COMMAND testLibinputSwitchEvent) ecm_mark_as_test(testLibinputSwitchEvent) ######################################################## # Test Context ######################################################## set(testLibinputContext_SRCS ../../libinput/context.cpp - ../../libinput/device.cpp - ../../libinput/events.cpp ../../libinput/libinput_logging.cpp ../../logind.cpp context_test.cpp - mock_libinput.cpp mock_udev.cpp ) add_executable(testLibinputContext ${testLibinputContext_SRCS}) target_link_libraries(testLibinputContext + LibInputTestObjects + Qt5::DBus Qt5::Test Qt5::Widgets @@ -107,8 +79,7 @@ ######################################################## # Test Input Events ######################################################## -set(testInputEvents_SRCS input_event_test.cpp mock_libinput.cpp ../../libinput/device.cpp ../../input_event.cpp) -add_executable(testInputEvents ${testInputEvents_SRCS}) -target_link_libraries(testInputEvents Qt5::Test Qt5::DBus Qt5::Gui Qt5::Widgets KF5::ConfigCore) +add_executable(testInputEvents input_event_test.cpp ../../input_event.cpp) +target_link_libraries(testInputEvents Qt5::Test Qt5::DBus Qt5::Gui Qt5::Widgets KF5::ConfigCore LibInputTestObjects) add_test(NAME kwin-testInputEvents COMMAND testInputEvents) ecm_mark_as_test(testInputEvents) diff --git a/effects/blur/CMakeLists.txt b/effects/blur/CMakeLists.txt --- a/effects/blur/CMakeLists.txt +++ b/effects/blur/CMakeLists.txt @@ -2,15 +2,15 @@ # Config set(kwin_blur_config_SRCS blur_config.cpp) ki18n_wrap_ui(kwin_blur_config_SRCS blur_config.ui) -qt5_add_dbus_interface(kwin_blur_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_blur_config_SRCS blurconfig.kcfgc) add_library(kwin_blur_config MODULE ${kwin_blur_config_SRCS}) target_link_libraries(kwin_blur_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_blur_config blur_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/coverswitch/CMakeLists.txt b/effects/coverswitch/CMakeLists.txt --- a/effects/coverswitch/CMakeLists.txt +++ b/effects/coverswitch/CMakeLists.txt @@ -5,15 +5,15 @@ # Config set(kwin_coverswitch_config_SRCS coverswitch_config.cpp) ki18n_wrap_ui(kwin_coverswitch_config_SRCS coverswitch_config.ui) -qt5_add_dbus_interface(kwin_coverswitch_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_coverswitch_config_SRCS coverswitchconfig.kcfgc) add_library(kwin_coverswitch_config MODULE ${kwin_coverswitch_config_SRCS}) target_link_libraries(kwin_coverswitch_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_coverswitch_config coverswitch_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/cube/CMakeLists.txt b/effects/cube/CMakeLists.txt --- a/effects/cube/CMakeLists.txt +++ b/effects/cube/CMakeLists.txt @@ -9,7 +9,6 @@ set(kwin_cube_config_SRCS cube_config.cpp) ki18n_wrap_ui(kwin_cube_config_SRCS cube_config.ui) -qt5_add_dbus_interface(kwin_cube_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_cube_config_SRCS cubeconfig.kcfgc) add_library(kwin_cube_config MODULE ${kwin_cube_config_SRCS}) @@ -20,6 +19,7 @@ KF5::I18n KF5::XmlGui KF5::KIOWidgets + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_cube_config cube_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/cubeslide/CMakeLists.txt b/effects/cubeslide/CMakeLists.txt --- a/effects/cubeslide/CMakeLists.txt +++ b/effects/cubeslide/CMakeLists.txt @@ -3,15 +3,15 @@ set(kwin_cubeslide_config_SRCS cubeslide_config.cpp) ki18n_wrap_ui(kwin_cubeslide_config_SRCS cubeslide_config.ui) -qt5_add_dbus_interface(kwin_cubeslide_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_cubeslide_config_SRCS cubeslideconfig.kcfgc) add_library(kwin_cubeslide_config MODULE ${kwin_cubeslide_config_SRCS}) target_link_libraries(kwin_cubeslide_config KF5::ConfigWidgets KF5::I18n kwineffects + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_cubeslide_config cubeslide_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/desktopgrid/CMakeLists.txt b/effects/desktopgrid/CMakeLists.txt --- a/effects/desktopgrid/CMakeLists.txt +++ b/effects/desktopgrid/CMakeLists.txt @@ -6,7 +6,6 @@ # Config set(kwin_desktopgrid_config_SRCS desktopgrid_config.cpp) ki18n_wrap_ui(kwin_desktopgrid_config_SRCS desktopgrid_config.ui) -qt5_add_dbus_interface(kwin_desktopgrid_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_desktopgrid_config_SRCS desktopgridconfig.kcfgc) add_library(kwin_desktopgrid_config MODULE ${kwin_desktopgrid_config_SRCS}) @@ -19,6 +18,7 @@ KF5::XmlGui Qt5::Quick kwineffects + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_desktopgrid_config desktopgrid_config.desktop SERVICE_TYPES kcmodule.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/diminactive/CMakeLists.txt b/effects/diminactive/CMakeLists.txt --- a/effects/diminactive/CMakeLists.txt +++ b/effects/diminactive/CMakeLists.txt @@ -2,15 +2,15 @@ # Config set(kwin_diminactive_config_SRCS diminactive_config.cpp) ki18n_wrap_ui(kwin_diminactive_config_SRCS diminactive_config.ui) -qt5_add_dbus_interface(kwin_diminactive_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_diminactive_config_SRCS diminactiveconfig.kcfgc) add_library(kwin_diminactive_config MODULE ${kwin_diminactive_config_SRCS}) target_link_libraries(kwin_diminactive_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_diminactive_config diminactive_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/flipswitch/CMakeLists.txt b/effects/flipswitch/CMakeLists.txt --- a/effects/flipswitch/CMakeLists.txt +++ b/effects/flipswitch/CMakeLists.txt @@ -2,7 +2,6 @@ # Config set(kwin_flipswitch_config_SRCS flipswitch_config.cpp) ki18n_wrap_ui(kwin_flipswitch_config_SRCS flipswitch_config.ui) -qt5_add_dbus_interface(kwin_flipswitch_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_flipswitch_config_SRCS flipswitchconfig.kcfgc) add_library(kwin_flipswitch_config MODULE ${kwin_flipswitch_config_SRCS}) @@ -12,6 +11,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_flipswitch_config flipswitch_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/glide/CMakeLists.txt b/effects/glide/CMakeLists.txt --- a/effects/glide/CMakeLists.txt +++ b/effects/glide/CMakeLists.txt @@ -2,15 +2,15 @@ # Config set(kwin_glide_config_SRCS glide_config.cpp) ki18n_wrap_ui(kwin_glide_config_SRCS glide_config.ui) -qt5_add_dbus_interface(kwin_glide_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_glide_config_SRCS glideconfig.kcfgc) add_library(kwin_glide_config MODULE ${kwin_glide_config_SRCS}) target_link_libraries(kwin_glide_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_glide_config glide_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/invert/CMakeLists.txt b/effects/invert/CMakeLists.txt --- a/effects/invert/CMakeLists.txt +++ b/effects/invert/CMakeLists.txt @@ -4,15 +4,15 @@ ####################################### # Config set(kwin_invert_config_SRCS invert_config.cpp) -qt5_add_dbus_interface(kwin_invert_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) add_library(kwin_invert_config MODULE ${kwin_invert_config_SRCS}) target_link_libraries(kwin_invert_config KF5::ConfigWidgets KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_invert_config invert_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/lookingglass/CMakeLists.txt b/effects/lookingglass/CMakeLists.txt --- a/effects/lookingglass/CMakeLists.txt +++ b/effects/lookingglass/CMakeLists.txt @@ -5,7 +5,6 @@ # Config set(kwin_lookingglass_config_SRCS lookingglass_config.cpp) ki18n_wrap_ui(kwin_lookingglass_config_SRCS lookingglass_config.ui) -qt5_add_dbus_interface(kwin_lookingglass_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_lookingglass_config_SRCS lookingglassconfig.kcfgc) add_library(kwin_lookingglass_config MODULE ${kwin_lookingglass_config_SRCS}) @@ -15,6 +14,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_lookingglass_config lookingglass_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/magiclamp/CMakeLists.txt b/effects/magiclamp/CMakeLists.txt --- a/effects/magiclamp/CMakeLists.txt +++ b/effects/magiclamp/CMakeLists.txt @@ -2,15 +2,15 @@ # Config set(kwin_magiclamp_config_SRCS magiclamp_config.cpp) ki18n_wrap_ui(kwin_magiclamp_config_SRCS magiclamp_config.ui) -qt5_add_dbus_interface(kwin_magiclamp_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_magiclamp_config_SRCS magiclampconfig.kcfgc) add_library(kwin_magiclamp_config MODULE ${kwin_magiclamp_config_SRCS}) target_link_libraries(kwin_magiclamp_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_magiclamp_config magiclamp_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/magnifier/CMakeLists.txt b/effects/magnifier/CMakeLists.txt --- a/effects/magnifier/CMakeLists.txt +++ b/effects/magnifier/CMakeLists.txt @@ -2,7 +2,6 @@ # Config set(kwin_magnifier_config_SRCS magnifier_config.cpp) ki18n_wrap_ui(kwin_magnifier_config_SRCS magnifier_config.ui) -qt5_add_dbus_interface(kwin_magnifier_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_magnifier_config_SRCS magnifierconfig.kcfgc) add_library(kwin_magnifier_config MODULE ${kwin_magnifier_config_SRCS}) @@ -12,6 +11,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_magnifier_config magnifier_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/mouseclick/CMakeLists.txt b/effects/mouseclick/CMakeLists.txt --- a/effects/mouseclick/CMakeLists.txt +++ b/effects/mouseclick/CMakeLists.txt @@ -3,7 +3,6 @@ ########################## set(kwin_mouseclick_config_SRCS mouseclick_config.cpp) ki18n_wrap_ui(kwin_mouseclick_config_SRCS mouseclick_config.ui) -qt5_add_dbus_interface(kwin_mouseclick_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_mouseclick_config_SRCS mouseclickconfig.kcfgc) add_library(kwin_mouseclick_config MODULE ${kwin_mouseclick_config_SRCS}) @@ -13,6 +12,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_mouseclick_config mouseclick_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/mousemark/CMakeLists.txt b/effects/mousemark/CMakeLists.txt --- a/effects/mousemark/CMakeLists.txt +++ b/effects/mousemark/CMakeLists.txt @@ -2,7 +2,6 @@ # Config set(kwin_mousemark_config_SRCS mousemark_config.cpp) ki18n_wrap_ui(kwin_mousemark_config_SRCS mousemark_config.ui) -qt5_add_dbus_interface(kwin_mousemark_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_mousemark_config_SRCS mousemarkconfig.kcfgc) add_library(kwin_mousemark_config MODULE ${kwin_mousemark_config_SRCS}) @@ -13,6 +12,7 @@ KF5::I18n KF5::TextWidgets KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_mousemark_config mousemark_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/presentwindows/CMakeLists.txt b/effects/presentwindows/CMakeLists.txt --- a/effects/presentwindows/CMakeLists.txt +++ b/effects/presentwindows/CMakeLists.txt @@ -6,7 +6,6 @@ # Config set(kwin_presentwindows_config_SRCS presentwindows_config.cpp) ki18n_wrap_ui(kwin_presentwindows_config_SRCS presentwindows_config.ui) -qt5_add_dbus_interface(kwin_presentwindows_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_presentwindows_config_SRCS presentwindowsconfig.kcfgc) add_library(kwin_presentwindows_config MODULE ${kwin_presentwindows_config_SRCS}) @@ -17,6 +16,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_presentwindows_config presentwindows_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/resize/CMakeLists.txt b/effects/resize/CMakeLists.txt --- a/effects/resize/CMakeLists.txt +++ b/effects/resize/CMakeLists.txt @@ -2,15 +2,15 @@ # Config set(kwin_resize_config_SRCS resize_config.cpp) ki18n_wrap_ui(kwin_resize_config_SRCS resize_config.ui) -qt5_add_dbus_interface(kwin_resize_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_resize_config_SRCS resizeconfig.kcfgc) add_library(kwin_resize_config MODULE ${kwin_resize_config_SRCS}) target_link_libraries(kwin_resize_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_resize_config resize_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/showfps/CMakeLists.txt b/effects/showfps/CMakeLists.txt --- a/effects/showfps/CMakeLists.txt +++ b/effects/showfps/CMakeLists.txt @@ -2,7 +2,6 @@ # Config set(kwin_showfps_config_SRCS showfps_config.cpp) ki18n_wrap_ui(kwin_showfps_config_SRCS showfps_config.ui) -qt5_add_dbus_interface(kwin_showfps_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_showfps_config_SRCS showfpsconfig.kcfgc) add_library(kwin_showfps_config MODULE ${kwin_showfps_config_SRCS}) @@ -12,6 +11,7 @@ KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_showfps_config showfps_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/slide/CMakeLists.txt b/effects/slide/CMakeLists.txt --- a/effects/slide/CMakeLists.txt +++ b/effects/slide/CMakeLists.txt @@ -2,15 +2,15 @@ # Config set(kwin_slide_config_SRCS slide_config.cpp) ki18n_wrap_ui(kwin_slide_config_SRCS slide_config.ui) -qt5_add_dbus_interface(kwin_slide_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_slide_config_SRCS slideconfig.kcfgc) add_library(kwin_slide_config MODULE ${kwin_slide_config_SRCS}) target_link_libraries(kwin_slide_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_slide_config slide_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/thumbnailaside/CMakeLists.txt b/effects/thumbnailaside/CMakeLists.txt --- a/effects/thumbnailaside/CMakeLists.txt +++ b/effects/thumbnailaside/CMakeLists.txt @@ -2,7 +2,6 @@ # Config set(kwin_thumbnailaside_config_SRCS thumbnailaside_config.cpp) ki18n_wrap_ui(kwin_thumbnailaside_config_SRCS thumbnailaside_config.ui) -qt5_add_dbus_interface(kwin_thumbnailaside_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_thumbnailaside_config_SRCS thumbnailasideconfig.kcfgc) add_library(kwin_thumbnailaside_config MODULE ${kwin_thumbnailaside_config_SRCS}) @@ -12,6 +11,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_thumbnailaside_config thumbnailaside_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/trackmouse/CMakeLists.txt b/effects/trackmouse/CMakeLists.txt --- a/effects/trackmouse/CMakeLists.txt +++ b/effects/trackmouse/CMakeLists.txt @@ -7,7 +7,6 @@ # Config set(kwin_trackmouse_config_SRCS trackmouse_config.cpp) ki18n_wrap_ui(kwin_trackmouse_config_SRCS trackmouse_config.ui) -qt5_add_dbus_interface(kwin_trackmouse_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_trackmouse_config_SRCS trackmouseconfig.kcfgc) add_library(kwin_trackmouse_config MODULE ${kwin_trackmouse_config_SRCS}) @@ -17,6 +16,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_trackmouse_config trackmouse_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/windowgeometry/CMakeLists.txt b/effects/windowgeometry/CMakeLists.txt --- a/effects/windowgeometry/CMakeLists.txt +++ b/effects/windowgeometry/CMakeLists.txt @@ -2,7 +2,6 @@ # Config set(kwin_windowgeometry_config_SRCS windowgeometry_config.cpp) ki18n_wrap_ui(kwin_windowgeometry_config_SRCS windowgeometry_config.ui) -qt5_add_dbus_interface(kwin_windowgeometry_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_windowgeometry_config_SRCS windowgeometryconfig.kcfgc) add_library(kwin_windowgeometry_config MODULE ${kwin_windowgeometry_config_SRCS}) @@ -12,6 +11,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_windowgeometry_config windowgeometry_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/wobblywindows/CMakeLists.txt b/effects/wobblywindows/CMakeLists.txt --- a/effects/wobblywindows/CMakeLists.txt +++ b/effects/wobblywindows/CMakeLists.txt @@ -2,15 +2,15 @@ # Config set(kwin_wobblywindows_config_SRCS wobblywindows_config.cpp) ki18n_wrap_ui(kwin_wobblywindows_config_SRCS wobblywindows_config.ui) -qt5_add_dbus_interface(kwin_wobblywindows_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_wobblywindows_config_SRCS wobblywindowsconfig.kcfgc) add_library(kwin_wobblywindows_config MODULE ${kwin_wobblywindows_config_SRCS}) target_link_libraries(kwin_wobblywindows_config KF5::ConfigWidgets KF5::I18n Qt5::DBus + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_wobblywindows_config wobblywindows_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/effects/zoom/CMakeLists.txt b/effects/zoom/CMakeLists.txt --- a/effects/zoom/CMakeLists.txt +++ b/effects/zoom/CMakeLists.txt @@ -2,7 +2,6 @@ # Config set(kwin_zoom_config_SRCS zoom_config.cpp) ki18n_wrap_ui(kwin_zoom_config_SRCS zoom_config.ui) -qt5_add_dbus_interface(kwin_zoom_config_SRCS ${kwin_effects_dbus_xml} kwineffects_interface) kconfig_add_kcfg_files(kwin_zoom_config_SRCS zoomconfig.kcfgc) add_library(kwin_zoom_config MODULE ${kwin_zoom_config_SRCS}) @@ -12,6 +11,7 @@ KF5::GlobalAccel KF5::I18n KF5::XmlGui + KWinEffectsInterface ) kcoreaddons_desktop_to_json(kwin_zoom_config zoom_config.desktop SERVICE_TYPES kcmodule.desktop) diff --git a/kcmkwin/kwinoptions/main.cpp b/kcmkwin/kwinoptions/main.cpp --- a/kcmkwin/kwinoptions/main.cpp +++ b/kcmkwin/kwinoptions/main.cpp @@ -235,4 +235,3 @@ ) #include "main.moc" -#include "moc_main.cpp" diff --git a/kcmkwin/kwinrules/CMakeLists.txt b/kcmkwin/kwinrules/CMakeLists.txt --- a/kcmkwin/kwinrules/CMakeLists.txt +++ b/kcmkwin/kwinrules/CMakeLists.txt @@ -1,19 +1,27 @@ # KI18N Translation Domain for this library add_definitions(-DTRANSLATION_DOMAIN=\"kcmkwinrules\") add_definitions(-DKCMRULES) -########### next target ############### include_directories(../../) -set(kwinrules_MOC_HDRS yesnobox.h ../../cursor.h ../../plugins/platforms/x11/standalone/x11cursor.h) -qt5_wrap_cpp(kwinrules_MOC_SRCS ${kwinrules_MOC_HDRS}) -set(kwinrules_SRCS ../../rulebooksettings.cpp ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp main.cpp ${kwinrules_MOC_SRCS}) +set(kwinrules_SRCS ../../rulebooksettings.cpp + ../../cursor.cpp + ../../plugins/platforms/x11/standalone/x11cursor.cpp + ../../rules.cpp + ../../placement.cpp + ../../utils.cpp + yesnobox.cpp + ruleswidget.cpp + ruleslist.cpp + kwinsrc.cpp + detectwidget.cpp + ) ki18n_wrap_ui(kwinrules_SRCS ruleslist.ui detectwidget.ui editshortcut.ui ruleswidgetbase.ui) kconfig_add_kcfg_files(kwinrules_SRCS ../../rulesettings.kcfgc) kconfig_add_kcfg_files(kwinrules_SRCS ../../rulebooksettingsbase.kcfgc) -add_executable(kwin_rules_dialog ${kwinrules_SRCS}) +add_library(KWinRulesObjects OBJECT ${kwinrules_SRCS}) set(kwin_kcm_rules_XCB_LIBS XCB::CURSOR @@ -36,19 +44,14 @@ if (KWIN_BUILD_ACTIVITIES) set(kcm_libs ${kcm_libs} KF5::Activities) endif() +target_link_libraries(KWinRulesObjects ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS}) -target_link_libraries(kwin_rules_dialog ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS}) - +add_executable(kwin_rules_dialog main.cpp) +target_link_libraries(kwin_rules_dialog KWinRulesObjects) install(TARGETS kwin_rules_dialog DESTINATION ${LIBEXEC_INSTALL_DIR}) -########### next target ############### - -set(kcm_kwinrules_PART_SRCS kcm.cpp ${kwinrules_SRCS}) - -add_library(kcm_kwinrules MODULE ${kcm_kwinrules_PART_SRCS}) - -target_link_libraries(kcm_kwinrules ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS}) - +add_library(kcm_kwinrules MODULE kcm.cpp) +target_link_libraries(kcm_kwinrules KWinRulesObjects) install(TARGETS kcm_kwinrules DESTINATION ${PLUGIN_INSTALL_DIR}) ########### install files ############### diff --git a/kcmkwin/kwinrules/kwinsrc.cpp b/kcmkwin/kwinrules/kwinsrc.cpp --- a/kcmkwin/kwinrules/kwinsrc.cpp +++ b/kcmkwin/kwinrules/kwinsrc.cpp @@ -16,15 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Include some code from kwin core in order to avoid -// double implementation. - -#include "../../cursor.cpp" -#include "../../plugins/platforms/x11/standalone/x11cursor.cpp" -#include "../../rules.cpp" -#include "../../placement.cpp" -#include "../../options.cpp" -#include "../../utils.cpp" +#include KWin::InputRedirection *KWin::InputRedirection::s_self = nullptr; diff --git a/kcmkwin/kwinrules/yesnobox.h b/kcmkwin/kwinrules/yesnobox.h --- a/kcmkwin/kwinrules/yesnobox.h +++ b/kcmkwin/kwinrules/yesnobox.h @@ -28,18 +28,7 @@ class YesNoBox : public QWidget { Q_OBJECT public: - explicit YesNoBox( QWidget *parent ) : QWidget(parent) - { - QHBoxLayout *l = new QHBoxLayout(this); - l->setContentsMargins(0, 0, 0, 0); - l->addWidget(yes = new QRadioButton(i18n("Yes"), this)); - l->addWidget(no = new QRadioButton(i18n("No"), this)); - l->addStretch(100); - no->setChecked(true); - connect(yes, SIGNAL(clicked(bool)), this, SIGNAL(clicked(bool))); - connect(yes, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); - connect(no, SIGNAL(clicked(bool)), this, SLOT(noClicked(bool))); - } + explicit YesNoBox( QWidget *parent ); bool isChecked() { return yes->isChecked(); } public Q_SLOTS: void setChecked(bool b) { yes->setChecked(b); } diff --git a/kcmkwin/kwinrules/yesnobox.cpp b/kcmkwin/kwinrules/yesnobox.cpp new file mode 100644 --- /dev/null +++ b/kcmkwin/kwinrules/yesnobox.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2011 Thomas Lübking + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "yesnobox.h" + +YesNoBox::YesNoBox( QWidget *parent ) + : QWidget(parent) +{ + QHBoxLayout *l = new QHBoxLayout(this); + l->setContentsMargins(0, 0, 0, 0); + l->addWidget(yes = new QRadioButton(i18n("Yes"), this)); + l->addWidget(no = new QRadioButton(i18n("No"), this)); + l->addStretch(100); + no->setChecked(true); + connect(yes, SIGNAL(clicked(bool)), this, SIGNAL(clicked(bool))); + connect(yes, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); + connect(no, SIGNAL(clicked(bool)), this, SLOT(noClicked(bool))); +} diff --git a/plugins/kdecorations/aurorae/themes/plastik/code/plastikplugin.cpp b/plugins/kdecorations/aurorae/themes/plastik/code/plastikplugin.cpp --- a/plugins/kdecorations/aurorae/themes/plastik/code/plastikplugin.cpp +++ b/plugins/kdecorations/aurorae/themes/plastik/code/plastikplugin.cpp @@ -29,5 +29,3 @@ engine->addImageProvider(QLatin1String("plastik"), new KWin::PlastikButtonProvider()); QQmlExtensionPlugin::initializeEngine(engine, uri); } - -#include "moc_plastikplugin.cpp" diff --git a/utils.h b/utils.h --- a/utils.h +++ b/utils.h @@ -194,8 +194,10 @@ explicit Process(QObject *parent = nullptr); ~Process() override; +#ifndef KCMRULES protected: void setupChildProcess() override; +#endif }; } // namespace diff --git a/utils.cpp b/utils.cpp --- a/utils.cpp +++ b/utils.cpp @@ -77,6 +77,13 @@ #endif +Process::Process(QObject *parent) + : QProcess(parent) +{ +} + +Process::~Process() = default; + #ifndef KCMRULES void updateXTime() { @@ -135,13 +142,6 @@ xcb_ungrab_keyboard(connection(), XCB_TIME_CURRENT_TIME); } -Process::Process(QObject *parent) - : QProcess(parent) -{ -} - -Process::~Process() = default; - void Process::setupChildProcess() { sigset_t userSiganls;