]> git.lyx.org Git - features.git/commitdiff
sorry no time for change log, add some const declare ShowMessage in lyx_cb.h and...
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 30 Aug 2000 04:38:32 +0000 (04:38 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 30 Aug 2000 04:38:32 +0000 (04:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@992 a592a061-630c-0410-9148-cb99ea01b6c8

src/converter.C
src/converter.h
src/exporter.C
src/exporter.h
src/lyx_cb.C
src/lyx_cb.h

index cf38de44bf59bc747fd43a06f58ed5ff717e8d7d..c1af3b58726f27f3fa18a7ebbffbf4c7e7c31eb8 100644 (file)
 #include "LyXView.h"
 #include "minibuffer.h"
 #include "lyx_gui_misc.h"
+#include "lyx_cb.h"
 
 using std::map;
 using std::vector;
 using std::queue;
 using std::stack;
 
-extern void ShowMessage(Buffer * buf,
-                string const & msg1,
-                string const & msg2 = string(),
-                string const & msg3 = string(), int delay = 6);
-
 //////////////////////////////////////////////////////////////////////////////
 
 map<string, Format> Formats::formats;
@@ -49,7 +45,8 @@ vector<Command> Converter::commands;
 
 //////////////////////////////////////////////////////////////////////////////
 
-Format::Format(string const & n) : name(n), in_degree(0)
+Format::Format(string const & n)
+       : name(n), in_degree(0)
 {
        struct Item {
                char const * name;
@@ -73,12 +70,14 @@ Format::Format(string const & n) : name(n), in_degree(0)
                }
 }
 
+
 void Formats::Add(string const & name)
 {
        if (formats.find(name) == formats.end())
                formats[name] = Format(name);
 }
 
+
 void Formats::SetViewer(string const & name, string const & command)
 {
        Add(name);
@@ -147,9 +146,8 @@ Format * Formats::GetFormat(string const & name)
                return 0;
 }
 
-string Formats::PrettyName(string const & name)
+string const Formats::PrettyName(string const & name)
 {
-
        string format;
        Converter::SplitFormat(name, format);
        Format * f = GetFormat(format);
@@ -159,6 +157,7 @@ string Formats::PrettyName(string const & name)
                return format;
 }
 
+
 //////////////////////////////////////////////////////////////////////////////
 void Converter::Add(string const & from, string const & to,
                    string const & command, string const & flags)
@@ -179,7 +178,8 @@ void Converter::Add(string const & from, string const & to,
        ++Formats::GetFormat(to)->in_degree;
 }
 
-vector< pair<string,string> > 
+
+vector< pair<string,string> > const
 Converter::GetReachable(string const & from, bool only_viewable)
 {
        vector< pair<string,string> > result;
@@ -233,8 +233,8 @@ bool Converter::convert(Buffer * buffer, string const & from_file,
                        string const & to_format)
 
 {
-       string using_format, format;
-       using_format = SplitFormat(to_format, format);
+       string format;
+       string using_format = SplitFormat(to_format, format);
        string from_format = GetExtension(from_file);
        if (from_format == format)
                return true;
@@ -336,7 +336,7 @@ bool Converter::convert(Buffer * buffer, string const & from_file,
 }
 
 
-string Converter::SplitFormat(string const & str, string & format)
+string const Converter::SplitFormat(string const & str, string & format)
 {
        string using_format = split(str, format, ':');
        if (format.empty())
@@ -344,6 +344,7 @@ string Converter::SplitFormat(string const & str, string & format)
        return using_format;
 }
 
+
 bool Converter::runLaTeX(Buffer * buffer, string const & command)
 {
        
index 02588fee2b4cf3b004f38366561ae8f3e29cff9d..3300b6ffcd137c2ec9ea64822294a370d24a057f 100644 (file)
@@ -22,7 +22,9 @@
 
 class Buffer;
 
+///
 struct Command {
+       ///
        Command(string const & f, string const & t, string const & c,
                bool o)
                : from(f), to(t), command(c), original_dir(o) {}
@@ -40,8 +42,10 @@ struct Command {
        std::vector<Command>::iterator previous;
 };
 
+///
 class Format {
 public:
+       ///
        Format() : in_degree(0) {}
        ///
        Format(string const & n);
@@ -55,6 +59,7 @@ public:
        int in_degree;
 };
 
+///
 class Formats {
 public:
        ///
@@ -71,13 +76,14 @@ public:
        Format * GetFormat(string const & name);
        ///
        static
-       string PrettyName(string const & name);
+       string const PrettyName(string const & name);
 private:
        ///
        static
        std::map<string, Format> formats;
 };
 
+///
 class Converter {
 public:
        ///
@@ -86,15 +92,16 @@ public:
                 string const & command, string const & flags);
        ///
        static
-       std::vector<std::pair<string, string> > GetReachable(string const & from,
-                                                            bool only_viewable = false);
+       std::vector<std::pair<string, string> > const
+       GetReachable(string const & from,
+                    bool only_viewable = false);
        ///
        static
        bool convert(Buffer * buffer, string const & from_file,
                     string const & to_format);
        ///
        static
-       string SplitFormat(string const & str, string & format); 
+       string const SplitFormat(string const & str, string & format); 
 private:
        ///
        static
index 3d29b191acb24bb84bc67d73b0b889dccd4b451a..a7847ffbb66ee642188f7b2593928e14e39d62c6 100644 (file)
 #include "converter.h"
 
 #include "buffer.h"
+#include "lyx_cb.h"
 #include "support/path.h"
 
-
 using std::vector;
 using std::pair;
 
-extern void ShowMessage(Buffer * buf,
-                string const & msg1,
-                string const & msg2 = string(),
-                string const & msg3 = string(), int delay = 6);
-
 bool Exporter::Export(Buffer * buffer, string const & format0,
                      bool put_in_tempdir)
 {
-       string using_format, format;
-       using_format = Converter::SplitFormat(format0, format);
+       string format;
+       string using_format = Converter::SplitFormat(format0, format);
 
        string filename = buffer->fileName();
        string backend_format = BufferExtension(buffer);
@@ -91,18 +86,21 @@ bool Exporter::Preview(Buffer * buffer, string const & format0)
 }
 
 
-vector<pair<string, string> > Exporter::GetExportableFormats(Buffer * buffer)
+vector<pair<string, string> > const
+Exporter::GetExportableFormats(Buffer const * buffer)
 {
        return Converter::GetReachable(BufferExtension(buffer), false);
 }
 
 
-vector<pair<string, string> > Exporter::GetViewableFormats(Buffer * buffer)
+vector<pair<string, string> > const
+Exporter::GetViewableFormats(Buffer const * buffer)
 {
        return Converter::GetReachable(BufferExtension(buffer), true);
 }
 
-string Exporter::BufferExtension(Buffer * buffer)
+
+string const Exporter::BufferExtension(Buffer const * buffer)
 {
        if (buffer->isLinuxDoc())
                return "sgml";
index ce57770b2e041d8ba50248dd1678d9358b66f784..3ca20c1e227912a021b07bb87e4d99950988a10c 100644 (file)
@@ -21,6 +21,7 @@
 
 class Buffer;
 
+///
 class Exporter {
 public:
        ///
@@ -32,13 +33,15 @@ public:
        bool Preview(Buffer * buffer, string const & format);
        ///
        static
-       std::vector<std::pair<string, string> > GetExportableFormats(Buffer * buffer);
+       std::vector<std::pair<string, string> > const
+       GetExportableFormats(Buffer const * buffer);
        ///
        static
-       std::vector<std::pair<string, string> > GetViewableFormats(Buffer * buffer);
+       std::vector<std::pair<string, string> > const
+       GetViewableFormats(Buffer const * buffer);
        ///
        static
-       string BufferExtension(Buffer * buffer);
+       string const BufferExtension(Buffer const * buffer);
 };
 
 //#define NEW_EXPORT 1
index c5e2f5fb0db79cf88cfe1d6c618fedfa2c37ef78..da971808f2290eac446bc4f23baff9f5d5ca29a9 100644 (file)
@@ -14,7 +14,7 @@
 #include <algorithm>
 #include <iostream>
 
-#include "LString.h"
+//#include "LString.h"
 #include FORMS_H_LOCATION
 #include "lyx.h"
 #include "layout_forms.h"
@@ -163,8 +163,8 @@ void MenuLayoutSave();
 
 void ShowMessage(Buffer * buf,
                 string const & msg1,
-                string const & msg2 = string(),
-                string const & msg3 = string(), int delay = 6)
+                string const & msg2,
+                string const & msg3, int delay)
 {
        if (lyxrc.use_gui) {
                buf->getUser()->owner()->getMiniBuffer()->Set(msg1, msg2,
index d15e788e18fd440a6be38e5fd61716c2071874cc..cc9bb3f42b3da48b91f52decda6a54888383c338 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef LYX_CB_H
 #define LYX_CB_H
 
+#include "LString.h"
+
 class BufferParams;
 
 ///
@@ -15,6 +17,11 @@ extern bool toggleall;
 extern bool BindFileSet;
 ///
 extern LyXFont UserFreeFont(BufferParams const & params);
+///
+void ShowMessage(Buffer * buf,
+                string const & msg1,
+                string const & msg2 = string(),
+                string const & msg3 = string(), int delay = 6);
 
 #endif