diff options
| author | Michael Biebl <biebl@debian.org> | 2026-07-03 19:53:23 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2026-07-03 19:53:23 +0200 |
| commit | aa308069bebf2d5a3200728caa69a76137c03d8b (patch) | |
| tree | c0ba2281e801c4720a0d8a5e5ee943688234f088 /src/nmtui/nmt-utils.h | |
| parent | 0a4b2c29da4ccf259bbcea3298d15abebb94348f (diff) | |
| parent | 537bfce2bda471c92caabd388589230200891509 (diff) | |
Update upstream source from tag 'upstream/1.58_rc1'
Update to upstream version '1.58~rc1' with Debian dir 451489c9234e2b6b7c2f41ca6670287ea3ac3efd
Diffstat (limited to 'src/nmtui/nmt-utils.h')
| -rw-r--r-- | src/nmtui/nmt-utils.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/nmtui/nmt-utils.h b/src/nmtui/nmt-utils.h index 3b780ae7..79058c0d 100644 --- a/src/nmtui/nmt-utils.h +++ b/src/nmtui/nmt-utils.h @@ -6,6 +6,8 @@ #ifndef NMT_UTILS_H #define NMT_UTILS_H +#include "libnmt-newt/nmt-newt-types.h" + typedef struct { gpointer private[3]; } NmtSyncOp; @@ -18,4 +20,37 @@ void nmt_sync_op_complete_boolean(NmtSyncOp *op, gboolean result, GError *er gpointer nmt_sync_op_wait_pointer(NmtSyncOp *op, GError **error); void nmt_sync_op_complete_pointer(NmtSyncOp *op, gpointer result, GError *error); +gboolean nmt_utils_filter_match(const char *haystack, const char *needle); + +#define NMT_SEARCH_ENTRY_WIDTH 34 + +/** + * NmtSearch: + * + * Vim-style '/' search glue shared by the connection lists. The caller builds + * the @label and @entry into its own layout and hands them over; NmtSearch + * wires '/' to reveal the entry, Enter to confirm, Esc to clear, keeps the + * status label in sync, and pins the form width so the list does not jump. + * + * @apply is invoked with the current text whenever the filter changes; @count + * returns the live match count for the label. + */ +typedef struct _NmtSearch NmtSearch; + +typedef void (*NmtSearchApplyFunc)(gpointer user_data, const char *text); +typedef int (*NmtSearchCountFunc)(gpointer user_data); + +NmtSearch *nmt_search_new(NmtNewtEntry *entry, + NmtNewtLabel *label, + NmtNewtWidget *focus, + NmtSearchApplyFunc apply, + NmtSearchCountFunc count, + gpointer user_data); + +void nmt_search_bind_form(NmtSearch *search, NmtNewtForm *form); +void nmt_search_update_label(NmtSearch *search); + +GVariant * +nmt_sync_get_secrets(NMRemoteConnection *connection, const char *setting_name, GError **error); + #endif /* NMT_UTILS_H */ |