Home | History | Annotate | Download | only in efl
      1 /*
      2  * Copyright (C) 2007 Apple Inc.  All rights reserved.
      3  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
      4  * Copyright (C) 2008 Holger Hans Peter Freyther
      5  * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
      6  * Copyright (C) 2009-2010 ProFUSION embedded systems
      7  * Copyright (C) 2009-2010 Samsung Electronics
      8  *
      9  * Redistribution and use in source and binary forms, with or without
     10  * modification, are permitted provided that the following conditions
     11  * are met:
     12  *
     13  * 1.  Redistributions of source code must retain the above copyright
     14  *     notice, this list of conditions and the following disclaimer.
     15  * 2.  Redistributions in binary form must reproduce the above copyright
     16  *     notice, this list of conditions and the following disclaimer in the
     17  *     documentation and/or other materials provided with the distribution.
     18  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
     19  *     its contributors may be used to endorse or promote products derived
     20  *     from this software without specific prior written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     23  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     24  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     25  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
     26  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     27  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     29  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  */
     33 
     34 #include "config.h"
     35 #include "PlatformScreen.h"
     36 
     37 #include "NotImplemented.h"
     38 #include "PlatformString.h"
     39 #include "Widget.h"
     40 #include <wtf/text/CString.h>
     41 
     42 #ifdef HAVE_ECORE_X
     43 #include <Ecore_X.h>
     44 #include <X11/Xlib.h>
     45 #endif
     46 
     47 namespace WebCore {
     48 
     49 int screenDepth(Widget* widget)
     50 {
     51     notImplemented();
     52     return 8;
     53 }
     54 
     55 int screenDepthPerComponent(Widget*)
     56 {
     57     notImplemented();
     58     return 8;
     59 }
     60 
     61 bool screenIsMonochrome(Widget*)
     62 {
     63     notImplemented();
     64     return false;
     65 }
     66 
     67 FloatRect screenRect(Widget* widget)
     68 {
     69     int x = 0, y = 0, w = 0, h = 0;
     70 
     71 #ifdef HAVE_ECORE_X
     72     Ecore_X_Display* display = ecore_x_display_get();
     73     int def = DefaultScreen(display);
     74     Screen* screen = ScreenOfDisplay(display, def);
     75     x = 0;
     76     y = 0;
     77     w = screen->width;
     78     h = screen->height;
     79 #endif
     80 
     81     return FloatRect(x, y, w, h);
     82 }
     83 
     84 FloatRect screenAvailableRect(Widget* widget)
     85 {
     86     notImplemented();
     87     return screenRect(widget);
     88 }
     89 
     90 }
     91