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