Browse Source

Documentation updated.

#111_valadoc
Kolan Sh 1 year ago
parent
commit
0895e89413

+ 30
- 0
src/conv/main.vala View File

@@ -16,20 +16,41 @@ namespace LAview {
16 16
 		 * File format converter (lyx, tex, pdf).
17 17
 		 */
18 18
 		public class Converter : Object {
19
+			/**
20
+			 * Path to the LyX executable.
21
+			 */
19 22
 	        public string lyx_path { get; construct; }
23
+
24
+			/**
25
+			 * Path to latexmk.pl executable.
26
+			 */
20 27
 	        public string latexmk_pl_path { get; construct; }
28
+
29
+			/**
30
+			 * Path to the Perl executable.
31
+			 */
21 32
 	        public string perl_path { get; construct; }
22 33
 
23 34
 			/**
24 35
 			 * Constructs a new ``Converter``.
25 36
 			 */
26 37
 			public Converter () { Object(lyx_path: "lyx", latexmk_pl_path: "latexmk", perl_path: "perl"); }
38
+
39
+			/**
40
+			 * Constructs a new ``Converter``.
41
+			 * @param lyx_path path to the LyX executable.
42
+			 * @param latexmk_pl_path path to latexmk.pl executable.
43
+			 * @param perl_path path to Perl executable.
44
+			 */
27 45
 			public Converter.new_with_paths (string lyx_path, string latexmk_pl_path, string perl_path) {
28 46
 				Object(lyx_path: lyx_path, latexmk_pl_path: latexmk_pl_path, perl_path: perl_path);
29 47
 			}
30 48
 
31 49
 			/**
32 50
 			 * LyX->TeX conversion.
51
+			 * @param lyx_file path to LyX source.
52
+			 * @param tex_path path to LaTeX output.
53
+			 * @throws Error any conversion error.
33 54
 			 */
34 55
 			public Subprocess lyx2tex (string lyx_file, string tex_path) throws Error {
35 56
 			    /* check paths */
@@ -46,6 +67,9 @@ namespace LAview {
46 67
 
47 68
 			/**
48 69
 			 * TeX->LyX conversion.
70
+			 * @param tex_file path to LaTeX source.
71
+			 * @param lyx_file_path path to LyX output.
72
+			 * @throws Error any conversion error.
49 73
 			 */
50 74
 			public Subprocess tex2lyx (string tex_file, string lyx_file_path) throws Error {
51 75
 			    /* check paths */
@@ -66,6 +90,9 @@ namespace LAview {
66 90
 
67 91
 			/**
68 92
 			 * LyX->PDF conversion.
93
+			 * @param lyx_file path to LyX source.
94
+			 * @param pdf_path path to PDF output.
95
+			 * @throws Error any conversion error.
69 96
 			 */
70 97
 			public Subprocess lyx2pdf (string lyx_file, string pdf_path) throws Error {
71 98
 			    /* check paths */
@@ -82,6 +109,9 @@ namespace LAview {
82 109
 
83 110
 			/**
84 111
 			 * TeX->PDF conversion.
112
+			 * @param tex_file path to LaTeX source.
113
+			 * @param pdf_path path to PDF output.
114
+			 * @throws Error any conversion error.
85 115
 			 */
86 116
 			public Subprocess tex2pdf (string tex_file, string pdf_path) throws Error {
87 117
 			    /* check paths */

+ 34
- 3
src/core-iface/CoreInterface.vala View File

@@ -19,6 +19,7 @@ namespace LAview.Core {
19 19
 
20 20
 		/**
21 21
 		 * Get data object.
22
+		 * @param name data object name.
22 23
 		 */
23 24
 		public abstract PluginData get_data_object (string name);
24 25
 	}
@@ -61,6 +62,9 @@ namespace LAview.Core {
61 62
 
62 63
 		/**
63 64
 		 * Compose the object.
65
+		 * @param parent parent Object/Window.
66
+		 * @param answers answers values.
67
+		 * @throws Error any compose error.
64 68
 		 */
65 69
 		public abstract bool compose (Object parent, Gee.HashMap<string, AnswerValue> answers) throws Error;
66 70
 
@@ -74,31 +78,58 @@ namespace LAview.Core {
74 78
 	 * Request Answer Value.
75 79
 	 */
76 80
 	public abstract class AnswerValue : Object {
81
+		/**
82
+		 * Constructs a new ``AnswerValue``.
83
+		 */
84
+		public AnswerValue () { }
77 85
 	}
78 86
 
79 87
 	/**
80
-	 * String.
88
+	 * String Answer.
81 89
 	 */
82 90
 	public class AnswerString : AnswerValue {
91
+		/**
92
+		 * String value.
93
+		 */
83 94
 		public string value;
84 95
 
96
+		/**
97
+		 * Constructs a new ``AnswerString``.
98
+		 * @param value string value.
99
+		 */
85 100
 		public AnswerString (string value = "") {
86 101
 			this.value = value;
87 102
 		}
88 103
 	}
89 104
 
90 105
 	/**
91
-	 * 1D Array.
106
+	 * 1D Array Answer.
92 107
 	 */
93 108
 	public class AnswerArray1D : AnswerValue {
109
+		/**
110
+		 * Array value.
111
+		 */
94 112
 		public string[] value;
113
+
114
+		/**
115
+		 * Constructs a new ``AnswerArray1D``.
116
+		 */
117
+		public AnswerArray1D () { }
95 118
 	}
96 119
 
97 120
 	/**
98
-	 * 2D Array;
121
+	 * 2D Array Answer;
99 122
 	 */
100 123
 	public class AnswerArray2D : AnswerValue {
124
+		/**
125
+		 * Array value.
126
+		 */
101 127
 		public string[,] value;
128
+
129
+		/**
130
+		 * Constructs a new ``AnswerArray1D``.
131
+		 */
132
+		public AnswerArray2D () { }
102 133
 	}
103 134
 
104 135
 	/**

+ 59
- 0
src/core/AppDirs.vala View File

@@ -1,21 +1,76 @@
1
+/**
2
+ * System calls.
3
+ */
1 4
 namespace Get {
5
+	/**
6
+	 * Gets library path.
7
+	 * @param so_path out path to shared library.
8
+	 * @param addr initialization method source address.
9
+	 */
2 10
 	extern void library_path (string so_path, void *addr);
3 11
 }
4 12
 
13
+/**
14
+ * LaTeX view.
15
+ *
16
+ * Public system of data view in the LaTeX format.
17
+ */
5 18
 namespace LAview.Core {
6 19
 
20
+	/**
21
+	 * Application directories/paths.
22
+	 */
7 23
 	class AppDirs {
8 24
 
25
+		/**
26
+		 * Shared library path.
27
+		 */
9 28
 		public static File so_path;
29
+
30
+		/**
31
+		 * Binary directory.
32
+		 */
10 33
 		public static File exec_dir;
34
+
35
+		/**
36
+		 * Common directory (parent to binary and shared).
37
+		 */
11 38
 		public static File common_dir;
39
+
40
+		/**
41
+		 * Data Plugins directory.
42
+		 */
12 43
 		public static string data_plugins_dir;
44
+
45
+		/**
46
+		 * Object Plugins directory.
47
+		 */
13 48
 		public static string object_plugins_dir;
49
+
50
+		/**
51
+		 * User Interface Glade files directory.
52
+		 */
14 53
 		public static string ui_dir;
54
+
55
+		/**
56
+		 * Settings/GLib Schemas directory.
57
+		 */
15 58
 		public static string settings_dir;
59
+
60
+		/**
61
+		 * Temporary directory.
62
+		 */
16 63
 		public static string temp_dir;
64
+
65
+		/**
66
+		 * Cache in temporary directory.
67
+		 */
17 68
 		public static string cache_dir;
18 69
 
70
+		/**
71
+		 * Initialization.
72
+		 * @throws FileError file i/o error.
73
+		 */
19 74
 		public static void init () throws FileError {
20 75
 			char _so_path[256];
21 76
 			Get.library_path ((string)_so_path, (void*)init);
@@ -36,6 +91,10 @@ namespace LAview.Core {
36 91
 			cache_dir = Path.build_path (Path.DIR_SEPARATOR_S, AppDirs.temp_dir, "cache");
37 92
 		}
38 93
 
94
+		/**
95
+		 * Termination.
96
+		 * @throws Error any error.
97
+		 */
39 98
 		public static void terminate () throws Error {
40 99
 			rm_rf (File.new_for_path(temp_dir));
41 100
 		}

+ 69
- 0
src/core/Core.vala View File

@@ -1,5 +1,10 @@
1 1
 using GObject, Plugins;
2 2
 
3
+/**
4
+ * LaTeX view.
5
+ *
6
+ * Public system of data view in the LaTeX format.
7
+ */
3 8
 namespace LAview.Core {
4 9
 
5 10
 	/**
@@ -13,16 +18,25 @@ namespace LAview.Core {
13 18
 
14 19
 		AppSettings settings;
15 20
 
21
+		/**
22
+		 * Path to LyX source.
23
+		 */
16 24
 		public string lyx_path {
17 25
 			get { return settings.lyx_path; }
18 26
 			set { settings.lyx_path = value; }
19 27
 		}
20 28
 
29
+		/**
30
+		 * Path to latexmk.pl executable.
31
+		 */
21 32
 		public string latexmk_pl_path {
22 33
 			get { return settings.latexmk_pl_path; }
23 34
 			set { settings.latexmk_pl_path = value; }
24 35
 		}
25 36
 
37
+		/**
38
+		 * Path to Perl executable.
39
+		 */
26 40
 		public string perl_path {
27 41
 			get { return settings.perl_path; }
28 42
 			set { settings.perl_path = value; }
@@ -38,11 +52,19 @@ namespace LAview.Core {
38 52
 			set { settings.object_path = value; }
39 53
 		}
40 54
 
55
+		/**
56
+		 * Data plugins.
57
+		 */
41 58
 		public Gee.HashMap<Type, PluginData> data_plugins = new Gee.HashMap<Type, PluginData>();
59
+
60
+		/**
61
+		 * Object plugins.
62
+		 */
42 63
 		public Gee.HashMap<Type, PluginObject> object_plugins = new Gee.HashMap<Type, PluginObject>();
43 64
 
44 65
 		/**
45 66
 		 * Load Data Modules.
67
+		 * @param dir_path directory with data modules.
46 68
 		 */
47 69
 		public void load_data_modules (string dir_path) {
48 70
 			Gee.ArrayList<Plugins.Module> tmp_modules = null;
@@ -59,6 +81,7 @@ namespace LAview.Core {
59 81
 
60 82
 		/**
61 83
 		 * Load Protocol Objects Modules.
84
+		 * @param dir_path directory with object modules.
62 85
 		 */
63 86
 		public void load_object_modules (string dir_path) {
64 87
 			Gee.ArrayList<Plugins.Module> tmp_modules = null;
@@ -81,6 +104,10 @@ namespace LAview.Core {
81 104
 			GObject.Plugins.unload_modules (object_modules);
82 105
 		}
83 106
 
107
+		/**
108
+		 * Constructs a new ``Core``.
109
+		 * @throws Error any error.
110
+		 */
84 111
 		public Core () throws Error {
85 112
 
86 113
 			/* Initialization */
@@ -100,10 +127,16 @@ namespace LAview.Core {
100 127
 			clear_cache ();
101 128
 		}
102 129
 
130
+		/**
131
+		 * Gets cache directory.
132
+		 */
103 133
 		public string get_cache_dir () {
104 134
 			return AppDirs.cache_dir;
105 135
 		}
106 136
 
137
+		/**
138
+		 * Gets templates human readable names.
139
+		 */
107 140
 		public string[] get_templates_readable_names () {
108 141
 			string[] names = {};
109 142
 			foreach (var t in templates)
@@ -111,10 +144,17 @@ namespace LAview.Core {
111 144
 			return names;
112 145
 		}
113 146
 
147
+		/**
148
+		 * Gets template path by its index.
149
+		 */
114 150
 		public string get_template_path_by_index (int index) {
115 151
 			return templates[index].get_path ();
116 152
 		}
117 153
 
154
+		/**
155
+		 * Adds a new template.
156
+		 * @param path new template path.
157
+		 */
118 158
 		public void add_template (string path) {
119 159
 			var file = File.new_for_path (path);
120 160
 			if (!file.query_exists() || file.query_file_type(FileQueryInfoFlags.NONE) != FileType.REGULAR)
@@ -131,12 +171,20 @@ namespace LAview.Core {
131 171
 			save_templates_list ();
132 172
 		}
133 173
 
174
+		/**
175
+		 * Removes template by index.
176
+		 * @param index template index.
177
+		 */
134 178
 		public void remove_template (int index) {
135 179
 			if (index < templates.size)
136 180
 				templates.remove_at (index);
137 181
 			save_templates_list ();
138 182
 		}
139 183
 
184
+		/**
185
+		 * Gets objects list.
186
+		 * @param template_index template index.
187
+		 */
140 188
 		public string[] get_objects_list (int template_index) throws Error {
141 189
 			if (template_index == last_template_index) return objects_list;
142 190
 			last_template_index = template_index;
@@ -186,6 +234,11 @@ namespace LAview.Core {
186 234
 			return objects_list;
187 235
 		}
188 236
 
237
+		/**
238
+		 * Compose/Construct the object.
239
+		 * @param parent parent window.
240
+		 * @param object_index object index.
241
+		 */
189 242
 		public bool compose_object (Object parent, int object_index) throws Error {
190 243
 			var cnt = object_index;
191 244
 			foreach (var req in requests.entries)
@@ -201,6 +254,10 @@ namespace LAview.Core {
201 254
 			return composed_objects[object_index];;
202 255
 		}
203 256
 
257
+		/**
258
+		 * Generates PDF document.
259
+		 * @throws Error any print error.
260
+		 */
204 261
 		public Subprocess print_document () throws Error {
205 262
 			foreach (var c in composed_objects)
206 263
 				if (c == false)
@@ -210,6 +267,10 @@ namespace LAview.Core {
210 267
 			return converter.tex2pdf (doc_tex_path(), doc_pdf_path());
211 268
 		}
212 269
 
270
+		/**
271
+		 * Gets out generated LyX document file path.
272
+		 * @throws Error any error.
273
+		 */
213 274
 		public string get_lyx_file_path () throws Error {
214 275
 			foreach (var c in composed_objects)
215 276
 				if (c == false)
@@ -217,6 +278,10 @@ namespace LAview.Core {
217 278
 			return generate_document_lyx();
218 279
 		}
219 280
 
281
+		/**
282
+		 * Gets out generated PDF document file path.
283
+		 * @throws Error any error.
284
+		 */
220 285
 		public string get_pdf_file_path () throws Error {
221 286
 			var pdf_path = Path.build_path (Path.DIR_SEPARATOR_S, AppDirs.cache_dir, "document.pdf");
222 287
 			if (!File.new_for_path(pdf_path).query_exists())
@@ -224,6 +289,10 @@ namespace LAview.Core {
224 289
 			return pdf_path;
225 290
 		}
226 291
 
292
+		/**
293
+		 * Gets data object by its name.
294
+		 * @param name data object name.
295
+		 */
227 296
 		public PluginData get_data_object (string name) {
228 297
 			return data_plugins2[name];
229 298
 		}

+ 5
- 0
src/core/FileUtils.vala View File

@@ -1,3 +1,8 @@
1
+/**
2
+ * LaTeX view.
3
+ *
4
+ * Public system of data view in the LaTeX format.
5
+ */
1 6
 namespace LAview.Core {
2 7
 	void rm_rf (File directory) throws Error {
3 8
 		var children = directory.enumerate_children ("standard::*",

+ 5
- 0
src/core/Templates.vala View File

@@ -1,5 +1,10 @@
1 1
 using GObject, Plugins;
2 2
 
3
+/**
4
+ * LaTeX view.
5
+ *
6
+ * Public system of data view in the LaTeX format.
7
+ */
3 8
 namespace LAview.Core {
4 9
 
5 10
 	/**

Loading…
Cancel
Save