[Pinfo-devel] r171 - pinfo/branches/cxx/src

Nathanael Nerode neroden-guest at costa.debian.org
Tue Sep 6 11:33:17 UTC 2005


Author: neroden-guest
Date: 2005-09-06 11:33:15 +0000 (Tue, 06 Sep 2005)
New Revision: 171

Modified:
   pinfo/branches/cxx/src/mainfunction.cxx
   pinfo/branches/cxx/src/video.cxx
   pinfo/branches/cxx/src/video.h
Log:
Vectorize message in video.cxx.


Modified: pinfo/branches/cxx/src/mainfunction.cxx
===================================================================
--- pinfo/branches/cxx/src/mainfunction.cxx	2005-09-06 11:21:44 UTC (rev 170)
+++ pinfo/branches/cxx/src/mainfunction.cxx	2005-09-06 11:33:15 UTC (rev 171)
@@ -178,8 +178,14 @@
 		key = pinfo_getch();
 		if (key == ERR)
 		{
-			if (statusline == FREE)
-				showscreen(Message, Lines, pos, cursor,infocolumn);
+			if (statusline == FREE) {
+				/* Quick conversion to vector.  Temporary, FIXME. */
+				vector<char *> my_message;
+				for (int x = 0; x < Lines; x++) {
+					my_message.push_back(Message[x]);
+				}
+				showscreen(my_message, Lines, pos, cursor,infocolumn);
+			}
 			waitforgetch();
 			key = pinfo_getch();
 		}

Modified: pinfo/branches/cxx/src/video.cxx
===================================================================
--- pinfo/branches/cxx/src/video.cxx	2005-09-06 11:21:44 UTC (rev 170)
+++ pinfo/branches/cxx/src/video.cxx	2005-09-06 11:33:15 UTC (rev 171)
@@ -24,8 +24,10 @@
 #include "common_includes.h"
 #include <string>
 using std::string;
+#include <vector>
+using std::vector;
 
-void info_add_highlights(int pos, int cursor, long lines, int column, char **message);
+void info_add_highlights(int pos, int cursor, long lines, int column, vector <char *> message);
 
 /*
  * Replace first occurence of substring in string.
@@ -68,7 +70,7 @@
 }
 
 void
-showscreen(char **message, long lines, long pos, long cursor, int column)
+showscreen(vector <char *> message, long lines, long pos, long cursor, int column)
 {
 	long i;
 #ifdef getmaxyx
@@ -141,7 +143,7 @@
 }
 
 void
-info_add_highlights(int pos, int cursor, long lines, int column, char **message)
+info_add_highlights(int pos, int cursor, long lines, int column, vector <char *> message)
 {
 	for (typeof(hyperobjects.size()) i = 0; i < hyperobjects.size(); i++) {
 		if ((hyperobjects[i].line < pos) ||

Modified: pinfo/branches/cxx/src/video.h
===================================================================
--- pinfo/branches/cxx/src/video.h	2005-09-06 11:21:44 UTC (rev 170)
+++ pinfo/branches/cxx/src/video.h	2005-09-06 11:33:15 UTC (rev 171)
@@ -25,7 +25,7 @@
 #define __VIDEO_H
 #include <string>
 /* paints the screen while viewing info file */
-void showscreen (char **message, long lines, long pos,
+void showscreen (std::vector<char *> message, long lines, long pos,
 		long cursor, int column);
 /* prints unselected menu option */
 void mvaddstr_menu (int y, int x, char *line, int linenumber);




More information about the Pinfo-devel mailing list