Return the fix screen info from the framebuffer file descriptor.
177540
def _get_fix_info(fbfid):
        """"""
        fix_info = FbMem.FixScreenInfo()
        fcntl.ioctl(fbfid, FbMem.FBIOGET_FSCREENINFO, fix_info)
        return fix_info
1158681
def getScreen(self):
        
        from .RegionMatching import PlatformManager, Screen
        screens = PlatformManager.getScreenDetails()
        for screen in screens:
            s_x, s_y, s_w, s_h = screen["rect"]
            if (self.x >= s_x) and (self.x < s_x + s_w) and (self.y >= s_y) and (self.y < s_y + s_h):
                # Top left corner is inside screen region
                return Screen(screens.index(screen))
        return None # Could not find matching screen
339768
def getouterframes(frame, context=1):
    """"""
    framelist = []
    while frame:
        framelist.append((frame,) + getframeinfo(frame, context))
        frame = frame.f_back
    return framelist
924899
def fix_embed_globals():
    
    frame = get_stack_frame(N=1)
    frame.f_globals.update(frame.f_locals)
    frame.f_globals['_did_embed_fix'] = True
    """
    def fix_embed_globals(N=0):
        import inspect
        # Get the parent frame
        frame_cur = inspect.currentframe()
        for _ix in range(N + 1):
            # always skip the frame of this function
            frame_next = frame_cur.f_back
            if frame_next is None:
                break
            frame_cur = frame_next
        # Add locals to parent globals
        frame = frame_cur
        frame.f_globals.update(frame.f_locals)
        frame.f_globals['_did_embed_fix'] = True
    """
239048
def return_buffer_contents(self, frame, force_unescaped=False):
        """"""
        if not force_unescaped:
            if frame.eval_ctx.volatile:
                self.writeline('if context.eval_ctx.autoescape:')
                self.indent()
                self.writeline('return Markup(concat(%s))' % frame.buffer)
                self.outdent()
                self.writeline('else:')
                self.indent()
                self.writeline('return concat(%s)' % frame.buffer)
                self.outdent()
                return
            elif frame.eval_ctx.autoescape:
                self.writeline('return Markup(concat(%s))' % frame.buffer)
                return
        self.writeline('return concat(%s)' % frame.buffer)
99003
def update(self):
        
        # this is not really neccesary because the surface is black after initializing
        self.corners.fill(BLACK)
        self.corners.draw_dot((0, 0), self.colors[0])
        self.corners.draw_dot((self.screen.width - 1, 0), self.colors[0])
        self.corners.draw_dot((self.screen.width - 1, self.screen.height - 1),
                              self.colors[0])
        self.corners.draw_dot((0, self.screen.height - 1), self.colors[0])

        self.lines.fill(BLACK)
        self.lines.draw_line((1, 0), (self.lines.width - 1, 0), self.colors[1])
        self.lines.draw_line((0, 1), (0, self.lines.height - 1), self.colors[3])
        self.lines.draw_line((0, 0), (self.lines.width - 1,
                                      self.lines.height - 1), self.colors[2])

        self.rects.fill(BLACK)
        self.rects.draw_rect((0, 0), (int(self.rects.width / 2) - 1,
                                      self.rects.height),
                             self.colors[2], self.colors[3])
        self.rects.draw_rect((int(self.rects.width / 2) + 1, 0),
                             (int(self.rects.width / 2) - 1,
                              self.rects.height),
                             self.colors[3], self.colors[2])

        self.circle.fill(BLACK)
        radius = int(min(self.circle.width, self.circle.height) / 2) - 1
        self.circle.draw_circle((int(self.circle.width / 2) - 1,
                                 int(self.circle.height / 2) - 1), radius,
                                self.colors[4], self.colors[5])

        self.filled.fill(self.colors[6])
581671
def get_raw_fixed_block(self, unbuffered=False):
        """"""
        if unbuffered or not self._fixed_block:
            self._fixed_block = self._read_fixed_block()
        return self._fixed_block
54623
def _source_info():
    
    ofi = inspect.getouterframes(inspect.currentframe())[2]
    try:
        calling_class = ofi[0].f_locals['self'].__class__
    except KeyError:
        calling_class = None
    # Tuple of file,line,calling_class,function_name
    return ofi[1], ofi[2], calling_class, ofi[3]
1230707
def getScreenBounds(self, screenId):
        
        screen_details = self.getScreenDetails()
        if not isinstance(screenId, int) or screenId < -1 or screenId >= len(screen_details):
            raise ValueError("Invalid screen ID")
        if screenId == -1:
            # -1 represents the entire virtual screen
            return self._getVirtualScreenRect()
        return screen_details[screenId]["rect"]
1124526
def screen(self):
        """"""
        hwnd = win32gui.GetDesktopWindow()
        left, top, right, bottom = self.rect
        width, height = right-left, bottom-top
        # copy bits to temporary dc
        win32gui.BitBlt(self._hdcmem, 0, 0, width, height, 
                        self._hdcwin, left, top, win32con.SRCCOPY)
        # read bits into buffer
        windll.gdi32.GetDIBits(self._hdcmem, self._hbmp.handle, 0, height, self._buf, ctypes.byref(self._bi), win32con.DIB_RGB_COLORS)
        # make a PIL Image
        img = Image.frombuffer('RGB', (width, height), self._buf, 'raw', 'BGRX', 0, 1)
        img = img.transpose(Image.FLIP_TOP_BOTTOM)
        return img
506004
def getScreenDetails(self):
        
        monitors = self._getMonitorInfo()
        primary_screen = None
        screens = []
        for monitor in monitors:
            # Convert screen rect to Lackey-style rect (x,y,w,h) as position in virtual screen
            screen = {
                "rect": (
                    monitor["rect"][0],
                    monitor["rect"][1],
                    monitor["rect"][2] - monitor["rect"][0],
                    monitor["rect"][3] - monitor["rect"][1]
                )
            }
            screens.append(screen)
        return screens
41277
def get_frame_list():
    

    # TODO: use this function in IPS below (less code duplication)

    frame_info_list = []
    frame_list = []
    frame = inspect.currentframe()
    while frame is not None:
        frame_list.append(frame)
        info = inspect.getframeinfo(frame)
        frame_info_list.append(info)
        frame = frame.f_back

    frame_info_list.reverse()
    frame_list.reverse()
    frame_info_str_list = [format_frameinfo(fi) for fi in frame_info_list]

    return frame_list, frame_info_list, frame_info_str_list
970481
def detach_framebuffer(self, screen_id, id_p):
        
        if not isinstance(screen_id, baseinteger):
            raise TypeError("screen_id can only be an instance of type baseinteger")
        if not isinstance(id_p, basestring):
            raise TypeError("id_p can only be an instance of type basestring")
        self._call("detachFramebuffer",
                     in_p=[screen_id, id_p])
409194
public void restoreScreenParam(int iFieldSeq)
    {
        if (this.getScreenRecord() != null)
            if (this.getScreenRecord().getField(iFieldSeq) != null)
                if (this.getScreenRecord().getField(iFieldSeq).getFieldName() != null)
        {
            String strFieldName = this.getScreenRecord().getField(iFieldSeq).getFieldName();
            if (this.getProperty(strFieldName) != null)
                this.getScreenRecord().getField(iFieldSeq).setString((String)this.getProperty(strFieldName));
        }
    }
251453
def refresh(self):
        
        self._screen.block_transfer(self._buffer, self._dx, self._dy)
301193
def _GetDebuggeeDescription(self):
    """"""
    return '-'.join(self._debuggee_labels[label]
                    for label in _DESCRIPTION_LABELS
                    if label in self._debuggee_labels)
220295
protected int getScreenResolution(Component c) {
        if (c == null) {
            return getDefaultScreenResolution();
        }

        Toolkit toolkit = c.getToolkit();
        return toolkit != null
                ? toolkit.getScreenResolution()
                : getDefaultScreenResolution();
    }