Commits

Daniel Poelzleithner  committed 5e86500

make editor_reload a official api call

  • Participants
  • Parent commits 250c90c

Comments (0)

Files changed (5)

File moo/mooedit/mooeditor-private.h

                                                  gboolean        focus);
 
 gpointer         _moo_editor_get_file_watch     (MooEditor      *editor);
-void             _moo_editor_reload             (MooEditor      *editor,
-                                                 MooEdit        *doc,
-                                                 const char     *encoding,
-                                                 GError        **error);
 gboolean         _moo_editor_save               (MooEditor      *editor,
                                                  MooEdit        *doc,
                                                  GError        **error);

File moo/mooedit/mooeditor.c

 
 
 void
-_moo_editor_reload (MooEditor   *editor,
+moo_editor_reload (MooEditor   *editor,
                     MooEdit     *doc,
                     const char  *encoding,
                     GError     **error)
         gtk_widget_grab_focus (GTK_WIDGET (doc));
 
         if (options & MOO_EDIT_OPEN_RELOAD)
-            _moo_editor_reload (editor, doc, NULL, NULL);
+            moo_editor_reload (editor, doc, NULL, NULL);
 
         return;
     }
     gtk_widget_grab_focus (GTK_WIDGET (doc));
 
     if (options & MOO_EDIT_OPEN_RELOAD)
-        _moo_editor_reload (editor, doc, NULL, NULL);
+        moo_editor_reload (editor, doc, NULL, NULL);
 }

File moo/mooedit/mooeditor.h

                                              GtkWidget      *parent,
                                              const char     *uri,
                                              const char     *encoding);
+void            moo_editor_reload           (MooEditor   *editor,
+                                             MooEdit     *doc,
+                                             const char  *encoding,
+                                             GError     **error);
 
 MooEdit         *moo_editor_get_doc         (MooEditor      *editor,
                                              const char     *filename);

File moo/mooedit/mooeditwindow.c

 {
     MooEdit *edit = ACTIVE_DOC (window);
     g_return_if_fail (edit != NULL);
-    _moo_editor_reload (window->priv->editor, edit, NULL, NULL);
+    moo_editor_reload (window->priv->editor, edit, NULL, NULL);
 }
 
 
     doc = ACTIVE_DOC (window);
     g_return_if_fail (doc != NULL);
 
-    _moo_editor_reload (window->priv->editor, doc, encoding, NULL);
+    moo_editor_reload (window->priv->editor, doc, encoding, NULL);
 }
 
 static GtkAction *

File moo/moopython/pygtk/mooeditor.defs

              "user pressed Cancel in the file chooser dialog.")
 )
 
+(define-method reload
+  (of-object "MooEditor")
+  (c-name "moo_editor_reload")
+  (return-type "none")
+  (parameters
+    '("MooEdit*" "edit")
+    '("GtkWidget*" "encoding" (null-ok) (default "NULL"))
+    '("GError**" "error")
+  )
+  (docstring "reload(edit, encoding=None).\n"
+             "\n"
+             "Reloads an already opened file.\n")
+)
+
 (define-method open_file_line
   (of-object "MooEditor")
   (c-name "moo_editor_open_file_line")