Beispiel #1
0
        // ###############################################################################
        // ### A T T R I B U T E S
        // ###############################################################################

        #region Attributes

        #endregion

        // ###############################################################################
        // ### C O N S T R U C T I O N   A N D   I N I T I A L I Z A T I O N
        // ###############################################################################

        #region Construction

        /// <summary> Minimal initializing constructor. Use this constructor only for *** shell classes *** only! </summary>
        /// <param name="display">The display pointer, that specifies the connection to the X server. <see cref="IntPtr"/> </param>
        protected XrwWmShell(IntPtr display)
            : base(display,
                   X11lib.XDefaultScreen(display),                      /* Select the current screen to display on. */
                   X11lib.XDefaultRootWindow(display))                  /* Select display's root window as parent window. */
        {
            ;
        }
Beispiel #2
0
        // ###############################################################################
        // ### M E T H O D S
        // ###############################################################################

        #region Methods

        /// <summary> Alloc a color from the default colormap of the display's default screen. </summary>
        /// <param name="colorname"> The color to alloc. <see cref="System.String"/> </param>
        /// <returns> The color pixel on success, or the white pixel otherwise. <see cref="X11.TColor"/> </returns>
        public TColor AllocColorFromDefaultColormap(string colorname)
        {
            IntPtr display = Xtlib.XtDisplay(_shell);

            if (display == IntPtr.Zero)
            {
                return(TColor.FallbackWhite);
            }

            TInt scrnID = X11lib.XDefaultScreen(display);

            return(X11lib.XAllocClosestNamedColor(display, X11lib.XDefaultColormap(display, scrnID), colorname));
        }