Esempio n. 1
0
    /// <summary>
    /// Creates a new window with the given window ID and the current window UI
    /// </summary>
    public void CreateNewWindow(int windowID)
    {
        if (!Directory.Exists(Application.persistentDataPath + "/Windows")) {
            Directory.CreateDirectory(Application.persistentDataPath + "/Windows/");
        }

        string path = Application.persistentDataPath;
        if (windowID == -1)
            path += "/Windows/BaseWindow.txt";
        else
            path += "/Windows/Window" + windowID.ToString() + ".txt";
        try {
            myData = new WindowData();
            myData.windowID = windowID;

            using (FileStream fs = new FileStream(path, FileMode.Create)) {
                XmlSerializer xmls = new XmlSerializer(typeof(WindowData));
                xmls.Serialize(fs, myData);
                fs.Close();
            }

            Debug.Log ("Succesfully wrote UIWindow to " + path);
        } catch (InvalidOperationException e) {
            Debug.LogError ("Failed to write UIWindow to " + path + "- Error: " + e.Message);
        }
    }
Esempio n. 2
0
        RuntimeController(RuntimeDelegate client, WindowData data)
        {
            window_data_ = data;
            client_      = client;

            //DartVM dartVM
            //DartSnapshot isolate_snapshot
            //DartSnapshot shared_snapshot
            //TaskRunners task_runners
            //SnapshotDelegate snapshot_delegate
            //GrContext resource_context
            //SkiaUnrefQueue unref_queue
            //string advisory_script_uri
            //string advisory_script_entrypoint

            DartIsolate root_isolate = root_isolate_.lock ();
                                       root_isolate.SetReturnCodeCallback(
                (uint code) =>
            {
                root_isolate_return_code_ = new Tuple <bool, uint>(true, code);
            });

            if (var window = GetWindowIfAvailable())
            {
                tonic::DartState::Scope scope = new Scope(root_isolate);
                window.DidCreateIsolate();
                if (!FlushRuntimeStateToIsolate())
                {
                    FML_DLOG(ERROR) << "Could not setup intial isolate state.";
                }
            }
    public override void Init()
    {
        base.Init();

        //添加子窗口
        var subwin = new SubWindow_Demo2(this.Transform.Find("SubWindow"));

        subwin.Init();

        this.AddSubWindow("subwin1", subwin);
        //注册消息监听
        RegisterAction("rotation", OnMsg_Rotation);
        //01按钮
        btn_01.onClick.AddListener(() =>
        {
            this.Close();
            ScreenViewManager.Inst.MainLayer.BeginNavTo("main");
        });

        //02按钮
        btn_02.onClick.AddListener(() =>
        {
            var data = WindowData.Create("testkey");
            data.AddData("testkey", "testvalue");
            this.OpenSubWindow("subwin1", data);
        });
    }
Esempio n. 4
0
    /// <summary>
    /// Saves the window with the passed window ID
    /// </summary>
    public void SaveWindow(int windowID)
    {
        if (!Directory.Exists(Application.persistentDataPath + "/Windows"))
        {
            Directory.CreateDirectory(Application.persistentDataPath + "/Windows/");
        }

        string path = Application.persistentDataPath;

        if (windowID == -1)
        {
            path += "/Windows/BaseWindow.txt";
        }
        else
        {
            path += "/Windows/Window" + windowID.ToString() + ".txt";
        }
        try {
            myData = new WindowData();
            UpdateAllWindowObjects();
            myData.windowID = windowID;

            using (FileStream fs = new FileStream(path, FileMode.Create)) {
                XmlSerializer xmls = new XmlSerializer(typeof(WindowData));
                xmls.Serialize(fs, myData);
                fs.Close();
            }

            Debug.Log("Succesfully wrote UIWindow to " + path);
        } catch (InvalidOperationException e) {
            Debug.LogError("Failed to write UIWindow to " + path + "- Error: " + e.Message);
        }
    }
Esempio n. 5
0
            private void BlitThreadInit(WindowData reg)
            {
                Clyde._windowing !.GLMakeContextCurrent(reg.Reg);
                Clyde._windowing.GLSwapInterval(0);

                if (!Clyde._isGLES)
                {
                    GL.Enable(EnableCap.FramebufferSrgb);
                }

                var vao = GL.GenVertexArray();

                GL.BindVertexArray(vao);
                GL.BindBuffer(BufferTarget.ArrayBuffer, Clyde.WindowVBO.ObjectHandle);
                // Vertex Coords
                GL.VertexAttribPointer(0, 2, VertexAttribPointerType.Float, false, Vertex2D.SizeOf, 0);
                GL.EnableVertexAttribArray(0);
                // Texture Coords.
                GL.VertexAttribPointer(1, 2, VertexAttribPointerType.Float, false, Vertex2D.SizeOf, 2 * sizeof(float));
                GL.EnableVertexAttribArray(1);

                var program = Clyde._compileProgram(
                    Clyde._winBlitShaderVert,
                    Clyde._winBlitShaderFrag,
                    new (string, uint)[]
Esempio n. 6
0
 private void Buy(WindowData window)
 {
     if (Computer.CanCreateWindow(window) && Computer.Coin.Pay(window.Cost))
     {
         Computer.CreateWindow(window);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// 初始化窗口数据
 /// </summary>
 public virtual void InitWindowData()
 {
     if (windowData == null)
     {
         windowData = new WindowData();
     }
 }
Esempio n. 8
0
    private void MakeFullScreen(WindowData windowData)
    {
        if (windowData.EditorWindow == null || windowData.IsFullScreen)
        {
            return;
        }

        float   scalingFactor = GetScalingFactor();
        Vector2 dims          = windowData.MonitorResolution / scalingFactor;
        Vector2 offset        = windowData.MonitorOffset / scalingFactor;
        int     tabHeight     = (int)(TAB_HEIGHT / scalingFactor);
        int     borderWidth   = (int)(BORDER_WIDTH / scalingFactor);


        Rect windowRect = new Rect(
            offset.x,
            offset.y - tabHeight,
            dims.x,
            dims.y + tabHeight - borderWidth);



        windowData.IsFullScreen         = true;
        windowData.EditorWindow.minSize = windowData.EditorWindow.maxSize = new Vector2(
            dims.x,
            dims.y + tabHeight - borderWidth);
        windowData.EditorWindow.position = windowRect;
    }
Esempio n. 9
0
        private void WindowDropdown_SelectedIndexChanged(object sender, EventArgs e)
        {
            WindowData Data = (WindowData)WindowDropdown.SelectedItem;

            WindowName   = Data.Name;
            WindowTitle  = Data.Title;
            WindowHandle = Data.Handle;
        }
Esempio n. 10
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var loader = new DataLoader();

            loader.Load();
            AppConfig  = loader.GetAppConfig();
            WindowData = loader.GetWindowData();
        }
Esempio n. 11
0
        private void CreateAndBindExchanger()
        {
            IExchangerSettings settings = WindowData.GetCurrentExchangerSettings();

            exchanger = ExchangerFactory.Create(WindowData.ExchangerType, settings);
            exchanger.BindSourceData(In);
            exchanger.BindResultData(Out);
        }
Esempio n. 12
0
        public static int SaveWindow(string windowType, string viewModelType, string board, string seccode)
        {
            var windowData = new WindowData(windowType, viewModelType, board, seccode, "");
            var id         = GenerateWindowId();

            WindowPlacements.Add(id, windowData);
            return(id);
        }
Esempio n. 13
0
    public AWindow(Transform transform)
    {
        this.Transform       = transform;
        this.TempData        = WindowData.Create();
        subWindowsDictionary = new Dictionary <string, SubWindow>();

        UITools.AutoSetTransformPath(this);
    }
Esempio n. 14
0
 public void RunPhonemeExtractor(AudioClip audioFile, string transcription, string _pathToConvertedFile)
 {
     audioClip           = audioFile;
     pathToConvertedFile = _pathToConvertedFile;
     textTranscripton    = transcription;
     currentPaths        = dataManager.LoadWindowData();
     RunJavaProcess();
     DataCleaning.LoadingBarViewer.Instance.StartLoading();
 }
Esempio n. 15
0
        public void LoadContent(WindowData wd)
        {
            var places = wd.SQLDatabase.GetPlaces();

            foreach (var p in places)
            {
                wd.PlaceDatas.PlaceList.Add(p);
            }
        }
Esempio n. 16
0
 public void OnMsg_GetData(WindowData data)
 {
     if (data != null)
     {
         var dial = data.GetData <Dial>("key");
         Debugger.Log("新增新转盘");
         Debugger.Log(dial);
     }
 }
Esempio n. 17
0
        public void LoadContent(WindowData datas)
        {
            var charas = datas.SQLDatabase.GetCharacters();

            foreach (var c in charas)
            {
                datas.CharacterDatas.CharacterList.Add(c);
            }
        }
Esempio n. 18
0
        public override bool SwapBuffersImpl(WindowData wdata)
        {
            var hWnd   = ((Win32WindowData)wdata).Hwnd;
            var hdc    = GetDC(hWnd);
            var result = SwapBuffers(hdc);

            ReleaseDC(hWnd, hdc);
            return(result);
        }
Esempio n. 19
0
        public override IntPtr CreateContextImpl(WindowData wdata)
        {
            var hWnd = ((Win32WindowData)wdata).Hwnd;
            var hdc  = GetDC(hWnd);
            var hrc  = WglCreateContext(hdc);

            ReleaseDC(hWnd, hdc);
            return(hrc);
        }
Esempio n. 20
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public ViderePlayer(WindowData data)
        {
            windowData           = data;
            data.Window.Closing += (Sender, Args) => data.MediaPlayer.Dispose( );

            MainDispatcher = data.Window.Dispatcher;

            this.LoadComponents( );
            this.InitializeComponents( );
        }
Esempio n. 21
0
    public GameObject GetGameWindow(NFCWindows.UI_WIN_STATE eState)
    {
        if (mhtWindows.ContainsKey(eState))
        {
            WindowData xWindowData = (WindowData)mhtWindows[eState];
            return(xWindowData.xWindowGameObject);
        }

        return(null);
    }
Esempio n. 22
0
    /// <summary>
    /// 更新UI使用的数据
    /// </summary>
    /// <param name="data">数据</param>
    public void SendMessage(WindowData data)
    {
        Action <WindowData> action = null;

        callbackMap.TryGetValue(data.Name, out action);
        if (action != null)
        {
            action(data);
        }
    }
Esempio n. 23
0
        public static List<IntPtr> SearchForWindow(string wndclass)
        {
            WindowData sd = new WindowData
            { Wndclass = wndclass,
              hWnd = new List<IntPtr>()
            };

            EnumWindows(new EnumWindowsProc(EnumProc), ref sd);
            return sd.hWnd;
        }
Esempio n. 24
0
    private void CloseWindow(WindowData windowData)
    {
        if (windowData.EditorWindow == null)
        {
            return;
        }

        windowData.EditorWindow.Close();
        windowData.EditorWindow = null;
    }
Esempio n. 25
0
    public void RegisterWindowStateCallback(NFCWindows.UI_WIN_STATE eState, WindowStateEventHandler handler)
    {
        if (!mhtWindows.ContainsKey(eState))
        {
            return;
        }

        WindowData xWindowData = (WindowData)mhtWindows[eState];

        xWindowData.doWindowHandleDel += handler;
    }
Esempio n. 26
0
        //public static void CreateBackupLogForm(ITrace trace)
        public static void CreateBackupLogForm()
        {
            //gLogBackupForm = new LogForm(trace);
            gLogBackupForm = new LogForm();

            WindowData windowData = WindowsApp.CurrentWindowsApp.AddWindow(gLogBackupForm);

            gLogBackupForm.Icon          = main.gIcon;
            gLogBackupForm.Text          = "Pib - log backup";
            gLogBackupForm.ShowInTaskbar = false;
        }
Esempio n. 27
0
        public static List <IntPtr> SearchForWindow(string wndclass)
        {
            WindowData sd = new WindowData
            {
                Wndclass = wndclass,
                hWnd     = new List <IntPtr>()
            };

            EnumWindows(new EnumWindowsProc(EnumProc), ref sd);
            return(sd.hWnd);
        }
Esempio n. 28
0
        public void Insert(float samplerate, float[] data, float[] spectrum)
        {
            if (buffer.Count >= length)
            {
                buffer.Dequeue();
            }

            WindowData newData = new WindowData(samplerate, data, spectrum);

            buffer.Enqueue(newData);
        }
Esempio n. 29
0
 public override void Open(WindowData data = null)
 {
     base.Open();
     if (data != null)
     {
         foreach (var v in data.DataMap)
         {
             text_msg.text = v.Key.ToString() + ":" + v.Value.ToString();
         }
     }
 }
Esempio n. 30
0
        public override bool SwapBuffersImpl(WindowData wdata)
        {
            var wwdata = (WaylandWindowData)wdata;
            var result = EGLSwapBuffers(_wwsd.EGLDisplay, wwdata.EGLSurface);

            if (!result)
            {
                LogError("eglSwapBuffers");
            }
            return(result);
        }
Esempio n. 31
0
    private void save()
    {
        if (tempDialData == null)
        {
            return;
        }
        var data = WindowData.Create("AddDial");

        data.AddData("key", tempDialData);
        UIManager.Inst.SendMessage((int)WinEnum.Win_Menu, data);
    }
Esempio n. 32
0
        public override IntPtr CreateContextImpl(WindowData wdata)
        {
            var wwdata = (WaylandWindowData)wdata;
            var ctx    = EGLCreateContext(_wwsd.EGLDisplay, wwdata.EGLConfig, IntPtr.Zero, ref EGL_NONE);

            if (ctx == IntPtr.Zero)
            {
                LogError("eglCreateContext");
            }
            return(ctx);
        }
Esempio n. 33
0
        public static List<IntPtr> SearchForWindow(string wndclass,string title)
        {
            WindowData sd = new WindowData
            {
                Wndclass = wndclass,
                windowName = title,
                hWnd = new List<IntPtr>()
            };

            EnumWindows(new EnumWindowsProc(EnumProcwithTitle), ref sd);
            return sd.hWnd;
        }
Esempio n. 34
0
 //Callback Function
 public static bool EnumProc(IntPtr hWnd, ref WindowData data)
 {
     //Check for className and get list of handles
     StringBuilder sb = new StringBuilder(1024);
     GetClassName(hWnd, sb, sb.Capacity);
     if (sb.ToString().Equals(data.Wndclass))
     {
         //Add more conditions for differenting between different instances of firefox
         data.hWnd.Add(hWnd);
         return true; //Continue Enumerating and adding
     }
     return true;
 }
Esempio n. 35
0
 //Callback Function
 public static bool EnumProcwithTitle(IntPtr hWnd, ref WindowData data)
 {
     //Check for className and get list of handles
     StringBuilder sb = new StringBuilder(1024);
     GetClassName(hWnd, sb, sb.Capacity);
     if (sb.ToString().Equals(data.Wndclass))
     {
         StringBuilder title = new StringBuilder(1024);
         GetWindowText(hWnd, title, title.Capacity);
         if(title.ToString().Contains(data.windowName))
             data.hWnd.Add(hWnd);
         return true; //Continue Enumerating and adding
     }
     return true;
 }
Esempio n. 36
0
        private BasicTeraData(string resourceDirectory)
        {
            ResourceDirectory = resourceDirectory;
            Directory.CreateDirectory(Path.Combine(resourceDirectory, "config")); //ensure config dir is created
            XmlConfigurator.Configure(new Uri(Path.Combine(ResourceDirectory, "log4net.xml")));
            HotkeysData = new HotkeysData(this);
            WindowData = new WindowData(this);
            EventsData = new EventsData(this);
            _dataForRegion = Helpers.Memoize<string, TeraData>(region => new TeraData(region));
            Servers = new ServerDatabase(Path.Combine(ResourceDirectory, "data"));
            //handle overrides
            var serversOverridePath = Path.Combine(ResourceDirectory, "config/server-overrides.txt");
            if (!File.Exists(serversOverridePath))//create the default file if it doesn't exist
                File.WriteAllText(serversOverridePath, LP.ServerOverrides );
            var overriddenServers = GetServers(serversOverridePath).ToList();
            Servers.AddOverrides(overriddenServers);

            ImageDatabase = new ImageDatabase(Path.Combine(ResourceDirectory, "img/"));
            Icons = new IconsDatabase(Path.Combine(ResourceDirectory, "data/"));
        }
Esempio n. 37
0
 private void UpdateProperties(SystemWindow sw)
 {
     if (!delayedUpdate.Checked && (sw.HWnd == windowProperties.Handle || sw.HWnd == parentProperties.Handle))
     {
         windowProperties.Text = "(recursive)";
         parentProperties.Text = "(recursive)";
     }
     delayedProperties = getWindowProperties(sw);
     windowData = new WindowData(mf, sw);
     SystemWindow swParent = sw.ParentSymmetric;
     while (swParent != null)
     {
         sw = swParent;
         swParent = sw.ParentSymmetric;
     }
     delayedMainProperties = getWindowProperties(sw);
     parentData = new WindowData(mf, sw);
     if (!delayedUpdate.Checked)
     {
         windowProperties.Text = delayedProperties;
         parentProperties.Text = delayedMainProperties;
     }
 }
Esempio n. 38
0
 public CopiedWindow(WindowData windowData, string window, WindowData mainData, string mainWindow)
 {
     this.title = windowData == null ? "[live display]" : windowData.Name;
     this.window = window;
     this.mainWindow = mainWindow;
     this.windowData = windowData;
     this.mainData = mainData;
 }
Esempio n. 39
0
    /// <summary>
    /// Loads the window from the windowID.
    /// Sets the WindowData to UIWindow and returns it
    /// </summary>
    public WindowData LoadWindow(int windowID)
    {
        if (!Directory.Exists(Application.persistentDataPath + "/Windows")) {
            Directory.CreateDirectory(Application.persistentDataPath + "/Windows/");
        }
        string path = Application.persistentDataPath;

        if (!File.Exists(path + "/Windows/BaseWindow.txt")) {
            SaveWindow(-1);
        }

        try {

            if (windowID == -1)
                path += "/Windows/BaseWindow.txt";
            else
                path += "/Windows/Window" + windowID + ".txt";

            myData = new WindowData();
            XmlSerializer xmls = new XmlSerializer(typeof(WindowData));

            using (FileStream fs = new FileStream(path, FileMode.Open)) {
                myData = xmls.Deserialize(fs) as WindowData;
                fs.Close();
            }
            Debug.Log("Succesfully Loaded window from path: " + path);

            return myData;
        } catch (InvalidOperationException e) {
            Debug.LogError ("Failed to load UIWindow from " + path + " - Error: " + e.Message);
            return null;
        }
    }
Esempio n. 40
0
        private void ScreenUpdate(WindowData data)
        {
            if ((data != null) && (data.Image != null))
            {
                // Unpack the data.
                //
                Image partial;
                Rectangle bounds;
                Utils.UnpackScreenCaptureData(data, out partial, out bounds);

                Utils.UpdateScreen(ref _viewerSession.Screen, partial, bounds);

                UpdateScreenImage();
            }
        }
Esempio n. 41
0
 private static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, ref WindowData data);