internal void Gui_RenameLayer(string pLayerID, string pNewName) { EzJson j = new EzJson(); j.BeginFunction("rename_layer"); j.AddField("layer", pLayerID); j.AddField("name", pNewName); m_controller.GuiInput(j.Finish()); }
internal void GuiInput_PointerMove(object sender, int x, int y, float pressure = 1.0f) { EzJson j = new EzJson(); j.BeginFunction("tool_move"); j.AddField("pressure", pressure.ToString(CultureInfo.InvariantCulture.NumberFormat)); j.AddField("x", (int)(x / m_canvasWindow.magnification)); j.AddField("y", (int)(y / m_canvasWindow.magnification)); m_controller.GuiInput(j.Finish()); }
internal void GuiInput_PointerUp(object sender, int x, int y, float pressure = 1.0f) { EzJson j = new EzJson(); j.BeginFunction("tool_up"); j.AddField("x", (int)(x / m_canvasWindow.magnification)); j.AddField("y", (int)(y / m_canvasWindow.magnification)); j.AddField("pressure", pressure); j.AddField("layer", selectedLayerID); m_controller.GuiInput(j.Finish()); }
internal void Gui_RemoveLayer(string pLayerID) { EzJson j = new EzJson(); j.BeginFunction("remove_layer"); j.AddField("layer", pLayerID); m_controller.GuiInput(j.Finish()); }
//internal void GuiInput_TabletMove(object sender, WintabPacket pkt) //{ // EzJson j = new EzJson(); // j.BeginFunction("tool_move"); // j.AddData("pressure", pkt.pkNormalPressure.pkAbsoluteNormalPressure.ToString()); // j.AddData("x", (int)(pkt.pkX / m_canvasWindow.magnification)); // j.AddData("y", (int)(pkt.pkY / m_canvasWindow.magnification)); // m_toolRunner.ParseJSON(j.Finish()); //} internal void Gui_Undo() { EzJson j = new EzJson(); j.BeginFunction("undo"); j.AddField("layer", selectedLayerID); m_controller.GuiInput(j.Finish()); Console.WriteLine("undo!"); }
internal string Gui_CreateLayer() { string id = Guid.NewGuid().ToString(); //create a globally unique id EzJson j = new EzJson(); j.BeginFunction("create_layer"); j.AddField("layer", id); m_controller.GuiInput(j.Finish()); return(id); }
internal void GuiInput_PointerDown(object sender, int x, int y, float pressure = 1.0f) { string toolName = m_mainForm.GetToolName(); EzJson j = new EzJson(); j.BeginFunction("tool_down"); j.AddField("pressure", pressure.ToString(CultureInfo.InvariantCulture.NumberFormat)); j.AddField("x", (int)(x / m_canvasWindow.magnification)); j.AddField("y", (int)(y / m_canvasWindow.magnification)); j.AddField("layer", selectedLayerID); j.AddField("tool", toolName); switch (toolName) { case "brush": j.AddObject("options", m_mainForm.GetBrushOptions()); break; case "pen": j.AddObject("options", m_mainForm.GetPenOptions()); break; default: j.AddField("options", ""); break; } m_controller.GuiInput(j.Finish()); }
internal void Gui_RemoveLayer( string pLayerID) { EzJson j = new EzJson(); j.BeginFunction("remove_layer"); j.AddField("layer", pLayerID); m_controller.GuiInput(j.Finish()); }
internal string Gui_CreateLayer() { string id = Guid.NewGuid().ToString(); //create a globally unique id EzJson j = new EzJson(); j.BeginFunction("create_layer"); j.AddField("layer", id); m_controller.GuiInput(j.Finish()); return id; }
internal void GuiInput_PointerMove(object sender, int x, int y, float pressure = 1.0f) { EzJson j = new EzJson(); j.BeginFunction("tool_move"); j.AddField("pressure", pressure.ToString(CultureInfo.InvariantCulture.NumberFormat)); j.AddField("x", (int)(x / m_canvasWindow.magnification)); j.AddField("y", (int)(y / m_canvasWindow.magnification)); m_controller.GuiInput( j.Finish()); }