Пример #1
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);
        }
    }
Пример #2
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);
    }