gtksourceview r2256 - in branches/gtksourcecompletion: . gtksourceview



Author: jessevdk
Date: Fri Apr 10 21:48:39 2009
New Revision: 2256
URL: http://svn.gnome.org/viewvc/gtksourceview?rev=2256&view=rev

Log:
	* gtksourceview/gtksourcecompletiontriggerkey.h:
	* gtksourceview/gtksourcecompletiontriggerkey.c:
	
	Cleanup code and change set_keys to set_accelerator


Modified:
   branches/gtksourcecompletion/ChangeLog
   branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c
   branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h

Modified: branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c
==============================================================================
--- branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c	(original)
+++ branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.c	Fri Apr 10 21:48:39 2009
@@ -39,19 +39,12 @@
 							GTK_TYPE_SOURCE_COMPLETION_TRIGGER_KEY, \
 							GtkSourceCompletionTriggerKeyPrivate))
 
-/* User request signals */
-enum
-{
-	CKP_GTK_TEXT_VIEW_KP,
-	LAST_SIGNAL
-};
-
 struct _GtkSourceCompletionTriggerKeyPrivate
 {
 	GtkSourceCompletion *completion;
-	
-	gulong signals[LAST_SIGNAL];
+
 	gchar *trigger_name;
+
 	guint key;
 	GdkModifierType mod;
 };
@@ -65,8 +58,8 @@
 				 		gtk_source_completion_trigger_key_iface_init))
 
 static gboolean
-view_key_press_event_cb (GtkWidget *view,
-			 GdkEventKey *event,
+view_key_press_event_cb (GtkWidget                     *view,
+			 GdkEventKey                   *event,
 			 GtkSourceCompletionTriggerKey *self)
 {
 	guint s;
@@ -95,7 +88,7 @@
 }
 
 static void 
-gtk_source_completion_trigger_key_init (GtkSourceCompletionTriggerKey * self)
+gtk_source_completion_trigger_key_init (GtkSourceCompletionTriggerKey *self)
 {
 	self->priv = GTK_SOURCE_COMPLETION_TRIGGER_KEY_GET_PRIVATE (self);
 	
@@ -116,7 +109,7 @@
 }
 
 static void 
-gtk_source_completion_trigger_key_class_init (GtkSourceCompletionTriggerKeyClass * klass)
+gtk_source_completion_trigger_key_class_init (GtkSourceCompletionTriggerKeyClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	
@@ -126,16 +119,16 @@
 }
 
 static void 
-gtk_source_completion_trigger_key_iface_init (GtkSourceCompletionTriggerIface * iface)
+gtk_source_completion_trigger_key_iface_init (GtkSourceCompletionTriggerIface *iface)
 {
-	iface->get_name   = gtk_source_completion_trigger_key_real_get_name;
+	iface->get_name = gtk_source_completion_trigger_key_real_get_name;
 }
 
 /**
  * gtk_source_completion_trigger_key_new:
  * @completion: The #GtkSourceCompletion
  * @trigger_name: The trigger name wich will be user the we trigger the event.
- * @keys: The string representation of the keys that we will
+ * @accelerator: The string representation of the keys that we will
  * use to activate the event. You can get this 
  * string with #gtk_accelerator_name
  *
@@ -145,10 +138,10 @@
  * Returns: a new #GtkSourceCompletionTriggerKey
  *
  */
-GtkSourceCompletionTriggerKey* 
+GtkSourceCompletionTriggerKey * 
 gtk_source_completion_trigger_key_new (GtkSourceCompletion *completion,
-				       const gchar *trigger_name,
-				       const gchar *keys)
+				       const gchar         *trigger_name,
+				       const gchar         *accelerator)
 {
 	GtkSourceCompletionTriggerKey *self;
 	GtkTextView *view;
@@ -161,10 +154,10 @@
 	
 	self->priv->completion = g_object_ref (completion);
 	self->priv->trigger_name = g_strdup (trigger_name);
-	gtk_source_completion_trigger_key_set_keys (self, keys);
+
+	gtk_source_completion_trigger_key_set_accelerator (self, accelerator);
 	
 	view = gtk_source_completion_get_view (self->priv->completion);
-	g_assert (GTK_IS_TEXT_VIEW (view));
 	
 	g_signal_connect (view,
 			  "key-press-event",
@@ -175,21 +168,21 @@
 }
 
 /**
- * gtk_source_completion_trigger_key_set_keys:
+ * gtk_source_completion_trigger_key_set_accelerator:
  * @self: The #GtkSourceCompletionTriggerKey 
- * @keys: The string representation of the keys that we will
+ * @accelerator: The string representation of the keys that we will
  * use to activate the user request event. You can get this 
  * string with #gtk_accelerator_name
  *
  * Assign the keys that we will use to activate the user request event.
  */
 void
-gtk_source_completion_trigger_key_set_keys (GtkSourceCompletionTriggerKey *self,
-					    const gchar *keys)
+gtk_source_completion_trigger_key_set_accelerator (GtkSourceCompletionTriggerKey *self,
+						   const gchar                   *accelerator)
 {
 	g_return_if_fail (GTK_IS_SOURCE_COMPLETION_TRIGGER_KEY (self));
 
-	gtk_accelerator_parse (keys, &self->priv->key, &self->priv->mod);
+	gtk_accelerator_parse (accelerator, &self->priv->key, &self->priv->mod);
 }
 
 

Modified: branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h
==============================================================================
--- branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h	(original)
+++ branches/gtksourcecompletion/gtksourceview/gtksourcecompletiontriggerkey.h	Fri Apr 10 21:48:39 2009
@@ -53,15 +53,15 @@
 	GObjectClass parent;
 };
 
-GType		 gtk_source_completion_trigger_key_get_type	(void) G_GNUC_CONST;
+GType		 gtk_source_completion_trigger_key_get_type		(void) G_GNUC_CONST;
 
 GtkSourceCompletionTriggerKey
-		*gtk_source_completion_trigger_key_new		(GtkSourceCompletion *completion,
-								 const gchar *trigger_name,
-								 const gchar *keys);
+		*gtk_source_completion_trigger_key_new			(GtkSourceCompletion *completion,
+								 	 const gchar         *trigger_name,
+								 	 const gchar         *accelerator);
 
-void		 gtk_source_completion_trigger_key_set_keys	(GtkSourceCompletionTriggerKey *self,
-								 const gchar *keys);
+void		 gtk_source_completion_trigger_key_set_accelerator	(GtkSourceCompletionTriggerKey *self,
+								 	 const gchar                   *keys);
 
 G_END_DECLS
 



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