src/video/directfb/SDL_DirectFB_WM.c
author Sam Lantinga
Sat, 05 Feb 2011 16:07:10 -0800
changeset 5199 164f20ba08eb
parent 4636 b196d2758026
child 5262 b530ef003506
permissions -rw-r--r--
Updated the DirectFB support, from Couriersud

attached is a working directfb driver diff which works with the current
changes. There are a number of changes around it as well, e.g.
configure.in.

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