summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostyantyn Ovechko <fastinetserver@gmail.com>2010-08-05 00:44:42 +0300
committerKostyantyn Ovechko <fastinetserver@gmail.com>2010-08-05 00:44:42 +0300
commit162f048696c45792dd192223fc2786b54d9f0b21 (patch)
treeb2a30780eaf0cdd60b6f89fad931b5f4ca1632c1 /tuiclient
parentFix: scrolling for distfile queue list. (diff)
downloadidfetch-162f048696c45792dd192223fc2786b54d9f0b21.tar.gz
idfetch-162f048696c45792dd192223fc2786b54d9f0b21.tar.bz2
idfetch-162f048696c45792dd192223fc2786b54d9f0b21.zip
Use .o files instead of .cpp in tuiclient.h
Diffstat (limited to 'tuiclient')
-rw-r--r--tuiclient/Makefile7
-rw-r--r--tuiclient/config.h2
-rw-r--r--tuiclient/distfilewindow.cpp1
-rw-r--r--tuiclient/helpwindow.h3
-rw-r--r--tuiclient/mainwindow.cpp2
-rw-r--r--tuiclient/scrollwindow.cpp1
-rw-r--r--tuiclient/scrollwindow.h7
-rw-r--r--tuiclient/shorttypes.h33
-rw-r--r--tuiclient/str.cpp30
-rw-r--r--tuiclient/str.h11
-rw-r--r--tuiclient/tuiclient.cpp4
-rw-r--r--tuiclient/tuiclient.h22
-rw-r--r--tuiclient/tuidistfile.cpp2
-rw-r--r--tuiclient/tuidistfile.h4
-rw-r--r--tuiclient/twindow.cpp3
-rw-r--r--tuiclient/twindow.h1
16 files changed, 106 insertions, 27 deletions
diff --git a/tuiclient/Makefile b/tuiclient/Makefile
index f3176ee..1386b2e 100644
--- a/tuiclient/Makefile
+++ b/tuiclient/Makefile
@@ -38,8 +38,11 @@ all: clean $(BINS)
#
%.o: %.cxx
$(CXX) -c -o $@ $(CXXFLAGS) $^
-%: %.o
- $(CXX) -o $@ $(LIBS) $(CIBS) $^
+#%: %.o
+# $(CXX) -o $@ $(LIBS) $(CIBS) $^
+
+tuiclient: tuiclient.o config.o colors.o distfilewindow.o helpwindow.o log.o mainwindow.o tuidistfile.o twindow.o scrollwindow.o settings.o str.o
+ $(CXX) -o $@ -lncurses -lpthread $(LIBS) $(CIBS) $^
make clean_log:
-rm -f ./logs/*.log
diff --git a/tuiclient/config.h b/tuiclient/config.h
index 27e091e..1816aa1 100644
--- a/tuiclient/config.h
+++ b/tuiclient/config.h
@@ -31,7 +31,7 @@
#include <map>
#include <fstream>
#include "str.h"
-#include "log.h"
+//#include "log.h"
using namespace std;
class Tconfig {
diff --git a/tuiclient/distfilewindow.cpp b/tuiclient/distfilewindow.cpp
index a14ee83..15224f7 100644
--- a/tuiclient/distfilewindow.cpp
+++ b/tuiclient/distfilewindow.cpp
@@ -25,6 +25,7 @@
*/
#include "distfilewindow.h"
+#include "str.h"
void Tdistfile_window::make_frame(){
wclear(window);
diff --git a/tuiclient/helpwindow.h b/tuiclient/helpwindow.h
index 71826f4..3073302 100644
--- a/tuiclient/helpwindow.h
+++ b/tuiclient/helpwindow.h
@@ -33,8 +33,7 @@ using namespace std;
class Thelp_window: public Twindow{
public:
// Thelp_window(int height_, int width_, int y_, int x_);
-// Thelp_window();
- ~Thelp_window(){};
+// Thelp_window(){};
void compose();
};
diff --git a/tuiclient/mainwindow.cpp b/tuiclient/mainwindow.cpp
index 81fc7e9..2493d81 100644
--- a/tuiclient/mainwindow.cpp
+++ b/tuiclient/mainwindow.cpp
@@ -25,6 +25,8 @@
*/
#include "mainwindow.h"
+#include "log.h"
+#include "str.h"
string get_time(string time_format){
try{
diff --git a/tuiclient/scrollwindow.cpp b/tuiclient/scrollwindow.cpp
index 8c84e2e..3714f04 100644
--- a/tuiclient/scrollwindow.cpp
+++ b/tuiclient/scrollwindow.cpp
@@ -25,6 +25,7 @@
*/
#include "scrollwindow.h"
+#include "str.h"
//Tscroll_window::~Tscroll_window(){};
diff --git a/tuiclient/scrollwindow.h b/tuiclient/scrollwindow.h
index bc678d3..35bab8e 100644
--- a/tuiclient/scrollwindow.h
+++ b/tuiclient/scrollwindow.h
@@ -27,10 +27,11 @@
#ifndef _SCROLLWINDOW_H_
#define _SCROLLWINDOW_H_
-const uint SCROLL_LINES_MAX_NUM=200;
-
-#include "twindow.h"
#include <vector>
+#include "twindow.h"
+#include "shorttypes.h"
+
+const uint SCROLL_LINES_MAX_NUM=200;
using namespace std;
class Tscroll_window: public Twindow{
diff --git a/tuiclient/shorttypes.h b/tuiclient/shorttypes.h
new file mode 100644
index 0000000..5d99613
--- /dev/null
+++ b/tuiclient/shorttypes.h
@@ -0,0 +1,33 @@
+/*
+* Copyright (C) 2010 Robin H.Johnson, Ovechko Kostyantyn <fastinetserver@gmail.com>.
+*
+* Project: IDFetch.
+* Developer: Ovechko Kostyantyn Olexandrovich (Kharkiv State Technical University of Construction and Architecture, Ukraine).
+* Mentor: Robin H. Johnson (Gentoo Linux: Developer, Trustee & Infrastructure Lead).
+* Mentoring organization: Gentoo Linux.
+* Sponsored by GSOC 2010.
+*
+* This file is part of Segget.
+*
+* Segget is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* Segget 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with Segget; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _TYPES_H_
+#define _TYPES_H_
+
+typedef unsigned long ulong;
+typedef unsigned int uint;
+
+#endif \ No newline at end of file
diff --git a/tuiclient/str.cpp b/tuiclient/str.cpp
index f831331..26afd36 100644
--- a/tuiclient/str.cpp
+++ b/tuiclient/str.cpp
@@ -35,7 +35,6 @@ long atol(string num_str){
return atol(num_str.c_str());
}
-
Tparts split(string splitter, string str){
Tparts result;
int splitter_pos=str.find(splitter);
@@ -55,12 +54,39 @@ vector <string> split_to_vector(string splitter, string str){
parts.push_back(str);
return parts;
}
-
+/*
template<typename T> string toString(T t){
stringstream s;
s << t;
return s.str();
}
+*/
+
+string toString(uint t){
+ stringstream s;
+ s << t;
+ return s.str();
+}
+string toString(int t){
+ stringstream s;
+ s << t;
+ return s.str();
+}
+string toString(ulong t){
+ stringstream s;
+ s << t;
+ return s.str();
+}
+string toString(long t){
+ stringstream s;
+ s << t;
+ return s.str();
+}
+string toString(bool t){
+ stringstream s;
+ s << t;
+ return s.str();
+}
template<typename T> string field(string prefix,T t, int width){
try{
diff --git a/tuiclient/str.h b/tuiclient/str.h
index ab1ba71..d0e16a9 100644
--- a/tuiclient/str.h
+++ b/tuiclient/str.h
@@ -42,7 +42,16 @@ class Tparts{
{};
};
-template<typename T> string toString(T t);
+
+int atoi(string num_str);
+long atol(string num_str);
+
+//template<typename T> string toString(T t);
+string toString(uint t);
+string toString(int t);
+string toString(ulong t);
+string toString(long t);
+string toString(bool t);
Tparts split(string splitter, string str);
vector <string> split_to_vector(string splitter, string str);
diff --git a/tuiclient/tuiclient.cpp b/tuiclient/tuiclient.cpp
index 5035115..28fc8e8 100644
--- a/tuiclient/tuiclient.cpp
+++ b/tuiclient/tuiclient.cpp
@@ -24,8 +24,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "tuiclient.h"
#include <iostream>
+#include "tuiclient.h"
+#include "str.h"
+
Twindow * next_window(){
cur_window_num++;
diff --git a/tuiclient/tuiclient.h b/tuiclient/tuiclient.h
index 708c843..81fdc38 100644
--- a/tuiclient/tuiclient.h
+++ b/tuiclient/tuiclient.h
@@ -36,17 +36,17 @@
#include <string.h>
#include <ncurses.h>
#include <pthread.h>
-#include "str.cpp"
-#include "twindow.cpp"
-#include "mainwindow.cpp"
-#include "helpwindow.cpp"
-#include "scrollwindow.cpp"
-#include "colors.cpp"
-#include "config.cpp"
-#include "log.cpp"
-#include "settings.cpp"
-#include "tuidistfile.cpp"
-#include "distfilewindow.cpp"
+#include "str.h"
+#include "twindow.h"
+#include "mainwindow.h"
+#include "helpwindow.h"
+#include "scrollwindow.h"
+#include "colors.h"
+#include "config.h"
+#include "log.h"
+#include "settings.h"
+#include "tuidistfile.h"
+#include "distfilewindow.h"
#define BUFFER_SIZE 2000
diff --git a/tuiclient/tuidistfile.cpp b/tuiclient/tuidistfile.cpp
index a6b31a3..5ac5d89 100644
--- a/tuiclient/tuidistfile.cpp
+++ b/tuiclient/tuidistfile.cpp
@@ -25,7 +25,9 @@
*/
#include "tuidistfile.h"
+#include "log.h"
+vector <Ttuidistfile> tuidistfiles;
string Ttuidistfile::statusToString(){
try{
diff --git a/tuiclient/tuidistfile.h b/tuiclient/tuidistfile.h
index f24815c..599dd4d 100644
--- a/tuiclient/tuidistfile.h
+++ b/tuiclient/tuidistfile.h
@@ -28,7 +28,7 @@
#define __TUIDISTFILE_H__
#include <string>
#include <vector>
-
+#include "shorttypes.h"
using namespace std;
enum Tdistfile_status{
@@ -67,7 +67,7 @@ class Ttuidistfile{
string statusToString();
};
-vector <Ttuidistfile> tuidistfiles;
+extern vector <Ttuidistfile> tuidistfiles;
//vector <string> tuidistfiles;
//string tuidistfiles;
diff --git a/tuiclient/twindow.cpp b/tuiclient/twindow.cpp
index fadd8b2..7b2d244 100644
--- a/tuiclient/twindow.cpp
+++ b/tuiclient/twindow.cpp
@@ -25,7 +25,7 @@
*/
#include "twindow.h"
-
+#include "str.h"
string sms;
void Twindow::init(string caption_, int height_, int width_, int y_, int x_){
@@ -108,7 +108,6 @@ void Twindow::make_frame(){
mvwaddstr(window,0,(width-caption.length())/2,caption.c_str());
// msg_short(0,width-20,"[Lines:"+toString(top_position+1)+"-"+toString(top_position+bottom_screenline_num)+"/"+toString(max_received_screenline_num)+"]");
// msg_short(0,width-20,"[Lines:"+toString(top_position+1)+"-"+toString(top_position+bottom_screenline_num)+"/"+toString(screen_lines.size())+"]");
- msg_short(height-1,width-27,"[Up/Dn/PgUp/PgDn - scroll]");
}
void Twindow::refresh(){
diff --git a/tuiclient/twindow.h b/tuiclient/twindow.h
index 533b101..baff7d9 100644
--- a/tuiclient/twindow.h
+++ b/tuiclient/twindow.h
@@ -28,6 +28,7 @@
#define _TWINDOW_H_
#include <ncurses.h>
+#include <string>
#include <sys/types.h>
#include "colors.h"
//#include "tuiclient.h"