Пример #1
0
void CreateLeafNodePair(screen_info *Screen, tree_node *Parent, int LeftWindowID, int RightWindowID, int SplitMode)
{
    Parent->WindowID = -1;
    Parent->SplitMode = SplitMode;
    Parent->SplitRatio = KwmSplitRatio;

    if(SplitMode == 1)
    {
        Parent->LeftChild = CreateLeafNode(Screen, Parent, LeftWindowID, 1);
        Parent->RightChild = CreateLeafNode(Screen, Parent, RightWindowID, 2);
    }
    else
    {
        Parent->LeftChild = CreateLeafNode(Screen, Parent, LeftWindowID, 3);
        Parent->RightChild = CreateLeafNode(Screen, Parent, RightWindowID, 4);
    }
}
Пример #2
0
void CreateLeafNodePair(screen_info *Screen, tree_node *Parent, int FirstWindowID, int SecondWindowID, int SplitMode)
{
    Parent->WindowID = -1;
    Parent->SplitMode = SplitMode;
    Parent->SplitRatio = KWMScreen.SplitRatio;

    int LeftWindowID = KWMTiling.SpawnAsLeftChild ? SecondWindowID : FirstWindowID;
    int RightWindowID = KWMTiling.SpawnAsLeftChild ? FirstWindowID : SecondWindowID;

    if(SplitMode == 1)
    {
        Parent->LeftChild = CreateLeafNode(Screen, Parent, LeftWindowID, 1);
        Parent->RightChild = CreateLeafNode(Screen, Parent, RightWindowID, 2);
    }
    else
    {
        Parent->LeftChild = CreateLeafNode(Screen, Parent, LeftWindowID, 3);
        Parent->RightChild = CreateLeafNode(Screen, Parent, RightWindowID, 4);
    }
}
Пример #3
0
void CreateLeafNodePair(ax_display *Display, tree_node *Parent, uint32_t FirstWindowID, uint32_t SecondWindowID, split_type SplitMode)
{
    Parent->WindowID = 0;
    Parent->SplitMode = SplitMode;
    Parent->SplitRatio = KWMSettings.SplitRatio;

    node_type ParentType = Parent->Type;
    link_node *ParentList = Parent->List;
    Parent->Type = NodeTypeTree;
    Parent->List = NULL;

    uint32_t LeftWindowID;
    uint32_t RightWindowID;

    if(HasFlags(&KWMSettings, Settings_SpawnAsLeftChild))
    {
        LeftWindowID = SecondWindowID;
        RightWindowID = FirstWindowID;
    }
    else
    {
        LeftWindowID = FirstWindowID;
        RightWindowID = SecondWindowID;
    }

    if(SplitMode == SPLIT_VERTICAL)
    {
        Parent->LeftChild = CreateLeafNode(Display, Parent, LeftWindowID, CONTAINER_LEFT);
        Parent->RightChild = CreateLeafNode(Display, Parent, RightWindowID, CONTAINER_RIGHT);

        tree_node *Node;
        if(HasFlags(&KWMSettings, Settings_SpawnAsLeftChild))
            Node = Parent->RightChild;
        else
            Node = Parent->LeftChild;

        Node->Type = ParentType;
        Node->List = ParentList;
        ResizeLinkNodeContainers(Node);
    }
    else if(SplitMode == SPLIT_HORIZONTAL)
    {
        Parent->LeftChild = CreateLeafNode(Display, Parent, LeftWindowID, CONTAINER_UPPER);
        Parent->RightChild = CreateLeafNode(Display, Parent, RightWindowID, CONTAINER_LOWER);

        tree_node *Node;
        if(HasFlags(&KWMSettings, Settings_SpawnAsLeftChild))
            Node = Parent->RightChild;
        else
            Node = Parent->LeftChild;

        Node->Type = ParentType;
        Node->List = ParentList;
        ResizeLinkNodeContainers(Node);
    }
    else
    {
        Parent->Parent = NULL;
        Parent->LeftChild = NULL;
        Parent->RightChild = NULL;
        Parent = NULL;
    }
}