summaryrefslogtreecommitdiff
path: root/source4/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'source4/gtk')
-rw-r--r--source4/gtk/common/gtk_events.c11
-rw-r--r--source4/gtk/config.m42
-rw-r--r--source4/gtk/config.mk11
3 files changed, 15 insertions, 9 deletions
diff --git a/source4/gtk/common/gtk_events.c b/source4/gtk/common/gtk_events.c
index 67467b87a7..45e1031093 100644
--- a/source4/gtk/common/gtk_events.c
+++ b/source4/gtk/common/gtk_events.c
@@ -43,7 +43,7 @@ static int gtk_event_context_destructor(struct event_context *ev)
/*
create a gtk_event_context structure.
*/
-static int gtk_event_context_init(struct event_context *ev, void *private_data)
+static int gtk_event_context_init(struct event_context *ev)
{
talloc_set_destructor(ev, gtk_event_context_destructor);
return 0;
@@ -339,16 +339,13 @@ static const struct event_ops gtk_event_ops = {
.loop_wait = gtk_event_loop_wait,
};
-const struct event_ops *gtk_event_get_ops(void)
-{
- return &gtk_event_ops;
-}
-
int gtk_event_loop(void)
{
int ret;
- gtk_event_context_global = event_context_init_ops(NULL, &gtk_event_ops, NULL);
+ event_register_backend("gtk", &gtk_event_ops);
+
+ gtk_event_context_global = event_context_init_byname(NULL, "gtk");
if (!gtk_event_context_global) return -1;
ret = event_loop_wait(gtk_event_context_global);
diff --git a/source4/gtk/config.m4 b/source4/gtk/config.m4
index aef24f5a74..4e23593c67 100644
--- a/source4/gtk/config.m4
+++ b/source4/gtk/config.m4
@@ -7,6 +7,7 @@ SMB_ENABLE(gwcrontab, NO)
SMB_ENABLE(gwsam, NO)
SMB_ENABLE(gepdump, NO)
SMB_ENABLE(gwsvcctl, NO)
+SMB_ENABLE(EVENTS_GTK, NO)
if test t$SMB_ENABLE_gtk = tYES; then
SMB_ENABLE(gtksamba, YES)
@@ -15,5 +16,6 @@ if test t$SMB_ENABLE_gtk = tYES; then
SMB_ENABLE(gwsam, YES)
SMB_ENABLE(gwsvcctl, YES)
SMB_ENABLE(gepdump, YES)
+ SMB_ENABLE(EVENTS_GTK, YES)
AC_DEFINE(HAVE_GTK, 1, [Whether GTK+ is available])
fi
diff --git a/source4/gtk/config.mk b/source4/gtk/config.mk
index 56b4392d22..51b9b0febd 100644
--- a/source4/gtk/config.mk
+++ b/source4/gtk/config.mk
@@ -1,5 +1,13 @@
# LIB GTK SMB subsystem
+##############################
+[MODULE::EVENTS_GTK]
+OBJ_FILES = common/gtk_events.o
+SUBSYSTEM = gtksamba
+INIT_FUNCTION = events_gtk_init
+PRIVATE_DEPENDENCIES = gtk
+##############################
+
[LIBRARY::gtksamba]
VERSION = 0.0.1
SO_VERSION = 0
@@ -7,9 +15,8 @@ DESCRIPTION = Common Samba-related widgets for GTK+ applications
PUBLIC_HEADERS = common/gtk-smb.h common/select.h
OBJ_FILES = common/gtk-smb.o \
common/select.o \
- common/gtk_events.o \
common/credentials.o
-PRIVATE_DEPENDENCIES = CHARSET LIBSAMBA-UTIL gtk RPC_NDR_SAMR
+PRIVATE_DEPENDENCIES = CHARSET LIBSAMBA-UTIL gtk RPC_NDR_SAMR EVENTS_GTK
[BINARY::gregedit]
INSTALLDIR = BINDIR