Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
8e464d41
Commit
8e464d41
authored
13 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Fill in the format-specific shortcut reading methods (A3)
Change-Id: Ie5d8b344ed46873c92f3ef878a1e45017eb699c6
parent
cf9dbbdd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
native/src/terminal_attributes.h
+15
-8
15 additions, 8 deletions
native/src/terminal_attributes.h
with
15 additions
and
8 deletions
native/src/terminal_attributes.h
+
15
−
8
View file @
8e464d41
...
...
@@ -30,20 +30,28 @@ class TerminalAttributes {
public:
class
ShortcutIterator
{
const
uint8_t
*
const
mDict
;
bool
mHasNextShortcutTarget
;
int
mPos
;
public:
ShortcutIterator
(
const
uint8_t
*
const
dict
,
const
int
pos
)
:
mDict
(
dict
),
mPos
(
pos
)
{
ShortcutIterator
(
const
uint8_t
*
dict
,
const
int
pos
,
const
uint8_t
flags
)
:
mDict
(
dict
),
mPos
(
pos
)
{
mHasNextShortcutTarget
=
(
0
!=
(
flags
&
UnigramDictionary
::
FLAG_HAS_SHORTCUT_TARGETS
));
}
inline
bool
hasNextShortcutTarget
()
const
{
// TODO: stub method. Fill this in.
return
false
;
return
mHasNextShortcutTarget
;
}
// Gets the shortcut target itself as a uint16_t string. For parameters and return value
// see BinaryFormat::getWordAtAddress.
inline
int
getNextShortcutTarget
(
const
int
maxDepth
,
uint16_t
*
outWord
)
{
// TODO: stub method. Fill this in.
return
0
;
const
int
shortcutFlags
=
BinaryFormat
::
getFlagsAndForwardPointer
(
mDict
,
&
mPos
);
mHasNextShortcutTarget
=
0
!=
(
shortcutFlags
&
UnigramDictionary
::
FLAG_ATTRIBUTE_HAS_NEXT
);
int
shortcutAddress
=
BinaryFormat
::
getAttributeAddressAndForwardPointer
(
mDict
,
shortcutFlags
,
&
mPos
);
return
BinaryFormat
::
getWordAtAddress
(
mDict
,
shortcutAddress
,
maxDepth
,
outWord
);
}
};
...
...
@@ -58,12 +66,11 @@ class TerminalAttributes {
}
inline
bool
isShortcutOnly
()
const
{
// TODO: stub method. Fill this in.
return
false
;
return
0
!=
(
mFlags
&
UnigramDictionary
::
FLAG_IS_SHORTCUT_ONLY
);
}
inline
ShortcutIterator
getShortcutIterator
()
const
{
return
ShortcutIterator
(
mDict
,
mStartPos
);
return
ShortcutIterator
(
mDict
,
mStartPos
,
mFlags
);
}
};
}
// namespace latinime
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment