#endif
LIBEDITTEXT_API_CURSORAPI_INFO
- const char *LibEditText_GetCursorLineString( int i_tinfoid, int i_curid );
+ const char *LibEditText_GetCursorRangeNextString( int i_tinfoid, int i_curid, DWord *pdw_len );
LIBEDITTEXT_API_CURSORAPI_INFO
- DWord LibEditText_GetCursorLineLength( int i_tinfoid, int i_curid );
+ const char * LibEditText_GetCursorRangeString( int i_tinfoid, int i_curid, DWord *pdw_len );
+LIBEDITTEXT_API_CURSORAPI_INFO
+ const char *LibEditText_GetCursorEndString( int i_tinfoid, int i_curid, DWord *pdw_len );
+LIBEDITTEXT_API_CURSORAPI_INFO
+ const char *LibEditText_GetCursorStartString( int i_tinfoid, int i_curid, DWord *pdw_len );
+LIBEDITTEXT_API_CURSORAPI_INFO
+ const char *LibEditText_GetCursorLineString( int i_tinfoid, int i_curid, DWord *pdw_len );
LIBEDITTEXT_API_CURSORAPI_INFO
int LibEditText_AllocCursor( int i_tinfid, DWord dw_ranges );
LIBEDITTEXT_API_CURSORAPI_INFO
DRD64_SRC_LIBEDITTEXT_CURSORAPI_INFO_SRCID, (n))
/***********************************************************************
- * GetCursorLineString
- * GetCursorLineLength
- * AllocCursor
- * FreeCursor
-***********************************************************************/
-
-
-/***********************************************************************
***********************************************************************/
/*
LIBEDITTEXT_API_CURSORAPI_INFO
/***********************************************************************
+ * GetCursorRangeString
+ * GetCursorRangeNextString
+ * GetCursorStartString
+ * GetCursorEndString
+ * GetCursorLineString
+ * GetCursorLineLength
+ * AllocCursor
+ * FreeCursor
+***********************************************************************/
+
+
+/***********************************************************************
+Implemented
***********************************************************************/
LIBEDITTEXT_API_CURSORAPI_INFO
const char *
- LibEditText_GetCursorLineString(
+ LibEditText_GetCursorRangeNextString(
int i_tinfoid,
- int i_curid )
+ int i_curid,
+ DWord *pdw_len )
{
- Byte *pb_str;
+ Byte *pb_data;
LibEditText_TextInfo *p_tinfo;
LibEditText_Cursor *p_cursor;
LibEditText_LineInfo *p_line;
return NULL;
}
- p_line = LINFO(p_tinfo, p_cursor->dw_lineid);
+ if( p_cursor->dw_now_rngline == p_cursor->dw_rangelines ) { return NULL; }
+
+ p_line = LINFO(p_tinfo, p_cursor->dw_now_linfoid);
+ if( NULL == p_line ) {
+ return NULL;
+ }
+
+ if( NULL != pdw_len ) { *pdw_len = p_line->dw_strlen; }
+ pb_data = p_tinfo->pb_text + p_line->dw_start;
+
+ p_cursor->dw_now_linfoid = p_line->dw_next;
+ p_cursor->dw_now_rngline++;
+
+ return (const char *)pb_data;
+}
+
+
+/***********************************************************************
+Implemented
+***********************************************************************/
+LIBEDITTEXT_API_CURSORAPI_INFO
+const char *
+ LibEditText_GetCursorRangeString(
+ int i_tinfoid,
+ int i_curid,
+ DWord *pdw_len )
+{
+ Byte *pb_data;
+ LibEditText_TextInfo *p_tinfo;
+ LibEditText_Cursor *p_cursor;
+ LibEditText_LineInfo *p_line;
+
+ p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
+ if( NULL == p_tinfo ) {
+ return NULL;
+ }
+
+ p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
+ if( NULL == p_cursor ) {
+ return NULL;
+ }
+
+ if( 0 == p_cursor->dw_rangelines ) { return NULL; }
+
+ p_line = LINFO(p_tinfo, p_cursor->dw_start_lineid);
assert( NULL != p_line );
- pb_str = p_tinfo->pb_text + p_line->dw_start;
+ if( NULL != pdw_len ) { *pdw_len = p_line->dw_strlen; }
+ pb_data = p_tinfo->pb_text + p_line->dw_start;
+
+ p_cursor->dw_now_linfoid = p_line->dw_next;
+ p_cursor->dw_now_rngline = 1;
- return (const char *)pb_str;
+ return (const char *)pb_data;
}
/***********************************************************************
+Implemented
***********************************************************************/
LIBEDITTEXT_API_CURSORAPI_INFO
-DWord
- LibEditText_GetCursorLineLength(
+const char *
+ LibEditText_GetCursorEndString(
int i_tinfoid,
- int i_curid )
+ int i_curid,
+ DWord *pdw_len )
+{
+ Byte *pb_data;
+ LibEditText_TextInfo *p_tinfo;
+ LibEditText_Cursor *p_cursor;
+ LibEditText_LineInfo *p_line;
+
+ p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
+ if( NULL == p_tinfo ) {
+ return NULL;
+ }
+
+ p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
+ if( NULL == p_cursor ) {
+ return NULL;
+ }
+
+ if( 0 == p_cursor->dw_rangelines ) { return NULL; }
+
+ p_line = LINFO(p_tinfo, p_cursor->dw_end_lineid);
+
+ if( NULL != pdw_len ) { *pdw_len = p_line->dw_strlen; }
+
+ pb_data = p_tinfo->pb_text + p_line->dw_start;
+
+ return (const char *)pb_data;
+}
+
+
+/***********************************************************************
+Implemented
+***********************************************************************/
+LIBEDITTEXT_API_CURSORAPI_INFO
+const char *
+ LibEditText_GetCursorStartString(
+ int i_tinfoid,
+ int i_curid,
+ DWord *pdw_len )
{
+ Byte *pb_data;
LibEditText_TextInfo *p_tinfo;
LibEditText_Cursor *p_cursor;
LibEditText_LineInfo *p_line;
p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
if( NULL == p_tinfo ) {
- return MAXLINES;
+ return NULL;
}
p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
if( NULL == p_cursor ) {
- return MAXLINES;
+ return NULL;
+ }
+
+ if( 0 == p_cursor->dw_rangelines ) { return NULL; }
+
+ p_line = LINFO(p_tinfo, p_cursor->dw_start_lineid);
+
+ if( NULL != pdw_len ) { *pdw_len = p_line->dw_strlen; }
+
+ pb_data = p_tinfo->pb_text + p_line->dw_start;
+
+ return (const char *)pb_data;
+}
+
+
+/***********************************************************************
+Implemented
+***********************************************************************/
+LIBEDITTEXT_API_CURSORAPI_INFO
+const char *
+ LibEditText_GetCursorLineString(
+ int i_tinfoid,
+ int i_curid,
+ DWord *pdw_len )
+{
+ Byte *pb_str;
+ LibEditText_TextInfo *p_tinfo;
+ LibEditText_Cursor *p_cursor;
+ LibEditText_LineInfo *p_line;
+
+ p_tinfo = LibEditText_System_GetTextInfo( i_tinfoid );
+ if( NULL == p_tinfo ) {
+ return NULL;
+ }
+
+ p_cursor = LibEditText_CursorInfo_GetCursor( p_tinfo, i_curid );
+ if( NULL == p_cursor ) {
+ return NULL;
}
p_line = LINFO(p_tinfo, p_cursor->dw_lineid);
assert( NULL != p_line );
- return p_line->dw_strlen;
+ if( NULL != pdw_len ) { *pdw_len = p_line->dw_strlen; }
+
+ pb_str = p_tinfo->pb_text + p_line->dw_start;
+
+ return (const char *)pb_str;
}