gtksourceview r2258 - in branches/gtksourcecompletion: . gtksourceview tests



Author: jessevdk
Date: Fri Apr 10 22:00:13 2009
New Revision: 2258
URL: http://svn.gnome.org/viewvc/gtksourceview?rev=2258&view=rev

Log:
	* gtksourceview/gtksourcecompletiontriggerkey.h:
	* gtksourceview/gtksourcecompletiontriggerkey.c:
	* tests/completion-simple.c:
	
	Changed trigger_key API from using accelerator string representation
	to more common key/modifier API


Modified:
   branches/gtksourcecompletion/ChangeLog
   branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c
   branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h
   branches/gtksourcecompletion/tests/completion-simple.c

Modified: branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c
==============================================================================
--- branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c	(original)
+++ branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c	Fri Apr 10 22:00:13 2009
@@ -141,7 +141,8 @@
 GtkSourceCompletionTriggerKey * 
 gtk_source_completion_trigger_key_new (GtkSourceCompletion *completion,
 				       const gchar         *trigger_name,
-				       const gchar         *accelerator)
+				       guint                key,
+				       GdkModifierType      modifier)
 {
 	GtkSourceCompletionTriggerKey *self;
 	GtkTextView *view;
@@ -155,7 +156,7 @@
 	self->priv->completion = g_object_ref (completion);
 	self->priv->trigger_name = g_strdup (trigger_name);
 
-	gtk_source_completion_trigger_key_set_accelerator (self, accelerator);
+	gtk_source_completion_trigger_key_set_accelerator (self, key, modifier);
 	
 	view = gtk_source_completion_get_view (self->priv->completion);
 	
@@ -178,11 +179,13 @@
  */
 void
 gtk_source_completion_trigger_key_set_accelerator (GtkSourceCompletionTriggerKey *self,
-						   const gchar                   *accelerator)
+						   guint                          key,
+						   GdkModifierType                modifier)
 {
 	g_return_if_fail (GTK_IS_SOURCE_COMPLETION_TRIGGER_KEY (self));
 
-	gtk_accelerator_parse (accelerator, &self->priv->key, &self->priv->mod);
+	self->priv->key = key;
+	self->priv->mod = modifier;
 }
 
 

Modified: branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h
==============================================================================
--- branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h	(original)
+++ branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h	Fri Apr 10 22:00:13 2009
@@ -57,11 +57,13 @@
 
 GtkSourceCompletionTriggerKey
 		*gtk_source_completion_trigger_key_new			(GtkSourceCompletion *completion,
-								 	 const gchar         *trigger_name,
-								 	 const gchar         *accelerator);
+									 const gchar         *trigger_name,
+								 	 guint                key,
+								 	 GdkModifierType      modifier);
 
 void		 gtk_source_completion_trigger_key_set_accelerator	(GtkSourceCompletionTriggerKey *self,
-								 	 const gchar                   *keys);
+								 	 guint                          key,
+								 	 GdkModifierType                modifier);
 
 G_END_DECLS
 

Modified: branches/gtksourcecompletion/tests/completion-simple.c
==============================================================================
--- branches/gtksourcecompletion/tests/completion-simple.c	(original)
+++ branches/gtksourcecompletion/tests/completion-simple.c	Fri Apr 10 22:00:13 2009
@@ -321,7 +321,8 @@
 	
 	ur_trigger = gtk_source_completion_trigger_key_new (comp,
 							    "User Request Trigger",
-							    "<Control>Return");
+							    GDK_Return,
+							    GDK_CONTROL_MASK);
 	
 	gtk_source_completion_add_trigger (comp, GTK_SOURCE_COMPLETION_TRIGGER (ur_trigger));
 



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