Issue #3 and #4 are now solved, windows tested unix not yet

This commit is contained in:
T 2018-01-30 21:20:11 +01:00
parent 93bc97c38c
commit 4212e728d5
17 changed files with 484 additions and 377 deletions

View File

@ -3,7 +3,22 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="310aeab2-4737-4e8e-b7eb-0aac10d104a3" name="Default" comment=""> <list default="true" id="310aeab2-4737-4e8e-b7eb-0aac10d104a3" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/Cargo.toml" afterPath="$PROJECT_DIR$/Cargo.toml" /> <change beforePath="$PROJECT_DIR$/examples/bin.rs" afterPath="$PROJECT_DIR$/examples/bin.rs" />
<change beforePath="$PROJECT_DIR$/examples/color/mod.rs" afterPath="$PROJECT_DIR$/examples/color/mod.rs" />
<change beforePath="$PROJECT_DIR$/examples/cursor/mod.rs" afterPath="$PROJECT_DIR$/examples/cursor/mod.rs" />
<change beforePath="$PROJECT_DIR$/examples/terminal/mod.rs" afterPath="$PROJECT_DIR$/examples/terminal/mod.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_cursor/ansi_cursor.rs" afterPath="$PROJECT_DIR$/src/crossterm_cursor/ansi_cursor.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_cursor/base_cursor.rs" afterPath="$PROJECT_DIR$/src/crossterm_cursor/base_cursor.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_cursor/cursor.rs" afterPath="$PROJECT_DIR$/src/crossterm_cursor/cursor.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_cursor/mod.rs" afterPath="$PROJECT_DIR$/src/crossterm_cursor/mod.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_cursor/winapi_cursor.rs" afterPath="$PROJECT_DIR$/src/crossterm_cursor/winapi_cursor.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_mouse/mod.rs" afterPath="" />
<change beforePath="$PROJECT_DIR$/src/crossterm_style/color/color.rs" afterPath="$PROJECT_DIR$/src/crossterm_style/color/color.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_style/mod.rs" afterPath="$PROJECT_DIR$/src/crossterm_style/mod.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_style/styles/styledobject.rs" afterPath="$PROJECT_DIR$/src/crossterm_style/styles/styledobject.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_terminal/mod.rs" afterPath="$PROJECT_DIR$/src/crossterm_terminal/mod.rs" />
<change beforePath="$PROJECT_DIR$/src/crossterm_terminal/terminal.rs" afterPath="$PROJECT_DIR$/src/crossterm_terminal/terminal.rs" />
<change beforePath="$PROJECT_DIR$/src/kernel/windows_kernel/ansi_support.rs" afterPath="$PROJECT_DIR$/src/kernel/windows_kernel/ansi_support.rs" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" /> <option name="TRACKING_ENABLED" value="true" />
@ -14,11 +29,106 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="Cargo.toml" pinned="false" current-in-tab="true"> <file leaf-file-name="mod.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Cargo.toml"> <entry file="file://$PROJECT_DIR$/examples/color/mod.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34"> <state relative-caret-position="510">
<caret line="2" column="14" lean-forward="false" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" /> <caret line="57" column="33" lean-forward="false" selection-start-line="57" selection-start-column="33" selection-end-line="57" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="mod.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/examples/cursor/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1326">
<caret line="78" column="51" lean-forward="false" selection-start-line="78" selection-start-column="51" selection-end-line="78" selection-end-column="51" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="mod.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/crossterm_style/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="47" lean-forward="false" selection-start-line="5" selection-start-column="47" selection-end-line="5" selection-end-column="47" />
<folding>
<element signature="e#1111#1112#0" expanded="true" />
<element signature="e#1161#1162#0" expanded="true" />
<element signature="e#1229#1230#0" expanded="true" />
<element signature="e#1279#1280#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="bin.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/examples/bin.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="28" column="19" lean-forward="false" selection-start-line="28" selection-start-column="19" selection-end-line="28" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="cursor.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="16" column="5" lean-forward="false" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="color.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/color.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-244">
<caret line="46" column="27" lean-forward="false" selection-start-line="46" selection-start-column="27" selection-end-line="46" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ansi_support.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/ansi_support.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="73" lean-forward="false" selection-start-line="0" selection-start-column="73" selection-end-line="0" selection-end-column="73" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="winapi_extentions.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/winapi_extentions.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="17" lean-forward="false" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="terminal.rs" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="194">
<caret line="125" column="1" lean-forward="false" selection-start-line="125" selection-start-column="1" selection-end-line="125" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="mod.rs" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/examples/terminal/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="470">
<caret line="117" column="5" lean-forward="false" selection-start-line="117" selection-start-column="5" selection-end-line="117" selection-end-column="5" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -28,8 +138,6 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>color</find>
<find>termin</find>
<find>Coord</find> <find>Coord</find>
<find>winapi</find> <find>winapi</find>
<find>kernel32</find> <find>kernel32</find>
@ -55,6 +163,11 @@
<find>handle::</find> <find>handle::</find>
<find>wincon</find> <find>wincon</find>
<find>CONSOLE_SCREEN_BUFFER_INFO</find> <find>CONSOLE_SCREEN_BUFFER_INFO</find>
<find>safe_position</find>
<find>init</find>
<find>cursor::get()</find>
<find>get()</find>
<find>get</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>crossterm_cursor</replace> <replace>crossterm_cursor</replace>
@ -75,36 +188,38 @@
<option value="$PROJECT_DIR$/src/shared/mod.rs" /> <option value="$PROJECT_DIR$/src/shared/mod.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/winapi_extentions.rs" /> <option value="$PROJECT_DIR$/src/kernel/windows_kernel/winapi_extentions.rs" />
<option value="$PROJECT_DIR$/src/lib.rs" /> <option value="$PROJECT_DIR$/src/lib.rs" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/shared/traits.rs" /> <option value="$PROJECT_DIR$/src/shared/traits.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/ansi_cursor.rs" />
<option value="$PROJECT_DIR$/examples/cursor/mod.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/base_cursor.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/cursor.rs" />
<option value="$PROJECT_DIR$/src/crossterm_terminal/ansi_terminal.rs" /> <option value="$PROJECT_DIR$/src/crossterm_terminal/ansi_terminal.rs" />
<option value="$PROJECT_DIR$/todo.txt" /> <option value="$PROJECT_DIR$/todo.txt" />
<option value="$PROJECT_DIR$/src/crossterm_terminal/terminal.rs" />
<option value="$PROJECT_DIR$/src/crossterm_terminal/base_terminal.rs" /> <option value="$PROJECT_DIR$/src/crossterm_terminal/base_terminal.rs" />
<option value="$PROJECT_DIR$/src/crossterm_terminal/winapi_terminal.rs" /> <option value="$PROJECT_DIR$/src/crossterm_terminal/winapi_terminal.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/ansi_support.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/winapi_cursor.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/handle.rs" /> <option value="$PROJECT_DIR$/src/kernel/windows_kernel/handle.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/mod.rs" /> <option value="$PROJECT_DIR$/src/kernel/windows_kernel/mod.rs" />
<option value="$PROJECT_DIR$/src/shared/functions.rs" /> <option value="$PROJECT_DIR$/src/shared/functions.rs" />
<option value="$PROJECT_DIR$/examples/terminal/mod.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/cursor.rs" /> <option value="$PROJECT_DIR$/src/kernel/windows_kernel/cursor.rs" />
<option value="$PROJECT_DIR$/examples/bin.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/color/color.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/color/base_color.rs" /> <option value="$PROJECT_DIR$/src/crossterm_style/color/base_color.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/color/winapi_color.rs" /> <option value="$PROJECT_DIR$/src/crossterm_style/color/winapi_color.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/mod.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/styles/styledobject.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/styles/objectstyle.rs" /> <option value="$PROJECT_DIR$/src/crossterm_style/styles/objectstyle.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs" /> <option value="$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/terminal.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/color.rs" /> <option value="$PROJECT_DIR$/src/kernel/windows_kernel/color.rs" />
<option value="$PROJECT_DIR$/examples/color/mod.rs" />
<option value="$PROJECT_DIR$/Cargo.toml" /> <option value="$PROJECT_DIR$/Cargo.toml" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/base_cursor.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/ansi_cursor.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/winapi_cursor.rs" />
<option value="$PROJECT_DIR$/src/crossterm_terminal/mod.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/mod.rs" />
<option value="$PROJECT_DIR$/src/crossterm_cursor/cursor.rs" />
<option value="$PROJECT_DIR$/src/crossterm_terminal/terminal.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/styles/styledobject.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/color/color.rs" />
<option value="$PROJECT_DIR$/src/crossterm_style/mod.rs" />
<option value="$PROJECT_DIR$/examples/cursor/mod.rs" />
<option value="$PROJECT_DIR$/examples/color/mod.rs" />
<option value="$PROJECT_DIR$/examples/terminal/mod.rs" />
<option value="$PROJECT_DIR$/examples/bin.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/ansi_support.rs" />
<option value="$PROJECT_DIR$/src/kernel/windows_kernel/terminal.rs" />
</list> </list>
</option> </option>
</component> </component>
@ -115,10 +230,10 @@
<sorting>DEFINITION_ORDER</sorting> <sorting>DEFINITION_ORDER</sorting>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="1016" /> <option name="x" value="-8" />
<option name="y" value="-8" /> <option name="y" value="-8" />
<option name="width" value="1616" /> <option name="width" value="2576" />
<option name="height" value="916" /> <option name="height" value="1056" />
</component> </component>
<component name="ProjectView"> <component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1"> <navigator currentView="ProjectPane" proportions="" version="1">
@ -135,6 +250,8 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="AndroidView" />
<pane id="Scope" />
<pane id="PackagesPane" /> <pane id="PackagesPane" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
@ -171,13 +288,24 @@
<item name="crossterm" type="462c0819:PsiDirectoryNode" /> <item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" /> <item name="src" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="kernel" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="crossterm" type="b2602c69:ProjectViewProjectNode" />
<item name="crossterm" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="kernel" type="462c0819:PsiDirectoryNode" />
<item name="windows_kernel" type="462c0819:PsiDirectoryNode" />
</path>
</expand> </expand>
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scratches" /> <pane id="Scratches" />
<pane id="Scope" />
<pane id="AndroidView" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -306,15 +434,18 @@
<workItem from="1516816975304" duration="6256000" /> <workItem from="1516816975304" duration="6256000" />
<workItem from="1516900692734" duration="812000" /> <workItem from="1516900692734" duration="812000" />
<workItem from="1517074341232" duration="930000" /> <workItem from="1517074341232" duration="930000" />
<workItem from="1517149399691" duration="2464000" />
<workItem from="1517253384995" duration="2918000" />
<workItem from="1517259828804" duration="830000" />
<workItem from="1517337587572" duration="5730000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="50993000" /> <option name="totallyTimeSpent" value="63533000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="2576" height="1056" extended-state="6" /> <frame x="-8" y="-8" width="2576" height="1056" extended-state="6" />
<editor active="true" />
<layout> <layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
@ -329,7 +460,7 @@
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.09765625" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15898438" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
@ -338,32 +469,11 @@
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cargo" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.03923648" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.09765625" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32979852" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
</layout> </layout>
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -377,15 +487,6 @@
<watches-manager /> <watches-manager />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/examples/term_cursor_example/mod.rs" />
<entry file="file://$PROJECT_DIR$/examples/bin.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="22" lean-forward="false" selection-start-line="0" selection-start-column="22" selection-end-line="0" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/LICENSE"> <entry file="file://$PROJECT_DIR$/LICENSE">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -444,30 +545,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/lib.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="136">
<caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="569">
<caret line="108" column="23" lean-forward="false" selection-start-line="108" selection-start-column="23" selection-end-line="108" selection-end-column="23" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/traits.rs"> <entry file="file://$PROJECT_DIR$/src/shared/traits.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="136"> <state relative-caret-position="136">
@ -482,32 +559,10 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/base_cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="133" lean-forward="false" selection-start-line="22" selection-start-column="4" selection-end-line="22" selection-end-column="133" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4131">
<caret line="243" column="12" lean-forward="false" selection-start-line="243" selection-start-column="12" selection-end-line="243" selection-end-column="12" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_mouse/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/todo.txt"> <entry file="file://$PROJECT_DIR$/todo.txt">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -518,13 +573,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_terminal/base_terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" column="38" lean-forward="false" selection-start-line="17" selection-start-column="38" selection-end-line="17" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.4/src/lib.rs"> <entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.4/src/lib.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="487"> <state relative-caret-position="487">
@ -539,13 +587,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/ansi_cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="663">
<caret line="43" column="5" lean-forward="false" selection-start-line="43" selection-start-column="5" selection-end-line="43" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.4/src/um/wincon.rs"> <entry file="file://$USER_HOME$/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-0.3.4/src/um/wincon.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="298"> <state relative-caret-position="298">
@ -554,28 +595,7 @@
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/handle.rs" /> <entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/handle.rs" />
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/winapi_extentions.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="17" lean-forward="false" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/shared/functions.rs" /> <entry file="file://$PROJECT_DIR$/src/shared/functions.rs" />
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/winapi_cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="17" column="0" lean-forward="false" selection-start-line="17" selection-start-column="0" selection-end-line="17" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_terminal/terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="765">
<caret line="162" column="25" lean-forward="false" selection-start-line="162" selection-start-column="25" selection-end-line="162" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_terminal/winapi_terminal.rs"> <entry file="file://$PROJECT_DIR$/src/crossterm_terminal/winapi_terminal.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="340"> <state relative-caret-position="340">
@ -590,32 +610,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/ansi_support.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="38" lean-forward="true" selection-start-line="2" selection-start-column="38" selection-end-line="2" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="16" column="5" lean-forward="false" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
<folding>
<element signature="e#222#223#0" expanded="false" />
<element signature="e#272#273#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/color/color.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/color/base_color.rs"> <entry file="file://$PROJECT_DIR$/src/crossterm_style/color/base_color.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187"> <state relative-caret-position="187">
@ -630,101 +624,242 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/styles/styledobject.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/color/winapi_color.rs"> <entry file="file://$PROJECT_DIR$/src/crossterm_style/color/winapi_color.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="561"> <state relative-caret-position="561">
<caret line="35" column="39" lean-forward="false" selection-start-line="35" selection-start-column="39" selection-end-line="35" selection-end-column="39" /> <caret line="35" column="39" lean-forward="false" selection-start-line="35" selection-start-column="39" selection-end-line="35" selection-end-column="39" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/styles/objectstyle.rs"> <entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state relative-caret-position="725"> <state split_layout="SPLIT">
<caret line="60" column="14" lean-forward="false" selection-start-line="60" selection-start-column="14" selection-end-line="60" selection-end-column="14" /> <first_editor relative-caret-position="68">
<folding> <caret line="104" column="22" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="219" selection-end-column="0" />
<element signature="e#1550#1551#0" expanded="false" /> </first_editor>
<element signature="e#1587#1588#0" expanded="false" /> <second_editor />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs"> <entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/kernel.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="663"> <state relative-caret-position="194">
<caret line="153" column="8" lean-forward="false" selection-start-line="153" selection-start-column="8" selection-end-line="153" selection-end-column="8" /> <caret line="106" column="7" lean-forward="false" selection-start-line="106" selection-start-column="7" selection-end-line="106" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/base_cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391">
<caret line="23" column="20" lean-forward="false" selection-start-line="23" selection-start-column="20" selection-end-line="23" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/ansi_cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="578">
<caret line="47" column="20" lean-forward="false" selection-start-line="47" selection-start-column="20" selection-end-line="47" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Cargo.toml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="18" column="7" lean-forward="false" selection-start-line="18" selection-start-column="7" selection-end-line="18" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_mouse/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/terminal.rs"> <entry file="file://$PROJECT_DIR$/src/crossterm_terminal/base_terminal.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="249"> <state relative-caret-position="153">
<caret line="138" column="12" lean-forward="false" selection-start-line="138" selection-start-column="12" selection-end-line="138" selection-end-column="12" /> <caret line="9" column="10" lean-forward="false" selection-start-line="9" selection-start-column="10" selection-end-line="9" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_terminal/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="11" column="42" lean-forward="false" selection-start-line="11" selection-start-column="42" selection-end-line="11" selection-end-column="42" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="49" lean-forward="false" selection-start-line="13" selection-start-column="49" selection-end-line="13" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/winapi_cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="340">
<caret line="24" column="47" lean-forward="false" selection-start-line="24" selection-start-column="47" selection-end-line="24" selection-end-column="47" />
<folding>
<element signature="e#260#261#0" expanded="false" />
<element signature="e#302#303#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_cursor/cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3503">
<caret line="28" column="19" lean-forward="false" selection-start-line="28" selection-start-column="19" selection-end-line="28" selection-end-column="19" />
<folding>
<element signature="e#7564#7565#0" expanded="false" />
<element signature="e#7603#7604#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_terminal/terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="759">
<caret line="167" column="30" lean-forward="false" selection-start-line="167" selection-start-column="4" selection-end-line="167" selection-end-column="30" />
<folding>
<element signature="e#4513#4514#0" expanded="false" />
<element signature="e#4546#4547#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/styles/objectstyle.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="742">
<caret line="60" column="14" lean-forward="false" selection-start-line="60" selection-start-column="14" selection-end-line="60" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/color/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="11" lean-forward="false" selection-start-line="1" selection-start-column="11" selection-end-line="1" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/color/color.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2312">
<caret line="136" column="29" lean-forward="false" selection-start-line="136" selection-start-column="29" selection-end-line="136" selection-end-column="29" />
<folding>
<element signature="e#3761#3762#0" expanded="true" />
<element signature="e#3799#3800#0" expanded="true" />
<element signature="e#4811#4812#0" expanded="true" />
<element signature="e#4850#4851#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/styles/styledobject.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="407">
<caret line="112" column="60" lean-forward="false" selection-start-line="112" selection-start-column="60" selection-end-line="112" selection-end-column="60" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/lib.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="19" lean-forward="false" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="19" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/crossterm_style/mod.rs"> <entry file="file://$PROJECT_DIR$/src/crossterm_style/mod.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="298"> <state relative-caret-position="85">
<caret line="53" column="4" lean-forward="false" selection-start-line="53" selection-start-column="4" selection-end-line="53" selection-end-column="4" /> <caret line="5" column="47" lean-forward="false" selection-start-line="5" selection-start-column="47" selection-end-line="5" selection-end-column="47" />
<folding /> <folding>
<element signature="e#1111#1112#0" expanded="true" />
<element signature="e#1161#1162#0" expanded="true" />
<element signature="e#1229#1230#0" expanded="true" />
<element signature="e#1279#1280#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/color.rs"> <entry file="file://$PROJECT_DIR$/examples/terminal/mod.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1394"> <state relative-caret-position="470">
<caret line="84" column="9" lean-forward="false" selection-start-line="84" selection-start-column="9" selection-end-line="84" selection-end-column="9" /> <caret line="117" column="5" lean-forward="false" selection-start-line="117" selection-start-column="5" selection-end-line="117" selection-end-column="5" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/examples/cursor/mod.rs"> <entry file="file://$PROJECT_DIR$/examples/cursor/mod.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="706"> <state relative-caret-position="1326">
<caret line="96" column="14" lean-forward="false" selection-start-line="81" selection-start-column="3" selection-end-line="96" selection-end-column="14" /> <caret line="78" column="51" lean-forward="false" selection-start-line="78" selection-start-column="51" selection-end-line="78" selection-end-column="51" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/examples/bin.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
<caret line="24" column="17" lean-forward="false" selection-start-line="24" selection-start-column="17" selection-end-line="24" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/examples/terminal/mod.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="708">
<caret line="130" column="4" lean-forward="false" selection-start-line="130" selection-start-column="4" selection-end-line="133" selection-end-column="27" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/examples/color/mod.rs"> <entry file="file://$PROJECT_DIR$/examples/color/mod.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="572"> <state relative-caret-position="510">
<caret line="115" column="44" lean-forward="false" selection-start-line="115" selection-start-column="44" selection-end-line="115" selection-end-column="45" /> <caret line="57" column="33" lean-forward="false" selection-start-line="57" selection-start-column="33" selection-end-line="57" selection-end-column="33" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Cargo.toml"> <entry file="file://$PROJECT_DIR$/examples/bin.rs">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34"> <state relative-caret-position="476">
<caret line="2" column="14" lean-forward="false" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" /> <caret line="28" column="19" lean-forward="false" selection-start-line="28" selection-start-column="19" selection-end-line="28" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/cursor.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="16" column="5" lean-forward="false" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/color.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-244">
<caret line="46" column="27" lean-forward="false" selection-start-line="46" selection-start-column="27" selection-end-line="46" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/ansi_support.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="73" lean-forward="false" selection-start-line="0" selection-start-column="73" selection-end-line="0" selection-end-column="73" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/winapi_extentions.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="17" lean-forward="false" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/kernel/windows_kernel/terminal.rs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="194">
<caret line="125" column="1" lean-forward="false" selection-start-line="125" selection-start-column="1" selection-end-line="125" selection-end-column="1" />
<folding /> <folding />
</state> </state>
</provider> </provider>

View File

@ -15,7 +15,7 @@
extern crate crossterm; extern crate crossterm;
// Add the usings for the crossterms modules to play with crossterm // Add the usings for the crossterms modules to play with crossterm
use self::crossterm::crossterm_style; use self::crossterm::crossterm_style::{paint, Color };
use self::crossterm::crossterm_cursor; use self::crossterm::crossterm_cursor;
use self::crossterm::crossterm_terminal; use self::crossterm::crossterm_terminal;
@ -25,5 +25,6 @@ pub mod cursor;
pub mod terminal; pub mod terminal;
fn main() { fn main() {
terminal::clear_all_lines();
cursor::print();
} }

View File

@ -103,7 +103,7 @@ pub fn print_all_background_colors()
println!("RGB (10,10,10): \t {}", paint(" ").on(Color::AnsiValue(50))); println!("RGB (10,10,10): \t {}", paint(" ").on(Color::AnsiValue(50)));
} }
/// Print font with all available attributes. Note that this can only be used at unix systems and that some are not supported widely. /// Print font with all available attributes. Note that this can only be used at unix systems and that some are not supported widely | demonstration..
#[cfg(unix)] #[cfg(unix)]
pub fn print_font_with_attributes() pub fn print_font_with_attributes()
{ {
@ -119,7 +119,7 @@ pub fn print_font_with_attributes()
println!("{}", paint("Crossed out font").crossed_out()); println!("{}", paint("Crossed out font").crossed_out());
} }
/// Print all supported rgb colors /// Print all supported rgb colors | demonstration.
#[cfg(unix)]#[cfg(unix)] #[cfg(unix)]#[cfg(unix)]
pub fn print_supported_colors() pub fn print_supported_colors()
{ {

View File

@ -4,13 +4,13 @@
extern crate crossterm; extern crate crossterm;
use self::crossterm::crossterm_cursor::{get, TerminalCursor}; use self::crossterm::crossterm_cursor::{cursor, TerminalCursor};
/// Set the cursor to position X: 10, Y: 5 in the terminal. /// Set the cursor to position X: 10, Y: 5 in the terminal.
pub fn goto() pub fn goto()
{ {
// Get the cursor // Get the cursor
let mut cursor = get(); let mut cursor = cursor();
// Set the cursor to position X: 10, Y: 5 in the terminal // Set the cursor to position X: 10, Y: 5 in the terminal
cursor.goto(10,5); cursor.goto(10,5);
} }
@ -19,7 +19,7 @@ pub fn goto()
pub fn move_up() pub fn move_up()
{ {
// Get the cursor // Get the cursor
let mut cursor = get(); let mut cursor = cursor();
// Move the cursor to position 3 times to the up in the terminal // Move the cursor to position 3 times to the up in the terminal
cursor.move_up(3); cursor.move_up(3);
} }
@ -28,7 +28,7 @@ pub fn move_up()
pub fn move_right() pub fn move_right()
{ {
// Get the cursor // Get the cursor
let mut cursor = get(); let mut cursor = cursor();
// Move the cursor to position 3 times to the right in the terminal // Move the cursor to position 3 times to the right in the terminal
cursor.move_right(3); cursor.move_right(3);
} }
@ -37,7 +37,7 @@ pub fn move_right()
pub fn move_down() pub fn move_down()
{ {
// Get the cursor // Get the cursor
let mut cursor = get(); let mut cursor = cursor();
// Move the cursor to position 3 times to the down in the terminal // Move the cursor to position 3 times to the down in the terminal
cursor.move_down(3); cursor.move_down(3);
} }
@ -46,7 +46,7 @@ pub fn move_down()
pub fn move_left() pub fn move_left()
{ {
// Get the cursor // Get the cursor
let mut cursor = get(); let mut cursor = cursor();
// Move the cursor to position 3 times to the left in the terminal // Move the cursor to position 3 times to the left in the terminal
cursor.move_left(3); cursor.move_left(3);
} }
@ -57,7 +57,7 @@ pub fn print()
// To print an some displayable content on an certain position. // To print an some displayable content on an certain position.
// Get the cursor // Get the cursor
let mut cursor = get(); let mut cursor = cursor();
// Set the cursor to position X: 10, Y: 5 in the terminal // Set the cursor to position X: 10, Y: 5 in the terminal
cursor.goto(10,5); cursor.goto(10,5);
// Print the @ symbol at position X: 10, Y: 5 in the terminal // Print the @ symbol at position X: 10, Y: 5 in the terminal
@ -67,32 +67,32 @@ pub fn print()
use std::io::Write; use std::io::Write;
std::io::stdout().flush(); std::io::stdout().flush();
/* Because the above method is a little to mutch code, /* Because the above method is a little to much code,
you can use the `print()` method for printing an value at an certain position in the terminal. you can use the `print()` method for printing an value at an certain position in the terminal.
Crossterm provides method chaining so that the above points can be inlined. Crossterm provides method chaining so that the above points can be inlined.
*/ */
get().goto(10,5).print("@"); cursor.goto(10,5).print("@");
} }
/// Save and reset cursor position. /// Save and reset cursor position | demonstration..
pub fn safe_and_reset_position() pub fn safe_and_reset_position()
{ {
let mut cursor = get(); let mut cursor = cursor();
// Goto X: 5 Y: 5 // Goto X: 5 Y: 5
cursor.goto(5,5); cursor.goto(5,5);
// Safe cursor position: X: 5 Y: 5 // Safe cursor position: X: 5 Y: 5
cursor.safe_position(); cursor.save_position();
// Goto X: 5 Y: 20 // Goto X: 5 Y: 20
cursor.goto(5,20); cursor.goto(5,20);
// Print at X: 5 Y: 20. // Print at X: 5 Y: 20.
print!("Yea!"); println!("Yea!");
// Reset back to X: 5 Y: 5. // Reset back to X: 5 Y: 5.
cursor.reset_position(); cursor.reset_position();
// Print Back at X: 5 Y: 5. // Print Back at X: 5 Y: 5.
print!("Back"); println!("Back");
println!() println!()
} }

View File

@ -4,13 +4,13 @@
extern crate crossterm; extern crate crossterm;
use crossterm::crossterm_terminal::{get, Terminal, ClearType}; use crossterm::crossterm_terminal::{ Terminal, ClearType, terminal};
use crossterm::crossterm_cursor; use crossterm::crossterm_cursor;
fn print_test_data() fn print_test_data()
{ {
for i in 0..100 { for i in 0..100 {
println!("abcdefghijTest data to test terminal: {}",i); println!("Test data to test terminal: {}",i);
} }
} }
@ -18,7 +18,7 @@ fn print_test_data()
pub fn clear_all_lines() pub fn clear_all_lines()
{ {
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
print_test_data(); print_test_data();
@ -30,12 +30,12 @@ pub fn clear_all_lines()
pub fn clear_from_cursor_down() pub fn clear_from_cursor_down()
{ {
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
print_test_data(); print_test_data();
// Set terminal cursor position (see example for more info). // Set terminal cursor position (see example for more info).
crossterm_cursor::get().goto(4,8); crossterm_cursor::cursor().goto(4,8);
// Clear all cells from current cursor position down. // Clear all cells from current cursor position down.
terminal.clear(ClearType::FromCursorDown); terminal.clear(ClearType::FromCursorDown);
@ -45,12 +45,12 @@ pub fn clear_from_cursor_down()
pub fn clear_from_cursor_up() pub fn clear_from_cursor_up()
{ {
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
print_test_data(); print_test_data();
// Set terminal cursor position (see example for more info). // Set terminal cursor position (see example for more info).
crossterm_cursor::get().goto(4,8); crossterm_cursor::cursor().goto(4,4);
// Clear all cells from current cursor position down. // Clear all cells from current cursor position down.
terminal.clear(ClearType::FromCursorUp); terminal.clear(ClearType::FromCursorUp);
@ -60,76 +60,77 @@ pub fn clear_from_cursor_up()
pub fn clear_current_line() pub fn clear_current_line()
{ {
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
print_test_data(); print_test_data();
// Set terminal cursor position (see example for more info). // Set terminal cursor position (see example for more info).
crossterm_cursor::get().goto(4,4); crossterm_cursor::cursor().goto(4,4);
// Clear current line cells. // Clear current line cells.
terminal.clear(ClearType::CurrentLine); terminal.clear(ClearType::CurrentLine);
} }
/// Clear all lines from cursor position X:4, Y:4 up | demonstration /// Clear all lines from cursor position X:4, Y:7 up | demonstration
pub fn clear_until_new_line() pub fn clear_until_new_line()
{ {
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
print_test_data(); print_test_data();
// Set terminal cursor position (see example for more info). // Set terminal cursor position (see example for more info).
crossterm_cursor::get().goto(4,7); crossterm_cursor::cursor().goto(4,7);
// Clear all the cells until next line. // Clear all the cells until next line.
terminal.clear(ClearType::UntilNewLine); terminal.clear(ClearType::UntilNewLine);
} }
/// Print the the current terminal size | demonstration.
pub fn print_terminal_size() pub fn print_terminal_size()
{ {
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
// Get terminal size // Get terminal size
let terminal_size = terminal.terminal_size().unwrap(); let terminal_size = terminal.terminal_size().unwrap();
// Print results // Print results
print!("X: {}, y: {}", terminal_size.0, terminal_size.1); print!("X: {}, y: {}", terminal_size.0, terminal_size.1);
} }
/// Set the terminal size to width 10, height: 10. /// Set the terminal size to width 10, height: 10 | demonstration.
pub fn set_terminal_size() pub fn set_terminal_size()
{ {
let mut terminal = get(); let mut terminal = terminal();
terminal.set_size(10,10); terminal.set_size(10,10);
} }
// scroll down 10 lines /// Scroll down 10 lines | demonstration.
pub fn scroll_down() pub fn scroll_down()
{ {
print_test_data(); print_test_data();
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
// Scroll down 10 lines. // Scroll down 10 lines.
terminal.scroll_down(10); terminal.scroll_down(10);
} }
// scroll down 10 lines /// Scroll down 10 lines | demonstration.
pub fn scroll_up() pub fn scroll_up()
{ {
print_test_data(); print_test_data();
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
// Scroll up 10 lines. // Scroll up 10 lines.
terminal.scroll_up(10); terminal.scroll_up(10);
} }
// Resize the terminal to X: 10, Y: 10 /// Resize the terminal to X: 10, Y: 10 | demonstration.
pub fn resize_terminal() pub fn resize_terminal()
{ {
// Get terminal // Get terminal
let mut terminal = get(); let mut terminal = terminal();
// Get terminal size // Get terminal size
terminal.set_size(1,1); terminal.set_size(10,10);
} }

View File

@ -45,7 +45,7 @@ impl ITerminalCursor for AnsiCursor {
write!(&mut some_writer, csi!("{}D"), count); write!(&mut some_writer, csi!("{}D"), count);
} }
fn safe_position(&mut self) fn save_position(&mut self)
{ {
let mut some_writer = io::stdout(); let mut some_writer = io::stdout();
write!(&mut some_writer, csi!("s")); write!(&mut some_writer, csi!("s"));

View File

@ -21,7 +21,7 @@ pub trait ITerminalCursor {
/// Move the cursor `n` times left. /// Move the cursor `n` times left.
fn move_left(&self, count: u16); fn move_left(&self, count: u16);
/// Save cursor position for recall later. Note that this position is stored program based not per instance of the cursor struct. /// Save cursor position for recall later. Note that this position is stored program based not per instance of the cursor struct.
fn safe_position(&mut self); fn save_position(&mut self);
/// Return to saved cursor position /// Return to saved cursor position
fn reset_position(&self); fn reset_position(&self);
} }

View File

@ -17,11 +17,16 @@ pub struct TerminalCursor {
} }
impl TerminalCursor { impl TerminalCursor {
/// Instantiates an platform specific cursor implementation whereon cursor related actions can be performed. /// Create new cursor instance whereon cursor related actions can be performed.
pub fn init(&mut self) { pub fn new() -> TerminalCursor {
if let None = self.terminal_cursor { let cursor: Option<Box<ITerminalCursor>> = {
self.terminal_cursor = get_cursor_options(); #[cfg(unix)]
} Some(AnsiCursor::new());
#[cfg(windows)]
Some(WinApiCursor::new())
};
TerminalCursor { terminal_cursor: cursor }
} }
/// Goto some position (x,y) in the terminal. /// Goto some position (x,y) in the terminal.
@ -34,11 +39,10 @@ impl TerminalCursor {
/// ///
/// use self::crossterm::crossterm_cursor; /// use self::crossterm::crossterm_cursor;
/// ///
/// crossterm_cursor::get().goto(10,10); /// crossterm_cursor::cursor().goto(10,10);
/// ///
/// ``` /// ```
pub fn goto(&mut self, x: u16, y: u16) -> &mut TerminalCursor { pub fn goto(&mut self, x: u16, y: u16) -> &mut TerminalCursor {
&self.init();
if let Some(ref terminal_cursor) = self.terminal_cursor { if let Some(ref terminal_cursor) = self.terminal_cursor {
terminal_cursor.goto(x, y); terminal_cursor.goto(x, y);
} }
@ -55,12 +59,11 @@ impl TerminalCursor {
/// ///
/// use self::crossterm::crossterm_cursor; /// use self::crossterm::crossterm_cursor;
/// ///
/// let pos = crossterm_cursor::get().pos(); /// let pos = crossterm_cursor::cursor().pos();
/// println!("{:?}", pos); /// println!("{:?}", pos);
/// ///
/// ``` /// ```
pub fn pos(&mut self) -> (i16, i16) { pub fn pos(&mut self) -> (i16, i16) {
&self.init();
if let Some(ref terminal_cursor) = self.terminal_cursor { if let Some(ref terminal_cursor) = self.terminal_cursor {
terminal_cursor.pos() terminal_cursor.pos()
} else { } else {
@ -79,14 +82,13 @@ impl TerminalCursor {
/// use self::crossterm::crossterm_cursor; /// use self::crossterm::crossterm_cursor;
/// ///
/// // Move 1 time up /// // Move 1 time up
/// crossterm_cursor::get().move_up(1); /// crossterm_cursor::cursor().move_up(1);
/// ///
/// // Move 2 times up /// // Move 2 times up
/// crossterm_cursor::get().move_up(2); /// crossterm_cursor::cursor().move_up(2);
/// ///
/// ``` /// ```
pub fn move_up(&mut self, count: u16) -> &mut TerminalCursor { pub fn move_up(&mut self, count: u16) -> &mut TerminalCursor {
&self.init();
if let Some(ref terminal_cursor) = self.terminal_cursor { if let Some(ref terminal_cursor) = self.terminal_cursor {
terminal_cursor.move_up(count); terminal_cursor.move_up(count);
} }
@ -105,14 +107,13 @@ impl TerminalCursor {
/// ///
/// ///
/// // move 1 time right /// // move 1 time right
/// crossterm_cursor::get().move_right(1); /// crossterm_cursor::cursor().move_right(1);
/// ///
/// // move 2 times right /// // move 2 times right
/// crossterm_cursor::get().move_right(2); /// crossterm_cursor::cursor().move_right(2);
/// ///
/// ``` /// ```
pub fn move_right(&mut self, count: u16) -> &mut TerminalCursor { pub fn move_right(&mut self, count: u16) -> &mut TerminalCursor {
&self.init();
if let Some(ref terminal_cursor) = self.terminal_cursor { if let Some(ref terminal_cursor) = self.terminal_cursor {
terminal_cursor.move_right(count); terminal_cursor.move_right(count);
} }
@ -130,14 +131,13 @@ impl TerminalCursor {
/// use self::crossterm::crossterm_cursor; /// use self::crossterm::crossterm_cursor;
/// ///
/// // move 1 time down /// // move 1 time down
/// crossterm_cursor::get().move_down(1); /// crossterm_cursor::cursor().move_down(1);
/// ///
/// // move 2 times down /// // move 2 times down
/// crossterm_cursor::get().move_down(2); /// crossterm_cursor::cursor().move_down(2);
/// ///
/// ``` /// ```
pub fn move_down(&mut self, count: u16) -> &mut TerminalCursor { pub fn move_down(&mut self, count: u16) -> &mut TerminalCursor {
&self.init();
if let Some(ref terminal_cursor) = self.terminal_cursor { if let Some(ref terminal_cursor) = self.terminal_cursor {
terminal_cursor.move_down(count); terminal_cursor.move_down(count);
} }
@ -155,14 +155,13 @@ impl TerminalCursor {
/// use self::crossterm::crossterm_cursor; /// use self::crossterm::crossterm_cursor;
/// ///
/// // move 1 time left /// // move 1 time left
/// crossterm_cursor::get().move_left(1); /// crossterm_cursor::cursor().move_left(1);
/// ///
/// // move 2 time left /// // move 2 time left
/// crossterm_cursor::get().move_left(2); /// crossterm_cursor::cursor().move_left(2);
/// ///
/// ``` /// ```
pub fn move_left(&mut self, count: u16) -> &mut TerminalCursor { pub fn move_left(&mut self, count: u16) -> &mut TerminalCursor {
&self.init();
if let Some(ref terminal_cursor) = self.terminal_cursor { if let Some(ref terminal_cursor) = self.terminal_cursor {
terminal_cursor.move_left(count); terminal_cursor.move_left(count);
} }
@ -191,12 +190,12 @@ impl TerminalCursor {
/// use std::io::Write; /// use std::io::Write;
/// ///
/// // of course we can just do this. /// // of course we can just do this.
/// crossterm_cursor::get().goto(10,10); /// crossterm_cursor::cursor().goto(10,10);
/// print!("@"); /// print!("@");
/// std::io::stdout().flush(); /// std::io::stdout().flush();
/// ///
/// // but now we can chain the methods so it looks cleaner and it automatically flushes the buffer. /// // but now we can chain the methods so it looks cleaner and it automatically flushes the buffer.
/// crossterm_cursor::get() /// crossterm_cursor::cursor()
/// .goto(10,10) /// .goto(10,10)
/// .print("@"); /// .print("@");
/// ///
@ -220,22 +219,21 @@ impl TerminalCursor {
/// ///
/// extern crate crossterm; /// extern crate crossterm;
/// ///
/// use self::crossterm::crossterm_cursor::get; /// use self::crossterm::crossterm_cursor::cursor;
/// ///
/// get().safe_position(); /// cursor().safe_position();
/// ///
/// ``` /// ```
pub fn safe_position(&mut self) pub fn save_position(&mut self)
{ {
&self.init();
if let Some(ref mut terminal_cursor) = self.terminal_cursor { if let Some(ref mut terminal_cursor) = self.terminal_cursor {
terminal_cursor.safe_position(); terminal_cursor.save_position();
} }
} }
/// Return to saved cursor position /// Return to saved cursor position
/// ///
/// Note that this method reset to the position set by `safe_position()` and that this position is stored program based not per instance of the `Cursor` struct. /// Note that this method reset to the position set by `save_position()` and that this position is stored program based not per instance of the `Cursor` struct.
/// ///
/// #Example /// #Example
/// ///
@ -243,29 +241,19 @@ impl TerminalCursor {
/// ///
/// extern crate crossterm; /// extern crate crossterm;
/// ///
/// use self::crossterm::crossterm_cursor::get; /// use self::crossterm::crossterm_cursor::cursor;
/// ///
/// get().reset_position(); /// cursor().reset_position();
/// ///
/// ``` /// ```
pub fn reset_position(&mut self) pub fn reset_position(&mut self)
{ {
&self.init();
if let Some(ref terminal_cursor) = self.terminal_cursor { if let Some(ref terminal_cursor) = self.terminal_cursor {
terminal_cursor.reset_position(); terminal_cursor.reset_position();
} }
} }
} }
/// Get the concrete ITerminalCursor implementation based on the current operating system.
fn get_cursor_options() -> Option<Box<ITerminalCursor>> {
#[cfg(unix)]
return Some(AnsiCursor::new());
#[cfg(windows)]
return Some(WinApiCursor::new());
}
/// Get an TerminalCursor implementation whereon cursor related actions can be performed. /// Get an TerminalCursor implementation whereon cursor related actions can be performed.
/// ///
/// Check `/examples/cursor` in the libary for more spesific examples. /// Check `/examples/cursor` in the libary for more spesific examples.
@ -279,15 +267,13 @@ fn get_cursor_options() -> Option<Box<ITerminalCursor>> {
/// use self::crossterm::crossterm_cursor; /// use self::crossterm::crossterm_cursor;
/// ///
/// // Get cursor and goto pos X: 5, Y: 10 /// // Get cursor and goto pos X: 5, Y: 10
/// let mut cursor = crossterm_cursor::get(); /// let mut cursor = crossterm_cursor::cursor();
/// cursor.goto(5,10); /// cursor.goto(5,10);
/// ///
/// //Or you can do it in one line. /// //Or you can do it in one line.
/// crossterm_cursor::get().goto(5,10); /// crossterm_cursor::cursor().goto(5,10);
/// ///
/// ``` /// ```
pub fn get() -> Box<TerminalCursor> { pub fn cursor() -> Box<TerminalCursor> {
Box::from(TerminalCursor { Box::from(TerminalCursor::new())
terminal_cursor: get_cursor_options(),
})
} }

View File

@ -11,5 +11,5 @@ use self::ansi_cursor::AnsiCursor;
#[cfg(windows)] #[cfg(windows)]
use self::winapi_cursor::WinApiCursor; use self::winapi_cursor::WinApiCursor;
pub use self::cursor::{ get, TerminalCursor }; pub use self::cursor::{ cursor, TerminalCursor };

View File

@ -44,7 +44,7 @@ impl ITerminalCursor for WinApiCursor {
} }
fn safe_position(&mut self) fn save_position(&mut self)
{ {
cursor::save_cursor_pos(); cursor::save_cursor_pos();
} }

View File

@ -20,11 +20,16 @@ pub struct TerminalColor {
} }
impl TerminalColor { impl TerminalColor {
/// Instantiate an color implementation whereon color related actions can be performed. /// Create new instance whereon color related actions can be performed.
pub fn init(&mut self) { pub fn new() -> TerminalColor {
if let None = self.terminal_color { let color: Option<Box<ITerminalColor>> = {
self.terminal_color = get_color_options(); #[cfg(unix)]
} Some(ANSIColor::new());
#[cfg(windows)]
Some(WinApiColor::new())
};
TerminalColor { terminal_color: color }
} }
/// Set the forground color to the given color. /// Set the forground color to the given color.
@ -34,10 +39,10 @@ impl TerminalColor {
/// ```rust /// ```rust
/// extern crate crossterm; /// extern crate crossterm;
/// ///
/// use self::crossterm::crossterm_style::{ get, Color}; /// use self::crossterm::crossterm_style::{ color, Color};
/// ///
/// // Get colored terminal instance /// // Get colored terminal instance
/// let mut colored_terminal = get(); /// let mut colored_terminal = color();
/// ///
/// // Set foreground color of the font /// // Set foreground color of the font
/// colored_terminal.set_fg(Color::Red); /// colored_terminal.set_fg(Color::Red);
@ -46,7 +51,6 @@ impl TerminalColor {
/// ///
/// ``` /// ```
pub fn set_fg(&mut self, color: Color) { pub fn set_fg(&mut self, color: Color) {
&self.init();
if let Some(ref terminal_color) = self.terminal_color { if let Some(ref terminal_color) = self.terminal_color {
terminal_color.set_fg(color); terminal_color.set_fg(color);
} }
@ -60,10 +64,10 @@ impl TerminalColor {
/// ///
/// extern crate crossterm; /// extern crate crossterm;
/// ///
/// use self::crossterm::crossterm_style::{ get, Color}; /// use self::crossterm::crossterm_style::{ color, Color};
/// ///
/// // Get colored terminal instance /// // Get colored terminal instance
/// let mut colored_terminal = get(); /// let mut colored_terminal = color();
/// ///
/// // Set background color of the font /// // Set background color of the font
/// colored_terminal.set_bg(Color::Red); /// colored_terminal.set_bg(Color::Red);
@ -72,7 +76,6 @@ impl TerminalColor {
/// ///
/// ``` /// ```
pub fn set_bg(&mut self, color: Color) { pub fn set_bg(&mut self, color: Color) {
&self.init();
if let Some(ref terminal_color) = self.terminal_color { if let Some(ref terminal_color) = self.terminal_color {
terminal_color.set_bg(color); terminal_color.set_bg(color);
} }
@ -84,16 +87,15 @@ impl TerminalColor {
/// ```rust /// ```rust
/// extern crate crossterm; /// extern crate crossterm;
/// ///
/// use self::crossterm::crossterm_style::get; /// use self::crossterm::crossterm_style::color;
/// ///
/// // Get colored terminal instance /// // Get colored terminal instance
/// let mut colored_terminal = get(); /// let mut colored_terminal = color();
/// ///
/// colored_terminal.reset(); /// colored_terminal.reset();
/// ///
/// ``` /// ```
pub fn reset(&mut self) { pub fn reset(&mut self) {
&self.init();
if let Some(ref terminal_color) = self.terminal_color { if let Some(ref terminal_color) = self.terminal_color {
terminal_color.reset(); terminal_color.reset();
} }
@ -117,14 +119,6 @@ impl TerminalColor {
} }
} }
/// Get an concrete ITerminalColor implementation based on the current operating system.
fn get_color_options() -> Option<Box<ITerminalColor>> {
#[cfg(unix)]
return Some(ANSIColor::new());
#[cfg(windows)]
return Some(WinApiColor::new());
}
/// Get an TerminalColor implementation whereon color related actions can be performed. /// Get an TerminalColor implementation whereon color related actions can be performed.
/// ///
/// # Example /// # Example
@ -132,20 +126,18 @@ fn get_color_options() -> Option<Box<ITerminalColor>> {
/// ```rust /// ```rust
/// extern crate crossterm; /// extern crate crossterm;
/// ///
/// use self::crossterm::crossterm_style::{get, Color}; /// use self::crossterm::crossterm_style::{color, Color};
/// ///
/// // Get colored terminal instance /// // Get colored terminal instance
/// let mut colored_terminal = get(); /// let mut colored_terminal = color();
/// ///
/// // preform some actions on the colored terminal /// // preform some actions on the colored terminal
/// colored_terminal.set_fg(Color::Red); /// colored_terminal.set_fg(Color::Red);
/// colored_terminal.set_bg(Color::Blue); /// colored_terminal.set_bg(Color::Blue);
/// colored_terminal.reset(); /// colored_terminal.reset();
/// ``` /// ```
pub fn get() -> Box<TerminalColor> { pub fn color() -> Box<TerminalColor> {
Box::from(TerminalColor { Box::from(TerminalColor::new())
terminal_color: get_color_options(),
})
} }
/// Wraps an displayable object so it can be formatted with colors and attributes. /// Wraps an displayable object so it can be formatted with colors and attributes.

View File

@ -1,7 +1,7 @@
mod color; mod color;
mod styles; mod styles;
pub use self::color::color::*; pub use self::color::color::{color, paint, TerminalColor };
pub use self::styles::objectstyle::ObjectStyle; pub use self::styles::objectstyle::ObjectStyle;
pub use self::styles::styledobject::StyledObject; pub use self::styles::styledobject::StyledObject;

View File

@ -110,7 +110,7 @@ macro_rules! impl_fmt
impl<D: fmt::$name> fmt::$name for StyledObject<D> { impl<D: fmt::$name> fmt::$name for StyledObject<D> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result
{ {
let mut colored_terminal = super::super::get(); let mut colored_terminal = super::super::color();
let mut reset = true; let mut reset = true;
if let Some(bg) = self.object_style.bg_color if let Some(bg) = self.object_style.bg_color

View File

@ -12,4 +12,4 @@ use self::ansi_terminal::UnixTerminal;
use self::winapi_terminal::WinApiTerminal; use self::winapi_terminal::WinApiTerminal;
pub use self::base_terminal::ClearType; pub use self::base_terminal::ClearType;
pub use self::terminal::{ get, Terminal }; pub use self::terminal::{ Terminal, terminal };

View File

@ -15,11 +15,17 @@ pub struct Terminal {
} }
impl Terminal { impl Terminal {
/// Instantiate an color implementation whereon color related actions can be performed. /// Create new terminal instance whereon terminal related actions can be performed.
pub fn init(&mut self) { pub fn new() -> Terminal {
if let None = self.terminal { let term: Option<Box<ITerminal>> =
self.terminal = get_terminal(); {
} #[cfg(unix)]
Some(UnixTerminal::new());
#[cfg(windows)]
Some(WinApiTerminal::new())
};
Terminal { terminal: term }
} }
/// Clear the current cursor by specifying the clear type /// Clear the current cursor by specifying the clear type
@ -31,7 +37,7 @@ impl Terminal {
/// extern crate crossterm; /// extern crate crossterm;
/// use crossterm::crossterm_terminal; /// use crossterm::crossterm_terminal;
/// ///
/// let mut term = crossterm_terminal::get(); /// let mut term = crossterm_terminal::terminal();
/// ///
/// // clear all cells in terminal. /// // clear all cells in terminal.
/// term.clear(crossterm_terminal::ClearType::All); /// term.clear(crossterm_terminal::ClearType::All);
@ -46,7 +52,6 @@ impl Terminal {
/// ///
/// ``` /// ```
pub fn clear(&mut self, clear_type: ClearType) { pub fn clear(&mut self, clear_type: ClearType) {
&self.init();
if let Some(ref terminal) = self.terminal { if let Some(ref terminal) = self.terminal {
terminal.clear(clear_type); terminal.clear(clear_type);
} }
@ -61,14 +66,13 @@ impl Terminal {
/// extern crate crossterm; /// extern crate crossterm;
/// use crossterm::crossterm_terminal; /// use crossterm::crossterm_terminal;
/// ///
/// let mut term = crossterm_terminal::get(); /// let mut term = crossterm_terminal::terminal();
/// ///
/// let size = term.terminal_size(); /// let size = term.terminal_size();
/// println!("{:?}", size); /// println!("{:?}", size);
/// ///
/// ``` /// ```
pub fn terminal_size(&mut self) -> Option<(u16, u16)> { pub fn terminal_size(&mut self) -> Option<(u16, u16)> {
&self.init();
if let Some(ref terminal) = self.terminal { if let Some(ref terminal) = self.terminal {
let a = terminal.terminal_size(); let a = terminal.terminal_size();
a a
@ -86,14 +90,13 @@ impl Terminal {
/// extern crate crossterm; /// extern crate crossterm;
/// use crossterm::crossterm_terminal; /// use crossterm::crossterm_terminal;
/// ///
/// let mut term = crossterm_terminal::get(); /// let mut term = crossterm_terminal::terminal();
/// ///
/// // scroll up by 5 lines /// // scroll up by 5 lines
/// let size = term.scroll_up(5); /// let size = term.scroll_up(5);
/// ///
/// ``` /// ```
pub fn scroll_up(&mut self, count: i16) { pub fn scroll_up(&mut self, count: i16) {
&self.init();
if let Some(ref terminal) = self.terminal { if let Some(ref terminal) = self.terminal {
terminal.scroll_up(count); terminal.scroll_up(count);
} }
@ -108,14 +111,13 @@ impl Terminal {
/// extern crate crossterm; /// extern crate crossterm;
/// use crossterm::crossterm_terminal; /// use crossterm::crossterm_terminal;
/// ///
/// let mut term = crossterm_terminal::get(); /// let mut term = crossterm_terminal::terminal();
/// ///
/// // scroll down by 5 lines /// // scroll down by 5 lines
/// let size = term.scroll_down(5); /// let size = term.scroll_down(5);
/// ///
/// ``` /// ```
pub fn scroll_down(&mut self, count: i16) { pub fn scroll_down(&mut self, count: i16) {
&self.init();
if let Some(ref terminal) = self.terminal { if let Some(ref terminal) = self.terminal {
terminal.scroll_down(count); terminal.scroll_down(count);
} }
@ -130,7 +132,7 @@ impl Terminal {
/// extern crate crossterm; /// extern crate crossterm;
/// use crossterm::crossterm_terminal; /// use crossterm::crossterm_terminal;
/// ///
/// let mut term = crossterm_terminal::get(); /// let mut term = crossterm_terminal::terminal();
/// ///
/// // Set of the size to X: 10 and Y: 10 /// // Set of the size to X: 10 and Y: 10
/// let size = term.set_size(10,10); /// let size = term.set_size(10,10);
@ -138,23 +140,12 @@ impl Terminal {
/// ``` /// ```
pub fn set_size(&mut self, width: i16, height: i16) pub fn set_size(&mut self, width: i16, height: i16)
{ {
&self.init(); if let Some (ref terminal) = self.terminal {
if let Some (ref terminal) = self.terminal
{
terminal.set_size(width,height); terminal.set_size(width,height);
} }
} }
} }
/// Get the concrete ITerminal implementation based on the current operating system.
fn get_terminal() -> Option<Box<ITerminal>> {
#[cfg(unix)]
return Some(UnixTerminal::new());
#[cfg(windows)]
return Some(WinApiTerminal::new());
}
/// Get an Terminal implementation whereon terminal related actions can be performed. /// Get an Terminal implementation whereon terminal related actions can be performed.
/// ///
/// Check `/examples/terminal` in the libary for more spesific examples. /// Check `/examples/terminal` in the libary for more spesific examples.
@ -166,14 +157,13 @@ fn get_terminal() -> Option<Box<ITerminal>> {
/// extern crate crossterm; /// extern crate crossterm;
/// use crossterm::crossterm_terminal; /// use crossterm::crossterm_terminal;
/// ///
/// let mut term = crossterm_terminal::get(); /// let mut term = crossterm_terminal::terminal();
/// ///
/// // scroll down by 5 lines /// // scroll down by 5 lines
/// let size = term.scroll_down(5); /// let size = term.scroll_down(5);
/// ///
/// ``` /// ```
pub fn get() -> Box<Terminal> { ///
Box::from(Terminal { pub fn terminal() -> Box<Terminal> {
terminal: get_terminal(), Box::from(Terminal::new())
})
} }

View File

@ -1,3 +1,5 @@
///! Notice that this feature is not used. But will be implemented later.
use super::kernel; use super::kernel;
/// Enables ansi for windows terminals. /// Enables ansi for windows terminals.