first step of the big refactoring ("tree" branch).

From here on, we can track changes. It made no sense to put the
development up to this point into git.
This commit is contained in:
Michael Stapelberg
2010-03-27 15:25:51 +01:00
parent 41b6631f68
commit c145f7e529
48 changed files with 2583 additions and 1270 deletions

View File

@ -11,14 +11,15 @@
#ifndef _FLOATING_H
#define _FLOATING_H
#include "tree.h"
/** Callback for dragging */
typedef void(*callback_t)(xcb_connection_t*, Client*, Rect*, uint32_t, uint32_t, void*);
typedef void(*callback_t)(Con*, Rect*, uint32_t, uint32_t, void*);
/** Macro to create a callback function for dragging */
#define DRAGGING_CB(name) \
static void name(xcb_connection_t *conn, Client *client, \
Rect *old_rect, uint32_t new_x, uint32_t new_y, \
void *extra)
static void name(Con *con, Rect *old_rect, uint32_t new_x, \
uint32_t new_y, void *extra)
/** On which border was the dragging initiated? */
typedef enum { BORDER_LEFT = (1 << 0),
@ -36,9 +37,9 @@ typedef enum { BORDER_LEFT = (1 << 0),
* the user.
*
*/
void toggle_floating_mode(xcb_connection_t *conn, Client *client,
bool automatic);
void toggle_floating_mode(Con *con, bool automatic);
#if 0
/**
* Removes the floating client from its workspace and attaches it to the new
* workspace. This is centralized here because it may happen if you move it
@ -56,13 +57,14 @@ void floating_assign_to_workspace(Client *client, Workspace *new_workspace);
int floating_border_click(xcb_connection_t *conn, Client *client,
xcb_button_press_event_t *event);
#endif
/**
* Called when the user clicked on the titlebar of a floating window.
* Calls the drag_pointer function with the drag_window callback
*
*/
void floating_drag_window(xcb_connection_t *conn, Client *client,
xcb_button_press_event_t *event);
void floating_drag_window(Con *con, xcb_button_press_event_t *event);
#if 0
/**
* Called when the user clicked on a floating window while holding the
@ -97,6 +99,7 @@ void floating_move(xcb_connection_t *conn, Client *currently_focused,
*/
void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace);
#endif
/**
* This function grabs your pointer and lets you drag stuff around (borders).
* Every time you move your mouse, an XCB_MOTION_NOTIFY event will be received
@ -105,7 +108,7 @@ void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace);
* the event and the new coordinates (x, y).
*
*/
void drag_pointer(xcb_connection_t *conn, Client *client, xcb_button_press_event_t *event,
void drag_pointer(Con *con, xcb_button_press_event_t *event,
xcb_window_t confine_to, border_t border, callback_t callback,
void *extra);