ssd: Move implementation details from ssd.h to ssd-internal.h

- Move private structs and functions to `ssd-internal.h`
- Add `ssd_button_get_type()` and `ssd_button_get_view()`
This commit is contained in:
John Lindgren 2022-11-26 16:53:35 -05:00 committed by Johan Malm
parent 1e8b0414fe
commit b67eccc99a
8 changed files with 166 additions and 140 deletions

View file

@ -352,8 +352,8 @@ get_cursor_context(struct server *server)
struct ssd_button *button =
node_ssd_button_from_node(node);
ret.node = node;
ret.type = button->type;
ret.view = button->view;
ret.type = ssd_button_get_type(button);
ret.view = ssd_button_get_view(button);
return ret;
}
case LAB_NODE_DESC_LAYER_SURFACE:

View file

@ -10,7 +10,7 @@
#include "common/mem.h"
#include "common/scene-helpers.h"
#include "labwc.h"
#include "ssd.h"
#include "ssd-internal.h"
#include "theme.h"
#include "view.h"
@ -286,6 +286,18 @@ ssd_hover_state_new(void)
return znew(struct ssd_hover_state);
}
enum ssd_part_type
ssd_button_get_type(const struct ssd_button *button)
{
return button ? button->type : LAB_SSD_NONE;
}
struct view *
ssd_button_get_view(const struct ssd_button *button)
{
return button ? button->view : NULL;
}
bool
ssd_debug_is_root_node(const struct ssd *ssd, struct wlr_scene_node *node)
{

View file

@ -2,7 +2,7 @@
#include "common/scene-helpers.h"
#include "labwc.h"
#include "ssd.h"
#include "ssd-internal.h"
#include "theme.h"
#include "view.h"

View file

@ -3,7 +3,7 @@
#include "common/mem.h"
#include "common/scene-helpers.h"
#include "labwc.h"
#include "ssd.h"
#include "ssd-internal.h"
#include "theme.h"
#include "view.h"

View file

@ -5,7 +5,7 @@
#include "common/mem.h"
#include "labwc.h"
#include "node.h"
#include "ssd.h"
#include "ssd-internal.h"
/* Internal helpers */
static void

View file

@ -9,7 +9,7 @@
#include "common/scene-helpers.h"
#include "labwc.h"
#include "node.h"
#include "ssd.h"
#include "ssd-internal.h"
#include "theme.h"
#include "view.h"