• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kate

katevirange.cpp

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002  * Copyright (C) 2008 Erlend Hamberg <ehamberg@gmail.com>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) version 3.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; see the file COPYING.LIB.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #include "katevirange.h"
00021 
00022     KateViRange::KateViRange( int slin, int scol, int elin, int ecol, ViMotion::MotionType inc )
00023   : startLine( slin ), startColumn( scol ), endLine( elin ), endColumn( ecol ), motionType( inc )
00024 {
00025   valid = true;
00026   jump = false;
00027 }
00028 
00029 // for motions which only return a position, in constrast to "text objects"
00030 // which returns a range
00031     KateViRange::KateViRange( int elin, int ecol, ViMotion::MotionType inc )
00032   : endLine( elin ), endColumn( ecol ), motionType( inc )
00033 {
00034   startLine = -1;
00035   startColumn = -1;
00036   valid = true;
00037   jump = false;
00038 }
00039 
00040 KateViRange::KateViRange()
00041 {
00042   startLine = -1;
00043   startColumn = -1;
00044   endLine = -1;
00045   endColumn = -1;
00046   valid = true;
00047   jump = false;
00048   motionType = ViMotion::InclusiveMotion;
00049 }
00050 
00051 void KateViRange::normalize()
00052 {
00053     if ( startLine > endLine || ( startLine == endLine && startColumn > endColumn ) ) {
00054         int tempC, tempL;
00055         tempL = startLine;
00056         tempC = startColumn;
00057 
00058         startLine = endLine;
00059         startColumn = endColumn;
00060         endLine = tempL;
00061         endColumn = tempC;
00062     }
00063 }

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal