YggdrasilWM  0.1.1
A tiny window manager coded in C++
Grow Class Reference

Grow a window. More...

#include <Grow.hpp>

Inheritance diagram for Grow:
Inheritance graph
Collaboration diagram for Grow:
Collaboration graph

Public Member Functions

 Grow ()
 
 ~Grow () override=default
 
void execute (const std::string &args) override
 Each child class must implement this interface. More...
 

Static Public Member Functions

static DeserializedXKeyEvent deserializeXKeyEvent (const std::string &serializedEvent)
 

Detailed Description

Grow a window.

Constructor & Destructor Documentation

◆ Grow()

Grow::Grow ( )
33  {
34 
35 }

◆ ~Grow()

Grow::~Grow ( )
overridedefault

Member Function Documentation

◆ deserializeXKeyEvent()

DeserializedXKeyEvent Grow::deserializeXKeyEvent ( const std::string &  serializedEvent)
static
50  {
52  std::istringstream ss(serializedEvent);
53  std::string item;
54 
55  // Extract args_
56  std::getline(ss, item, ',');
57  event.inc = std::stoi(item);
58 
59  // Extract subwindow
60  std::getline(ss, item, ',');
61  event.subwindow = static_cast<Window>(std::stoul(item));
62 
63  // Extract window
64  std::getline(ss, item, ',');
65  event.window = static_cast<Window>(std::stoul(item));
66 
67  // Extract state
68  std::getline(ss, item, ',');
69  event.state = std::stoul(item);
70 
71  // Extract keycode
72  std::getline(ss, item, ',');
73  event.keycode = std::stoul(item);
74 
75  return event;
76 }
Definition: Grow.hpp:37

Referenced by execute().

Here is the caller graph for this function:

◆ execute()

void Grow::execute ( const std::string &  args)
overridevirtual

Each child class must implement this interface.

Parameters
argsarguments to the command

Implements CommandBase.

37  {
40  std::shared_ptr<Client> client = wm->getClient(event.subwindow);
41  if (client) {
42  LayoutManager * lm = wm->getActiveGroup()->getLayoutManager().get();
43  TreeLayoutManager * tlm = dynamic_cast<TreeLayoutManager *>(lm);
44  if (tlm) {
45  tlm->growSpace(client.get(), event.inc);
46  }
47  }
48 }
static DeserializedXKeyEvent deserializeXKeyEvent(const std::string &serializedEvent)
Definition: Grow.cpp:50
LayoutManager class Interface for the layout managers.
Definition: LayoutManager.hpp:42
TreeLayoutManager class this class is a subclass of LayoutManager it handles the tree style layout Wh...
Definition: TreeLayoutManager.hpp:44
void growSpace(Client *client, int inc)
grow the space of the client in the x axis
Definition: TreeLayoutManager.cpp:165
WindowManager class This class is responsible for managing the windows.in an X11 session....
Definition: WindowManager.hpp:59
std::shared_ptr< Client > getClient(Window window)
Get the Client by window ptr or frame ptr.
Definition: WindowManager.cpp:251
std::shared_ptr< Group > getActiveGroup() const
get the current Active Group
Definition: WindowManager.cpp:272
static WindowManager * getInstance()
Get the WindowManager instance this is a singleton class this function returns the instance of the Wi...
Definition: WindowManager.cpp:244

References deserializeXKeyEvent(), WindowManager::getActiveGroup(), WindowManager::getClient(), WindowManager::getInstance(), and TreeLayoutManager::growSpace().

Here is the call graph for this function:

The documentation for this class was generated from the following files: