howm
howm
scratchpad.c File Reference

The stack implementation and appropriate functions required for sending clients (or groups of clients) to the scratchpad. More...

#include <stdlib.h>
#include <xcb/xcb.h>
#include <xcb/xproto.h>
#include "scratchpad.h"
#include "client.h"
#include "helper.h"
#include "howm.h"

Functions

void stack_init (struct stack *s)
 Dynamically allocate space for the contents of the stack. More...
 
void stack_free (struct stack *s)
 Free the allocated contents. More...
 
void stack_push (struct stack *s, client_t *c)
 Pushes a client onto the stack, as long as it isn't full. More...
 
client_tstack_pop (struct stack *s)
 Remove the top item from the stack and return it. More...
 
void send_to_scratchpad (void)
 Send a client to the scratchpad and unmap it. More...
 
void get_from_scratchpad (void)
 Get a client from the scratchpad, attach it as the last item in the client list and set it to float. More...
 

Variables

struct stack del_reg
 
static client_tscratchpad
 

Detailed Description

The stack implementation and appropriate functions required for sending clients (or groups of clients) to the scratchpad.

Author
Harvey Hunt
Date
2015

Function Documentation

void stack_free ( struct stack s)

Free the allocated contents.

Parameters
sThe stack that needs to have its contents freed.
void stack_init ( struct stack s)

Dynamically allocate space for the contents of the stack.

We don't know how big the stack will be when the struct is defined, so we need to allocate it dynamically.

Parameters
sThe stack that needs to have its contents allocated.
client_t* stack_pop ( struct stack s)

Remove the top item from the stack and return it.

Parameters
sThe stack to be popped from.
Returns
The client that was at the top of the stack. It acts as the head of the linked list of clients.
void stack_push ( struct stack s,
client_t c 
)

Pushes a client onto the stack, as long as it isn't full.

Parameters
sThe stack.
cThe client to be pushed on. This client is treated as the head of a linked list.

Variable Documentation

struct stack del_reg
client_t* scratchpad
static