views/view: Store signal id

This will be used by next commits
This commit is contained in:
Georges Basile Stavracas Neto
2023-03-02 21:14:02 -03:00
parent c961e28f8a
commit a77f6e39e4
+13 -3
View File
@@ -29,6 +29,16 @@
G_DEFINE_INTERFACE (GcalView, gcal_view, GTK_TYPE_WIDGET) G_DEFINE_INTERFACE (GcalView, gcal_view, GTK_TYPE_WIDGET)
enum
{
CREATE_EVENT,
CREATE_EVENT_DETAILED,
EVENT_ACTIVATED,
N_SIGNALS,
};
static guint signals[N_SIGNALS] = { 0, };
static void static void
gcal_view_default_init (GcalViewInterface *iface) gcal_view_default_init (GcalViewInterface *iface)
{ {
@@ -61,7 +71,7 @@ gcal_view_default_init (GcalViewInterface *iface)
* *
* Emitted when the view wants to create an event. * Emitted when the view wants to create an event.
*/ */
g_signal_new ("create-event", signals[CREATE_EVENT] = g_signal_new ("create-event",
GCAL_TYPE_VIEW, GCAL_TYPE_VIEW,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GcalViewInterface, create_event), G_STRUCT_OFFSET (GcalViewInterface, create_event),
@@ -79,7 +89,7 @@ gcal_view_default_init (GcalViewInterface *iface)
* Emitted when the view wants to create an event and immediately * Emitted when the view wants to create an event and immediately
* edit it. * edit it.
*/ */
g_signal_new ("create-event-detailed", signals[CREATE_EVENT_DETAILED] = g_signal_new ("create-event-detailed",
GCAL_TYPE_VIEW, GCAL_TYPE_VIEW,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GcalViewInterface, create_event_detailed), G_STRUCT_OFFSET (GcalViewInterface, create_event_detailed),
@@ -93,7 +103,7 @@ gcal_view_default_init (GcalViewInterface *iface)
* *
* Emitted when an event widget inside the view is activated. * Emitted when an event widget inside the view is activated.
*/ */
g_signal_new ("event-activated", signals[EVENT_ACTIVATED] = g_signal_new ("event-activated",
GCAL_TYPE_VIEW, GCAL_TYPE_VIEW,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, 0, NULL, NULL, NULL,