How can I do some changes in LC engine and test them?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, LCMark

Post Reply
Monox18
Posts: 73
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

How can I do some changes in LC engine and test them?

Post by Monox18 » Mon Jan 04, 2021 12:51 am

I want to modify how the browser widget call the CEF browser implementation. I took a look into LC source in github and found the file that I want to edit which is this: https://github.com/livecode/livecode/bl ... rowser.cpp

Once I modify it, how do I incorporate/compile/run that file? I searched that file in my Windows installation of LC. But I didn't find it. Do I need to compile the engine? or can I just edit that file and replace something locally in my machine?

The lines which I want to modify are:

Code: Select all

	CefMainArgs t_args;
	CefSettings t_settings;
	t_settings.multi_threaded_message_loop = false;
	t_settings.command_line_args_disabled = true;
	t_settings.no_sandbox = true;
	t_settings.log_severity = LOGSEVERITY_VERBOSE;
t_args contains the arguments (flags) that initialize the CEF browser and t_settings contains some of the settings utilized. LC doesn't provide a method to change them. They are hardcoded.

The problem that I'm facing is that currently the browser widget can't access the GetUserMedia() JavaScript method because the CEF browser requires the --enable-media-stream flag to enable the WebRTC features and thus allow the GetUserMedia to access the webcam and microphone.

From the CEF forum I have found how to add flags. I really don't know C++ but I'm praying adding this line will enable WebRTC:

Code: Select all

t_settings.CefCommandLineArgs.Add("enable-media-stream", "1");
Also, CEF contains a whole ton of flags and settings to play around. By implementing a method that allows to change them, one would give LC a massive boost integration with the CEF capabilites, thus a more solid HTML5 implementation in native apps.

Thank you!
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3199
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: How can I do some changes in LC engine and test them?

Post by mwieder » Mon Jan 04, 2021 3:14 am

Yes, you'll need to compile the system locally and launch the newly-compiled engine to test any changes.
Been a while since I've had to do this on Windows, but the instructions are at

https://github.com/livecode/livecode/bl ... ild-win.md

...and thanks in advance for any CEF modifications you can make.

Monox18
Posts: 73
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: How can I do some changes in LC engine and test them?

Post by Monox18 » Mon Jan 04, 2021 11:57 am

Just what I was fearing, I have to follow a long process in order to compile the engine and play around with the browser widget. Alright, thank you for pointing me in the right direction. Will report back the results.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Monox18
Posts: 73
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: How can I do some changes in LC engine and test them?

Post by Monox18 » Mon Jan 04, 2021 2:31 pm

I installed all the dependencies, including updates, and followed Windows guide in LC github. After cloning LC, when I double click the configure.bat file I get an error. Apparently 2 files are missing:
Image

Any recommendation? No idea what I am missing.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3199
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: How can I do some changes in LC engine and test them?

Post by mwieder » Tue Jan 05, 2021 1:54 am

I found some notes that Trevor typed up a couple of years ago.

https://www.bluemangolearning.com/livec ... community/

Monox18
Posts: 73
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: How can I do some changes in LC engine and test them?

Post by Monox18 » Tue Jan 05, 2021 6:14 pm

Actually It was doing what it is supposed to do. It wasn't an error, just a warning. It mentions two missing input files. So I proceed.

The configure.bat files does create the folder build-win-x86_64 containing the Visual Studio files to compile it. That file detects my PC's arquitecture and automatically choses -x86_64 rather than the x32 as shown in the github instructions. I opened Visual studio 2017, followed the final steps and build it. The built was successful.

Then I can see the file "LiveCode-Community.exe" in the "build-win-x86_64\livecode\Debug\" folder and although it runs the IDE 9.7 (dp 1) it runs extremely slowly. Like very buggy. Doesn't respond well to user actions. takes minutes to load. Can't open properly my other stacks. Can't drag widgets from the palette. Even created 2 buttons and created the browser widget from code. Setting its URL does nothing.... (And I haven't done any changes in the engine source code yet).

This compiled engine doesn't work well in my machine. I guess this is as far as I can go.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3199
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: How can I do some changes in LC engine and test them?

Post by mwieder » Tue Jan 05, 2021 9:27 pm

Hmmm... grasping at straws here, but the IDE will load very slowly at first because it's creating the entire dictionary for you. I don't know if there is a flag to get around that, but if you're launching from the command line you'll see a lot of thrashing around building the files.

Post Reply

Return to “Engine Contributors”