src/video/directfb/SDL_DirectFB_WM.c
author Sam Lantinga <slouken@libsdl.org>
Sat, 02 Jan 2016 10:10:34 -0800
changeset 9998 f67cf37e9cd4
parent 9619 b94b6d0bff0f
child 10737 3406a0f8b041
permissions -rw-r--r--
Updated copyright to 2016
couriersud@3023
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@9998
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
couriersud@3023
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
couriersud@3023
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
couriersud@3023
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
couriersud@3023
    20
*/
icculus@8093
    21
#include "../../SDL_internal.h"
slouken@6044
    22
slouken@6044
    23
#if SDL_VIDEO_DRIVER_DIRECTFB
couriersud@3023
    24
couriersud@3023
    25
#include "SDL_DirectFB_video.h"
slouken@5199
    26
#include "SDL_DirectFB_window.h"
couriersud@3023
    27
slouken@4636
    28
#include "../../events/SDL_windowevents_c.h"
slouken@4636
    29
couriersud@3023
    30
#define COLOR_EXPAND(col) col.r, col.g, col.b, col.a
couriersud@3023
    31
couriersud@3023
    32
static DFB_Theme theme_std = {
couriersud@3023
    33
    4, 4, 8, 8,
couriersud@3023
    34
    {255, 200, 200, 200},
couriersud@3023
    35
    24,
couriersud@3023
    36
    {255, 0, 0, 255},
couriersud@3023
    37
    16,
couriersud@3023
    38
    {255, 255, 255, 255},
couriersud@3023
    39
    "/usr/share/fonts/truetype/freefont/FreeSans.ttf",
couriersud@3023
    40
    {255, 255, 0, 0},
couriersud@3023
    41
    {255, 255, 255, 0},
couriersud@3023
    42
};
couriersud@3023
    43
couriersud@3023
    44
static DFB_Theme theme_none = {
couriersud@3023
    45
    0, 0, 0, 0,
couriersud@3023
    46
    {0, 0, 0, 0},
couriersud@3023
    47
    0,
couriersud@3023
    48
    {0, 0, 0, 0},
couriersud@3023
    49
    0,
couriersud@3023
    50
    {0, 0, 0, 0},
couriersud@3023
    51
    NULL
couriersud@3023
    52
};
couriersud@3023
    53
couriersud@3023
    54
static void
slouken@4636
    55
DrawTriangle(IDirectFBSurface * s, int down, int x, int y, int w)
couriersud@3023
    56
{
couriersud@3023
    57
    int x1, x2, x3;
couriersud@3023
    58
    int y1, y2, y3;
couriersud@3023
    59
couriersud@3023
    60
    if (down) {
couriersud@3023
    61
        x1 = x + w / 2;
couriersud@3023
    62
        x2 = x;
couriersud@3023
    63
        x3 = x + w;
couriersud@3023
    64
        y1 = y + w;
couriersud@3023
    65
        y2 = y;
couriersud@3023
    66
        y3 = y;
couriersud@3023
    67
    } else {
couriersud@3023
    68
        x1 = x + w / 2;
couriersud@3023
    69
        x2 = x;
couriersud@3023
    70
        x3 = x + w;
couriersud@3023
    71
        y1 = y;
couriersud@3023
    72
        y2 = y + w;
couriersud@3023
    73
        y3 = y + w;
couriersud@3023
    74
    }
couriersud@3023
    75
    s->FillTriangle(s, x1, y1, x2, y2, x3, y3);
couriersud@3023
    76
}
couriersud@3023
    77
couriersud@3023
    78
static void
slouken@4636
    79
LoadFont(_THIS, SDL_Window * window)
slouken@4636
    80
{
slouken@4636
    81
    SDL_DFB_DEVICEDATA(_this);
slouken@4636
    82
    SDL_DFB_WINDOWDATA(window);
slouken@4636
    83
slouken@7191
    84
    if (windata->font != NULL) {
slouken@7191
    85
        SDL_DFB_RELEASE(windata->font);
slouken@7191
    86
        windata->font = NULL;
slouken@7191
    87
        SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font));
slouken@7191
    88
    }
slouken@7191
    89
slouken@7191
    90
    if (windata->theme.font != NULL)
slouken@7191
    91
    {
slouken@4636
    92
        DFBFontDescription fdesc;
slouken@4636
    93
slouken@7191
    94
        SDL_zero(fdesc);
slouken@7191
    95
        fdesc.flags = DFDESC_HEIGHT;
slouken@7191
    96
        fdesc.height = windata->theme.font_size;
slouken@7191
    97
        SDL_DFB_CHECK(devdata->
slouken@7191
    98
                      dfb->CreateFont(devdata->dfb, windata->theme.font,
slouken@7191
    99
                                      &fdesc, &windata->font));
slouken@7191
   100
        SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font));
slouken@7191
   101
    }
slouken@4636
   102
}
slouken@4636
   103
slouken@4636
   104
static void
slouken@4636
   105
DrawCraption(_THIS, IDirectFBSurface * s, int x, int y, char *text)
couriersud@3023
   106
{
couriersud@3023
   107
    DFBSurfaceTextFlags flags;
couriersud@3023
   108
couriersud@3023
   109
    flags = DSTF_CENTER | DSTF_TOP;
couriersud@3023
   110
couriersud@3023
   111
    s->DrawString(s, text, -1, x, y, flags);
couriersud@3023
   112
}
couriersud@3023
   113
couriersud@3023
   114
void
slouken@4636
   115
DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window)
couriersud@3023
   116
{
couriersud@3023
   117
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   118
    IDirectFBSurface *s = windata->window_surface;
couriersud@3023
   119
    DFB_Theme *t = &windata->theme;
couriersud@3023
   120
    int i;
couriersud@3023
   121
    int d = (t->caption_size - t->font_size) / 2;
couriersud@3023
   122
    int x, y, w;
couriersud@3023
   123
couriersud@3023
   124
couriersud@3023
   125
    if (!windata->is_managed || (window->flags & SDL_WINDOW_FULLSCREEN))
couriersud@3023
   126
        return;
couriersud@3023
   127
slouken@5199
   128
    SDL_DFB_CHECK(s->SetSrcBlendFunction(s, DSBF_ONE));
slouken@5199
   129
    SDL_DFB_CHECK(s->SetDstBlendFunction(s, DSBF_ZERO));
slouken@5199
   130
    SDL_DFB_CHECK(s->SetDrawingFlags(s, DSDRAW_NOFX));
slouken@5199
   131
    SDL_DFB_CHECK(s->SetBlittingFlags(s, DSBLIT_NOFX));
slouken@5199
   132
slouken@7191
   133
    LoadFont(_this, window);
gabomdq@7678
   134
    /* s->SetDrawingFlags(s, DSDRAW_BLEND); */
couriersud@3023
   135
    s->SetColor(s, COLOR_EXPAND(t->frame_color));
couriersud@3023
   136
    /* top */
couriersud@3023
   137
    for (i = 0; i < t->top_size; i++)
couriersud@3023
   138
        s->DrawLine(s, 0, i, windata->size.w, i);
couriersud@3023
   139
    /* bottom */
couriersud@3023
   140
    for (i = windata->size.h - t->bottom_size; i < windata->size.h; i++)
couriersud@3023
   141
        s->DrawLine(s, 0, i, windata->size.w, i);
couriersud@3023
   142
    /* left */
couriersud@3023
   143
    for (i = 0; i < t->left_size; i++)
couriersud@3023
   144
        s->DrawLine(s, i, 0, i, windata->size.h);
couriersud@3023
   145
    /* right */
couriersud@3023
   146
    for (i = windata->size.w - t->right_size; i < windata->size.w; i++)
couriersud@3023
   147
        s->DrawLine(s, i, 0, i, windata->size.h);
couriersud@3023
   148
    /* Caption */
couriersud@3023
   149
    s->SetColor(s, COLOR_EXPAND(t->caption_color));
couriersud@3023
   150
    s->FillRectangle(s, t->left_size, t->top_size, windata->client.w,
couriersud@3023
   151
                     t->caption_size);
couriersud@3023
   152
    /* Close Button */
couriersud@3023
   153
    w = t->caption_size;
couriersud@3023
   154
    x = windata->size.w - t->right_size - w + d;
couriersud@3023
   155
    y = t->top_size + d;
couriersud@3023
   156
    s->SetColor(s, COLOR_EXPAND(t->close_color));
slouken@4636
   157
    DrawTriangle(s, 1, x, y, w - 2 * d);
couriersud@3023
   158
    /* Max Button */
couriersud@3023
   159
    s->SetColor(s, COLOR_EXPAND(t->max_color));
slouken@4636
   160
    DrawTriangle(s, window->flags & SDL_WINDOW_MAXIMIZED ? 1 : 0, x - w,
couriersud@3023
   161
               y, w - 2 * d);
couriersud@3023
   162
couriersud@3023
   163
    /* Caption */
icculus@9474
   164
    if (*window->title) {
slouken@7191
   165
        s->SetColor(s, COLOR_EXPAND(t->font_color));
slouken@4636
   166
        DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title);
couriersud@3023
   167
    }
couriersud@3023
   168
    /* Icon */
couriersud@3023
   169
    if (windata->icon) {
couriersud@3023
   170
        DFBRectangle dr;
couriersud@3023
   171
couriersud@3023
   172
        dr.x = t->left_size + d;
couriersud@3023
   173
        dr.y = t->top_size + d;
couriersud@3023
   174
        dr.w = w - 2 * d;
couriersud@3023
   175
        dr.h = w - 2 * d;
couriersud@3023
   176
        s->SetBlittingFlags(s, DSBLIT_BLEND_ALPHACHANNEL);
couriersud@3023
   177
couriersud@3023
   178
        s->StretchBlit(s, windata->icon, NULL, &dr);
couriersud@3023
   179
    }
couriersud@3023
   180
    windata->wm_needs_redraw = 0;
couriersud@3023
   181
}
couriersud@3023
   182
couriersud@3023
   183
DFBResult
couriersud@3023
   184
DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch)
couriersud@3023
   185
{
couriersud@3023
   186
    SDL_DFB_WINDOWDATA(window);
slouken@7191
   187
    IDirectFBWindow *dfbwin = windata->dfbwin;
couriersud@3023
   188
slouken@5199
   189
    SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, cw, ch));
slouken@5199
   190
    dfbwin->GetSize(dfbwin, cw, ch);
couriersud@3023
   191
    *cw -= windata->theme.left_size + windata->theme.right_size;
couriersud@3023
   192
    *ch -=
couriersud@3023
   193
        windata->theme.top_size + windata->theme.caption_size +
couriersud@3023
   194
        windata->theme.bottom_size;
slouken@4636
   195
    return DFB_OK;
couriersud@3023
   196
}
couriersud@3023
   197
couriersud@3023
   198
void
slouken@4636
   199
DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h)
couriersud@3023
   200
{
couriersud@3023
   201
    SDL_DFB_WINDOWDATA(window);
couriersud@3023
   202
couriersud@3023
   203
    if (!windata->is_managed)
couriersud@3023
   204
        windata->theme = theme_none;
slouken@5199
   205
    else if (flags & SDL_WINDOW_BORDERLESS)
gabomdq@7678
   206
        /* desc.caps |= DWCAPS_NODECORATION;) */
slouken@7191
   207
        windata->theme = theme_none;
slouken@4636
   208
    else if (flags & SDL_WINDOW_FULLSCREEN) {
couriersud@3023
   209
        windata->theme = theme_none;
slouken@4636
   210
    } else if (flags & SDL_WINDOW_MAXIMIZED) {
couriersud@3023
   211
        windata->theme = theme_std;
couriersud@3023
   212
        windata->theme.left_size = 0;
couriersud@3023
   213
        windata->theme.right_size = 0;
couriersud@3023
   214
        windata->theme.top_size = 0;
couriersud@3023
   215
        windata->theme.bottom_size = 0;
couriersud@3023
   216
    } else {
couriersud@3023
   217
        windata->theme = theme_std;
couriersud@3023
   218
    }
couriersud@3023
   219
couriersud@3023
   220
    windata->client.x = windata->theme.left_size;
couriersud@3023
   221
    windata->client.y = windata->theme.top_size + windata->theme.caption_size;
slouken@4636
   222
    windata->client.w = w;
slouken@4636
   223
    windata->client.h = h;
couriersud@3023
   224
    windata->size.w =
slouken@4636
   225
        w + windata->theme.left_size + windata->theme.right_size;
couriersud@3023
   226
    windata->size.h =
slouken@4636
   227
        h + windata->theme.top_size +
couriersud@3023
   228
        windata->theme.caption_size + windata->theme.bottom_size;
couriersud@3023
   229
}
couriersud@3023
   230
couriersud@3023
   231
couriersud@3023
   232
enum
couriersud@3023
   233
{
couriersud@3023
   234
    WM_POS_NONE = 0x00,
couriersud@3023
   235
    WM_POS_CAPTION = 0x01,
couriersud@3023
   236
    WM_POS_CLOSE = 0x02,
couriersud@3023
   237
    WM_POS_MAX = 0x04,
couriersud@3023
   238
    WM_POS_LEFT = 0x08,
couriersud@3023
   239
    WM_POS_RIGHT = 0x10,
couriersud@3023
   240
    WM_POS_TOP = 0x20,
couriersud@3023
   241
    WM_POS_BOTTOM = 0x40,
couriersud@3023
   242
};
couriersud@3023
   243
couriersud@3023
   244
static int
couriersud@3023
   245
WMIsClient(DFB_WindowData * p, int x, int y)
couriersud@3023
   246
{
couriersud@3023
   247
    x -= p->client.x;
couriersud@3023
   248
    y -= p->client.y;
couriersud@3023
   249
    if (x < 0 || y < 0)
couriersud@3023
   250
        return 0;
couriersud@3023
   251
    if (x >= p->client.w || y >= p->client.h)
couriersud@3023
   252
        return 0;
couriersud@3023
   253
    return 1;
couriersud@3023
   254
}
couriersud@3023
   255
couriersud@3023
   256
static int
couriersud@3023
   257
WMPos(DFB_WindowData * p, int x, int y)
couriersud@3023
   258
{
couriersud@3023
   259
    int pos = WM_POS_NONE;
couriersud@3023
   260
couriersud@3023
   261
    if (!WMIsClient(p, x, y)) {
couriersud@3023
   262
        if (y < p->theme.top_size) {
couriersud@3023
   263
            pos |= WM_POS_TOP;
couriersud@3023
   264
        } else if (y < p->client.y) {
couriersud@3023
   265
            if (x <
couriersud@3023
   266
                p->size.w - p->theme.right_size - 2 * p->theme.caption_size) {
couriersud@3023
   267
                pos |= WM_POS_CAPTION;
couriersud@3023
   268
            } else if (x <
couriersud@3023
   269
                       p->size.w - p->theme.right_size -
couriersud@3023
   270
                       p->theme.caption_size) {
couriersud@3023
   271
                pos |= WM_POS_MAX;
couriersud@3023
   272
            } else {
couriersud@3023
   273
                pos |= WM_POS_CLOSE;
couriersud@3023
   274
            }
couriersud@3023
   275
        } else if (y >= p->size.h - p->theme.bottom_size) {
couriersud@3023
   276
            pos |= WM_POS_BOTTOM;
couriersud@3023
   277
        }
couriersud@3023
   278
        if (x < p->theme.left_size) {
couriersud@3023
   279
            pos |= WM_POS_LEFT;
couriersud@3023
   280
        } else if (x >= p->size.w - p->theme.right_size) {
couriersud@3023
   281
            pos |= WM_POS_RIGHT;
couriersud@3023
   282
        }
couriersud@3023
   283
    }
couriersud@3023
   284
    return pos;
couriersud@3023
   285
}
couriersud@3023
   286
couriersud@3023
   287
int
slouken@3040
   288
DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt)
couriersud@3023
   289
{
slouken@4636
   290
    SDL_DFB_DEVICEDATA(_this);
couriersud@3023
   291
    SDL_DFB_WINDOWDATA(window);
slouken@7191
   292
    DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL);
slouken@7191
   293
    IDirectFBWindow *dfbwin = windata->dfbwin;
slouken@5199
   294
    DFBWindowOptions wopts;
couriersud@3023
   295
couriersud@3023
   296
    if (!windata->is_managed)
couriersud@3023
   297
        return 0;
couriersud@3023
   298
slouken@5199
   299
    SDL_DFB_CHECK(dfbwin->GetOptions(dfbwin, &wopts));
slouken@5199
   300
couriersud@3023
   301
    switch (evt->type) {
couriersud@3023
   302
    case DWET_BUTTONDOWN:
couriersud@3023
   303
        if (evt->buttons & DIBM_LEFT) {
couriersud@3023
   304
            int pos = WMPos(windata, evt->x, evt->y);
couriersud@3023
   305
            switch (pos) {
couriersud@3023
   306
            case WM_POS_NONE:
couriersud@3023
   307
                return 0;
couriersud@3023
   308
            case WM_POS_CLOSE:
slouken@7191
   309
                windata->wm_grab = WM_POS_NONE;
slouken@4568
   310
                SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0,
slouken@3040
   311
                                    0);
couriersud@3023
   312
                return 1;
couriersud@3023
   313
            case WM_POS_MAX:
slouken@7191
   314
                windata->wm_grab = WM_POS_NONE;
slouken@7191
   315
                if (window->flags & SDL_WINDOW_MAXIMIZED) {
slouken@7191
   316
                    SDL_RestoreWindow(window);
slouken@7191
   317
                } else {
slouken@7191
   318
                    SDL_MaximizeWindow(window);
slouken@7191
   319
                }
couriersud@3023
   320
                return 1;
slouken@4636
   321
            case WM_POS_CAPTION:
slouken@7191
   322
                if (!(wopts & DWOP_KEEP_STACKING)) {
slouken@7191
   323
                    DirectFB_RaiseWindow(_this, window);
slouken@7191
   324
                }
slouken@7191
   325
                if (window->flags & SDL_WINDOW_MAXIMIZED)
slouken@7191
   326
                    return 1;
slouken@4636
   327
                /* fall through */
couriersud@3023
   328
            default:
slouken@5199
   329
                windata->wm_grab = pos;
slouken@4636
   330
                if (gwindata != NULL)
slouken@7191
   331
                    SDL_DFB_CHECK(gwindata->dfbwin->UngrabPointer(gwindata->dfbwin));
slouken@5199
   332
                SDL_DFB_CHECK(dfbwin->GrabPointer(dfbwin));
slouken@5199
   333
                windata->wm_lastx = evt->cx;
slouken@5199
   334
                windata->wm_lasty = evt->cy;
couriersud@3023
   335
            }
couriersud@3023
   336
        }
couriersud@3023
   337
        return 1;
couriersud@3023
   338
    case DWET_BUTTONUP:
slouken@5199
   339
        if (!windata->wm_grab)
slouken@5199
   340
            return 0;
slouken@5199
   341
        if (!(evt->buttons & DIBM_LEFT)) {
slouken@5199
   342
            if (windata->wm_grab & (WM_POS_RIGHT | WM_POS_BOTTOM)) {
slouken@5199
   343
                int dx = evt->cx - windata->wm_lastx;
slouken@5199
   344
                int dy = evt->cy - windata->wm_lasty;
slouken@5199
   345
slouken@7191
   346
                if (!(wopts & DWOP_KEEP_SIZE)) {
slouken@5199
   347
                    int cw, ch;
slouken@7191
   348
                    if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM)
slouken@7191
   349
                        dx = 0;
slouken@7191
   350
                    else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT)
slouken@7191
   351
                        dy = 0;
slouken@7191
   352
                    SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch));
slouken@5199
   353
gabomdq@7677
   354
                    /* necessary to trigger an event - ugly */
slouken@7191
   355
                    SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL));
slouken@7191
   356
                    SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx + 1, ch + dy));
slouken@7191
   357
                    SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL));
slouken@5199
   358
slouken@7191
   359
                    SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy));
slouken@7191
   360
                }
slouken@5199
   361
            }
slouken@5199
   362
            SDL_DFB_CHECK(dfbwin->UngrabPointer(dfbwin));
slouken@5199
   363
            if (gwindata != NULL)
slouken@5199
   364
                SDL_DFB_CHECK(gwindata->dfbwin->GrabPointer(gwindata->dfbwin));
slouken@5199
   365
            windata->wm_grab = WM_POS_NONE;
slouken@5199
   366
            return 1;
slouken@5199
   367
        }
couriersud@3023
   368
        break;
couriersud@3023
   369
    case DWET_MOTION:
slouken@5199
   370
        if (!windata->wm_grab)
couriersud@3023
   371
            return 0;
couriersud@3023
   372
        if (evt->buttons & DIBM_LEFT) {
slouken@7191
   373
            int dx = evt->cx - windata->wm_lastx;
slouken@5199
   374
            int dy = evt->cy - windata->wm_lasty;
couriersud@3023
   375
slouken@5199
   376
            if (windata->wm_grab & WM_POS_CAPTION) {
slouken@7191
   377
                if (!(wopts & DWOP_KEEP_POSITION))
slouken@7191
   378
                    SDL_DFB_CHECK(dfbwin->Move(dfbwin, dx, dy));
couriersud@3023
   379
            }
slouken@5199
   380
            if (windata->wm_grab & (WM_POS_RIGHT | WM_POS_BOTTOM)) {
slouken@7191
   381
                if (!(wopts & DWOP_KEEP_SIZE)) {
slouken@7191
   382
                    int cw, ch;
slouken@5199
   383
slouken@7191
   384
                    /* Make sure all events are disabled for this operation ! */
slouken@7191
   385
                    SDL_DFB_CHECK(dfbwin->DisableEvents(dfbwin, DWET_ALL));
slouken@5199
   386
slouken@7191
   387
                    if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM)
slouken@7191
   388
                        dx = 0;
slouken@7191
   389
                    else if ((windata->wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT)
slouken@7191
   390
                        dy = 0;
slouken@5199
   391
slouken@7191
   392
                    SDL_DFB_CHECK(dfbwin->GetSize(dfbwin, &cw, &ch));
slouken@7191
   393
                    SDL_DFB_CHECK(dfbwin->Resize(dfbwin, cw + dx, ch + dy));
slouken@5199
   394
slouken@7191
   395
                    SDL_DFB_CHECK(dfbwin->EnableEvents(dfbwin, DWET_ALL));
slouken@7191
   396
                }
slouken@5199
   397
            }
slouken@7191
   398
            windata->wm_lastx = evt->cx;
slouken@7191
   399
            windata->wm_lasty = evt->cy;
slouken@7191
   400
            return 1;
couriersud@3023
   401
        }
couriersud@3023
   402
        break;
couriersud@3023
   403
    case DWET_KEYDOWN:
couriersud@3023
   404
        break;
couriersud@3023
   405
    case DWET_KEYUP:
couriersud@3023
   406
        break;
couriersud@3023
   407
    default:
couriersud@3023
   408
        ;
couriersud@3023
   409
    }
couriersud@3023
   410
    return 0;
couriersud@3023
   411
}
slouken@5199
   412
slouken@6044
   413
#endif /* SDL_VIDEO_DRIVER_DIRECTFB */