From c73219f23613756f81f45dca0898c75134afcc5f Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Fri, 3 Dec 2021 10:58:54 -0300 Subject: [PATCH] Adding required macos sources. --- src/dialogs/macos/select.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/selection/macos/copy.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/selection/macos/paste.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/terminal/macos/init.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/terminal/macos/iosource.c | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 713 insertions(+), 0 deletions(-) create mode 100644 src/dialogs/macos/select.c create mode 100644 src/selection/macos/copy.c create mode 100644 src/selection/macos/paste.c create mode 100644 src/terminal/macos/init.c create mode 100644 src/terminal/macos/iosource.c diff --git a/src/dialogs/macos/select.c b/src/dialogs/macos/select.c new file mode 100644 index 0000000..4a2f0ac --- /dev/null +++ b/src/dialogs/macos/select.c @@ -0,0 +1,96 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob + * o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + +#include "../private.h" +#include + +/*--[ Implement ]------------------------------------------------------------------------------------*/ + +gchar * v3270_select_file(GtkWidget *widget, const gchar *title, const gchar *button, GtkFileChooserAction action, const gchar *filename) +{ + gchar *rc = NULL; + +#if GTK_CHECK_VERSION(3,20,0) + + debug("%s action=%d",__FUNCTION__,(int) action); + + GtkFileChooserNative *native = + gtk_file_chooser_native_new + ( + title, + GTK_WINDOW(widget), + action, + button, + _( "_Cancel" ) + ); + + + // Setup filename + if(filename && *filename) + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(native),filename); + + + // Run dialog + if(gtk_native_dialog_run(GTK_NATIVE_DIALOG (native)) == GTK_RESPONSE_ACCEPT) { + rc = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(native)); + } + + g_object_unref(native); + +#else + + debug("%s action=%d",__FUNCTION__,(int) action); + + GtkWidget * chooser = + gtk_file_chooser_dialog_new + ( + title, + GTK_WINDOW(widget), + action, + _("_Cancel" ), GTK_RESPONSE_CANCEL, + button, GTK_RESPONSE_ACCEPT, + NULL + ); + + if(filename && *filename) + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(chooser),filename); + + if(gtk_dialog_run(GTK_DIALOG(chooser)) == GTK_RESPONSE_ACCEPT) { + rc = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser)); + } + + gtk_widget_destroy(chooser); + +#endif // GTK 3.20 + + return rc; + +} + diff --git a/src/selection/macos/copy.c b/src/selection/macos/copy.c new file mode 100644 index 0000000..04f65c8 --- /dev/null +++ b/src/selection/macos/copy.c @@ -0,0 +1,196 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + #include + #include + #include + +/*--[ Implement ]------------------------------------------------------------------------------------*/ + +void v3270_clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GObject *obj) +{ + v3270 * terminal = GTK_V3270(obj); + + if(!lib3270_get_toggle(terminal->host,LIB3270_TOGGLE_KEEP_SELECTED)) + { + v3270_unselect(GTK_WIDGET(obj)); + v3270_clear_selection(terminal); + } + +} + +void v3270_clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionData *selection, guint target, GObject *obj) +{ + v3270 * terminal = GTK_V3270(obj); + + if(!terminal->selection.blocks) + { + return; + } + + switch(target) + { + case CLIPBOARD_TYPE_TEXT: // Get clipboard contents as text + { + g_autofree gchar *text = v3270_get_copy_as_text(terminal,"UTF-8"); + gtk_selection_data_set_text(selection,text,-1); + } + break; + + case CLIPBOARD_TYPE_CSV: + { + g_autofree gchar *text = v3270_get_copy_as_table(terminal,";","UTF-8"); + debug("Selection:\n%s",text); + gtk_selection_data_set( + selection, + gdk_atom_intern_static_string("text/csv"), + 8, + (guchar *) text, + strlen(text) + ); + } + break; + + case CLIPBOARD_TYPE_HTML: + { + g_autofree gchar *text = v3270_get_copy_as_html(terminal,"UTF-8"); + //debug("Selection:\n%s",text); + gtk_selection_data_set( + selection, + gdk_atom_intern_static_string("text/html"), + 8, + (guchar *) text, + strlen(text) + ); + } + break; + + case CLIPBOARD_TYPE_V3270_FORMATTED: + { + g_autofree gchar *data = v3270_get_copy_as_data_block(terminal); + gtk_selection_data_set( + selection, + GTK_V3270_GET_CLASS(obj)->clipboard_formatted, + 8, + (guchar *) data, + ((struct SelectionHeader *) data)->length + ); + } + break; + + case CLIPBOARD_TYPE_PIXBUFF: + { + GdkPixbuf * pixbuff = v3270_get_selection_as_pixbuf(terminal, terminal->selection.blocks, FALSE); + + debug("%s: pixbuff=%p (blocks=%p)",__FUNCTION__,pixbuff,terminal->selection.blocks); + + if(pixbuff) + { + gtk_selection_data_set_pixbuf(selection,pixbuff); + g_object_unref(pixbuff); + } + } + break; + + default: + g_warning("Unexpected clipboard type %d\n",target); + } +} + +void v3270_update_system_clipboard(GtkWidget *widget) +{ + v3270 * terminal = GTK_V3270(widget); + + if(!terminal->selection.blocks) + { + // No clipboard data, return. + v3270_emit_copy_state(widget); + return; + } + + // Has clipboard data, inform system. + GtkClipboard * clipboard = gtk_widget_get_clipboard(widget,terminal->selection.target); + + // Create target list + // + // Reference: https://cpp.hotexamples.com/examples/-/-/g_list_insert_sorted/cpp-g_list_insert_sorted-function-examples.html + // + GtkTargetList * list = gtk_target_list_new(NULL,0); + + gtk_target_list_add_text_targets(list, CLIPBOARD_TYPE_TEXT); + + if((terminal->selection.options & V3270_SELECTION_PLAIN_TEXT) == 0) + { + static const GtkTargetEntry targets[] = { + { "text/csv", 0, CLIPBOARD_TYPE_CSV }, + { "text/html", 0, CLIPBOARD_TYPE_HTML }, + { "application/x-v3270-formatted", 0, CLIPBOARD_TYPE_V3270_FORMATTED }, + }; + + gtk_target_list_add_table(list, targets, G_N_ELEMENTS(targets)); + + } + + if(terminal->selection.options & V3270_SELECTION_PIXBUFF) + { + gtk_target_list_add_image_targets(list,CLIPBOARD_TYPE_PIXBUFF,TRUE); + } + + int n_targets; + GtkTargetEntry * targets = gtk_target_table_new_from_list(list, &n_targets); + +#ifdef DEBUG + { + int ix; + for(ix = 0; ix < n_targets; ix++) { + debug("target(%d)=\"%s\"",ix,targets[ix].target); + } + } +#endif // DEBUG + + if(gtk_clipboard_set_with_owner( + clipboard, + targets, + n_targets, + (GtkClipboardGetFunc) v3270_clipboard_get, + (GtkClipboardClearFunc) v3270_clipboard_clear, + G_OBJECT(widget) + )) + { + gtk_clipboard_set_can_store(clipboard,targets,1); + } + + gtk_target_table_free(targets, n_targets); + gtk_target_list_unref(list); + + v3270_emit_copy_state(widget); + +} + + diff --git a/src/selection/macos/paste.c b/src/selection/macos/paste.c new file mode 100644 index 0000000..04f65c8 --- /dev/null +++ b/src/selection/macos/paste.c @@ -0,0 +1,196 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + #include + #include + #include + +/*--[ Implement ]------------------------------------------------------------------------------------*/ + +void v3270_clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GObject *obj) +{ + v3270 * terminal = GTK_V3270(obj); + + if(!lib3270_get_toggle(terminal->host,LIB3270_TOGGLE_KEEP_SELECTED)) + { + v3270_unselect(GTK_WIDGET(obj)); + v3270_clear_selection(terminal); + } + +} + +void v3270_clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionData *selection, guint target, GObject *obj) +{ + v3270 * terminal = GTK_V3270(obj); + + if(!terminal->selection.blocks) + { + return; + } + + switch(target) + { + case CLIPBOARD_TYPE_TEXT: // Get clipboard contents as text + { + g_autofree gchar *text = v3270_get_copy_as_text(terminal,"UTF-8"); + gtk_selection_data_set_text(selection,text,-1); + } + break; + + case CLIPBOARD_TYPE_CSV: + { + g_autofree gchar *text = v3270_get_copy_as_table(terminal,";","UTF-8"); + debug("Selection:\n%s",text); + gtk_selection_data_set( + selection, + gdk_atom_intern_static_string("text/csv"), + 8, + (guchar *) text, + strlen(text) + ); + } + break; + + case CLIPBOARD_TYPE_HTML: + { + g_autofree gchar *text = v3270_get_copy_as_html(terminal,"UTF-8"); + //debug("Selection:\n%s",text); + gtk_selection_data_set( + selection, + gdk_atom_intern_static_string("text/html"), + 8, + (guchar *) text, + strlen(text) + ); + } + break; + + case CLIPBOARD_TYPE_V3270_FORMATTED: + { + g_autofree gchar *data = v3270_get_copy_as_data_block(terminal); + gtk_selection_data_set( + selection, + GTK_V3270_GET_CLASS(obj)->clipboard_formatted, + 8, + (guchar *) data, + ((struct SelectionHeader *) data)->length + ); + } + break; + + case CLIPBOARD_TYPE_PIXBUFF: + { + GdkPixbuf * pixbuff = v3270_get_selection_as_pixbuf(terminal, terminal->selection.blocks, FALSE); + + debug("%s: pixbuff=%p (blocks=%p)",__FUNCTION__,pixbuff,terminal->selection.blocks); + + if(pixbuff) + { + gtk_selection_data_set_pixbuf(selection,pixbuff); + g_object_unref(pixbuff); + } + } + break; + + default: + g_warning("Unexpected clipboard type %d\n",target); + } +} + +void v3270_update_system_clipboard(GtkWidget *widget) +{ + v3270 * terminal = GTK_V3270(widget); + + if(!terminal->selection.blocks) + { + // No clipboard data, return. + v3270_emit_copy_state(widget); + return; + } + + // Has clipboard data, inform system. + GtkClipboard * clipboard = gtk_widget_get_clipboard(widget,terminal->selection.target); + + // Create target list + // + // Reference: https://cpp.hotexamples.com/examples/-/-/g_list_insert_sorted/cpp-g_list_insert_sorted-function-examples.html + // + GtkTargetList * list = gtk_target_list_new(NULL,0); + + gtk_target_list_add_text_targets(list, CLIPBOARD_TYPE_TEXT); + + if((terminal->selection.options & V3270_SELECTION_PLAIN_TEXT) == 0) + { + static const GtkTargetEntry targets[] = { + { "text/csv", 0, CLIPBOARD_TYPE_CSV }, + { "text/html", 0, CLIPBOARD_TYPE_HTML }, + { "application/x-v3270-formatted", 0, CLIPBOARD_TYPE_V3270_FORMATTED }, + }; + + gtk_target_list_add_table(list, targets, G_N_ELEMENTS(targets)); + + } + + if(terminal->selection.options & V3270_SELECTION_PIXBUFF) + { + gtk_target_list_add_image_targets(list,CLIPBOARD_TYPE_PIXBUFF,TRUE); + } + + int n_targets; + GtkTargetEntry * targets = gtk_target_table_new_from_list(list, &n_targets); + +#ifdef DEBUG + { + int ix; + for(ix = 0; ix < n_targets; ix++) { + debug("target(%d)=\"%s\"",ix,targets[ix].target); + } + } +#endif // DEBUG + + if(gtk_clipboard_set_with_owner( + clipboard, + targets, + n_targets, + (GtkClipboardGetFunc) v3270_clipboard_get, + (GtkClipboardClearFunc) v3270_clipboard_clear, + G_OBJECT(widget) + )) + { + gtk_clipboard_set_can_store(clipboard,targets,1); + } + + gtk_target_table_free(targets, n_targets); + gtk_target_list_unref(list); + + v3270_emit_copy_state(widget); + +} + + diff --git a/src/terminal/macos/init.c b/src/terminal/macos/init.c new file mode 100644 index 0000000..17a0d27 --- /dev/null +++ b/src/terminal/macos/init.c @@ -0,0 +1,56 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + #include + #include + #include + #include + #include + + int libv3270_loaded(void) __attribute__((constructor)); + int libv3270_unloaded(void) __attribute__((destructor)); + +/*---[ Implement ]-----------------------------------------------------------------------------------------*/ + + int libv3270_loaded(void) { + + debug("LocaleDIR(%s)=%s",PACKAGE_NAME,LIB3270_STRINGIZE_VALUE_OF(LOCALEDIR)); + + bindtextdomain(PACKAGE_NAME, LIB3270_STRINGIZE_VALUE_OF(LOCALEDIR)); + bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); + + return 0; + + } + + int libv3270_unloaded(void) { + + return 0; + + } diff --git a/src/terminal/macos/iosource.c b/src/terminal/macos/iosource.c new file mode 100644 index 0000000..b45ec0b --- /dev/null +++ b/src/terminal/macos/iosource.c @@ -0,0 +1,169 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + #include + #include + #include + #include + #include + #include + +/*---[ Structs ]-------------------------------------------------------------------------------------------*/ + + typedef struct _IO_Source + { + GSource gsrc; + GPollFD poll; + gboolean enabled; + int fd; + void (*call)(H3270 *, int, LIB3270_IO_FLAG, void *); + H3270 * session; + void * userdata; + } IO_Source; + +static gboolean IO_prepare(GSource *source, gint *timeout); +static gboolean IO_check(GSource *source); +static gboolean IO_dispatch(GSource *source, GSourceFunc callback, gpointer user_data); +static void IO_finalize(GSource *source); /* Can be NULL */ +static gboolean IO_closure(gpointer data); + +/*---[ Implement ]-----------------------------------------------------------------------------------------*/ + +GSource * IO_source_new(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*call)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata) +{ + static GSourceFuncs IOSources = + { + IO_prepare, + IO_check, + IO_dispatch, + IO_finalize, + IO_closure, + NULL + }; + + IO_Source *src = (IO_Source *) g_source_new(&IOSources,sizeof(IO_Source)); + + src->fd = fd; + src->enabled = TRUE; + src->call = call; + src->userdata = userdata; + src->session = session; + + src->poll.fd = (int) fd; + src->poll.events = G_IO_HUP|G_IO_ERR; + + if(flag & LIB3270_IO_FLAG_READ) + src->poll.events |= G_IO_IN; + + if(flag & LIB3270_IO_FLAG_WRITE) + src->poll.events |= G_IO_OUT; + + IO_source_set_state((GSource *) src, TRUE); + + g_source_attach((GSource *) src,NULL); + g_source_add_poll((GSource *) src, &((IO_Source *)src)->poll); + + return (GSource *) src; +} + +void IO_source_set_state(GSource *source, gboolean enable) +{ + ((IO_Source *)source)->enabled = enable; +} + +gboolean IO_prepare(G_GNUC_UNUSED GSource *source, G_GNUC_UNUSED gint *timeout) +{ + /* + * Called before all the file descriptors are polled. + * If the source can determine that it is ready here + * (without waiting for the results of the poll() call) + * it should return TRUE. + * + * It can also return a timeout_ value which should be the maximum + * timeout (in milliseconds) which should be passed to the poll() call. + * The actual timeout used will be -1 if all sources returned -1, + * or it will be the minimum of all the timeout_ values + * returned which were >= 0. + * + */ + return 0; +} + +gboolean IO_check(GSource *source) +{ + /* + * Called after all the file descriptors are polled. + * The source should return TRUE if it is ready to be dispatched. + * Note that some time may have passed since the previous prepare + * function was called, so the source should be checked again here. + * + */ + if(((IO_Source *) source)->enabled) + { + struct pollfd fds; + + memset(&fds,0,sizeof(fds)); + + fds.fd = ((IO_Source *) source)->poll.fd; + fds.events = ((IO_Source *) source)->poll.events; + + if(poll(&fds,1,0) > 0) + return TRUE; + } + + return FALSE; +} + +gboolean IO_dispatch(GSource *source, G_GNUC_UNUSED GSourceFunc callback, G_GNUC_UNUSED gpointer user_data) +{ + /* + * Called to dispatch the event source, + * after it has returned TRUE in either its prepare or its check function. + * The dispatch function is passed in a callback function and data. + * The callback function may be NULL if the source was never connected + * to a callback using g_source_set_callback(). The dispatch function + * should call the callback function with user_data and whatever additional + * parameters are needed for this type of event source. + */ + IO_Source *obj = (IO_Source *) source; + + obj->call(obj->session,obj->fd,0,obj->userdata); + + return TRUE; +} + +void IO_finalize(G_GNUC_UNUSED GSource *source) +{ + +} + +gboolean IO_closure(G_GNUC_UNUSED gpointer data) +{ + return 0; +} -- libgit2 0.21.2