Git commit 55ccd71fab21f1cca87b77db4c7140d0055c4c81 by Thomas Eschenbacher.
Committed on 07/03/2015 at 17:33.
Pushed by eschenbacher into branch 'master'.

added new command 'window:mousemove' (nearly the same as 'window:click', but 
sends a mouse move event instead of a mouse press/release event)

fixed some typos in comments

M  +29   -0    doc/en/index.docbook
M  +2    -0    kwave/FileContext.cpp
M  +1    -1    libgui/SignalView.cpp
M  +14   -0    plugins/debug/DebugPlugin.cpp
M  +1    -1    plugins/playback/PlayBackPlugin.cpp

http://commits.kde.org/kwave/55ccd71fab21f1cca87b77db4c7140d0055c4c81

diff --git a/doc/en/index.docbook b/doc/en/index.docbook
index e9005ee..d82cd71 100644
--- a/doc/en/index.docbook
+++ b/doc/en/index.docbook
@@ -125,6 +125,7 @@
   <!ENTITY no-i18n-cmd_window_cascade "window:cascade">
   <!ENTITY no-i18n-cmd_window_click "window:click">
   <!ENTITY no-i18n-cmd_window_close "window:close">
+  <!ENTITY no-i18n-cmd_window_mousemove "window:mousemove">
   <!ENTITY no-i18n-cmd_window_next_sub "window:next_sub">
   <!ENTITY no-i18n-cmd_window_prev_sub "window:prev_sub">
   <!ENTITY no-i18n-cmd_window_resize "window:resize">
@@ -3126,6 +3127,7 @@
                <indexentry><primaryie><link linkend="cmd_sect_window_cascade" 
endterm="cmd_title_window_cascade"/></primaryie></indexentry>
                <indexentry><primaryie><link linkend="cmd_sect_window_click" 
endterm="cmd_title_window_click"/></primaryie></indexentry>
                <indexentry><primaryie><link linkend="cmd_sect_window_close" 
endterm="cmd_title_window_close"/></primaryie></indexentry>
+               <indexentry><primaryie><link 
linkend="cmd_sect_window_mousemove" 
endterm="cmd_title_window_mousemove"/></primaryie></indexentry>
                <indexentry><primaryie><link linkend="cmd_sect_window_next_sub" 
endterm="cmd_title_window_next_sub"/></primaryie></indexentry>
                <indexentry><primaryie><link linkend="cmd_sect_window_prev_sub" 
endterm="cmd_title_window_prev_sub"/></primaryie></indexentry>
                <indexentry><primaryie><link linkend="cmd_sect_window_resize" 
endterm="cmd_title_window_resize"/></primaryie></indexentry>
@@ -4826,6 +4828,33 @@
        </tbody></tgroup></informaltable></simplesect>
        </sect2>
 
+       <!-- @COMMAND@ window:mousemove(class,x,y) -->
+       <sect2 id="cmd_sect_window_mousemove"><title 
id="cmd_title_window_mousemove">&no-i18n-cmd_window_mousemove;</title>
+       <simplesect>
+           
<title>&i18n-cmd_syntax;<command>&no-i18n-cmd_window_resize;</command>(
+               <replaceable>class</replaceable>,
+               <replaceable>x</replaceable>,
+               <replaceable>y</replaceable>
+           )</title>
+           <para>
+               Sends a mouse move event to window, identified by its
+               <replaceable>class</replaceable> name.
+               The event will only be sent to the first window that has
+               the given class name, therefore you should make sure that you
+               have only one instance of the given window when this command
+               gets executed.
+           </para>
+       </simplesect>
+       <simplesect><title>Parameters</title><informaltable 
frame='none'><tgroup cols='2'><tbody>
+           <row><entry><parameter>class</parameter>:</entry>
+               <entry>name of the window class</entry></row>
+           <row><entry><parameter>x</parameter>:</entry>
+               <entry>x position, relative to the left border of the window 
(in pixels)</entry></row>
+           <row><entry><parameter>y</parameter>:</entry>
+               <entry>y position, relative to the top border of the window (in 
pixels)</entry></row>
+       </tbody></tgroup></informaltable></simplesect>
+       </sect2>
+
        <!-- @COMMAND@ window:next_sub() -->
        <sect2 id="cmd_sect_window_next_sub"><title 
id="cmd_title_window_next_sub">&no-i18n-cmd_window_next_sub;</title>
        <simplesect>
diff --git a/kwave/FileContext.cpp b/kwave/FileContext.cpp
index 2d518d4..8111090 100644
--- a/kwave/FileContext.cpp
+++ b/kwave/FileContext.cpp
@@ -443,6 +443,8 @@ int Kwave::FileContext::executeCommand(const QString &line)
        return delegateCommand("debug", parser, 3);
     CASE_COMMAND("window:close")
        return delegateCommand("debug", parser, 1);
+    CASE_COMMAND("window:mousemove")
+       return delegateCommand("debug", parser, 3);
     CASE_COMMAND("window:resize")
        return delegateCommand("debug", parser, 3);
     CASE_COMMAND("window:sendkey")
diff --git a/libgui/SignalView.cpp b/libgui/SignalView.cpp
index 4d09de0..d7eead3 100644
--- a/libgui/SignalView.cpp
+++ b/libgui/SignalView.cpp
@@ -476,7 +476,7 @@ void Kwave::SignalView::mousePressEvent(QMouseEvent *e)
                }
                break;
            }
-           case 0: {
+           case Qt::NoModifier: {
                if (isSelectionBorder(e->pos().x())) {
                    // modify selection border
                    sample_index_t ofs = m_signal_manager->selection().first();
diff --git a/plugins/debug/DebugPlugin.cpp b/plugins/debug/DebugPlugin.cpp
index 1b09cb1..f49d86e 100644
--- a/plugins/debug/DebugPlugin.cpp
+++ b/plugins/debug/DebugPlugin.cpp
@@ -146,6 +146,20 @@ QStringList *Kwave::DebugPlugin::setup(QStringList &params)
            DBG(class_name), static_cast<void *>(widget));
        if (!widget) return 0;
        widget->close();
+    } else if (command == _("window:mousemove")) {
+       if (params.count() != 4) return 0;
+       QString    class_name = params[1];
+       QWidget   *widget     = findWidget(class_name.toUtf8().constData());
+       unsigned int x        = params[2].toUInt();
+       unsigned int y        = params[3].toUInt();
+       if (!widget) return 0;
+
+       QMouseEvent *move_event =
+           new QMouseEvent(QEvent::MouseMove,
+               QPoint(x, y),
+               widget->mapToGlobal(QPoint(x,y)),
+               Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+       QCoreApplication::postEvent(widget, move_event);
     } else if (command == _("window:resize")) {
        if (params.count() != 4) return 0;
        QString    class_name = params[1];
diff --git a/plugins/playback/PlayBackPlugin.cpp 
b/plugins/playback/PlayBackPlugin.cpp
index c51be20..5b8c29a 100644
--- a/plugins/playback/PlayBackPlugin.cpp
+++ b/plugins/playback/PlayBackPlugin.cpp
@@ -159,7 +159,7 @@ QStringList *Kwave::PlayBackPlugin::setup(QStringList 
&previous_params)
 {
     QStringList *result = 0;
 
-    // try to interprete the list of previous parameters, ignore errors
+    // try to interpret the list of previous parameters, ignore errors
     Kwave::PlayBackParam playback_params =
        interpreteParameters(previous_params);
 

Reply via email to