Skip to content

Commit

Permalink
re-order API functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Feb 8, 2024
1 parent 0de4da0 commit fbc709e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/rime_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
13 changes: 7 additions & 6 deletions src/rime_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fbc709e

Please sign in to comment.