SF.net SVN: geany:[4453] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Nov 29 13:36:26 UTC 2009


Revision: 4453
          http://geany.svn.sourceforge.net/geany/?rev=4453&view=rev
Author:   eht16
Date:     2009-11-29 13:36:26 +0000 (Sun, 29 Nov 2009)

Log Message:
-----------
Add main_is_realized() to the plugin API.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/plugins/geanyfunctions.h
    trunk/src/main.c
    trunk/src/main.h
    trunk/src/plugindata.h
    trunk/src/plugins.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-11-27 21:02:44 UTC (rev 4452)
+++ trunk/ChangeLog	2009-11-29 13:36:26 UTC (rev 4453)
@@ -1,3 +1,10 @@
+2009-11-29  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/main.c, src/main.h, src/plugins.c, src/plugindata.h,
+   plugins/geanyfunctions.h:
+   Add main_is_realized() to the plugin API.
+
+
 2009-11-26  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>
 
  * src/about.c, THANKS:

Modified: trunk/plugins/geanyfunctions.h
===================================================================
--- trunk/plugins/geanyfunctions.h	2009-11-27 21:02:44 UTC (rev 4452)
+++ trunk/plugins/geanyfunctions.h	2009-11-29 13:36:26 UTC (rev 4453)
@@ -312,5 +312,7 @@
 	geany_functions->p_main->reload_configuration
 #define main_locale_init \
 	geany_functions->p_main->locale_init
+#define main_is_realized \
+	geany_functions->p_main->is_realized
 
 #endif

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2009-11-27 21:02:44 UTC (rev 4452)
+++ trunk/src/main.c	2009-11-29 13:36:26 UTC (rev 4453)
@@ -386,6 +386,23 @@
 
 
 /**
+ *  Check whether the main window has been realized.
+ *  This is an easy indicator whether Geany is right now starting up (main window is not
+ *  yet realized) or whether it has finished the startup process (main window is realized).
+ *  This is because the main window is realized (i.e. actually drawn on the screen) at the
+ *  end of the startup process.
+ *
+ *  @return @c TRUE if the Geany main window has been realized or @c FALSE otherwise.
+ *
+ *  @since 0.19
+ **/
+gboolean main_is_realized(void)
+{
+	return main_status.main_window_realized;
+}
+
+
+/**
  *  Initialises the gettext translation system.
  *  This is a convenience function to set up gettext for internationalisation support
  *  in external plugins. You should call this function early in @ref plugin_init().

Modified: trunk/src/main.h
===================================================================
--- trunk/src/main.h	2009-11-27 21:02:44 UTC (rev 4452)
+++ trunk/src/main.h	2009-11-29 13:36:26 UTC (rev 4453)
@@ -64,4 +64,6 @@
 
 void main_locale_init(const gchar *locale_dir, const gchar *gettext_package);
 
+gboolean main_is_realized(void);
+
 #endif

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2009-11-27 21:02:44 UTC (rev 4452)
+++ trunk/src/plugindata.h	2009-11-29 13:36:26 UTC (rev 4453)
@@ -50,7 +50,7 @@
 enum {
 	/** The Application Programming Interface (API) version, incremented
 	 * whenever any plugin data types are modified or appended to. */
-	GEANY_API_VERSION = 164,
+	GEANY_API_VERSION = 165,
 
 	/** The Application Binary Interface (ABI) version, incremented whenever
 	 * existing fields in the plugin data types have to be changed or reordered. */
@@ -401,7 +401,7 @@
 {
 	void		(*reload_configuration) (void);
 	void		(*locale_init) (const gchar *locale_dir, const gchar *package);
-
+	gboolean	(*is_realized) (void);
 }
 MainFuncs;
 

Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c	2009-11-27 21:02:44 UTC (rev 4452)
+++ trunk/src/plugins.c	2009-11-29 13:36:26 UTC (rev 4453)
@@ -290,7 +290,8 @@
 
 static MainFuncs main_funcs = {
 	&main_reload_configuration,
-	&main_locale_init
+	&main_locale_init,
+	&main_is_realized
 };
 
 static GeanyFunctions geany_functions = {


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