include: Break out view.h from labwc.h

IMHO it encourages better design (by making dependencies more obvious)
to have source file/header file pairs like view.c/view.h, rather than a
monolithic header like labwc.h with everything in it.

I don't think we need to break up all of labwc.h at once, but maybe we
can start pulling it apart bit by bit as it's convenient.

Also:

- Move "struct border" to ssd.h so that view.h can use it without pulling
  in all of labwc.h.
- Add a missing required #include within scaled_font_buffer.h (forward
  declaration of "struct font" is not enough).
This commit is contained in:
John Lindgren 2022-11-21 10:10:39 -05:00 committed by Johan Malm
parent 9021020f6e
commit f08e931a29
25 changed files with 194 additions and 165 deletions

View file

@ -14,6 +14,7 @@
#include "menu/menu.h"
#include "private/action.h"
#include "ssd.h"
#include "view.h"
#include "workspaces.h"
enum action_type {

View file

@ -14,6 +14,7 @@
#include "menu/menu.h"
#include "resistance.h"
#include "ssd.h"
#include "view.h"
static const char * const *cursor_names = NULL;

View file

@ -1,10 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_scene.h>
#include "buffer.h"
#include "common/scene-helpers.h"
#include "labwc.h"
#include "node.h"
#include "common/scene-helpers.h"
#include "view.h"
#define HEADER_CHARS "------------------------------"

View file

@ -5,9 +5,9 @@
#include "common/scene-helpers.h"
#include "dnd.h"
#include "labwc.h"
#include "layers.h"
#include "node.h"
#include "ssd.h"
#include "view.h"
#include "workspaces.h"
static void

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "labwc.h"
#include "view.h"
#include "workspaces.h"
static void

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "labwc.h"
#include "view.h"
static int
max_move_scale(double pos_cursor, double pos_current,

View file

@ -14,6 +14,7 @@
#include "labwc.h"
#include "theme.h"
#include "node.h"
#include "view.h"
#include "workspaces.h"
#define OSD_ITEM_HEIGHT (20)

View file

@ -19,6 +19,7 @@
#include "labwc.h"
#include "layers.h"
#include "node.h"
#include "view.h"
static void
output_frame_notify(struct wl_listener *listener, void *data)

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "labwc.h"
#include "config/rcxml.h"
#include "labwc.h"
#include "view.h"
struct edges {
int left;

View file

@ -18,6 +18,7 @@
#include "menu/menu.h"
#include "ssd.h"
#include "theme.h"
#include "view.h"
#include "workspaces.h"
#define LAB_XDG_SHELL_VERSION (2)

View file

@ -7,12 +7,11 @@
*/
#include <assert.h>
#include "config/rcxml.h"
#include "common/font.h"
#include "labwc.h"
#include "theme.h"
#include "ssd.h"
#include "common/scene-helpers.h"
#include "labwc.h"
#include "ssd.h"
#include "theme.h"
#include "view.h"
struct border
ssd_thickness(struct view *view)

View file

@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "common/scene-helpers.h"
#include "labwc.h"
#include "ssd.h"
#include "theme.h"
#include "common/scene-helpers.h"
#include "view.h"
#define FOR_EACH_STATE(view, tmp) FOR_EACH(tmp, \
&(view)->ssd.border.active, \

View file

@ -1,10 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "common/mem.h"
#include "common/scene-helpers.h"
#include "labwc.h"
#include "ssd.h"
#include "theme.h"
#include "common/mem.h"
#include "common/scene-helpers.h"
#include "view.h"
static struct ssd_part *
add_extent(struct wl_list *part_list, enum ssd_part_type type,

View file

@ -3,14 +3,14 @@
#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <string.h>
#include "labwc.h"
#include "ssd.h"
#include "theme.h"
#include "common/font.h"
#include "common/mem.h"
#include "common/scaled_font_buffer.h"
#include "common/scene-helpers.h"
#include "labwc.h"
#include "node.h"
#include "ssd.h"
#include "theme.h"
#include "view.h"
#define FOR_EACH_STATE(view, tmp) FOR_EACH(tmp, \
&(view)->ssd.titlebar.active, \

View file

@ -3,6 +3,7 @@
#include <stdio.h>
#include <strings.h>
#include "labwc.h"
#include "view.h"
void
view_impl_map(struct view *view)

View file

@ -7,6 +7,7 @@
#include "labwc.h"
#include "ssd.h"
#include "menu/menu.h"
#include "view.h"
#include "workspaces.h"
#define LAB_FALLBACK_WIDTH 640

View file

@ -12,6 +12,7 @@
#include "common/list.h"
#include "common/mem.h"
#include "labwc.h"
#include "view.h"
#include "workspaces.h"
/* Internal helpers */

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "common/mem.h"
#include "labwc.h"
#include "view.h"
struct xdg_deco {
struct wlr_xdg_toplevel_decoration_v1 *wlr_decoration;

View file

@ -10,6 +10,7 @@
#include "common/mem.h"
#include "labwc.h"
#include "node.h"
#include "view.h"
struct xdg_popup {
struct view *parent_view;

View file

@ -4,6 +4,7 @@
#include "labwc.h"
#include "node.h"
#include "ssd.h"
#include "view.h"
#include "workspaces.h"
static void

View file

@ -4,6 +4,7 @@
#include "labwc.h"
#include "node.h"
#include "ssd.h"
#include "view.h"
#include "workspaces.h"
static void