mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
Compare commits
10 commits
5fdebedcd9
...
c9030dcc5b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9030dcc5b | ||
|
|
26bd02d457 | ||
|
|
1692c47fa0 | ||
|
|
bdc8e1c546 | ||
|
|
ee87b4fc30 | ||
|
|
34e52a40c7 | ||
|
|
139a5f0383 | ||
|
|
0bf2678f9d | ||
|
|
6bbdc3c6dc | ||
|
|
7a5b7aa378 |
22 changed files with 23 additions and 121 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -168,6 +168,7 @@ jobs:
|
|||
meson setup build-gcc-release -Dxwayland=enabled \
|
||||
-Dbuildtype=release -Db_ndebug=true --werror
|
||||
meson configure build-gcc-release -Dwlroots:b_ndebug=false || true
|
||||
meson configure build-gcc-release -Dlibsfdo:b_ndebug=false || true
|
||||
meson compile -C build-gcc-release
|
||||
' | $TARGET
|
||||
|
||||
|
|
@ -190,6 +191,7 @@ jobs:
|
|||
meson setup build-clang-release -Dxwayland=enabled \
|
||||
-Dbuildtype=release -Db_ndebug=true --werror
|
||||
meson configure build-clang-release -Dwlroots:b_ndebug=false || true
|
||||
meson configure build-clang-release -Dlibsfdo:b_ndebug=false || true
|
||||
meson compile -C build-clang-release
|
||||
' | $TARGET
|
||||
|
||||
|
|
|
|||
|
|
@ -15,15 +15,6 @@ bool string_null_or_empty(const char *s);
|
|||
*/
|
||||
bool str_space_only(const char *s);
|
||||
|
||||
/**
|
||||
* trim_last_field() - Trim last field of string splitting on provided delim
|
||||
* @buf: string to trim
|
||||
* @delim: delimitator
|
||||
*
|
||||
* Example: With delim='_' and buf="foo_bar_baz" the return value is "foo_bar"
|
||||
*/
|
||||
void trim_last_field(char *buf, char delim);
|
||||
|
||||
/**
|
||||
* string_strip - strip white space left and right
|
||||
* Note: this function does a left skip, so the returning pointer cannot be
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ void lab_xml_expand_dotted_attributes(xmlNode *root);
|
|||
/* Returns true if the node only contains a string or is empty */
|
||||
bool lab_xml_node_is_leaf(xmlNode *node);
|
||||
|
||||
bool lab_xml_get_node(xmlNode *node, const char *key, xmlNode **dst_node);
|
||||
bool lab_xml_get_string(xmlNode *node, const char *key, char *s, size_t len);
|
||||
bool lab_xml_get_int(xmlNode *node, const char *key, int *i);
|
||||
bool lab_xml_get_bool(xmlNode *node, const char *key, bool *b);
|
||||
|
|
|
|||
|
|
@ -71,11 +71,12 @@ struct rcxml {
|
|||
enum tearing_mode allow_tearing;
|
||||
bool auto_enable_outputs;
|
||||
bool reuse_output_mode;
|
||||
enum lab_placement_policy placement_policy;
|
||||
bool xwayland_persistence;
|
||||
bool primary_selection;
|
||||
char *prompt_command;
|
||||
|
||||
/* placement */
|
||||
enum lab_placement_policy placement_policy;
|
||||
int placement_cascade_offset_x;
|
||||
int placement_cascade_offset_y;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,5 @@ void key_state_store_pressed_key_as_bound(uint32_t keycode);
|
|||
bool key_state_corresponding_press_event_was_bound(uint32_t keycode);
|
||||
void key_state_bound_key_remove(uint32_t keycode);
|
||||
int key_state_nr_bound_keys(void);
|
||||
int key_state_nr_pressed_keys(void);
|
||||
|
||||
#endif /* LABWC_KEY_STATE_H */
|
||||
|
|
|
|||
|
|
@ -7,13 +7,6 @@
|
|||
#include "common/set.h"
|
||||
#include "input/cursor.h"
|
||||
#include "overlay.h"
|
||||
#if HAVE_NLS
|
||||
#include <libintl.h>
|
||||
#include <locale.h>
|
||||
#define _ gettext
|
||||
#else
|
||||
#define _(s) (s)
|
||||
#endif
|
||||
|
||||
#define XCURSOR_DEFAULT "left_ptr"
|
||||
#define XCURSOR_SIZE 24
|
||||
|
|
|
|||
|
|
@ -100,18 +100,6 @@ void menu_open_root(struct menu *menu, int x, int y);
|
|||
*/
|
||||
void menu_process_cursor_motion(struct wlr_scene_node *node);
|
||||
|
||||
/**
|
||||
* menu_call_actions - call actions associated with a menu node
|
||||
*
|
||||
* If menuitem connected to @node does not just open a submenu:
|
||||
* - associated actions will be called
|
||||
* - server->menu_current will be closed
|
||||
* - server->menu_current will be set to NULL
|
||||
*
|
||||
* Returns true if actions have actually been executed
|
||||
*/
|
||||
bool menu_call_actions(struct wlr_scene_node *node);
|
||||
|
||||
/**
|
||||
* menu_close_root- close root menu
|
||||
*
|
||||
|
|
|
|||
|
|
@ -45,13 +45,6 @@ struct view *node_view_from_node(struct wlr_scene_node *wlr_scene_node);
|
|||
struct lab_layer_surface *node_layer_surface_from_node(
|
||||
struct wlr_scene_node *wlr_scene_node);
|
||||
|
||||
/**
|
||||
* node_layer_popup_from_node - return lab_layer_popup struct from node
|
||||
* @wlr_scene_node: wlr_scene_node from which to return data
|
||||
*/
|
||||
struct lab_layer_popup *node_layer_popup_from_node(
|
||||
struct wlr_scene_node *wlr_scene_node);
|
||||
|
||||
/**
|
||||
* node_menuitem_from_node - return menuitem struct from node
|
||||
* @wlr_scene_node: wlr_scene_node from which to return data
|
||||
|
|
|
|||
|
|
@ -70,11 +70,4 @@ void handle_output_power_manager_set_mode(struct wl_listener *listener,
|
|||
void *data);
|
||||
void output_enable_adaptive_sync(struct output *output, bool enabled);
|
||||
|
||||
/**
|
||||
* output_max_scale() - get maximum scale factor of all usable outputs.
|
||||
* Used when loading/rendering resources (e.g. icons) that may be
|
||||
* displayed on any output.
|
||||
*/
|
||||
float output_max_scale(struct server *server);
|
||||
|
||||
#endif // LABWC_OUTPUT_H
|
||||
|
|
|
|||
|
|
@ -73,12 +73,4 @@ void scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text
|
|||
int max_width, struct font *font, const float *color,
|
||||
const float *bg_color);
|
||||
|
||||
/**
|
||||
* Update the max width of an existing auto scaling font buffer
|
||||
* and force a new render.
|
||||
*
|
||||
* No steps are taken to detect if its actually required to render a new buffer.
|
||||
*/
|
||||
void scaled_font_buffer_set_max_width(struct scaled_font_buffer *self, int max_width);
|
||||
|
||||
#endif /* LABWC_SCALED_FONT_BUFFER_H */
|
||||
|
|
|
|||
14
include/translate.h
Normal file
14
include/translate.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef LABWC_TRANSLATE_H
|
||||
#define LABWC_TRANSLATE_H
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_NLS
|
||||
#include <libintl.h>
|
||||
#include <locale.h>
|
||||
#define _ gettext
|
||||
#else
|
||||
#define _(s) (s)
|
||||
#endif
|
||||
|
||||
#endif /* LABWC_TRANSLATE_H */
|
||||
|
|
@ -5,8 +5,8 @@
|
|||
#include <wlr/util/log.h>
|
||||
#include "action.h"
|
||||
#include "common/buf.h"
|
||||
#include "labwc.h" /* for gettext */
|
||||
#include "theme.h"
|
||||
#include "translate.h"
|
||||
|
||||
enum {
|
||||
LAB_PROMPT_NONE = 0,
|
||||
|
|
|
|||
|
|
@ -20,15 +20,6 @@ string_null_or_empty(const char *s)
|
|||
return !s || !*s;
|
||||
}
|
||||
|
||||
void
|
||||
trim_last_field(char *buf, char delim)
|
||||
{
|
||||
char *p = strrchr(buf, delim);
|
||||
if (p) {
|
||||
*p = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
rtrim(char *s)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -164,12 +164,6 @@ get_node(xmlNode *node, const char *key, xmlNode **dst_node, bool leaf_only)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
lab_xml_get_node(xmlNode *node, const char *key, xmlNode **dst_node)
|
||||
{
|
||||
return get_node(node, key, dst_node, /* leaf_only */ false);
|
||||
}
|
||||
|
||||
bool
|
||||
lab_xml_get_string(xmlNode *node, const char *key, char *s, size_t len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "osd.h"
|
||||
#include "regions.h"
|
||||
#include "ssd.h"
|
||||
#include "translate.h"
|
||||
#include "view.h"
|
||||
#include "window-rules.h"
|
||||
#include "workspaces.h"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include "desktop-entry.h"
|
||||
#include <locale.h>
|
||||
#include <sfdo-desktop.h>
|
||||
#include <sfdo-icon.h>
|
||||
#include <sfdo-basedir.h>
|
||||
|
|
|
|||
|
|
@ -84,9 +84,3 @@ key_state_nr_bound_keys(void)
|
|||
{
|
||||
return bound.size;
|
||||
}
|
||||
|
||||
int
|
||||
key_state_nr_pressed_keys(void)
|
||||
{
|
||||
return pressed.size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "config/session.h"
|
||||
#include "labwc.h"
|
||||
#include "theme.h"
|
||||
#include "translate.h"
|
||||
#include "menu/menu.h"
|
||||
|
||||
struct rcxml rc = { 0 };
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "scaled-buffer/scaled-font-buffer.h"
|
||||
#include "scaled-buffer/scaled-icon-buffer.h"
|
||||
#include "theme.h"
|
||||
#include "translate.h"
|
||||
#include "view.h"
|
||||
#include "workspaces.h"
|
||||
|
||||
|
|
@ -1544,15 +1545,6 @@ menu_process_cursor_motion(struct wlr_scene_node *node)
|
|||
menu_process_item_selection(item);
|
||||
}
|
||||
|
||||
bool
|
||||
menu_call_actions(struct wlr_scene_node *node)
|
||||
{
|
||||
assert(node && node->data);
|
||||
struct menuitem *item = node_menuitem_from_node(node);
|
||||
|
||||
return menu_execute_item(item);
|
||||
}
|
||||
|
||||
void
|
||||
menu_close_root(struct server *server)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,15 +50,6 @@ node_layer_surface_from_node(struct wlr_scene_node *wlr_scene_node)
|
|||
return (struct lab_layer_surface *)node_descriptor->data;
|
||||
}
|
||||
|
||||
struct lab_layer_popup *
|
||||
node_layer_popup_from_node(struct wlr_scene_node *wlr_scene_node)
|
||||
{
|
||||
assert(wlr_scene_node->data);
|
||||
struct node_descriptor *node_descriptor = wlr_scene_node->data;
|
||||
assert(node_descriptor->type == LAB_NODE_LAYER_POPUP);
|
||||
return (struct lab_layer_popup *)node_descriptor->data;
|
||||
}
|
||||
|
||||
struct menuitem *
|
||||
node_menuitem_from_node(struct wlr_scene_node *wlr_scene_node)
|
||||
{
|
||||
|
|
|
|||
14
src/output.c
14
src/output.c
|
|
@ -1142,17 +1142,3 @@ output_enable_adaptive_sync(struct output *output, bool enabled)
|
|||
enabled ? "en" : "dis", output->wlr_output->name);
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
output_max_scale(struct server *server)
|
||||
{
|
||||
/* Never return less than 1, in case outputs are disabled */
|
||||
float scale = 1;
|
||||
struct output *output;
|
||||
wl_list_for_each(output, &server->outputs, link) {
|
||||
if (output_is_usable(output)) {
|
||||
scale = MAX(scale, output->wlr_output->scale);
|
||||
}
|
||||
}
|
||||
return scale;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,17 +139,3 @@ scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text,
|
|||
scaled_buffer_request_update(self->scaled_buffer,
|
||||
self->width, self->height);
|
||||
}
|
||||
|
||||
void
|
||||
scaled_font_buffer_set_max_width(struct scaled_font_buffer *self, int max_width)
|
||||
{
|
||||
self->max_width = max_width;
|
||||
|
||||
int computed_height;
|
||||
font_get_buffer_size(self->max_width, self->text, &self->font,
|
||||
&self->width, &computed_height);
|
||||
self->height = (self->fixed_height > 0) ?
|
||||
self->fixed_height : computed_height;
|
||||
scaled_buffer_request_update(self->scaled_buffer,
|
||||
self->width, self->height);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue