summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-12-02 17:47:11 +0000
committerMichael Meeks <michael.meeks@suse.com>2011-12-05 20:53:23 +0000
commit857b4f5357ba53bdfaf59671b219d74ae8c5945a (patch)
treecc3a2612e220bfb837c4f008e3741c0d336dc085 /sdext
parentb35b7080980c0ba43f411db469feb30f8a5c6881 (diff)
presenter console: add 'Switch monitors' button to help get setup
For years, we've been carefully detecting the laptop display, and choosing it as the default display to project to - thus many of our users have configured around this. Provide a way for them to undo the folly, and any subsequent mis-detections easily. Initial Artwork is clearly in need of some bug-fixing. Cleanup hyper-pre-optimised madness in ProtocolHandler.cxx too, called a few dozen times - and has nested switch statements on characters.
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx130
-rw-r--r--sdext/source/presenter/bitmaps/ButtonSwitchMonitorDisabled.pngbin0 -> 2146 bytes
-rw-r--r--sdext/source/presenter/bitmaps/ButtonSwitchMonitorMouseOver.pngbin0 -> 1628 bytes
-rw-r--r--sdext/source/presenter/bitmaps/ButtonSwitchMonitorNormal.pngbin0 -> 1569 bytes
-rw-r--r--sdext/source/presenter/makefile.mk2
-rw-r--r--sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu38
6 files changed, 100 insertions, 70 deletions
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index 1c19fc4ce48a..f5be51f8bd20 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -109,6 +109,19 @@ namespace {
rtl::Reference<PresenterController> mpPresenterController;
};
+ class SwitchMonitorCommand : public Command
+ {
+ public:
+ SwitchMonitorCommand (
+ const rtl::Reference<PresenterController>& rpPresenterController);
+ virtual ~SwitchMonitorCommand (void) {}
+ virtual void Execute (void);
+ virtual bool IsEnabled (void) const;
+ virtual Any GetState (void) const;
+ private:
+ rtl::Reference<PresenterController> mpPresenterController;
+ };
+
class SetNotesViewCommand : public Command
{
public:
@@ -426,76 +439,31 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand (
{
if (rsURLPath.getLength() <= 5)
return NULL;
- switch (rsURLPath[0])
- {
- case sal_Char('C') :
- switch (rsURLPath[5])
- {
- case sal_Char('N'):
- if (rsURLPath == A2S("CloseNotes"))
- return new SetNotesViewCommand(false, rpPresenterController);
- break;
- case sal_Char('S'):
- if (rsURLPath == A2S("CloseSlideSorter"))
- return new SetSlideSorterCommand(false, rpPresenterController);
- break;
- case sal_Char('H'):
- if (rsURLPath == A2S("CloseHelp"))
- return new SetHelpViewCommand(false, rpPresenterController);
- break;
- }
- break;
- case sal_Char('G') :
- if (rsURLPath == A2S("GrowNotesFont"))
- return new NotesFontSizeCommand(rpPresenterController, +1);
- break;
-
- case sal_Char('N') :
- switch (rsURLPath[4])
- {
- case sal_Char('E'):
- if (rsURLPath == A2S("NextEffect"))
- return new GotoNextEffectCommand(rpPresenterController);
- case sal_Char('S'):
- if (rsURLPath == A2S("NextSlide"))
- return new GotoNextSlideCommand(rpPresenterController);
- break;
- }
- break;
- case sal_Char('P') :
- if (rsURLPath == A2S("PrevSlide"))
- return new GotoPreviousSlideCommand(rpPresenterController);
- break;
-
- case sal_Char('S') :
- switch (rsURLPath[4])
- {
- case sal_Char('N'):
- if (rsURLPath == A2S("ShowNotes"))
- return new SetNotesViewCommand(true, rpPresenterController);
- break;
-
- case sal_Char('S'):
- if (rsURLPath == A2S("ShowSlideSorter"))
- return new SetSlideSorterCommand(true, rpPresenterController);
- break;
-
- case sal_Char('H'):
- if (rsURLPath == A2S("ShowHelp"))
- return new SetHelpViewCommand(true, rpPresenterController);
- break;
-
- case sal_Char('n'):
- if (rsURLPath == A2S("ShrinkNotesFont"))
- return new NotesFontSizeCommand(rpPresenterController, -1);
- break;
- }
- break;
-
- default:
- break;
- }
+ if (rsURLPath == A2S("CloseNotes"))
+ return new SetNotesViewCommand(false, rpPresenterController);
+ if (rsURLPath == A2S("CloseSlideSorter"))
+ return new SetSlideSorterCommand(false, rpPresenterController);
+ if (rsURLPath == A2S("CloseHelp"))
+ return new SetHelpViewCommand(false, rpPresenterController);
+ if (rsURLPath == A2S("GrowNotesFont"))
+ return new NotesFontSizeCommand(rpPresenterController, +1);
+ if (rsURLPath == A2S("NextEffect"))
+ return new GotoNextEffectCommand(rpPresenterController);
+ if (rsURLPath == A2S("NextSlide"))
+ return new GotoNextSlideCommand(rpPresenterController);
+ if (rsURLPath == A2S("PrevSlide"))
+ return new GotoPreviousSlideCommand(rpPresenterController);
+ if (rsURLPath == A2S("SwitchMonitor"))
+ return new SwitchMonitorCommand(rpPresenterController);
+ if (rsURLPath == A2S("ShowNotes"))
+ return new SetNotesViewCommand(true, rpPresenterController);
+ if (rsURLPath == A2S("ShowSlideSorter"))
+ return new SetSlideSorterCommand(true, rpPresenterController);
+ if (rsURLPath == A2S("ShowHelp"))
+ return new SetHelpViewCommand(true, rpPresenterController);
+ if (rsURLPath == A2S("ShrinkNotesFont"))
+ return new NotesFontSizeCommand(rpPresenterController, -1);
return NULL;
}
@@ -686,7 +654,6 @@ Any GotoPreviousSlideCommand::GetState (void) const
-
//===== GotoNextEffect ========================================================
GotoNextEffectCommand::GotoNextEffectCommand (
@@ -771,6 +738,29 @@ Any GotoNextSlideCommand::GetState (void) const
}
+//===== SwitchMonitorCommand ==============================================
+
+SwitchMonitorCommand::SwitchMonitorCommand (
+ const rtl::Reference<PresenterController>& rpPresenterController)
+ : mpPresenterController(rpPresenterController)
+{
+}
+
+void SwitchMonitorCommand::Execute (void)
+{
+ fprintf (stderr, "Switch monitor !\n");
+}
+
+bool SwitchMonitorCommand::IsEnabled (void) const
+{
+ fprintf (stderr, "FIXME - check me !\n");
+ return true;
+}
+
+Any SwitchMonitorCommand::GetState (void) const
+{
+ return Any(sal_False);
+}
//===== SetNotesViewCommand ===================================================
diff --git a/sdext/source/presenter/bitmaps/ButtonSwitchMonitorDisabled.png b/sdext/source/presenter/bitmaps/ButtonSwitchMonitorDisabled.png
new file mode 100644
index 000000000000..653dffeb183d
--- /dev/null
+++ b/sdext/source/presenter/bitmaps/ButtonSwitchMonitorDisabled.png
Binary files differ
diff --git a/sdext/source/presenter/bitmaps/ButtonSwitchMonitorMouseOver.png b/sdext/source/presenter/bitmaps/ButtonSwitchMonitorMouseOver.png
new file mode 100644
index 000000000000..f56751687eb7
--- /dev/null
+++ b/sdext/source/presenter/bitmaps/ButtonSwitchMonitorMouseOver.png
Binary files differ
diff --git a/sdext/source/presenter/bitmaps/ButtonSwitchMonitorNormal.png b/sdext/source/presenter/bitmaps/ButtonSwitchMonitorNormal.png
new file mode 100644
index 000000000000..3ca0f6f20c46
--- /dev/null
+++ b/sdext/source/presenter/bitmaps/ButtonSwitchMonitorNormal.png
Binary files differ
diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk
index e1d15a51636a..a0d8d0f939d6 100644
--- a/sdext/source/presenter/makefile.mk
+++ b/sdext/source/presenter/makefile.mk
@@ -190,6 +190,8 @@ COMPONENT_BITMAPS= \
$(ZIP1DIR)$/bitmaps$/ButtonNotesMouseOver.png \
$(ZIP1DIR)$/bitmaps$/ButtonNotesSelected.png \
$(ZIP1DIR)$/bitmaps$/ButtonNotesDisabled.png \
+ $(ZIP1DIR)$/bitmaps$/ButtonSwitchMonitorNormal.png \
+ $(ZIP1DIR)$/bitmaps$/ButtonSwitchMonitorMouseOver.png \
$(ZIP1DIR)$/bitmaps$/ButtonSlideSorterNormal.png \
$(ZIP1DIR)$/bitmaps$/ButtonSlideSorterMouseOver.png \
$(ZIP1DIR)$/bitmaps$/ButtonSlideSorterSelected.png \
diff --git a/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu b/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu
index 22316392f807..069cc3bf03cc 100644
--- a/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu
+++ b/sdext/source/presenter/registry/data/org/openoffice/Office/extension/PresenterScreen.xcu
@@ -222,6 +222,44 @@
</node>
</node>
<node oor:name="l" oor:op="replace">
+ <prop oor:name="Name"><value>SwitchMonitor</value></prop>
+ <prop oor:name="Type"><value>Button</value></prop>
+ <node oor:name="Normal">
+ <prop oor:name="Text"><value xml:lang="en-US">Exchange</value></prop>
+ <node oor:name="Icon">
+ <prop oor:name="NormalFileName"><value>bitmaps/ButtonSwitchMonitorNormal.png</value></prop>
+ </node>
+ <prop oor:name="Action"><value>vnd.com.sun.star.comp.PresenterScreen:SwitchMonitor</value></prop>
+ <node oor:name="Font">
+ <prop oor:name="Size"><value>12</value></prop>
+ <prop oor:name="Style"><value>Bold</value></prop>
+ <prop oor:name="Color"><value>B3B7BC</value></prop>
+ <prop oor:name="Anchor"><value>Center</value></prop>
+ </node>
+ </node>
+ <node oor:name="MouseOver">
+ <node oor:name="Icon">
+ <prop oor:name="NormalFileName"><value>bitmaps/ButtonSwitchMonitorMouseOver.png</value></prop>
+ </node>
+ <node oor:name="Font">
+ <prop oor:name="Color"><value>FFFFFF</value></prop>
+ </node>
+ </node>
+ <node oor:name="Disabled">
+ <node oor:name="Icon">
+ <prop oor:name="NormalFileName"><value>bitmaps/ButtonSwitchMonitorDisabled.png</value></prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="m" oor:op="replace">
+ <prop oor:name="Type"><value>VerticalSeparator</value></prop>
+ <node oor:name="Normal">
+ <node oor:name="Font">
+ <prop oor:name="Color"><value>76797C</value></prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="n" oor:op="replace">
<prop oor:name="Name"><value>Help</value></prop>
<prop oor:name="Type"><value>Button</value></prop>
<node oor:name="Normal">