source: vendor/current/source3/utils/regedit_treeview.h

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 3.3 KB
Line 
1/*
2 * Samba Unix/Linux SMB client library
3 * Registry Editor
4 * Copyright (C) Christopher Davis 2012
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef _REGEDIT_TREEVIEW_H_
21#define _REGEDIT_TREEVIEW_H_
22
23#include "includes.h"
24#include <ncurses.h>
25#include <panel.h>
26
27struct registry_key;
28
29struct tree_node {
30
31 char *name;
32 struct registry_key *key;
33
34 struct tree_node *parent;
35 struct tree_node *child_head;
36 struct tree_node *previous;
37 struct tree_node *next;
38};
39
40struct multilist;
41
42struct tree_view {
43
44 struct tree_node *root;
45 WINDOW *window;
46 WINDOW *sub;
47 PANEL *panel;
48 struct multilist *list;
49};
50
51struct registry_context;
52
53struct tree_node *tree_node_new(TALLOC_CTX *ctx, struct tree_node *parent,
54 const char *name, struct registry_key *key);
55struct tree_node *tree_node_new_root(TALLOC_CTX *ctx,
56 struct registry_context *regctx);
57#define tree_node_is_root(node) ((node)->key == NULL)
58#define tree_node_is_top_level(node) tree_node_is_root((node)->parent)
59void tree_node_append(struct tree_node *left, struct tree_node *right);
60struct tree_node *tree_node_pop(struct tree_node **plist);
61struct tree_node *tree_node_first(struct tree_node *list);
62struct tree_node *tree_node_last(struct tree_node *list);
63bool tree_node_next(struct tree_node **node, bool depth, WERROR *err);
64bool tree_node_prev(struct tree_node **node, bool depth, WERROR *err);
65void tree_node_append_last(struct tree_node *list, struct tree_node *node);
66size_t tree_node_print_path(WINDOW *label, struct tree_node *node);
67const char **tree_node_get_path(TALLOC_CTX *ctx, struct tree_node *node);
68struct tree_view *tree_view_new(TALLOC_CTX *ctx, struct tree_node *root,
69 int nlines, int ncols,
70 int begin_y, int begin_x);
71void tree_view_set_selected(struct tree_view *view, bool select);
72void tree_view_resize(struct tree_view *view, int nlines, int ncols,
73 int begin_y, int begin_x);
74void tree_view_show(struct tree_view *view);
75void tree_view_clear(struct tree_view *view);
76WERROR tree_view_set_root(struct tree_view *view, struct tree_node *root);
77WERROR tree_view_set_path(struct tree_view *view, const char **path);
78WERROR tree_view_update(struct tree_view *view, struct tree_node *list);
79WERROR tree_node_reopen_key(struct registry_context *ctx,
80 struct tree_node *node);
81bool tree_node_has_children(struct tree_node *node);
82WERROR tree_node_load_children(struct tree_node *node);
83void tree_node_insert_sorted(struct tree_node *list, struct tree_node *node);
84bool tree_view_is_node_visible(struct tree_view *view, struct tree_node *node);
85void tree_view_set_current_node(struct tree_view *view, struct tree_node *node);
86struct tree_node *tree_view_get_current_node(struct tree_view *view);
87void tree_view_driver(struct tree_view *view, int c);
88
89#endif
Note: See TracBrowser for help on using the repository browser.