public string Accept(TInt type, string fieldName, string tablesName)
 {
     throw new NotImplementedException();
 }
Example #2
0
 public string Accept(TInt type)
 {
     return("number");
 }
    public static void Main()
    {
        TInt X = 3;

        Console.WriteLine(X);
    }
Example #4
0
 /// <summary> Initializing constructor. </summary>
 /// <param name="x"> The x-coordinate. <see cref="TInt"/> </param>
 /// <param name="y"> The y-coordinate. <see cref="TInt"/> </param>
 public TPoint(TInt x, TInt y)
 {
     X = (int)x;
     Y = (int)y;
 }
        // ###############################################################################
        // ### 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> Initializing constructor. </summary>
        /// <param name="display">The display pointer, that specifies the connection to the X server. <see cref="System.IntPtr"/> </param>
        /// <param name="screenNumber"> The appropriate screen number on the host server. <see cref="System.Int32"/> </param>
        /// <param name="icon"> The left bitmap to display. <see cref="XrwBitmap.Icon"/> </param>
        public X11Graphic(IntPtr display, TInt screenNumber, StockIcon icon)
        {
            // Check arguments.
            if (display == IntPtr.Zero)
            {
                throw new ArgumentNullException("display");
            }
            if (icon == X11Graphic.StockIcon.None)
            {
                throw new ArgumentNullException("icon");
            }

            _display      = display;
            _screenNumber = screenNumber;

            // Load bitmap.
            Bitmap bmp = null;

            try
            {
                System.IO.Stream bmpStream = null;

                if (icon == X11Graphic.StockIcon.Attention16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_ATTENTION_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Attention32TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_ATTENTION_32_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Attention48TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_ATTENTION_48_TRUECOLOR, false);
                }

                else if (icon == X11Graphic.StockIcon.Cancel16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_CANCEL_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Cancel32TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_CANCEL_32_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Cancel48TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_CANCEL_48_TRUECOLOR, false);
                }

                else if (icon == X11Graphic.StockIcon.Error16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_ERROR_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Error32TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_ERROR_32_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Error48TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_ERROR_48_TRUECOLOR, false);
                }

                else if (icon == X11Graphic.StockIcon.Information16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_INFO_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Information32TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_INFO_32_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Information48TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_INFO_48_TRUECOLOR, false);
                }

                else if (icon == X11Graphic.StockIcon.Ok16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_OK_16_TRUECOLOR, false);
                }

                else if (icon == X11Graphic.StockIcon.Question16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_QUESTION_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Question32TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_QUESTION_32_TRUECOLOR, false);
                }

                else if (icon == X11Graphic.StockIcon.Warning16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_WARNING_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.Warning32TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_WARNING_32_TRUECOLOR, false);
                }

                else if (icon == X11Graphic.StockIcon.ToggleOff16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_TOGGLEOFF_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.ToggleOn16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_TOGGLEON_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.RadioOff16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_RADIOOFF_16_TRUECOLOR, false);
                }
                else if (icon == X11Graphic.StockIcon.RadioOn16TrueColor)
                {
                    bmpStream = new System.IO.MemoryStream(X11Resources.IMAGE_RADIOON_16_TRUECOLOR, false);
                }

                bmp = new Bitmap(bmpStream);
                bmpStream.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            if (bmp == null)
            {
                throw new OperationCanceledException("Failed to create bitmap from '" + icon.ToString() + "'.");
            }

            InitializeGraphicRessources(bmp);
        }
Example #6
0
 public void Accept(TInt type, Dictionary <string, DefTypeBase> x)
 {
 }
 public string Accept(TInt type)
 {
     return("int32_t");
 }
Example #8
0
 public string Accept(TInt type, string json, string x)
 {
     return($"{x} = {json}.GetInt32();");
 }
 public bool Accept(TInt type, TType x, Dictionary <DefTypeBase, bool> y, HashSet <DefTypeBase> z)
 {
     return(true);
 }
Example #10
0
 public string Accept(TInt type, string jsonVarName, string fieldName)
 {
     return($"{fieldName} = {jsonVarName}");
 }
Example #11
0
 public DType Accept(TInt type, JsonElement x, DefAssembly ass)
 {
     return(DInt.ValueOf(x.GetInt32()));
 }
Example #12
0
 public string Accept(TInt type, string byteBufName, string fieldName)
 {
     return($"{byteBufName}.WriteInt({fieldName});");
 }
Example #13
0
 public string Accept(TInt type, string x)
 {
     return($"{x} or 0");
 }
Example #14
0
 public void setPeso(TInt value)
 {
     //<bucb> setPeso(TInt value)
     //<eucb> setPeso(TInt value)
     this.peso = value;
 }
 public void Accept(TInt type, HashSet <DefTypeBase> x)
 {
 }
Example #16
0
        // ###############################################################################
        // ### 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>Initializing constructor.</summary>
        /// <param name="display">The display to initialize the font specifications for.<see cref="IntPtr"/></param>
        /// <param name="preferredCharSet">The preferred charset or empty string for no preference.
        /// Sort fonts with this charset to the top. <see cref="System.String"/> </param>
        public FontSpecificationList(IntPtr display, string preferredCharSet)
        {
            _preferredCharSet = preferredCharSet;

            TInt   numFonts   = 0;
            string fontFilter = "-*-*-*-*-*-*-*-*-*-*-*-*-*";
            //string fontFilter = "-*-*-*-*-*-*-0-0-0-0-*-*-*";
            //                   -1-2-3-4-5-6-7-8-9-A-B-C-D
            //                    1 = Foundry
            //                    2 = Family
            //                    3 = Weight
            //                    4 = Slant
            //                    5 = Width
            //                    6 = Extra
            //                    7 = Pixel
            //                    8 = TenthOfPoint
            //                    9 = Horz resolution
            //                    A = Vert resolution
            //                    B = Spacing
            //                    C = TenthOfAveragePixelWidth
            //                    D = Characterset
            IntPtr fontNameArray = X11lib.XListFonts(display, fontFilter, (TInt)20000, ref numFonts);

            for (int countFont = 0; countFont < (int)numFonts; countFont++)
            {
                IntPtr fontNameDeref = System.Runtime.InteropServices.Marshal.ReadIntPtr(fontNameArray, IntPtr.Size * countFont);
                string fontName      = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(fontNameDeref);
                if (!string.IsNullOrEmpty(fontName))
                {
                    _qualifiedFontNames.Add(fontName);
                    this.AddFontSpecification(fontName);

                    // This takes a lot of time!!!

                    /*
                     * IntPtr fontResourceId = X11lib.XLoadFont (display, fontName);
                     * if (fontResourceId != IntPtr.Zero)
                     * {
                     *      IntPtr fontStruct = X11lib.XQueryFont (display, fontResourceId);
                     *      if (fontStruct != IntPtr.Zero)
                     *      {
                     *              string name = "";
                     *              TUlong val = (TUlong)0;
                     *              TBoolean res = X11lib.XGetFontProperty (fontStruct, X11atoms.XA_FAMILY_NAME, ref val);
                     *              if (res == (TBoolean)1)
                     *              {
                     *                      IntPtr nameRef = X11lib.XGetAtomName (display, (IntPtr)val);
                     *                      if (nameRef != IntPtr.Zero)
                     *                      {
                     *                              name = System.Runtime.InteropServices.Marshal.PtrToStringAuto (nameRef);
                     *                              X11lib.XFree (nameRef);
                     *                      }
                     *              }
                     *              X11lib.XFreeFontInfo (IntPtr.Zero, fontStruct, (TInt)0);
                     *      }
                     *      //X11lib.XFreeFont (display, fontResourceId);
                     * }
                     */
                }
            }
            X11lib.XFreeFontNames(fontNameArray);
            fontNameArray = IntPtr.Zero;
            // http://coot.googlecode.com/svn/trunk/ccp4mg-utils/pygl/x11_font.cc

            _qualifiedFontNames.Sort();
            this.Sort();
        }
Example #17
0
 public void Accept(TInt type, HashSet <string> x)
 {
 }
 public string Accept(TInt type, string bufName, string fieldName)
 {
     return($"{fieldName} = {bufName}.ReadInt();");
 }
Example #19
0
 public DType Accept(TInt type, JsonElement x, DefAssembly ass)
 {
     return(new DInt(x.GetInt32()));
 }
Example #20
0
 public string Accept(TInt type, string json, string field)
 {
     return(DefaultSave(json, field));
 }
Example #21
0
 /// <summary> Initializing constructor. </summary>
 /// <param name="width"> The width. <see cref="TInt"/> </param>
 /// <param name="height"> The height. <see cref="TInt"/> </param>
 public TSize(TInt width, TInt height)
 {
     Width  = (int)width;
     Height = (int)height;
 }
Example #22
0
 public override string Accept(TInt type)
 {
     return("Integer");
 }
Example #23
0
 void method(TInt interf, string msg)
 {
     interf.mes = msg;
     interf.IntMeth();
 }