mirror of
https://github.com/servo/servo.git
synced 2025-06-23 00:24:35 +01:00
Support launching Servo2d with a URI.
This commit is contained in:
parent
0a5aab6cc2
commit
daabda7fe1
3 changed files with 29 additions and 5 deletions
|
@ -3,11 +3,32 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <Servo2D.h>
|
||||
#include <ml_lifecycle.h>
|
||||
#include <ml_logging.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ML_LOG(Debug, "Servo2D Starting.");
|
||||
Servo2D myApp;
|
||||
return myApp.run();
|
||||
|
||||
// Handle optional initialization string passed via 'mldb launch'
|
||||
MLLifecycleInitArgList* list = NULL;
|
||||
MLLifecycleGetInitArgList(&list);
|
||||
const char* uri = NULL;
|
||||
if (nullptr != list) {
|
||||
int64_t list_length = 0;
|
||||
MLLifecycleGetInitArgListLength(list, &list_length);
|
||||
if (list_length > 0) {
|
||||
const MLLifecycleInitArg* iarg = NULL;
|
||||
MLLifecycleGetInitArgByIndex(list, 0, &iarg);
|
||||
if (nullptr != iarg) {
|
||||
MLLifecycleGetInitArgUri(iarg, &uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Servo2D myApp(uri);
|
||||
int rv = myApp.run();
|
||||
|
||||
MLLifecycleFreeInitArgList(&list);
|
||||
return rv;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue