[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: KWrite update
From:       John Birch <jbb () kdevelop ! org>
Date:       2001-04-17 20:38:29
[Download RAW message or body]

Hmmm,

Lets be very clear about this.

KDEVELOP_1_4 branch is dead after the kde2.2 release. If you want to continue 
hacking on it for yourselves, then that's your decision. Just remember that 
there is no official kdevelop release planned for this and there shouldn't be.

Adding a kwrite part now to kdevelop2.0 is not really a good idea. We have 
what we need in our current kwrite. If you want to add horizontal scroll bars 
to this, then please work on it. I've attached Jens last patch as a starting 
point. IIRC speed is the issue with it. Make sure you also test scrolling 
speed as well.

It would be much better if people work on the _real_ outstanding problems in 
the current code. There are several crashes to do with mdi, theres the 
makefile problem if you don't have a makefile. I've a small fix for the 
debugger etc etc etc

From the release plan at
(http://developer.kde.org/development-versions/kde-2.2-release-plan.html)

our next milestone is KDE 2.2 Beta 1 - Monday May 7.

Lets just keep focus on the goals here

jbb


On Wed, 18 Apr 2001 06:22, Roland Krause wrote:
> --- "F@lk Brettschneider" <gigafalk@yahoo.com> wrote:
> > Roland Krause wrote:
> > > Roland
> >
> > The pro is that Kate seems to have a well-designed architecture and a
> > good maintainance.
> > The con is that our 1_4 kwrite version is pretty stable and ready to
> > use
> > except the horizontal scrollbar problem.
>
> Gotta have a look at "Kate" :-)
>
> > One would decide for our kwrite version under the policy that 1_4 is
> > dead after 2.0.
> > Another one would decide for Kate under the policy that life goes on
> > on
> > branch 1_4.
>
> Life goes on, it always does (/me singing that Beatles song... :-)
>
> Seriously, I was most interested in seeing how much has changed in the
> core and whether these changes can be backported to KDEVELOP_1_4. To
> me, it makes no sense even releasing KDEVELOP_1_4 has kdevelop-2 if we
> are not serious with it. People *will* use this version for months if
> not years. So I think, especially if Christian gives us a hand, it's
> worthwhile.
>
> The big question is, can we define those parts of kwrite that we can
> use in a black box manner?
>
> Roland
>
> > Ciao,
> > F@lk
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> > -
> > to unsubscribe from this list send an email to
> > kdevelop-devel-request@kdevelop.org with the following body:
> > unsubscribe »your-email-address«
>
> =====
> --
> Roland Krause
> In the garage of life there are mechanics and
> there are drivers. Mechanics wanted!
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> -
> to unsubscribe from this list send an email to
> kdevelop-devel-request@kdevelop.org with the following body: unsubscribe
> »your-email-address«

["hs_bar2.diff" (text/x-c++)]

? kdevelop-1.4-my/hscroll.diff
? kdevelop-1.4-my/doc/de/about/Makefile
? kdevelop-1.4-my/doc/de/about/Makefile.in
? kdevelop-1.4-my/kdevelop/.kdbgrc.kdevelop
Index: kdevelop-1.4-my/kdevelop/ckdevelop_noslot.cpp
===================================================================
RCS file: /cvs/kdevelop/kdevelop/Attic/ckdevelop_noslot.cpp,v
retrieving revision 1.72.2.41.2.33
diff -u -3 -p -r1.72.2.41.2.33 ckdevelop_noslot.cpp
--- kdevelop-1.4-my/kdevelop/ckdevelop_noslot.cpp	2001/02/11 04:20:00	1.72.2.41.2.33
+++ kdevelop-1.4-my/kdevelop/ckdevelop_noslot.cpp	2001/02/25 15:43:55
@@ -1108,7 +1108,7 @@ void CKDevelop::readOptions()
 {
   //default geometry on first startup, saved geometry is set by \
applyMainWindowSettings afterwards  //  \
setGeometry(QApplication::desktop()->width()/2-400, \
                QApplication::desktop()->height()/2-300, 800, 600);
-	showMaximized();
+//	showMaximized();
   applyMainWindowSettings(config);
 
   config->setGroup("General Options");
Index: kdevelop-1.4-my/kdevelop/kwrite/kwdoc.cpp
===================================================================
RCS file: /cvs/kdevelop/kdevelop/kwrite/Attic/kwdoc.cpp,v
retrieving revision 1.5.2.14.2.12
diff -u -3 -p -r1.5.2.14.2.12 kwdoc.cpp
--- kdevelop-1.4-my/kdevelop/kwrite/kwdoc.cpp	2001/02/07 02:47:42	1.5.2.14.2.12
+++ kdevelop-1.4-my/kdevelop/kwrite/kwdoc.cpp	2001/02/25 15:44:04
@@ -113,7 +113,7 @@ void TextLine::del(int pos, int n) {
   }
 }
 
-int TextLine::length() {
+int TextLine::length() const {
   return len;
 }
 
@@ -188,21 +188,21 @@ void TextLine::setAttr(int attribute) {
   attr = (attr & taSelectMask) | attribute;
 }
 
-int TextLine::getAttr(int pos) {
+int TextLine::getAttr(int pos) const {
   if (pos < len) return attribs[pos] & taAttrMask;
   return attr & taAttrMask;
 }
 
-int TextLine::getAttr() {
+int TextLine::getAttr() const {
   return attr & taAttrMask;
 }
 
-int TextLine::getRawAttr(int pos) {
+int TextLine::getRawAttr(int pos) const {
   if (pos < len) return attribs[pos];
   return (attr & taSelectMask) ? attr : attr | 256;
 }
 
-int TextLine::getRawAttr() {
+int TextLine::getRawAttr() const{
   return attr;
 }
 
@@ -765,6 +765,8 @@ void KWriteDoc::loadFile(QIODevice &dev)
     }
   } while (s != buf);
   highlight->doPreHighlight( contents );
+  longestLine = NULL;
+  updateMaxLength(longestLine);
 #endif
 
 //  updateLines();
@@ -1271,10 +1273,13 @@ void KWriteDoc::updateLines(int startLin
 }
 
 
-void KWriteDoc::updateMaxLength(TextLine *textLine) {
+void KWriteDoc::updateMaxLength( const TextLine *textLine) {
   int len;
 
-  len = textWidth(textLine,textLine->length());
+  if ( textLine )
+    len = textWidth(textLine,textLine->length());
+  else
+    len = -1;
 
   if (len > maxLength) {
     longestLine = textLine;
@@ -1282,12 +1287,14 @@ void KWriteDoc::updateMaxLength(TextLine
     newDocGeometry = true;
   } else {
     if (!longestLine || (textLine == longestLine && len <= maxLength*3/4)) {
+      // longestLine not set or currently being shortened -> search for new longest \
line  maxLength = -1;
-      for (textLine = contents.first(); textLine != 0L; textLine = contents.next()) \
                {
-        len = textWidth(textLine,textLine->length());
+      TextLine *line;
+      for (line = contents.first(); line != 0L; line = contents.next()) {
+        len = textWidth(line,line->length());
         if (len > maxLength) {
           maxLength = len;
-          longestLine = textLine;
+          longestLine = line;
         }
       }
       newDocGeometry = true;
@@ -1317,7 +1324,7 @@ void KWriteDoc::updateViews(KWriteView *
 }
 
 
-int KWriteDoc::textWidth(TextLine *textLine, int cursorX) {
+int KWriteDoc::textWidth( const TextLine *textLine, const int cursorX) {
   int x;
   int z;
   char ch;
@@ -2545,6 +2552,8 @@ void KWriteDoc::setFileName(const QStrin
 	// Read bookmarks, breakpoints, ...
 	readFileConfig();
   updateViews();
+  longestLine = NULL;
+  updateMaxLength(longestLine);
 }
 
 void KWriteDoc::clearFileName() {
Index: kdevelop-1.4-my/kdevelop/kwrite/kwdoc.h
===================================================================
RCS file: /cvs/kdevelop/kdevelop/kwrite/Attic/kwdoc.h,v
retrieving revision 1.5.2.6.2.7
diff -u -3 -p -r1.5.2.6.2.7 kwdoc.h
--- kdevelop-1.4-my/kdevelop/kwrite/kwdoc.h	2001/02/07 02:47:43	1.5.2.6.2.7
+++ kdevelop-1.4-my/kdevelop/kwrite/kwdoc.h	2001/02/25 15:44:04
@@ -27,7 +27,7 @@ class TextLine {
     void overwrite(int pos, const char *, int l);
     void append(char, int n = 1);
     void del(int pos,int l = 1);
-    int length();
+    int length() const;
     void setLength(int l);
 
     void wrap(TextLine *nextLine, int pos);
@@ -40,10 +40,10 @@ class TextLine {
 
     void setAttribs(int attribute, int start, int end);
     void setAttr(int attribute);
-    int getAttr(int pos);
-    int getAttr();
-    int getRawAttr(int pos);
-    int getRawAttr();
+    int getAttr(int pos) const;
+    int getAttr() const;
+    int getRawAttr(int pos) const;
+    int getRawAttr() const;
 
     void setContext(int context);
     int getContext();
@@ -212,10 +212,10 @@ class KWriteDoc : QObject {
     void updateFontData();
     void setTabWidth(int);
     void updateLines(int startLine = 0, int endLine = 0xffffff, int flags = 0);
-    void updateMaxLength(TextLine *);
+    void updateMaxLength( const TextLine *);
     void updateViews(KWriteView *exclude = 0L);
 
-    int textWidth(TextLine *, int cursorX);
+    int textWidth( const TextLine *, const int cursorX);
     int textWidth(PointStruc &cursor);
     int textWidth(bool wrapCursor, PointStruc &cursor, int xPos);
     int textPos(TextLine *, int xPos);
@@ -307,7 +307,7 @@ class KWriteDoc : QObject {
     QList<KWriteView> views;
     bool newDocGeometry;
 
-    TextLine *longestLine;
+    TextLine const *longestLine;
     int maxLength;
 
     PointStruc select;
Index: kdevelop-1.4-my/kdevelop/kwrite/kwview.cpp
===================================================================
RCS file: /cvs/kdevelop/kdevelop/kwrite/Attic/kwview.cpp,v
retrieving revision 1.9.2.19.2.20
diff -u -3 -p -r1.9.2.19.2.20 kwview.cpp
--- kdevelop-1.4-my/kdevelop/kwrite/kwview.cpp	2001/02/18 10:30:54	1.9.2.19.2.20
+++ kdevelop-1.4-my/kdevelop/kwrite/kwview.cpp	2001/02/25 15:44:07
@@ -587,14 +587,14 @@ void KWriteView::changeYPos(int p) {
   startLine = yPos / kWriteDoc->fontHeight;
   endLine = (yPos + height() -1) / kWriteDoc->fontHeight;
   if (QABS(dy) < height())
-	{
-		leftBorder->scroll(0,dy);
+  {
+    leftBorder->scroll(0,dy);
     scroll(0,dy);
-	}
+  }
   else
-	{
+  {
     QWidget::update();
-	}
+  }
 }
 
 void KWriteView::getVConfig(VConfig &c) {
@@ -783,7 +783,7 @@ void KWriteView::updateView(int flags, i
     w = kWrite->width() - 4;
     h = kWrite->height() - 4;
 
-    xMax = kWriteDoc->textWidth() - w;
+    xMax = kWriteDoc->textWidth() - w + iconBorderWidth;
     b = (xPos > 0 || xMax > 0);
     if (b) h -= 16;
     yMax = kWriteDoc->textHeight() - h;
@@ -887,7 +887,6 @@ void KWriteView::updateView(int flags, i
 
     if (b) {
       repaint(0, 0, width(), height(), false);
-
     } else {
       if(dy) leftBorder->scroll(0,dy);
 
@@ -1362,7 +1361,7 @@ void KWriteView::paintEvent(QPaintEvent 
   y = line*h - yPos;
   yEnd = updateR.y() + updateR.height();
 
- int textLineCount = kWriteDoc->getTextLineCount()-1;
+  int textLineCount = kWriteDoc->getTextLineCount()-1;
   while (y < yEnd)
   {
     if (textLineCount>line)


-
to unsubscribe from this list send an email to kdevelop-devel-request@kdevelop.org \
with the following body: unsubscribe »your-email-address«



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic