~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to intern/ghost/intern/GHOST_SystemWin32.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: GHOST_SystemWin32.cpp 14444 2008-04-16 22:40:48Z hos $
 
2
 * $Id: GHOST_SystemWin32.cpp 16448 2008-09-09 21:15:30Z ben2610 $
3
3
 * ***** BEGIN GPL LICENSE BLOCK *****
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
28
28
 
29
29
/**
30
30
 
31
 
 * $Id: GHOST_SystemWin32.cpp 14444 2008-04-16 22:40:48Z hos $
 
31
 * $Id: GHOST_SystemWin32.cpp 16448 2008-09-09 21:15:30Z ben2610 $
32
32
 * Copyright (C) 2001 NaN Technologies B.V.
33
33
 * @author      Maarten Gribnau
34
34
 * @date        May 7, 2001
42
42
 
43
43
#include "GHOST_SystemWin32.h"
44
44
 
 
45
// win64 doesn't define GWL_USERDATA
 
46
#ifdef WIN32
 
47
#ifndef GWL_USERDATA
 
48
#define GWL_USERDATA GWLP_USERDATA
 
49
#define GWL_WNDPROC GWLP_WNDPROC
 
50
#endif
 
51
#endif
 
52
 
45
53
/*
46
54
 * According to the docs the mouse wheel message is supported from windows 98 
47
55
 * upwards. Leaving WINVER at default value, the WM_MOUSEWHEEL message and the 
161
169
        const STR_String& title, 
162
170
        GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
163
171
        GHOST_TWindowState state, GHOST_TDrawingContextType type,
164
 
        bool stereoVisual)
 
172
        bool stereoVisual, const GHOST_TEmbedderWindowID parentWindow )
165
173
{
166
174
        GHOST_Window* window = 0;
167
175
        window = new GHOST_WindowWin32 (title, left, top, width, height, state, type, stereoVisual);
302
310
{
303
311
        GHOST_TSuccess success = GHOST_System::init();
304
312
 
 
313
        /* Disable scaling on high DPI displays on Vista */
 
314
        HMODULE user32 = ::LoadLibraryA("user32.dll");
 
315
        typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)();
 
316
        LPFNSETPROCESSDPIAWARE SetProcessDPIAware =
 
317
                (LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, "SetProcessDPIAware");
 
318
        if (SetProcessDPIAware)
 
319
                SetProcessDPIAware();
 
320
        FreeLibrary(user32);
 
321
 
305
322
        // Determine whether this system has a high frequency performance counter. */
306
323
        m_hasPerformanceCounter = ::QueryPerformanceFrequency((LARGE_INTEGER*)&m_freq) == TRUE;
307
324
        if (m_hasPerformanceCounter) {
900
917
        char *buffer;
901
918
        char *temp_buff;
902
919
        
903
 
        if ( OpenClipboard(NULL) ) {
 
920
        if ( IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL) ) {
904
921
                HANDLE hData = GetClipboardData( CF_TEXT );
 
922
                if (hData == NULL) {
 
923
                        CloseClipboard();
 
924
                        return NULL;
 
925
                }
905
926
                buffer = (char*)GlobalLock( hData );
906
927
                
907
928
                temp_buff = (char*) malloc(strlen(buffer)+1);