Skip to content

Commit 0a7d8d6

Browse files
committed
Fix focus in all examples. Pass kwargs to Handlers' callbacks (BC BREAK!).
Fix focus issue in qt.py and gtk2.py examples during app initial loading (cztomczak#284). The solution is to call SetFocus in OnLoadStart once. Pass keyword arguments to Handlers' callbacks (cztomczak#291). This will break many of existing code for Handlers' callbacks. Similar changes were also applied to: CookieVisitor, StringVisitor, WebRequestClient. In JavascriptDialogCallback.Continue "userInput" argument was renamed to "user_input". Fix PyCharm warnings in kivy_.py example (cztomczak#285). Rename JavascriptContextHandler to V8ContextHandler (API docs only changes). Update tools/apidocs.py. Sort top-level headings by name.
1 parent d81f266 commit 0a7d8d6

36 files changed

+956
-848
lines changed

api/API-categories.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* [CommandLineSwitches](CommandLineSwitches.md) dictionary
1616

1717

18-
### Objects
18+
### Classes and objects
1919

2020
* [Browser](Browser.md) object
2121
* [Callback](Callback.md) object
@@ -36,17 +36,24 @@
3636
* [WindowUtils](WindowUtils.md) class
3737

3838

39-
### Handlers
39+
### Handlers (interfaces)
4040

4141
* [DisplayHandler](DisplayHandler.md)
4242
* [DownloadHandler](DownloadHandler.md)
4343
* [FocusHandler](FocusHandler.md)
44-
* [JavascriptContextHandler](JavascriptContextHandler.md)
4544
* [JavascriptDialogHandler](JavascriptDialogHandler.md)
4645
* [KeyboardHandler](KeyboardHandler.md)
4746
* [LifespanHandler](LifespanHandler.md)
4847
* [LoadHandler](LoadHandler.md)
4948
* [RenderHandler](RenderHandler.md)
5049
* [RequestHandler](RequestHandler.md)
5150
* [ResourceHandler](ResourceHandler.md)
51+
* [V8ContextHandler](V8ContextHandler.md)
52+
53+
54+
### Other interfaces
55+
56+
* [CookieVisitor](CookieVisitor.md) interface
57+
* [StringVisitor](StringVisitor.md) interface
58+
* [WebRequestClient](WebRequestClient.md) interface
5259

api/API-index.md

Lines changed: 297 additions & 296 deletions
Large diffs are not rendered by default.

api/ApplicationSettings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ The behavior for encode/decode errors is to replace the unknown character with "
385385

386386
(int)
387387
The number of stack trace frames to capture for uncaught exceptions.
388-
Specify a positive value to enable the [JavascriptContextHandler](JavascriptContextHandler.md).OnUncaughtException()
388+
Specify a positive value to enable the [V8ContextHandler](V8ContextHandler.md).OnUncaughtException()
389389
callback. Specify 0 (default value) and
390390
OnUncaughtException() will not be called. Also configurable using the
391391
"uncaught-exception-stack-size" [command-line switch](CommandLineSwitches.md).

api/CookieVisitor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ Table of contents:
2525
| cookie | [Cookie](Cookie.md) |
2626
| count | int |
2727
| total | int |
28-
| deleteCookie | list |
28+
| delete_cookie_out | list[bool] |
2929
| __Return__ | bool |
3030

3131
Method that will be called once for each cookie. |count| is the 0-based
3232
index for the current cookie. |total| is the total number of cookies.
33-
Set |`deleteCookie[0]`| to True to delete the cookie currently being visited.
33+
Set |delete_cookie_out[0]| to True to delete the cookie currently being visited.
3434
Return False to stop visiting cookies, True to continue. This method may
3535
never be called if no cookies are found.

api/DisplayHandler.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ Called when the page title changes.
4848
| Parameter | Type |
4949
| --- | --- |
5050
| browser | [Browser](Browser.md) |
51-
| textOut | list& |
51+
| text_out | list |
5252
| __Return__ | bool |
5353

54-
Called when the browser is about to display a tooltip. `textOut[0]` contains the
54+
Called when the browser is about to display a tooltip. `text_out[0]` contains the
5555
text that will be displayed in the tooltip. To handle the display of the
56-
tooltip yourself return true. Otherwise, you can optionally modify `textOut[0]`
56+
tooltip yourself return true. Otherwise, you can optionally modify `text_out[0]`
5757
and then return false to allow the browser to display the tooltip.
5858
When window rendering is disabled the application is responsible for
5959
drawing tooltips and the return value is ignored.

api/FocusHandler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Table of contents:
2222
| Parameter | Type |
2323
| --- | --- |
2424
| browser | [Browser](Browser.md) |
25-
| next | bool |
25+
| next_component | bool |
2626
| __Return__ | void |
2727

2828
Description from upstream CEF:

api/JavascriptDialogHandler.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ requests.
2727
| Parameter | Type |
2828
| --- | --- |
2929
| allow | bool |
30-
| userInput | str |
30+
| user_input | str |
3131
| __Return__ | void |
3232

3333
Continue the javascript dialog request. Set |allow| to true if the OK button was
34-
pressed. The |userInput| value should be specified for prompt dialogs.
34+
pressed. The |user_input| value should be specified for prompt dialogs.
3535

3636

3737
## Callbacks
@@ -47,17 +47,17 @@ pressed. The |userInput| value should be specified for prompt dialogs.
4747
| message_text | str |
4848
| default_prompt_text | str |
4949
| callback | JavascriptDialogCallback |
50-
| suppress_message[0] | bool& |
50+
| suppress_message_out | list |
5151
| __Return__ | bool |
5252

5353
Called to run a JavaScript dialog. If |origin_url| is non-empty it can be
5454
passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
5555
and user-friendly display string. The |default_prompt_text| value will be
56-
specified for prompt dialogs only. Set |suppress_message| to true and
56+
specified for prompt dialogs only. Set |suppress_message_out[0]| to true and
5757
return false to suppress the message (suppressing messages is preferable to
5858
immediately executing the callback as this is used to detect presumably
5959
malicious behavior like spamming alert messages in onbeforeunload). Set
60-
|suppress_message| to false and return false to use the default
60+
|suppress_message_out[0]| to false and return false to use the default
6161
implementation (the default implementation will show one modal dialog at a
6262
time and suppress any additional dialog requests until the displayed dialog
6363
is dismissed). Return true if the application will use a custom dialog or

api/KeyboardHandler.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Table of contents:
2121
| --- | --- |
2222
| browser | [Browser](Browser.md) |
2323
| event | KeyEvent |
24-
| eventHandle | MSG\* / GdkEvent\* / NSEvent\*` |
25-
| isKeyboardShortcutOut | out list[0] -> bool |
26-
| __Return__ | void |
24+
| event_handle | MSG\* / GdkEvent\* / NSEvent\*` |
25+
| is_keyboard_shortcut_out | list |
26+
| __Return__ | bool |
2727

2828
Called before a keyboard event is sent to the renderer. |event| contains
29-
information about the keyboard event. |eventHandle| is the operating system
29+
information about the keyboard event. |event_handle| is the operating system
3030
event message, if any. Return true if the event was handled or false
3131
otherwise. If the event will be handled in OnKeyEvent() as a keyboard
32-
shortcut, set isKeyboardShortcutOut[0] to True and return False.
32+
shortcut, set |is_keyboard_shortcut_out[0]| to True and return False.
3333

3434
KeyEvent is a dictionary with the following keys:
3535

@@ -77,10 +77,11 @@ KeyEventFlags constants defined in the cefpython module:
7777
| --- | --- |
7878
| browser | [Browser](Browser.md) |
7979
| event | KeyEvent |
80-
| eventHandle | MSG\* / GdkEvent\* / NSEvent\* |
81-
| __Return__ | void |
80+
| event_handle | MSG\* / GdkEvent\* / NSEvent\* |
81+
| __Return__ | bool |
8282

8383
Called after the renderer and javascript in the page has had a chance to
8484
handle the event. |event| contains information about the keyboard event.
8585
|os_event| is the operating system event message, if any. Return true if
86-
the keyboard event was handled or false otherwise. Description of the KeyEvent type is in the OnPreKeyEvent() callback.
86+
the keyboard event was handled or false otherwise. Description of the
87+
KeyEvent type is in the OnPreKeyEvent() callback.

api/LifespanHandler.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Table of contents:
2525
| --- | --- |
2626
| browser | [Browser](Browser.md) |
2727
| frame | [Frame](Frame.md) |
28-
| targetUrl | string |
29-
| targetFrameName | string |
30-
| targetDisposition | WindowOpenDisposition |
31-
| userGesture | bool |
32-
| popupFeatures | None |
33-
| out windowInfo[0] | [WindowInfo](WindowInfo.md) |
28+
| target_url | string |
29+
| target_frame_name | string |
30+
| target_disposition | WindowOpenDisposition |
31+
| user_gesture | bool |
32+
| popup_features | None |
33+
| window_info_out | list[[WindowInfo](WindowInfo.md)] |
3434
| client | None |
35-
| out browserSettings[0] | [BrowserSettings](BrowserSettings.md) |
36-
| out noJavascriptAccess[0] | bool |
35+
| browser_settings_out | list[[BrowserSettings](BrowserSettings.md)] |
36+
| no_javascript_access_out | list[bool] |
3737
| __Return__ | bool |
3838

3939
Called on the IO thread before a new popup browser is created. The
@@ -44,15 +44,15 @@ The |target_disposition| value indicates where the user intended to open
4444
the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
4545
be true if the popup was opened via explicit user gesture (e.g. clicking a
4646
link) or false if the popup opened automatically (e.g. via the
47-
DomContentLoaded event). The |popupFeatures| structure contains additional
47+
DomContentLoaded event). The |popup_features| structure contains additional
4848
information about the requested popup window. To allow creation of the
4949
popup browser optionally modify |windowInfo|, |client|, |browserSettings| and
50-
|noJavascriptAccess| and return false. To cancel creation of the popup
50+
|no_javascript_access| and return false. To cancel creation of the popup
5151
browser return true. The |client| and |settings| values will default to the
5252
source browser's values. If the |no_javascript_access| value is set to
5353
false the new browser will not be scriptable and may not be hosted in the
5454
same renderer process as the source browser. Any modifications to
55-
|windowInfo| will be ignored if the parent browser is wrapped in a
55+
|window_info| will be ignored if the parent browser is wrapped in a
5656
CefBrowserView.
5757

5858
Note that if you return True and create the popup window yourself, then

api/LoadHandler.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Table of contents:
2525
| Parameter | Type |
2626
| --- | --- |
2727
| browser | [Browser](Browser.md) |
28-
| isLoading | bool |
29-
| canGoBack | bool |
30-
| canGoForward | bool |
28+
| is_loading | bool |
29+
| can_go_back | bool |
30+
| can_go_forward | bool |
3131
| __Return__ | void |
3232

3333
Called when the loading state has changed. This callback will be executed
@@ -78,7 +78,7 @@ Not yet implemented. See [Issue #32](../issues/32).
7878
| --- | --- |
7979
| browser | [Browser](Browser.md) |
8080
| frame | [Frame](Frame.md) |
81-
| httpStatusCode | int |
81+
| http_code | int |
8282
| __Return__ | void |
8383

8484
Called when the browser is done loading a frame. The |frame| value will
@@ -89,9 +89,12 @@ will always be called for all frames irrespective of whether the request
8989
completes successfully. For notification of overall browser load status use
9090
OnLoadingStateChange instead.
9191

92-
This event behaves like window.onload, it waits for all the content to load (e.g. images), there is currently no callback for a DOMContentLoaded event, see [Issue #32](../issues/32).
92+
This event behaves like window.onload, it waits for all the content
93+
to load (e.g. images), there is currently no callback for
94+
a DOMContentLoaded event, see [Issue #32](../issues/32).
9395

94-
There are some cases when this callback won't get called, see this topic: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10906
96+
There are some cases when this callback won't get called, see this
97+
topic: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10906
9598

9699

97100
### OnLoadError
@@ -100,14 +103,15 @@ There are some cases when this callback won't get called, see this topic: http:/
100103
| --- | --- |
101104
| browser | [Browser](Browser.md) |
102105
| frame | [Frame](Frame.md) |
103-
| errorCode | [NetworkError](NetworkError.md) |
104-
| errorText | list& |
105-
| failedUrl | string |
106+
| error_code | [NetworkError](NetworkError.md) |
107+
| error_text_out | list[string] |
108+
| failed_url | string |
106109
| __Return__ | void |
107110

108111
Called when the resource load for a navigation fails or is canceled.
109-
|errorCode| is the error code number, |`errorText[0]`| is the error text and
110-
|failedUrl| is the URL that failed to load. See net\base\net_error_list.h
111-
for complete descriptions of the error codes.
112+
|errorCode| is the error code number, |error_text_out[0]| is the error
113+
text and |failed_url| is the URL that failed to load. See
114+
net\base\net_error_list.h for complete descriptions of the error codes.
112115

113-
This callback may get called when [Browser](Browser.md).`StopLoad` is called, or when file download is aborted (see DownloadHandler).
116+
This callback may get called when [Browser](Browser.md).`StopLoad`
117+
is called, or when file download is aborted (see DownloadHandler).

0 commit comments

Comments
 (0)