Changeset 181


Ignore:
Timestamp:
Jan 16, 2007, 7:13:31 PM (15 years ago)
Author:
Eugene Romanenko
Message:

Use UClip library from Yuri Dario for clipboard operations

Location:
trunk/Lucide/SOURCE/gui
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/clipbrd.cpp

    r175 r181  
    4545#include "cpconv.h"
    4646
    47 
    48 #define kUnicodeMimeMozilla "text/unicode"
    49 #define kUnicodeMimeOdin    "Odin32 UnicodeText"
    50 
    51 inline ULONG RegisterClipboardFormat(PCSZ pcszFormat)
    52 {
    53     ATOM atom = WinFindAtom(WinQuerySystemAtomTable(), pcszFormat);
    54     if (!atom) {
    55         atom = WinAddAtom(WinQuerySystemAtomTable(), pcszFormat);
    56     }
    57     return atom;
    58 }
    59 
    60 void initClipbrd()
    61 {
    62     RegisterClipboardFormat( kUnicodeMimeMozilla );
    63     RegisterClipboardFormat( kUnicodeMimeOdin );
    64 }
     47#include "UClip.h"
    6548
    6649
     
    9073    size_t olen = 0;
    9174
    92     if ( WinOpenClipbrd( hab ) )
     75    if ( UWinOpenClipbrd( hab ) )
    9376    {
    94         WinEmptyClipbrd( hab );
     77        UWinEmptyClipbrd( hab );
    9578
    9679        size_t cSubs = 0;
     
    11194            memcpy( memuni, shmemuni, olen );
    11295
    113             ULONG ulFormatID = RegisterClipboardFormat( kUnicodeMimeOdin );
    114             WinSetClipbrdData( hab, (ULONG)shmemuni, ulFormatID, CFI_POINTER );
    115 
    116             // place to clipboard as unicode for Mozilla
    117             if ( DosAllocSharedMem( &shmemuni, NULL, olen, fALLOCSHR ) == 0 )
    118             {
    119                 memcpy( shmemuni, memuni, olen );
    120                 ulFormatID = RegisterClipboardFormat( kUnicodeMimeMozilla );
    121                 WinSetClipbrdData( hab, (ULONG)shmemuni, ulFormatID, CFI_POINTER );
    122             }
     96            UWinSetClipbrdData( hab, (ULONG)shmemuni, UCLIP_CF_UNICODETEXT, CFI_POINTER );
    12397
    12498            int liglen = uniLigaturesLength( (UniChar *)memuni );
     
    144118                UniUconvFromUcs( objtosys, &tmpuni, &unilen, &tmpsys, &olen, &cSubs );
    145119
    146                 WinSetClipbrdData( hab, (ULONG)shmemsys, CF_TEXT, CFI_POINTER );
     120                UWinSetClipbrdData( hab, (ULONG)shmemsys, UCLIP_CF_TEXT, CFI_POINTER );
    147121            }
    148122            delete memuni;
    149123        }
    150124
    151         WinCloseClipbrd( hab );
     125        UWinCloseClipbrd( hab );
    152126    }
    153127
  • trunk/Lucide/SOURCE/gui/makefile

    r179 r181  
    7878lib libconv
    7979lib libuls
     80lib UClip
    8081export LucideMain
    8182| tmpmake.lnk >NUL
Note: See TracChangeset for help on using the changeset viewer.