Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dda7541e2f | |||
| 2408f5494c | |||
| 2542690eca | |||
| cc0c187481 | |||
| a8dcfbec58 | |||
| 65705e3354 | |||
| e1f9a9eb6a |
2
.idea/editor.xml
generated
2
.idea/editor.xml
generated
@@ -19,7 +19,7 @@
|
|||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||||
|
|||||||
2
.idea/kte.iml
generated
2
.idea/kte.iml
generated
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module classpath="CMake" type="CPP_MODULE" version="4">
|
<module classpath="CIDR" type="CPP_MODULE" version="4">
|
||||||
<component name="FacetManager">
|
<component name="FacetManager">
|
||||||
<facet type="Python" name="Python facet">
|
<facet type="Python" name="Python facet">
|
||||||
<configuration sdkName="" />
|
<configuration sdkName="" />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ project(kte)
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(KTE_VERSION "1.5.2")
|
set(KTE_VERSION "1.5.4")
|
||||||
|
|
||||||
# Default to terminal-only build to avoid SDL/OpenGL dependency by default.
|
# Default to terminal-only build to avoid SDL/OpenGL dependency by default.
|
||||||
# Enable with -DBUILD_GUI=ON when SDL2/OpenGL/Freetype are available.
|
# Enable with -DBUILD_GUI=ON when SDL2/OpenGL/Freetype are available.
|
||||||
@@ -208,6 +208,7 @@ set(FONT_HEADERS
|
|||||||
fonts/Syne.h
|
fonts/Syne.h
|
||||||
fonts/Triplicate.h
|
fonts/Triplicate.h
|
||||||
fonts/Unispace.h
|
fonts/Unispace.h
|
||||||
|
fonts/BerkeleyMono.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(COMMON_HEADERS
|
set(COMMON_HEADERS
|
||||||
@@ -255,6 +256,7 @@ if (BUILD_GUI)
|
|||||||
ImGuiFrontend.h
|
ImGuiFrontend.h
|
||||||
ImGuiInputHandler.h
|
ImGuiInputHandler.h
|
||||||
ImGuiRenderer.h
|
ImGuiRenderer.h
|
||||||
|
fonts/BerkeleyMono.h
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
@@ -379,12 +381,18 @@ if (${BUILD_GUI})
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/kge-Info.plist
|
${CMAKE_CURRENT_BINARY_DIR}/kge-Info.plist
|
||||||
@ONLY)
|
@ONLY)
|
||||||
|
|
||||||
|
# Ensure proper macOS bundle properties and RPATH so our bundled
|
||||||
|
# frameworks are preferred over system/Homebrew ones.
|
||||||
set_target_properties(kge PROPERTIES
|
set_target_properties(kge PROPERTIES
|
||||||
MACOSX_BUNDLE TRUE
|
MACOSX_BUNDLE TRUE
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${KGE_BUNDLE_ID}
|
MACOSX_BUNDLE_GUI_IDENTIFIER ${KGE_BUNDLE_ID}
|
||||||
MACOSX_BUNDLE_BUNDLE_NAME "kge"
|
MACOSX_BUNDLE_BUNDLE_NAME "kge"
|
||||||
MACOSX_BUNDLE_ICON_FILE ${MACOSX_BUNDLE_ICON_FILE}
|
MACOSX_BUNDLE_ICON_FILE ${MACOSX_BUNDLE_ICON_FILE}
|
||||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/kge-Info.plist")
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/kge-Info.plist"
|
||||||
|
# Prefer the app's bundled frameworks at runtime
|
||||||
|
INSTALL_RPATH "@executable_path/../Frameworks"
|
||||||
|
BUILD_WITH_INSTALL_RPATH TRUE
|
||||||
|
)
|
||||||
|
|
||||||
add_dependencies(kge kte)
|
add_dependencies(kge kte)
|
||||||
add_custom_command(TARGET kge POST_BUILD
|
add_custom_command(TARGET kge POST_BUILD
|
||||||
@@ -408,4 +416,19 @@ if (${BUILD_GUI})
|
|||||||
# Install kge man page only when GUI is built
|
# Install kge man page only when GUI is built
|
||||||
install(FILES docs/kge.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
install(FILES docs/kge.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||||
install(FILES kge.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons)
|
install(FILES kge.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons)
|
||||||
|
|
||||||
|
# Optional post-build bundle fixup (can also be run from scripts).
|
||||||
|
# This provides a CMake target to run BundleUtilities' fixup_bundle on the
|
||||||
|
# built app, useful after macdeployqt to ensure non-Qt dylibs are internalized.
|
||||||
|
if (APPLE)
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
add_custom_target(kge_fixup_bundle ALL
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DAPP_BUNDLE=$<TARGET_BUNDLE_DIR:kge>
|
||||||
|
-P ${CMAKE_CURRENT_LIST_DIR}/cmake/fix_bundle.cmake
|
||||||
|
BYPRODUCTS $<TARGET_BUNDLE_DIR:kge>/Contents/Frameworks
|
||||||
|
COMMENT "Running fixup_bundle on kge.app to internalize non-Qt dylibs"
|
||||||
|
VERBATIM)
|
||||||
|
add_dependencies(kge_fixup_bundle kge)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
886
Command.cc
886
Command.cc
File diff suppressed because it is too large
Load Diff
@@ -158,16 +158,17 @@ map_key(const SDL_Keycode key,
|
|||||||
ascii_key = static_cast<int>(key);
|
ascii_key = static_cast<int>(key);
|
||||||
}
|
}
|
||||||
bool ctrl2 = (mod & KMOD_CTRL) != 0;
|
bool ctrl2 = (mod & KMOD_CTRL) != 0;
|
||||||
// If user typed a literal 'C' (or '^') as a control qualifier, keep k-prefix active
|
// If user typed a literal 'C' (uppercase) or '^' as a control qualifier, keep k-prefix active
|
||||||
if (ascii_key == 'C' || ascii_key == 'c' || ascii_key == '^') {
|
// Do NOT treat lowercase 'c' as a qualifier; 'c' is a valid k-command (BufferClose).
|
||||||
k_ctrl_pending = true;
|
if (ascii_key == 'C' || ascii_key == '^') {
|
||||||
// Keep waiting for the next suffix; show status and suppress ensuing TEXTINPUT
|
k_ctrl_pending = true;
|
||||||
if (ed)
|
// Keep waiting for the next suffix; show status and suppress ensuing TEXTINPUT
|
||||||
ed->SetStatus("C-k C _");
|
if (ed)
|
||||||
suppress_textinput_once = true;
|
ed->SetStatus("C-k C _");
|
||||||
out.hasCommand = false;
|
suppress_textinput_once = true;
|
||||||
return true;
|
out.hasCommand = false;
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
// Otherwise, consume the k-prefix now for the actual suffix
|
// Otherwise, consume the k-prefix now for the actual suffix
|
||||||
k_prefix = false;
|
k_prefix = false;
|
||||||
if (ascii_key != 0) {
|
if (ascii_key != 0) {
|
||||||
@@ -472,16 +473,16 @@ ImGuiInputHandler::ProcessSDLEvent(const SDL_Event &e)
|
|||||||
ascii_key = static_cast<int>(c0);
|
ascii_key = static_cast<int>(c0);
|
||||||
}
|
}
|
||||||
if (ascii_key != 0) {
|
if (ascii_key != 0) {
|
||||||
// Qualifier via TEXTINPUT: 'C' or '^'
|
// Qualifier via TEXTINPUT: uppercase 'C' or '^' only
|
||||||
if (ascii_key == 'C' || ascii_key == 'c' || ascii_key == '^') {
|
if (ascii_key == 'C' || ascii_key == '^') {
|
||||||
k_ctrl_pending_ = true;
|
k_ctrl_pending_ = true;
|
||||||
if (ed_)
|
if (ed_)
|
||||||
ed_->SetStatus("C-k C _");
|
ed_->SetStatus("C-k C _");
|
||||||
// Keep k-prefix active; do not emit a command
|
// Keep k-prefix active; do not emit a command
|
||||||
k_prefix_ = true;
|
k_prefix_ = true;
|
||||||
produced = true;
|
produced = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Map via k-prefix table; do not pass Ctrl for TEXTINPUT case
|
// Map via k-prefix table; do not pass Ctrl for TEXTINPUT case
|
||||||
CommandId id;
|
CommandId id;
|
||||||
bool pass_ctrl = k_ctrl_pending_;
|
bool pass_ctrl = k_ctrl_pending_;
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ TerminalFrontend::Init(Editor &ed)
|
|||||||
have_old_sigint_ = true;
|
have_old_sigint_ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,4 +121,4 @@ TerminalFrontend::Shutdown()
|
|||||||
have_old_sigint_ = false;
|
have_old_sigint_ = false;
|
||||||
}
|
}
|
||||||
endwin();
|
endwin();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,14 +178,15 @@ map_key_to_command(const int ch,
|
|||||||
ctrl = true;
|
ctrl = true;
|
||||||
ascii_key = 'a' + (ch - 1);
|
ascii_key = 'a' + (ch - 1);
|
||||||
}
|
}
|
||||||
// If user typed literal 'C'/'c' or '^' as a qualifier, keep k-prefix and set pending
|
// If user typed literal 'C' or '^' as a qualifier, keep k-prefix and set pending
|
||||||
if (ascii_key == 'C' || ascii_key == 'c' || ascii_key == '^') {
|
// Note: Do NOT treat lowercase 'c' as a qualifier, since 'c' is a valid C-k command (BufferClose).
|
||||||
k_ctrl_pending = true;
|
if (ascii_key == 'C' || ascii_key == '^') {
|
||||||
if (ed)
|
k_ctrl_pending = true;
|
||||||
ed->SetStatus("C-k C _");
|
if (ed)
|
||||||
out.hasCommand = false;
|
ed->SetStatus("C-k C _");
|
||||||
return true;
|
out.hasCommand = false;
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
// For actual suffix, consume the k-prefix
|
// For actual suffix, consume the k-prefix
|
||||||
k_prefix = false;
|
k_prefix = false;
|
||||||
// Do NOT lowercase here; KLookupKCommand handles case-sensitive bindings
|
// Do NOT lowercase here; KLookupKCommand handles case-sensitive bindings
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
lib,
|
pkgs ? import <nixpkgs> {},
|
||||||
|
lib ? pkgs.lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
cmake,
|
cmake,
|
||||||
ncurses,
|
ncurses,
|
||||||
|
|||||||
5438
fonts/BerkeleyMono.h
Normal file
5438
fonts/BerkeleyMono.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,12 +3,12 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "BrassMonoCode.h"
|
#include "BerkeleyMono.h"
|
||||||
|
|
||||||
namespace kte::Fonts {
|
namespace kte::Fonts {
|
||||||
// Provide default embedded font aliases used by GUIFrontend fallback loader
|
// Provide default embedded font aliases used by GUIFrontend fallback loader
|
||||||
inline const unsigned int DefaultFontSize = BrassMonoCode::DefaultFontBoldCompressedSize;
|
inline const unsigned int DefaultFontSize = BerkeleyMono::DefaultFontRegularCompressedSize;
|
||||||
inline const unsigned int *DefaultFontData = BrassMonoCode::DefaultFontBoldCompressedData;
|
inline const unsigned int *DefaultFontData = BerkeleyMono::DefaultFontRegularCompressedData;
|
||||||
|
|
||||||
class Font {
|
class Font {
|
||||||
public:
|
public:
|
||||||
@@ -31,4 +31,4 @@ private:
|
|||||||
const unsigned int *data_{nullptr};
|
const unsigned int *data_{nullptr};
|
||||||
unsigned int size_{0};
|
unsigned int size_{0};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "B612Mono.h"
|
#include "B612Mono.h"
|
||||||
|
#include "BerkeleyMono.h"
|
||||||
#include "BrassMono.h"
|
#include "BrassMono.h"
|
||||||
#include "BrassMonoCode.h"
|
#include "BrassMonoCode.h"
|
||||||
#include "FiraCode.h"
|
#include "FiraCode.h"
|
||||||
@@ -14,4 +15,4 @@
|
|||||||
#include "SpaceMono.h"
|
#include "SpaceMono.h"
|
||||||
#include "Syne.h"
|
#include "Syne.h"
|
||||||
#include "Triplicate.h"
|
#include "Triplicate.h"
|
||||||
#include "Unispace.h"
|
#include "Unispace.h"
|
||||||
|
|||||||
@@ -7,28 +7,38 @@ InstallDefaultFonts()
|
|||||||
{
|
{
|
||||||
FontRegistry::Instance().Register(std::make_unique<Font>(
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
"default",
|
"default",
|
||||||
BrassMono::DefaultFontBoldCompressedData,
|
BerkeleyMono::DefaultFontBoldCompressedData,
|
||||||
BrassMono::DefaultFontBoldCompressedSize
|
BerkeleyMono::DefaultFontBoldCompressedSize
|
||||||
));
|
));
|
||||||
FontRegistry::Instance().Register(std::make_unique<Font>(
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
"b612",
|
"b612",
|
||||||
B612Mono::DefaultFontRegularCompressedData,
|
B612Mono::DefaultFontRegularCompressedData,
|
||||||
B612Mono::DefaultFontRegularCompressedSize
|
B612Mono::DefaultFontRegularCompressedSize
|
||||||
));
|
));
|
||||||
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
|
"berkeley",
|
||||||
|
BerkeleyMono::DefaultFontRegularCompressedData,
|
||||||
|
BerkeleyMono::DefaultFontRegularCompressedSize
|
||||||
|
));
|
||||||
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
|
"berkeley-bold",
|
||||||
|
BerkeleyMono::DefaultFontBoldCompressedData,
|
||||||
|
BerkeleyMono::DefaultFontBoldCompressedSize
|
||||||
|
));
|
||||||
FontRegistry::Instance().Register(std::make_unique<Font>(
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
"brassmono",
|
"brassmono",
|
||||||
BrassMono::DefaultFontRegularCompressedData,
|
BrassMono::DefaultFontRegularCompressedData,
|
||||||
BrassMono::DefaultFontRegularCompressedSize
|
BrassMono::DefaultFontRegularCompressedSize
|
||||||
));
|
));
|
||||||
FontRegistry::Instance().Register(std::make_unique<Font>(
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
"brassmono-bold",
|
"brassmono-bold",
|
||||||
BrassMono::DefaultFontBoldCompressedData,
|
BrassMono::DefaultFontBoldCompressedData,
|
||||||
BrassMono::DefaultFontBoldCompressedSize
|
BrassMono::DefaultFontBoldCompressedSize
|
||||||
));
|
));
|
||||||
FontRegistry::Instance().Register(std::make_unique<Font>(
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
"brassmonocode",
|
"brassmonocode",
|
||||||
BrassMonoCode::DefaultFontRegularCompressedData,
|
BrassMonoCode::DefaultFontRegularCompressedData,
|
||||||
BrassMonoCode::DefaultFontRegularCompressedSize
|
BrassMonoCode::DefaultFontRegularCompressedSize
|
||||||
));
|
));
|
||||||
FontRegistry::Instance().Register(std::make_unique<Font>(
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
||||||
"brassmonocode-bold",
|
"brassmonocode-bold",
|
||||||
@@ -101,4 +111,4 @@ InstallDefaultFonts()
|
|||||||
Unispace::DefaultFontRegularCompressedSize
|
Unispace::DefaultFontRegularCompressedSize
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
main.cc
11
main.cc
@@ -192,13 +192,11 @@ main(int argc, const char *argv[])
|
|||||||
} else if (req_term) {
|
} else if (req_term) {
|
||||||
use_gui = false;
|
use_gui = false;
|
||||||
} else {
|
} else {
|
||||||
|
// Default depends on build target: kge defaults to GUI, kte to terminal
|
||||||
|
|
||||||
// Default depends on build target: kge defaults to GUI, kte to terminal
|
|
||||||
#if defined(KTE_DEFAULT_GUI)
|
#if defined(KTE_DEFAULT_GUI)
|
||||||
use_gui = true;
|
use_gui = true;
|
||||||
#else
|
#else
|
||||||
use_gui = false;
|
use_gui = false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -307,6 +305,7 @@ main(int argc, const char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool running = true;
|
bool running = true;
|
||||||
while (running) {
|
while (running) {
|
||||||
fe->Step(editor, running);
|
fe->Step(editor, running);
|
||||||
@@ -315,4 +314,4 @@ main(int argc, const char *argv[])
|
|||||||
fe->Shutdown();
|
fe->Shutdown();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,14 +16,18 @@ open .
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
mkdir -p cmake-build-release-qt
|
mkdir -p cmake-build-release-qt
|
||||||
cmake -S . -B cmake-build-release -DBUILD_GUI=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_ASAN=OFF
|
cmake -S . -B cmake-build-release-qt -DBUILD_GUI=ON -DKTE_USE_QT=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_ASAN=OFF
|
||||||
|
|
||||||
cd cmake-build-release-qt
|
cd cmake-build-release-qt
|
||||||
make clean
|
make clean
|
||||||
rm -fr kge.app* kge-qt.app*
|
rm -fr kge.app* kge-qt.app*
|
||||||
make
|
make
|
||||||
mv kge.app kge-qt.app
|
mv -f kge.app kge-qt.app
|
||||||
macdeployqt kge-qt.app -always-overwrite
|
# Use the same Qt's macdeployqt as used for building; ensure it overwrites in-bundle paths
|
||||||
|
macdeployqt kge-qt.app -always-overwrite -verbose=3
|
||||||
|
|
||||||
|
# Run CMake BundleUtilities fixup to internalize non-Qt dylibs and rewrite install names
|
||||||
|
cmake -DAPP_BUNDLE="$(pwd)/kge-qt.app" -P "${PWD%/*}/cmake/fix_bundle.cmake"
|
||||||
zip -r kge-qt.app.zip kge-qt.app
|
zip -r kge-qt.app.zip kge-qt.app
|
||||||
sha256sum kge-qt.app.zip
|
sha256sum kge-qt.app.zip
|
||||||
open .
|
open .
|
||||||
|
|||||||
Reference in New Issue
Block a user