anjuta r4332 - in trunk: . libanjuta/interfaces plugins/class-gen plugins/cvs-plugin



Author: jhs
Date: Sat Oct 11 17:23:06 2008
New Revision: 4332
URL: http://svn.gnome.org/viewvc/anjuta?rev=4332&view=rev

Log:
2008-10-11  Johannes Schmid  <jhs gnome org>

	* libanjuta/interfaces/libanjuta.idl:
	Created new IAnjutaVcs interface
	
	* plugins/class-gen/plugin.c (cg_plugin_add_to_repository):
	Adapted to new interface
	* plugins/cvs-plugin/plugin.c:
	Removed old interface

Modified:
   trunk/ChangeLog
   trunk/libanjuta/interfaces/libanjuta.idl
   trunk/plugins/class-gen/plugin.c
   trunk/plugins/cvs-plugin/plugin.c

Modified: trunk/libanjuta/interfaces/libanjuta.idl
==============================================================================
--- trunk/libanjuta/interfaces/libanjuta.idl	(original)
+++ trunk/libanjuta/interfaces/libanjuta.idl	Sat Oct 11 17:23:06 2008
@@ -4464,50 +4464,126 @@
  */
 interface IAnjutaVcs
 {
+	#include <gio/gio.h>
+
+  /**
+	 * IAnjutaVcsError:
+	 * @IANJUTA_VCS_UNKNOWN_ERROR: Unkown error
+ 	 *
+ 	 * These enumeration is used to specify errors.
+	 */
+	enum Error
+	{
+	  UNKOWN_ERROR
+	}
+
+  /**
+	 * IAnjutaVcsStatus:
+	 * @IANJUTA_VCS_STATUS_NONE: File has unknown status
+	 * @IANJUTA_VCS_STATUS_MODIFIED: File was modified locally
+	 * @IANJUTA_VCS_STATUS_CONFLICT: File has unresolved conflict
+	 * @IANJUTA_VCS_STATUS_OUTDATED: File is not up-to-date
+	 * @IANJUTA_VCS_STATUS_LOCKED: File is locked
+	 * @IANJUTA_VCS_STATUS_ADDED: File was added
+	 * @IANJUTA_VCS_STATUS_DELETED: File was deleted
+	 * @IANJUTA_VCS_STATUS_IGNORED: File is ignored by VCS system
+ 	 *
+ 	 * These enumeration is used to specify the status of a file. A file can
+ 	 * have multiple status flags assigned (MODIFIED and CONFLICT, for example)
+	 */
+	enum Status
+	{
+	  STATUS_NONE = 0x00,
+	  STATUS_MODIFIED = 0x01,
+	  STATUS_CONFLICT = 0x02,
+	  STATUS_OUTDATED = 0x04,
+	  STATUS_LOCKED = 0x08,
+	  STATUS_ADDED = 0x10,
+	  STATUS_DELETED = 0x20,	  
+	  STATUS_IGNORED = 0x40	  
+	}
+
 	/**
 	 * ianjuta_vcs_add:
-	 * @filename: String with the filename
+	 * @files: List of GFiles* to add
 	 * @obj: Self
 	 * @err: Error propagation and reporting
 	 *
-	 * Add filename to the cvs repositry.
+	 * Add filename to the vcs repositry.
 	 */
-	void add(const gchar* filename);
+	void add(List<GFile*> files);
 	
 	/**
 	 * ianjuta_cvs_remove:
-	 * @filename: String with the filename
+	 * @files: List of GFiles* to remove
 	 * @obj: Self
 	 * @err: Error propagation and reporting
 	 *
-	 * Remove filename to the cvs repositry. Note that the file
-	 * is not removed physicly. This function will fail if the file
-	 * still exists on disc.
+	 * Remove filename to the vcs repositry.
 	 */
-	void remove(const gchar* filename);
+	void remove(List<GFile*> files);
 	
 	/**
 	 * ianjuta_vcs_update:
-	 * @filename: String with the filename
-	 * @recurse: TRUE to recurse into subdirectories
+	 * @file: GFile* to update
+	 * @recurse: TRUE to recurse into subdirectories (if file is a directory)
 	 * @obj: Self
 	 * @err: Error propagation and reporting
 	 *
-	 * Update filename with the cvs repositry.
+	 * Update filename with the vcs repositry.
 	 */
-	void update(const gchar* filename, gboolean recurse);
+	void update(GFile* file, gboolean recurse);
 	
-	/**
-	 * ianjuta_vcs_commit:
-	 * @filename: String with the filename
-	 * @log: The log message for the commit or ""
-	 * @recurse: TRUE to recurse into subdirectories
-	 * @obj: Self
-	 * @err: Error propagation and reporting
-	 *
-	 * Commit changes in filename to the cvs repositry.
-	 */
-	void commit(const gchar* filename, const gchar* log, gboolean recurse);	
+	typedef void (*StatusCallback) (GFile* file, IAnjutaVcsStatus status, gpointer user_data);
+  
+  /**
+   * ianjuta_vcs_query_status:
+   * @obj: Self
+   * @files: List of GFiles* to query
+   * @callback: callback to call when data for a particular file is available
+   * @user_data: Userdata passed to callback
+   * @err: Error propagation and reporting
+   *
+   * Querys the status of the files asyncronously and calls callback once the data
+   * is available. On error, -1 is returned and err is set.
+   *
+   * Returns: Id to cancel this query
+   */
+  gint query_status (List<GFile*> files, StatusCallback callback, gpointer user_data);
+  
+  /**
+   * ianjuta_vcs_query_status_cancel:
+   * @obj: Self
+   * @id: Id of the query to cancel
+   * @err: Error propagation and reporting
+   *
+   * Cancels a query when the data is no longer needed
+   */
+  void query_status_cancel (gint id);
+   
+  typedef void (*DiffCallback) (GFile* file, IAnjutaVcsStatus status, const gchar* diff, gpointer user_data);
+   /**
+    * ianjuta_vcs_diff:
+    * @obj: Self
+    * @file: GFile* to diff
+    * @err: Error propagation and reporting
+    *
+    * Asyncronous request for a unified diff between the repository and the file. callback
+    * will be called when the information is available.
+    *
+    * Returns: Id to cancel the request
+    */
+  gint ianjuta_vcs_diff(GFile* file, DiffCallback callback, gpointer user_data);
+
+	/**
+   * ianjuta_vcs_diff_cancel:
+   * @obj: Self
+   * @id: Id of the query to cancel
+   * @err: Error propagation and reporting
+   *
+   * Cancels a query when the data is no longer needed
+   */
+   void ianjuta_vcs_diff_cancel (gint id);
 }
 
 /**

Modified: trunk/plugins/class-gen/plugin.c
==============================================================================
--- trunk/plugins/class-gen/plugin.c	(original)
+++ trunk/plugins/class-gen/plugin.c	Sat Oct 11 17:23:06 2008
@@ -241,8 +241,12 @@
 
 	if(vcs != NULL)
 	{
-		ianjuta_vcs_add (vcs, header_file, NULL);
-		ianjuta_vcs_add (vcs, source_file, NULL);
+		GList* files = NULL;
+		files = g_list_append (files, g_file_new_for_path (header_file));
+		files = g_list_append (files, g_file_new_for_path (source_file));		
+		ianjuta_vcs_add (vcs, files, NULL);
+		g_list_foreach (files, (GFunc) g_object_unref, NULL);
+		g_list_free (files);
 	}
 }
 

Modified: trunk/plugins/cvs-plugin/plugin.c
==============================================================================
--- trunk/plugins/cvs-plugin/plugin.c	(original)
+++ trunk/plugins/cvs-plugin/plugin.c	Sat Oct 11 17:23:06 2008
@@ -446,43 +446,6 @@
 	klass->finalize = finalize;
 }
 
-/* Interface */
-
-static void
-ianjuta_cvs_add (IAnjutaVcs *obj, const gchar* filename, 
-	GError **err)
-{
-	anjuta_cvs_add(ANJUTA_PLUGIN(obj), filename, FALSE, err);
-}
-	
-static void
-ianjuta_cvs_commit (IAnjutaVcs *obj, const gchar* filename, const gchar* log, 
-						 gboolean recurse, GError **err)
-{
-	anjuta_cvs_commit (ANJUTA_PLUGIN(obj), filename, log, "", recurse, err);
-}
-
-static void
-ianjuta_cvs_remove (IAnjutaVcs *obj, const gchar* filename, GError **err)
-{
-	anjuta_cvs_remove (ANJUTA_PLUGIN(obj), filename, err);
-}
-
-
-static void
-ianjuta_cvs_update (IAnjutaVcs *obj, const gchar* filename, gboolean recurse, GError **err)
-{
-	anjuta_cvs_update(ANJUTA_PLUGIN(obj), filename, recurse, FALSE, TRUE, FALSE,"", err);}
-
-static void
-ianjuta_vcs_iface_init (IAnjutaVcsIface *iface)
-{
-	iface->add = ianjuta_cvs_add;
-	iface->remove = ianjuta_cvs_remove;
-	iface->update = ianjuta_cvs_update;
-	iface->commit = ianjuta_cvs_commit;	
-}
-
 static void
 ipreferences_merge(IAnjutaPreferences* ipref, AnjutaPreferences* prefs, GError** e)
 {
@@ -507,7 +470,6 @@
 }
 
 ANJUTA_PLUGIN_BEGIN (CVSPlugin, cvs_plugin);
-ANJUTA_PLUGIN_ADD_INTERFACE(ianjuta_vcs, IANJUTA_TYPE_VCS);
 ANJUTA_PLUGIN_ADD_INTERFACE(ipreferences, IANJUTA_TYPE_PREFERENCES);
 ANJUTA_PLUGIN_END;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]