normalize file headers across **/*.{h,c}
This commit is contained in:
parent
8660ae4e12
commit
726f2a1e5a
|
@ -2,13 +2,10 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
* i3-config-wizard: Program to convert configs using keycodes to configs using
|
* i3-config-wizard: Program to convert configs using keycodes to configs using
|
||||||
* keysyms.
|
* keysyms.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <ev.h>
|
#include <ev.h>
|
||||||
|
|
|
@ -2,13 +2,10 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
* i3-input/main.c: Utility which lets the user input commands and sends them
|
* i3-input/main.c: Utility which lets the user input commands and sends them
|
||||||
* to i3.
|
* to i3.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <ev.h>
|
#include <ev.h>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009 Michael Stapelberg and contributors
|
* ucs2_to_utf8.c: Converts between UCS-2 and UTF-8, both of which are used in
|
||||||
*
|
* different contexts in X11.
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -14,6 +14,8 @@
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
|
||||||
|
#include "libi3.h"
|
||||||
|
|
||||||
static iconv_t conversion_descriptor = 0;
|
static iconv_t conversion_descriptor = 0;
|
||||||
static iconv_t conversion_descriptor2 = 0;
|
static iconv_t conversion_descriptor2 = 0;
|
||||||
|
|
||||||
|
@ -23,37 +25,33 @@ static iconv_t conversion_descriptor2 = 0;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *convert_ucs_to_utf8(char *input) {
|
char *convert_ucs_to_utf8(char *input) {
|
||||||
size_t input_size = 2;
|
size_t input_size = 2;
|
||||||
/* UTF-8 may consume up to 4 byte */
|
/* UTF-8 may consume up to 4 byte */
|
||||||
int buffer_size = 8;
|
int buffer_size = 8;
|
||||||
|
|
||||||
char *buffer = calloc(buffer_size, 1);
|
char *buffer = scalloc(buffer_size);
|
||||||
if (buffer == NULL)
|
size_t output_size = buffer_size;
|
||||||
err(EXIT_FAILURE, "malloc() failed\n");
|
/* We need to use an additional pointer, because iconv() modifies it */
|
||||||
size_t output_size = buffer_size;
|
char *output = buffer;
|
||||||
/* We need to use an additional pointer, because iconv() modifies it */
|
|
||||||
char *output = buffer;
|
|
||||||
|
|
||||||
/* We convert the input into UCS-2 big endian */
|
/* We convert the input into UCS-2 big endian */
|
||||||
if (conversion_descriptor == 0) {
|
if (conversion_descriptor == 0) {
|
||||||
conversion_descriptor = iconv_open("UTF-8", "UCS-2BE");
|
conversion_descriptor = iconv_open("UTF-8", "UCS-2BE");
|
||||||
if (conversion_descriptor == 0) {
|
if (conversion_descriptor == 0)
|
||||||
fprintf(stderr, "error opening the conversion context\n");
|
errx(EXIT_FAILURE, "Error opening the conversion context");
|
||||||
exit(1);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the conversion descriptor back to original state */
|
/* Get the conversion descriptor back to original state */
|
||||||
iconv(conversion_descriptor, NULL, NULL, NULL, NULL);
|
iconv(conversion_descriptor, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
/* Convert our text */
|
/* Convert our text */
|
||||||
int rc = iconv(conversion_descriptor, (void*)&input, &input_size, &output, &output_size);
|
int rc = iconv(conversion_descriptor, (void*)&input, &input_size, &output, &output_size);
|
||||||
if (rc == (size_t)-1) {
|
if (rc == (size_t)-1) {
|
||||||
perror("Converting to UCS-2 failed");
|
perror("Converting to UCS-2 failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -64,41 +62,37 @@ char *convert_ucs_to_utf8(char *input) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *convert_utf8_to_ucs2(char *input, int *real_strlen) {
|
char *convert_utf8_to_ucs2(char *input, int *real_strlen) {
|
||||||
size_t input_size = strlen(input) + 1;
|
size_t input_size = strlen(input) + 1;
|
||||||
/* UCS-2 consumes exactly two bytes for each glyph */
|
/* UCS-2 consumes exactly two bytes for each glyph */
|
||||||
int buffer_size = input_size * 2;
|
int buffer_size = input_size * 2;
|
||||||
|
|
||||||
char *buffer = malloc(buffer_size);
|
char *buffer = smalloc(buffer_size);
|
||||||
if (buffer == NULL)
|
size_t output_size = buffer_size;
|
||||||
err(EXIT_FAILURE, "malloc() failed\n");
|
/* We need to use an additional pointer, because iconv() modifies it */
|
||||||
size_t output_size = buffer_size;
|
char *output = buffer;
|
||||||
/* We need to use an additional pointer, because iconv() modifies it */
|
|
||||||
char *output = buffer;
|
|
||||||
|
|
||||||
/* We convert the input into UCS-2 big endian */
|
/* We convert the input into UCS-2 big endian */
|
||||||
if (conversion_descriptor2 == 0) {
|
if (conversion_descriptor2 == 0) {
|
||||||
conversion_descriptor2 = iconv_open("UCS-2BE", "UTF-8");
|
conversion_descriptor2 = iconv_open("UCS-2BE", "UTF-8");
|
||||||
if (conversion_descriptor2 == 0) {
|
if (conversion_descriptor2 == 0)
|
||||||
fprintf(stderr, "error opening the conversion context\n");
|
errx(EXIT_FAILURE, "Error opening the conversion context");
|
||||||
exit(1);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the conversion descriptor back to original state */
|
/* Get the conversion descriptor back to original state */
|
||||||
iconv(conversion_descriptor2, NULL, NULL, NULL, NULL);
|
iconv(conversion_descriptor2, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
/* Convert our text */
|
|
||||||
int rc = iconv(conversion_descriptor2, (void*)&input, &input_size, &output, &output_size);
|
|
||||||
if (rc == (size_t)-1) {
|
|
||||||
perror("Converting to UCS-2 failed");
|
|
||||||
if (real_strlen != NULL)
|
|
||||||
*real_strlen = 0;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Convert our text */
|
||||||
|
int rc = iconv(conversion_descriptor2, (void*)&input, &input_size, &output, &output_size);
|
||||||
|
if (rc == (size_t)-1) {
|
||||||
|
perror("Converting to UCS-2 failed");
|
||||||
if (real_strlen != NULL)
|
if (real_strlen != NULL)
|
||||||
*real_strlen = ((buffer_size - output_size) / 2) - 1;
|
*real_strlen = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return buffer;
|
if (real_strlen != NULL)
|
||||||
|
*real_strlen = ((buffer_size - output_size) / 2) - 1;
|
||||||
|
|
||||||
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2010 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
* i3-msg/main.c: Utility which sends messages to a running i3-instance using
|
* i3-msg/main.c: Utility which sends messages to a running i3-instance using
|
||||||
* IPC via UNIX domain sockets.
|
* IPC via UNIX domain sockets.
|
||||||
|
|
|
@ -2,12 +2,10 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
* i3-nagbar is a utility which displays a nag message, for example in the case
|
||||||
*
|
* when the user has an error in his configuration file.
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
|
||||||
* i3-nagbar is a utility which displays a nag message.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <ev.h>
|
#include <ev.h>
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* child.c: Getting Input for the statusline
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef CHILD_H_
|
#ifndef CHILD_H_
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
*
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef COMMON_H_
|
#ifndef COMMON_H_
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* config.c: Parses the configuration (received from i3).
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef CONFIG_H_
|
#ifndef CONFIG_H_
|
||||||
#define CONFIG_H_
|
#define CONFIG_H_
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* ipc.c: Communicating with i3
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef IPC_H_
|
#ifndef IPC_H_
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* outputs.c: Maintaining the output-list
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef OUTPUTS_H_
|
#ifndef OUTPUTS_H_
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
*
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef TRAYCLIENT_H_
|
#ifndef TRAYCLIENT_H_
|
||||||
|
|
|
@ -1 +1,15 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* ucs2_to_utf8.c: Converts between UCS-2 and UTF-8, both of which are used in
|
||||||
|
* different contexts in X11.
|
||||||
|
*/
|
||||||
|
#ifndef _UCS2_TO_UTF8
|
||||||
|
#define _UCS2_TO_UTF8
|
||||||
|
|
||||||
char *convert_utf8_to_ucs2(char *input, int *real_strlen);
|
char *convert_utf8_to_ucs2(char *input, int *real_strlen);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef UTIL_H_
|
#ifndef UTIL_H_
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* workspaces.c: Maintaining the workspace-lists
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef WORKSPACES_H_
|
#ifndef WORKSPACES_H_
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* xcb.c: Communicating with X
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef XCB_H_
|
#ifndef XCB_H_
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* child.c: Getting Input for the statusline
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
|
||||||
* src/child.c: Getting Input for the statusline
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* config.c: Parses the configuration (received from i3).
|
||||||
*
|
|
||||||
* See file LICENSE for license information
|
|
||||||
*
|
|
||||||
* src/outputs.c: Maintaining the output-list
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* ipc.c: Communicating with i3
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
|
||||||
* src/ipc.c: Communicating with i3
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
*
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* outputs.c: Maintaining the output-list
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
|
||||||
* src/outputs.c: Maintaining the output-list
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009 Michael Stapelberg and contributors
|
* ucs2_to_utf8.c: Converts between UCS-2 and UTF-8, both of which are used in
|
||||||
*
|
* different contexts in X11.
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -25,35 +24,35 @@ static iconv_t conversion_descriptor2 = 0;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *convert_ucs_to_utf8(char *input) {
|
char *convert_ucs_to_utf8(char *input) {
|
||||||
size_t input_size = 2;
|
size_t input_size = 2;
|
||||||
/* UTF-8 may consume up to 4 byte */
|
/* UTF-8 may consume up to 4 byte */
|
||||||
int buffer_size = 8;
|
int buffer_size = 8;
|
||||||
|
|
||||||
char *buffer = scalloc(buffer_size);
|
char *buffer = scalloc(buffer_size);
|
||||||
size_t output_size = buffer_size;
|
size_t output_size = buffer_size;
|
||||||
/* We need to use an additional pointer, because iconv() modifies it */
|
/* We need to use an additional pointer, because iconv() modifies it */
|
||||||
char *output = buffer;
|
char *output = buffer;
|
||||||
|
|
||||||
/* We convert the input into UCS-2 big endian */
|
/* We convert the input into UCS-2 big endian */
|
||||||
|
if (conversion_descriptor == 0) {
|
||||||
|
conversion_descriptor = iconv_open("UTF-8", "UCS-2BE");
|
||||||
if (conversion_descriptor == 0) {
|
if (conversion_descriptor == 0) {
|
||||||
conversion_descriptor = iconv_open("UTF-8", "UCS-2BE");
|
fprintf(stderr, "error opening the conversion context\n");
|
||||||
if (conversion_descriptor == 0) {
|
exit(1);
|
||||||
fprintf(stderr, "error opening the conversion context\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the conversion descriptor back to original state */
|
/* Get the conversion descriptor back to original state */
|
||||||
iconv(conversion_descriptor, NULL, NULL, NULL, NULL);
|
iconv(conversion_descriptor, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
/* Convert our text */
|
/* Convert our text */
|
||||||
int rc = iconv(conversion_descriptor, (void*)&input, &input_size, &output, &output_size);
|
int rc = iconv(conversion_descriptor, (void*)&input, &input_size, &output, &output_size);
|
||||||
if (rc == (size_t)-1) {
|
if (rc == (size_t)-1) {
|
||||||
perror("Converting to UCS-2 failed");
|
perror("Converting to UCS-2 failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -64,38 +63,38 @@ char *convert_ucs_to_utf8(char *input) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *convert_utf8_to_ucs2(char *input, int *real_strlen) {
|
char *convert_utf8_to_ucs2(char *input, int *real_strlen) {
|
||||||
size_t input_size = strlen(input) + 1;
|
size_t input_size = strlen(input) + 1;
|
||||||
/* UCS-2 consumes exactly two bytes for each glyph */
|
/* UCS-2 consumes exactly two bytes for each glyph */
|
||||||
int buffer_size = input_size * 2;
|
int buffer_size = input_size * 2;
|
||||||
|
|
||||||
char *buffer = smalloc(buffer_size);
|
char *buffer = smalloc(buffer_size);
|
||||||
size_t output_size = buffer_size;
|
size_t output_size = buffer_size;
|
||||||
/* We need to use an additional pointer, because iconv() modifies it */
|
/* We need to use an additional pointer, because iconv() modifies it */
|
||||||
char *output = buffer;
|
char *output = buffer;
|
||||||
|
|
||||||
/* We convert the input into UCS-2 big endian */
|
/* We convert the input into UCS-2 big endian */
|
||||||
|
if (conversion_descriptor2 == 0) {
|
||||||
|
conversion_descriptor2 = iconv_open("UCS-2BE", "UTF-8");
|
||||||
if (conversion_descriptor2 == 0) {
|
if (conversion_descriptor2 == 0) {
|
||||||
conversion_descriptor2 = iconv_open("UCS-2BE", "UTF-8");
|
fprintf(stderr, "error opening the conversion context\n");
|
||||||
if (conversion_descriptor2 == 0) {
|
exit(1);
|
||||||
fprintf(stderr, "error opening the conversion context\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the conversion descriptor back to original state */
|
/* Get the conversion descriptor back to original state */
|
||||||
iconv(conversion_descriptor2, NULL, NULL, NULL, NULL);
|
iconv(conversion_descriptor2, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
/* Convert our text */
|
|
||||||
int rc = iconv(conversion_descriptor2, (void*)&input, &input_size, &output, &output_size);
|
|
||||||
if (rc == (size_t)-1) {
|
|
||||||
perror("Converting to UCS-2 failed");
|
|
||||||
if (real_strlen != NULL)
|
|
||||||
*real_strlen = 0;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Convert our text */
|
||||||
|
int rc = iconv(conversion_descriptor2, (void*)&input, &input_size, &output, &output_size);
|
||||||
|
if (rc == (size_t)-1) {
|
||||||
|
perror("Converting to UCS-2 failed");
|
||||||
if (real_strlen != NULL)
|
if (real_strlen != NULL)
|
||||||
*real_strlen = ((buffer_size - output_size) / 2) - 1;
|
*real_strlen = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return buffer;
|
if (real_strlen != NULL)
|
||||||
|
*real_strlen = ((buffer_size - output_size) / 2) - 1;
|
||||||
|
|
||||||
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* workspaces.c: Maintaining the workspace-lists
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
|
||||||
* src/workspaces.c: Maintaining the workspace-lists
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3bar - an xcb-based status- and ws-bar for i3
|
* i3bar - an xcb-based status- and ws-bar for i3
|
||||||
|
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2010-2011 Axel Wagner and contributors
|
* xcb.c: Communicating with X
|
||||||
*
|
|
||||||
* See file LICNSE for license information
|
|
||||||
*
|
|
||||||
* src/xcb.c: Communicating with X
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
/*
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
* This header file includes all relevant files of i3 and the most often used
|
* This header file includes all relevant files of i3 and the most often used
|
||||||
* system header files. This reduces boilerplate (the amount of code duplicated
|
* system header files. This reduces boilerplate (the amount of code duplicated
|
||||||
* at the beginning of each source file) and is not significantly slower at
|
* at the beginning of each source file) and is not significantly slower at
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* assignments.c: Assignments for specific windows (for_window).
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _ASSIGNMENTS_H
|
#ifndef _ASSIGNMENTS_H
|
||||||
#define _ASSIGNMENTS_H
|
#define _ASSIGNMENTS_H
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
* click.c: Button press (mouse click) events.
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _CLICK_H
|
#ifndef _CLICK_H
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* cmdparse.y: the parser for commands you send to i3 (or bind on keys)
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef _CMDPARSE_H
|
#ifndef _CMDPARSE_H
|
||||||
#define _CMDPARSE_H
|
#define _CMDPARSE_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* con.c: Functions which deal with containers directly (creating containers,
|
||||||
|
* searching containers, getting specific properties from containers,
|
||||||
|
* …).
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef _CON_H
|
#ifndef _CON_H
|
||||||
#define _CON_H
|
#define _CON_H
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
* include/config.h: Contains all structs/variables for the configurable
|
* include/config.h: Contains all structs/variables for the configurable
|
||||||
* part of i3 as well as functions handling the configuration file (calling
|
* part of i3 as well as functions handling the configuration file (calling
|
||||||
|
@ -13,7 +10,6 @@
|
||||||
* mode).
|
* mode).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CONFIG_H
|
#ifndef _CONFIG_H
|
||||||
#define _CONFIG_H
|
#define _CONFIG_H
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
* include/data.h: This file defines all data structures used by i3
|
* include/data.h: This file defines all data structures used by i3
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _DATA_H
|
#ifndef _DATA_H
|
||||||
#define _DATA_H
|
#define _DATA_H
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* (c) 2009 Michael Stapelberg and contributors
|
* debug.c: Debugging functions, especially FormatEvent, which prints unhandled
|
||||||
*
|
* events. This code is from xcb-util.
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _DEBUG_H
|
#ifndef _DEBUG_H
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009 Michael Stapelberg and contributors
|
* ewmh.c: Get/set certain EWMH properties easily.
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _EWMH_C
|
#ifndef _EWMH_C
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
* floating.c: Floating windows.
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _FLOATING_H
|
#ifndef _FLOATING_H
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
* handlers.c: Small handlers for various events (keypresses, focus changes,
|
||||||
*
|
* …).
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _HANDLERS_H
|
#ifndef _HANDLERS_H
|
||||||
|
|
11
include/i3.h
11
include/i3.h
|
@ -2,12 +2,14 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009 Michael Stapelberg and contributors
|
* i3.h: global variables that are used all over i3.
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#ifndef _I3_H
|
||||||
|
#define _I3_H
|
||||||
|
|
||||||
#include <xcb/xcb_keysyms.h>
|
#include <xcb/xcb_keysyms.h>
|
||||||
|
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
@ -19,9 +21,6 @@
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "xcb.h"
|
#include "xcb.h"
|
||||||
|
|
||||||
#ifndef _I3_H
|
|
||||||
#define _I3_H
|
|
||||||
|
|
||||||
extern xcb_connection_t *conn;
|
extern xcb_connection_t *conn;
|
||||||
extern int conn_screen;
|
extern int conn_screen;
|
||||||
/** The last timestamp we got from X11 (timestamps are included in some events
|
/** The last timestamp we got from X11 (timestamps are included in some events
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2010 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
* This public header defines the different constants and message types to use
|
* This public header defines the different constants and message types to use
|
||||||
* for the IPC interface to i3 (see docs/ipc for more information).
|
* for the IPC interface to i3 (see docs/ipc for more information).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _I3_IPC_H
|
#ifndef _I3_IPC_H
|
||||||
#define _I3_IPC_H
|
#define _I3_IPC_H
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
* ipc.c: UNIX domain socket IPC (initialization, client handling, protocol).
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IPC_H
|
#ifndef _IPC_H
|
||||||
#define _IPC_H
|
#define _IPC_H
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* libi3: contains functions which are used by i3 *and* accompanying tools such
|
||||||
|
* as i3-msg, i3-config-wizard, …
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _LIBI3_H
|
#ifndef _LIBI3_H
|
||||||
#define _LIBI3_H
|
#define _LIBI3_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* load_layout.c: Restore (parts of) the layout, for example after an inplace
|
||||||
|
* restart.
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef _LOAD_LAYOUT_H
|
#ifndef _LOAD_LAYOUT_H
|
||||||
#define _LOAD_LAYOUT_H
|
#define _LOAD_LAYOUT_H
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
* log.c: Setting of loglevels, logging functions.
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _LOG_H
|
#ifndef _LOG_H
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009 Michael Stapelberg and contributors
|
* manage.c: Initially managing new windows (or existing ones on restart).
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "data.h"
|
|
||||||
|
|
||||||
#ifndef _MANAGE_H
|
#ifndef _MANAGE_H
|
||||||
#define _MANAGE_H
|
#define _MANAGE_H
|
||||||
|
|
||||||
|
#include "data.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Go through all existing windows (if the window manager is restarted) and
|
* Go through all existing windows (if the window manager is restarted) and
|
||||||
* manage them
|
* manage them
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* A "match" is a data structure which acts like a mask or expression to match
|
||||||
|
* certain windows or not. For example, when using commands, you can specify a
|
||||||
|
* command like this: [title="*Firefox*"] kill. The title member of the match
|
||||||
|
* data structure will then be filled and i3 will check each window using
|
||||||
|
* match_matches_window() to find the windows affected by this command.
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef _MATCH_H
|
#ifndef _MATCH_H
|
||||||
#define _MATCH_H
|
#define _MATCH_H
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* move.c: Moving containers into some direction.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _MOVE_H
|
#ifndef _MOVE_H
|
||||||
#define _MOVE_H
|
#define _MOVE_H
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* output.c: Output (monitor) related functions.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _OUTPUT_H
|
#ifndef _OUTPUT_H
|
||||||
#define _OUTPUT_H
|
#define _OUTPUT_H
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
* For more information on RandR, please see the X.org RandR specification at
|
||||||
*
|
* http://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt
|
||||||
* See file LICENSE for license information.
|
* (take your time to read it completely, it answers all questions).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "data.h"
|
|
||||||
#include <xcb/randr.h>
|
|
||||||
|
|
||||||
#ifndef _RANDR_H
|
#ifndef _RANDR_H
|
||||||
#define _RANDR_H
|
#define _RANDR_H
|
||||||
|
|
||||||
|
#include "data.h"
|
||||||
|
#include <xcb/randr.h>
|
||||||
|
|
||||||
TAILQ_HEAD(outputs_head, xoutput);
|
TAILQ_HEAD(outputs_head, xoutput);
|
||||||
extern struct outputs_head outputs;
|
extern struct outputs_head outputs;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* regex.c: Interface to libPCRE (perl compatible regular expressions).
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _REGEX_H
|
#ifndef _REGEX_H
|
||||||
#define _REGEX_H
|
#define _REGEX_H
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* render.c: Renders (determines position/sizes) the layout tree, updating the
|
||||||
|
* various rects. Needs to be pushed to X11 (see x.c) to be visible.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _RENDER_H
|
#ifndef _RENDER_H
|
||||||
#define _RENDER_H
|
#define _RENDER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* resize.c: Interactive resizing.
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef _RESIZE_H
|
#ifndef _RESIZE_H
|
||||||
#define _RESIZE_H
|
#define _RESIZE_H
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
|
||||||
* © 2009-2010 Jan-Erik Rediger
|
* © 2009-2010 Jan-Erik Rediger
|
||||||
*
|
*
|
||||||
* See file LICENSE for license information.
|
* sighandler.c: Interactive crash dialog upon SIGSEGV/SIGABRT/SIGFPE (offers
|
||||||
|
* to restart inplace).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _SIGHANDLER_H
|
#ifndef _SIGHANDLER_H
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
* startup.c: Startup notification code. Ensures a startup notification context
|
||||||
*
|
* is setup when launching applications. We store the current
|
||||||
* See file LICENSE for license information.
|
* workspace to open windows in that startup notification context on
|
||||||
|
* the appropriate workspace.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _STARTUP_H
|
#ifndef _STARTUP_H
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* tree.c: Everything that primarily modifies the layout tree data structure.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _TREE_H
|
#ifndef _TREE_H
|
||||||
#define _TREE_H
|
#define _TREE_H
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009 Michael Stapelberg and contributors
|
* util.c: Utility functions, which can be useful everywhere within i3 (see
|
||||||
*
|
* also libi3).
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#ifndef _UTIL_H
|
||||||
|
#define _UTIL_H
|
||||||
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
|
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
|
|
||||||
#ifndef _UTIL_H
|
|
||||||
#define _UTIL_H
|
|
||||||
|
|
||||||
#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
|
#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
|
||||||
#define exit_if_null(pointer, ...) { if (pointer == NULL) die(__VA_ARGS__); }
|
#define exit_if_null(pointer, ...) { if (pointer == NULL) die(__VA_ARGS__); }
|
||||||
#define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0)
|
#define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0)
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* window.c: Updates window attributes (X11 hints/properties).
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef _WINDOW_H
|
#ifndef _WINDOW_H
|
||||||
#define _WINDOW_H
|
#define _WINDOW_H
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,20 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
* workspace.c: Modifying workspaces, accessing them, moving containers to
|
||||||
*
|
* workspaces.
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#ifndef _WORKSPACE_H
|
||||||
|
#define _WORKSPACE_H
|
||||||
|
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
#include "randr.h"
|
#include "randr.h"
|
||||||
|
|
||||||
#ifndef _WORKSPACE_H
|
|
||||||
#define _WORKSPACE_H
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a pointer to the workspace with the given number (starting at 0),
|
* Returns a pointer to the workspace with the given number (starting at 0),
|
||||||
* creating the workspace if necessary (by allocating the necessary amount of
|
* creating the workspace if necessary (by allocating the necessary amount of
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* x.c: Interface to X11, transfers our in-memory state to X11 (see also
|
||||||
|
* render.c). Basically a big state machine.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _X_H
|
#ifndef _X_H
|
||||||
#define _X_H
|
#define _X_H
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
* xcb.c: Helper functions for easier usage of XCB
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _XCB_H
|
#ifndef _XCB_H
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* xcb_compat.h: uses #define to create aliases for xcb functions which got
|
||||||
|
* renamed. Makes the code work with >= 0.3.8 xcb-util and
|
||||||
|
* older versions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
#ifndef _XCB_COMPAT_H
|
#ifndef _XCB_COMPAT_H
|
||||||
#define _XCB_COMPAT_H
|
#define _XCB_COMPAT_H
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
|
*
|
||||||
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
|
*
|
||||||
|
* xcursor.c: libXcursor support for themed cursors.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef _XCURSOR_CURSOR_H
|
#ifndef _XCURSOR_CURSOR_H
|
||||||
#define _XCURSOR_CURSOR_H
|
#define _XCURSOR_CURSOR_H
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* vim:ts=8:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
*
|
*
|
||||||
* © 2009-2010 Michael Stapelberg and contributors
|
* This is LEGACY code (we support RandR, which can do much more than
|
||||||
*
|
* Xinerama), but necessary for the poor users of the nVidia binary
|
||||||
* See file LICENSE for license information.
|
* driver which does not support RandR in 2011 *sigh*.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "data.h"
|
|
||||||
|
|
||||||
#ifndef _XINERAMA_H
|
#ifndef _XINERAMA_H
|
||||||
#define _XINERAMA_H
|
#define _XINERAMA_H
|
||||||
|
|
||||||
|
#include "data.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We have just established a connection to the X server and need the initial
|
* We have just established a connection to the X server and need the initial
|
||||||
* Xinerama information to setup workspaces for each screen.
|
* Xinerama information to setup workspaces for each screen.
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
* vim:ts=4:sw=4:expandtab
|
* vim:ts=4:sw=4:expandtab
|
||||||
*
|
*
|
||||||
* i3 - an improved dynamic tiling window manager
|
* i3 - an improved dynamic tiling window manager
|
||||||
*
|
* © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
|
||||||
* © 2009-2011 Michael Stapelberg and contributors
|
|
||||||
*
|
|
||||||
* See file LICENSE for license information.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
*
|
*
|
||||||
* cmdparse.y: the parser for commands you send to i3 (or bind on keys)
|
* cmdparse.y: the parser for commands you send to i3 (or bind on keys)
|
||||||
*
|
*
|
||||||
|
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
Loading…
Reference in New Issue