[gedit/wip/statusbar-buttons] fix
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/statusbar-buttons] fix
- Date: Tue, 11 Feb 2014 10:53:33 +0000 (UTC)
commit a6777dd21d3f8dd062a7486057fda33d90deb2e9
Author: Steve Frécinaux <code istique net>
Date: Tue Feb 11 11:53:00 2014 +0100
fix
gedit/gedit-highlight-mode-widget.c | 78 +++++++++++++++++-----------------
gedit/gedit-highlight-mode-widget.h | 2 +-
2 files changed, 40 insertions(+), 40 deletions(-)
---
diff --git a/gedit/gedit-highlight-mode-widget.c b/gedit/gedit-highlight-mode-widget.c
index 84ca079..669f28c 100644
--- a/gedit/gedit-highlight-mode-widget.c
+++ b/gedit/gedit-highlight-mode-widget.c
@@ -82,7 +82,7 @@ gedit_highlight_mode_widget_class_init (GeditHighlightModeWidgetClass *klass)
static gboolean
visible_func (GtkTreeModel *model,
GtkTreeIter *iter,
- GeditHighlightModeWidget *dlg)
+ GeditHighlightModeWidget *hmwidget)
{
const gchar *entry_text;
gchar *name;
@@ -90,7 +90,7 @@ visible_func (GtkTreeModel *model,
gchar *text_lower;
gboolean visible = FALSE;
- entry_text = gtk_entry_get_text (GTK_ENTRY (dlg->priv->entry));
+ entry_text = gtk_entry_get_text (GTK_ENTRY (hmwidget->priv->entry));
if (*entry_text == '\0')
{
@@ -117,20 +117,20 @@ visible_func (GtkTreeModel *model,
static void
on_entry_changed (GtkEntry *entry,
- GeditHighlightModeWidget *dlg)
+ GeditHighlightModeWidget *hmwidget)
{
GtkTreeIter iter;
- gtk_tree_model_filter_refilter (dlg->priv->treemodelfilter);
+ gtk_tree_model_filter_refilter (hmwidget->priv->treemodelfilter);
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dlg->priv->treemodelfilter), &iter))
+ if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter), &iter))
{
- gtk_tree_selection_select_iter (dlg->priv->treeview_selection, &iter);
+ gtk_tree_selection_select_iter (hmwidget->priv->treeview_selection, &iter);
}
}
static gboolean
-move_selection (GeditHighlightModeWidget *dlg,
+move_selection (GeditHighlightModeWidget *hmwidget,
gint howmany)
{
GtkTreeIter iter;
@@ -138,13 +138,13 @@ move_selection (GeditHighlightModeWidget *dlg,
gint *indices;
gint ret = FALSE;
- if (!gtk_tree_selection_get_selected (dlg->priv->treeview_selection, NULL, &iter) &&
- !gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dlg->priv->treemodelfilter), &iter))
+ if (!gtk_tree_selection_get_selected (hmwidget->priv->treeview_selection, NULL, &iter) &&
+ !gtk_tree_model_get_iter_first (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter), &iter))
{
return FALSE;
}
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (dlg->priv->treemodelfilter), &iter);
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter), &iter);
indices = gtk_tree_path_get_indices (path);
if (indices)
@@ -154,7 +154,7 @@ move_selection (GeditHighlightModeWidget *dlg,
GtkTreePath *new_path;
idx = indices[0];
- num = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (dlg->priv->treemodelfilter), NULL);
+ num = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter), NULL);
if ((idx + howmany) < 0)
{
@@ -170,8 +170,8 @@ move_selection (GeditHighlightModeWidget *dlg,
}
new_path = gtk_tree_path_new_from_indices (idx, -1);
- gtk_tree_selection_select_path (dlg->priv->treeview_selection, new_path);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (dlg->priv->treeview),
+ gtk_tree_selection_select_path (hmwidget->priv->treeview_selection, new_path);
+ gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (hmwidget->priv->treeview),
new_path, NULL, TRUE, 0.5, 0);
gtk_tree_path_free (new_path);
@@ -186,23 +186,23 @@ move_selection (GeditHighlightModeWidget *dlg,
static gboolean
on_entry_key_press_event (GtkWidget *entry,
GdkEventKey *event,
- GeditHighlightModeWidget *dlg)
+ GeditHighlightModeWidget *hmwidget)
{
if (event->keyval == GDK_KEY_Down)
{
- return move_selection (dlg, 1);
+ return move_selection (hmwidget, 1);
}
else if (event->keyval == GDK_KEY_Up)
{
- return move_selection (dlg, -1);
+ return move_selection (hmwidget, -1);
}
else if (event->keyval == GDK_KEY_Page_Down)
{
- return move_selection (dlg, 5);
+ return move_selection (hmwidget, 5);
}
else if (event->keyval == GDK_KEY_Page_Up)
{
- return move_selection (dlg, -5);
+ return move_selection (hmwidget, -5);
}
return FALSE;
@@ -212,9 +212,9 @@ static void
on_row_activated (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
- GeditHighlightModeWidget *dlg)
+ GeditHighlightModeWidget *hmwidget)
{
- GeditHighlightModeWidgetPrivate *priv = dlg->priv;
+ GeditHighlightModeWidgetPrivate *priv = hmwidget->priv;
GtkSourceLanguage *lang;
GtkTreeIter iter;
@@ -225,7 +225,7 @@ on_row_activated (GtkTreeView *tree_view,
-1);
}
- g_signal_emit (G_OBJECT (dlg), signals[LANGUAGE_SELECTED], 0, lang);
+ g_signal_emit (G_OBJECT (hmwidget), signals[LANGUAGE_SELECTED], 0, lang);
if (lang)
{
@@ -234,7 +234,7 @@ on_row_activated (GtkTreeView *tree_view,
}
static void
-gedit_highlight_mode_widget_init (GeditHighlightModeWidget *dlg)
+gedit_highlight_mode_widget_init (GeditHighlightModeWidget *hmwidget)
{
GeditHighlightModeWidgetPrivate *priv;
GtkSourceLanguageManager *lm;
@@ -242,23 +242,23 @@ gedit_highlight_mode_widget_init (GeditHighlightModeWidget *dlg)
gint i;
GtkTreeIter iter;
- dlg->priv = gedit_highlight_mode_widget_get_instance_private (dlg);
- priv = dlg->priv;
+ hmwidget->priv = gedit_highlight_mode_widget_get_instance_private (hmwidget);
+ priv = hmwidget->priv;
- gtk_widget_init_template (GTK_WIDGET (dlg));
+ gtk_widget_init_template (GTK_WIDGET (hmwidget));
gtk_tree_model_filter_set_visible_func (priv->treemodelfilter,
(GtkTreeModelFilterVisibleFunc)visible_func,
- dlg,
+ hmwidget,
NULL);
g_signal_connect (priv->entry, "changed",
- G_CALLBACK (on_entry_changed), dlg);
+ G_CALLBACK (on_entry_changed), hmwidget);
g_signal_connect (priv->entry, "key-press-event",
- G_CALLBACK (on_entry_key_press_event), dlg);
+ G_CALLBACK (on_entry_key_press_event), hmwidget);
g_signal_connect (priv->treeview, "row-activated",
- G_CALLBACK (on_row_activated), dlg);
+ G_CALLBACK (on_row_activated), hmwidget);
/* Populate tree model */
gtk_list_store_append (priv->liststore, &iter);
@@ -287,9 +287,9 @@ gedit_highlight_mode_widget_init (GeditHighlightModeWidget *dlg)
}
/* select first item */
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dlg->priv->treemodelfilter), &iter))
+ if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter), &iter))
{
- gtk_tree_selection_select_iter (dlg->priv->treeview_selection, &iter);
+ gtk_tree_selection_select_iter (hmwidget->priv->treeview_selection, &iter);
}
}
@@ -301,25 +301,25 @@ gedit_highlight_mode_widget_new ()
}
void
-gedit_highlight_mode_widget_select_language (GeditHighlightModeWidget *dlg,
+gedit_highlight_mode_widget_select_language (GeditHighlightModeWidget *hmwidget,
GtkSourceLanguage *language)
{
GtkTreeIter iter;
- g_return_if_fail (GEDIT_IS_HIGHLIGHT_MODE_WIDGET (dlg));
+ g_return_if_fail (GEDIT_IS_HIGHLIGHT_MODE_WIDGET (hmwidget));
if (language == NULL)
{
return;
}
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dlg->priv->treemodelfilter), &iter))
+ if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter), &iter))
{
do
{
GtkSourceLanguage *lang;
- gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->treemodelfilter),
+ gtk_tree_model_get (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter),
&iter,
COLUMN_LANG, &lang,
-1);
@@ -334,17 +334,17 @@ gedit_highlight_mode_widget_select_language (GeditHighlightModeWidget *dlg,
{
GtkTreePath *path;
- path = gtk_tree_model_get_path (GTK_TREE_MODEL
(dlg->priv->treemodelfilter), &iter);
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL
(hmwidget->priv->treemodelfilter), &iter);
- gtk_tree_selection_select_iter (dlg->priv->treeview_selection, &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (dlg->priv->treeview),
+ gtk_tree_selection_select_iter (hmwidget->priv->treeview_selection,
&iter);
+ gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW
(hmwidget->priv->treeview),
path, NULL, TRUE, 0.5, 0);
gtk_tree_path_free (path);
break;
}
}
}
- while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dlg->priv->treemodelfilter), &iter));
+ while (gtk_tree_model_iter_next (GTK_TREE_MODEL (hmwidget->priv->treemodelfilter), &iter));
}
}
diff --git a/gedit/gedit-highlight-mode-widget.h b/gedit/gedit-highlight-mode-widget.h
index c9f1a4d..dc6bd96 100644
--- a/gedit/gedit-highlight-mode-widget.h
+++ b/gedit/gedit-highlight-mode-widget.h
@@ -59,7 +59,7 @@ GType gedit_highlight_mode_widget_get_type (void) G_GN
GtkWidget *gedit_highlight_mode_widget_new (void);
-void gedit_highlight_mode_widget_select_language (GeditHighlightModeWidget *dlg,
+void gedit_highlight_mode_widget_select_language (GeditHighlightModeWidget *hmwidget,
GtkSourceLanguage *language);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]