OSDN Git Service

* Implement: (API) LibEditText_GetCursorPosition() (non-Tested)
authorKoine Yuusuke(koinec) <koinec@users.sourceforge.jp>
Wed, 1 Jul 2015 11:27:10 +0000 (20:27 +0900)
committerKoine Yuusuke(koinec) <koinec@users.sourceforge.jp>
Wed, 1 Jul 2015 11:27:10 +0000 (20:27 +0900)
* Implement: (API) LibEditText_GetMaxLines() (non-Tested)

include/libedittext.h
libedittext/drd64_libedittext_cursorapi_info.c
libedittext/test_libedittext_cursorapi.c

index cf034b5..be98d1f 100644 (file)
@@ -97,6 +97,11 @@ LIBEDITTEXT_API_LINEAPI
 #endif
 
 LIBEDITTEXT_API_CURSORAPI_INFO
+       int LibEditText_GetCursorPosition(
+                       int i_tinfoid, int i_curid, DWord *pdw_curline, DWord *pdw_curpos );
+LIBEDITTEXT_API_CURSORAPI_INFO
+       DWord LibEditText_GetMaxLines( int i_tinfoid ); 
+LIBEDITTEXT_API_CURSORAPI_INFO
        const char *LibEditText_GetCursorRangeNextString( int i_tinfoid, int i_curid, DWord *pdw_len );
 LIBEDITTEXT_API_CURSORAPI_INFO
        const char * LibEditText_GetCursorRangeString( int i_tinfoid, int i_curid, DWord *pdw_len );
index 634b3f7..160eafd 100644 (file)
@@ -71,6 +71,8 @@ int
 
        
 /***********************************************************************
+  GetMaxLines
+  GetCursorPosition
   * GetCursorRangeString
   * GetCursorRangeNextString
   * GetCursorStartString
@@ -83,6 +85,54 @@ int
 
 
 /***********************************************************************
+***********************************************************************/
+LIBEDITTEXT_API_CURSORAPI_INFO
+int
+       LibEditText_GetCursorPosition(
+                       int             i_tinfoid,
+                       int             i_curid,
+                       DWord   *pdw_curline,
+                       DWord   *pdw_curpos )
+{
+       LibEditText_TextInfo    *p_tinfo;
+       LibEditText_Cursor              *p_cursor;
+
+       p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
+       if( NULL == p_tinfo )   {
+               return -0x01;
+       }
+
+       p_cursor        = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
+       if( NULL == p_cursor )  {
+               return -0x02;
+       }
+
+       if( NULL != pdw_curline )       { *pdw_curline  = p_cursor->dw_line; }
+       if( NULL != pdw_curpos )        { *pdw_curpos   = p_cursor->dw_pos; }
+
+       return  0x00;
+}
+
+       
+/***********************************************************************
+***********************************************************************/
+LIBEDITTEXT_API_CURSORAPI_INFO
+DWord
+       LibEditText_GetMaxLines(
+                       int             i_tinfoid )
+{
+       LibEditText_TextInfo    *p_tinfo;
+
+       p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
+       if( NULL == p_tinfo )   {
+               return MAXLINES;
+       }
+
+       return  p_tinfo->dw_maxline;
+}
+
+       
+/***********************************************************************
 Implemented
 ***********************************************************************/
 LIBEDITTEXT_API_CURSORAPI_INFO
index 4c0bf5c..ed362e2 100644 (file)
@@ -119,6 +119,9 @@ void Test_LibEditText_API_CursorAPI_test00_001(void)
 
        /* TestPhase B --- CursorMove & Jump ========================*/
        /* Move Up/Down/Left/Right/Start/End & Jump */
+       i_result        = LibEditText_JumpCursor( i_tinfoid, i_curid, 0 );
+       CU_ASSERT( 0x00 == i_result );
+
 
        /* TestPhase C --- Delete Data ==============================*/
        /* Test 30 --- JoinLine */