Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit fe3607c

Browse files
Merge branch 'develop' of https://github.com/runrev/livecode into feature-raw_clipboard
Conflicts: engine/src/executionerrors.h
2 parents ef6592b + 007858f commit fe3607c

File tree

139 files changed

+14760
-661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+14760
-661
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Name: do in widget
2+
3+
Type: command
4+
5+
Syntax: do <script> in <widget>
6+
7+
Summary: Executes a list of statements within a widget.
8+
9+
Introduced: 8.0
10+
11+
OS: mac,windows,linux,ios,android
12+
13+
Platforms: desktop,mobile
14+
15+
Example:
16+
// Use JavaScript to hide "myButton" in the page displayed in a browser widget.
17+
do "document.getElementById('myButton').hidden = 'hidden'" in widget "myBrowser"
18+
19+
Parameters:
20+
script (string): The code to execute within the widget.
21+
widget: A widget reference
22+
23+
Description:
24+
Use the <do in widget> command to execute statements in a widget. LiveCode sends a "OnDo" message with <script> as parameter to the widget, which can then handle that messages to run the code appropriately.
25+
26+
References: do (command), widget (object)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Name: go in widget
2+
3+
Type: command
4+
5+
Syntax: go { forward | forth | back[ward] } in <widget>
6+
7+
Summary: Navigates forward or backward in a widget.
8+
9+
Introduced: 8.0
10+
11+
OS: mac,windows,linux,ios,android
12+
13+
Platforms: desktop,mobile
14+
15+
Example:
16+
// Navigate to previous page in browser widget.
17+
go back in widget "myBrowser"
18+
19+
Example:
20+
// Return after previous call to "go back"
21+
go forward in widget "myBrowser"
22+
23+
Parameters:
24+
widget: A widget reference.
25+
26+
Description:
27+
Use the <go in widget> command to navigate within a widget. LiveCode sends a "OnGoBack" or "OnGoForward" message to the widget, which can then handle those messages to provide back / forward navigation.
28+
29+
References: widget (object)
30+
31+
Tags: navigation, widget
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Name: launch url in widget
2+
3+
Type: command
4+
5+
Syntax: launch url <url> in <widget>
6+
7+
Summary: Launches a url in a widget.
8+
9+
Introduced: 8.0
10+
11+
OS: mac,windows,linux,ios,android
12+
13+
Platforms: desktop,mobile
14+
15+
Example:
16+
launch url "http://www.livecode.com" in widget "myWebBrowser"
17+
18+
Parameters:
19+
url (string): The URL to launch. The supported url types will vary depending on the capabilities of the widget.
20+
widget: A widget reference.
21+
22+
Description:
23+
Use the <launch url> command to open a url within a widget. When <launch url in widget> is called, LiveCode sends a "OnLaunchURL" message to that widget with <url> as the parameter. The widget can then display the url in an appropriate manner.
24+
25+
References: launch url (command), launch document (command), URL (keyword), widget (object)
26+
27+
Tags: widget
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# New Browser Widget
2+
3+
This feature introduces a new embeddable browser implemented as a widget, making it much easier to use than the old revbrowser external.
4+
5+
To add a browser to your application, simply drag and drop the browser widget onto your stack and set the properties you need.
6+
7+
## Properties
8+
9+
* *browserUrl* - The URL of the page displayed in the browser.
10+
* *browserHtmltext* - The HTML source of the content displayed in the browser
11+
* *browserScrollbars* - Whether or not the browser displays scrollbars
12+
* *browserUserAgent* - The identifier sent by the browser when fetching web content.
13+
* *browserJavascriptHandlers* - A list of object script handlers that can be called by javascript code in the page loaded in the browser.
14+
15+
## Messages
16+
17+
* *browserDocumentLoadBegin pUrl* - sent when a new document has completed loading in the browser.
18+
* *browserDocumentLoadComplete pUrl* - sent when a new document has completed loading in the browser.
19+
* *browserDocumentLoadFailed pUrl, pError* - sent when a new document has failed to load in the browser.
20+
* *browserFrameDocumentLoadBegin pUrl* - sent when a new document has completed loading in a frame of the browser.
21+
* *browserFrameDocumentLoadComplete pUrl* - sent when a new document has completed loading in a frame of the browser.
22+
* *browserFrameDocumentLoadFailed pUrl, pError* - sent when a new document has failed to load in a frame of the browser.
23+
* *browserNavigateBegin pUrl* - sent when the browser begins navigation to a new page.
24+
* *browserNavigateComplete pUrl* - sent when the browser successfully navigates to a new page.
25+
* *browserNavigateFailed pUrl, pError* - sent when the browser has failed to navigate to a new page.

engine/engine-sources.gypi

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
'src/exec-interface-scrollbar.cpp',
343343
'src/exec-interface-stack.cpp',
344344
'src/exec-interface-vclip.cpp',
345+
'src/exec-interface-widget.cpp',
345346
'src/exec-keywords.cpp',
346347
'src/exec-legacy.cpp',
347348
'src/exec-logic.cpp',
@@ -577,17 +578,7 @@
577578

578579
# Native layers
579580
'src/native-layer.h',
580-
'src/native-layer-android.h',
581-
'src/native-layer-ios.h',
582-
'src/native-layer-mac.h',
583-
'src/native-layer-win32.h',
584-
'src/native-layer-x11.h',
585581
'src/native-layer.cpp',
586-
'src/native-layer-android.cpp',
587-
'src/native-layer-ios.mm',
588-
'src/native-layer-mac.mm',
589-
'src/native-layer-win32.cpp',
590-
'src/native-layer-x11.cpp',
591582
],
592583

593584
# Sources that are only for desktop mode
@@ -615,6 +606,20 @@
615606
'src/platform-surface.cpp',
616607
'src/platform-window.cpp',
617608

609+
# Group "Native Layer"
610+
'src/native-layer.cpp',
611+
'src/native-layer.h',
612+
'src/native-layer-android.cpp',
613+
'src/native-layer-android.h',
614+
'src/native-layer-ios.h',
615+
'src/native-layer-ios.mm',
616+
'src/native-layer-mac.h',
617+
'src/native-layer-mac.mm',
618+
'src/native-layer-win32.cpp',
619+
'src/native-layer-win32.h',
620+
'src/native-layer-x11.cpp',
621+
'src/native-layer-x11.h',
622+
618623
# Group "Desktop - Linux"
619624
'src/lnxans.h',
620625
'src/lnxaudio.h',
@@ -843,6 +848,7 @@
843848
'src/srvtheme.cpp',
844849
'src/srvspec.cpp',
845850
'src/srvstack.cpp',
851+
'src/native-layer-srv.cpp',
846852
],
847853

848854
# Java sources for Android
@@ -896,6 +902,8 @@
896902
'src/java/com/runrev/android/nativecontrol/NativeControlModule.java',
897903
'src/java/com/runrev/android/nativecontrol/ScrollerControl.java',
898904
'src/java/com/runrev/android/nativecontrol/VideoControl.java',
905+
906+
'src/java/com/runrev/android/libraries/LibBrowser.java',
899907
],
900908

901909
# AIDL sources for Android
@@ -934,6 +942,8 @@
934942
'src/module-canvas.cpp',
935943
'src/module-engine.cpp',
936944
'src/module-resources.cpp',
945+
946+
'src/module-browser.cpp',
937947
],
938948

939949
# Engine LCB files containing syntax
@@ -947,7 +957,7 @@
947957
# Other engine LCB files
948958
'engine_other_lcb_files':
949959
[
950-
960+
'src/browser.lcb',
951961
],
952962
},
953963

@@ -988,6 +998,7 @@
988998
[
989999
'src/dskmac.cpp',
9901000
'src/srvmac.cpp',
1001+
'src/native-layer-mac.mm',
9911002
],
9921003
},
9931004
],
@@ -1001,6 +1012,11 @@
10011012
['exclude', '(^|/)linux-'],
10021013
['exclude', '-x11\.cpp$'],
10031014
],
1015+
1016+
'sources!':
1017+
[
1018+
'src/native-layer-x11.cpp',
1019+
],
10041020
},
10051021
],
10061022
[
@@ -1017,6 +1033,7 @@
10171033
'sources!':
10181034
[
10191035
'src/srvwindows.cpp',
1036+
'src/native-layer-win32.cpp',
10201037
],
10211038
},
10221039
],
@@ -1036,6 +1053,11 @@
10361053
[
10371054
['exclude', '-android\.cpp$'],
10381055
],
1056+
1057+
'sources!':
1058+
[
1059+
'src/native-layer-android.cpp',
1060+
],
10391061
},
10401062
],
10411063
[
@@ -1045,6 +1067,11 @@
10451067
[
10461068
['exclude', '-ios\.(mm|cpp)$'],
10471069
],
1070+
1071+
'sources!':
1072+
[
1073+
'src/native-layer-ios.mm',
1074+
],
10481075
},
10491076
],
10501077
[

engine/kernel-mode-template.gypi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
'../libfoundation/libfoundation.gyp:libFoundation',
77
'../libgraphics/libgraphics.gyp:libGraphics',
88
'../libscript/libscript.gyp:libScript',
9+
10+
'../libbrowser/libbrowser.gyp:libbrowser',
911
],
1012

1113
'conditions':

engine/kernel.gypi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
'../libgraphics/libgraphics.gyp:libGraphics',
1313
'../libscript/libscript.gyp:libScript',
1414

15+
'../libbrowser/libbrowser.gyp:libbrowser',
16+
1517
'../thirdparty/libgif/libgif.gyp:libgif',
1618
'../thirdparty/libjpeg/libjpeg.gyp:libjpeg',
1719
'../thirdparty/libopenssl/libopenssl.gyp:libopenssl',

engine/src/aclip.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -965,26 +965,26 @@ IO_stat MCAudioClip::load(IO_handle stream, uint32_t version)
965965
IO_stat stat;
966966

967967
if ((stat = MCObject::load(stream, version)) != IO_NORMAL)
968-
return stat;
968+
return checkloadstat(stat);
969969
if ((stat = IO_read_uint4(&size, stream)) != IO_NORMAL)
970-
return stat;
970+
return checkloadstat(stat);
971971
if (size != 0)
972972
{
973973
samples = new int1[size];
974974
if ((stat = IO_read(samples, size, stream)) != IO_NORMAL)
975-
return stat;
975+
return checkloadstat(stat);
976976
}
977977
if ((stat = IO_read_uint2(&format, stream)) != IO_NORMAL)
978-
return stat;
978+
return checkloadstat(stat);
979979
if ((stat = IO_read_uint2(&nchannels, stream)) != IO_NORMAL)
980-
return stat;
980+
return checkloadstat(stat);
981981
if ((stat = IO_read_uint2(&swidth, stream)) != IO_NORMAL)
982-
return stat;
982+
return checkloadstat(stat);
983983
if ((stat = IO_read_uint2(&rate, stream)) != IO_NORMAL)
984-
return stat;
984+
return checkloadstat(stat);
985985
if (flags & F_LOUDNESS)
986986
if ((stat = IO_read_uint2(&loudness, stream)) != IO_NORMAL)
987-
return stat;
987+
return checkloadstat(stat);
988988
return loadpropsets(stream, version);
989989
}
990990

0 commit comments

Comments
 (0)