Esempio n. 1
0
        protected override void OnRealized()
        {
            SetFlag(Gtk.WidgetFlags.Realized);

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.Colormap   = Colormap;

            // This enables all events except PointerMotionHitMask which prevents correct behavior
            // of MotionNotifyEvent
            attributes.EventMask = (int)(Gdk.EventMask.AllEventsMask & (~Gdk.EventMask.PointerMotionHintMask));

            Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y
                                            | WindowAttributesType.Visual | WindowAttributesType.Colormap;

            GdkWindow          = new Gdk.Window(ParentWindow, attributes, (int)mask);
            GdkWindow.UserData = Handle;
            GdkWindow.SetBackPixmap(null, false);

            Style = Style.Attach(GdkWindow);
            Style.SetBackground(GdkWindow, StateType.Normal);

            Color = new Cairo.Color(1.0, 1.0, 1.0);
        }
Esempio n. 2
0
        protected override void OnRealized()
        {
            base.OnRealized();

            var alloc = Allocation;
            int bw    = (int)BorderWidth;

            var attributes = new Gdk.WindowAttr()
            {
                WindowType = Gdk.WindowType.Child,
                Wclass     = Gdk.WindowClass.InputOnly,
                EventMask  = (int)(
                    EventMask.EnterNotifyMask |
                    EventMask.LeaveNotifyMask |
                    EventMask.PointerMotionMask |
                    EventMask.ButtonPressMask |
                    EventMask.ButtonReleaseMask
                    ),
                X      = alloc.X + bw,
                Y      = alloc.Y + bw,
                Width  = alloc.Width - bw * 2,
                Height = alloc.Height - bw * 2,
            };

            var attrMask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y;

            inputWindow          = new Gdk.Window(Parent.GdkWindow, attributes, (int)attrMask);
            inputWindow.UserData = Handle;
        }
Esempio n. 3
0
        protected override void OnRealized ()
        {
            base.OnRealized ();

            WindowAttr attributes = new WindowAttr ();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X = Allocation.X;
            attributes.Y = Allocation.Y;
            attributes.Width = Allocation.Width;
            attributes.Height = Allocation.Height;
            attributes.Wclass = WindowClass.InputOnly;
            attributes.EventMask = (int)(
                EventMask.PointerMotionMask |
                EventMask.ButtonPressMask |
                EventMask.ButtonReleaseMask |
                EventMask.EnterNotifyMask |
                EventMask.LeaveNotifyMask |
                EventMask.ExposureMask);

            WindowAttributesType attributes_mask =
                WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Wmclass;

            event_window = new Gdk.Window (GdkWindow, attributes, attributes_mask);
            event_window.UserData = Handle;

            AllocateChild ();
            QueueResize ();
        }
Esempio n. 4
0
        // HERZUM SPRINT 2.4 TLAB-157
        public static ExperimentCanvasPad CreateCompositeExperimentCanvasPad(ApplicationContext applicationContext, ExperimentCanvasWidget experimentCanvasWidget, CompositeComponentGraph experiment)
        {
            ExperimentCanvasPad experimentCanvasPad = null;

            if (m_mapPadToNodes.TryGetValue(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, out experimentCanvasPad))
            {
                return(experimentCanvasPad);
            }
            else
            {
                experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);
                m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
            }

            DockFrame m_dockFrame = new DockFrame();

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = 100;
            attributes.Y          = 100;
            attributes.Width      = 100;
            attributes.Height     = 100;
            Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y;
            m_dockFrame.GdkWindow = new Gdk.Window(null, attributes, (int)mask);
            experimentCanvasPad.Initialize(m_dockFrame);
            experimentCanvasPad.SetApplicationModel(applicationContext.Application, experimentCanvasWidget, experiment);
            return(experimentCanvasPad);
        }
Esempio n. 5
0
		protected override void OnRealized ()
		{
			base.OnRealized ();

			WindowAttr attributes = new WindowAttr ();
			attributes.WindowType = Gdk.WindowType.Child;
			attributes.X = Allocation.X;
			attributes.Y = Allocation.Y;
			attributes.Width = Allocation.Width;
			attributes.Height = Allocation.Height;
			attributes.Wclass = WindowClass.InputOutput;
			attributes.Visual = Visual;
			attributes.Colormap = Colormap;
			attributes.EventMask = (int) Events;
			attributes.EventMask = attributes.EventMask | ((int) Gdk.EventMask.ExposureMask |
						(int) Gdk.EventMask.KeyPressMask |
						(int) Gdk.EventMask.KeyReleaseMask |
						(int) Gdk.EventMask.EnterNotifyMask |
						(int) Gdk.EventMask.LeaveNotifyMask |
						(int) Gdk.EventMask.StructureMask |
						(int) Gdk.EventMask.FocusChangeMask);

			GdkWindow = new Gdk.Window (ParentWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | 
			                            Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual);
			GdkWindow.UserData = this.Handle;

			Style = Style.Attach (GdkWindow);
			Style.Background (StateType.Normal);
			
			browser.Load (this.Handle, width, height);		
		}
Esempio n. 6
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Height     = Allocation.Height;
            attributes.Width      = Allocation.Width;
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.Wclass     = Gdk.WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.Colormap   = Colormap;
            attributes.EventMask  = (int)(Events |
                                          Gdk.EventMask.ExposureMask |
                                          Gdk.EventMask.Button1MotionMask |
                                          Gdk.EventMask.ButtonPressMask |
                                          Gdk.EventMask.ButtonReleaseMask);

            Gdk.WindowAttributesType attributes_mask =
                Gdk.WindowAttributesType.X |
                Gdk.WindowAttributesType.Y |
                Gdk.WindowAttributesType.Colormap |
                Gdk.WindowAttributesType.Visual;
            GdkWindow          = new Gdk.Window(ParentWindow, attributes, (int)attributes_mask);
            GdkWindow.UserData = Handle;

            Style = Style.Attach(GdkWindow);
            Style.SetBackground(GdkWindow, State);
            this.WidgetFlags &= ~WidgetFlags.NoWindow;

            //GdkWindow.SetBackPixmap (null, true);

            ModifyBase(StateType.Normal, Styles.DockFrameBackground.ToGdkColor());
        }
Esempio n. 7
0
        protected override void OnRealized()
        {
            IsRealized = true;

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.Wclass     = Gdk.WindowWindowClass.InputOutput;
            attributes.EventMask  = (int)Gdk.EventMask.ExposureMask;

            Window                = new Gdk.Window(Parent.Window, attributes, 0);
            Window.UserData       = Handle;
            Window.BackgroundRgba = StyleContext.GetBackgroundColor(StateFlags);
        }
Esempio n. 8
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.Wclass     = Gdk.WindowClass.InputOutput;
            attributes.EventMask  = (int)Gdk.EventMask.ExposureMask;
            GdkWindow             = new Gdk.Window(Parent.GdkWindow, attributes, 0);
            GdkWindow.UserData    = Handle;
            GdkWindow.Background  = Style.Background(State);
            Style.Attach(GdkWindow);
        }
        // HERZUM SPRINT 2.4 TLAB-157
        public static ExperimentCanvasPad CreateCompositeExperimentCanvasPad(ApplicationContext applicationContext, ExperimentCanvasWidget experimentCanvasWidget, CompositeComponentGraph experiment) 
        {   
            ExperimentCanvasPad experimentCanvasPad = null;
            if (m_mapPadToNodes.TryGetValue (applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, out experimentCanvasPad))
                return experimentCanvasPad;
            else
            {
                experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);
                m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
            } 
 
            DockFrame m_dockFrame = new DockFrame();
            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X = 100;
            attributes.Y = 100;
            attributes.Width = 100;
            attributes.Height = 100;    
            Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y;
            m_dockFrame.GdkWindow = new Gdk.Window(null, attributes, (int) mask);
            experimentCanvasPad.Initialize (m_dockFrame);
            experimentCanvasPad.SetApplicationModel(applicationContext.Application, experimentCanvasWidget, experiment);
            return experimentCanvasPad;
        }
Esempio n. 10
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;

            GdkWindow = Parent.GdkWindow;

            var attributes = new WindowAttr () {
                WindowType = Gdk.WindowType.Child,
                X = Allocation.X,
                Y = Allocation.Y,
                Width = Allocation.Width,
                Height = Allocation.Height,
                Wclass = WindowClass.InputOnly,
                EventMask = (int)(
                    EventMask.ButtonPressMask |
                    EventMask.ButtonReleaseMask |
                    EventMask.KeyPressMask |
                    EventMask.KeyReleaseMask |
                    EventMask.EnterNotifyMask |
                    EventMask.LeaveNotifyMask)
            };

            var attributes_mask =
                WindowAttributesType.X |
                WindowAttributesType.Y |
                WindowAttributesType.Wmclass;

            input_window = new Gdk.Window (GdkWindow, attributes, attributes_mask) {
                UserData = Handle
            };

            base.OnRealized ();
        }
        protected override void OnRealized ()
        {
            WidgetFlags |= WidgetFlags.Realized;

            Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.Wclass = Gdk.WindowClass.InputOutput;
            attributes.EventMask = (int)Gdk.EventMask.ExposureMask;

            GdkWindow = new Gdk.Window (Parent.GdkWindow, attributes, 0);
            GdkWindow.UserData = Handle;
            GdkWindow.Background = Style.Background (State);
            Style.Attach (GdkWindow);
        }
Esempio n. 12
0
		protected override void OnRealized () {
			SetFlag(Gtk.WidgetFlags.Realized);
			
			Gdk.WindowAttr attributes = new Gdk.WindowAttr();
			attributes.WindowType = Gdk.WindowType.Child;
			attributes.X = Allocation.X;
			attributes.Y = Allocation.Y;
			attributes.Width = Allocation.Width;
			attributes.Height = Allocation.Height;
			attributes.Wclass = WindowClass.InputOutput;
			attributes.Visual = Visual;
			attributes.Colormap = Colormap;
			
			// This enables all events except PointerMotionHitMask which prevents correct behavior
			// of MotionNotifyEvent
			attributes.EventMask = (int) (Gdk.EventMask.AllEventsMask & (~Gdk.EventMask.PointerMotionHintMask));
			
			Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y
				| WindowAttributesType.Visual | WindowAttributesType.Colormap;
			
			GdkWindow = new Gdk.Window(ParentWindow, attributes, (int) mask);
			GdkWindow.UserData = Handle;
			GdkWindow.SetBackPixmap(null, false);
			
			Style = Style.Attach(GdkWindow);
			Style.SetBackground(GdkWindow, StateType.Normal);
			
			Color = new Cairo.Color(1.0, 1.0, 1.0);
		}
Esempio n. 13
0
        protected override void OnRealized()
        {
            IsRealized = true;

            Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.Wclass = Gdk.WindowWindowClass.InputOutput;
            attributes.EventMask = (int)Gdk.EventMask.ExposureMask;

            Window = new Gdk.Window (Parent.Window, attributes, 0);
            Window.UserData = Handle;
            Window.BackgroundRgba = StyleContext.GetBackgroundColor (StateFlags);
        }
Esempio n. 14
0
		protected override void OnRealized ()
		{
			base.OnRealized ();
			
			var alloc = Allocation;
			int bw = (int) BorderWidth;
			
			var attributes = new Gdk.WindowAttr () {
				WindowType = Gdk.WindowType.Child,
				Wclass = Gdk.WindowClass.InputOnly,
				EventMask = (int) (
					EventMask.EnterNotifyMask |
					EventMask.LeaveNotifyMask |
					EventMask.PointerMotionMask |
					EventMask.ButtonPressMask | 
					EventMask.ButtonReleaseMask
				),
				X = alloc.X + bw,
				Y = alloc.Y + bw,
				Width = alloc.Width - bw * 2,
				Height = alloc.Height - bw * 2,
			};
			
			var attrMask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y;
			
			inputWindow = new Gdk.Window (Parent.GdkWindow, attributes, (int) attrMask);
			inputWindow.UserData = Handle;
		}
Esempio n. 15
0
		protected override void OnRealized ()
		{
			WidgetFlags |= WidgetFlags.Realized;
			
			Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
			attributes.X = Allocation.X;
			attributes.Y = Allocation.Y;
			attributes.Height = Allocation.Height;
			attributes.Width = Allocation.Width;
			attributes.WindowType = Gdk.WindowType.Child;
			attributes.Wclass = Gdk.WindowClass.InputOutput;
			attributes.Visual = Visual;
			attributes.Colormap = Colormap;
			attributes.EventMask = (int)(Events |
				Gdk.EventMask.ExposureMask |
				Gdk.EventMask.Button1MotionMask |
				Gdk.EventMask.ButtonPressMask |
				Gdk.EventMask.ButtonReleaseMask);
		
			Gdk.WindowAttributesType attributes_mask =
				Gdk.WindowAttributesType.X |
				Gdk.WindowAttributesType.Y |
				Gdk.WindowAttributesType.Colormap |
				Gdk.WindowAttributesType.Visual;
			GdkWindow = new Gdk.Window (ParentWindow, attributes, (int)attributes_mask);
			GdkWindow.UserData = Handle;

			Style = Style.Attach (GdkWindow);
			Style.SetBackground (GdkWindow, State);
			this.WidgetFlags &= ~WidgetFlags.NoWindow;
			
			//GdkWindow.SetBackPixmap (null, true);

			ModifyBase (StateType.Normal, Styles.DockFrameBackground);
		}
Esempio n. 16
0
	public static Cairo.Surface Realize (Widget widget)
	{
		IntPtr dpy = gdk_x11_get_default_xdisplay ();
		int scr = gdk_x11_get_default_screen ();

		DrawableFormat template = new DrawableFormat ();
		template.Color = new ColorFormat ();
		FormatMask mask = FormatMask.None;
		//template.Doublebuffer = doublebuffer;
		//mask |= FormatMask.Doublebuffer;
		IntPtr dformat = GlitzAPI.glitz_glx_find_window_format (dpy, scr, mask, ref template, 0);

		if (dformat == IntPtr.Zero)
			throw new Exception ("Could not find a usable GL visual");

		IntPtr vinfo = GlitzAPI.glitz_glx_get_visual_info_from_format (dpy, scr, dformat);
		widget.DoubleBuffered = false;

		Gdk.WindowAttr attributes = new Gdk.WindowAttr ();
				attributes.Mask = widget.Events  |
			     (Gdk.EventMask.ExposureMask |
			      Gdk.EventMask.KeyPressMask |
			      Gdk.EventMask.KeyReleaseMask |
			      Gdk.EventMask.EnterNotifyMask |
			      Gdk.EventMask.LeaveNotifyMask |
			      Gdk.EventMask.StructureMask);
				//attributes.X = widget.Allocation.X;
				//attributes.Y = widget.Allocation.Y;
				attributes.X = 0;
				attributes.Y = 0;
				attributes.Width = 100;
				attributes.Height = 100;
		attributes.Wclass = Gdk.WindowClass.InputOutput;
		attributes.Visual = new Gdk.Visual (gdkx_visual_get (XVisualIDFromVisual (vinfo)));
		attributes.Colormap = new Gdk.Colormap (attributes.Visual, true);
		attributes.WindowType = Gdk.WindowType.Child;
		Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap;

		widget.GdkWindow = new Gdk.Window (widget.ParentWindow, attributes, attributes_mask);
		widget.GdkWindow.UserData = widget.Handle;
		uint xid = gdk_x11_drawable_get_xid (widget.GdkWindow.Handle);

		attributes.Width = 100;
		attributes.Height = 100;

		IntPtr glitz_drawable = GlitzAPI.glitz_glx_create_drawable_for_window (dpy, scr, dformat, xid, (uint)attributes.Width, (uint)attributes.Height);
		ggd = new NDesk.Glitz.Drawable (glitz_drawable);

		IntPtr glitz_format = ggd.FindStandardFormat (FormatName.ARGB32);

		ggs = new NDesk.Glitz.Surface (ggd, glitz_format, (uint)attributes.Width, (uint)attributes.Height, 0, IntPtr.Zero);
		Console.WriteLine (ggd.Features);
		ggs.Attach (ggd, doublebuffer ? DrawableBuffer.BackColor : DrawableBuffer.FrontColor);

		//GlitzAPI.glitz_drawable_destroy (glitz_drawable);

		GlitzSurface gs = new GlitzSurface (ggs.Handle);

		return gs;
	}
Esempio n. 17
0
 protected override void OnRealized ()
 {
     WindowAttr attributes = new WindowAttr ();
     WindowAttributesType attributes_mask;
     
     this.SetFlag (Gtk.WidgetFlags.Realized);
     
     attributes.WindowType = Gdk.WindowType.Child;
     attributes.X = this.Allocation.X;
     attributes.Y = this.Allocation.Y;
     attributes.Width = this.Allocation.Width;
     attributes.Height = this.Allocation.Height;
     attributes.Wclass = WindowClass.InputOutput;
     attributes.Visual = this.Visual;
     attributes.Colormap = this.Colormap;
     attributes.EventMask = (int)
         (Gdk.EventMask.VisibilityNotifyMask
          | Gdk.EventMask.ExposureMask
          | Gdk.EventMask.ScrollMask
          | Gdk.EventMask.PointerMotionMask
          | Gdk.EventMask.ButtonPressMask
          | Gdk.EventMask.ButtonReleaseMask
          | Gdk.EventMask.KeyPressMask
          | Gdk.EventMask.KeyReleaseMask);
     
     attributes_mask = WindowAttributesType.X
         | WindowAttributesType.Y
             | WindowAttributesType.Visual
             | WindowAttributesType.Colormap;
     
     this.GdkWindow = new Gdk.Window (this.ParentWindow,
                                      attributes,
                                      attributes_mask);
     this.GdkWindow.UserData = this.Handle;
     
     this.Style.Attach (this.GdkWindow);
     this.GdkWindow.SetBackPixmap (null, false);
     this.Style.SetBackground (this.GdkWindow, StateType.Normal);
     
     foreach (Crumb crumb in this.m_Crumbs) {
         this.PrepareCrumb (crumb);
     }
 }
Esempio n. 18
0
		protected override void OnRealized ()
		{
			WidgetFlags |= WidgetFlags.Realized;
			WindowAttr attributes = new WindowAttr () {
				WindowType = Gdk.WindowType.Child,
				X = Allocation.X,
				Y = Allocation.Y,
				Width = Allocation.Width,
				Height = Allocation.Height,
				Wclass = WindowClass.InputOutput,
				Visual = this.Visual,
				Colormap = this.Colormap,
				EventMask = (int)(this.Events | Gdk.EventMask.ExposureMask),
				Mask = this.Events | Gdk.EventMask.ExposureMask,
			};
			
			WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual;
			GdkWindow = new Gdk.Window (ParentWindow, attributes, mask);
			GdkWindow.UserData = Raw;
			Style = Style.Attach (GdkWindow);
		}
Esempio n. 19
0
		protected override void OnRealized ()
		{
			WidgetFlags |= WidgetFlags.Realized;
			WindowAttr attributes = new WindowAttr ();
			attributes.WindowType = Gdk.WindowType.Child;
			attributes.X = Allocation.X;
			attributes.Y = Allocation.Y;
			attributes.Width = Allocation.Width;
			attributes.Height = Allocation.Height;
			attributes.Wclass = WindowClass.InputOutput;
			attributes.Visual = this.Visual;
			attributes.Colormap = this.Colormap;
			attributes.EventMask = (int)(this.Events | Gdk.EventMask.ExposureMask);
			attributes.Mask = this.Events | Gdk.EventMask.ExposureMask;
//			attributes.Mask = EventMask;
			
			WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual;
			this.GdkWindow = new Gdk.Window (ParentWindow, attributes, mask);
			this.GdkWindow.UserData = this.Raw;
			this.Style = Style.Attach (this.GdkWindow);
			this.WidgetFlags &= ~WidgetFlags.NoWindow;
		}
Esempio n. 20
0
        // END HERZUM SPRINT 5.0: TLAB-235

        // HERZUM SPRINT 1.1 LOOP
        protected void DrawScope (String start, String end){

            var metadata = this.ExperimentNode.Data.Metadata;
            ScopeBaseMetadata scopeMetadata = metadata as ScopeBaseMetadata;

            //componentGraph might be null if component metadata definition is not existing in the library 
            if(scopeMetadata.ComponentGraph != null)
            {
                // HERZUM SPRINT 1.1 CANVAS
                // return;
                // END HERZUM SPRINT 1.1 CANVAS

                if (m_scopeCanvasWidget == null)
                {
                    // HERZUM SPRINT 1.0
                    //scopeCanvasPad = new ExperimentCanvasPad(m_applicationContext);
                    //scopeCanvasPad = new  ScopeCanvasPad(m_applicationContext);
                    // END HERZUM SPRINT 1.0

                    //HERZUM SPRINT 2.0 TLAB-136
                    scopeCanvasPad = ExperimentCanvasPadFactory.CreateExperimentCanvasPad (m_applicationContext,this);
                    //END HERZUM SPRINT 2.0 TLAB-136

                    DockFrame m_dockFrame = new DockFrame();
                    Gdk.WindowAttr attributes = new Gdk.WindowAttr();
                    attributes.WindowType = Gdk.WindowType.Child;

                    attributes.X = 100;
                    attributes.Y = 100;
                    attributes.Width = 100;
                    attributes.Height = 100;    

                    Gdk.WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y;
                    m_dockFrame.GdkWindow = new Gdk.Window(null, attributes, (int) mask);
                    scopeCanvasPad.Initialize (m_dockFrame);

                    
                    // HERZUM SPRINT 2.2 TLAB-101 TLAB-102
                    foreach (ExperimentNode node in scopeMetadata.ComponentGraph.GetExperiment().Vertices)
                    {
                        if (node is ExperimentStartNode)
                            // HERZUM SPRINT 5.0: TLAB-235
                            // node.Data.Metadata.Label = "Start";
                            node.Data.Metadata.Label = start;
                        // END HERZUM SPRINT 5.0: TLAB-235

                        if (node is ExperimentEndNode)
                        {
                            // HERZUM SPRINT 5.0: TLAB-235
                            // node.Data.Metadata.Label = "End";
                            node.Data.Metadata.Label = end;
                            // END HERZUM SPRINT 5.0: TLAB-235

                            //HERZUM SPRINT 2.4 TLAB-158
                            // HERZUM SPRINT 5.0: TLAB-235
                            if (scopeMetadata.ComponentGraph.GetExperiment().StartNode.Data.X == 0 && 
                                scopeMetadata.ComponentGraph.GetExperiment().StartNode.Data.Y == 0 &&
                                scopeMetadata.ComponentGraph.GetExperiment().EndNode.Data.X == 0 && 
                                scopeMetadata.ComponentGraph.GetExperiment().EndNode.Data.Y == 0)
                            // END HERZUM SPRINT 5.0: TLAB-235
                                //HERZUM SPRINT 5.3 TLAB-185
                                    node.Data.Y =+ 110;
                               //END HERZUM SPRINT 5.3 TLAB-185
                            //END HERZUM SPRINT 2.4 TLAB-158
                        }
                    }
                    // END HERZUM SPRINT 2.2 TLAB-101 TLAB-102

                    // HERZUM SPRINT 1.0
                    scopeCanvasPad.SetScopeApplicationModel(this, m_applicationContext.Application, scopeMetadata.ComponentGraph);
                    // scopeCanvasPad.SetScopeApplicationModel(m_applicationContext.Application, scopeMetadata.ComponentGraph);
                    // END HERZUM SPRINT 1.0


                    // HERZUM SPRINT 1.0
                    //m_scopeCanvasWidget = scopeCanvasPad.ScopeCanvasWidget;
                    m_scopeCanvasWidget = scopeCanvasPad.ExperimentCanvasWidget;
                    m_scopeCanvasWidget.DestroyVbox1();
                    // END HERZUM SPRINT 1.0

                }

                // HERZUM SPRINT 2.1
                // m_applicationContext.MainWindow.ExperimentCanvasPad.ScopeNodeControlCurrent = this;
                // END HERZUM SPRINT 2.1


                
                //HERZUM SPRINT 2.0 TLAB-136
                ecp = ExperimentCanvasPadFactory.GetExperimentCanvasPad (m_applicationContext, this);
                //END HERZUM SPRINT 2.0 TLAB-136

                valueZoom = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.Scale;

                if (!nodeCreated)
                {

                    xCur=rect.X;
                    yCur=rect.Y;

                    //PRINT 1.2 TLAB-133
                    //HERZUM SPRINT 2.0 TLAB-136
                    // HERZUM SPRINT 2.4: TLAB-156
                    offsetPanX =  ecp.ExperimentCanvasWidget.OffsetPanX;
                    offsetPanY= ecp.ExperimentCanvasWidget.OffsetPanY;

                    // HERZUM SPRINT 5.3: TLAB-185
                    //ecp.DisplayScope (m_scopeCanvasWidget, rect.X+1+offsetPanX, rect2.Y2+1+offsetPanY); 
                    //ecp.DisplayScope (m_scopeCanvasWidget, rect.X+edgeBorder+offsetPanX, rect2.Y2+edgeBorder+offsetPanY); 
                    ecp.DisplayScope (m_scopeCanvasWidget, (int)((rect.X+edgeBorder+offsetPanX)*valueZoom), (int)((rect2.Y2+edgeBorder+offsetPanY)*valueZoom)); 
                    // END HERZUM SPRINT 5.3: TLAB-185

                    // END HERZUM SPRINT 2.4: TLAB-156
                    //END HERZUM SPRINT 2.0 TLAB-136
                    //END HERZUM SPRINT 1.2 TLAB-133

                    m_scopeCanvasWidget.Show();
                    nodeCreated=true;
                } 

                else if (xCur!=rect.X  ||  yCur!=rect.Y) 
                { 
                    //HERZUM SPRINT 1.2 TLAB-133
                    //HERZUM SPRINT 2.0 TLAB-136

                    //HERZUM SPRINT 2: TLAB-156
                    if (valueZoom==zoomPrevious && valueZoom==1)
                        // HERZUM SPRINT 2.4: TLAB-156
                        // HERZUM SPRINT 5.3: TLAB-185
                        //ecp.MoveScope (m_scopeCanvasWidget, rect.X+1+offsetPanX, rect2.Y2+1+offsetPanY);
                        ecp.MoveScope (m_scopeCanvasWidget, rect.X+edgeBorder+offsetPanX, rect2.Y2+edgeBorder+offsetPanY);
                        // END HERZUM SPRINT 5.3: TLAB-185
                        // END HERZUM SPRINT 2.4: TLAB-156
                    //END HERZUM SPRINT 2: TLAB-156

                    //END HERZUM SPRINT 2.0 TLAB-136

                    xCur=rect.X;
                    yCur=rect.Y;

                    //HERZUM SPRINT 2.0 TLAB-135
                    if (IconisationForced)
                    { 
                        NormalizeScope ();
                        IconisationForced = false;
                    } 

                    OverlayScope (m_applicationContext);
                    //END HERZUM SPRINT 2.0 TLAB-135

                } 


                //HERZUM SPRINT 1.2 TLAB-133
                ResizeCanvasWidget ();
                //END HERZUM SPRINT 1.2 TLAB-133

            }

            if (firstDrawScope)
                if (stateWidget=="max")
                { 
                    MaximizeScope();
                    PaddingBottom = PaddingBottom - 20;
                }
                else if (stateWidget=="iconized")
                    IconizeScope();

            if (stateWidget=="iconized")
                m_scopeCanvasWidget.Hide();

            //HERZUM SPRINT 2.0 TLAB-135
            if (firstDrawScope)
            { 
                OverlayScope (m_applicationContext);
                firstDrawScope=false;
            }
            //END HERZUM SPRINT 2.0 TLAB-135


            //HERZUM SPRINT 2.0 TLAB-135
            if (IsResize)
            { 
                OverlayScope (m_applicationContext);
                IsResize=false;
            }
            //END HERZUM SPRINT 2.0 TLAB-135   


            //HERZUM SPRINT 2: TLAB-156
            valueZoom = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.Scale;
            m_scopeCanvasWidget.ExperimentCanvas.View.Scale = valueZoom;   
            SetZoom (valueZoom);
            //HERZUM END SPRINT 2: TLAB-156

            
            // HERZUM SPRINT 2.4: TLAB-156
            //HERZUM SPRINT 5.5 TLAB-216
            point = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.DrawingToView ((int)rect.X / valueZoom, (int)rect2.Y2 / valueZoom);
            offsetPanX = (point.X - rect.X) / valueZoom;
            offsetPanY = (point.Y - rect2.Y - 30) / valueZoom;
            //END HERZUM SPRINT 5.5 TLAB-216 
            if (ecp.ExperimentCanvasWidget.IsPanToolButtonActive ()) {
                //point = ecp.ExperimentCanvasWidget.ExperimentCanvas.View.DrawingToView ((int)rect.X / valueZoom, (int)rect2.Y2 / valueZoom);
                //offsetPanX = (point.X - rect.X) / valueZoom;
                //offsetPanY = (point.Y - rect2.Y - 30) / valueZoom;
                if (valueZoom == 1)
                    // HERZUM SPRINT 5.3: TLAB-185
                    //ecp.MoveScope (m_scopeCanvasWidget, point.X + 1, point.Y);
                    ecp.MoveScope (m_scopeCanvasWidget, point.X + edgeBorder, point.Y + edgeBorder);              
                   // END HERZUM SPRINT 5.3: TLAB-185
            } 
            // END HERZUM SPRINT 2.4: TLAB-156
              

        }
Esempio n. 21
0
    public static Cairo.Surface Realize(Widget widget)
    {
        IntPtr dpy = gdk_x11_get_default_xdisplay();
        int    scr = gdk_x11_get_default_screen();

        DrawableFormat template = new DrawableFormat();

        template.Color = new ColorFormat();
        FormatMask mask = FormatMask.None;
        //template.Doublebuffer = doublebuffer;
        //mask |= FormatMask.Doublebuffer;
        IntPtr dformat = GlitzAPI.glitz_glx_find_window_format(dpy, scr, mask, ref template, 0);

        if (dformat == IntPtr.Zero)
        {
            throw new Exception("Could not find a usable GL visual");
        }

        IntPtr vinfo = GlitzAPI.glitz_glx_get_visual_info_from_format(dpy, scr, dformat);

        widget.DoubleBuffered = false;

        Gdk.WindowAttr attributes = new Gdk.WindowAttr();
        attributes.Mask = widget.Events |
                          (Gdk.EventMask.ExposureMask |
                           Gdk.EventMask.KeyPressMask |
                           Gdk.EventMask.KeyReleaseMask |
                           Gdk.EventMask.EnterNotifyMask |
                           Gdk.EventMask.LeaveNotifyMask |
                           Gdk.EventMask.StructureMask);
        //attributes.X = widget.Allocation.X;
        //attributes.Y = widget.Allocation.Y;
        attributes.X          = 0;
        attributes.Y          = 0;
        attributes.Width      = 100;
        attributes.Height     = 100;
        attributes.Wclass     = Gdk.WindowClass.InputOutput;
        attributes.Visual     = new Gdk.Visual(gdkx_visual_get(XVisualIDFromVisual(vinfo)));
        attributes.Colormap   = new Gdk.Colormap(attributes.Visual, true);
        attributes.WindowType = Gdk.WindowType.Child;
        Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap;

        widget.GdkWindow          = new Gdk.Window(widget.ParentWindow, attributes, attributes_mask);
        widget.GdkWindow.UserData = widget.Handle;
        uint xid = gdk_x11_drawable_get_xid(widget.GdkWindow.Handle);

        attributes.Width  = 100;
        attributes.Height = 100;

        IntPtr glitz_drawable = GlitzAPI.glitz_glx_create_drawable_for_window(dpy, scr, dformat, xid, (uint)attributes.Width, (uint)attributes.Height);

        ggd = new NDesk.Glitz.Drawable(glitz_drawable);

        IntPtr glitz_format = ggd.FindStandardFormat(FormatName.ARGB32);

        ggs = new NDesk.Glitz.Surface(ggd, glitz_format, (uint)attributes.Width, (uint)attributes.Height, 0, IntPtr.Zero);
        Console.WriteLine(ggd.Features);
        ggs.Attach(ggd, doublebuffer ? DrawableBuffer.BackColor : DrawableBuffer.FrontColor);

        //GlitzAPI.glitz_drawable_destroy (glitz_drawable);

        GlitzSurface gs = new GlitzSurface(ggs.Handle);

        return(gs);
    }
Esempio n. 22
0
        protected override void OnRealized()
        {
            DebugHelper.WriteLine ("OnRealized");

            SetFlag (WidgetFlags.Realized);
            Gdk.WindowAttr attributes = new WindowAttr();

            attributes.WindowType = Gdk.WindowType.Toplevel;
            attributes.X = this.Allocation.X;
            attributes.Y = this.Allocation.Y;
            attributes.Width = this.Allocation.Width;
            attributes.Height = this.Allocation.Height;
            attributes.Wclass = WindowClass.InputOutput;
            attributes.Visual = this.Visual;
            attributes.Colormap = this.Colormap;
            attributes.EventMask = (int)this.Events;

            attributes.EventMask |= (int)(Gdk.EventMask.AllEventsMask);

            this.GdkWindow = new Gdk.Window(this.ParentWindow, attributes,
                                            (Gdk.WindowAttributesType.X |
                                             Gdk.WindowAttributesType.Y |
                                             Gdk.WindowAttributesType.Visual |
                                             Gdk.WindowAttributesType.Colormap));
            this.GdkWindow.UserData = this.Handle;
            this.Style.Attach (this.GdkWindow);
            this.Style.SetBackground (this.GdkWindow, StateType.Normal);

            ParentWindow.Events = (Gdk.EventMask) (GdkEventMask.StructureNotifyMask | GdkEventMask.SubstructureNotifyMask);
        }