TempleOSCD_140715.ISO
This commit is contained in:
1 parent
7ef616a20e
commit
64f679eeb9
1095 files changed
+24814
-221011
No files matched your search
+66
-92
@@ -1,32 +1,13 @@
|
||||
#help_index "Windows"
|
||||
|
||||
I64 old_ipx=-1000,old_ipy=-1000,old_ipz=0;
|
||||
I64 old_ipx_presnap=-1000,old_ipy_presnap=-1000,old_ipz_presnap=0;
|
||||
Bool old_ip_lb=FALSE,old_ip_rb=FALSE;
|
||||
F64 left_ip_dbl_time=0;
|
||||
Bool left_dbl=FALSE,left_down_sent=FALSE;
|
||||
F64 right_ip_dbl_time=0;
|
||||
Bool right_dbl=FALSE,right_down_sent=FALSE;
|
||||
public F64 dbl_click_time=0.350;
|
||||
CIPStateGlbls old_ip={IP_NULL,{-1000,-1000,0},{-1000,-1000,0},{-1000,-1000,0},
|
||||
{0,0,0},{1.0,1.0,1.0},
|
||||
0,(MAX_I32+1)>>3,0.0,GetTSC,0.350,0,0,
|
||||
FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE};
|
||||
|
||||
public I64 win_updates=0;
|
||||
Bool win_first_after_startup_complete=FALSE;
|
||||
F64 refresh_ode_time=0,last_refresh_ode_time=0;
|
||||
|
||||
//These are not hardware rates. They
|
||||
//are the rate the video mem is updated.
|
||||
public F64
|
||||
win_min_refresh=15,
|
||||
win_desired_refresh =win_min_refresh, //This is dynamically adjusted
|
||||
win_actual_refresh =win_min_refresh;
|
||||
|
||||
F64 WinMaxRefresh()
|
||||
{
|
||||
if (sys_focus_task && TaskValidate(sys_focus_task))
|
||||
return sys_focus_task->win_max_refresh;
|
||||
else
|
||||
return WIN_DFT_MAX_REFRESH;
|
||||
}
|
||||
public CWinMgrGlbls winmgr={0,0,0,15,15,NULL,NULL,FALSE,FALSE,FALSE,FALSE};
|
||||
winmgr.t=CAlloc(sizeof(CWinMgrTimingGlbls));
|
||||
winmgr.t->last_refresh_time=tS;
|
||||
|
||||
#define PROGRESS_BAR_HEIGHT 20
|
||||
#define PROGRESS_BAR_WIDTH (3*GR_WIDTH/4)
|
||||
@@ -69,7 +50,7 @@ U0 DrawProgressBars(CDC *dc)
|
||||
if (*sys_progresses[i].desc)
|
||||
st=StrNew(sys_progresses[i].desc);
|
||||
else
|
||||
st=MPrint("%d/%d",n,m);
|
||||
st=MStrPrint("%d/%d",n,m);
|
||||
GrPrint(dc,(GR_WIDTH-FONT_WIDTH*StrLen(st))/2,
|
||||
(GR_HEIGHT-FONT_HEIGHT-
|
||||
(NUM_PROGRESS_BARS*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st);
|
||||
@@ -91,16 +72,16 @@ U0 DrawWinGrid(CDC *dc)
|
||||
|
||||
U0 WinGrid(Bool val)
|
||||
{
|
||||
CGrid last_grid;
|
||||
MemCpy(&last_grid,&ip_grid,sizeof(CGrid));
|
||||
CGridGlbls last_grid;
|
||||
MemCpy(&last_grid,&ip_grid,sizeof(CGridGlbls));
|
||||
if (!val || PopUpForm(&ip_grid)) {
|
||||
if (!val)
|
||||
GridInit;
|
||||
mxx_prescale*=last_grid.x_speed/ip_grid.x_speed;
|
||||
myy_prescale*=last_grid.y_speed/ip_grid.y_speed;
|
||||
mzz_prescale*=last_grid.z_speed/ip_grid.z_speed;
|
||||
mouse.prescale.x*=last_grid.x_speed/ip_grid.x_speed;
|
||||
mouse.prescale.y*=last_grid.y_speed/ip_grid.y_speed;
|
||||
mouse.prescale.z*=last_grid.z_speed/ip_grid.z_speed;
|
||||
} else
|
||||
MemCpy(&ip_grid,&last_grid,sizeof(CGrid));
|
||||
MemCpy(&ip_grid,&last_grid,sizeof(CGridGlbls));
|
||||
}
|
||||
U0 CtrlAltG(I64 sc)
|
||||
{
|
||||
@@ -135,7 +116,7 @@ U0 ExtendedASCII()
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
if (i>=0)
|
||||
PostMsg(ext_ASCII_task,MSG_KEY_DOWN_UP,i,A2ScanCode(i));
|
||||
PostMsg(ext_ASCII_task,MSG_KEY_DOWN_UP,i,Char2ScanCode(i));
|
||||
}
|
||||
|
||||
U0 CtrlAltA(I64)
|
||||
@@ -145,10 +126,8 @@ U0 CtrlAltA(I64)
|
||||
}
|
||||
SetCtrlAltLetCB('A',&CtrlAltA,"Sys/Extended ASCII");
|
||||
|
||||
|
||||
Bool win_grab_scroll=FALSE,win_grab_scroll_closed=FALSE;
|
||||
public U0 WinScrollNull(CTask *task,CD3I64 *s)
|
||||
{
|
||||
{//If panning a window has been done, restore to zero.
|
||||
s->x=task->scroll_x;
|
||||
s->y=task->scroll_y;
|
||||
s->z=task->scroll_z;
|
||||
@@ -158,7 +137,7 @@ public U0 WinScrollNull(CTask *task,CD3I64 *s)
|
||||
}
|
||||
|
||||
public U0 WinScrollRestore(CTask *task,CD3I64 *s)
|
||||
{
|
||||
{//Set window pan value to stored value.
|
||||
task->scroll_x=s->x;
|
||||
task->scroll_y=s->y;
|
||||
task->scroll_z=s->z;
|
||||
@@ -169,75 +148,74 @@ U0 DrawInputPtr(CDC *dc)
|
||||
I64 x,y;
|
||||
PUSHFD
|
||||
CLI
|
||||
x=ipx;
|
||||
y=ipy;
|
||||
x=ip.pos.x;
|
||||
y=ip.pos.y;
|
||||
POPFD
|
||||
if (ip_on && ip_dev!=IP_NULL) {
|
||||
if (text_mode)
|
||||
gr_text_base[iptx+ipty*TEXT_COLS]^=0x7F00;
|
||||
if (ip.show && ip.dev!=IP_NULL) {
|
||||
if (!sys_bios_gr_mode) //if text mode
|
||||
gr.text_base[ip.pos_text.x+ip.pos_text.y*TEXT_COLS]^=0x7F00;
|
||||
else {
|
||||
if (fp_draw_input_ptr) {
|
||||
if (ip_lb)
|
||||
dc->color=ROP_XOR+LTPURPLE^COLOR_TRANSPARENT;
|
||||
else if (ip_rb)
|
||||
dc->color=ROP_XOR+LTCYAN^COLOR_TRANSPARENT;
|
||||
if (gr.fp_draw_input_ptr) {
|
||||
if (ip.lb)
|
||||
dc->color=ROP_XOR+LTPURPLE^TRANSPARENT;
|
||||
else if (ip.rb)
|
||||
dc->color=ROP_XOR+LTCYAN^TRANSPARENT;
|
||||
else
|
||||
dc->color=ROP_XOR+BLACK^COLOR_TRANSPARENT;
|
||||
if (win_grab_scroll && fp_draw_grab_input_ptr)
|
||||
(*fp_draw_grab_input_ptr)(dc,x,y,win_grab_scroll_closed);
|
||||
dc->color=ROP_XOR+BLACK^TRANSPARENT;
|
||||
if (winmgr.grab_scroll && gr.fp_draw_grab_input_ptr)
|
||||
(*gr.fp_draw_grab_input_ptr)(dc,x,y,winmgr.grab_scroll_closed);
|
||||
else
|
||||
(*fp_draw_input_ptr)(dc,x,y);
|
||||
(*gr.fp_draw_input_ptr)(dc,x,y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bool win_show_menu=FALSE;
|
||||
U0 WinFinalUpdate(CDC *dc)
|
||||
{
|
||||
if (ip_grid.show)
|
||||
DrawWinGrid(dc);
|
||||
DrawProgressBars(dc);
|
||||
if (win_show_menu)
|
||||
if (winmgr.show_menu)
|
||||
DrawMenu(dc);
|
||||
else
|
||||
sys_cur_submenu_entry=NULL;
|
||||
DrawInputPtr(dc);
|
||||
}
|
||||
|
||||
fp_final_screen_update=&WinFinalUpdate;
|
||||
gr.fp_final_screen_update=&WinFinalUpdate;
|
||||
|
||||
U0 WinIPUpdate()
|
||||
{
|
||||
I64 dd;
|
||||
Bool set=FALSE;
|
||||
if (ip_dev==IP_MOUSE) {
|
||||
ip_has_wheel=mouse_has_wheel;
|
||||
if (mouse_evt) {
|
||||
ip_throttle+=ip_throttle_step*SignI64(mzz-ipz);
|
||||
IPVarsUpdate(mxx,myy,mzz,mouse_buttons[0],ip_cb,mouse_buttons[1]);
|
||||
mouse_evt=FALSE;
|
||||
if (ip.dev==IP_MOUSE) {
|
||||
ip.has_wheel=mouse.has_wheel;
|
||||
if (mouse.evt) {
|
||||
ip.throttle+=ip.throttle_step*SignI64(mouse.pos.z-ip.pos.z);
|
||||
IPVarsUpdate(mouse.pos.x,mouse.pos.y,mouse.pos.z,mouse.buttons[0],mouse.buttons[1]);
|
||||
mouse.evt=FALSE;
|
||||
set=TRUE;
|
||||
}
|
||||
} else if (ip_dev==IP_NULL && mouse_installed)
|
||||
ip_dev=IP_MOUSE;
|
||||
} else if (ip.dev==IP_NULL && mouse.installed)
|
||||
ip.dev=IP_MOUSE;
|
||||
|
||||
if (set) {
|
||||
if (ip_dev==IP_MOUSE) {
|
||||
ip_speed=mouse_speed;
|
||||
ip_last_move_time=mouse_evt_time;
|
||||
if (ip.dev==IP_MOUSE) {
|
||||
ip.speed=mouse.speed;
|
||||
ip.timestamp=mouse.timestamp;
|
||||
}
|
||||
} else
|
||||
ip_speed*=0.95;
|
||||
if (gr_screen_zoom!=1) {
|
||||
if (gr_continuous_scroll)
|
||||
ip.speed*=0.95;
|
||||
if (gr.screen_zoom!=1) {
|
||||
if (gr.continuous_scroll)
|
||||
GrScaleZoom(1.0);
|
||||
else {
|
||||
dd=(ipx-grsx)*gr_screen_zoom;
|
||||
dd=(ip.pos.x-gr.sx)*gr.screen_zoom;
|
||||
if (!(8<=dd<GR_WIDTH-8))
|
||||
GrScaleZoom(1.0);
|
||||
else {
|
||||
dd=(ipy-grsy)*gr_screen_zoom;
|
||||
dd=(ip.pos.y-gr.sy)*gr.screen_zoom;
|
||||
if (!(8<=dd<GR_HEIGHT-8))
|
||||
GrScaleZoom(1.0);
|
||||
}
|
||||
@@ -248,13 +226,13 @@ U0 WinIPUpdate()
|
||||
CTask *WinRefocus()
|
||||
{
|
||||
CTask *task;
|
||||
CLI
|
||||
PUSHFD
|
||||
CLI
|
||||
task=sys_focus_task;
|
||||
if (!task) {
|
||||
task=sys_winmgr_task->last_task;
|
||||
while (TaskValidate(task) && task!=sys_winmgr_task) {
|
||||
if (!Bt(&task->win_inhibit,WIf_FOCUS)) {
|
||||
if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) {
|
||||
sys_focus_task=task;
|
||||
break;
|
||||
}
|
||||
@@ -293,7 +271,7 @@ I64 WinOnTopWindows()
|
||||
}
|
||||
|
||||
public I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE)
|
||||
{
|
||||
{//Put task's win on top of window stack.
|
||||
CTask *task1;
|
||||
I64 result=0;
|
||||
if (!task) task=Fs;
|
||||
@@ -313,7 +291,7 @@ public I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE)
|
||||
TaskQueIns(task,sys_winmgr_task);
|
||||
result++;
|
||||
}
|
||||
if (!Bt(&task->win_inhibit,WIf_FOCUS))
|
||||
if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS))
|
||||
sys_focus_task=task;
|
||||
if (result && !Bt(&task->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP)) {
|
||||
task1=task->next_child_task;
|
||||
@@ -336,10 +314,10 @@ public I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE)
|
||||
ext[EXT_WIN_TO_TOP]=&WinToTop;
|
||||
|
||||
public U0 WinFocus(CTask *task=NULL)
|
||||
{
|
||||
CLI
|
||||
{//Set task as focus task.
|
||||
PUSHFD
|
||||
if (!TaskValidate(task)||Bt(&task->win_inhibit,WIf_FOCUS))
|
||||
CLI
|
||||
if (!TaskValidate(task)||Bt(&task->win_inhibit,WIf_SELF_FOCUS))
|
||||
task=WinRefocus;
|
||||
WinToTop(sys_focus_task=task);
|
||||
POPFD
|
||||
@@ -347,7 +325,7 @@ public U0 WinFocus(CTask *task=NULL)
|
||||
ext[EXT_WIN_FOCUS]=&WinFocus;
|
||||
|
||||
public Bool SetWinHorz(I64 left,I64 right,CTask *task=NULL)
|
||||
{
|
||||
{//Set task's win left and right columns.
|
||||
I64 d=right-left;
|
||||
if (!task) task=Fs;
|
||||
if (!TaskValidate(task)) return FALSE;
|
||||
@@ -381,7 +359,7 @@ public Bool SetWinHorz(I64 left,I64 right,CTask *task=NULL)
|
||||
}
|
||||
|
||||
public Bool SetWinVert(I64 top,I64 bottom,CTask *task=NULL)
|
||||
{
|
||||
{//Set task's win top and bottom rows.
|
||||
I64 d=bottom-top;
|
||||
if (!task) task=Fs;
|
||||
if (!TaskValidate(task)) return FALSE;
|
||||
@@ -415,7 +393,7 @@ public Bool SetWinVert(I64 top,I64 bottom,CTask *task=NULL)
|
||||
}
|
||||
|
||||
public U0 WinTileHorz()
|
||||
{
|
||||
{//Tile windows horizontally top-to-bottom.
|
||||
CTask *task,*last_task=Fs;
|
||||
I64 cnt,c,i,vert_size,no_border;
|
||||
|
||||
@@ -424,16 +402,15 @@ public U0 WinTileHorz()
|
||||
task=sys_winmgr_task;
|
||||
cnt=0;
|
||||
do {
|
||||
if (!Bt(&task->win_inhibit,WIf_FOCUS))
|
||||
if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS))
|
||||
cnt++;
|
||||
task=task->last_task;
|
||||
} while (task!=sys_winmgr_task);
|
||||
|
||||
|
||||
task=sys_winmgr_task;
|
||||
i=0;
|
||||
do {
|
||||
if (!Bt(&task->win_inhibit,WIf_FOCUS)) {
|
||||
if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) {
|
||||
no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER);
|
||||
c=cnt- i&~3;
|
||||
if (!c)
|
||||
@@ -456,7 +433,7 @@ public U0 WinTileHorz()
|
||||
}
|
||||
|
||||
public U0 WinTileVert()
|
||||
{
|
||||
{//Tile windows vertically side-by-side.
|
||||
CTask *task,*last_task=Fs;
|
||||
I64 cnt,c,i,horz_size,no_border;
|
||||
PUSHFD
|
||||
@@ -464,7 +441,7 @@ public U0 WinTileVert()
|
||||
task=sys_winmgr_task;
|
||||
cnt=0;
|
||||
do {
|
||||
if (!Bt(&task->win_inhibit,WIf_FOCUS))
|
||||
if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS))
|
||||
cnt++;
|
||||
task=task->last_task;
|
||||
} while (task!=sys_winmgr_task);
|
||||
@@ -472,7 +449,7 @@ public U0 WinTileVert()
|
||||
task=sys_winmgr_task;
|
||||
i=0;
|
||||
do {
|
||||
if (!Bt(&task->win_inhibit,WIf_FOCUS)) {
|
||||
if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) {
|
||||
no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER);
|
||||
c=cnt- i&~3;
|
||||
if (!c)
|
||||
@@ -493,9 +470,8 @@ public U0 WinTileVert()
|
||||
POPFD
|
||||
}
|
||||
|
||||
|
||||
public U0 WinMax(CTask *task=NULL)
|
||||
{
|
||||
{//Maximize task's window
|
||||
I64 no_border;
|
||||
if (!task) task=Fs;
|
||||
if (!TaskValidate(task)) return;
|
||||
@@ -509,7 +485,7 @@ public U0 WinMax(CTask *task=NULL)
|
||||
}
|
||||
|
||||
public Bool WinBorder(Bool val=OFF,CTask *task=NULL)
|
||||
{
|
||||
{//Turn off (or on) window border.
|
||||
Bool old_has_border;
|
||||
if (!task) task=Fs;
|
||||
if (!TaskValidate(task)) return FALSE;
|
||||
@@ -534,5 +510,3 @@ public Bool WinBorder(Bool val=OFF,CTask *task=NULL)
|
||||
POPFD
|
||||
return old_has_border;
|
||||
}
|
||||
|
||||
#help_index ""
|
||||
Reference in new issue
Block a user