Add ssd.h

This commit is contained in:
Johan Malm 2021-03-21 20:54:55 +00:00
parent 4127643cc1
commit fc76100fd5
9 changed files with 35 additions and 20 deletions

View file

@ -145,19 +145,6 @@ enum view_type {
#endif
};
enum ssd_part {
LAB_SSD_NONE = 0,
LAB_SSD_BUTTON_CLOSE,
LAB_SSD_BUTTON_MAXIMIZE,
LAB_SSD_BUTTON_ICONIFY,
LAB_SSD_PART_TITLE,
LAB_SSD_PART_TOP,
LAB_SSD_PART_RIGHT,
LAB_SSD_PART_BOTTOM,
LAB_SSD_PART_LEFT,
LAB_SSD_END_MARKER
};
struct view_impl {
void (*configure)(struct view *view, struct wlr_box geo);
void (*close)(struct view *view);
@ -345,11 +332,6 @@ void server_init(struct server *server);
void server_start(struct server *server);
void server_finish(struct server *server);
struct border ssd_thickness(struct view *view);
struct wlr_box ssd_max_extents(struct view *view);
struct wlr_box ssd_box(struct view *view, enum ssd_part ssd_part);
enum ssd_part ssd_at(struct view *view, double lx, double ly);
void action(struct server *server, const char *action, const char *command);
void dbg_show_one_view(struct view *view);

24
include/ssd.h Normal file
View file

@ -0,0 +1,24 @@
#ifndef __LABWC_SSD_H
#define __LABWC_SSD_H
enum ssd_part {
LAB_SSD_NONE = 0,
LAB_SSD_BUTTON_CLOSE,
LAB_SSD_BUTTON_MAXIMIZE,
LAB_SSD_BUTTON_ICONIFY,
LAB_SSD_PART_TITLE,
LAB_SSD_PART_TOP,
LAB_SSD_PART_RIGHT,
LAB_SSD_PART_BOTTOM,
LAB_SSD_PART_LEFT,
LAB_SSD_END_MARKER
};
struct view;
struct border ssd_thickness(struct view *view);
struct wlr_box ssd_max_extents(struct view *view);
struct wlr_box ssd_box(struct view *view, enum ssd_part ssd_part);
enum ssd_part ssd_at(struct view *view, double lx, double ly);
#endif /* __LABWC_SSD_H */

View file

@ -1,6 +1,7 @@
#include <assert.h>
#include "labwc.h"
#include "menu/menu.h"
#include "ssd.h"
#define RESIZE_BORDER_WIDTH 2

View file

@ -1,6 +1,7 @@
#include "config.h"
#include <assert.h>
#include "labwc.h"
#include "ssd.h"
static void
move_to_front(struct view *view)

View file

@ -13,6 +13,7 @@
#include "labwc.h"
#include "layers.h"
#include "menu/menu.h"
#include "ssd.h"
#include "theme.h"
//#define DEBUG 1

View file

@ -1,12 +1,13 @@
/*
* Helpers for handling window decorations
* Helpers for view server side decorations
*
* Copyright Johan Malm 2020
* Copyright (C) 2020 Johan Malm
*/
#include <assert.h>
#include "config/rcxml.h"
#include "labwc.h"
#include "ssd.h"
#define BORDER_WIDTH (2)
@ -107,3 +108,5 @@ ssd_at(struct view *view, double lx, double ly)
}
return LAB_SSD_NONE;
}

View file

@ -1,5 +1,6 @@
#include <stdio.h>
#include "labwc.h"
#include "ssd.h"
void
view_move_resize(struct view *view, struct wlr_box geo)

View file

@ -1,5 +1,6 @@
#include <assert.h>
#include "labwc.h"
#include "ssd.h"
/*
* xdg_popup_create() and subsurface_create() are only called for the

View file

@ -1,5 +1,6 @@
#include <assert.h>
#include "labwc.h"
#include "ssd.h"
static void
handle_commit(struct wl_listener *listener, void *data)