From fbc709ef67beaa0fd505ceff91420cf6089a6cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E6=88=8E=E6=B0=8F?= Date: Thu, 8 Feb 2024 23:03:43 +0800 Subject: [PATCH] re-order API functions --- src/rime_api.cc | 2 +- src/rime_api.h | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rime_api.cc b/src/rime_api.cc index 3f64d499cb..448ba542bb 100644 --- a/src/rime_api.cc +++ b/src/rime_api.cc @@ -1148,10 +1148,10 @@ RIME_API RimeApi* rime_get_api() { s_api.get_state_label = &RimeGetStateLabel; s_api.delete_candidate = &RimeDeleteCandidate; s_api.delete_candidate_on_current_page = &RimeDeleteCandidateOnCurrentPage; + s_api.get_state_label_abbreviated = &RimeGetStateLabelAbbreviated; s_api.peek_candidate = &RimePeekCandidate; s_api.peek_candidate_on_current_page = &RimePeekCandidateOnCurrentPage; s_api.change_page = &RimeChangePage; - s_api.get_state_label_abbreviated = &RimeGetStateLabelAbbreviated; } return &s_api; } diff --git a/src/rime_api.h b/src/rime_api.h index ecdf44cba7..78c4fe9d76 100644 --- a/src/rime_api.h +++ b/src/rime_api.h @@ -524,8 +524,6 @@ typedef struct rime_api_t { //! select a candidate at the given index in candidate list. Bool (*select_candidate)(RimeSessionId session_id, size_t index); - //! peek a selection without commiting to it - Bool (*peek_candidate)(RimeSessionId session_id, size_t index); //! get the version of librime const char* (*get_version)(void); @@ -535,10 +533,6 @@ typedef struct rime_api_t { //! select a candidate from current page. Bool (*select_candidate_on_current_page)(RimeSessionId session_id, size_t index); - //! peek a selection without commiting to it - Bool (*peek_candidate_on_current_page)(RimeSessionId session_id, size_t index); - - Bool (*change_page)(RimeSessionId session_id, Bool previous); //! access candidate list. Bool (*candidate_list_begin)(RimeSessionId session_id, RimeCandidateListIterator* iterator); @@ -573,6 +567,13 @@ typedef struct rime_api_t { const char *option_name, Bool state, Bool abbreviated); + + //! peek a selection without commiting to it + Bool (*peek_candidate)(RimeSessionId session_id, size_t index); + //! peek a selection without commiting to it + Bool (*peek_candidate_on_current_page)(RimeSessionId session_id, size_t index); + + Bool (*change_page)(RimeSessionId session_id, Bool previous); } RimeApi; //! API entry