You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/i3ipc++/ipc.hpp
+57Lines changed: 57 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,7 @@ struct version_t {
67
67
uint32_t patch; /**< Patch number of i3 */
68
68
};
69
69
70
+
70
71
/**
71
72
* Types of the events of i3
72
73
*/
@@ -102,6 +103,56 @@ enum class WindowEventType : char {
102
103
URGENT = 'u', /**< Window became urgent */
103
104
};
104
105
106
+
107
+
/**
108
+
* A style of a container's border
109
+
*/
110
+
enumclassBorderStyle : char {
111
+
UNKNOWN = '?', //< If got an unknown border style in reply
112
+
NONE = 'N',
113
+
NORMAL = 'n',
114
+
ONE_PIXEL = '1',
115
+
};
116
+
117
+
118
+
/**
119
+
* A type of a container's layout
120
+
*/
121
+
enumclassContainerLayout : char {
122
+
UNKNOWN = '?', //< If got an unknown border style in reply
123
+
SPLIT_H = 'h',
124
+
SPLIT_V = 'v',
125
+
STACKED = 's',
126
+
TABBED = 't',
127
+
DOCKAREA = 'd',
128
+
OUTPUT = 'o',
129
+
};
130
+
131
+
132
+
/**
133
+
* A node of tree of windows
134
+
*/
135
+
structcontainer_t {
136
+
uint64_t id; ///< The internal ID (actually a C pointer value) of this container. Do not make any assumptions about it. You can use it to (re-)identify and address containers when talking to i3
137
+
uint64_t xwindow_id; ///< The X11 window ID of the actual client window inside this container. This field is set to null for split containers or otherwise empty containers. This ID corresponds to what xwininfo(1) and other X11-related tools display (usually in hex)
138
+
std::string name; ///< The internal name of this container. For all containers which are part of the tree structure down to the workspace contents, this is set to a nice human-readable name of the container. For containers that have an X11 window, the content is the title (_NET_WM_NAME property) of that window. For all other containers, the content is not defined (yet)
139
+
std::string type; ///< Type of this container
140
+
BorderStyle border; ///< A style of the container's border
141
+
std::string border_raw; ///< A "border" field of TREE reply. NOT empty only if border equals BorderStyle::UNKNOWN
142
+
uint32_t current_border_width; ///< Number of pixels of the border width
143
+
ContainerLayout layout; ///< A type of the container's layout
144
+
std::string layout_raw; ///< A "layout" field of TREE reply. NOT empty only if layout equals ContainerLayout::UNKNOWN
145
+
float percent; ///< The percentage which this container takes in its parent. A value of < 0 means that the percent property does not make sense for this container, for example for the root container.
146
+
rect_t rect; ///< The absolute display coordinates for this container
147
+
rect_t window_rect; ///< The coordinates of the actual client window inside its container. These coordinates are relative to the container and do not include the window decoration (which is actually rendered on the parent container)
148
+
rect_t deco_rect; ///< The coordinates of the window decoration inside its container. These coordinates are relative to the container and do not include the actual client window
149
+
rect_t geometry; ///< The original geometry the window specified when i3 mapped it. Used when switching a window to floating mode, for example
I3IPC_WARN("Got a unknown \"border\" property: \"" << border << "\". Perhaps its neccessary to update i3ipc++. If you are using latest, note maintainer about this")
256
+
}
257
+
258
+
container->layout = ContainerLayout::UNKNOWN;
259
+
std::string layout = o["layout"].asString();
260
+
261
+
if (layout == "splith") {
262
+
container->layout = ContainerLayout::SPLIT_H;
263
+
} elseif (layout == "splitv") {
264
+
container->layout = ContainerLayout::SPLIT_V;
265
+
} elseif (layout == "stacked") {
266
+
container->layout = ContainerLayout::STACKED;
267
+
} elseif (layout == "tabbed") {
268
+
container->layout = ContainerLayout::TABBED;
269
+
} elseif (layout == "dockarea") {
270
+
container->layout = ContainerLayout::DOCKAREA;
271
+
} elseif (layout == "output") {
272
+
container->layout = ContainerLayout::OUTPUT;
273
+
} else {
274
+
container->layout_raw = border;
275
+
I3IPC_WARN("Got a unknown \"layout\" property: \"" << layout << "\". Perhaps its neccessary to update i3ipc++. If you are using latest, note maintainer about this")
276
+
}
277
+
278
+
Json::Value nodes = o["nodes"];
279
+
if (!nodes.isNull()) {
280
+
IPC_JSON_ASSERT_TYPE_ARRAY(nodes, "nodes")
281
+
for (Json::ArrayIndex i = 0; i < nodes.size(); i++) {
0 commit comments