Exemple #1
0
        public unsafe static XRRScreenSize[] XRRSizes(Display dpy, int screen)
        {
            int            count;
            XRRScreenSize *data = XRRSizes(dpy, screen, &count);

            if (count == 0)
            {
                return(null);
            }

            XRRScreenSize[] sizes = new XRRScreenSize[count];
            for (int i = 0; i < count; i++)
            {
                sizes[i] = *data++;
            }
            return(sizes);
        }
Exemple #2
0
        public static unsafe XRRScreenSize[] XRRSizes(IntPtr dpy, int screen)
        {
            int length;

            byte *numPtr = (byte *)(void *)Functions.XRRSizes(dpy, screen, &length);

            if (length == 0)
            {
                return((XRRScreenSize[])null);
            }
            XRRScreenSize[] xrrScreenSizeArray = new XRRScreenSize[length];
            for (int index = 0; index < length; ++index)
            {
                xrrScreenSizeArray[index] = new XRRScreenSize();
                xrrScreenSizeArray[index] = (XRRScreenSize)Marshal.PtrToStructure((IntPtr)((void *)numPtr), typeof(XRRScreenSize));
                numPtr += Marshal.SizeOf(typeof(XRRScreenSize));
            }
            return(xrrScreenSizeArray);
        }
Exemple #3
0
        public static XRRScreenSize[] XRRSizes(Display dpy, int screen)
        {
            XRRScreenSize[] sizes;
            //IntPtr ptr;
            int count;
            unsafe
            {
                //ptr = XRRSizes(dpy, screen, &nsizes);

                byte* data = (byte*)XRRSizes(dpy, screen, &count);//(byte*)ptr;
                if (count == 0)
                    return null;
                sizes = new XRRScreenSize[count];
                for (int i = 0; i < count; i++)
                {
                    sizes[i] = new XRRScreenSize();
                    sizes[i] = (XRRScreenSize)Marshal.PtrToStructure((IntPtr)data, typeof(XRRScreenSize));
                    data += Marshal.SizeOf(typeof(XRRScreenSize));
                }
                //XFree(ptr);   // Looks like we must not free this.
                return sizes;
            }
        }
Exemple #4
0
        public static unsafe XRRScreenSize[] XRRSizes(Display dpy, int screen)
        {
            int count;
            XRRScreenSize* data = XRRSizes(dpy, screen, &count);
            if (count == 0) return null;

            XRRScreenSize[] sizes = new XRRScreenSize[count];
            for (int i = 0; i < count; i++)
                sizes[i] = *data++;
            return sizes;
        }
Exemple #5
0
 public static unsafe XRRScreenSize[] XRRSizes(IntPtr dpy, int screen)
 {
     int length;
       byte* numPtr = (byte*) (void*) Functions.XRRSizes(dpy, screen, &length);
       if (length == 0)
     return (XRRScreenSize[]) null;
       XRRScreenSize[] xrrScreenSizeArray = new XRRScreenSize[length];
       for (int index = 0; index < length; ++index)
       {
     xrrScreenSizeArray[index] = new XRRScreenSize();
     xrrScreenSizeArray[index] = (XRRScreenSize) Marshal.PtrToStructure((IntPtr) ((void*) numPtr), typeof (XRRScreenSize));
     numPtr += Marshal.SizeOf(typeof (XRRScreenSize));
       }
       return xrrScreenSizeArray;
 }