public override void Execute(SurfaceReceiver receiver)
        {
            int x, y;
            int tx, ty;
            int width, height;

            Gdk.Pixbuf      pixbuf;
            Gdk.Rectangle[] rects;
            Gdk.Rectangle   clippedRect;

            if (codecID != CODEC_ID_REMOTEFX)
            {
                return;
            }

            RfxMessage rfxMsg = receiver.rfx.ParseMessage(bitmapData, bitmapDataLength);

            x     = y = 0;
            width = height = 64;
            rects = new Gdk.Rectangle[rfxMsg.RectCount];

            int count = 0;

            while (rfxMsg.HasNextRect())
            {
                rfxMsg.GetNextRect(ref x, ref y, ref width, ref height);

                tx = x + destLeft;
                ty = y + destTop;

                rects[count++] = new Gdk.Rectangle(tx, ty, width, height);
            }

            while (rfxMsg.HasNextTile())
            {
                rfxMsg.GetNextTile(buffer, ref x, ref y);

                tx = x + destLeft;
                ty = y + destTop;

                Gdk.Rectangle tileRect = new Gdk.Rectangle(tx, ty, 64, 64);

                foreach (Gdk.Rectangle rect in rects)
                {
                    rect.Intersect(tileRect, out clippedRect);

                    if (!clippedRect.IsEmpty)
                    {
                        pixbuf = new Gdk.Pixbuf(buffer, Gdk.Colorspace.Rgb, true, 8, 64, 64, 64 * 4);

                        pixbuf.CopyArea(0, 0, clippedRect.Width, clippedRect.Height,
                                        receiver.surface, clippedRect.X, clippedRect.Y);

                        receiver.InvalidateRect(clippedRect.X, clippedRect.Y, clippedRect.Width, clippedRect.Height);
                    }
                }
            }
        }
        public override void Execute(SurfaceReceiver receiver)
        {
            int x, y;
            int tx, ty;
            int width, height;
            Gdk.Pixbuf pixbuf;
            Gdk.Rectangle[] rects;
            Gdk.Rectangle clippedRect;

            if (codecID != CODEC_ID_REMOTEFX)
                return;

            RfxMessage rfxMsg = receiver.rfx.ParseMessage(bitmapData, bitmapDataLength);

            x = y = 0;
            width = height = 64;
            rects = new Gdk.Rectangle[rfxMsg.RectCount];

            int count = 0;
            while (rfxMsg.HasNextRect())
            {
                rfxMsg.GetNextRect(ref x, ref y, ref width, ref height);

                tx = x + destLeft;
                ty = y + destTop;

                rects[count++] = new Gdk.Rectangle(tx, ty, width, height);
            }

            while (rfxMsg.HasNextTile())
            {
                rfxMsg.GetNextTile(buffer, ref x, ref y);

                tx = x + destLeft;
                ty = y + destTop;

                Gdk.Rectangle tileRect = new Gdk.Rectangle(tx, ty, 64, 64);

                foreach (Gdk.Rectangle rect in rects)
                {
                    rect.Intersect(tileRect, out clippedRect);

                    if (!clippedRect.IsEmpty)
                    {
                        pixbuf = new Gdk.Pixbuf(buffer, Gdk.Colorspace.Rgb, true, 8, 64, 64, 64 * 4);

                        pixbuf.CopyArea(0, 0, clippedRect.Width, clippedRect.Height,
                            receiver.surface, clippedRect.X, clippedRect.Y);

                        receiver.InvalidateRect(clippedRect.X, clippedRect.Y, clippedRect.Width, clippedRect.Height);
                    }
                }
            }
        }
Beispiel #3
0
 public virtual void Execute(SurfaceReceiver receiver)
 {
 }
 public override void Execute(SurfaceReceiver receiver)
 {
     receiver.window.ProcessUpdates(false);
 }
Beispiel #5
0
    public MainWindow(int m)
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        /* Instantiate client states */
        clientStates = new IClientState[7]
        {
            new StartedState(this),
            new SenderCreatedState(this),
            new ReceiverJoinedState(this),
            new ReceiverAuthenticatedState(this),
            new SenderSendingState(this),
            new ReceiverInControlState(this),
            new SenderSendingRemoteState(this)
        };

        /* Set current state to STARTED */
        currentState = clientStates[STARTED_STATE];
        currentState.refresh();

        width = 1024;
        height = 768;

        config = Config.Load();

        window = mainDrawingArea.GdkWindow;
        drawable = (Gdk.Drawable) window;

        mainDrawingArea.AddEvents(
            (int) Gdk.EventMask.ButtonPressMask |
            (int) Gdk.EventMask.ButtonReleaseMask |
            (int) Gdk.EventMask.PointerMotionMask |
            (int) Gdk.EventMask.KeyPressMask |
            (int) Gdk.EventMask.KeyReleaseMask);

        gc = new Gdk.GC(drawable);
        gc.ClipRectangle = new Gdk.Rectangle(0, 0, width, height);

        surface = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, width, height);
        window.InvalidateRect(new Gdk.Rectangle(0, 0, width, height), true);

        receiver = new SurfaceReceiver(window, surface);

        this.transport = null;

        pcapSource = new PcapSource(this);

        keyboard = new Keyboard();

        if (config.BroadcasterAutoconnect)
            OnUserConnect(config.BroadcasterHostname, config.BroadcasterPort);
    }
Beispiel #6
0
    /**
     * Resets the Drawing Area to blank
     */
    protected void OnCloseActionActivated(object sender, System.EventArgs e)
    {
        this.Title = "Screenary";
        window = mainDrawingArea.GdkWindow;
        drawable = (Gdk.Drawable) window;

        gc = new Gdk.GC(drawable);
        gc.ClipRectangle = new Gdk.Rectangle(0, 0, width, height);

        surface = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, width, height);
        window.InvalidateRect(new Gdk.Rectangle(0, 0, width, height), true);

        receiver = new SurfaceReceiver(window, surface);
    }
Beispiel #7
0
 public override void Execute(SurfaceReceiver receiver)
 {
     receiver.window.ProcessUpdates(false);
 }
 public virtual void Execute(SurfaceReceiver receiver)
 {
 }
Beispiel #9
0
    public MainWindow(int m)
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        /* Instantiate client states */
        clientStates = new IClientState[4] {
            new StartedState(this),
            new SenderCreatedState(this),
            new ReceiverJoinedState(this),
            new ReceiverAuthenticatedState(this)
        };

        /* Set current state to STARTED */
        currentState = clientStates[STARTED_STATE];

        mode = m;
        width = 1024;
        height = 768;

        config = Config.Load();

        window = mainDrawingArea.GdkWindow;
        drawable = (Gdk.Drawable) window;

        gc = new Gdk.GC(drawable);
        gc.ClipRectangle = new Gdk.Rectangle(0, 0, width, height);

        surface = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, width, height);
        window.InvalidateRect(new Gdk.Rectangle(0, 0, width, height), true);

        receiver = new SurfaceReceiver(window, surface);

        OutOfSessionWindow();

        this.transport = null;

        rdpSource = new RdpSource(this);
        pcapSource = new PcapSource(this);

        if (config.BroadcasterAutoconnect)
            OnUserConnect(config.BroadcasterHostname, config.BroadcasterPort);
    }