UI,shared: Move OBSPlainTextEdit to its own directory

This commit is contained in:
tytan652 2024-01-17 08:25:36 +01:00
parent 69eae11019
commit 437ef58666
13 changed files with 60 additions and 18 deletions

View file

@ -71,6 +71,10 @@ find_package(CURL REQUIRED)
add_subdirectory(frontend-plugins) add_subdirectory(frontend-plugins)
add_executable(obs) add_executable(obs)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
if(NOT TARGET OBS::qt-wrappers) if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers") add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif() endif()
@ -195,8 +199,6 @@ target_sources(
menu-button.hpp menu-button.hpp
mute-checkbox.hpp mute-checkbox.hpp
noncheckable-button.hpp noncheckable-button.hpp
plain-text-edit.cpp
plain-text-edit.hpp
properties-view.cpp properties-view.cpp
properties-view.hpp properties-view.hpp
properties-view.moc.hpp properties-view.moc.hpp
@ -316,7 +318,8 @@ target_link_libraries(
FFmpeg::avformat FFmpeg::avformat
OBS::libobs OBS::libobs
OBS::frontend-api OBS::frontend-api
OBS::qt-wrappers) OBS::qt-wrappers
OBS::qt-plain-text-edit)
set_target_properties(obs PROPERTIES FOLDER "frontend") set_target_properties(obs PROPERTIES FOLDER "frontend")

View file

@ -9,8 +9,6 @@ target_sources(
double-slider.hpp double-slider.hpp
horizontal-scroll-area.cpp horizontal-scroll-area.cpp
horizontal-scroll-area.hpp horizontal-scroll-area.hpp
plain-text-edit.cpp
plain-text-edit.hpp
properties-view.cpp properties-view.cpp
properties-view.hpp properties-view.hpp
properties-view.moc.hpp properties-view.moc.hpp
@ -26,6 +24,12 @@ target_compile_options(obs-ui-support INTERFACE $<$<PLATFORM_ID:Linux>:-Wno-erro
target_link_libraries(obs-studio PRIVATE OBS::ui-support) target_link_libraries(obs-studio PRIVATE OBS::ui-support)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
target_link_libraries(obs-studio PRIVATE OBS::qt-plain-text-edit)
target_sources( target_sources(
obs-studio obs-studio
PRIVATE # cmake-format: sortable PRIVATE # cmake-format: sortable

View file

@ -23,6 +23,10 @@ if(NOT TARGET OBS::aja-support)
add_subdirectory("${CMAKE_SOURCE_DIR}/plugins/aja" "${CMAKE_BINARY_DIR}/plugins/aja") add_subdirectory("${CMAKE_SOURCE_DIR}/plugins/aja" "${CMAKE_BINARY_DIR}/plugins/aja")
endif() endif()
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
if(NOT TARGET OBS::qt-wrappers) if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers") add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif() endif()
@ -44,6 +48,7 @@ target_link_libraries(
PRIVATE OBS::libobs PRIVATE OBS::libobs
OBS::aja-support OBS::aja-support
OBS::frontend-api OBS::frontend-api
OBS::qt-plain-text-edit
OBS::qt-wrappers OBS::qt-wrappers
OBS::ui-support OBS::ui-support
Qt::Widgets Qt::Widgets

View file

@ -9,6 +9,10 @@ find_package(LibAJANTV2 REQUIRED)
add_library(aja-output-ui MODULE) add_library(aja-output-ui MODULE)
add_library(OBS::aja-output-ui ALIAS aja-output-ui) add_library(OBS::aja-output-ui ALIAS aja-output-ui)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
if(NOT TARGET OBS::qt-wrappers) if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers") add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif() endif()
@ -52,8 +56,6 @@ target_sources(
${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.hpp ${CMAKE_SOURCE_DIR}/plugins/aja/aja-widget-io.hpp
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp ${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp ${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/plain-text-edit.hpp
${CMAKE_SOURCE_DIR}/UI/plain-text-edit.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp ${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp ${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp ${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
@ -64,7 +66,8 @@ target_sources(
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp ${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp) ${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp)
target_link_libraries(aja-output-ui PRIVATE OBS::libobs OBS::frontend-api OBS::qt-wrappers Qt::Widgets AJA::LibAJANTV2) target_link_libraries(aja-output-ui PRIVATE OBS::libobs OBS::frontend-api OBS::qt-wrappers OBS::qt-plain-text-edit
Qt::Widgets AJA::LibAJANTV2)
if(OS_MACOS) if(OS_MACOS)
find_library(IOKIT_FRAMEWORK Iokit) find_library(IOKIT_FRAMEWORK Iokit)

View file

@ -20,6 +20,10 @@ endif()
add_library(decklink-output-ui MODULE) add_library(decklink-output-ui MODULE)
add_library(OBS::decklink-output-ui ALIAS decklink-output-ui) add_library(OBS::decklink-output-ui ALIAS decklink-output-ui)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
if(NOT TARGET OBS::qt-wrappers) if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers") add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif() endif()
@ -35,6 +39,7 @@ target_link_libraries(
decklink-output-ui decklink-output-ui
PRIVATE OBS::libobs PRIVATE OBS::libobs
OBS::frontend-api OBS::frontend-api
OBS::qt-plain-text-edit
OBS::qt-wrappers OBS::qt-wrappers
OBS::ui-support OBS::ui-support
Qt::Widgets Qt::Widgets

View file

@ -7,6 +7,10 @@ endif()
add_library(decklink-output-ui MODULE) add_library(decklink-output-ui MODULE)
add_library(OBS::decklink-output-ui ALIAS decklink-output-ui) add_library(OBS::decklink-output-ui ALIAS decklink-output-ui)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
if(NOT TARGET OBS::qt-wrappers) if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers") add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif() endif()
@ -34,8 +38,6 @@ target_sources(
decklink-ui-main.h decklink-ui-main.h
${CMAKE_SOURCE_DIR}/UI/double-slider.cpp ${CMAKE_SOURCE_DIR}/UI/double-slider.cpp
${CMAKE_SOURCE_DIR}/UI/double-slider.hpp ${CMAKE_SOURCE_DIR}/UI/double-slider.hpp
${CMAKE_SOURCE_DIR}/UI/plain-text-edit.hpp
${CMAKE_SOURCE_DIR}/UI/plain-text-edit.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.hpp ${CMAKE_SOURCE_DIR}/UI/properties-view.hpp
${CMAKE_SOURCE_DIR}/UI/properties-view.cpp ${CMAKE_SOURCE_DIR}/UI/properties-view.cpp
${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp ${CMAKE_SOURCE_DIR}/UI/properties-view.moc.hpp
@ -46,7 +48,8 @@ target_sources(
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp ${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp) ${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp)
target_link_libraries(decklink-output-ui PRIVATE OBS::libobs OBS::frontend-api OBS::qt-wrappers Qt::Widgets) target_link_libraries(decklink-output-ui PRIVATE OBS::libobs OBS::frontend-api OBS::qt-wrappers OBS::qt-plain-text-edit
Qt::Widgets)
target_compile_features(decklink-output-ui PRIVATE cxx_std_17) target_compile_features(decklink-output-ui PRIVATE cxx_std_17)

View file

@ -14,6 +14,10 @@ endif()
add_library(frontend-tools MODULE) add_library(frontend-tools MODULE)
add_library(OBS::frontend-tools ALIAS frontend-tools) add_library(OBS::frontend-tools ALIAS frontend-tools)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
if(NOT TARGET OBS::qt-wrappers) if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers") add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif() endif()
@ -49,6 +53,7 @@ target_link_libraries(
frontend-tools frontend-tools
PRIVATE OBS::frontend-api PRIVATE OBS::frontend-api
OBS::libobs OBS::libobs
OBS::qt-plain-text-edit
OBS::qt-wrappers OBS::qt-wrappers
OBS::ui-support OBS::ui-support
Qt::Widgets Qt::Widgets

View file

@ -3,6 +3,10 @@ project(frontend-tools)
add_library(frontend-tools MODULE) add_library(frontend-tools MODULE)
add_library(OBS::frontend-tools ALIAS frontend-tools) add_library(OBS::frontend-tools ALIAS frontend-tools)
if(NOT TARGET OBS::qt-plain-text-edit)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/plain-text-edit" "${CMAKE_BINARY_DIR}/shared/qt/plain-text-edit")
endif()
if(NOT TARGET OBS::qt-wrappers) if(NOT TARGET OBS::qt-wrappers)
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers") add_subdirectory("${CMAKE_SOURCE_DIR}/shared/qt/wrappers" "${CMAKE_BINARY_DIR}/shared/qt/wrappers")
endif() endif()
@ -43,13 +47,12 @@ target_sources(
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp ${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.cpp
${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp ${CMAKE_SOURCE_DIR}/UI/slider-ignorewheel.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp ${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.hpp
${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp ${CMAKE_SOURCE_DIR}/UI/vertical-scroll-area.cpp)
${CMAKE_SOURCE_DIR}/UI/plain-text-edit.cpp
${CMAKE_SOURCE_DIR}/UI/plain-text-edit.hpp)
target_compile_features(frontend-tools PRIVATE cxx_std_17) target_compile_features(frontend-tools PRIVATE cxx_std_17)
target_link_libraries(frontend-tools PRIVATE OBS::frontend-api OBS::qt-wrappers OBS::libobs Qt::Widgets) target_link_libraries(frontend-tools PRIVATE OBS::frontend-api OBS::qt-wrappers OBS::qt-plain-text-edit OBS::libobs
Qt::Widgets)
if(OS_POSIX AND NOT OS_MACOS) if(OS_POSIX AND NOT OS_MACOS)
target_link_libraries(frontend-tools PRIVATE Qt::GuiPrivate) target_link_libraries(frontend-tools PRIVATE Qt::GuiPrivate)

View file

@ -1,7 +1,6 @@
#include "obs-module.h" #include "obs-module.h"
#include "scripts.hpp" #include "scripts.hpp"
#include "../../properties-view.hpp" #include "../../properties-view.hpp"
#include "../../plain-text-edit.hpp"
#include <QFileDialog> #include <QFileDialog>
#include <QHBoxLayout> #include <QHBoxLayout>
@ -18,6 +17,7 @@
#include <QUrl> #include <QUrl>
#include <QDesktopServices> #include <QDesktopServices>
#include <qt-wrappers.hpp> #include <qt-wrappers.hpp>
#include <plain-text-edit.hpp>
#include <obs.hpp> #include <obs.hpp>
#include <obs-module.h> #include <obs-module.h>

View file

@ -29,10 +29,10 @@
#include "spinbox-ignorewheel.hpp" #include "spinbox-ignorewheel.hpp"
#include "properties-view.hpp" #include "properties-view.hpp"
#include "properties-view.moc.hpp" #include "properties-view.moc.hpp"
#include "plain-text-edit.hpp"
#include "obs-app.hpp" #include "obs-app.hpp"
#include <qt-wrappers.hpp> #include <qt-wrappers.hpp>
#include <plain-text-edit.hpp>
#include <cstdlib> #include <cstdlib>
#include <initializer_list> #include <initializer_list>
#include <obs-data.h> #include <obs-data.h>

View file

@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.22...3.25)
find_package(Qt6 REQUIRED Core Widgets)
add_library(qt-plain-text-edit INTERFACE)
add_library(OBS::qt-plain-text-edit ALIAS qt-plain-text-edit)
target_sources(qt-plain-text-edit INTERFACE plain-text-edit.cpp plain-text-edit.hpp)
target_include_directories(qt-plain-text-edit INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(qt-plain-text-edit INTERFACE Qt::Core Qt::Widgets)

View file

@ -1,4 +1,4 @@
#include "plain-text-edit.hpp" #include <plain-text-edit.hpp>
#include <QFontDatabase> #include <QFontDatabase>
OBSPlainTextEdit::OBSPlainTextEdit(QWidget *parent, bool monospace) OBSPlainTextEdit::OBSPlainTextEdit(QWidget *parent, bool monospace)