[gedit] Add "set_markup" method to the file browser



commit 5fbccd67ca44e282f88d6b88d075b12587b5ece9
Author: Garrett Regier <garrettregier gmail com>
Date:   Mon Jul 1 06:22:06 2013 -0700

    Add "set_markup" method to the file browser
    
    This allows setting the actual text used to display the file.

 plugins/filebrowser/Makefile.am                    |    2 +
 plugins/filebrowser/gedit-file-browser-messages.c  |   66 +++++++++
 plugins/filebrowser/gedit-file-browser-store.c     |   64 +++++++---
 plugins/filebrowser/gedit-file-browser-store.h     |    5 +-
 plugins/filebrowser/gedit-file-browser-view.c      |   57 +++++++--
 plugins/filebrowser/messages.xml                   |    4 +
 .../gedit-file-browser-message-set-markup.c        |  140 ++++++++++++++++++++
 .../gedit-file-browser-message-set-markup.h        |   69 ++++++++++
 plugins/filebrowser/messages/messages.h            |    1 +
 9 files changed, 380 insertions(+), 28 deletions(-)
---
diff --git a/plugins/filebrowser/Makefile.am b/plugins/filebrowser/Makefile.am
index d0a558d..c8d965c 100644
--- a/plugins/filebrowser/Makefile.am
+++ b/plugins/filebrowser/Makefile.am
@@ -32,6 +32,7 @@ NOINST_H_FILES = \
        messages/gedit-file-browser-message-id.h \
        messages/gedit-file-browser-message-id-location.h \
        messages/gedit-file-browser-message-set-emblem.h \
+       messages/gedit-file-browser-message-set-markup.h \
        messages/gedit-file-browser-message-set-root.h \
        messages/messages.h
 
@@ -52,6 +53,7 @@ libfilebrowser_la_SOURCES = \
        messages/gedit-file-browser-message-id.c \
        messages/gedit-file-browser-message-id-location.c \
        messages/gedit-file-browser-message-set-emblem.c \
+       messages/gedit-file-browser-message-set-markup.c \
        messages/gedit-file-browser-message-set-root.c \
        $(NOINST_H_FILES)
 
diff --git a/plugins/filebrowser/gedit-file-browser-messages.c 
b/plugins/filebrowser/gedit-file-browser-messages.c
index d07fd0b..203d6b4 100644
--- a/plugins/filebrowser/gedit-file-browser-messages.c
+++ b/plugins/filebrowser/gedit-file-browser-messages.c
@@ -278,6 +278,65 @@ message_set_emblem_cb (GeditMessageBus *bus,
        g_free (emblem);
 }
 
+static void
+message_set_markup_cb (GeditMessageBus *bus,
+                      GeditMessage    *message,
+                      WindowData      *data)
+{
+       gchar *id = NULL;
+       gchar *markup = NULL;
+       GtkTreePath *path;
+       GeditFileBrowserStore *store;
+
+       g_object_get (message, "id", &id, "markup", &markup, NULL);
+
+       if (!id)
+       {
+               g_free (id);
+               g_free (markup);
+
+               return;
+       }
+
+       path = track_row_lookup (data, id);
+
+       if (path != NULL)
+       {
+               GtkTreeIter iter;
+               GValue value = G_VALUE_INIT;
+
+               store = gedit_file_browser_widget_get_browser_store (data->widget);
+
+               if (gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path))
+               {
+                       if (markup == NULL)
+                       {
+                               gchar *name;
+
+                               gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+                                                   GEDIT_FILE_BROWSER_STORE_COLUMN_NAME, &name,
+                                                   -1);
+                               markup = g_markup_escape_text (name, -1);
+
+                               g_free (name);
+                       }
+
+                       g_value_init (&value, G_TYPE_STRING);
+                       g_value_set_string (&value, markup);
+
+                       gedit_file_browser_store_set_value (store,
+                                                           &iter,
+                                                           GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP,
+                                                           &value);
+
+                       g_value_unset (&value);
+               }
+       }
+
+       g_free (id);
+       g_free (markup);
+}
+
 static gchar *
 item_id (const gchar *path,
         GFile *location)
@@ -603,6 +662,11 @@ register_methods (GeditWindow            *window,
                                    "set_emblem");
 
        gedit_message_bus_register (bus,
+                                   GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP,
+                                   MESSAGE_OBJECT_PATH,
+                                   "set_markup");
+
+       gedit_message_bus_register (bus,
                                    GEDIT_TYPE_FILE_BROWSER_MESSAGE_ADD_FILTER,
                                    MESSAGE_OBJECT_PATH,
                                    "add_filter");
@@ -660,6 +724,7 @@ register_methods (GeditWindow            *window,
        BUS_CONNECT (bus, get_root, data);
        BUS_CONNECT (bus, set_root, data);
        BUS_CONNECT (bus, set_emblem, data);
+       BUS_CONNECT (bus, set_markup, data);
        BUS_CONNECT (bus, add_filter, window);
        BUS_CONNECT (bus, remove_filter, data);
 
@@ -953,6 +1018,7 @@ gedit_file_browser_messages_unregister (GeditWindow *window)
        BUS_DISCONNECT (bus, get_root, data);
        BUS_DISCONNECT (bus, set_root, data);
        BUS_DISCONNECT (bus, set_emblem, data);
+       BUS_DISCONNECT (bus, set_markup, data);
        BUS_DISCONNECT (bus, add_filter, window);
        BUS_DISCONNECT (bus, remove_filter, data);
 
diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/gedit-file-browser-store.c
index c620151..dc17f57 100644
--- a/plugins/filebrowser/gedit-file-browser-store.c
+++ b/plugins/filebrowser/gedit-file-browser-store.c
@@ -92,6 +92,7 @@ struct _FileBrowserNode
        GFile *file;
        guint flags;
        gchar *name;
+       gchar *markup;
 
        GdkPixbuf *icon;
        GdkPixbuf *emblem;
@@ -490,9 +491,10 @@ gedit_file_browser_store_init (GeditFileBrowserStore *obj)
        obj->priv = GEDIT_FILE_BROWSER_STORE_GET_PRIVATE (obj);
 
        obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_LOCATION] = G_TYPE_FILE;
-       obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_NAME] = G_TYPE_STRING;
+       obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP] = G_TYPE_STRING;
        obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS] = G_TYPE_UINT;
        obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_ICON] = GDK_TYPE_PIXBUF;
+       obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_NAME] = G_TYPE_STRING;
        obj->priv->column_types[GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM] = GDK_TYPE_PIXBUF;
 
        /* Default filter mode is hiding the hidden files */
@@ -723,8 +725,8 @@ gedit_file_browser_store_get_value (GtkTreeModel *tree_model,
                case GEDIT_FILE_BROWSER_STORE_COLUMN_LOCATION:
                        set_gvalue_from_node (value, node);
                        break;
-               case GEDIT_FILE_BROWSER_STORE_COLUMN_NAME:
-                       g_value_set_string (value, node->name);
+               case GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP:
+                       g_value_set_string (value, node->markup);
                        break;
                case GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS:
                        g_value_set_uint (value, node->flags);
@@ -732,6 +734,9 @@ gedit_file_browser_store_get_value (GtkTreeModel *tree_model,
                case GEDIT_FILE_BROWSER_STORE_COLUMN_ICON:
                        g_value_set_object (value, node->icon);
                        break;
+               case GEDIT_FILE_BROWSER_STORE_COLUMN_NAME:
+                       g_value_set_string (value, node->name);
+                       break;
                case GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM:
                        g_value_set_object (value, node->emblem);
                        break;
@@ -1356,11 +1361,17 @@ static void
 file_browser_node_set_name (FileBrowserNode *node)
 {
        g_free (node->name);
+       g_free (node->markup);
 
        if (node->file)
                node->name = gedit_file_browser_utils_file_basename (node->file);
        else
                node->name = NULL;
+
+       if (node->name)
+               node->markup = g_markup_escape_text (node->name, -1);
+       else
+               node->markup = NULL;
 }
 
 static void
@@ -1467,6 +1478,7 @@ file_browser_node_free (GeditFileBrowserStore *model,
                g_object_unref (node->emblem);
 
        g_free (node->name);
+       g_free (node->markup);
 
        if (NODE_IS_DIR (node))
                g_slice_free (FileBrowserNodeDir, (FileBrowserNodeDir *)node);
@@ -1769,6 +1781,7 @@ model_create_dummy_node (GeditFileBrowserStore *model,
 
        dummy = file_browser_node_new (NULL, parent);
        dummy->name = g_strdup (_("(Empty)"));
+       dummy->markup = g_markup_escape_text (dummy->name, -1);
 
        dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_DUMMY;
        dummy->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_IS_HIDDEN;
@@ -2947,27 +2960,46 @@ gedit_file_browser_store_set_value (GeditFileBrowserStore *tree_model,
        GtkTreePath *path;
 
        g_return_if_fail (GEDIT_IS_FILE_BROWSER_STORE (tree_model));
-       g_return_if_fail (column == GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM);
-       g_return_if_fail (G_VALUE_HOLDS_OBJECT (value));
        g_return_if_fail (iter != NULL);
        g_return_if_fail (iter->user_data != NULL);
 
-       data = g_value_get_object (value);
+       node = (FileBrowserNode *) (iter->user_data);
 
-       if (data)
-               g_return_if_fail (GDK_IS_PIXBUF (data));
+       if (column == GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP)
+       {
+               g_return_if_fail (G_VALUE_HOLDS_STRING (value));
 
-       node = (FileBrowserNode *) (iter->user_data);
+               data = g_value_dup_string (value);
 
-       if (node->emblem)
-               g_object_unref (node->emblem);
+               if (!data)
+                       data = g_strdup (node->name);
 
-       if (data)
-               node->emblem = g_object_ref (GDK_PIXBUF (data));
-       else
-               node->emblem = NULL;
+               g_free (node->markup);
+               node->markup = g_strdup (data);
+       }
+       else if (column == GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM)
+       {
+               g_return_if_fail (G_VALUE_HOLDS_OBJECT (value));
+
+               data = g_value_get_object (value);
+
+               g_return_if_fail (GDK_IS_PIXBUF (data) || data == NULL);
+
+               if (node->emblem)
+                       g_object_unref (node->emblem);
 
-       model_recomposite_icon (tree_model, iter);
+               if (data)
+                       node->emblem = g_object_ref (GDK_PIXBUF (data));
+               else
+                       node->emblem = NULL;
+
+               model_recomposite_icon (tree_model, iter);
+       }
+       else
+       {
+               g_return_if_fail (column == GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP ||
+                                 column == GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM);
+       }
 
        if (model_node_visibility (tree_model, node))
        {
diff --git a/plugins/filebrowser/gedit-file-browser-store.h b/plugins/filebrowser/gedit-file-browser-store.h
index e460b34..ec4928c 100644
--- a/plugins/filebrowser/gedit-file-browser-store.h
+++ b/plugins/filebrowser/gedit-file-browser-store.h
@@ -36,9 +36,12 @@ G_BEGIN_DECLS
 typedef enum
 {
        GEDIT_FILE_BROWSER_STORE_COLUMN_ICON = 0,
-       GEDIT_FILE_BROWSER_STORE_COLUMN_NAME,
+       GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP,
        GEDIT_FILE_BROWSER_STORE_COLUMN_LOCATION,
        GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS,
+
+       /* Columns not in common with GeditFileBookmarksStore */
+       GEDIT_FILE_BROWSER_STORE_COLUMN_NAME,
        GEDIT_FILE_BROWSER_STORE_COLUMN_EMBLEM,
        GEDIT_FILE_BROWSER_STORE_COLUMN_NUM
 } GeditFileBrowserStoreColumn;
diff --git a/plugins/filebrowser/gedit-file-browser-view.c b/plugins/filebrowser/gedit-file-browser-view.c
index 8060561..58d3031 100644
--- a/plugins/filebrowser/gedit-file-browser-view.c
+++ b/plugins/filebrowser/gedit-file-browser-view.c
@@ -42,6 +42,9 @@ struct _GeditFileBrowserViewPrivate
        GtkCellRenderer *text_renderer;
 
        GtkTreeModel *model;
+
+       /* Used when renaming */
+       gchar *orig_markup;
        GtkTreeRowReference *editable;
 
        /* Click policy */
@@ -1030,8 +1033,8 @@ gedit_file_browser_view_init (GeditFileBrowserView *obj)
                                         obj->priv->text_renderer, TRUE);
        gtk_tree_view_column_add_attribute (obj->priv->column,
                                            obj->priv->text_renderer,
-                                           "text",
-                                           GEDIT_FILE_BROWSER_STORE_COLUMN_NAME);
+                                           "markup",
+                                           GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP);
 
        g_signal_connect (obj->priv->text_renderer, "edited",
                          G_CALLBACK (on_cell_edited), obj);
@@ -1138,7 +1141,10 @@ void
 gedit_file_browser_view_start_rename (GeditFileBrowserView *tree_view,
                                      GtkTreeIter          *iter)
 {
+       gchar *name;
+       gchar *markup;
        guint flags;
+       GValue name_escaped = G_VALUE_INIT;
        GtkTreeRowReference *rowref;
        GtkTreePath *path;
 
@@ -1148,11 +1154,25 @@ gedit_file_browser_view_start_rename (GeditFileBrowserView *tree_view,
        g_return_if_fail (iter != NULL);
 
        gtk_tree_model_get (tree_view->priv->model, iter,
-                           GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
-                           -1);
+                           GEDIT_FILE_BROWSER_STORE_COLUMN_NAME, &name,
+                           GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP, &markup,
+                           GEDIT_FILE_BROWSER_STORE_COLUMN_FLAGS, &flags,
+                           -1);
 
        if (!(FILE_IS_DIR (flags) || !FILE_IS_DUMMY (flags)))
+       {
+               g_free (name);
+               g_free (markup);
                return;
+       }
+
+       /* Restore the markup to the original
+        * name, a plugin might have changed the markup.
+        */
+       g_value_init (&name_escaped, G_TYPE_STRING);
+       g_value_take_string (&name_escaped, g_markup_escape_text (name, -1));
+       gedit_file_browser_store_set_value (GEDIT_FILE_BROWSER_STORE (tree_view->priv->model), iter,
+                                           GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP, &name_escaped);
 
        path = gtk_tree_model_get_path (tree_view->priv->model, iter);
        rowref = gtk_tree_row_reference_new (tree_view->priv->model, path);
@@ -1165,6 +1185,8 @@ gedit_file_browser_view_start_rename (GeditFileBrowserView *tree_view,
                                              path);
 
        gtk_tree_path_free (path);
+
+       tree_view->priv->orig_markup = markup;
        tree_view->priv->editable = rowref;
 
        gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view),
@@ -1175,6 +1197,9 @@ gedit_file_browser_view_start_rename (GeditFileBrowserView *tree_view,
                                      gtk_tree_row_reference_get_path (tree_view->priv->editable),
                                      tree_view->priv->column,
                                      FALSE, 0.0, 0.0);
+
+       g_value_unset (&name_escaped);
+       g_free (name);
 }
 
 void
@@ -1208,21 +1233,23 @@ on_cell_edited (GtkCellRendererText  *cell,
        GtkTreePath *treepath;
        GtkTreeIter iter;
        gboolean ret;
+       GValue orig_markup = G_VALUE_INIT;
        GError *error = NULL;
 
-       gtk_tree_row_reference_free (tree_view->priv->editable);
-       tree_view->priv->editable = NULL;
-
-       if (new_text == NULL || *new_text == '\0')
-               return;
-
        treepath = gtk_tree_path_new_from_string (path);
        ret = gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_view->priv->model), &iter, treepath);
        gtk_tree_path_free (treepath);
 
        if (ret)
        {
-               if (gedit_file_browser_store_rename (GEDIT_FILE_BROWSER_STORE (tree_view->priv->model),
+               /* Restore the original markup */
+               g_value_init (&orig_markup, G_TYPE_STRING);
+               g_value_set_string (&orig_markup, tree_view->priv->orig_markup);
+               gedit_file_browser_store_set_value (GEDIT_FILE_BROWSER_STORE (tree_view->priv->model), &iter,
+                                                   GEDIT_FILE_BROWSER_STORE_COLUMN_MARKUP, &orig_markup);
+
+               if (new_text != NULL && *new_text != '\0' &&
+                   gedit_file_browser_store_rename (GEDIT_FILE_BROWSER_STORE (tree_view->priv->model),
                    &iter, new_text, &error))
                {
                        treepath = gtk_tree_model_get_path (GTK_TREE_MODEL (tree_view->priv->model), &iter);
@@ -1237,7 +1264,15 @@ on_cell_edited (GtkCellRendererText  *cell,
                                       error->code, error->message);
                        g_error_free (error);
                }
+
+               g_value_unset (&orig_markup);
        }
+
+       g_free (tree_view->priv->orig_markup);
+       tree_view->priv->orig_markup = NULL;
+       
+       gtk_tree_row_reference_free (tree_view->priv->editable);
+       tree_view->priv->editable = NULL;
 }
 
 static void
diff --git a/plugins/filebrowser/messages.xml b/plugins/filebrowser/messages.xml
index 059dd76..0aebd99 100644
--- a/plugins/filebrowser/messages.xml
+++ b/plugins/filebrowser/messages.xml
@@ -13,6 +13,10 @@
     <property name="id" type="string"/>
     <property name="emblem" type="string"/>
   </message>
+  <message namespace="Gedit" name="FileBrowserMessageSetMarkup">
+    <property name="id" type="string"/>
+    <property name="markup" type="string"/>
+  </message>
   <message namespace="Gedit" name="FileBrowserMessageAddFilter">
     <property name="object_path" type="string"/>
     <property name="method" type="string"/>
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.c 
b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.c
new file mode 100644
index 0000000..8d87438
--- /dev/null
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.c
@@ -0,0 +1,140 @@
+
+/*
+ * gedit-file-browser-message-set-markup.c
+ * This file is part of gedit
+ *
+ * Copyright (C) 2013 - Garrett Regier
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#include "gedit-file-browser-message-set-markup.h"
+
+#define GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), 
GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP, GeditFileBrowserMessageSetMarkupPrivate))
+
+enum
+{
+       PROP_0,
+
+       PROP_ID,
+       PROP_MARKUP,
+};
+
+struct _GeditFileBrowserMessageSetMarkupPrivate
+{
+       gchar *id;
+       gchar *markup;
+};
+
+G_DEFINE_TYPE (GeditFileBrowserMessageSetMarkup, gedit_file_browser_message_set_markup, GEDIT_TYPE_MESSAGE)
+
+static void
+gedit_file_browser_message_set_markup_finalize (GObject *obj)
+{
+       GeditFileBrowserMessageSetMarkup *msg = GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP (obj);
+
+       g_free (msg->priv->id);
+       g_free (msg->priv->markup);
+
+       G_OBJECT_CLASS (gedit_file_browser_message_set_markup_parent_class)->finalize (obj);
+}
+
+static void
+gedit_file_browser_message_set_markup_get_property (GObject    *obj,
+                                                    guint       prop_id,
+                                                    GValue     *value,
+                                                    GParamSpec *pspec)
+{
+       GeditFileBrowserMessageSetMarkup *msg;
+
+       msg = GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP (obj);
+
+       switch (prop_id)
+       {
+               case PROP_ID:
+                       g_value_set_string (value, msg->priv->id);
+                       break;
+               case PROP_MARKUP:
+                       g_value_set_string (value, msg->priv->markup);
+                       break;
+       }
+}
+
+static void
+gedit_file_browser_message_set_markup_set_property (GObject      *obj,
+                                                    guint         prop_id,
+                                                    GValue const *value,
+                                                    GParamSpec   *pspec)
+{
+       GeditFileBrowserMessageSetMarkup *msg;
+
+       msg = GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP (obj);
+
+       switch (prop_id)
+       {
+               case PROP_ID:
+               {
+                       g_free (msg->priv->id);
+                       msg->priv->id = g_value_dup_string (value);
+                       break;
+               }
+               case PROP_MARKUP:
+               {
+                       g_free (msg->priv->markup);
+                       msg->priv->markup = g_value_dup_string (value);
+                       break;
+               }
+       }
+}
+
+static void
+gedit_file_browser_message_set_markup_class_init (GeditFileBrowserMessageSetMarkupClass *klass)
+{
+       GObjectClass *object_class = G_OBJECT_CLASS(klass);
+
+       object_class->finalize = gedit_file_browser_message_set_markup_finalize;
+
+       object_class->get_property = gedit_file_browser_message_set_markup_get_property;
+       object_class->set_property = gedit_file_browser_message_set_markup_set_property;
+
+       g_object_class_install_property (object_class,
+                                        PROP_ID,
+                                        g_param_spec_string ("id",
+                                                             "Id",
+                                                             "Id",
+                                                             NULL,
+                                                             G_PARAM_READWRITE |
+                                                             G_PARAM_CONSTRUCT |
+                                                             G_PARAM_STATIC_STRINGS));
+
+       g_object_class_install_property (object_class,
+                                        PROP_MARKUP,
+                                        g_param_spec_string ("markup",
+                                                             "Markup",
+                                                             "Markup",
+                                                             NULL,
+                                                             G_PARAM_READWRITE |
+                                                             G_PARAM_CONSTRUCT |
+                                                             G_PARAM_STATIC_STRINGS));
+
+       g_type_class_add_private (object_class, sizeof (GeditFileBrowserMessageSetMarkupPrivate));
+}
+
+static void
+gedit_file_browser_message_set_markup_init (GeditFileBrowserMessageSetMarkup *message)
+{
+       message->priv = GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_GET_PRIVATE (message);
+}
diff --git a/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.h 
b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.h
new file mode 100644
index 0000000..41b3f83
--- /dev/null
+++ b/plugins/filebrowser/messages/gedit-file-browser-message-set-markup.h
@@ -0,0 +1,69 @@
+
+/*
+ * gedit-file-browser-message-set-markup.h
+ * This file is part of gedit
+ *
+ * Copyright (C) 2013 - Garrett Regier
+ *
+ * gedit is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gedit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gedit; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef __GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_H__
+#define __GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_H__
+
+#include <gedit/gedit-message.h>
+
+G_BEGIN_DECLS
+
+#define GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP            
(gedit_file_browser_message_set_markup_get_type ())
+#define GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                               GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP,\
+                                                               GeditFileBrowserMessageSetMarkup))
+#define GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_CONST(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
+                                                               GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP,\
+                                                               GeditFileBrowserMessageSetMarkup const))
+#define GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),\
+                                                               GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP,\
+                                                               GeditFileBrowserMessageSetMarkupClass))
+#define GEDIT_IS_FILE_BROWSER_MESSAGE_SET_MARKUP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
+                                                               GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP))
+#define GEDIT_IS_FILE_BROWSER_MESSAGE_SET_MARKUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
+                                                               GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP))
+#define GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),\
+                                                               GEDIT_TYPE_FILE_BROWSER_MESSAGE_SET_MARKUP,\
+                                                               GeditFileBrowserMessageSetMarkupClass))
+
+typedef struct _GeditFileBrowserMessageSetMarkup        GeditFileBrowserMessageSetMarkup;
+typedef struct _GeditFileBrowserMessageSetMarkupClass   GeditFileBrowserMessageSetMarkupClass;
+typedef struct _GeditFileBrowserMessageSetMarkupPrivate GeditFileBrowserMessageSetMarkupPrivate;
+
+struct _GeditFileBrowserMessageSetMarkup
+{
+       GeditMessage parent;
+
+       GeditFileBrowserMessageSetMarkupPrivate *priv;
+};
+
+struct _GeditFileBrowserMessageSetMarkupClass
+{
+       GeditMessageClass parent_class;
+};
+
+GType gedit_file_browser_message_set_markup_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* __GEDIT_FILE_BROWSER_MESSAGE_SET_MARKUP_H__ */
diff --git a/plugins/filebrowser/messages/messages.h b/plugins/filebrowser/messages/messages.h
index 779a10b..fb8acfb 100644
--- a/plugins/filebrowser/messages/messages.h
+++ b/plugins/filebrowser/messages/messages.h
@@ -9,6 +9,7 @@
 #include "gedit-file-browser-message-id.h"
 #include "gedit-file-browser-message-id-location.h"
 #include "gedit-file-browser-message-set-emblem.h"
+#include "gedit-file-browser-message-set-markup.h"
 #include "gedit-file-browser-message-set-root.h"
 
 #endif /* __GEDIT_FILE_BROWER_MESSAGES_MESSAGES_H__ */


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