Skip to content

Commit

Permalink
[Term] Get rid of selection grips
Browse files Browse the repository at this point in the history
  • Loading branch information
o-sdn-o authored Apr 29, 2022
2 parents c70d58b + 1c508e2 commit 1693730
Show file tree
Hide file tree
Showing 34 changed files with 6,776 additions and 6,392 deletions.
4 changes: 2 additions & 2 deletions .resources/status/freebsd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .resources/status/linux.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .resources/status/macos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .resources/status/netbsd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .resources/status/openbsd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .resources/status/windows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ Text-based desktop environment inside your terminal*
Build-time dependencies
- `git`
- `cmake`
- [`gcc`](https://gcc.gnu.org/projects/cxx-status.html) or [`clang`](https://clang.llvm.org/cxx_status.html) with support for C++20
- Compiler support for C++20
- Minimal requirements to compile
- Using [`GCC`](https://gcc.gnu.org/projects/cxx-status.html)`3GB` of RAM
- Using [`Clang`](https://clang.llvm.org/cxx_status.html)`8GB` of RAM

```bash
git clone https://github.com/netxs-group/vtm.git && cd ./vtm
Expand Down Expand Up @@ -159,7 +162,7 @@ No arguments | Run client (auto start server)
<tr>
<th>LeftDrag</th>
<td colspan="3">Adjust sidebar width</td>
<td colspan="5">Move app window</td>
<td colspan="5">Move window or Select text</td>
<td>Panoramic workspace scrolling</td>
</tr>
<tr>
Expand All @@ -177,6 +180,15 @@ No arguments | Run client (auto start server)
<th>Left+RightDrag</th>
<td colspan="9">Panoramic workspace scrolling</td>
</tr>
<tr>
<th>Ctrl+LeftDrag</th>
<td colspan="9">Modify selection</td>
</tr>
<tr>
<tr>
<th>Alt+LeftDrag</th>
<td colspan="9">Switch boxed/linear selection mode</td>
</tr>
<tr>
<th>Ctrl+RightDrag or Ctrl+MiddleDrag</th>
<td colspan="9">Copy selected area to clipboard, OSC 52</td>
Expand Down
6 changes: 3 additions & 3 deletions src/netxs/abstract/duplet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ namespace netxs
}
return faux;
}
duplet less(duplet const& what, duplet const& iftrue, duplet const& iffalse) const
duplet less(duplet const& what, duplet const& if_yes, duplet const& if_no) const
{
return { x < what.x ? iftrue.x : iffalse.x,
y < what.y ? iftrue.y : iffalse.y };
return { x < what.x ? if_yes.x : if_no.x,
y < what.y ? if_yes.y : if_no.y };
}
bool inside(duplet const& p) const
{
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/abstract/fifo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace netxs::generics
zero{ }
{ }

template<bool ISSUB = false>
template<bool ISSUB = !true>
constexpr
void push(ITEM value)
{
Expand Down
5 changes: 1 addition & 4 deletions src/netxs/abstract/hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ namespace netxs
bool on_key(M const& map, K const& key)
{
const auto it = map.find(key);
if (it == map.end())
return false;
else
return true;
return it != map.end();
}

// do it in place
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/abstract/ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace netxs
static std::mutex mutex;
static wptr<T> count;

std::lock_guard lock(mutex);
auto guard = std::lock_guard{ mutex };

auto thing = count.lock();
if (thing) return thing;
Expand Down
21 changes: 10 additions & 11 deletions src/netxs/abstract/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,54 @@ namespace netxs
std::mutex d_mutex;
std::condition_variable d_condition;
std::deque<T> d_queue;

public:
void push(T const& value)
{
{
std::unique_lock<std::mutex> lock(d_mutex);
d_queue.push_front(value);
}
auto guard = std::lock_guard{ d_mutex };
d_queue.push_front(value);
d_condition.notify_one();
}
T pop()
{
std::unique_lock<std::mutex> lock(d_mutex);
auto lock = std::unique_lock{ d_mutex };
d_condition.wait(lock, [this] { return !d_queue.empty(); });
T rc(std::move(d_queue.back()));
d_queue.pop_back();
return rc;
}
bool try_pop(T& v, std::chrono::milliseconds timeout)
{
std::unique_lock<std::mutex> lock(d_mutex);
auto lock = std::unique_lock{ d_mutex };
if (!d_condition.wait_for(lock, timeout, [this] { return !d_queue.empty(); }))
{
return false;
return !true;
}
v = d_queue.back();
d_queue.pop_back();
return true;
}
size_t size()
{
std::unique_lock<std::mutex> lock(d_mutex);
auto guard = std::lock_guard{ d_mutex };
return d_queue.size();
}
void clear()
{
std::unique_lock<std::mutex> lock(d_mutex);
auto guard = std::lock_guard{ d_mutex };
d_queue.clear();
}

mt_queue() { }
mt_queue(mt_queue<T>&& x)
{
std::unique_lock<std::mutex> lock(x.d_mutex);
auto guard = std::lock_guard{ d_mutex };
d_queue = std::move(x.d_queue);
}
mt_queue<T>& operator=(mt_queue<T>&& x)
{
//todo *this is not a MT safe (only x.d_mutex is locked)
std::unique_lock<std::mutex> lock(x.d_mutex);
auto guard = std::lock_guard{ d_mutex };
d_queue = std::move(x.d_queue);
return *this;
}
Expand Down
5 changes: 2 additions & 3 deletions src/netxs/abstract/semaphore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace utils

void acquire()
{
std::unique_lock<std::mutex> lock(m);
auto lock = std::unique_lock{ m };
while (count == max_count)
{
cv.wait(lock);
Expand All @@ -32,8 +32,7 @@ namespace utils

void release()
{
std::lock_guard<std::mutex> lock(m);

auto guard = std::lock_guard{ m };
--count;
cv.notify_one();
}
Expand Down
Loading

0 comments on commit 1693730

Please sign in to comment.