/*******************************************************************************
 * Copyright (c) 2016 QNX Software Systems and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/ const electron = require ( 'electron' ) ; const app = electron . app ; const BrowserWindow = electron . BrowserWindow ; const path = require ( 'path' ) ; const url = require ( 'url' ) ; let mainWindow ; app . setName ( "Two IDE" ) ; app . commandLine . appendSwitch ( 'ignore-gpu-blacklist' ) ; function createWindow ( ) { mainWindow = new BrowserWindow ( { width : 800 , height : 600 } ) ; mainWindow . loadURL ( url . format ( { pathname : path . join ( app . getAppPath ( ) , 'src/ui/index.html' ) , protocol : 'file:' , slashes : true } ) ) ; mainWindow . on ( 'closed' , function ( ) { mainWindow = null ; } ) ; } app . on ( 'ready' , ( ) => { createWindow ( ) ; } ) ; app . on ( 'window-all-closed' , function ( ) { if ( process . platform !== 'darwin' ) { app . quit ( ) ; } } ) ; app . on ( 'activate' , function ( ) { if ( mainWindow === null ) { createWindow ( ) ; } } ) ;