New keycodes; linux one time code execution; close file handle in save function

master
Allen Webster 2020-03-03 18:44:25 -08:00
parent bc2b834f3b
commit 7933ec6bc9
14 changed files with 377 additions and 208 deletions

View File

@ -123,9 +123,20 @@ make_key_list(Arena *arena){
add_code(arena, &list, string_u8_litexpr("Control"));
add_code(arena, &list, string_u8_litexpr("Alt"));
add_code(arena, &list, string_u8_litexpr("Command"));
for (u32 i = 1; i <= 16; i += 1){
for (u32 i = 1; i <= 24; i += 1){
add_code(arena, &list, push_u8_stringf(arena, "F%d", i));
}
for (u32 i = '0'; i <= '9'; i += 1){
add_code(arena, &list, push_u8_stringf(arena, "NumPad%c", i));
}
add_code(arena, &list, string_u8_litexpr("NumPadStar"));
add_code(arena, &list, string_u8_litexpr("NumPadPlus"));
add_code(arena, &list, string_u8_litexpr("NumPadMinus"));
add_code(arena, &list, string_u8_litexpr("NumPadDot"));
add_code(arena, &list, string_u8_litexpr("NumPadSlash"));
for (i32 i = 0; i < 30; i += 1){
add_code(arena, &list, push_u8_stringf(arena, "Ex%d", i));
}
return(list);
}

0
bin/itchio_push_all.sh Normal file → Executable file
View File

0
bin/itchio_push_linux-x86.sh Normal file → Executable file
View File

0
bin/itchio_push_linux.sh Normal file → Executable file
View File

0
bin/package-x86-linux.sh Normal file → Executable file
View File

42
custom/bin/build_one_time.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# If any command errors, stop the script
set -e
# Set up directories
ORIGINAL=$PWD
ME="$(readlink -f "$0")"
LOCATION="$(dirname "$ME")"
cd $LOCATION
cd ..
CUSTOM_ROOT=$PWD
cd $ORIGINAL
target=$1
if [ -z "$target" ]
then
echo error: no input file
exit 1
fi
full_target=$target
if [[ ${target:0:1} != "/" ]];
then
full_target="$PWD/$target"
fi
dst=$2
if [[ $dst == "" ]];
then
dst=.
fi
debug=-g
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=0"
pushd $dst
g++ -I"$CUSTOM_ROOT" $opts $full_target -o one_time
popd

View File

@ -15,9 +15,11 @@ if [ -z "$SOURCE" ]; then
fi
echo SOURCE = $SOURCE
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=1"
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=0"
arch=-m64
debug=-g
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
g++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=c++11 "$SOURCE" -E -o $preproc_file

View File

@ -18,6 +18,8 @@ fi
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_MAC=1 -DOS_WINDOWS=0 -DOS_LINUX=0"
arch=-m64
debug=-g
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
clang++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=c++11 "$SOURCE" -E -o $preproc_file

View File

@ -14,9 +14,11 @@ if [ -z "$SOURCE" ]; then
SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")"
fi
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=1"
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=0"
arch=-m32
debug=-g
preproc_file=4coder_command_metadata.i
meta_macros="-DMETA_PASS"
g++ -I"$CODE_HOME" $meta_macros $arch $opts $debug -std=c++11 "$SOURCE" -E -o $preproc_file

View File

@ -86,7 +86,60 @@ enum{
KeyCode_F14 = 85,
KeyCode_F15 = 86,
KeyCode_F16 = 87,
KeyCode_COUNT = 88,
KeyCode_F17 = 88,
KeyCode_F18 = 89,
KeyCode_F19 = 90,
KeyCode_F20 = 91,
KeyCode_F21 = 92,
KeyCode_F22 = 93,
KeyCode_F23 = 94,
KeyCode_F24 = 95,
KeyCode_NumPad0 = 96,
KeyCode_NumPad1 = 97,
KeyCode_NumPad2 = 98,
KeyCode_NumPad3 = 99,
KeyCode_NumPad4 = 100,
KeyCode_NumPad5 = 101,
KeyCode_NumPad6 = 102,
KeyCode_NumPad7 = 103,
KeyCode_NumPad8 = 104,
KeyCode_NumPad9 = 105,
KeyCode_NumPadStar = 106,
KeyCode_NumPadPlus = 107,
KeyCode_NumPadMinus = 108,
KeyCode_NumPadDot = 109,
KeyCode_NumPadSlash = 110,
KeyCode_Ex0 = 111,
KeyCode_Ex1 = 112,
KeyCode_Ex2 = 113,
KeyCode_Ex3 = 114,
KeyCode_Ex4 = 115,
KeyCode_Ex5 = 116,
KeyCode_Ex6 = 117,
KeyCode_Ex7 = 118,
KeyCode_Ex8 = 119,
KeyCode_Ex9 = 120,
KeyCode_Ex10 = 121,
KeyCode_Ex11 = 122,
KeyCode_Ex12 = 123,
KeyCode_Ex13 = 124,
KeyCode_Ex14 = 125,
KeyCode_Ex15 = 126,
KeyCode_Ex16 = 127,
KeyCode_Ex17 = 128,
KeyCode_Ex18 = 129,
KeyCode_Ex19 = 130,
KeyCode_Ex20 = 131,
KeyCode_Ex21 = 132,
KeyCode_Ex22 = 133,
KeyCode_Ex23 = 134,
KeyCode_Ex24 = 135,
KeyCode_Ex25 = 136,
KeyCode_Ex26 = 137,
KeyCode_Ex27 = 138,
KeyCode_Ex28 = 139,
KeyCode_Ex29 = 140,
KeyCode_COUNT = 141,
};
global char* key_code_name[KeyCode_COUNT] = {
"None",
@ -177,6 +230,59 @@ global char* key_code_name[KeyCode_COUNT] = {
"F14",
"F15",
"F16",
"F17",
"F18",
"F19",
"F20",
"F21",
"F22",
"F23",
"F24",
"NumPad0",
"NumPad1",
"NumPad2",
"NumPad3",
"NumPad4",
"NumPad5",
"NumPad6",
"NumPad7",
"NumPad8",
"NumPad9",
"NumPadStar",
"NumPadPlus",
"NumPadMinus",
"NumPadDot",
"NumPadSlash",
"Ex0",
"Ex1",
"Ex2",
"Ex3",
"Ex4",
"Ex5",
"Ex6",
"Ex7",
"Ex8",
"Ex9",
"Ex10",
"Ex11",
"Ex12",
"Ex13",
"Ex14",
"Ex15",
"Ex16",
"Ex17",
"Ex18",
"Ex19",
"Ex20",
"Ex21",
"Ex22",
"Ex23",
"Ex24",
"Ex25",
"Ex26",
"Ex27",
"Ex28",
"Ex29",
};
enum{
MouseCode_Left = 1,

View File

@ -1080,7 +1080,7 @@ linux_keycode_init(Display* dpy){
// Find the rest by their key label
struct SymCode { KeySym sym; Key_Code code; };
SymCode sym_table[100];
SymCode sym_table[108];
SymCode* p = sym_table;
*p++ = { XK_space, KeyCode_Space };
@ -1112,7 +1112,7 @@ linux_keycode_init(Display* dpy){
*p++ = { XK_Super_L, KeyCode_Command };
*p++ = { XK_Super_R, KeyCode_Command };
for(Key_Code k = KeyCode_F1; k <= KeyCode_F16; ++k) {
for (Key_Code k = KeyCode_F1; k <= KeyCode_F24; ++k){
*p++ = { XK_F1 + (k - KeyCode_F1), k };
}

View File

@ -233,6 +233,7 @@ system_save_file(Arena* scratch, char* file_name, String_Const_u8 data){
result = linux_file_attributes_from_struct_stat(&file_stat);
}
}
close(fd);
} else {
perror("open");
}

View File

@ -53,8 +53,8 @@ command_list = {
{ .name = "run one time",
.out = "*run*", .footer_panel = false, .save_dirty_files = false,
.cmd = { { "pushd ..\\build & one_time", .os = "win" },
{ "pushd ../build & one_time", .os = "linux" },
{ "pushd ../build & one_time", .os = "mac" }, }, },
{ "cd ../build && ./one_time" , .os = "linux" },
{ "pushd ../build && ./one_time" , .os = "mac" }, }, },
{ .name = "build custom api docs",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
@ -92,7 +92,8 @@ command_list = {
{ .name = "build keycode generator",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,
.cmd = { { "custom\\bin\\build_one_time 4ed_generate_keycodes.cpp ..\\build", .os = "win" }, }, },
.cmd = { { "custom\\bin\\build_one_time 4ed_generate_keycodes.cpp ..\\build", .os = "win" },
{ "custom/bin/build_one_time.sh 4ed_generate_keycodes.cpp ../build", .os = "linux" }, }, },
{ .name = "build site render",
.out = "*compilation*", .footer_panel = true, .save_dirty_files = true,

View File

@ -7,6 +7,8 @@
+ in config.4coder the variable virtual_whitespace_regular_indent determines the number of space-widths to use as the regular indentation in a virtual whitespace layout
+ show whitespace mode implemented in 'default_render_buffer'
+ `set_face_size` and `set_face_size_this_buffer` commands
+ `HookID_WholeScreenRenderCaller` hook runs once per frame after all views render
+ Extended key codes list
+ Fix: tabs are measured with the correct amount of width for the user's settings
+ Fix: virtual whitespace toggling works when the config initially diabled virtual whitespace
+ Fix: never miss the most recent post to the clipboard on windows