From 93820f1ea7afb270758e286246c3757622fb0016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 26 Apr 2006 10:16:19 +0000 Subject: [PATCH] Renamed moreUTF8.h to utf8_functions.h. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17239 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../{moreUTF8.h => utf8_functions.h} | 10 +- src/kits/interface/BTextView/UndoBuffer.cpp | 99 +++++++++---------- src/kits/interface/BTextView/WidthBuffer.cpp | 47 ++++----- src/kits/interface/Font.cpp | 21 ++-- src/kits/interface/InterfaceDefs.cpp | 2 +- src/servers/app/ServerFont.cpp | 10 +- .../Painter/font_support/AGGTextRenderer.cpp | 2 +- 7 files changed, 85 insertions(+), 106 deletions(-) rename headers/private/interface/{moreUTF8.h => utf8_functions.h} (95%) diff --git a/headers/private/interface/moreUTF8.h b/headers/private/interface/utf8_functions.h similarity index 95% rename from headers/private/interface/moreUTF8.h rename to headers/private/interface/utf8_functions.h index a1ff7e38fe..c7d740e894 100644 --- a/headers/private/interface/moreUTF8.h +++ b/headers/private/interface/utf8_functions.h @@ -1,5 +1,9 @@ -#ifndef __MOREUTF8 -#define __MOREUTF8 +/* + * Copyright 2004-2006, Haiku, Inc. + * Distributed under the terms of the MIT License. + */ +#ifndef _UTF8_FUNCTIONS_H +#define _UTF8_FUNCTIONS_H #include @@ -205,4 +209,4 @@ UTF8ToLength(const char *bytes) return length; } -#endif // __MOREUTF8 +#endif // _UTF8_FUNCTIONS_H diff --git a/src/kits/interface/BTextView/UndoBuffer.cpp b/src/kits/interface/BTextView/UndoBuffer.cpp index 1cd9357365..c04c64596d 100644 --- a/src/kits/interface/BTextView/UndoBuffer.cpp +++ b/src/kits/interface/BTextView/UndoBuffer.cpp @@ -1,46 +1,30 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2003, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: UndoBuffer.cpp -// Author: Stefano Ceccherini (burton666@libero.it) -// Description: _BUndoBuffer_ and its subclasses -// handle different types of Undo operations. -//------------------------------------------------------------------------------ +/* + * Copyright 2003-2006, Haiku, Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Stefano Ceccherini (burton666@libero.it) + */ -// Standard Includes ----------------------------------------------------------- -#include -#include -#include +//! _BUndoBuffer_ and its subclasses handle different types of Undo operations. + + +#include "UndoBuffer.h" +#include "utf8_functions.h" -// System Includes ------------------------------------------------------------- #include -// Local Includes -------------------------------------------------------------- -#include "moreUTF8.h" -#include "UndoBuffer.h" +#include +#include +#include -// TODO: document properly this file +// TODO: properly document this file + + +// #pragma mark - _BUndoBuffer_ + -// ******** _BUndoBuffer_ ******* _BUndoBuffer_::_BUndoBuffer_(BTextView *textView, undo_state state) : fTextView(textView), @@ -101,10 +85,11 @@ _BUndoBuffer_::RedoSelf(BClipboard *clipboard) } -// ******** _BCutUndoBuffer_ ******* +// #pragma mark - _BCutUndoBuffer_ + + _BCutUndoBuffer_::_BCutUndoBuffer_(BTextView *textView) - : - _BUndoBuffer_(textView, B_UNDO_CUT) + : _BUndoBuffer_(textView, B_UNDO_CUT) { } @@ -135,11 +120,12 @@ _BCutUndoBuffer_::RedoSelf(BClipboard *clipboard) } -// ******** _BPasteUndoBuffer_ ******* +// #pragma mark - _BPasteUndoBuffer_ + + _BPasteUndoBuffer_::_BPasteUndoBuffer_(BTextView *textView, const char *text, - int32 textLen, text_run_array *runArray, int32 runArrayLen) - : - _BUndoBuffer_(textView, B_UNDO_PASTE), + int32 textLen, text_run_array *runArray, int32 runArrayLen) + : _BUndoBuffer_(textView, B_UNDO_PASTE), fPasteText(NULL), fPasteTextLength(textLen), fPasteRunArray(NULL), @@ -183,10 +169,11 @@ _BPasteUndoBuffer_::RedoSelf(BClipboard *clipboard) } -// ******** _BClearUndoBuffer_ ******* +// #pragma mark - _BClearUndoBuffer_ + + _BClearUndoBuffer_::_BClearUndoBuffer_(BTextView *textView) - : - _BUndoBuffer_(textView, B_UNDO_CLEAR) + : _BUndoBuffer_(textView, B_UNDO_CLEAR) { } @@ -204,12 +191,13 @@ _BClearUndoBuffer_::RedoSelf(BClipboard *clipboard) } -// ******** _BDropUndoBuffer_ ******** -_BDropUndoBuffer_::_BDropUndoBuffer_(BTextView *textView, char const *text, int32 textLen, - text_run_array *runArray, int32 runArrayLen, int32 location, - bool internalDrop) - : - _BUndoBuffer_(textView, B_UNDO_DROP), +// #pragma mark - _BDropUndoBuffer_ + + +_BDropUndoBuffer_::_BDropUndoBuffer_(BTextView *textView, char const *text, + int32 textLen, text_run_array *runArray, int32 runArrayLen, + int32 location, bool internalDrop) + : _BUndoBuffer_(textView, B_UNDO_DROP), fDropText(NULL), fDropTextLength(textLen), fDropRunArray(NULL) @@ -264,10 +252,11 @@ _BDropUndoBuffer_::RedoSelf(BClipboard *) } -// ******** _BTypingUndoBuffer_ ******** +// #pragma mark - _BTypingUndoBuffer_ + + _BTypingUndoBuffer_::_BTypingUndoBuffer_(BTextView *textView) - : - _BUndoBuffer_(textView, B_UNDO_TYPING), + : _BUndoBuffer_(textView, B_UNDO_TYPING), fTypedText(NULL), fTypedStart(fStart), fTypedEnd(fEnd), diff --git a/src/kits/interface/BTextView/WidthBuffer.cpp b/src/kits/interface/BTextView/WidthBuffer.cpp index 066e1ad797..a2bf9e04d1 100644 --- a/src/kits/interface/BTextView/WidthBuffer.cpp +++ b/src/kits/interface/BTextView/WidthBuffer.cpp @@ -1,47 +1,34 @@ /* - * Copyright (c) 2003-2004 Haiku, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. + * Copyright 2003-2006, Haiku, Inc. + * Distributed under the terms of the MIT License. * - * File: WidthBuffer.cpp - * Author: Stefano Ceccherini (burton666@libero.it) - * Description: Caches string widths in a hash table, to avoid a trip to - * the app server. + * Authors: + * Stefano Ceccherini (burton666@libero.it) */ -#include -#include -#include "moreUTF8.h" +//! Caches string widths in a hash table, to avoid a trip to the app server. + + +#include "utf8_functions.h" #include "TextGapBuffer.h" #include "WidthBuffer.h" -#include +#include +#include + +#include + const static uint32 kTableCount = 128; const static uint32 kInvalidCode = 0xFFFFFFFF; -struct hashed_escapement -{ +struct hashed_escapement { uint32 code; float escapement; - hashed_escapement() { + + hashed_escapement() + { code = kInvalidCode; escapement = 0; } diff --git a/src/kits/interface/Font.cpp b/src/kits/interface/Font.cpp index 64dbcd6cff..425b7722dc 100644 --- a/src/kits/interface/Font.cpp +++ b/src/kits/interface/Font.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku, Inc. + * Copyright 2001-2006, Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -9,10 +9,12 @@ */ -#include - -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -20,15 +22,12 @@ #include #include #include -#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include using namespace std; diff --git a/src/kits/interface/InterfaceDefs.cpp b/src/kits/interface/InterfaceDefs.cpp index 9a1d589197..e4dffe104c 100644 --- a/src/kits/interface/InterfaceDefs.cpp +++ b/src/kits/interface/InterfaceDefs.cpp @@ -10,8 +10,8 @@ /** Global functions and variables for the Interface Kit */ -#include "moreUTF8.h" #include "truncate_string.h" +#include "utf8_functions.h" #include #include diff --git a/src/servers/app/ServerFont.cpp b/src/servers/app/ServerFont.cpp index d072e7046d..606ed6f35f 100644 --- a/src/servers/app/ServerFont.cpp +++ b/src/servers/app/ServerFont.cpp @@ -9,20 +9,20 @@ */ -#include -#include -#include +#include "ServerFont.h" #include "Angle.h" #include "FontManager.h" -#include "moreUTF8.h" #include "truncate_string.h" +#include "utf8_functions.h" #include FT_FREETYPE_H #include FT_GLYPH_H #include FT_OUTLINE_H -#include "ServerFont.h" +#include +#include +#include // functions needed to convert a freetype vector graphics to a BShape diff --git a/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp b/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp index e50307976f..87521eb545 100644 --- a/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp +++ b/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp @@ -7,8 +7,8 @@ #include "AGGTextRenderer.h" #include "FontManager.h" -#include "moreUTF8.h" #include "ServerFont.h" +#include "utf8_functions.h" #include #include