FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cefpython/src/handlers/focus_handler.pyx at cefpython53 · pythonthings/cefpython · GitHub
pythonthings
cefpython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cefpython
/
src
/
handlers
/
focus_handler.pyx
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (51 loc) · 1.89 KB
Breadcrumbs
cefpython
/
src
/
handlers
/
focus_handler.pyx
Copy path
File metadata and controls
59 lines (51 loc) · 1.89 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
Copyright (c) 2016 CEF Python. See the Authors and License files.
include
"
../cefpython.pyx
"
cimport cef_types
from
cef_types cimport TID_UI
FOCUS_SOURCE_NAVIGATION
=
cef_types.FOCUS_SOURCE_NAVIGATION
FOCUS_SOURCE_SYSTEM
=
cef_types.FOCUS_SOURCE_SYSTEM
cdef public
void
FocusHandler_OnTakeFocus(
CefRefPtr[CefBrowser] cef_browser,
cpp_bool next_
)
except
*
with
gil:
cdef PyBrowser browser
try
:
assert
IsThread(TID_UI),
"
Must be called on the UI thread
"
browser
=
GetPyBrowser(cef_browser)
callback
=
browser.GetClientCallback(
"
OnTakeFocus
"
)
if
callback:
callback(browser, next_)
except
:
(exc_type, exc_value, exc_trace)
=
sys.exc_info()
sys.excepthook(exc_type, exc_value, exc_trace)
cdef public cpp_bool FocusHandler_OnSetFocus(
CefRefPtr[CefBrowser] cef_browser,
cef_types.cef_focus_source_t source
)
except
*
with
gil:
cdef PyBrowser browser
cdef py_bool ret
try
:
assert
IsThread(TID_UI),
"
Must be called on the UI thread
"
browser
=
GetPyBrowser(cef_browser)
callback
=
browser.GetClientCallback(
"
OnSetFocus
"
)
if
callback:
ret
=
callback(browser, source)
return
bool
(ret)
else
:
return
False
except
:
(exc_type, exc_value, exc_trace)
=
sys.exc_info()
sys.excepthook(exc_type, exc_value, exc_trace)
cdef public
void
FocusHandler_OnGotFocus(
CefRefPtr[CefBrowser] cef_browser
)
except
*
with
gil:
cdef PyBrowser browser
try
:
assert
IsThread(TID_UI),
"
Must be called on the UI thread
"
browser
=
GetPyBrowser(cef_browser)
callback
=
browser.GetClientCallback(
"
OnGotFocus
"
)
if
callback:
callback(browser)
except
:
(exc_type, exc_value, exc_trace)
=
sys.exc_info()
sys.excepthook(exc_type, exc_value, exc_trace)
Back
|
FazBrowse Home
|
New Git URL