Skip to content

Commit

Permalink
before-release
Browse files Browse the repository at this point in the history
  • Loading branch information
HouQiming committed Apr 1, 2016
1 parent 133c23c commit 407028d
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 21 deletions.
2 changes: 1 addition & 1 deletion js/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ return {
//"SSH_SERVER_LINUX":"[email protected]",
//"SSH_SERVER_LINUX":"[email protected]",
"SSH_SERVER_RASPPI":"[email protected]",
"SSH_SERVER_LINUX":"[email protected].114",
"SSH_SERVER_LINUX":"[email protected].116",
"SSH_SERVER_MAC":"[email protected]",
}
2 changes: 1 addition & 1 deletion notebook.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cells":[{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for the project\ncd /d c:/tp/pure\nbootstrap\\bin\\win32_release\\main --arch=win32 main.jc\nrem bin\\win64_release\\main --arch=win32 main.jc\nif errorlevel 1 goto end\nrem bin\\win32\\main --rebuild -awin32 test/test_u32_cns_shift.jc --run\nrem bin\\win32\\main --rebuild -awin32 mo/qpad.jc --run\nrem bin\\win32\\main --no_c_lines --rebuild -awin32 -brelease mo/qpad.jc\nrem bin\\win32\\main -vv --rebuild -awin32 -brelease mo/qpad.jc > $log.txt\nrem bin\\win32\\main -vv --rebuild -awin32 test/test_gui.jc --run >$log.txt\nrem bin\\win32\\main -vv --rebuild -awin32 test/test_empty_ctor.jc --run >$log.txt\nrem bin\\win32\\main -vv --rebuild -awin32 -brelease test/test_pbuf.jc --run >$log.txt\nrem bin\\win32\\main -vv --no_c_lines --rebuild -awin32 test/test_stackalloc2.jc --run >$log.txt\nrem bin\\win32\\main --no_c_lines --readable_c_code --rebuild -awin64 -brelease m:/dde/trainer3k/feature_learning.jc --run >$log.txt\nrem bin\\win32\\main --rebuild test/test_rc4.jc --run\nrem bin\\win32\\main -vv --rebuild -awin32 --readable_c_code mo/qpad.jc --run >$log.txt\nrem bin\\win32\\main --rebuild -awin32 --no_c_lines --readable_c_code mo/qpad.jc --run\nrem bin\\win32\\main -vv --rebuild -awin32 --no_c_lines --readable_c_code -brelease test/test_js0.jc --run >$log.txt\nrem bin\\win32\\main --rebuild --no_c_lines --readable_c_code test/test_array4.jc --run > $log.txt 2> NUL\nrem bin\\win32\\main -vv test/test_timely_release.jc --run >$log.txt\nrem bin\\win32\\main -vv --rebuild --no_c_lines --readable_c_code --cpp test/test_js0.jc --run > $log.txt\nbin\\win32\\main -vv --rebuild --no_c_lines --readable_c_code --cpp test/test_crash.jc --run > $log.txt\n:end\n","m_text_out":"Stopped...\nc:/tp/pure/notebook.json:1:1: fatal error: the script has returned an error 1\n","m_cell_id":0,"m_has_any_error":1,"m_completion_time":[2016,2,27,14,43,1,1],"m_current_path":"c:/tp/pure"},{"m_language":"Markdown","m_text_in":"# TODO LIST\nmore timely destruction of unnamed variables\n\tnon-temp locals of an inline\n\trenaming something *TO* a force_death-ed:\n\t\tthe force_death is run\n\t\tbut the variable may get used *after* it\n\tdefer to later\n\t--\n\tfundamentally, they're front-end live range annotations\n\tthey provide accurate death points... that have to be maintained during optimization\n\t\tbut it's more accurate than what we could get in backend\n\t\t\tconditionally assigned locals can be killed in FE\n\t\t\tbut in BE... hard to analyze?\n\trepresent scope open/close as hack functions...\n\t--\n\twhich is easier?\n\t\taccurate live range in rcdfsComputeSafeStoreAndVarDeath\n\t\t\twhy are we making all the for loops atomic blocks?\n\t\t\t\tfailure to do a proper CFG\n\t\tall-the-way maintained FE hint\ndo not stack-alloc JS-returned arrays\nrobust serialization\n\tthe most important feature in machine learning code\n\tmatching two pb types\nautomatically highlight the most useful pieces of errors\n\tin a user program, not function-ranged\nliterate-programming-like GL\n\ttech: global variable indexed by code location\n\trun time literate for shader composition\n\tcould use it for JS strings?\n","m_text_out":"","m_cell_id":1,"m_has_any_error":0},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/unicodeguy.jc'\ncd /d c:/tp/pure/test\njc c:/tp/pure/test/unicodeguy.jc --run\n","m_text_out":"s7main.c\r\n Creating library c:/tp/pure/test/bin/win32/unicodeguy.lib and object c:/tp/pure/test/bin/win32/unicodeguy.exp\r\n","m_cell_id":2,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,1,23,21,2,55,3]},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/glmaker_pure.jc'\ncd /d c:/tp/pure/test\njc c:/tp/pure/test/glmaker_pure.jc --run\n","m_text_out":"g-l.jc updated\r\n","m_cell_id":3,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,2,26,23,7,4,0]},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/test_nfd.jc'\ncd /d c:/tp/pure/test\njc c:/tp/pure/test/test_nfd.jc --run\n","m_text_out":"s7main.c\r\n Creating library c:/tp/pure/test/bin/win32/test_nfd.lib and object c:/tp/pure/test/bin/win32/test_nfd.exp\r\nstring.NULL\r\nstring.NULL\r\n","m_cell_id":4,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,1,28,15,57,16,1]},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/wrapper/duktape.c'\ncall \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\\\..\\..\\vc\\bin\\x86_amd64\\vcvarsx86_amd64.bat\"\ncd /d c:/tp/pure/wrapper\ncl /Zi /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0 /D_SCL_SECURE_NO_WARNINGS /MT /DPM_C_MODE /DNEED_MAIN_WRAPPING c:/tp/pure/wrapper/duktape.c && duktape\n","m_text_out":"Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\nduktape.c\r\nMicrosoft (R) Incremental Linker Version 12.00.31101.0\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n/out:duktape.exe \r\n/debug \r\nduktape.obj \r\nLINK : fatal error LNK1561: entry point must be defined\r\nc:/tp/pure/notebook.json:1:1: fatal error: the script has returned an error 2\n","m_cell_id":5,"m_has_any_error":1,"m_current_path":"c:/tp/pure/wrapper","m_completion_time":[2016,2,17,10,24,38,5]},{"m_language":"Markdown","m_text_in":"Search result","m_text_out":"c:/tp/pure/test/glpure_part0.jc:99347..99377: glCreateRenderToTextureContext\nc:/tp/pure/test/glpure_part0.jc:102059..102089: glCreateRenderToTextureContext\nc:/tp/pure/units/g-l.jc:100050..100080: glCreateRenderToTextureContext\n","m_cell_id":6,"m_has_any_error":1},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/pmjs.jc'\ncd /d c:/tp/pure/test\ndel bin\\win32_release\\pmjs.exe\njc -brelease c:/tp/pure/test/pmjs.jc\ncopy bin\\win32_release\\pmjs.exe ..\\bin\\win32_release\n\n","m_text_out":"s7main.c\r\n 1 file(s) copied.\r\n","m_cell_id":7,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,2,27,15,39,33,1]}]}
{"cells":[{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for the project\ncd /d c:/tp/pure\nbootstrap\\bin\\win32_release\\main --arch=win32 main.jc\nrem bin\\win64_release\\main --arch=win32 main.jc\nif errorlevel 1 goto end\nrem bin\\win32\\main --rebuild -awin32 test/test_u32_cns_shift.jc --run\nrem bin\\win32\\main --rebuild -awin32 mo/qpad.jc --run\nrem bin\\win32\\main --no_c_lines --rebuild -awin32 -brelease mo/qpad.jc\nrem bin\\win32\\main -vv --rebuild -awin32 -brelease mo/qpad.jc > $log.txt\nrem bin\\win32\\main -vv --rebuild -awin32 test/test_gui.jc --run >$log.txt\nrem bin\\win32\\main -vv --rebuild -awin32 test/test_empty_ctor.jc --run >$log.txt\nrem bin\\win32\\main -vv --rebuild -awin32 -brelease test/test_pbuf.jc --run >$log.txt\nrem bin\\win32\\main -vv --no_c_lines --rebuild -awin32 test/test_stackalloc2.jc --run >$log.txt\nrem bin\\win32\\main --no_c_lines --readable_c_code --rebuild -awin64 -brelease m:/dde/trainer3k/feature_learning.jc --run >$log.txt\nrem bin\\win32\\main --rebuild test/test_rc4.jc --run\nrem bin\\win32\\main -vv --rebuild -awin32 --readable_c_code mo/qpad.jc --run >$log.txt\nrem bin\\win32\\main --rebuild -awin32 --no_c_lines --readable_c_code mo/qpad.jc --run\nrem bin\\win32\\main -vv --rebuild -awin32 --no_c_lines --readable_c_code -brelease test/test_js0.jc --run >$log.txt\nrem bin\\win32\\main --rebuild --no_c_lines --readable_c_code test/test_array4.jc --run > $log.txt 2> NUL\nrem bin\\win32\\main -vv test/test_timely_release.jc --run >$log.txt\nrem bin\\win32\\main -vv --rebuild --no_c_lines --readable_c_code --cpp test/test_js0.jc --run > $log.txt\nbin\\win32\\main -vv --rebuild --no_c_lines --readable_c_code --cpp test/test_crash.jc --run > $log.txt\n:end\n","m_text_out":"Stopped...\nc:/tp/pure/notebook.json:1:1: fatal error: the script has returned an error 1\n","m_cell_id":0,"m_has_any_error":1,"m_completion_time":[2016,3,0,17,38,53,5],"m_current_path":"c:/tp/pure"},{"m_language":"Markdown","m_text_in":"# TODO LIST\nmore timely destruction of unnamed variables\n\tnon-temp locals of an inline\n\trenaming something *TO* a force_death-ed:\n\t\tthe force_death is run\n\t\tbut the variable may get used *after* it\n\tdefer to later\n\t--\n\tfundamentally, they're front-end live range annotations\n\tthey provide accurate death points... that have to be maintained during optimization\n\t\tbut it's more accurate than what we could get in backend\n\t\t\tconditionally assigned locals can be killed in FE\n\t\t\tbut in BE... hard to analyze?\n\trepresent scope open/close as hack functions...\n\t--\n\twhich is easier?\n\t\taccurate live range in rcdfsComputeSafeStoreAndVarDeath\n\t\t\twhy are we making all the for loops atomic blocks?\n\t\t\t\tfailure to do a proper CFG\n\t\tall-the-way maintained FE hint\ndo not stack-alloc JS-returned arrays\nrobust serialization\n\tthe most important feature in machine learning code\n\tmatching two pb types\nautomatically highlight the most useful pieces of errors\n\tin a user program, not function-ranged\nliterate-programming-like GL\n\ttech: global variable indexed by code location\n\trun time literate for shader composition\n\tcould use it for JS strings?\n","m_text_out":"","m_cell_id":1,"m_has_any_error":0},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/unicodeguy.jc'\ncd /d c:/tp/pure/test\njc c:/tp/pure/test/unicodeguy.jc --run\n","m_text_out":"s7main.c\r\n Creating library c:/tp/pure/test/bin/win32/unicodeguy.lib and object c:/tp/pure/test/bin/win32/unicodeguy.exp\r\n","m_cell_id":2,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,1,23,21,2,55,3]},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/glmaker_pure.jc'\ncd /d c:/tp/pure/test\njc c:/tp/pure/test/glmaker_pure.jc --run\n","m_text_out":"s7main.c\r\n Creating library c:/tp/pure/test/bin/win32/glmaker_pure.lib and object c:/tp/pure/test/bin/win32/glmaker_pure.exp\r\ng-l.jc updated\r\n","m_cell_id":3,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,2,29,20,4,59,3]},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/test_nfd.jc'\ncd /d c:/tp/pure/test\njc c:/tp/pure/test/test_nfd.jc --run\n","m_text_out":"s7main.c\r\n Creating library c:/tp/pure/test/bin/win32/test_nfd.lib and object c:/tp/pure/test/bin/win32/test_nfd.exp\r\nstring.NULL\r\nstring.NULL\r\n","m_cell_id":4,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,1,28,15,57,16,1]},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/wrapper/duktape.c'\ncall \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\\\..\\..\\vc\\bin\\x86_amd64\\vcvarsx86_amd64.bat\"\ncd /d c:/tp/pure/wrapper\ncl /Zi /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0 /D_SCL_SECURE_NO_WARNINGS /MT /DPM_C_MODE /DNEED_MAIN_WRAPPING c:/tp/pure/wrapper/duktape.c && duktape\n","m_text_out":"Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\nduktape.c\r\nMicrosoft (R) Incremental Linker Version 12.00.31101.0\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n/out:duktape.exe \r\n/debug \r\nduktape.obj \r\nLINK : fatal error LNK1561: entry point must be defined\r\nc:/tp/pure/notebook.json:1:1: fatal error: the script has returned an error 2\n","m_cell_id":5,"m_has_any_error":1,"m_current_path":"c:/tp/pure/wrapper","m_completion_time":[2016,2,17,10,24,38,5]},{"m_language":"Markdown","m_text_in":"Search result","m_text_out":"c:/tp/pure/test/glpure_part0.jc:99347..99377: glCreateRenderToTextureContext\nc:/tp/pure/test/glpure_part0.jc:102059..102089: glCreateRenderToTextureContext\nc:/tp/pure/units/g-l.jc:100050..100080: glCreateRenderToTextureContext\n","m_cell_id":6,"m_has_any_error":1},{"m_language":"Windows BAT","m_text_in":"@echo off\nrem build script for 'c:/tp/pure/test/pmjs.jc'\ncd /d c:/tp/pure/test\ndel bin\\win32_release\\pmjs.exe\njc -brelease c:/tp/pure/test/pmjs.jc\ncopy bin\\win32_release\\pmjs.exe ..\\bin\\win32_release\n\n","m_text_out":"s7main.c\r\n 1 file(s) copied.\r\n","m_cell_id":7,"m_has_any_error":0,"m_current_path":"c:/tp/pure/test","m_completion_time":[2016,2,27,15,39,33,1]}]}
8 changes: 7 additions & 1 deletion test/glpure_part0.jc
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,10 @@ GL_FRAGMENT_LIGHT6_EXT=0x8412
GL_FRAGMENT_LIGHT7_EXT=0x8413
GL_READ_FRAMEBUFFER_EXT=0x8CA8
GL_DRAW_FRAMEBUFFER_EXT=0x8CA9
GL_READ_FRAMEBUFFER=0x8CA8
GL_DRAW_FRAMEBUFFER=0x8CA9
GL_DRAW_FRAMEBUFFER_BINDING=0x8CA6
GL_READ_FRAMEBUFFER_BINDING=0x8CAA
GL_DRAW_FRAMEBUFFER_BINDING_EXT=0x8CA6
GL_READ_FRAMEBUFFER_BINDING_EXT=0x8CAA
GL_RENDERBUFFER_SAMPLES_EXT=0x8CAB
Expand Down Expand Up @@ -3461,6 +3465,8 @@ inline glCreateBuffer(what,data)
return ret

auto glCreateRenderToTextureContext(GLenum format,int w,int h,int flags)
p_old_fbo=new u32[1]
glGetIntegerv(GL_FRAMEBUFFER_BINDING,__pointer(p_old_fbo.d))
tex=glCreateTexture(
format,w,h,
GL_LINEAR,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,
Expand All @@ -3480,7 +3486,7 @@ auto glCreateRenderToTextureContext(GLenum format,int w,int h,int flags)
glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,tex,0);
if flags&GL_RTT_DEPTH:
glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_DEPTH_STENCIL_ATTACHMENT,GL_RENDERBUFFER,rbo);
glBindFramebuffer(GL_FRAMEBUFFER,0u);
glBindFramebuffer(GL_FRAMEBUFFER,p_old_fbo[0]);
return new CJSGLRenderToTextureContext(){m_tex:tex,m_rbo:rbo,m_fbo:fbo,w:w,h:h}

auto createGLJSObject(JSObject JS_GL)
Expand Down
8 changes: 7 additions & 1 deletion units/g-l.jc
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,10 @@ GL_FRAGMENT_LIGHT6_EXT=0x8412
GL_FRAGMENT_LIGHT7_EXT=0x8413
GL_READ_FRAMEBUFFER_EXT=0x8CA8
GL_DRAW_FRAMEBUFFER_EXT=0x8CA9
GL_READ_FRAMEBUFFER=0x8CA8
GL_DRAW_FRAMEBUFFER=0x8CA9
GL_DRAW_FRAMEBUFFER_BINDING=0x8CA6
GL_READ_FRAMEBUFFER_BINDING=0x8CAA
GL_DRAW_FRAMEBUFFER_BINDING_EXT=0x8CA6
GL_READ_FRAMEBUFFER_BINDING_EXT=0x8CAA
GL_RENDERBUFFER_SAMPLES_EXT=0x8CAB
Expand Down Expand Up @@ -3461,6 +3465,8 @@ inline glCreateBuffer(what,data)
return ret

auto glCreateRenderToTextureContext(GLenum format,int w,int h,int flags)
p_old_fbo=new u32[1]
glGetIntegerv(GL_FRAMEBUFFER_BINDING,__pointer(p_old_fbo.d))
tex=glCreateTexture(
format,w,h,
GL_LINEAR,GL_CLAMP_TO_EDGE,GL_CLAMP_TO_EDGE,
Expand All @@ -3480,7 +3486,7 @@ auto glCreateRenderToTextureContext(GLenum format,int w,int h,int flags)
glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,tex,0);
if flags&GL_RTT_DEPTH:
glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_DEPTH_STENCIL_ATTACHMENT,GL_RENDERBUFFER,rbo);
glBindFramebuffer(GL_FRAMEBUFFER,0u);
glBindFramebuffer(GL_FRAMEBUFFER,p_old_fbo[0]);
return new CJSGLRenderToTextureContext(){m_tex:tex,m_rbo:rbo,m_fbo:fbo,w:w,h:h}

auto createGLJSObject(JSObject JS_GL)
Expand Down
16 changes: 9 additions & 7 deletions units/gui2d.jc
Original file line number Diff line number Diff line change
Expand Up @@ -582,21 +582,23 @@ class CRenderer
formatNumber(u32(m_vbo[i+2]),{base:16,align:8}))
if ((i/VERTEX_SIZE)&3)==3:
Writeln('-------')
auto DrawWindow(__pointer hwnd_onlydraw,float2 translation,float2 scale)
auto DrawWindow(JSContext JS,__pointer hwnd_onlydraw,float2 translation,float2 scale)
TestSRGB()
wnd_viewport=new int[4]
glGetIntegerv(GL_VIEWPORT,__pointer(wnd_viewport.d));
JS["UI"]["m_gl_curwindow_w"]=wnd_viewport[2]
JS["UI"]["m_gl_curwindow_h"]=wnd_viewport[3]
if m_srgb_supported==2:
//manual sRGB
wnd_viewport=new int[4]
glGetIntegerv(GL_VIEWPORT,__pointer(wnd_viewport.d));
wnd_w=wnd_viewport[2]
wnd_h=wnd_viewport[3]
if !m_srgb_fbo||m_srgb_fbo.w<wnd_w||m_srgb_fbo.h<wnd_h:
if !m_srgb_fbo||m_srgb_fbo.w!=wnd_w||m_srgb_fbo.h!=wnd_h:
fbo_w=wnd_w
fbo_h=wnd_h
if m_srgb_fbo:
//fbo_w=max(fbo_w,m_srgb_fbo.w)
//fbo_h=max(fbo_h,m_srgb_fbo.h)
m_srgb_fbo.discard()
fbo_w=max(fbo_w,m_srgb_fbo.w)
fbo_h=max(fbo_h,m_srgb_fbo.h)
m_srgb_fbo=glCreateRenderToTextureContext(GL_RGBA8,fbo_w,fbo_h,0)
bk_fbo=new u32[1]
glGetIntegerv(GL_FRAMEBUFFER_BINDING,__pointer(bk_fbo.d))
Expand Down Expand Up @@ -1579,7 +1581,7 @@ auto createUIObject(JSObject JS_UI,CUISandbox sbox,int is_real)
//"privileged" functions
JS_UI["DrawWindow"]=function(JSContext JS){
hwnd=JS.Param(0).or(NULL)
g_renderer.DrawWindow(hwnd,float2(0.f,0.f),float2(1.f,1.f))
g_renderer.DrawWindow(JS,hwnd,float2(0.f,0.f),float2(1.f,1.f))
return 0
}
JS_UI["DrawCaret"]=function(JSContext JS){
Expand Down
27 changes: 18 additions & 9 deletions units/gui2d/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,7 @@ var fauto_refresher=UI.HackCallback(function(){

UI.AutoRefresh=function(){
if(!UI.is_real){return;}
UI.n_auto_refreshes++;
if(UI.animation_framerate>20){
UI.Refresh()
}else{
Expand Down Expand Up @@ -1630,6 +1631,8 @@ UI.m_frame_tick=Duktape.__ui_get_tick();
UI.DrawFrame=function(){
//the main painting loop
//clear message-created invalidation flag
//print("===UI.DrawFrame")
UI.n_auto_refreshes=0;
UI.m_frame_is_invalid=0;
UI.need_to_refresh=0;
UI.BeginFrame();
Expand Down Expand Up @@ -1947,19 +1950,25 @@ UI.Run=function(){
//ignore alt+tab
break;
}
//print(JSON.stringify(event),obj_window.m_just_alted)
if(obj_window&&UI.Platform.ARCH!="mac"){
if(event.keysym==UI.SDLK_LALT||event.keysym==UI.SDLK_RALT){
//alt-menu case
//print("ALT",event.type==UI.SDL_KEYDOWN?"DOWN":"UP")
if(event.type==UI.SDL_KEYDOWN){
obj_window.m_just_alted=1;
if((event.keysym==UI.SDLK_LALT||event.keysym==UI.SDLK_RALT)){
if(event.repeat){
//do nothing
}else{
if(obj_window.m_just_alted){
if(obj_window.OnMenu){
obj_window.OnMenu();
//alt-menu case
//print("ALT",event.type==UI.SDL_KEYDOWN?"DOWN":"UP")
if(event.type==UI.SDL_KEYDOWN){
obj_window.m_just_alted=1;
}else{
if(obj_window.m_just_alted){
//print("call alt menu")
if(obj_window.OnMenu){
obj_window.OnMenu();
}
}
obj_window.m_just_alted=0;
}
obj_window.m_just_alted=0;
}
}else{
obj_window.m_just_alted=0;
Expand Down
15 changes: 15 additions & 0 deletions units/gui2d/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,21 @@ W.PureRegion=function(id,obj){
return obj;
}

W.RestoreRegion=function(obj){
if(obj.OnTextInput||obj.OnKeyDown){
if(!UI.context_tentative_focus||(UI.context_tentative_focus.default_focus||0)<(obj.default_focus||0)){
UI.context_tentative_focus=obj;
}
}
if(obj==UI.nd_focus){
UI.context_focus_is_a_region=1
}
if(obj==UI.nd_mouse_over){
UI.context_mouse_over_is_a_region=1;
}
UI.context_regions.push(obj);
}

////////////////////////////////////////
//utility
W.Group=function(id,attrs){
Expand Down
2 changes: 1 addition & 1 deletion units/text-box.jc
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ class CEditableText
rr_styles=new TRRContext[]
wf_hl=wf
if handler.GetWrapWidth:
wf_hl=min(wf_hl,fixed2float(handler.GetWrapWidth()))
wf_hl=min(wf_hl,fixed2float(handler.GetWrapWidth()-x))
foreach hl in m_highlights
ccnt0=hl.p0.ccnt
ccnt1=hl.p1.ccnt
Expand Down

0 comments on commit 407028d

Please sign in to comment.