mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Simplify FuncRequest constructors
This commit is contained in:
parent
e0f553b941
commit
1dd676bed1
@ -30,41 +30,35 @@ FuncRequest const FuncRequest::unknown(LFUN_UNKNOWN_ACTION);
|
||||
FuncRequest const FuncRequest::noaction(LFUN_NOACTION);
|
||||
|
||||
FuncRequest::FuncRequest(Origin o)
|
||||
: action_(LFUN_NOACTION), origin_(o), view_origin_(nullptr), x_(0), y_(0),
|
||||
button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
|
||||
: origin_(o)
|
||||
{}
|
||||
|
||||
|
||||
FuncRequest::FuncRequest(FuncCode act, Origin o)
|
||||
: action_(act), origin_(o), view_origin_(nullptr), x_(0), y_(0),
|
||||
button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
|
||||
: action_(act), origin_(o)
|
||||
{}
|
||||
|
||||
|
||||
FuncRequest::FuncRequest(FuncCode act, docstring const & arg, Origin o)
|
||||
: action_(act), argument_(arg), origin_(o), view_origin_(nullptr), x_(0), y_(0),
|
||||
button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
|
||||
: action_(act), argument_(arg), origin_(o)
|
||||
{}
|
||||
|
||||
|
||||
FuncRequest::FuncRequest(FuncCode act, string const & arg, Origin o)
|
||||
: action_(act), argument_(from_utf8(arg)),
|
||||
origin_(o), view_origin_(nullptr), x_(0), y_(0),
|
||||
button_(mouse_button::none), modifier_(NoModifier), allow_async_(true)
|
||||
: FuncRequest(act, from_utf8(arg), o)
|
||||
{}
|
||||
|
||||
|
||||
FuncRequest::FuncRequest(FuncCode act, int ax, int ay,
|
||||
mouse_button::state button, KeyModifier modifier, Origin o)
|
||||
: action_(act), origin_(o), view_origin_(nullptr), x_(ax), y_(ay),
|
||||
button_(button), modifier_(modifier), allow_async_(true)
|
||||
: action_(act), origin_(o),
|
||||
x_(ax), y_(ay), button_(button), modifier_(modifier)
|
||||
{}
|
||||
|
||||
|
||||
FuncRequest::FuncRequest(FuncRequest const & cmd, docstring const & arg, Origin o)
|
||||
: action_(cmd.action()), argument_(arg),
|
||||
origin_(o), view_origin_(nullptr), x_(cmd.x_), y_(cmd.y_),
|
||||
button_(cmd.button_), modifier_(NoModifier), allow_async_(true)
|
||||
: action_(cmd.action()), argument_(arg), origin_(o),
|
||||
x_(cmd.x_), y_(cmd.y_), button_(cmd.button_)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -105,25 +105,25 @@ public:
|
||||
|
||||
private:
|
||||
/// the action
|
||||
FuncCode action_;
|
||||
FuncCode action_ = LFUN_NOACTION;
|
||||
/// the action's string argument
|
||||
docstring argument_;
|
||||
/// who initiated the action
|
||||
Origin origin_;
|
||||
Origin origin_ = INTERNAL;
|
||||
/// to which view should be this command sent (see bug #11004)
|
||||
/// NULL=current view
|
||||
frontend::GuiView* view_origin_;
|
||||
frontend::GuiView* view_origin_ = nullptr;
|
||||
/// the x coordinate of a mouse press
|
||||
int x_;
|
||||
int x_ = 0;
|
||||
/// the y coordinate of a mouse press
|
||||
int y_;
|
||||
int y_ = 0;
|
||||
/// some extra information (like button number)
|
||||
mouse_button::state button_;
|
||||
mouse_button::state button_ = mouse_button::none;
|
||||
///
|
||||
KeyModifier modifier_;
|
||||
KeyModifier modifier_ = NoModifier;
|
||||
/// Commands should be run synchronously when they
|
||||
/// are launched via "command-sequence" or "repeat" or "buffer-forall"
|
||||
bool allow_async_;
|
||||
bool allow_async_ = true;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user