Ejemplo n.º 1
0
        internal void Gui_RenameLayer(string pLayerID, string pNewName)
        {
            EzJson j = new EzJson();

            j.BeginFunction("rename_layer");
            j.AddData("layer", pLayerID);
            j.AddData("name", pNewName);
            m_toolRunner.ParseJSON(j.Finish());
        }
Ejemplo n.º 2
0
        internal void GuiInput_MouseMove(object sender, MouseEventArgs e)
        {
            EzJson j = new EzJson();

            j.BeginFunction("tool_move");
            j.AddData("pressure", (128).ToString());
            j.AddData("x", (int)(e.X / m_canvasWindow.magnification));
            j.AddData("y", (int)(e.Y / m_canvasWindow.magnification));
            m_toolRunner.ParseJSON(j.Finish());
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        internal void GuiInput_MouseUp(object sender, MouseEventArgs e)
        {
            EzJson j = new EzJson();

            j.BeginFunction("tool_up");
            j.AddData("x", (int)(e.X / m_canvasWindow.magnification));
            j.AddData("y", (int)(e.Y / m_canvasWindow.magnification));
            j.AddData("pressure", 0);
            j.AddData("layer", selectedLayerID);
            m_toolRunner.ParseJSON(j.Finish());
        }
Ejemplo n.º 5
0
        internal void GuiInput_MouseDown(object sender, MouseEventArgs e)
        {
            string toolName = m_mainForm.GetToolName();
            EzJson j        = new EzJson();

            j.BeginFunction("tool_down");
            j.AddData("pressure", (128).ToString());
            j.AddData("x", (int)(e.X / m_canvasWindow.magnification));
            j.AddData("y", (int)(e.Y / m_canvasWindow.magnification));
            j.AddData("layer", selectedLayerID);
            j.AddData("tool", toolName);
            switch (toolName)
            {
            case "brush":
                j.AddData("options", m_mainForm.GetBrushOptions());
                break;

            case "pen":
                j.AddData("options", m_mainForm.GetPenOptions());
                break;

            default:
                j.AddData("options", null);
                break;
            }
            m_toolRunner.ParseJSON(j.Finish());
        }
Ejemplo n.º 6
0
        internal void GuiInput_TabletDown(object sender, WintabPacket pkt)
        {
            string toolName = m_mainForm.GetToolName();
            EzJson j        = new EzJson();

            j.BeginFunction("tool_down");
            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));
            j.AddData("layer", selectedLayerID);
            j.AddData("tool", toolName);
            switch (toolName)
            {
            case "brush":
                j.AddData("options", m_mainForm.GetBrushOptions());
                break;

            case "pen":
                j.AddData("options", m_mainForm.GetPenOptions());
                break;

            default:
                j.AddData("options", null);
                break;
            }
            m_toolRunner.ParseJSON(j.Finish());
        }
Ejemplo n.º 7
0
        internal void Gui_SetLayerOrder(string[] pOrderedIDs)
        {
            EzJson j = new EzJson();

            j.BeginFunction("reorder_layers");
            j.AddData("order", pOrderedIDs);
            m_toolRunner.ParseJSON(j.Finish());
        }
Ejemplo n.º 8
0
        internal void Gui_RemoveLayer(string pLayerID)
        {
            EzJson j = new EzJson();

            j.BeginFunction("remove_layer");
            j.AddData("layer", pLayerID);
            m_toolRunner.ParseJSON(j.Finish());
        }
Ejemplo n.º 9
0
        internal void Gui_Undo()
        {
            EzJson j = new EzJson();

            j.BeginFunction("undo");
            j.AddData("layer", selectedLayerID);
            m_toolRunner.ParseJSON(j.Finish());
            Console.WriteLine("undo!");
        }
Ejemplo n.º 10
0
        internal string Gui_CreateLayer()
        {
            string id = Guid.NewGuid().ToString(); //create a globally unique id
            EzJson j  = new EzJson();

            j.BeginFunction("create_layer");
            j.AddData("layer", id);
            m_toolRunner.ParseJSON(j.Finish());
            return(id);
        }
 internal void Gui_RemoveLayer( string pLayerID)
 {
     EzJson j = new EzJson();
     j.BeginFunction("remove_layer");
     j.AddData("layer", pLayerID);
     m_toolRunner.ParseJSON(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.AddData("layer", id);
     m_toolRunner.ParseJSON(j.Finish());
     return id;
 }
 internal void GuiInput_TabletUp(object sender, WintabPacket pkt)
 {
     EzJson j = new EzJson();
     j.BeginFunction("tool_up");
     j.AddData("x", (int)(pkt.pkX / m_canvasWindow.magnification));
     j.AddData("y", (int)(pkt.pkY / m_canvasWindow.magnification));
     j.AddData("pressure", pkt.pkNormalPressure.pkAbsoluteNormalPressure.ToString());
     j.AddData("layer", selectedLayerID);
     m_toolRunner.ParseJSON(j.Finish());
 }
 internal void GuiInput_TabletDown(object sender, WintabPacket pkt)
 {
     string toolName = m_mainForm.GetToolName();
     EzJson j = new EzJson();
     j.BeginFunction("tool_down");
     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));
     j.AddData("layer", selectedLayerID);
     j.AddData("tool", toolName);
     switch (toolName)
     {
         case "brush":
             j.AddData("options", m_mainForm.GetBrushOptions());
             break;
         case "pen":
             j.AddData("options", m_mainForm.GetPenOptions());
             break;
         default:
             j.AddData("options", null);
             break;
     }
     m_toolRunner.ParseJSON(j.Finish());
 }
 internal void GuiInput_MouseUp(object sender, MouseEventArgs e)
 {
     EzJson j = new EzJson();
     j.BeginFunction("tool_up");
     j.AddData("x", (int)(e.X / m_canvasWindow.magnification));
     j.AddData("y", (int)(e.Y / m_canvasWindow.magnification));
     j.AddData("pressure", 0);
     j.AddData("layer", selectedLayerID);
     m_toolRunner.ParseJSON(j.Finish());
 }
 internal void GuiInput_MouseMove(object sender, MouseEventArgs e)
 {
     EzJson j = new EzJson();
     j.BeginFunction("tool_move");
     j.AddData("pressure", (128).ToString());
     j.AddData("x", (int)(e.X / m_canvasWindow.magnification));
     j.AddData("y", (int)(e.Y / m_canvasWindow.magnification));
     m_toolRunner.ParseJSON(j.Finish());
 }
 internal void Gui_Undo()
 {
     EzJson j = new EzJson();
     j.BeginFunction("undo");
     j.AddData("layer", selectedLayerID);
     m_toolRunner.ParseJSON(j.Finish());
     Console.WriteLine("undo!");
 }
 internal void Gui_RenameLayer(string pLayerID, string pNewName)
 {
     EzJson j = new EzJson();
     j.BeginFunction("rename_layer");
     j.AddData("layer", pLayerID);
     j.AddData("name", pNewName);
     m_toolRunner.ParseJSON(j.Finish());
 }
 internal void Gui_SetLayerOrder(string[] pOrderedIDs)
 {
     EzJson j = new EzJson();
     j.BeginFunction("reorder_layers");
     j.AddData("order", pOrderedIDs);
     m_toolRunner.ParseJSON(j.Finish());
 }
Ejemplo n.º 20
0
 internal void GuiInput_PointerMove(object sender, int x, int y, float pressure = 1.0f)
 {
     EzJson j = new EzJson();
     j.BeginFunction("tool_move");
     j.AddData("pressure", (pressure).ToString());
     j.AddData("x", (int)(x / m_canvasWindow.magnification));
     j.AddData("y", (int)(y / m_canvasWindow.magnification));
     m_toolRunner.ParseJSON(j.Finish());
 }
 internal void GuiInput_MouseDown(object sender, MouseEventArgs e)
 {
     string toolName = m_mainForm.GetToolName();
     EzJson j = new EzJson();
     j.BeginFunction("tool_down");
     j.AddData("pressure", (128).ToString());
     j.AddData("x", (int)(e.X / m_canvasWindow.magnification));
     j.AddData("y", (int)(e.Y / m_canvasWindow.magnification));
     j.AddData("layer", selectedLayerID);
     j.AddData("tool", toolName);
     switch (toolName) {
         case "brush":
             j.AddData("options", m_mainForm.GetBrushOptions());
         break;
         case "pen":
             j.AddData("options", m_mainForm.GetPenOptions());
         break;
         default:
             j.AddData("options", null);
         break;
     }
     m_toolRunner.ParseJSON(j.Finish());
 }
Ejemplo n.º 22
0
 internal void GuiInput_PointerUp(object sender, int x, int y, float pressure = 1.0f)
 {
     EzJson j = new EzJson();
     j.BeginFunction("tool_up");
     j.AddData("x", (int)(x / m_canvasWindow.magnification));
     j.AddData("y", (int)(y / m_canvasWindow.magnification));
     j.AddData("pressure", pressure);
     j.AddData("layer", selectedLayerID);
     m_toolRunner.ParseJSON(j.Finish());
 }