1 /*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
4 for INTEL64(R), AMD64(R)
6 Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
11 1. Redistributions of source code must retain the above copyright notice,
12 this list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
17 THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
18 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 OF THE POSSIBILITY OF SUCH DAMAGE.
29 DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
31 /* File Info -----------------------------------------------------------
35 ----------------------------------------------------------------------*/
37 #define DRD64_SRC_LIBEDITTEXT_CURSORAPI
38 #include"drd64_libedittext.h"
40 #define LOCATION(n) DRD64_ERR_LOCATION( \
41 DRD64_ERROR_MODULE_LIBEDITTEXT, DRD64_ERROR_ARCH_NODEPEND, \
42 DRD64_SRC_LIBEDITTEXT_CURSORAPI_SRCID, (n))
44 /***********************************************************************
60 ***********************************************************************/
63 /***********************************************************************
64 ***********************************************************************/
65 /*LIBEDITTEXT_API_CURSORAPI
67 LibEditText_MoveEndCursor(
72 LibEditText_TextInfo *p_tinfo;
73 LibEditText_Cursor *p_cursor;
74 LibEditText_LineInfo *p_line;
76 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
77 if( NULL == p_tinfo ) {
81 p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
82 if( NULL == p_cursor ) {
86 p_line = LINFO(p_tinfo, p_cursor->dw_lineid);
87 if( NULL == p_line ) {
91 i_result = LibEditText_CursorMove_MoveRight( p_tinfo, p_cursor, dw_len );
96 /***********************************************************************
97 ***********************************************************************/
98 LIBEDITTEXT_API_CURSORAPI
100 LibEditText_MoveUpCursor(
106 LibEditText_TextInfo *p_tinfo;
107 LibEditText_Cursor *p_cursor;
109 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
110 if( NULL == p_tinfo ) {
114 p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
115 if( NULL == p_cursor ) {
119 i_result = LibEditText_CursorMove_MoveUp( p_tinfo, p_cursor, dw_lines );
124 /***********************************************************************
125 ***********************************************************************/
126 LIBEDITTEXT_API_CURSORAPI
128 LibEditText_MoveDownCursor(
134 LibEditText_TextInfo *p_tinfo;
135 LibEditText_Cursor *p_cursor;
137 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
138 if( NULL == p_tinfo ) {
142 p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
143 if( NULL == p_cursor ) {
147 i_result = LibEditText_CursorMove_MoveDown( p_tinfo, p_cursor, dw_lines );
152 /***********************************************************************
153 ***********************************************************************/
154 LIBEDITTEXT_API_CURSORAPI
156 LibEditText_MoveRightCursor(
162 LibEditText_TextInfo *p_tinfo;
163 LibEditText_Cursor *p_cursor;
165 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
166 if( NULL == p_tinfo ) {
170 p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
171 if( NULL == p_cursor ) {
175 i_result = LibEditText_CursorMove_MoveRight( p_tinfo, p_cursor, dw_len );
180 /***********************************************************************
181 ***********************************************************************/
182 LIBEDITTEXT_API_CURSORAPI
184 LibEditText_MoveLeftCursor(
190 LibEditText_TextInfo *p_tinfo;
191 LibEditText_Cursor *p_cursor;
193 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
194 if( NULL == p_tinfo ) {
198 p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
199 if( NULL == p_cursor ) {
203 i_result = LibEditText_CursorMove_MoveLeft( p_tinfo, p_cursor, dw_len );
208 /***********************************************************************
209 ***********************************************************************/
210 LIBEDITTEXT_API_CURSORAPI
212 LibEditText_JumpCursor(
218 LibEditText_TextInfo *p_tinfo;
219 LibEditText_Cursor *p_cursor;
221 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
222 if( NULL == p_tinfo ) {
226 p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
227 if( NULL == p_cursor ) {
231 i_result = LibEditText_CursorInfo_JumpCursor( p_tinfo, p_cursor, dw_line );
237 /***********************************************************************
238 ***********************************************************************/
239 LIBEDITTEXT_API_CURSORAPI
241 LibEditText_AllocCursor(
246 LibEditText_TextInfo *p_tinfo;
248 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
249 if( NULL == p_tinfo ) {
253 i_curid = LibEditText_CursorInfo_AllocCursor( p_tinfo, dw_ranges );
259 /***********************************************************************
260 ***********************************************************************/
261 LIBEDITTEXT_API_CURSORAPI
263 LibEditText_FreeCursor(
268 LibEditText_TextInfo *p_tinfo;
270 p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
271 if( NULL == p_tinfo ) {
275 i_result = LibEditText_CursorInfo_FreeCursor( p_tinfo, i_curid );
282 /* EOF of drd64_.c ----------------------------------- */