Re: kb_action

2008-03-07 Thread Abdelrazak Younes

Andre Poenitz wrote:

What would be a good name for the 'kb_action' enum?
It's a bit similar to 'InsetCode'...

LFunCode?
FunctionCode?
FuncCode?


FuncCode looks good, inline with FuncRequest.

Abdel.



Re: kb_action

2008-03-07 Thread Pavel Sanda
> What would be a good name for the 'kb_action' enum?
> It's a bit similar to 'InsetCode'...
> 
> LFunCode?
+1

> FunctionCode?
> FuncCode?

p


kb_action

2008-03-07 Thread Andre Poenitz

What would be a good name for the 'kb_action' enum?
It's a bit similar to 'InsetCode'...

LFunCode?
FunctionCode?
FuncCode?

Andre'


Re: [patch] More refinemens LyXAction, kb_action and friends

2003-09-22 Thread John Levon
On Mon, Sep 22, 2003 at 10:24:11AM +0200, Andre Poenitz wrote:

> On Mon, Sep 22, 2003 at 12:46:29AM +0100, John Levon wrote:
> > > No, this latest patch fixes it and the first one did not introduce it.
> > 
> > Hmm, then what am I left with to complain about !
> 
> Maybe you could just complain about nothing being left to complain
> about...

I thought I was ! Nobody ever seems to understand me ... *grumble*

john
-- 
Khendon's Law:
If the same point is made twice by the same person, the thread is over.


Re: [patch] More refinemens LyXAction, kb_action and friends

2003-09-22 Thread Andre Poenitz
On Mon, Sep 22, 2003 at 12:46:29AM +0100, John Levon wrote:
> > No, this latest patch fixes it and the first one did not introduce it.
> 
> Hmm, then what am I left with to complain about !

Maybe you could just complain about nothing being left to complain
about...

[Although this is a thing I'd call 'typical German' I would gladly you
the right to participate -- lest that art be forgotten in an era of
enough other things to complain about...]

Andre'


Re: [patch] More refinemens LyXAction, kb_action and friends

2003-09-21 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

| On Mon, Sep 22, 2003 at 01:40:06AM +0200, Lars Gullik Bj?nnes wrote:
>
>> >> Also I found some strange differences between XForms and Qt. In XForms
>> >> the command bindings are present in the menus, in qt noe. (gtk does
>> >> not matter since that does not even try to put bindings in the menus).
>> >
>> | Do I mean this to understand  that the patch introduces a regression,
>> | yet it was still applied ? :(
>> 
>> No, this latest patch fixes it and the first one did not introduce it.
>
| Hmm, then what am I left with to complain about !

I am sure you will find something.

-- 
Lgb


Re: [patch] More refinemens LyXAction, kb_action and friends

2003-09-21 Thread John Levon
On Mon, Sep 22, 2003 at 01:40:06AM +0200, Lars Gullik Bj?nnes wrote:

> >> Also I found some strange differences between XForms and Qt. In XForms
> >> the command bindings are present in the menus, in qt noe. (gtk does
> >> not matter since that does not even try to put bindings in the menus).
> >
> | Do I mean this to understand  that the patch introduces a regression,
> | yet it was still applied ? :(
> 
> No, this latest patch fixes it and the first one did not introduce it.

Hmm, then what am I left with to complain about !

john

-- 
Khendon's Law:
If the same point is made twice by the same person, the thread is over.


Re: [patch] More refinemens LyXAction, kb_action and friends

2003-09-21 Thread Lars Gullik Bjønnes
John Levon <[EMAIL PROTECTED]> writes:

| On Mon, Sep 22, 2003 at 12:42:36AM +0200, Lars Gullik Bj?nnes wrote:
>
>> Also I found some strange differences between XForms and Qt. In XForms
>> the command bindings are present in the menus, in qt noe. (gtk does
>> not matter since that does not even try to put bindings in the menus).
>
| Do I mean this to understand  that the patch introduces a regression,
| yet it was still applied ? :(

No, this latest patch fixes it and the first one did not introduce it.

-- 
Lgb


Re: [patch] More refinemens LyXAction, kb_action and friends

2003-09-21 Thread John Levon
On Mon, Sep 22, 2003 at 12:42:36AM +0200, Lars Gullik Bj?nnes wrote:

> Also I found some strange differences between XForms and Qt. In XForms
> the command bindings are present in the menus, in qt noe. (gtk does
> not matter since that does not even try to put bindings in the menus).

Do I mean this to understand  that the patch introduces a regression,
yet it was still applied ? :(

john

-- 
Khendon's Law:
If the same point is made twice by the same person, the thread is over.


[patch] More refinemens LyXAction, kb_action and friends

2003-09-21 Thread Lars Gullik Bjønnes

This moves the world along (according to me...)

IMHO things are beginning to look a bit better, but there are still
several functions that can be removed and simplified.

Also I found some strange differences between XForms and Qt. In XForms
the command bindings are present in the menus, in qt noe. (gtk does
not matter since that does not even try to put bindings in the menus).

? action-1.diff
? pseudo-2.diff
Index: src/BufferView_pimpl.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.438
diff -u -p -r1.438 BufferView_pimpl.C
--- src/BufferView_pimpl.C	17 Sep 2003 16:44:51 -	1.438
+++ src/BufferView_pimpl.C	21 Sep 2003 22:39:47 -
@@ -1324,7 +1324,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
 		ev.errorMessage(N_("Unknown function!"));
 		break;
 
-	default:	
+	default:
 		return bv_->getLyXText()->dispatch(FuncRequest(ev, bv_));
 	} // end of switch
 
Index: src/LyXAction.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LyXAction.C,v
retrieving revision 1.183
diff -u -p -r1.183 LyXAction.C
--- src/LyXAction.C	21 Sep 2003 18:57:13 -	1.183
+++ src/LyXAction.C	21 Sep 2003 22:39:47 -
@@ -20,6 +20,8 @@
 
 #include "support/lstrings.h"
 
+#include 
+
 using lyx::support::split;
 using lyx::support::trim;
 
@@ -47,16 +49,6 @@ using std::ostream;
 
 LyXAction lyxaction;
 
-namespace {
-
-/// return true if the given action is a pseudo-action
-inline bool isPseudoAction(int a)
-{
-	return a > int(LFUN_LASTACTION);
-}
-
-}
-
 
 void LyXAction::newFunc(kb_action action, string const & name,
 			unsigned int attrib)
@@ -345,29 +337,27 @@ LyXAction::LyXAction()
 
 
 // Returns an action tag from a string.
-kb_action LyXAction::LookupFunc(string const & func)
+FuncRequest LyXAction::lookupFunc(string const & func) const
 {
 	string const func2 = trim(func);
-	if (func2.empty()) return LFUN_NOACTION;
 
-	// split action and arg
-	string actstr;
-	string const argstr = split(func2, actstr, ' ');
-	lyxerr[Debug::ACTION] << "Action: " << actstr << '\n'
-			  << "Arg   : " << argstr << endl;
+	if (func2.empty()) {
+		return FuncRequest(LFUN_NOACTION);
+	}
+
+	string cmd;
+	string const arg = split(func2, cmd, ' ');
 
-	func_map::const_iterator fit = lyx_func_map.find(actstr);
+	func_map::const_iterator fit = lyx_func_map.find(cmd);
 
-	return fit != lyx_func_map.end() ? fit->second : LFUN_UNKNOWN_ACTION;
+	return fit != lyx_func_map.end() ? FuncRequest(fit->second, arg) : FuncRequest(LFUN_UNKNOWN_ACTION);
 }
 
 
-string const LyXAction::getActionName(int action) const
+string const LyXAction::getActionName(kb_action action) const
 {
-	info_map::const_iterator const it = lyx_info_map.find(kb_action(action));
-	if (it != lyx_info_map.end())
-		return it->second.name;
-	return string();
+	info_map::const_iterator const it = lyx_info_map.find(action);
+	return it != lyx_info_map.end() ? it->second.name : string();
 }
 
 
@@ -376,14 +366,9 @@ bool LyXAction::funcHasFlag(kb_action ac
 {
 	info_map::const_iterator ici = lyx_info_map.find(action);
 
-	if (ici != lyx_info_map.end()) {
-		return ici->second.attrib & flag;
-	} else {
-		// it really should exist, but...
-		lyxerr << "LyXAction::funcHasFlag: "
-			"No info about kb_action: " << action << '\n';
-		return false;
-	}
+	BOOST_ASSERT(ici != lyx_info_map.end());
+
+	return ici->second.attrib & flag;
 }
 
 
Index: src/LyXAction.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LyXAction.h,v
retrieving revision 1.26
diff -u -p -r1.26 LyXAction.h
--- src/LyXAction.h	21 Sep 2003 18:57:13 -	1.26
+++ src/LyXAction.h	21 Sep 2003 22:39:47 -
@@ -60,10 +60,10 @@ public:
 	 * If you include arguments in func_name, a new pseudoaction
 	 * will be created if needed.
 	 */
-	kb_action LookupFunc(string const & func_name);
+	FuncRequest lookupFunc(string const & func_name) const;
 
 	/// Return the name (and argument) associated with the given (pseudo) action
-	string const getActionName(int action) const;
+	string const getActionName(kb_action action) const;
 
 	/// True if the command has `flag' set
 	bool funcHasFlag(kb_action action, func_attrib flag) const;
Index: src/MenuBackend.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/MenuBackend.C,v
retrieving revision 1.87
diff -u -p -r1.87 MenuBackend.C
--- src/MenuBackend.C	21 Sep 2003 18:57:13 -	1.87
+++ src/MenuBackend.C	21 Sep 2003 22:39:47 -
@@ -115,12 +115,17 @@ string const MenuItem::binding() const
 
 	// Get the keys bound to this action, but keep only the
 	// fir

Re: Bug: "LyXAction::funcHasFlag: No info about kb_action: -1073748040"

2003-01-06 Thread Jean-Marc Lasgouttes
>>>>> "John" == John Levon <[EMAIL PROTECTED]> writes:

John> On Sun, Dec 22, 2002 at 03:38:25PM +0100, Michael Schmitt wrote:
>> >>If I open some of the LyX menus, I get the following console
>> message:
>> >>
>> >> LyXAction::funcHasFlag: No info about kb_action: -1073748040
>> 
>> xforms frontend. Menus "edit", "insert", "display/view" (whatever
>> it is called in english), and "navigate".
>> 

John> I cannot reproduce this

I fixed it.

JMarc



Re: Bug: "LyXAction::funcHasFlag: No info about kb_action: -1073748040"

2003-01-03 Thread John Levon
On Sun, Dec 22, 2002 at 03:38:25PM +0100, Michael Schmitt wrote:

> >>If I open some of the LyX menus, I get the following console message:
> >>
> >>   LyXAction::funcHasFlag: No info about kb_action: -1073748040
> 
> xforms frontend. Menus "edit", "insert", "display/view" (whatever it is 
> called in english), and "navigate".
> 

I cannot reproduce this

regards
john

-- 
"I will eat a rubber tire to the music of The Flight of the Bumblebee"



Re: Bug: "LyXAction::funcHasFlag: No info about kb_action: -1073748040"

2002-12-23 Thread Jean-Marc Lasgouttes
>>>>> "Michael" == Michael Schmitt <[EMAIL PROTECTED]> writes:

Michael> John Levon wrote:
>>> If I open some of the LyX menus, I get the following console
>>> message:
>>> 
>>> LyXAction::funcHasFlag: No info about kb_action: -1073748040
>>> 
>>> valgrind tells me the following:
>> which menus exactly ? xforms frontend ?? I thought I fixed the Qt
>> cases. The menu code should never be quering an uninited kb_action,
>> we're probably asking about the "status" of a separator or
>> something

Michael> xforms frontend. Menus "edit", "insert", "display/view"
Michael> (whatever it is called in english), and "navigate".

Are you sure this latest cvs. I thought I fixed it...

JMarc





Re: Bug: "LyXAction::funcHasFlag: No info about kb_action: -1073748040"

2002-12-22 Thread Michael Schmitt
John Levon wrote:


If I open some of the LyX menus, I get the following console message:

   LyXAction::funcHasFlag: No info about kb_action: -1073748040

valgrind tells me the following:



which menus exactly ? xforms frontend ?? I  thought I fixed the Qt
cases. The menu code  should never be quering an uninited kb_action,
we're probably asking about the "status" of a separator or something


xforms frontend. Menus "edit", "insert", "display/view" (whatever it is 
called in english), and "navigate".

Michael




Re: Bug: "LyXAction::funcHasFlag: No info about kb_action: -1073748040"

2002-12-21 Thread John Levon
On Sat, Dec 21, 2002 at 02:20:08AM +0100, Michael Schmitt wrote:

> If I open some of the LyX menus, I get the following console message:
> 
> LyXAction::funcHasFlag: No info about kb_action: -1073748040
> 
> valgrind tells me the following:

which menus exactly ? xforms frontend ?? I  thought I fixed the Qt
cases. The menu code  should never be quering an uninited kb_action,
we're probably asking about the "status" of a separator or something

regards
john



Bug: "LyXAction::funcHasFlag: No info about kb_action: -1073748040"

2002-12-20 Thread Michael Schmitt
Hi!

If I open some of the LyX menus, I get the following console message:

LyXAction::funcHasFlag: No info about kb_action: -1073748040

valgrind tells me the following:

==11293== Conditional jump or move depends on uninitialised value(s)
==11293==at 0x8076B42: LyXAction::retrieveActionArg(int) const 
(LyXAction.C:492)
==11293==by 0x80D6828: LyXFunc::getStatus(int) const 
(/usr/include/g++/bits/basic_string.h:229)
==11293==by 0x82053AB: Menubar::Pimpl::create_submenu(unsigned long, 
XFormsView*, Menu const&, std::vector >&, 
bool&) (../../../src/MenuBackend.h:87)
==11293==by 0x8206483: Menubar::Pimpl::MenuCallback(flobjs_*, long) 
(Menubar_pimpl.C:396)
==11293==
==11293== Conditional jump or move depends on uninitialised value(s)
==11293==at 0x80D689C: LyXFunc::getStatus(FuncRequest const&) const 
(/usr/include/g++/bits/stl_alloc.h:630)
==11293==by 0x80D6835: LyXFunc::getStatus(int) const 
(/usr/include/g++/bits/basic_string.h:229)
==11293==by 0x82053AB: Menubar::Pimpl::create_submenu(unsigned long, 
XFormsView*, Menu const&, std::vector >&, 
bool&) (../../../src/MenuBackend.h:87)
==11293==by 0x8206483: Menubar::Pimpl::MenuCallback(flobjs_*, long) 
(Menubar_pimpl.C:396)
==11293==
==11293== Conditional jump or move depends on uninitialised value(s)
==11293==at 0x80D690A: LyXFunc::getStatus(FuncRequest const&) const 
(lyxfunc.C:274)
==11293==by 0x80D6835: LyXFunc::getStatus(int) const 
(/usr/include/g++/bits/basic_string.h:229)
==11293==by 0x82053AB: Menubar::Pimpl::create_submenu(unsigned long, 
XFormsView*, Menu const&, std::vector >&, 
bool&) (../../../src/MenuBackend.h:87)
==11293==by 0x8206483: Menubar::Pimpl::MenuCallback(flobjs_*, long) 
(Menubar_pimpl.C:396)
==11293==

What does this mean? I haven't seen this problem in the past (more than 
3 days ago)

Regards, Michael