mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-17 20:34:08 -05:00
New classes for gtk-tool
This commit is contained in:
parent
055ede483b
commit
9c975d34b4
4 changed files with 45 additions and 0 deletions
18
contrib/gtk-tool/Gtk_LdapTree.cc
Normal file
18
contrib/gtk-tool/Gtk_LdapTree.cc
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <Gtk_LdapTree.h>
|
||||
|
||||
void Gtk_LdapTree::show_impl() {
|
||||
cout << "tree show" << endl;
|
||||
Gtk_LdapTree *tree;
|
||||
Gtk_LdapTreeItem *item;
|
||||
Gtk_LdapTree::selectioniterator i;
|
||||
debug("iterator\n");
|
||||
for (i=this->begin(); i!=this->end();i++) {
|
||||
item = (Gtk_LdapTreeItem *)GTK_TREE_ITEM((*i));
|
||||
debug("#%s#\n", item->dn);
|
||||
tree = item->getSubtree(item->ld, 1);
|
||||
if (tree != NULL) item->set_subtree(*tree);
|
||||
}
|
||||
debug("done\n");
|
||||
Gtk_c_signals_Tree *sig=(Gtk_c_signals_Tree *)internal_getsignalbase();
|
||||
sig->show(GTK_WIDGET(gtkobj()));
|
||||
}
|
||||
10
contrib/gtk-tool/Gtk_LdapTree.h
Normal file
10
contrib/gtk-tool/Gtk_LdapTree.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef GTK_LDAP_TREE_H
|
||||
#define GTK_LDAP_TREE_H
|
||||
#include <gtk--/tree.h>
|
||||
#include "utils.h"
|
||||
#include <Gtk_LdapTreeItem.h>
|
||||
|
||||
class Gtk_LdapTree : public Gtk_Tree {
|
||||
void show_impl();
|
||||
};
|
||||
#endif
|
||||
13
contrib/gtk-tool/utils.cc
Normal file
13
contrib/gtk-tool/utils.cc
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int debug(const char *format,...) {
|
||||
#ifdef DEBUG
|
||||
va_list args;
|
||||
int ret;
|
||||
va_start(args, format);
|
||||
ret = vprintf(format, args);
|
||||
va_end(args);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
4
contrib/gtk-tool/utils.h
Normal file
4
contrib/gtk-tool/utils.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef MY_UTIL_H
|
||||
#define MY_UTIL_H
|
||||
int debug(const char *format,...);
|
||||
#endif /* MY_UTIL_H */
|
||||
Loading…
Reference in a new issue