AC_PROG_LIBTOOL
AC_PROG_RANLIB
+dnl ******************************
+dnl glib-genmarshal
+dnl ******************************
+AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
+
# Checks for libraries.
PKG_CHECK_MODULES(ORGANIGRAMMA, [gio-2.0 >= 2.20
gtk+-2.0 >= 2.16
lib_LTLIBRARIES = liborganigramma.la
liborganigramma_la_SOURCES = \
+ ../src/marshal.c \
../src/nodi.c \
../src/nodo.c \
../src/persona.c \
liborganigramma_include_HEADERS = \
../src/commons.h \
+ ../src/marshal.h \
../src/nodi.h \
../src/nodo.h \
../src/persona.h \
bin_PROGRAMS = organigramma
+marshal.c: marshal.h organigramma_marshal.list $(GLIB_GENMARSHAL)
+ $(GLIB_GENMARSHAL) organigramma_marshal.list --body --prefix=_organigramma_marshal > $@
+
+marshal.h: organigramma_marshal.list $(GLIB_GENMARSHAL)
+ $(GLIB_GENMARSHAL) organigramma_marshal.list --header --prefix=_organigramma_marshal > $@
+
organigramma_SOURCES = \
commons.h \
main.c \
+ marshal.c \
+ marshal.h \
nodi.c \
nodi.h \
nodo.c \
--- /dev/null
+
+#include <glib-object.h>
+
+
+#ifdef G_ENABLE_DEBUG
+#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
+#define g_marshal_value_peek_char(v) g_value_get_schar (v)
+#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
+#define g_marshal_value_peek_int(v) g_value_get_int (v)
+#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
+#define g_marshal_value_peek_long(v) g_value_get_long (v)
+#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
+#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
+#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
+#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
+#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
+#define g_marshal_value_peek_float(v) g_value_get_float (v)
+#define g_marshal_value_peek_double(v) g_value_get_double (v)
+#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
+#define g_marshal_value_peek_param(v) g_value_get_param (v)
+#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
+#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
+#define g_marshal_value_peek_object(v) g_value_get_object (v)
+#define g_marshal_value_peek_variant(v) g_value_get_variant (v)
+#else /* !G_ENABLE_DEBUG */
+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+ * Do not access GValues directly in your code. Instead, use the
+ * g_value_get_*() functions
+ */
+#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
+#define g_marshal_value_peek_char(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_int(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_long(v) (v)->data[0].v_long
+#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
+#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
+#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
+#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_float(v) (v)->data[0].v_float
+#define g_marshal_value_peek_double(v) (v)->data[0].v_double
+#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer
+#endif /* !G_ENABLE_DEBUG */
+
+
+/* BOOLEAN:UINT (organigramma_marshal.list:1) */
+void
+_organigramma_marshal_BOOLEAN__UINT (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gboolean (*GMarshalFunc_BOOLEAN__UINT) (gpointer data1,
+ guint arg_1,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__UINT callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gboolean v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 2);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_BOOLEAN__UINT) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_uint (param_values + 1),
+ data2);
+
+ g_value_set_boolean (return_value, v_return);
+}
+
--- /dev/null
+
+#ifndef ___organigramma_marshal_MARSHAL_H__
+#define ___organigramma_marshal_MARSHAL_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* BOOLEAN:UINT (organigramma_marshal.list:1) */
+extern void _organigramma_marshal_BOOLEAN__UINT (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+
+G_END_DECLS
+
+#endif /* ___organigramma_marshal_MARSHAL_H__ */
+
--- /dev/null
+BOOLEAN:UINT
#include <libsolipa/utils.h>
#include "uffici.h"
+#include "marshal.h"
#include "ufficio.h"
static void organigramma_uffici_class_init (OrganigrammaUfficiClass *klass);
GValue *value,
GParamSpec *pspec);
+static void organigramma_uffici_on_map_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
static void organigramma_uffici_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void organigramma_uffici_on_btn_modifica_clicked (GtkButton *button,
gboolean selezione;
GtkWindow *wtransient;
+
+ guint sign_id;
};
G_DEFINE_TYPE (OrganigrammaUffici, organigramma_uffici, G_TYPE_OBJECT)
g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE,
1, G_TYPE_UINT);
+
+ /**
+ * OrganigrammaUffici::ask-toshow:
+ * @uffici:
+ *
+ */
+ klass->ask_toshow_signal_id = g_signal_new ("ask-toshow",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ _organigramma_marshal_BOOLEAN__UINT,
+ G_TYPE_BOOLEAN,
+ 1, G_TYPE_UINT);
}
static void
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
g_strsplit (g_strconcat ("lstore_uffici|",
- (selezione ? "w_uffici" : "vbx_uffici"),
- NULL), "|", -1),
+ (selezione ? "w_uffici" : "vbx_uffici"),
+ NULL),
+ "|", -1),
&error);
if (error != NULL)
{
"clicked", G_CALLBACK (organigramma_uffici_on_btn_annulla_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button27"),
"clicked", G_CALLBACK (organigramma_uffici_on_btn_seleziona_clicked), (gpointer)a);
+
+ priv->sign_id = g_signal_connect_after (G_OBJECT (priv->widget),
+ "map-event", G_CALLBACK (organigramma_uffici_on_map_event), (gpointer)a);
}
else
{
gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "button26")));
gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "button27")));
- }
- organigramma_uffici_carica (a);
+ organigramma_uffici_carica (a);
+ }
ires1 = autoz_get_resource_from_id (priv->commons->autoz, "organigramma_rw");
if (!autoz_is_allowed (priv->commons->autoz, priv->commons->role_utente, ires1, FALSE))
gint rows;
gint row;
+ guint id;
+ gboolean toshow;
+
+ OrganigrammaUfficiClass *klass = ORGANIGRAMMA_UFFICI_GET_CLASS (uffici);
OrganigrammaUfficiPrivate *priv = ORGANIGRAMMA_UFFICI_GET_PRIVATE (uffici);
gtk_list_store_clear (priv->lstore_uffici);
rows = gda_data_model_get_n_rows (dm);
for (row = 0; row < rows; row++)
{
- gtk_list_store_append (priv->lstore_uffici, &iter);
- gtk_list_store_set (priv->lstore_uffici, &iter,
- COL_ID, gdaex_data_model_get_field_value_integer_at (dm, row, "id"),
- COL_NOME, gdaex_data_model_get_field_value_stringify_at (dm, row, "nome"),
- -1);
+ toshow = TRUE;
+ id = (guint)gdaex_data_model_get_field_value_integer_at (dm, row, "id");
+ if (g_signal_has_handler_pending (G_OBJECT (uffici),
+ klass->ask_toshow_signal_id,
+ 0,
+ TRUE))
+ {
+ g_signal_emit (G_OBJECT (uffici), klass->ask_toshow_signal_id, 0, id, &toshow);
+ }
+
+ if (toshow)
+ {
+ gtk_list_store_append (priv->lstore_uffici, &iter);
+ gtk_list_store_set (priv->lstore_uffici, &iter,
+ COL_ID, id,
+ COL_NOME, gdaex_data_model_get_field_value_stringify_at (dm, row, "nome"),
+ -1);
+ }
}
g_object_unref (dm);
}
}
+static void
+organigramma_uffici_on_map_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ organigramma_uffici_carica ((OrganigrammaUffici *)user_data);
+}
+
/* CALLBACK */
static void
organigramma_uffici_on_btn_nuovo_clicked (GtkButton *button,
GObjectClass parent_class;
guint selezionato_signal_id;
+ guint ask_toshow_signal_id;
};
GType organigramma_uffici_get_type (void) G_GNUC_CONST;