Changeset 69311 in webkit


Ignore:
Timestamp:
Oct 7, 2010 8:08:08 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-07 Dave Moore <davemoore@chromium.org>

Reviewed by Kent Tamura.

Add WebThemeEngine api for chromium/linux
https://bugs.webkit.org/show_bug.cgi?id=47278
Create new linux specific version of WinThemeEngine.h and move
existing windows specific one to win directory. Keep old top
level file until chromium is updated to use the new ones.

  • WebKit.gyp:
  • public/WebThemeEngine.h:
  • src/ChromiumBridge.cpp:
Location:
trunk/WebKit/chromium
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r69295 r69311  
     12010-10-07  Dave Moore  <davemoore@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        Add WebThemeEngine api for chromium/linux
     6        https://bugs.webkit.org/show_bug.cgi?id=47278
     7        Create new linux specific version of WinThemeEngine.h and move
     8        existing windows specific one to win directory. Keep old top
     9        level file until chromium is updated to use the new ones.
     10
     11        * WebKit.gyp:
     12        * public/WebThemeEngine.h:
     13        * src/ChromiumBridge.cpp:
     14
    1152010-10-07  Andrey Kosyakov  <caseq@chromium.org>
    216
  • trunk/WebKit/chromium/WebKit.gyp

    r69243 r69311  
    9797                'public/linux/WebFontRenderStyle.h',
    9898                'public/linux/WebRenderTheme.h',
     99                'public/linux/WebThemeEngine.h',
    99100                'public/x11/WebScreenInfoFactory.h',
    100101                'public/mac/WebInputEventFactory.h',
     
    264265                'public/WebTextInputType.h',
    265266                'public/WebTextRun.h',
    266                 'public/WebThemeEngine.h',
    267267                'public/WebURL.h',
    268268                'public/WebURLError.h',
     
    282282                'public/win/WebSandboxSupport.h',
    283283                'public/win/WebScreenInfoFactory.h',
     284                'public/win/WebThemeEngine.h',
    284285                'src/ApplicationCacheHost.cpp',
    285286                'src/ApplicationCacheHostInternal.h',
  • trunk/WebKit/chromium/public/WebThemeEngine.h

    r63589 r69311  
    4040struct WebSize;
    4141
     42// FIXME: This file has been moved to the win subdirectory as it's entirely
     43// windows dependent. Once chromium has been updated to access the file from
     44// there this file should be deleted.
    4245class WebThemeEngine {
    4346public:
  • trunk/WebKit/chromium/public/linux/WebThemeEngine.h

    r69310 r69311  
    3232#define WebThemeEngine_h
    3333
    34 #include "WebCanvas.h"
    35 #include "WebColor.h"
     34#include "../WebCanvas.h"
     35#include "../WebColor.h"
     36#include "../WebSize.h"
    3637
    3738namespace WebKit {
    3839
    3940struct WebRect;
    40 struct WebSize;
    4141
    4242class WebThemeEngine {
    4343public:
    44 #ifdef WIN32
    45 // The part and state parameters correspond to values defined by the
    46 // Windows Theme API (see
    47 // http://msdn.microsoft.com/en-us/library/bb773187(VS.85).aspx ).
    48 // The classicState parameter corresponds to the uState
    49 // parameter of the Windows DrawFrameControl() function.
    50 // See the definitions in <vsstyle.h> and <winuser.h>.
    51     virtual void paintButton(
    52         WebCanvas*, int part, int state, int classicState,
    53         const WebRect&) = 0;
     44    // The UI part which is being accessed.
     45    enum Part {
     46        PartScrollbarDownArrow,
     47        PartScrollbarLeftArrow,
     48        PartScrollbarRightArrow,
     49        PartScrollbarUpArrow,
     50        PartScrollbarHorizontalThumb,
     51        PartScrollbarVerticalThumb,
     52        PartScrollbarHoriztonalTrack,
     53        PartScrollbarVerticalTrack
     54    };
    5455
    55     virtual void paintMenuList(
    56         WebCanvas*, int part, int state, int classicState,
    57         const WebRect&) = 0;
     56    // The current state of the associated Part.
     57    enum State {
     58        StateDisabled,
     59        StateHover,
     60        StateNormal,
     61        StatePressed,
     62    };
    5863
    59     virtual void paintScrollbarArrow(
    60         WebCanvas*, int state, int classicState,
    61         const WebRect&) = 0;
     64    // Extra parameters for drawing the PartScrollbarHoriztonalTrack and
     65    // PartScrollbarVerticalTrack.
     66    struct ScrollbarTrackExtraParams {
     67        // The bounds of the entire track, as opposed to the part being painted.
     68        int trackX;
     69        int trackY;
     70        int trackWidth;
     71        int trackHeight;
     72    };
    6273
    63     virtual void paintScrollbarThumb(
    64         WebCanvas*, int part, int state, int classicState,
    65         const WebRect&) = 0;
     74    union ExtraParams {
     75        ScrollbarTrackExtraParams scrollbarTrack;
     76    };
    6677
    67     virtual void paintScrollbarTrack(
    68         WebCanvas*, int part, int state, int classicState,
    69         const WebRect&, const WebRect& alignRect) = 0;
    70 
    71     virtual void paintSpinButton(
    72         WebCanvas*, int part, int state, int classicState,
    73         const WebRect&) {}
    74 
    75     virtual void paintTextField(
    76         WebCanvas*, int part, int state, int classicState,
    77         const WebRect&, WebColor, bool fillContentArea, bool drawEdges) = 0;
    78 
    79     virtual void paintTrackbar(
    80         WebCanvas*, int part, int state, int classicState,
    81         const WebRect&) = 0;
    82 
    83     virtual void paintProgressBar(
    84         WebCanvas*, const WebRect& barRect, const WebRect& valueRect,
    85         bool determinate, double animatedSeconds) {}
    86 
    87 #endif
     78    // Gets the size of the given theme part. For variable sized items
     79    // like vertical scrollbar thumbs, the width will be the required width of
     80    // the track while the height will be the minimum height.
     81    virtual WebSize getSize(Part) { return WebSize(); }
     82    // Paint the given the given theme part.
     83    virtual void paint(
     84        WebCanvas*, Part, State, const WebRect&, const ExtraParams*) {}
    8885};
    8986
  • trunk/WebKit/chromium/public/win/WebThemeEngine.h

    r69310 r69311  
    3232#define WebThemeEngine_h
    3333
    34 #include "WebCanvas.h"
    35 #include "WebColor.h"
     34#include "../WebCanvas.h"
     35#include "../WebColor.h"
     36#include "../WebSize.h"
    3637
    3738namespace WebKit {
     
    4243class WebThemeEngine {
    4344public:
    44 #ifdef WIN32
    4545// The part and state parameters correspond to values defined by the
    4646// Windows Theme API (see
     
    8484        WebCanvas*, const WebRect& barRect, const WebRect& valueRect,
    8585        bool determinate, double animatedSeconds) {}
    86 
    87 #endif
    8886};
    8987
  • trunk/WebKit/chromium/src/ChromiumBridge.cpp

    r68112 r69311  
    6464#if OS(WINDOWS)
    6565#include "WebRect.h"
    66 #include "WebThemeEngine.h"
     66#include "win/WebThemeEngine.h"
    6767#endif
    6868
Note: See TracChangeset for help on using the changeset viewer.