Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
74f29f10
Commit
74f29f10
authored
Jun 27, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 30, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLWindow3::setInterval implementation.
parent
0d56f105
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
24 deletions
+41
-24
htmlwindow.c
dlls/mshtml/htmlwindow.c
+8
-5
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-1
task.c
dlls/mshtml/task.c
+32
-18
No files found.
dlls/mshtml/htmlwindow.c
View file @
74f29f10
...
...
@@ -846,7 +846,8 @@ static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, I
return
E_NOTIMPL
;
}
static
HRESULT
window_set_timer
(
HTMLWindow
*
This
,
VARIANT
*
expr
,
long
msec
,
VARIANT
*
language
,
long
*
timer_id
)
static
HRESULT
window_set_timer
(
HTMLWindow
*
This
,
VARIANT
*
expr
,
long
msec
,
VARIANT
*
language
,
BOOL
interval
,
long
*
timer_id
)
{
IDispatch
*
disp
=
NULL
;
...
...
@@ -868,7 +869,7 @@ static HRESULT window_set_timer(HTMLWindow *This, VARIANT *expr, long msec, VARI
if
(
!
disp
)
return
E_FAIL
;
*
timer_id
=
set_task_timer
(
This
->
doc
,
msec
,
disp
);
*
timer_id
=
set_task_timer
(
This
->
doc
,
msec
,
interval
,
disp
);
IDispatch_Release
(
disp
);
return
S_OK
;
...
...
@@ -881,15 +882,17 @@ static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expre
TRACE
(
"(%p)->(%p(%d) %ld %p %p)
\n
"
,
This
,
expression
,
V_VT
(
expression
),
msec
,
language
,
timerID
);
return
window_set_timer
(
This
,
expression
,
msec
,
language
,
timerID
);
return
window_set_timer
(
This
,
expression
,
msec
,
language
,
FALSE
,
timerID
);
}
static
HRESULT
WINAPI
HTMLWindow3_setInterval
(
IHTMLWindow3
*
iface
,
VARIANT
*
expression
,
long
msec
,
VARIANT
*
language
,
long
*
timerID
)
{
HTMLWindow
*
This
=
HTMLWINDOW3_THIS
(
iface
);
FIXME
(
"(%p)->(%p %ld %p %p)
\n
"
,
This
,
expression
,
msec
,
language
,
timerID
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p %ld %p %p)
\n
"
,
This
,
expression
,
msec
,
language
,
timerID
);
return
window_set_timer
(
This
,
expression
,
msec
,
language
,
TRUE
,
timerID
);
}
static
HRESULT
WINAPI
HTMLWindow3_print
(
IHTMLWindow3
*
iface
)
...
...
dlls/mshtml/mshtml_private.h
View file @
74f29f10
...
...
@@ -623,7 +623,7 @@ thread_data_t *get_thread_data(BOOL);
HWND
get_thread_hwnd
(
void
);
void
push_task
(
task_t
*
);
void
remove_doc_tasks
(
const
HTMLDocument
*
);
DWORD
set_task_timer
(
HTMLDocument
*
,
DWORD
,
IDispatch
*
);
DWORD
set_task_timer
(
HTMLDocument
*
,
DWORD
,
BOOL
,
IDispatch
*
);
HRESULT
get_typeinfo
(
tid_t
,
ITypeInfo
**
);
void
release_typelib
(
void
);
...
...
dlls/mshtml/task.c
View file @
74f29f10
...
...
@@ -43,6 +43,7 @@ typedef struct {
HTMLDocument
*
doc
;
DWORD
id
;
DWORD
time
;
DWORD
interval
;
IDispatch
*
disp
;
struct
list
entry
;
...
...
@@ -123,7 +124,29 @@ void remove_doc_tasks(const HTMLDocument *doc)
}
}
DWORD
set_task_timer
(
HTMLDocument
*
doc
,
DWORD
msec
,
IDispatch
*
disp
)
static
BOOL
queue_timer
(
thread_data_t
*
thread_data
,
task_timer_t
*
timer
)
{
task_timer_t
*
iter
;
if
(
list_empty
(
&
thread_data
->
timer_list
)
||
LIST_ENTRY
(
list_head
(
&
thread_data
->
timer_list
),
task_timer_t
,
entry
)
->
time
>
timer
->
time
)
{
list_add_head
(
&
thread_data
->
timer_list
,
&
timer
->
entry
);
return
TRUE
;
}
LIST_FOR_EACH_ENTRY
(
iter
,
&
thread_data
->
timer_list
,
task_timer_t
,
entry
)
{
if
(
iter
->
time
>
timer
->
time
)
{
list_add_tail
(
&
iter
->
entry
,
&
timer
->
entry
);
return
FALSE
;
}
}
list_add_tail
(
&
thread_data
->
timer_list
,
&
timer
->
entry
);
return
FALSE
;
}
DWORD
set_task_timer
(
HTMLDocument
*
doc
,
DWORD
msec
,
BOOL
interval
,
IDispatch
*
disp
)
{
thread_data_t
*
thread_data
=
get_thread_data
(
TRUE
);
task_timer_t
*
timer
;
...
...
@@ -135,27 +158,13 @@ DWORD set_task_timer(HTMLDocument *doc, DWORD msec, IDispatch *disp)
timer
->
id
=
id_cnt
++
;
timer
->
doc
=
doc
;
timer
->
time
=
tc
+
msec
;
timer
->
interval
=
interval
?
msec
:
0
;
IDispatch_AddRef
(
disp
);
timer
->
disp
=
disp
;
if
(
list_empty
(
&
thread_data
->
timer_list
)
||
LIST_ENTRY
(
list_head
(
&
thread_data
->
timer_list
),
task_timer_t
,
entry
)
->
time
>
timer
->
time
)
{
list_add_head
(
&
thread_data
->
timer_list
,
&
timer
->
entry
);
if
(
queue_timer
(
thread_data
,
timer
))
SetTimer
(
thread_data
->
thread_hwnd
,
TIMER_ID
,
msec
,
NULL
);
}
else
{
task_timer_t
*
iter
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
thread_data
->
timer_list
,
task_timer_t
,
entry
)
{
if
(
iter
->
time
>
timer
->
time
)
{
list_add_tail
(
&
iter
->
entry
,
&
timer
->
entry
);
return
timer
->
id
;
}
}
list_add_tail
(
&
thread_data
->
timer_list
,
&
timer
->
entry
);
}
return
timer
->
id
;
}
...
...
@@ -354,7 +363,12 @@ static LRESULT process_timer(void)
call_disp_func
(
timer
->
doc
,
timer
->
disp
);
release_task_timer
(
thread_data
->
thread_hwnd
,
timer
);
if
(
timer
->
interval
)
{
timer
->
time
+=
timer
->
interval
;
queue_timer
(
thread_data
,
timer
);
}
else
{
release_task_timer
(
thread_data
->
thread_hwnd
,
timer
);
}
}
KillTimer
(
thread_data
->
thread_hwnd
,
TIMER_ID
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment