summaryrefslogtreecommitdiff
path: root/source4/gtk
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-01-05 09:35:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:36:50 -0500
commitb213b70c089046f426e1e3f2f733e42a02e2cbfe (patch)
treea7f76bc62aa974810e691ad1715cc5900bba09ed /source4/gtk
parent9698b2c2821986fdf2bb66dc4a52b2d50fbea151 (diff)
downloadsamba-b213b70c089046f426e1e3f2f733e42a02e2cbfe.tar.gz
samba-b213b70c089046f426e1e3f2f733e42a02e2cbfe.tar.bz2
samba-b213b70c089046f426e1e3f2f733e42a02e2cbfe.zip
r20539: - split the common timer related events code into events_timed.c
- make it easier to plug in a new events backend - add simpler 'select' and 'epoll' backends This is part of the effort to add good AIO support. The events_aio.c backend is done, but sometimes dies with a SEGV, which is why it isn't enabled yet. (This used to be commit 934f18283dbc7958944931a93a854526bcd54884)
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