Remove inconsistent use of 'is_' prefix

Fixes #1963
This commit is contained in:
Norman Feske
2016-05-11 18:21:47 +02:00
committed by Christian Helmuth
parent 15141f3ca7
commit 807be83b1b
225 changed files with 876 additions and 705 deletions

View File

@ -245,7 +245,7 @@ class Domain_registry
_insert(domain);
if (domain.is_last(type))
if (domain.last(type))
break;
}
}

View File

@ -33,13 +33,13 @@ static unsigned num_consecutive_events(Input::Event const *ev, unsigned max)
if (max < 1) return 0;
if (ev->type() != Input::Event::MOTION) return 1;
bool first_is_absolute = ev->is_absolute_motion();
bool const first_absolute = ev->absolute_motion();
/* iterate until we get a different event type, start at second */
unsigned cnt = 1;
for (ev++ ; cnt < max; cnt++, ev++) {
if (ev->type() != Input::Event::MOTION) break;
if (first_is_absolute != ev->is_absolute_motion()) break;
if (first_absolute != ev->absolute_motion()) break;
}
return cnt;
}
@ -72,7 +72,7 @@ static Input::Event merge_motion_events(Input::Event const *ev, unsigned n)
static bool import_input_events(Input::Event *ev_buf, unsigned num_ev,
User_state &user_state)
{
bool user_is_active = false;
bool user_active = false;
if (num_ev > 0) {
/*
@ -97,7 +97,7 @@ static bool import_input_events(Input::Event *ev_buf, unsigned num_ev,
* a zero-motion event, drop it. Otherwise, it would be
* misinterpreted as absolute event pointing to (0, 0).
*/
if (e->is_relative_motion() && curr.rx() == 0 && curr.ry() == 0)
if (e->relative_motion() && curr.rx() == 0 && curr.ry() == 0)
continue;
/*
@ -105,7 +105,7 @@ static bool import_input_events(Input::Event *ev_buf, unsigned num_ev,
* we regard the user as active. This check captures the presence
* of press-release combinations within one batch of input events.
*/
user_is_active |= user_state.key_is_pressed();
user_active |= user_state.key_pressed();
/* pass event to user state */
user_state.handle_event(curr);
@ -122,9 +122,9 @@ static bool import_input_events(Input::Event *ev_buf, unsigned num_ev,
/*
* If at least one key is kept pressed, we regard the user as active.
*/
user_is_active |= user_state.key_is_pressed();
user_active |= user_state.key_pressed();
return user_is_active;
return user_active;
}
#endif /* _INPUT_H_ */

View File

@ -79,7 +79,7 @@ Framebuffer::Session *tmp_fb;
static void report_session(Genode::Reporter &reporter, Session *session,
bool active = false)
{
if (!reporter.is_enabled())
if (!reporter.enabled())
return;
Genode::Reporter::Xml_generator xml(reporter, [&] ()
@ -277,7 +277,7 @@ class Input::Session_component : public Genode::Rpc_object<Session>
Dataspace_capability dataspace() override { return _ev_ram_ds.cap(); }
bool is_pending() const override { return _num_ev > 0; }
bool pending() const override { return _num_ev > 0; }
int flush() override
{
@ -527,7 +527,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
case Command::OP_GEOMETRY:
{
Locked_ptr<View> view(_view_handle_registry.lookup(command.geometry.view));
if (!view.is_valid())
if (!view.valid())
return;
Point pos = command.geometry.rect.p1();
@ -536,7 +536,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
if (view->top_level())
pos = ::Session::phys_pos(pos, _view_stack.size());
if (view.is_valid())
if (view.valid())
_view_stack.geometry(*view, Rect(pos, command.geometry.rect.area()));
return;
@ -546,7 +546,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
{
Locked_ptr<View> view(_view_handle_registry.lookup(command.geometry.view));
if (view.is_valid())
if (view.valid())
_view_stack.buffer_offset(*view, command.offset.offset);
return;
@ -558,7 +558,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
return;
Locked_ptr<View> view(_view_handle_registry.lookup(command.to_front.view));
if (!view.is_valid())
if (!view.valid())
return;
/* bring to front if no neighbor is specified */
@ -569,7 +569,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
/* stack view relative to neighbor */
Locked_ptr<View> neighbor(_view_handle_registry.lookup(command.to_front.neighbor));
if (neighbor.is_valid())
if (neighbor.valid())
_view_stack.stack(*view, &(*neighbor), false);
return;
@ -581,7 +581,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
return;
Locked_ptr<View> view(_view_handle_registry.lookup(command.to_back.view));
if (!view.is_valid())
if (!view.valid())
return;
/* bring to front if no neighbor is specified */
@ -592,7 +592,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
/* stack view relative to neighbor */
Locked_ptr<View> neighbor(_view_handle_registry.lookup(command.to_back.neighbor));
if (neighbor.is_valid())
if (neighbor.valid())
_view_stack.stack(*view, &(*neighbor), true);
return;
@ -602,7 +602,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
{
if (_provides_default_bg) {
Locked_ptr<View> view(_view_handle_registry.lookup(command.to_front.view));
if (!view.is_valid())
if (!view.valid())
return;
view->background(true);
@ -616,7 +616,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
/* assign session background */
Locked_ptr<View> view(_view_handle_registry.lookup(command.to_front.view));
if (!view.is_valid())
if (!view.valid())
return;
::Session::background(&(*view));
@ -632,7 +632,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
{
Locked_ptr<View> view(_view_handle_registry.lookup(command.title.view));
if (view.is_valid())
if (view.valid())
_view_stack.title(*view, command.title.title.string());
return;
@ -764,7 +764,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
try {
Locked_ptr<View> parent(_view_handle_registry.lookup(parent_handle));
if (!parent.is_valid())
if (!parent.valid())
return View_handle();
view = new (_view_alloc)
@ -849,7 +849,7 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
{
try {
Locked_ptr<View> view(_view_handle_registry.lookup(handle));
return view.is_valid() ? view->cap() : View_capability();
return view.valid() ? view->cap() : View_capability();
}
catch (View_handle_registry::Lookup_failed) {
return View_capability();
@ -1272,7 +1272,7 @@ void Nitpicker::Main::handle_input(unsigned)
user_active = false;
/* report mouse-position updates */
if (pointer_reporter.is_enabled() && old_pointer_pos != new_pointer_pos) {
if (pointer_reporter.enabled() && old_pointer_pos != new_pointer_pos) {
Genode::Reporter::Xml_generator xml(pointer_reporter, [&] ()
{
@ -1282,7 +1282,7 @@ void Nitpicker::Main::handle_input(unsigned)
}
/* report hover changes */
if (!user_state.Mode::key_is_pressed()
if (!user_state.Mode::key_pressed()
&& old_pointed_session != new_pointed_session) {
report_session(hover_reporter, new_pointed_session);
}

View File

@ -51,7 +51,7 @@ class Mode
bool has_key_cnt(unsigned cnt) const { return cnt == _key_cnt; }
bool key_is_pressed() const { return _key_cnt > 0; }
bool key_pressed() const { return _key_cnt > 0; }
Session *focused_session() { return _focused_session; }
Session const *focused_session() const { return _focused_session; }
@ -62,7 +62,7 @@ class Mode
_next_focused_session = session;
}
bool is_focused(Session const &session) const { return &session == _focused_session; }
bool focused(Session const &session) const { return &session == _focused_session; }
void next_focused_session(Session *session) { _next_focused_session = session; }
@ -77,7 +77,7 @@ class Mode
* inconsistent press and release events. However, focus changes
* during global key sequences are fine.
*/
if (key_is_pressed() && !_global_key_sequence)
if (key_pressed() && !_global_key_sequence)
return;
if (_focused_session != _next_focused_session)

View File

@ -75,7 +75,7 @@ void User_state::handle_event(Input::Event ev)
ax = ev.ax();
ay = ev.ay();
ev = Input::Event::create_touch_event(ax, ay, ev.code(),
ev.is_touch_release());
ev.touch_release());
} else
ev = Input::Event(type, keycode, ax, ay, rx, ry);

View File

@ -206,7 +206,7 @@ class View : public Same_buffer_list_elem,
{
if (!_session.label_visible()) return 0;
return mode.is_focused(_session) ? 5 : 3;
return mode.focused(_session) ? 5 : 3;
}
/**
@ -236,10 +236,10 @@ class View : public Same_buffer_list_elem,
/**
* Set view as background
*
* \param is_bg true if view is background
* \param bg true if view is background
*/
void background(bool is_bg) {
_background = is_bg ? BACKGROUND : NOT_BACKGROUND; }
void background(bool bg) {
_background = bg ? BACKGROUND : NOT_BACKGROUND; }
/**
* Accessors