SF.net SVN: geany: [1816] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Aug 23 15:22:14 UTC 2007


Revision: 1816
          http://geany.svn.sourceforge.net/geany/?rev=1816&view=rev
Author:   ntrel
Date:     2007-08-23 08:22:13 -0700 (Thu, 23 Aug 2007)

Log Message:
-----------
Apply patch from blackdog to add "document-activate" plugin signal,
which is sent when switching notebook pages (thanks).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/callbacks.c
    trunk/src/geanyobject.c
    trunk/src/geanyobject.h
    trunk/src/plugindata.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-08-23 11:34:06 UTC (rev 1815)
+++ trunk/ChangeLog	2007-08-23 15:22:13 UTC (rev 1816)
@@ -25,6 +25,10 @@
    Make utils_isbrace() and utils_is_opening_brace() take an
    'include_angles' argument (to separate from editor_prefs).
    Make 'Goto matching brace' keybinding include <> angle brackets.
+ * src/geanyobject.c, src/plugindata.h, src/geanyobject.h,
+   src/callbacks.c:
+   Apply patch from blackdog to add "document-activate" plugin signal,
+   which is sent when switching notebook pages (thanks).
 
 
 2007-08-22  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2007-08-23 11:34:06 UTC (rev 1815)
+++ trunk/src/callbacks.c	2007-08-23 15:22:13 UTC (rev 1816)
@@ -62,6 +62,8 @@
 #include "project.h"
 #include "navqueue.h"
 
+#include "geanyobject.h"
+
 #ifdef HAVE_VTE
 # include "vte.h"
 #endif
@@ -781,6 +783,11 @@
 #ifdef HAVE_VTE
 		vte_cwd(doc_list[idx].file_name, FALSE);
 #endif
+
+		if (geany_object)
+		{
+			g_signal_emit_by_name(geany_object, "document-activate", idx);
+		}
 	}
 }
 

Modified: trunk/src/geanyobject.c
===================================================================
--- trunk/src/geanyobject.c	2007-08-23 11:34:06 UTC (rev 1815)
+++ trunk/src/geanyobject.c	2007-08-23 15:22:13 UTC (rev 1816)
@@ -107,6 +107,15 @@
 		gtk_marshal_NONE__INT,
 		G_TYPE_NONE, 1,
 		G_TYPE_INT);
+	geany_object_signals[GCB_DOCUMENT_ACTIVATE] = g_signal_new (
+		"document-activate",
+		G_OBJECT_CLASS_TYPE (g_object_class),
+		G_SIGNAL_RUN_FIRST,
+		G_STRUCT_OFFSET (GeanyObjectClass, document_activate),
+		NULL, NULL,
+		gtk_marshal_NONE__INT,
+		G_TYPE_NONE, 1,
+		G_TYPE_INT);
 }
 
 

Modified: trunk/src/geanyobject.h
===================================================================
--- trunk/src/geanyobject.h	2007-08-23 11:34:06 UTC (rev 1815)
+++ trunk/src/geanyobject.h	2007-08-23 15:22:13 UTC (rev 1816)
@@ -37,6 +37,7 @@
 	GCB_DOCUMENT_NEW,
 	GCB_DOCUMENT_OPEN,
 	GCB_DOCUMENT_SAVE,
+	GCB_DOCUMENT_ACTIVATE,
 	GCB_MAX
 } GeanyCallbackId;
 
@@ -69,6 +70,7 @@
 	void (*document_new)(gint idx);
 	void (*document_open)(gint idx);
 	void (*document_save)(gint idx);
+	void (*document_activate)(gint idx);
 };
 
 GType		geany_object_get_type	(void);

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2007-08-23 11:34:06 UTC (rev 1815)
+++ trunk/src/plugindata.h	2007-08-23 15:22:13 UTC (rev 1816)
@@ -63,12 +63,15 @@
  *
  * "document-save"
  * 	Sent when a file is saved.
+ *
+ * "document-activate"
+ * 	Sent when switching notebook pages.
  */
 
 
 /* The API version should be incremented whenever any plugin data types below are
  * modified. */
-static const gint api_version = 13;
+static const gint api_version = 14;
 
 /* The ABI version should be incremented whenever existing fields in the plugin
  * data types below have to be changed or reordered. It should stay the same if fields


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list