[longomatch] New Tranparent Drawing Tool For Live Drawings
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [longomatch] New Tranparent Drawing Tool For Live Drawings
- Date: Sun, 6 Sep 2009 22:20:44 +0000 (UTC)
commit 7b31e93ba220432c98a9fa0adf18234aa4fd5a59
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sun Sep 6 22:22:52 2009 +0200
New Tranparent Drawing Tool For Live Drawings
Free-hand drawing tool based on a transparent drawing area
that lets draw over any existent widget
CesarPlayer/Gui/PlayerBin.cs | 3 +
CesarPlayer/Player/GstPlayer.cs | 3 +-
LongoMatch/Gui/DrawingToolBox.cs | 104 +++++++
LongoMatch/Gui/MainWindow.cs | 24 +-
LongoMatch/Gui/TransparentDrawingArea.cs | 272 ++++++++++++++++++
LongoMatch/Handlers/DrawingManager.cs | 83 ++++++
LongoMatch/Handlers/Handlers.cs | 47 +++-
LongoMatch/LongoMatch.mdp | 5 +
LongoMatch/Makefile.am | 5 +
.../LongoMatch.Gui.Component.DrawingToolBox.cs | 194 +++++++++++++
LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs | 99 ++++---
.../LongoMatch.Gui.Popup.TransparentDrawingArea.cs | 47 +++
LongoMatch/gtk-gui/gui.stetic | 303 +++++++++++++++++++-
LongoMatch/gtk-gui/objects.xml | 15 +
14 files changed, 1136 insertions(+), 68 deletions(-)
---
diff --git a/CesarPlayer/Gui/PlayerBin.cs b/CesarPlayer/Gui/PlayerBin.cs
index b791faa..b3e74ba 100644
--- a/CesarPlayer/Gui/PlayerBin.cs
+++ b/CesarPlayer/Gui/PlayerBin.cs
@@ -126,6 +126,9 @@ namespace LongoMatch.Gui
set{player.LogoMode = value;}
}
+ public Widget VideoWidget{
+ get{return ((Gtk.EventBox)player);}
+ }
#endregion
#region Public methods
diff --git a/CesarPlayer/Player/GstPlayer.cs b/CesarPlayer/Player/GstPlayer.cs
index 63f276a..2c3444b 100644
--- a/CesarPlayer/Player/GstPlayer.cs
+++ b/CesarPlayer/Player/GstPlayer.cs
@@ -1359,7 +1359,6 @@ namespace LongoMatch.Video.Player {
public void CancelProgramedStop(){
this.SegmentSeek(this.CurrentTime,this.StreamLength,1);
}
-
-
+
}
}
diff --git a/LongoMatch/Gui/DrawingToolBox.cs b/LongoMatch/Gui/DrawingToolBox.cs
new file mode 100644
index 0000000..b3a984d
--- /dev/null
+++ b/LongoMatch/Gui/DrawingToolBox.cs
@@ -0,0 +1,104 @@
+//
+// Copyright (C) 2009 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+
+using System;
+using Gtk;
+using Gdk;
+using LongoMatch.Handlers;
+
+namespace LongoMatch.Gui.Component
+{
+
+
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class DrawingToolBox : Gtk.Bin
+ {
+
+ public event LineWidthChangedHandler LineWidthChanged;
+ public event ColorChangedHandler ColorChanged;
+ public event VisibilityChangedHandler VisibilityChanged;
+ public event ClearDrawingHandler ClearDrawing;
+
+ Gdk.Color normalColor;
+ Gdk.Color activeColor;
+
+ public DrawingToolBox()
+ {
+ this.Build();
+ SetButtonColor(wbutton,"white");
+ SetButtonColor(bbutton,"black");
+ SetButtonColor(rbutton,"red");
+ SetButtonColor(gbutton,"green");
+ SetButtonColor(blbutton,"blue");
+ SetButtonColor(ybutton,"yellow");
+ }
+
+ public bool DrawingVisibility{
+ set{
+ if (VisibilityChanged != null)
+ VisibilityChanged(value);
+ }
+ }
+
+ private void SetButtonColor(Button button, string color){
+
+ string darkColor;
+
+ if (color == "yellow")
+ darkColor = "goldenrod";
+ else if (color == "white")
+ darkColor = "beige";
+ else if (color == "black")
+ darkColor = "black";
+ else
+ darkColor = "dark "+color;
+
+ Gdk.Color.Parse(color,ref normalColor);
+ Gdk.Color.Parse(darkColor,ref activeColor);
+ button.ModifyBg(StateType.Normal,normalColor);
+ button.ModifyBg(StateType.Active,activeColor);
+ button.ModifyBg(StateType.Selected,activeColor);
+ button.ModifyBg(StateType.Prelight,normalColor);
+
+
+ }
+
+ protected virtual void OnClearbuttonClicked (object sender, System.EventArgs e)
+ {
+ if (ClearDrawing != null)
+ ClearDrawing();
+ }
+
+ protected virtual void OnCombobox1Changed (object sender, System.EventArgs e)
+ {
+ int lineWidth;
+ if (LineWidthChanged != null){
+ lineWidth = Int16.Parse(combobox1.ActiveText.Split(' ')[0]);
+ LineWidthChanged(lineWidth);
+ }
+ }
+
+ protected virtual void OnButtonToggled (object sender, System.EventArgs e)
+ {
+ RadioButton button = sender as RadioButton;
+ if (ColorChanged != null && button.Active)
+ ColorChanged(button.Style.Background(StateType.Normal));
+ }
+
+ }
+}
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index 4189169..d5d7b23 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -28,7 +28,7 @@ using Gdk;
using LongoMatch.DB;
using LongoMatch.TimeNodes;
using LongoMatch.Gui.Dialog;
-using LongoMatch.Gui;
+using LongoMatch.Gui.Popup;
using LongoMatch.Video.Player;
using LongoMatch.Updates;
using LongoMatch.IO;
@@ -48,6 +48,7 @@ namespace LongoMatch.Gui
private EventsManager eManager;
private HotKeysManager hkManager;
private KeyPressEventHandler hotkeysListener;
+
#region Constructors
public MainWindow() :
@@ -75,13 +76,17 @@ namespace LongoMatch.Gui
// Forward the event to the events manager
hkManager.newMarkEvent += new NewMarkEventHandler(eManager.OnNewMark);
+ DrawingManager dManager = new DrawingManager(drawingtoolbox1,playerbin1.VideoWidget);
+ //Forward Key and Button events to the Drawing Manager
+ KeyPressEvent += new KeyPressEventHandler(dManager.OnKeyPressEvent);
+
playerbin1.SetLogo(System.IO.Path.Combine(MainClass.ImagesDir(),"background.png"));
playerbin1.LogoMode = true;
playlistwidget2.SetPlayer(playerbin1);
localplayerslisttreewidget.Team = Team.LOCAL;
- visitorplayerslisttreewidget.Team = Team.VISITOR;
+ visitorplayerslisttreewidget.Team = Team.VISITOR;
}
#endregion
@@ -369,7 +374,7 @@ namespace LongoMatch.Gui
}
protected override bool OnKeyPressEvent (EventKey evnt)
- {
+ {
if (openedProject != null && evnt.State == ModifierType.None){
Gdk.Key key = evnt.Key;
if (key == Gdk.Key.z){
@@ -408,6 +413,12 @@ namespace LongoMatch.Gui
}
+ protected virtual void OnDrawingToolActionToggled (object sender, System.EventArgs e)
+ {
+ drawingtoolbox1.Visible = DrawingToolAction.Active;
+ drawingtoolbox1.DrawingVisibility = DrawingToolAction.Active;
+ }
+
protected virtual void OnAboutActionActivated (object sender, System.EventArgs e)
{
Version version = Assembly.GetExecutingAssembly().GetName().Version;
@@ -486,10 +497,7 @@ GNU General Public License for more details.";
try{
System.Diagnostics.Process.Start("http://www.longomatch.ylatuya.es/documentation/manual.html");
}catch{}
- }
-
-#endregion
-
+ }
+#endregion
}
-
}
\ No newline at end of file
diff --git a/LongoMatch/Gui/TransparentDrawingArea.cs b/LongoMatch/Gui/TransparentDrawingArea.cs
new file mode 100644
index 0000000..da6fc47
--- /dev/null
+++ b/LongoMatch/Gui/TransparentDrawingArea.cs
@@ -0,0 +1,272 @@
+
+using System;
+using Gdk;
+using Gtk;
+using Cairo;
+
+namespace LongoMatch.Gui.Popup
+{
+
+
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class TransparentDrawingArea : Gtk.Window
+ {
+ //Pixmpas and shapes
+ private Pixmap pixmap;
+ private Pixmap shape;
+ private Gdk.GC shapeGC;
+ private Gdk.GC paintGC;
+ private Gdk.Color transparent;
+ private Gdk.Color opaque;
+
+ //Mouse motion
+ private double lastx=-1;
+ private double lasty=-1;
+ private uint motionTime;
+
+ //Reshaping timeout
+ private uint timeoutId;
+
+ //Status
+ private bool modified;
+ private bool hardGrab;
+ private bool ready;
+
+ //Drawing Properties
+ private Gdk.Color foreground;
+ private int lineWidth = 7;
+
+ //"Parent" Widget we want to draw over
+ private Widget targetWidget;
+
+
+ public TransparentDrawingArea(Widget targetWidget):base (Gtk.WindowType.Toplevel)
+ {
+ this.Build();
+
+ ExtensionEvents = ExtensionMode.All;
+ Gdk.Color.Parse("red",ref foreground);
+ LineColor=foreground;
+ lineWidth = 6;
+ modified = false;
+ this.targetWidget = targetWidget;
+ Maximize();
+ }
+
+ public int LineWidth{
+ set{
+ lineWidth = value;
+ }
+ }
+
+ public Gdk.Color LineColor{
+ set{foreground = value;}
+ }
+
+ public void ToggleGrab(){
+ if (hardGrab)
+ ReleaseGrab();
+ else
+ AcquireGrab();
+ }
+
+ public void ReleaseGrab(){
+ if (hardGrab){
+ hardGrab=false;
+ Pointer.Ungrab( Gtk.Global.CurrentEventTime);
+ }
+ }
+
+ public void AcquireGrab(){
+ GrabStatus stat;
+ if (!hardGrab){
+ stat =Pointer.Grab(drawingarea.GdkWindow, false,
+ EventMask.ButtonMotionMask |
+ EventMask.ButtonPressMask |
+ EventMask.ButtonReleaseMask,
+ targetWidget.GdkWindow,
+ new Gdk.Cursor(Gdk.CursorType.Pencil) /* data->paint_cursor */,
+ Gtk.Global.CurrentEventTime);
+ if (stat == GrabStatus.Success){
+ hardGrab=true;
+ }
+ }
+ }
+
+ public void ToggleVisibility(){
+ Visible = !Visible;
+ }
+
+ public void Clear(){
+ //Clear shape
+ shapeGC.Foreground = transparent;
+ shape.DrawRectangle(shapeGC,true, 0, 0,Allocation.Width, Allocation.Height);
+ shapeGC.Background=opaque;
+
+ ShapeCombineMask(shape, 0,0);
+
+ //Clear pixmap
+ pixmap.DrawRectangle(drawingarea.Style.BlackGC,true, 0, 0, Allocation.Width, Allocation.Height);
+ }
+
+ private bool Reshape(){
+ if (modified)
+ {
+ ShapeCombineMask(shape, 0,0);
+ modified = false;
+ }
+ return true;
+ }
+
+ private void CreatePixmaps(){
+ GCValues shapeGCV;
+
+ //Create a 1 depth pixmap used as a shape
+ //that will contain the info about transparency
+ shape = new Pixmap(null,Allocation.Width,Allocation.Height,1);
+ shapeGC = new Gdk.GC(shape);
+ shapeGCV = new GCValues();
+ shapeGC.GetValues(shapeGCV);
+ transparent = shapeGCV.Foreground;
+ opaque = shapeGCV.Background;
+ shapeGC.Foreground = transparent;
+ shape.DrawRectangle(shapeGC,true,0,0,Allocation.Width,Allocation.Height);
+ shapeGC.Background=opaque;
+
+ ShapeCombineMask(shape, 0,0);
+
+ //Create the pixmap that will contain the real drawing
+ //Used on Expose event to redraw the drawing area
+ pixmap = new Pixmap (drawingarea.GdkWindow,Allocation.Width,Allocation.Height);
+ paintGC= new Gdk.GC(pixmap);
+ pixmap.Colormap = Gdk.Rgb.Colormap;
+ pixmap.DrawRectangle(drawingarea.Style.BlackGC,true,0,0,Allocation.Width,Allocation.Height);
+ }
+
+ private double Clamp(double val, double min, double max){
+ if (val < min)
+ return min;
+ if (val>max)
+ return max;
+ else return val;
+ }
+
+ private void DrawCairoLine(Context c, int x1, int y1, int x2, int y2,Gdk.Color color){
+ c.Color = new Cairo.Color(color.Red, color.Green, color.Blue, 1);
+ c.MoveTo (x1, y1);
+ c.LineTo (x2, y2);
+ c.LineWidth = lineWidth;
+ c.LineCap = LineCap.Round;
+ c.LineJoin = LineJoin.Round;
+ c.Stroke();
+ c.Fill();
+ }
+
+ private void DrawLine(int x1, int y1, int x2, int y2){
+ Cairo.Rectangle rect = new Cairo.Rectangle(Math.Min (x1,x2) - lineWidth / 2,
+ Math.Min (y1,y2) - lineWidth / 2,
+ Math.Abs (x1-x2) + lineWidth,
+ Math.Abs (y1-y2) + lineWidth);
+
+ using (Context c =CairoHelper.Create(drawingarea.GdkWindow)){
+ c.Color = new Cairo.Color( foreground.Red, foreground.Green, foreground.Blue, 1);
+ c.Rectangle(rect);
+ c.LineWidth = lineWidth;
+ c.LineCap = LineCap.Round;
+ c.LineJoin = LineJoin.Round;
+ c.StrokePreserve();
+ c.Fill();
+ }
+
+ using (Context c =CairoHelper.Create(shape)){
+ DrawCairoLine(c,x1,y1,x2,y2,opaque);
+ }
+
+ using (Context c =CairoHelper.Create(pixmap)){
+ DrawCairoLine(c,x1,y1,x2,y2,foreground);
+ }
+ modified = true;
+ }
+
+ protected virtual void OnDrawingareaExposeEvent (object o, Gtk.ExposeEventArgs args)
+ {
+ EventExpose evnt = args.Event;
+ drawingarea.GdkWindow.DrawDrawable(drawingarea.Style.ForegroundGCs[(int)drawingarea.State],
+ pixmap,
+ evnt.Area.X, evnt.Area.Y,
+ evnt.Area.X, evnt.Area.Y,
+ evnt.Area.Width, evnt.Area.Height);
+ }
+
+ protected virtual void OnDrawingareaButtonPressEvent (object o, Gtk.ButtonPressEventArgs args)
+ {
+ if (!hardGrab)
+ return;
+ lastx = args.Event.X;
+ lasty = args.Event.Y;
+
+ if (args.Event.Button == 1)
+ DrawLine((int)args.Event.X, (int)args.Event.Y,(int) args.Event.X, (int)args.Event.Y);
+ }
+
+ protected virtual void OnDrawingareaMotionNotifyEvent (object o, Gtk.MotionNotifyEventArgs args)
+ {
+ if (!hardGrab)
+ return;
+
+ if (lastx==-1 || lasty==-1){
+ lastx = args.Event.X;
+ lasty = args.Event.Y;
+ }
+ DrawLine ((int)lastx, (int)lasty, (int)args.Event.X, (int)args.Event.Y);
+ lastx = args.Event.X;
+ lasty = args.Event.Y;
+ }
+
+
+ protected virtual void OnDrawingareaButtonReleaseEvent (object o, Gtk.ButtonReleaseEventArgs args)
+ {
+ drawingarea.QueueDraw();
+ lastx=-1;
+ lasty=-1;
+ }
+
+ protected override void OnHidden ()
+ {
+ GLib.Source.Remove(timeoutId);
+ base.OnHidden ();
+ }
+
+ protected override void OnShown(){
+ //Prevent a dirty flash when the
+ //Window is created and inmediatle hidden
+ if (targetWidget != null){
+ base.OnShown ();
+ timeoutId = GLib.Timeout.Add(20,Reshape);
+ }
+ }
+
+ protected virtual void OnDrawingareaConfigureEvent (object o, Gtk.ConfigureEventArgs args)
+ {
+ this.TransientFor = (Gtk.Window)targetWidget.Toplevel;
+ if (ready){
+ CreatePixmaps();
+ ready=false;
+ }
+ }
+
+ protected virtual void OnWindowStateEvent (object o, Gtk.WindowStateEventArgs args)
+ {
+ //Create pixmap and shape once, the first time the
+ //the widget is maximized
+ if (args.Event.NewWindowState == WindowState.Maximized
+ && pixmap == null)
+ ready=true;
+ }
+
+ protected virtual void OnFocused (object o, Gtk.FocusedArgs args)
+ {
+
+ }
+ }
+}
diff --git a/LongoMatch/Handlers/DrawingManager.cs b/LongoMatch/Handlers/DrawingManager.cs
new file mode 100644
index 0000000..79604a1
--- /dev/null
+++ b/LongoMatch/Handlers/DrawingManager.cs
@@ -0,0 +1,83 @@
+//
+// Copyright (C) 2009 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+
+using System;
+using Gdk;
+using Gtk;
+using LongoMatch.Gui.Component;
+using LongoMatch.Gui.Popup;
+using LongoMatch.Handlers;
+namespace LongoMatch.Handlers
+{
+
+
+ public class DrawingManager
+ {
+
+ TransparentDrawingArea drawingArea;
+ DrawingToolBox toolBox;
+ Widget targetWidget;
+
+ public DrawingManager(DrawingToolBox toolBox, Widget targetWidget)
+ {
+ this.targetWidget=targetWidget;
+ targetWidget.AddEvents((int)(EventMask.ButtonReleaseMask));
+ drawingArea = new TransparentDrawingArea(targetWidget);
+ drawingArea.Hide();
+ this.toolBox=toolBox;
+ toolBox.ColorChanged += new ColorChangedHandler(OnColorChanged);
+ toolBox.LineWidthChanged += new LineWidthChangedHandler(OnLineWidthChanged);
+ toolBox.VisibilityChanged += new VisibilityChangedHandler(OnVisibilityChanged);
+ toolBox.ClearDrawing += new ClearDrawingHandler(OnClearDrawing);
+ }
+
+ public void OnKeyPressEvent (object o, Gtk.KeyPressEventArgs args)
+ {
+ if (!toolBox.Visible)
+ return;
+ if(args.Event.Key== Gdk.Key.d){
+ drawingArea.ToggleGrab();
+ }
+ else if(args.Event.Key== Gdk.Key.c){
+ drawingArea.Clear();
+ }
+ else if(args.Event.Key== Gdk.Key.s){
+ drawingArea.ToggleVisibility();
+ }
+ }
+
+ protected virtual void OnColorChanged(Gdk.Color color){
+ drawingArea.LineColor = color;
+ }
+
+ protected virtual void OnLineWidthChanged(int width){
+ drawingArea.LineWidth = width;
+ }
+
+ protected virtual void OnVisibilityChanged(bool visible){
+ drawingArea.Visible = visible;
+ if (!visible)
+ drawingArea.Clear();
+ }
+
+ protected virtual void OnClearDrawing(){
+ drawingArea.Clear();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/LongoMatch/Handlers/Handlers.cs b/LongoMatch/Handlers/Handlers.cs
index 0cd64aa..880f129 100644
--- a/LongoMatch/Handlers/Handlers.cs
+++ b/LongoMatch/Handlers/Handlers.cs
@@ -26,33 +26,52 @@ using LongoMatch.TimeNodes;
namespace LongoMatch.Handlers
{
- //Manejador para el evento producido al seleccionar un nodo en el árbol
+ /*Tagging Events*/
+ //A Play was selected
public delegate void TimeNodeSelectedHandler (MediaTimeNode tNode);
- //Manejador para el evento producido al pulsar un botón de selección de nuava marca
- public delegate void NewMarkEventHandler (int i);
+ //A new play needs to be create for a specific category at the current play time
+ public delegate void NewMarkEventHandler (int i);
+ //Several plays needs to be created for a several categories
public delegate void NewMarksEventHandler (List<int> sections);
- //Manejador para el evento producido al pulsar un botón de selección de nuava marca
+ //A need play needs to be created at precise frame
public delegate void NewMarkAtFrameEventHandler (int i,int frame);
- //Manejador para el evento producido cuando se edita un nodo
+ //A play was edited
public delegate void TimeNodeChangedHandler (TimeNode tNode, object val);
- //Manejador para el evento producido al eliminar un MediaTimeNode
+ //A play was deleted
public delegate void TimeNodeDeletedHandler (MediaTimeNode tNode,int section);
- //Manejador para el evento producido al inserir un MediaTimeNode en la lista de reproducción
+ //Players needs to be tagged
+ public delegate void PlayersTaggedHandler (MediaTimeNode tNode, Team team);
+
+ /*Playlist Events*/
+ //Add the a play to the opened playlist
public delegate void PlayListNodeAddedHandler(MediaTimeNode tNode);
- //Manejador para el evento producido al selecionar un nodo en la lista de reproducción
+ //A play list element is selected
public delegate void PlayListNodeSelectedHandler (PlayListTimeNode plNode, bool hasNext);
- //Manejador para el evento producido al ajustar la posición
- public delegate void PositionChangedHandler (Time pos);
+ //Save current playrate to a play list element
+ public delegate void ApplyCurrentRateHandler (PlayListTimeNode plNode);
- public delegate void DateSelectedHandler (DateTime selectedDate);
+ //Drawing events
+ //Paint color changed
+ public delegate void ColorChangedHandler (Gdk.Color color);
+ //Paint line width changed
+ public delegate void LineWidthChangedHandler (int width);
+ //Toggle widget visibility
+ public delegate void VisibilityChangedHandler (bool visible);
+ //Clear drawings
+ public delegate void ClearDrawingHandler ();
- public delegate void SnapshotSeriesHandler(MediaTimeNode tNode);
+ //The position of the stream has changed
+ public delegate void PositionChangedHandler (Time pos);
+ //A date was selected
+ public delegate void DateSelectedHandler (DateTime selectedDate);
+ //Create snapshots for a play
+ public delegate void SnapshotSeriesHandler(MediaTimeNode tNode);
+ //A new version of the software exists
public delegate void NewVersionHandler(Version version, string URL);
- public delegate void ApplyCurrentRateHandler (PlayListTimeNode plNode);
- public delegate void PlayersTaggedHandler (MediaTimeNode tNode, Team team);
+
diff --git a/LongoMatch/LongoMatch.mdp b/LongoMatch/LongoMatch.mdp
index 0abcc63..9b6d4b7 100644
--- a/LongoMatch/LongoMatch.mdp
+++ b/LongoMatch/LongoMatch.mdp
@@ -142,6 +142,11 @@
<File name="Compat/0.0/IO/SectionsReader.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/LongoMatch.Gui.Dialog.Win32CalendarDialog.cs" subtype="Code" buildaction="Compile" />
<File name="Gui/Win32CalendarDialog.cs" subtype="Code" buildaction="Compile" />
+ <File name="Gui/TransparentDrawingArea.cs" subtype="Code" buildaction="Compile" />
+ <File name="gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs" subtype="Code" buildaction="Compile" />
+ <File name="gtk-gui/LongoMatch.Gui.Component.DrawingToolBox.cs" subtype="Code" buildaction="Compile" />
+ <File name="Gui/DrawingToolBox.cs" subtype="Code" buildaction="Compile" />
+ <File name="Handlers/DrawingManager.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
diff --git a/LongoMatch/Makefile.am b/LongoMatch/Makefile.am
index 4f965b8..48685ed 100644
--- a/LongoMatch/Makefile.am
+++ b/LongoMatch/Makefile.am
@@ -80,6 +80,7 @@ FILES = \
Gui/ButtonsWidget.cs \
Gui/CalendarPopup.cs \
Gui/DBManager.cs \
+ Gui/DrawingToolBox.cs\
Gui/ProjectListWidget.cs \
Gui/FileDescriptionWidget.cs \
Gui/FramesCaptureProgressDialog.cs \
@@ -109,6 +110,7 @@ FILES = \
Gui/TimeLineWidget.cs \
Gui/TimeReferenceWidget.cs \
Gui/TimeScale.cs \
+ Gui/TransparentDrawingArea.cs\
Gui/VideoEditionProperties.cs \
Gui/UpdateDialog.cs \
Gui/HotKeySelectorDialog.cs \
@@ -131,7 +133,9 @@ FILES = \
gtk-gui/LongoMatch.Gui.Component.ProjectListWidget.cs \
gtk-gui/LongoMatch.Gui.Component.TreeWidget.cs \
gtk-gui/LongoMatch.Gui.Popup.CalendarPopup.cs \
+ gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs\
gtk-gui/LongoMatch.Gui.Component.ButtonsWidget.cs \
+ gtk-gui/LongoMatch.Gui.Component.DrawingToolBox.cs\
gtk-gui/LongoMatch.Gui.Dialog.DBManager.cs \
gtk-gui/LongoMatch.Gui.Dialog.OpenProjectDialog.cs \
gtk-gui/LongoMatch.Gui.Dialog.NewProjectDialog.cs \
@@ -164,6 +168,7 @@ FILES = \
Updates/XmlUpdateParser.cs \
IO/CSVExport.cs \
Time/HotKey.cs \
+ Handlers/DrawingManager.cs\
Handlers/EventsManager.cs \
Handlers/HotKeysManager.cs \
DB/TeamTemplate.cs \
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.DrawingToolBox.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.DrawingToolBox.cs
new file mode 100644
index 0000000..2d65892
--- /dev/null
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.DrawingToolBox.cs
@@ -0,0 +1,194 @@
+// ------------------------------------------------------------------------------
+// <autogenerated>
+// This code was generated by a tool.
+//
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </autogenerated>
+// ------------------------------------------------------------------------------
+
+namespace LongoMatch.Gui.Component {
+
+
+ public partial class DrawingToolBox {
+
+ private Gtk.VBox vbox2;
+
+ private Gtk.ComboBox combobox1;
+
+ private Gtk.Table table1;
+
+ private Gtk.RadioButton bbutton;
+
+ private Gtk.RadioButton blbutton;
+
+ private Gtk.RadioButton gbutton;
+
+ private Gtk.RadioButton rbutton;
+
+ private Gtk.RadioButton wbutton;
+
+ private Gtk.RadioButton ybutton;
+
+ private Gtk.Button clearbutton;
+
+ private Gtk.Label label1;
+
+ protected virtual void Build() {
+ Stetic.Gui.Initialize(this);
+ // Widget LongoMatch.Gui.Component.DrawingToolBox
+ Stetic.BinContainer.Attach(this);
+ this.Name = "LongoMatch.Gui.Component.DrawingToolBox";
+ // Container child LongoMatch.Gui.Component.DrawingToolBox.Gtk.Container+ContainerChild
+ this.vbox2 = new Gtk.VBox();
+ this.vbox2.Name = "vbox2";
+ this.vbox2.Spacing = 6;
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.combobox1 = Gtk.ComboBox.NewText();
+ this.combobox1.AppendText(Mono.Unix.Catalog.GetString("2 px"));
+ this.combobox1.AppendText(Mono.Unix.Catalog.GetString("4 px"));
+ this.combobox1.AppendText(Mono.Unix.Catalog.GetString("6 px"));
+ this.combobox1.AppendText(Mono.Unix.Catalog.GetString("8 px"));
+ this.combobox1.AppendText(Mono.Unix.Catalog.GetString("10 px"));
+ this.combobox1.Name = "combobox1";
+ this.combobox1.Active = 2;
+ this.vbox2.Add(this.combobox1);
+ Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox2[this.combobox1]));
+ w1.Position = 0;
+ w1.Expand = false;
+ w1.Fill = false;
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.table1 = new Gtk.Table(((uint)(3)), ((uint)(2)), false);
+ this.table1.Name = "table1";
+ this.table1.RowSpacing = ((uint)(6));
+ this.table1.ColumnSpacing = ((uint)(6));
+ // Container child table1.Gtk.Table+TableChild
+ this.bbutton = new Gtk.RadioButton("");
+ this.bbutton.Name = "bbutton";
+ this.bbutton.DrawIndicator = false;
+ this.bbutton.UseUnderline = true;
+ this.bbutton.FocusOnClick = false;
+ this.bbutton.Group = new GLib.SList(System.IntPtr.Zero);
+ this.table1.Add(this.bbutton);
+ Gtk.Table.TableChild w2 = ((Gtk.Table.TableChild)(this.table1[this.bbutton]));
+ w2.LeftAttach = ((uint)(1));
+ w2.RightAttach = ((uint)(2));
+ w2.YOptions = ((Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.blbutton = new Gtk.RadioButton("");
+ this.blbutton.Name = "blbutton";
+ this.blbutton.DrawIndicator = false;
+ this.blbutton.UseUnderline = true;
+ this.blbutton.FocusOnClick = false;
+ this.blbutton.Group = this.bbutton.Group;
+ this.table1.Add(this.blbutton);
+ Gtk.Table.TableChild w3 = ((Gtk.Table.TableChild)(this.table1[this.blbutton]));
+ w3.TopAttach = ((uint)(1));
+ w3.BottomAttach = ((uint)(2));
+ w3.LeftAttach = ((uint)(1));
+ w3.RightAttach = ((uint)(2));
+ w3.YOptions = ((Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.gbutton = new Gtk.RadioButton("");
+ this.gbutton.Name = "gbutton";
+ this.gbutton.DrawIndicator = false;
+ this.gbutton.UseUnderline = true;
+ this.gbutton.FocusOnClick = false;
+ this.gbutton.Group = this.bbutton.Group;
+ this.table1.Add(this.gbutton);
+ Gtk.Table.TableChild w4 = ((Gtk.Table.TableChild)(this.table1[this.gbutton]));
+ w4.TopAttach = ((uint)(2));
+ w4.BottomAttach = ((uint)(3));
+ w4.YOptions = ((Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.rbutton = new Gtk.RadioButton("");
+ this.rbutton.Name = "rbutton";
+ this.rbutton.DrawIndicator = false;
+ this.rbutton.UseUnderline = true;
+ this.rbutton.FocusOnClick = false;
+ this.rbutton.Group = this.bbutton.Group;
+ this.table1.Add(this.rbutton);
+ Gtk.Table.TableChild w5 = ((Gtk.Table.TableChild)(this.table1[this.rbutton]));
+ w5.TopAttach = ((uint)(1));
+ w5.BottomAttach = ((uint)(2));
+ w5.YOptions = ((Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.wbutton = new Gtk.RadioButton("");
+ this.wbutton.Name = "wbutton";
+ this.wbutton.DrawIndicator = false;
+ this.wbutton.UseUnderline = true;
+ this.wbutton.FocusOnClick = false;
+ this.wbutton.Group = this.bbutton.Group;
+ this.table1.Add(this.wbutton);
+ Gtk.Table.TableChild w6 = ((Gtk.Table.TableChild)(this.table1[this.wbutton]));
+ w6.YOptions = ((Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.ybutton = new Gtk.RadioButton("");
+ this.ybutton.Name = "ybutton";
+ this.ybutton.DrawIndicator = false;
+ this.ybutton.UseUnderline = true;
+ this.ybutton.FocusOnClick = false;
+ this.ybutton.Group = this.bbutton.Group;
+ this.table1.Add(this.ybutton);
+ Gtk.Table.TableChild w7 = ((Gtk.Table.TableChild)(this.table1[this.ybutton]));
+ w7.TopAttach = ((uint)(2));
+ w7.BottomAttach = ((uint)(3));
+ w7.LeftAttach = ((uint)(1));
+ w7.RightAttach = ((uint)(2));
+ w7.YOptions = ((Gtk.AttachOptions)(4));
+ this.vbox2.Add(this.table1);
+ Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.vbox2[this.table1]));
+ w8.Position = 1;
+ w8.Expand = false;
+ w8.Fill = false;
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.clearbutton = new Gtk.Button();
+ this.clearbutton.CanFocus = true;
+ this.clearbutton.Name = "clearbutton";
+ this.clearbutton.UseUnderline = true;
+ // Container child clearbutton.Gtk.Container+ContainerChild
+ Gtk.Alignment w9 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ Gtk.HBox w10 = new Gtk.HBox();
+ w10.Spacing = 2;
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ Gtk.Image w11 = new Gtk.Image();
+ w11.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-clear", Gtk.IconSize.LargeToolbar, 24);
+ w10.Add(w11);
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ Gtk.Label w13 = new Gtk.Label();
+ w10.Add(w13);
+ w9.Add(w10);
+ this.clearbutton.Add(w9);
+ this.vbox2.Add(this.clearbutton);
+ Gtk.Box.BoxChild w17 = ((Gtk.Box.BoxChild)(this.vbox2[this.clearbutton]));
+ w17.Position = 2;
+ w17.Expand = false;
+ w17.Fill = false;
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.label1 = new Gtk.Label();
+ this.label1.Name = "label1";
+ this.label1.LabelProp = Mono.Unix.Catalog.GetString("Draw-><b> D</b>\nClear-><b> C</b>\nHide-><b> S</b>\nShow-><b> S</b>\n");
+ this.label1.UseMarkup = true;
+ this.vbox2.Add(this.label1);
+ Gtk.Box.BoxChild w18 = ((Gtk.Box.BoxChild)(this.vbox2[this.label1]));
+ w18.Position = 3;
+ w18.Expand = false;
+ w18.Fill = false;
+ this.Add(this.vbox2);
+ if ((this.Child != null)) {
+ this.Child.ShowAll();
+ }
+ this.Hide();
+ this.combobox1.Changed += new System.EventHandler(this.OnCombobox1Changed);
+ this.ybutton.Toggled += new System.EventHandler(this.OnButtonToggled);
+ this.wbutton.Toggled += new System.EventHandler(this.OnButtonToggled);
+ this.rbutton.Toggled += new System.EventHandler(this.OnButtonToggled);
+ this.gbutton.Toggled += new System.EventHandler(this.OnButtonToggled);
+ this.blbutton.Toggled += new System.EventHandler(this.OnButtonToggled);
+ this.bbutton.Toggled += new System.EventHandler(this.OnButtonToggled);
+ this.clearbutton.Clicked += new System.EventHandler(this.OnClearbuttonClicked);
+ }
+ }
+}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
index 25387d5..e767bde 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -55,6 +55,8 @@ namespace LongoMatch.Gui {
private Gtk.Action HelpAction1;
+ private Gtk.ToggleAction DrawingToolAction;
+
private Gtk.VBox vbox1;
private Gtk.VBox menubox;
@@ -83,6 +85,10 @@ namespace LongoMatch.Gui {
private Gtk.VBox vbox5;
+ private Gtk.HBox hbox1;
+
+ private LongoMatch.Gui.Component.DrawingToolBox drawingtoolbox1;
+
private LongoMatch.Gui.PlayerBin playerbin1;
private LongoMatch.Gui.Component.TimeLineWidget timelinewidget1;
@@ -131,7 +137,7 @@ namespace LongoMatch.Gui {
w1.Add(this.SectionsTemplatesManagerAction, null);
this.ViewAction = new Gtk.Action("ViewAction", Mono.Unix.Catalog.GetString("_View"), null, null);
this.ViewAction.ShortLabel = Mono.Unix.Catalog.GetString("_View");
- w1.Add(this.ViewAction, null);
+ w1.Add(this.ViewAction, "<Control>t");
this.FullScreenAction = new Gtk.ToggleAction("FullScreenAction", Mono.Unix.Catalog.GetString("Full Screen"), null, "gtk-fullscreen");
this.FullScreenAction.ShortLabel = Mono.Unix.Catalog.GetString("Full Screen");
w1.Add(this.FullScreenAction, null);
@@ -172,6 +178,9 @@ namespace LongoMatch.Gui {
this.HelpAction1 = new Gtk.Action("HelpAction1", Mono.Unix.Catalog.GetString("_Help"), null, "gtk-help");
this.HelpAction1.ShortLabel = Mono.Unix.Catalog.GetString("_Help");
w1.Add(this.HelpAction1, null);
+ this.DrawingToolAction = new Gtk.ToggleAction("DrawingToolAction", Mono.Unix.Catalog.GetString("_Drawing Tool"), null, null);
+ this.DrawingToolAction.ShortLabel = Mono.Unix.Catalog.GetString("Drawing Tool");
+ w1.Add(this.DrawingToolAction, "<Control>d");
this.UIManager.InsertActionGroup(w1, 0);
this.AddAccelGroup(this.UIManager.AccelGroup);
this.Name = "LongoMatch.Gui.MainWindow";
@@ -188,7 +197,7 @@ namespace LongoMatch.Gui {
this.menubox.Name = "menubox";
this.menubox.Spacing = 6;
// Container child menubox.Gtk.Box+BoxChild
- this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewPojectAction' action='NewPojectAction'/><menuitem name='OpenProjectAction' action='OpenProjectAction'/><menuitem name='SaveProjectAction' action='SaveProjectAction'/><menuitem name='CloseProjectAction' action='CloseProjectAction'/><separator/><menuitem name='QuitAction' action='QuitAction'/></menu><menu name='ToolsAction' action='ToolsAction'><menuitem name='ProjectsManagerAction' action='ProjectsManagerAction'/><menuitem name='SectionsTemplatesManagerAction' action='SectionsTemplatesManagerAction'/><menuitem name='TeamsTemplatesManagerAction' action='TeamsTemplatesManagerAction'/><menuitem name='ExportProjectToCSVFileAction' action='ExportProjectToCSVFileAction'/></menu><menu name='ViewAction' action='ViewAction'><menuitem name='FullScreenAction' action='FullScreenAction'/><menuitem name='HideAllWidgetsAction' action='HideAllWidgetsAction'/
><separator/><menuitem name='PlaylistAction' action='PlaylistAction'/><menuitem name='CaptureModeAction' action='CaptureModeAction'/><menuitem name='AnalyzeModeAction' action='AnalyzeModeAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='HelpAction1' action='HelpAction1'/></menu></menubar></ui>");
+ this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewPojectAction' action='NewPojectAction'/><menuitem name='OpenProjectAction' action='OpenProjectAction'/><menuitem name='SaveProjectAction' action='SaveProjectAction'/><menuitem name='CloseProjectAction' action='CloseProjectAction'/><separator/><menuitem name='QuitAction' action='QuitAction'/></menu><menu name='ToolsAction' action='ToolsAction'><menuitem name='ProjectsManagerAction' action='ProjectsManagerAction'/><menuitem name='SectionsTemplatesManagerAction' action='SectionsTemplatesManagerAction'/><menuitem name='TeamsTemplatesManagerAction' action='TeamsTemplatesManagerAction'/><menuitem name='ExportProjectToCSVFileAction' action='ExportProjectToCSVFileAction'/></menu><menu name='ViewAction' action='ViewAction'><menuitem name='FullScreenAction' action='FullScreenAction'/><menuitem name='HideAllWidgetsAction' action='HideAllWidgetsAction'/
><separator/><menuitem name='PlaylistAction' action='PlaylistAction'/><menuitem name='DrawingToolAction' action='DrawingToolAction'/><separator/><menuitem name='CaptureModeAction' action='CaptureModeAction'/><menuitem name='AnalyzeModeAction' action='AnalyzeModeAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='HelpAction1' action='HelpAction1'/></menu></menubar></ui>");
this.menubar1 = ((Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1")));
this.menubar1.Name = "menubar1";
this.menubox.Add(this.menubar1);
@@ -205,7 +214,7 @@ namespace LongoMatch.Gui {
this.hpaned = new Gtk.HPaned();
this.hpaned.CanFocus = true;
this.hpaned.Name = "hpaned";
- this.hpaned.Position = 361;
+ this.hpaned.Position = 318;
// Container child hpaned.Gtk.Paned+PanedChild
this.leftbox = new Gtk.VBox();
this.leftbox.Name = "leftbox";
@@ -263,20 +272,36 @@ namespace LongoMatch.Gui {
this.hpaned1 = new Gtk.HPaned();
this.hpaned1.CanFocus = true;
this.hpaned1.Name = "hpaned1";
- this.hpaned1.Position = 694;
+ this.hpaned1.Position = 760;
// Container child hpaned1.Gtk.Paned+PanedChild
this.vbox5 = new Gtk.VBox();
this.vbox5.Name = "vbox5";
this.vbox5.Spacing = 6;
// Container child vbox5.Gtk.Box+BoxChild
+ this.hbox1 = new Gtk.HBox();
+ this.hbox1.Name = "hbox1";
+ this.hbox1.Spacing = 6;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.drawingtoolbox1 = new LongoMatch.Gui.Component.DrawingToolBox();
+ this.drawingtoolbox1.Events = ((Gdk.EventMask)(256));
+ this.drawingtoolbox1.Name = "drawingtoolbox1";
+ this.hbox1.Add(this.drawingtoolbox1);
+ Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.hbox1[this.drawingtoolbox1]));
+ w9.Position = 0;
+ w9.Expand = false;
+ w9.Fill = false;
+ // Container child hbox1.Gtk.Box+BoxChild
this.playerbin1 = new LongoMatch.Gui.PlayerBin();
this.playerbin1.Events = ((Gdk.EventMask)(256));
this.playerbin1.Name = "playerbin1";
this.playerbin1.Rate = 0F;
this.playerbin1.LogoMode = false;
- this.vbox5.Add(this.playerbin1);
- Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox5[this.playerbin1]));
- w9.Position = 0;
+ this.hbox1.Add(this.playerbin1);
+ Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.hbox1[this.playerbin1]));
+ w10.Position = 1;
+ this.vbox5.Add(this.hbox1);
+ Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox5[this.hbox1]));
+ w11.Position = 0;
// Container child vbox5.Gtk.Box+BoxChild
this.timelinewidget1 = new LongoMatch.Gui.Component.TimeLineWidget();
this.timelinewidget1.HeightRequest = 200;
@@ -284,21 +309,21 @@ namespace LongoMatch.Gui {
this.timelinewidget1.Name = "timelinewidget1";
this.timelinewidget1.CurrentFrame = ((uint)(0));
this.vbox5.Add(this.timelinewidget1);
- Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox5[this.timelinewidget1]));
- w10.Position = 1;
- w10.Expand = false;
+ Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(this.vbox5[this.timelinewidget1]));
+ w12.Position = 1;
+ w12.Expand = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonswidget1 = new LongoMatch.Gui.Component.ButtonsWidget();
this.buttonswidget1.Events = ((Gdk.EventMask)(256));
this.buttonswidget1.Name = "buttonswidget1";
this.vbox5.Add(this.buttonswidget1);
- Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox5[this.buttonswidget1]));
- w11.Position = 2;
- w11.Expand = false;
+ Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.vbox5[this.buttonswidget1]));
+ w13.Position = 2;
+ w13.Expand = false;
this.hpaned1.Add(this.vbox5);
- Gtk.Paned.PanedChild w12 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.vbox5]));
- w12.Resize = false;
- w12.Shrink = false;
+ Gtk.Paned.PanedChild w14 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.vbox5]));
+ w14.Resize = false;
+ w14.Shrink = false;
// Container child hpaned1.Gtk.Paned+PanedChild
this.rightvbox = new Gtk.VBox();
this.rightvbox.WidthRequest = 100;
@@ -309,27 +334,27 @@ namespace LongoMatch.Gui {
this.noteswidget1.Events = ((Gdk.EventMask)(256));
this.noteswidget1.Name = "noteswidget1";
this.rightvbox.Add(this.noteswidget1);
- Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.rightvbox[this.noteswidget1]));
- w13.Position = 1;
+ Gtk.Box.BoxChild w15 = ((Gtk.Box.BoxChild)(this.rightvbox[this.noteswidget1]));
+ w15.Position = 1;
// Container child rightvbox.Gtk.Box+BoxChild
this.playlistwidget2 = new LongoMatch.Gui.Component.PlayListWidget();
this.playlistwidget2.WidthRequest = 100;
this.playlistwidget2.Events = ((Gdk.EventMask)(256));
this.playlistwidget2.Name = "playlistwidget2";
this.rightvbox.Add(this.playlistwidget2);
- Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.rightvbox[this.playlistwidget2]));
- w14.Position = 2;
+ Gtk.Box.BoxChild w16 = ((Gtk.Box.BoxChild)(this.rightvbox[this.playlistwidget2]));
+ w16.Position = 2;
this.hpaned1.Add(this.rightvbox);
- Gtk.Paned.PanedChild w15 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.rightvbox]));
- w15.Resize = false;
- w15.Shrink = false;
+ Gtk.Paned.PanedChild w17 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.rightvbox]));
+ w17.Resize = false;
+ w17.Shrink = false;
this.hpaned.Add(this.hpaned1);
- Gtk.Paned.PanedChild w16 = ((Gtk.Paned.PanedChild)(this.hpaned[this.hpaned1]));
- w16.Resize = false;
- w16.Shrink = false;
+ Gtk.Paned.PanedChild w18 = ((Gtk.Paned.PanedChild)(this.hpaned[this.hpaned1]));
+ w18.Resize = false;
+ w18.Shrink = false;
this.vbox1.Add(this.hpaned);
- Gtk.Box.BoxChild w17 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned]));
- w17.Position = 1;
+ Gtk.Box.BoxChild w19 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned]));
+ w19.Position = 1;
// Container child vbox1.Gtk.Box+BoxChild
this.statusbar1 = new Gtk.Statusbar();
this.statusbar1.Name = "statusbar1";
@@ -339,15 +364,15 @@ namespace LongoMatch.Gui {
this.videoprogressbar.Name = "videoprogressbar";
this.videoprogressbar.Text = Mono.Unix.Catalog.GetString("Creating video...");
this.statusbar1.Add(this.videoprogressbar);
- Gtk.Box.BoxChild w18 = ((Gtk.Box.BoxChild)(this.statusbar1[this.videoprogressbar]));
- w18.Position = 3;
- w18.Expand = false;
- w18.Fill = false;
+ Gtk.Box.BoxChild w20 = ((Gtk.Box.BoxChild)(this.statusbar1[this.videoprogressbar]));
+ w20.Position = 3;
+ w20.Expand = false;
+ w20.Fill = false;
this.vbox1.Add(this.statusbar1);
- Gtk.Box.BoxChild w19 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
- w19.Position = 2;
- w19.Expand = false;
- w19.Fill = false;
+ Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
+ w21.Position = 2;
+ w21.Expand = false;
+ w21.Fill = false;
this.Add(this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll();
@@ -355,6 +380,7 @@ namespace LongoMatch.Gui {
this.DefaultWidth = 1259;
this.DefaultHeight = 537;
this.leftbox.Hide();
+ this.drawingtoolbox1.Hide();
this.timelinewidget1.Hide();
this.buttonswidget1.Hide();
this.noteswidget1.Hide();
@@ -378,6 +404,7 @@ namespace LongoMatch.Gui {
this.TeamsTemplatesManagerAction.Activated += new System.EventHandler(this.OnTeamsTemplatesManagerActionActivated);
this.HideAllWidgetsAction.Toggled += new System.EventHandler(this.OnHideAllWidgetsActionToggled);
this.HelpAction1.Activated += new System.EventHandler(this.OnHelpAction1Activated);
+ this.DrawingToolAction.Toggled += new System.EventHandler(this.OnDrawingToolActionToggled);
this.treewidget1.TimeNodeSelected += new LongoMatch.Handlers.TimeNodeSelectedHandler(this.OnTimeNodeSelected);
this.playerbin1.Error += new LongoMatch.Video.Handlers.ErrorHandler(this.OnPlayerbin1Error);
this.playerbin1.SegmentClosedEvent += new LongoMatch.Video.Handlers.SegmentClosedHandler(this.OnSegmentClosedEvent);
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs
new file mode 100644
index 0000000..48504d3
--- /dev/null
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Popup.TransparentDrawingArea.cs
@@ -0,0 +1,47 @@
+// ------------------------------------------------------------------------------
+// <autogenerated>
+// This code was generated by a tool.
+//
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </autogenerated>
+// ------------------------------------------------------------------------------
+
+namespace LongoMatch.Gui.Popup {
+
+
+ public partial class TransparentDrawingArea {
+
+ private Gtk.DrawingArea drawingarea;
+
+ protected virtual void Build() {
+ Stetic.Gui.Initialize(this);
+ // Widget LongoMatch.Gui.Popup.TransparentDrawingArea
+ this.Name = "LongoMatch.Gui.Popup.TransparentDrawingArea";
+ this.Title = Mono.Unix.Catalog.GetString("TransparentDrawingArea");
+ this.WindowPosition = ((Gtk.WindowPosition)(4));
+ this.AllowShrink = true;
+ this.Gravity = ((Gdk.Gravity)(5));
+ this.SkipPagerHint = true;
+ this.SkipTaskbarHint = true;
+ // Container child LongoMatch.Gui.Popup.TransparentDrawingArea.Gtk.Container+ContainerChild
+ this.drawingarea = new Gtk.DrawingArea();
+ this.drawingarea.Name = "drawingarea";
+ this.Add(this.drawingarea);
+ if ((this.Child != null)) {
+ this.Child.ShowAll();
+ }
+ this.DefaultWidth = 644;
+ this.DefaultHeight = 370;
+ this.Show();
+ this.WindowStateEvent += new Gtk.WindowStateEventHandler(this.OnWindowStateEvent);
+ this.Focused += new Gtk.FocusedHandler(this.OnFocused);
+ this.drawingarea.MotionNotifyEvent += new Gtk.MotionNotifyEventHandler(this.OnDrawingareaMotionNotifyEvent);
+ this.drawingarea.ButtonPressEvent += new Gtk.ButtonPressEventHandler(this.OnDrawingareaButtonPressEvent);
+ this.drawingarea.ExposeEvent += new Gtk.ExposeEventHandler(this.OnDrawingareaExposeEvent);
+ this.drawingarea.ConfigureEvent += new Gtk.ConfigureEventHandler(this.OnDrawingareaConfigureEvent);
+ this.drawingarea.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler(this.OnDrawingareaButtonReleaseEvent);
+ }
+ }
+}
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index ea0466a..1eac3cd 100755
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -1413,6 +1413,7 @@
</action>
<action id="ViewAction">
<property name="Type">Action</property>
+ <property name="Accelerator"><Control>t</property>
<property name="Label" translatable="yes">_View</property>
<property name="ShortLabel" translatable="yes">_View</property>
</action>
@@ -1503,6 +1504,15 @@
<property name="StockId">gtk-help</property>
<signal name="Activated" handler="OnHelpAction1Activated" />
</action>
+ <action id="DrawingToolAction">
+ <property name="Type">Toggle</property>
+ <property name="Accelerator"><Control>d</property>
+ <property name="Label" translatable="yes">_Drawing Tool</property>
+ <property name="ShortLabel" translatable="yes">Drawing Tool</property>
+ <property name="DrawAsRadio">False</property>
+ <property name="Active">False</property>
+ <signal name="Toggled" handler="OnDrawingToolActionToggled" />
+ </action>
</action-group>
<property name="MemberName" />
<property name="Title" translatable="yes">LongoMatch</property>
@@ -1541,6 +1551,8 @@
<node type="Menuitem" action="HideAllWidgetsAction" />
<node type="Separator" />
<node type="Menuitem" action="PlaylistAction" />
+ <node type="Menuitem" action="DrawingToolAction" />
+ <node type="Separator" />
<node type="Menuitem" action="CaptureModeAction" />
<node type="Menuitem" action="AnalyzeModeAction" />
</node>
@@ -1569,7 +1581,7 @@
<widget class="Gtk.HPaned" id="hpaned">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Position">361</property>
+ <property name="Position">318</property>
<child>
<widget class="Gtk.VBox" id="leftbox">
<property name="MemberName" />
@@ -1648,19 +1660,45 @@
<widget class="Gtk.HPaned" id="hpaned1">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Position">694</property>
+ <property name="Position">760</property>
<child>
<widget class="Gtk.VBox" id="vbox5">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="LongoMatch.Gui.PlayerBin" id="playerbin1">
+ <widget class="Gtk.HBox" id="hbox1">
<property name="MemberName" />
- <property name="Events">ButtonPressMask</property>
- <property name="Rate">0</property>
- <property name="LogoMode">False</property>
- <signal name="Error" handler="OnPlayerbin1Error" />
- <signal name="SegmentClosedEvent" handler="OnSegmentClosedEvent" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="LongoMatch.Gui.Component.DrawingToolBox" id="drawingtoolbox1">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="LongoMatch.Gui.PlayerBin" id="playerbin1">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ <property name="Rate">0</property>
+ <property name="LogoMode">False</property>
+ <signal name="Error" handler="OnPlayerbin1Error" />
+ <signal name="SegmentClosedEvent" handler="OnSegmentClosedEvent" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
</widget>
<packing>
<property name="Position">0</property>
@@ -4242,4 +4280,253 @@ If you are not sure about what you are doing, click ok</property>
</widget>
</child>
</widget>
+ <widget class="Gtk.Window" id="LongoMatch.Gui.Popup.TransparentDrawingArea" design-size="644 370">
+ <property name="MemberName" />
+ <property name="Title" translatable="yes">TransparentDrawingArea</property>
+ <property name="WindowPosition">CenterOnParent</property>
+ <property name="AllowShrink">True</property>
+ <property name="Gravity">Center</property>
+ <property name="SkipPagerHint">True</property>
+ <property name="SkipTaskbarHint">True</property>
+ <signal name="WindowStateEvent" handler="OnWindowStateEvent" />
+ <signal name="Focused" handler="OnFocused" />
+ <child>
+ <widget class="Gtk.DrawingArea" id="drawingarea">
+ <property name="MemberName" />
+ <signal name="MotionNotifyEvent" handler="OnDrawingareaMotionNotifyEvent" />
+ <signal name="ButtonPressEvent" handler="OnDrawingareaButtonPressEvent" />
+ <signal name="ExposeEvent" handler="OnDrawingareaExposeEvent" />
+ <signal name="ConfigureEvent" handler="OnDrawingareaConfigureEvent" />
+ <signal name="ButtonReleaseEvent" handler="OnDrawingareaButtonReleaseEvent" />
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.DrawingToolBox" design-size="67 313">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox2">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ComboBox" id="combobox1">
+ <property name="MemberName" />
+ <property name="IsTextCombo">True</property>
+ <property name="Items" translatable="yes">2 px
+4 px
+6 px
+8 px
+10 px</property>
+ <property name="Active">2</property>
+ <signal name="Changed" handler="OnCombobox1Changed" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Table" id="table1">
+ <property name="MemberName" />
+ <property name="NRows">3</property>
+ <property name="NColumns">2</property>
+ <property name="RowSpacing">6</property>
+ <property name="ColumnSpacing">6</property>
+ <child>
+ <widget class="Gtk.RadioButton" id="bbutton">
+ <property name="MemberName" />
+ <property name="Label" translatable="yes" />
+ <property name="Active">True</property>
+ <property name="DrawIndicator">False</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Group">group1</property>
+ <signal name="Toggled" handler="OnButtonToggled" />
+ </widget>
+ <packing>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">True</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.RadioButton" id="blbutton">
+ <property name="MemberName" />
+ <property name="Label" translatable="yes" />
+ <property name="DrawIndicator">False</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Group">group1</property>
+ <signal name="Toggled" handler="OnButtonToggled" />
+ </widget>
+ <packing>
+ <property name="TopAttach">1</property>
+ <property name="BottomAttach">2</property>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">True</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.RadioButton" id="gbutton">
+ <property name="MemberName" />
+ <property name="Label" translatable="yes" />
+ <property name="DrawIndicator">False</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Group">group1</property>
+ <signal name="Toggled" handler="OnButtonToggled" />
+ </widget>
+ <packing>
+ <property name="TopAttach">2</property>
+ <property name="BottomAttach">3</property>
+ <property name="AutoSize">True</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">True</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.RadioButton" id="rbutton">
+ <property name="MemberName" />
+ <property name="Label" translatable="yes" />
+ <property name="DrawIndicator">False</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Group">group1</property>
+ <signal name="Toggled" handler="OnButtonToggled" />
+ </widget>
+ <packing>
+ <property name="TopAttach">1</property>
+ <property name="BottomAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">True</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.RadioButton" id="wbutton">
+ <property name="MemberName" />
+ <property name="Label" translatable="yes" />
+ <property name="DrawIndicator">False</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Group">group1</property>
+ <signal name="Toggled" handler="OnButtonToggled" />
+ </widget>
+ <packing>
+ <property name="AutoSize">True</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">True</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.RadioButton" id="ybutton">
+ <property name="MemberName" />
+ <property name="Label" translatable="yes" />
+ <property name="DrawIndicator">False</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Group">group1</property>
+ <signal name="Toggled" handler="OnButtonToggled" />
+ </widget>
+ <packing>
+ <property name="TopAttach">2</property>
+ <property name="BottomAttach">3</property>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">True</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="clearbutton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-clear LargeToolbar</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="OnClearbuttonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="label1">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Draw-><b> D</b>
+Clear-><b> C</b>
+Hide-><b> S</b>
+Show-><b> S</b>
+</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ </child>
+ </widget>
</stetic-interface>
\ No newline at end of file
diff --git a/LongoMatch/gtk-gui/objects.xml b/LongoMatch/gtk-gui/objects.xml
index c163b01..2d5091f 100755
--- a/LongoMatch/gtk-gui/objects.xml
+++ b/LongoMatch/gtk-gui/objects.xml
@@ -173,4 +173,19 @@
</itemgroups>
<signals />
</object>
+ <object type="LongoMatch.Gui.Popup.TransparentDrawingArea" palette-category="General" allow-children="false" base-type="Gtk.Window">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="LongoMatch.Gui.Component.DrawingToolBox" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals>
+ <itemgroup label="DrawingToolBox Signals">
+ <signal name="LineWidthChanged" />
+ <signal name="ColorChanged" />
+ <signal name="VisibilityChanged" />
+ <signal name="ClearDrawing" />
+ </itemgroup>
+ </signals>
+ </object>
</objects>
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]