Changeset 309 for branches


Ignore:
Timestamp:
Mar 24, 2010, 5:05:57 PM (12 years ago)
Author:
dmik
Message:

branches/kmk: Made Lucide GUI build with kmk/gcc.

Location:
branches/kmk/Lucide
Files:
2 added
35 edited

Legend:

Unmodified
Added
Removed
  • branches/kmk/Lucide/Makefile.kmk

    r306 r309  
    99#
    1010include $(PATH_SUB_CURRENT)/plugins/Makefile.kmk
     11include $(PATH_SUB_CURRENT)/gui/Makefile.kmk
    1112
    1213include $(FILE_KBUILD_SUB_FOOTER)
  • branches/kmk/Lucide/gui/Lucide.rc

    r268 r309  
    11#include "Lucide_res.H"
     2#define INCL_NLS
    23#include <os2.h>
    34
  • branches/kmk/Lucide/gui/UClip.h

    r181 r309  
    44#define __UCLIP_H__
    55
    6 #define INCL_DOS
    7 #include <os2.h>
     6#include "os2.h"
    87
    98#ifndef WIN32API
  • branches/kmk/Lucide/gui/aboutDlg.cpp

    r138 r309  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    3333
    3434
    35 #define INCL_DOS
    36 #define INCL_WIN
    37 #include <os2.h>
     35#include "os2.h"
    3836
    3937#include <stdio.h>
  • branches/kmk/Lucide/gui/clipbrd.cpp

    r218 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #define INCL_DOS
    37 #include <os2.h>
     35#include "os2.h"
    3836
    3937#include <uconv.h>
     
    139137            UniUconvToUcs( objtouni, (void **)&text, &len, &tmpuni, &unilen, &cSubs );
    140138            unilen = UniStrlen( (UniChar *)shmemuni );
    141             void *memuni = (void *)new char[ olen ];
     139            char *memuni = new char[ olen ];
    142140            memcpy( memuni, shmemuni, olen );
    143141
  • branches/kmk/Lucide/gui/docInfoDlg.cpp

    r138 r309  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include <string>
  • branches/kmk/Lucide/gui/docViewer.cpp

    r285 r309  
    3333
    3434
    35 #define INCL_DOS
    36 #define INCL_WIN
    37 #define INCL_GPI
    38 #include <os2.h>
     35#include "os2.h"
    3936
    4037#include <string>
     38#include <algorithm>
    4139#include <process.h>
    4240#include <stdio.h>
     
    256254            pagesizes[i].y = tmp;
    257255        }
    258         fullwidth = __max( fullwidth, pagesizes[i].x );
     256        fullwidth = std::max( fullwidth, pagesizes[i].x );
    259257        fullheight += ( pagesizes[i].y + VERT_SPACE );
    260258    }
     
    596594        fullheight = 0;
    597595        for ( long i = 0; i < totalpages; i++ ) {
    598             fullwidth = __max( fullwidth, pagesizes[i].x );
     596            fullwidth = std::max( fullwidth, pagesizes[i].x );
    599597            fullheight += pagesizes[i].y;
    600598        }
     
    604602        }
    605603        else if ( zoom == -2 ) { // fit page
    606             realzoom = __min( (double)cxClient / width, (double)cyClient / height );
     604            realzoom = std::min( (double)cxClient / width, (double)cyClient / height );
    607605        }
    608606        else {
     
    651649    {
    652650        case SB_LINEUP:
    653             sVscrollInc = -(__max( LINE_HEIGHT, VScrollStep ));
     651            sVscrollInc = -(std::max( LINE_HEIGHT, (int)VScrollStep ));
    654652            break ;
    655653        case SB_LINEDOWN:
    656             sVscrollInc = __max( LINE_HEIGHT, VScrollStep );
     654            sVscrollInc = std::max( LINE_HEIGHT, (int)VScrollStep );
    657655            break;
    658656        case SB_PAGEUP:
    659             sVscrollInc = __min( -1, -( cyClient - LINE_HEIGHT ) );
     657            sVscrollInc = std::min( -1, -( (int)cyClient - LINE_HEIGHT ) );
    660658            break;
    661659        case SB_PAGEDOWN:
    662             sVscrollInc = __max( 1, cyClient - LINE_HEIGHT );
     660            sVscrollInc = std::max( 1, (int)cyClient - LINE_HEIGHT );
    663661            break;
    664662        case SB_SLIDERTRACK:
     
    672670
    673671    if ( SHORT2FROMMP( mp2 ) != SB_PAGEDRAG ) {
    674         sVscrollInc = __max( -sVscrollPos * VScrollStep, __min( sVscrollInc,
    675                               ( sVscrollMax - sVscrollPos ) * VScrollStep ) );
     672        sVscrollInc = std::max( -sVscrollPos * (LONG)VScrollStep, std::min( sVscrollInc,
     673                              ( sVscrollMax - sVscrollPos ) * (LONG)VScrollStep ) );
    676674        sVscrollInc = ( sVscrollInc / VScrollStep ) * VScrollStep;
    677675    }
     
    706704            break;
    707705        case SB_PAGELEFT:
    708             sHscrollInc = __min( -1, -( cxClient - LINE_HEIGHT ) );
     706            sHscrollInc = std::min( -1, -( (int)cxClient - LINE_HEIGHT ) );
    709707            break;
    710708        case SB_PAGERIGHT:
    711             sHscrollInc = __max( 1, cxClient - LINE_HEIGHT );
     709            sHscrollInc = std::max( 1, (int)cxClient - LINE_HEIGHT );
    712710            break;
    713711        case SB_SLIDERTRACK:
     
    720718    }
    721719
    722     sHscrollInc = __max( -sHscrollPos, __min( sHscrollInc, sHscrollMax - sHscrollPos ) );
     720    sHscrollInc = std::max( -(LONG)sHscrollPos, std::min( sHscrollInc, (LONG)(sHscrollMax - sHscrollPos) ) );
    723721
    724722    if ( sHscrollInc != 0 )
     
    770768    else
    771769    {
    772         sHscrollMax = (SHORT)__max( 0, ( isContinuous() ? fullwidth : width ) - cxClient );
    773         sHscrollPos = __min( sHscrollPos, sHscrollMax );
     770        sHscrollMax = (SHORT)std::max( 0., ( isContinuous() ? fullwidth : width ) - cxClient );
     771        sHscrollPos = std::min( sHscrollPos, sHscrollMax );
    774772
    775773        WinSendMsg( hWndHscroll, SBM_SETSCROLLBAR,
     
    782780        if ( isContinuous() )
    783781        {
    784             realVscrollMax = __max( 0, fullheight - cyClient );
     782            realVscrollMax = std::max( 0., fullheight - cyClient );
    785783            ULONG ssize = realVscrollMax / VScrollStep;
    786784            while ( ssize > 32000 ) {
     
    795793        }
    796794        else {
    797             realVscrollMax = sVscrollMax = (SHORT)__max( 0, height - cyClient );
    798         }
    799         sVscrollPos = __min( sVscrollPos, sVscrollMax );
     795            realVscrollMax = sVscrollMax = (SHORT)std::max( 0., height - cyClient );
     796        }
     797        sVscrollPos = std::min( sVscrollPos, sVscrollMax );
    800798
    801799        WinSendMsg( hWndVscroll, SBM_SETSCROLLBAR,
     
    896894                       pda->startpos.x, pda->startpos.y, rclx, rcly, _this->realzoom,
    897895                       _this->rotation, _this->pixbuf,
    898                        asynchCallbackFnDraw, asynchCallbackFnAbort, p,
     896                       (LuDocument_asynchCallbackFn)asynchCallbackFnDraw,
     897                       (LuDocument_asynchCallbackFn)asynchCallbackFnAbort, p,
    899898                       &renderErrorCode, &renderError );
    900899                delete _this->pixbuf;
     
    15751574
    15761575    if ( ( xpos < 0 ) && ( sHscrollPos > 0 ) ) {
    1577         xinc = __max( sHscrollPos * -1, xpos );
     1576        xinc = std::max( (SHORT)( -sHscrollPos ), (SHORT)xpos );
    15781577    } else if ( ( xpos > cxClient ) && ( sHscrollPos < sHscrollMax ) ) {
    1579         xinc = __min( sHscrollMax - sHscrollPos, xpos - cxClient );
     1578        xinc = std::min( (SHORT)( sHscrollMax - sHscrollPos ), (SHORT)( xpos - cxClient ) );
    15801579    }
    15811580    if ( ( ypos < 0 ) && ( sVscrollPos < sVscrollMax ) ) {
    1582         yinc = __min( ( sVscrollMax - sVscrollPos ) * VScrollStep, ypos * -1 );
     1581        yinc = std::min( (SHORT)( ( sVscrollMax - sVscrollPos ) * VScrollStep ), (SHORT)( -ypos ) );
    15831582    }
    15841583    else if ( ( ypos > cyClient ) && ( sVscrollPos > 0 ) ) {
    1585         yinc = __max( ( sVscrollPos * -1 ) * VScrollStep, cyClient - ypos );
     1584        yinc = std::max( (SHORT)( ( -sVscrollPos ) * VScrollStep ), (SHORT)( cyClient - ypos ) );
    15861585    }
    15871586
     
    17201719            docDraggingEnd.x = xpos;
    17211720            docDraggingEnd.y = ypos;
    1722  
     1721
    17231722            SHORT hMove = docDraggingEnd.x - docDraggingStart.x;
    17241723            if ( abs( hMove ) > 5 )
  • branches/kmk/Lucide/gui/findDlg.cpp

    r185 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include <stdio.h>
  • branches/kmk/Lucide/gui/fontsInfoDlg.cpp

    r138 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include <process.h>
  • branches/kmk/Lucide/gui/indexWindow.cpp

    r211 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include <stdio.h>
     
    283282            }
    284283            break;
    285            
     284
    286285        case WM_FOCUSCHANGE:
    287286            if ( SHORT1FROMMP( mp2 ) ) {
  • branches/kmk/Lucide/gui/intern.cpp

    r136 r309  
    3333
    3434
    35 #define INCL_DOS
    36 #define INCL_WIN
    37 #include <os2.h>
     35#include "os2.h"
    3836
    3937#include <fstream>
     
    4644#include <string.h>
    4745#include <io.h>
     46#if !defined(__WATCOM__)
     47#include <unistd.h>
     48#endif
    4849
    4950#include "globals.h"
     
    144145    char drive[ _MAX_DRIVE ];
    145146    char dir[ _MAX_DIR ];
     147#if defined(__WATCOM__)
    146148    _splitpath( __argv[0], drive, dir, NULL, NULL );
     149#else
     150    _execname( appdir, sizeof(appdir) );
     151    _splitpath( appdir, drive, dir, NULL, NULL );
     152#endif
    147153    _makepath( appdir, drive, dir, NULL, NULL );
    148154
     
    216222
    217223    SHORT id, len;
    218     SHORT cnt = (SHORT)WinSendMsg( hmenu, MM_QUERYITEMCOUNT, MPVOID, MPVOID );
     224    SHORT cnt = SHORT1FROMMR( WinSendMsg( hmenu, MM_QUERYITEMCOUNT, MPVOID, MPVOID ) );
    219225    for ( SHORT i = 0; i < cnt; i++ )
    220226    {
    221         id = (SHORT)WinSendMsg( hmenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT( i ), MPVOID );
    222 
    223         len = (SHORT)WinSendMsg( hmenu, MM_QUERYITEMTEXT, MPFROM2SHORT( id, mtext.getSize() ),
    224                                  MPFROMP( mtext.buffer ) );
     227        id = SHORT1FROMMR( WinSendMsg( hmenu, MM_ITEMIDFROMPOSITION, MPFROMSHORT( i ), MPVOID ) );
     228
     229        len = SHORT1FROMMR( WinSendMsg( hmenu, MM_QUERYITEMTEXT, MPFROM2SHORT( id, mtext.getSize() ),
     230                                        MPFROMP( mtext.buffer ) ) );
    225231
    226232        if ( len > 0 )
  • branches/kmk/Lucide/gui/lcd.c

    r190 r309  
    3333
    3434
    35 #define INCL_DOS
    36 #define INCL_WIN
    37 #include <os2.h>
     35#include "os2.h"
    3836
    3937#include <stdio.h>
  • branches/kmk/Lucide/gui/lcdfdlg.cpp

    r238 r309  
    1 #define INCL_DOS
    2 #define INCL_WIN
    3 #define INCL_GPI
    4 #include <os2.h>
     1#include "os2.h"
    52
    63#include <string.h>
     
    1916static char *szAllSupportedTypes = NULL;
    2017
    21 void previewFile( HWND hwnd, const char *fn );
     18static void previewFile( HWND hwnd, const char *fn );
    2219
    2320struct previewData
  • branches/kmk/Lucide/gui/linklab.c

    r127 r309  
    66 */
    77
    8 #define INCL_WIN
    9 #define INCL_GPI
    10 #include <os2.h>
     8#include "os2.h"
    119
    1210#include <string.h>
  • branches/kmk/Lucide/gui/lucide.cpp

    r267 r309  
    1 /* ***** BEGIN LICENSE BLOCK *****
     1/* ***** BEGIN47 LICENSE BLOCK *****
    22 * Version: CDDL 1.0/LGPL 2.1
    33 *
     
    3333
    3434
    35 #define INCL_WIN
    36 #define INCL_DOS
    3735#define INCL_SPL
    3836#define INCL_SPLDOSPRINT
    39 #define INCL_DEV
    40 #include <os2.h>
     37#include "os2.h"
    4138
    4239#include <string>
     
    4542#include <stdlib.h>
    4643#include <process.h>
     44#if defined(__WATCOM__)
    4745#include <dos.h>
     46#define find_t_name(find_t) find_t.name
     47#else
     48#include <unistd.h>
     49#include <emx/syscalls.h>
     50typedef _find find_t;
     51#define find_t_name(find_t) find_t.szName
     52#define _dos_findfirst __findfirst
     53#define _dos_findnext __findnext
     54#define _dos_findclose(a) do {} while(0)
     55#endif
    4856
    4957#include <ludoc.xh>
     
    121129char        *Lucide::loadError                     = NULL;
    122130long         Lucide::loadErrorCode                 = LU_LDERR_NO_ERROR;
    123 void        *Lucide::thumbnailData                 = NULL;
     131char        *Lucide::thumbnailData                 = NULL;
    124132int          Lucide::thumbnailDataLen              = 0;
    125133
     
    367375void Lucide::closeDocument()
    368376{
    369     if ( doc != NULL ) {   
     377    if ( doc != NULL ) {
    370378        docViewer->close();
    371379        delete doc;
     
    560568        strcat( buf, mask );
    561569
    562         struct find_t ffblk;
     570        find_t ffblk;
    563571        unsigned done = _dos_findfirst( buf, _A_RDONLY | _A_NORMAL, &ffblk );
    564572        while ( done == 0 )
    565573        {
    566             fileList.insert( ffblk.name );
     574            fileList.insert( find_t_name( ffblk ) );
    567575            done = _dos_findnext( &ffblk );
    568576        }
     
    825833    }
    826834
     835#if defined(__WATCOM__)
     836    const char *execname = __argv[0];
     837#else
     838    char execname[ _MAX_PATH ];
     839    _execname( execname, sizeof(execname) );
     840#endif
     841
    827842    PROGDETAILS pd;
    828843    pd.Length                      = sizeof( PROGDETAILS );
     
    830845    pd.progt.fbVisible             = SHE_VISIBLE;
    831846    pd.pszTitle                    = NULL;
    832     pd.pszExecutable               = __argv[0];
     847    pd.pszExecutable               = execname;
    833848    pd.pszParameters               = NULL;
    834849    pd.pszStartupDir               = NULL;
     
    965980                    Lucide::saveDocumentAs();
    966981                    return (MRESULT)FALSE;
    967                    
     982
    968983                case CM_CLOSE:
    969984                    Lucide::closeDocument();
     
    11641179int deffontlen = sizeof( deffont );
    11651180
    1166 extern "C" APIRET APIENTRY LucideMain( int argc, char *argv[] )
     1181__declspec(dllexport) _System APIRET APIENTRY LucideMain( int argc, char *argv[] )
    11671182{
    11681183    HMQ   hmq;
  • branches/kmk/Lucide/gui/lucide.h

    r286 r309  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    3939
    4040// debug support
     41#ifdef USE_PMPRINT
    4142#ifdef __TEST__
    4243#define   _PMPRINTF_
    4344#endif
    4445#include  "PMPRINTF.H"
     46#endif
    4547
    4648class LuDocument;
     
    6567{
    6668    private:
    67    
     69
    6870        static ProgressDlg *loadProgressDlg;
    6971        static char docFullName[ CCHMAXPATH ];
     
    7678        static bool isFullscreen;
    7779        static LuWindowPos winPos;
    78    
     80
    7981        static void setOfPages( long pages );
    8082        static void enableZoomMenus();
     
    8385        static void readMask( const char *mask );
    8486        static void loadFileList();
    85        
    86         static void *thumbnailData;
     87
     88        static char *thumbnailData;
    8789        static int thumbnailDataLen;
    8890
     
    9395        static bool showIndex;
    9496        static ActiveWindow activeWindow;
    95        
     97
    9698        static void newWindow( char *file, bool addDir );
    9799        static void openDocument();
  • branches/kmk/Lucide/gui/lucidethumbs.cpp

    r260 r309  
    3232 * ***** END LICENSE BLOCK ***** */
    3333
    34 // interferes with os2medef.h
    35 #undef VERSION
    36 
    37 #define INCL_DOS
    38 #define INCL_MMIOOS2
    39 #define INCL_GPI
    40 #include <os2.h>
    41 #include <os2me.h>
    42 #include <fourcc.h>
     34
     35#include "os2.h"
     36#include <mmioos2.h>
    4337
    4438#include <stdlib.h>
     
    4640#include <io.h>
    4741#include <fcntl.h>
     42#include <algorithm>
    4843
    4944#include <ludoc.xh>
     
    300295    double width = 0, height = 0;
    301296    doc->getPageSize( ev, 0, &width, &height );
    302     double zoom = __min( (double)LUTHUMB_SIZE_X / width, (double)LUTHUMB_SIZE_Y / height );
     297    double zoom = std::min( (double)LUTHUMB_SIZE_X / width, (double)LUTHUMB_SIZE_Y / height );
    303298    short bpp = doc->getBpp( ev );
    304299
  • branches/kmk/Lucide/gui/lusettings.cpp

    r50 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include <stdlib.h>
  • branches/kmk/Lucide/gui/luutils.cpp

    r153 r309  
    3333
    3434
    35 #define INCL_DOS
    36 #define INCL_WIN
    37 #define INCL_GPI
    38 #include <os2.h>
     35#include "os2.h"
    3936
    4037#include <time.h>
    4138#include <stdio.h>
    4239#include <string.h>
    43 #include <strstrea.h>
    4440#include <stdlib.h>
    4541#include <string>
    4642
     43#if defined(__WATCOM__)
     44#include <strstrea.h>
     45#else
     46#include <sstream>
     47#include <algorithm>
     48#endif
     49
    4750#include "luutils.h"
    4851#include "messages.h"
    4952
    50 bool initCountryInfo();
     53static bool initCountryInfo();
    5154
    5255static COUNTRYINFO CtryInfo;
     
    199202    }
    200203
    201     if ( pIniName == NULL ) { // ¯šè¥¬ ¢ user profile
     204    if ( pIniName == NULL ) { // ᅵᅵ襬 ï¿œ user profile
    202205        hini = HINI_USER;
    203206    }
     
    311314
    312315
     316#if defined(__WATCOM__)
    313317static void end_zeros_trim( char *s )
    314318{
     
    324328    }
    325329}
     330#endif
    326331
    327332std::string str( double n )
    328333{
     334#if defined(__WATCOM__)
    329335    char *pt;
    330336    char buf[ 60 ];
     
    337343
    338344    return buf;
     345#else
     346    std::basic_ostringstream< char > o;
     347    o.flags( std::ios::dec | std::ios::showpoint | std::ios::fixed );
     348    o << n;
     349    std::string ret = o.str();
     350    std::string::iterator it = ret.end();
     351    while ( it != ret.begin() && *--it == '0' )
     352        it = ret.erase(it);
     353    if ( *it == '.')
     354        ret.erase(it);
     355    return ret;
     356#endif
    339357}
    340358
     
    439457{
    440458    struct tm tmbuf = { 0 };
     459#if defined(__WATCOM__)
    441460    _localtime( &time, &tmbuf );
     461#else
     462    time_t t = time;
     463    localtime_r(&t, &tmbuf );
     464#endif
    442465    char datbuf[ 16 ] = "";
    443466    char timbuf[ 16 ] = "";
     
    483506    delete actsizetext;
    484507
    485     return __max( actsizelen, __max( fitwindlen, fitwidthlen ) );
     508    return std::max( actsizelen, std::max( fitwindlen, fitwidthlen ) );
    486509}
    487510
  • branches/kmk/Lucide/gui/luutils.h

    r153 r309  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    3636#define __LUUTILS_H
    3737
     38#include <string>
    3839
    3940// Auto-free buffer
     
    4142{
    4243        protected:
    43                 unsigned int size; 
     44                unsigned int size;
    4445        public:
    4546                char *buffer;
     
    8283void getLocalizedString( const char *key, LONG maxLen, char *buf );
    8384char *newstrdupL( const char *key );
    84 #ifdef _STRING_INCLUDED
    8585std::string getLocalizedString( const char *t );
    8686std::string str( double n );
    8787std::string time2string( unsigned long time );
    88 #endif
    8988
    9089extern "C" int startBrowser( const char *url );
  • branches/kmk/Lucide/gui/passwordDlg.cpp

    r177 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include "globals.h"
  • branches/kmk/Lucide/gui/pipemon.cpp

    r242 r309  
    3333
    3434
    35 #define INCL_DOS
    36 #define INCL_WIN
    37 #include <os2.h>
     35#include "os2.h"
    3836
    3937#include <string.h>
    4038#include <process.h>
     39#include <stdlib.h>
    4140
    4241#include "Lucide_res.h"
  • branches/kmk/Lucide/gui/pluginViewDlg.cpp

    r138 r309  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include "globals.h"
  • branches/kmk/Lucide/gui/pluginman.cpp

    r238 r309  
    3333
    3434
    35 #define INCL_DOS
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include "pluginman.h"
    3938#include "luutils.h"
     39#if defined(__WATCOM__)
    4040#include <dos.h>
     41#elif defined(__EMX__)
     42#include <unistd.h>
     43#include <emx/syscalls.h>
     44typedef _find find_t;
     45#define find_t_name(find_t) find_t.szName
     46#define _dos_findfirst __findfirst
     47#define _dos_findnext __findnext
     48#define _dos_findclose(a) do {} while(0)
     49#endif
    4150#include <fcntl.h>
    4251#include <stdio.h>
     
    5362    char drive[ _MAX_DRIVE ];
    5463    char dir[ _MAX_DIR ];
     64#if defined(__WATCOM__)
    5565    _splitpath( __argv[0], drive, dir, NULL, NULL );
     66#else
     67    _execname( buffer, sizeof(buffer) );
     68    _splitpath( buffer, drive, dir, NULL, NULL );
     69#endif
    5670    _makepath( path, drive, dir, NULL, NULL );
    5771    strcpy( buffer, path );
     
    6074    // enum plugins, (LU*.DLL) except for LUDOC.DLL, which is 'null' plugin
    6175    // and Lucide.dll, which is not a plugin.
    62     struct find_t ffblk;
     76    find_t ffblk;
    6377    unsigned done = _dos_findfirst( buffer, _A_RDONLY | _A_NORMAL, &ffblk );
    6478    while ( done == 0 )
    6579    {
    66         if ( ( stricmp( ffblk.name, "LUDOC.DLL" ) != 0 ) &&
    67              ( stricmp( ffblk.name, "LUCIDE.DLL" ) != 0 ) )
     80        if ( ( stricmp( find_t_name( ffblk ), "LUDOC.DLL" ) != 0 ) &&
     81             ( stricmp( find_t_name( ffblk ), "LUCIDE.DLL" ) != 0 ) )
    6882        {
    69             loadPlugin( path, ffblk.name );
     83            loadPlugin( path, find_t_name( ffblk ) );
    7084        }
    7185        done = _dos_findnext( &ffblk );
     
    198212{
    199213    lseek( h, signature->offset, ( signature->origin == 0 ) ? SEEK_SET : SEEK_END );
    200     unsigned char *buf = new char[ signature->length ];
     214    char *buf = new char[ signature->length ];
    201215    read( h, buf, signature->length );
    202216    bool result = ( memcmp( signature->data, buf, signature->length ) == 0 );
  • branches/kmk/Lucide/gui/pmsplitter.cpp

    r35 r309  
    66 */
    77
    8 #define INCL_WIN
    9 #define INCL_GPI
    10 #include <os2.h>
     8#include "os2.h"
    119
    1210#include "tb_spl.h"
  • branches/kmk/Lucide/gui/pmtoolbar.cpp

    r88 r309  
    66 */
    77
    8 #define INCL_WIN
    9 #define INCL_GPI
    10 #define INCL_DOS
    11 #include <os2.h>
     8#include "os2.h"
    129
    1310#include <string.h>
     
    826823    {
    827824        tws->mshowed = TRUE;
    828         SHORT id = (SHORT)WinSendMsg( ti->hmenu, MM_ITEMIDFROMPOSITION,
    829                                       MPFROMSHORT( 0 ), MPVOID );
     825        USHORT id = SHORT1FROMMR( WinSendMsg( ti->hmenu, MM_ITEMIDFROMPOSITION,
     826                                              MPFROMSHORT( 0 ), MPVOID ) );
    830827        WinPopupMenu( hwnd, WinQueryWindow( hwnd, QW_PARENT ),
    831828                      ti->hmenu, ptl.x, ptl.y, id,
     
    862859
    863860        case TBM_QUERYCHECK:
    864             return (MRESULT)tws->queryCheck( (SHORT)mp1 );
     861            return (MRESULT)tws->queryCheck( SHORT1FROMMP( mp1 ) );
    865862
    866863        case TBM_SETCHECK:
    867             tws->setCheck( (SHORT)mp1, (BOOL)mp2 );
     864            tws->setCheck( SHORT1FROMMP( mp1 ), (BOOL)mp2 );
    868865            WinInvalidateRect( hwnd, NULL, TRUE );
    869866            return (MRESULT)(TRUE);
    870867
    871868        case TBM_ENABLEITEM:
    872             tws->enableItem( (SHORT)mp1, (BOOL)mp2 );
     869            tws->enableItem( SHORT1FROMMP( mp1 ), (BOOL)mp2 );
    873870            WinInvalidateRect( hwnd, NULL, TRUE );
    874871            return (MRESULT)(TRUE);
    875872
    876873        case TBM_SETBUBBLETEXT:
    877             tws->setBubbleText( (SHORT)mp1, (PCSZ)mp2 );
     874            tws->setBubbleText( SHORT1FROMMP( mp1 ), (PCSZ)mp2 );
    878875            return (MRESULT)(TRUE);
    879876
  • branches/kmk/Lucide/gui/print.cpp

    r265 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #define INCL_GPI
    37 #define INCL_DOS
    38 #define INCL_DEV
    39 #define INCL_ERRORS
    4035#define INCL_SPL
    4136#define INCL_SPLDOSPRINT
    42 #include <os2.h>
     37#include "os2.h"
    4338
    4439#include <ludoc.xh>
     
    4843#include <stdio.h>
    4944#include <io.h>
     45#include <algorithm>
    5046
    5147#include "globals.h"
     
    253249    {
    254250        double maxcoeff = psetup->higherQuality ? HIGH_IMAGE_ZOOM : STD_IMAGE_ZOOM;
    255         zoom = __min( (double)pwidth / w, (double)pheight / h );
     251        zoom = std::min( (double)pwidth / w, (double)pheight / h );
    256252        if ( zoom > maxcoeff ) {
    257253            zoom = maxcoeff;
     
    265261    w *= zoom;
    266262    h *= zoom;
    267     double pgzoom = __min( (double)pwidth / w, (double)pheight / h );
     263    double pgzoom = std::min( (double)pwidth / w, (double)pheight / h );
    268264
    269265    // Printed size
  • branches/kmk/Lucide/gui/printDlg.cpp

    r265 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #define INCL_DEV
    37 #define INCL_ERRORS
    3835#define INCL_SPL
    3936#define INCL_SPLDOSPRINT
    40 #include <os2.h>
     37#include "os2.h"
    4138
    4239#include <string>
     
    590587                    if ( SHORT2FROMMP(mp1) == CBN_LBSELECT )
    591588                    {
    592                         SHORT rc = (SHORT)WinSendDlgItemMsg( hwnd, IDC_PNAME, LM_QUERYSELECTION,
    593                                                              MPFROMSHORT( LIT_CURSOR ), MPVOID );
     589                        SHORT rc = SHORT1FROMMR( WinSendDlgItemMsg( hwnd, IDC_PNAME, LM_QUERYSELECTION,
     590                                                                   MPFROMSHORT( LIT_CURSOR ), MPVOID ) );
    594591                        if ( rc != LIT_NONE ) {
    595592                            MRESULT r = WinSendDlgItemMsg( hwnd, IDC_PNAME, LM_QUERYITEMHANDLE,
     
    727724                        if ( _this->psetup->ptype == TypeAsImage )
    728725                        {
    729                             SHORT rc = (SHORT)WinSendDlgItemMsg( hwnd, IDC_RANGE_EVEN_ODD, LM_QUERYSELECTION,
    730                                                              MPFROMSHORT( LIT_CURSOR ), MPVOID );
     726                            SHORT rc = SHORT1FROMMR( WinSendDlgItemMsg( hwnd, IDC_RANGE_EVEN_ODD, LM_QUERYSELECTION,
     727                                                                        MPFROMSHORT( LIT_CURSOR ), MPVOID ) );
    731728                            if ( rc != LIT_NONE ) {
    732729                                MRESULT r = WinSendDlgItemMsg( hwnd, IDC_RANGE_EVEN_ODD, LM_QUERYITEMHANDLE,
  • branches/kmk/Lucide/gui/progressDlg.cpp

    r138 r309  
    3333
    3434
    35 #define INCL_GPI
    36 #define INCL_WIN
    37 #include <os2.h>
     35#include "os2.h"
    3836
    3937#include <process.h>
     
    142140            _this->pOldBarProc = WinSubclassWindow( hBar, progressBarProc );
    143141            WinStartTimer( hBarHab, hBar, TID_PAINT, 1 );
    144            
     142
    145143            _beginthread( _this->threadFn, NULL, 262144, _this->threadData );
    146144
  • branches/kmk/Lucide/gui/recent.cpp

    r229 r309  
    3232 * ***** END LICENSE BLOCK ***** */
    3333
    34 #define INCL_WIN
    35 #include <os2.h>
     34
     35#include "os2.h"
    3636
    3737#include <vector>
  • branches/kmk/Lucide/gui/recent.h

    r229 r309  
    3838#define RECENT_SIZE     9
    3939
    40 class std::vector<std::string>;
     40#include <vector>
    4141
    4242class RecentFiles
     
    5757        void clear();
    5858        std::string getFile( USHORT cmd );
    59        
     59
    6060        void load();
    6161        void save();
  • branches/kmk/Lucide/gui/settingsDlg.cpp

    r138 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include <string>
     
    132131                case DID_OK:
    133132                    {
    134                         SHORT rc = (SHORT)WinSendDlgItemMsg( hwnd, IDC_DEFPGLAYOUT, LM_QUERYSELECTION,
    135                                                 MPFROMSHORT( LIT_CURSOR ), MPVOID );
     133                        SHORT rc = SHORT1FROMMR( WinSendDlgItemMsg( hwnd, IDC_DEFPGLAYOUT, LM_QUERYSELECTION,
     134                                                                    MPFROMSHORT( LIT_CURSOR ), MPVOID ) );
    136135                        if ( rc != LIT_NONE )
    137136                        {
     
    143142                        }
    144143
    145                         rc = (SHORT)WinSendDlgItemMsg( hwnd, IDC_DEFZOOM, LM_QUERYSELECTION,
    146                                                 MPFROMSHORT( LIT_CURSOR ), MPVOID );
     144                        rc = SHORT1FROMMR( WinSendDlgItemMsg( hwnd, IDC_DEFZOOM, LM_QUERYSELECTION,
     145                                                              MPFROMSHORT( LIT_CURSOR ), MPVOID ) );
    147146                        if ( rc != LIT_NONE )
    148147                        {
  • branches/kmk/Lucide/gui/stbrowser.c

    r127 r309  
    66 */
    77
    8 #define INCL_DOS
    9 #define INCL_WIN
    10 #include <os2.h>
     8#include "os2.h"
    119
    1210#include <string.h>
     
    2220{
    2321    PROGDETAILS pd;
    24     HAPP happ = NULL;
     22    HAPP happ = NULLHANDLE;
    2523
    2624    if ( url == NULL ) {
     
    5553    pd.swpInitial.ulReserved2      = 0;
    5654    happ = WinStartApp( NULLHANDLE, &pd, url, NULL, 0 );
    57     return ( happ != NULL );
     55    return ( happ != NULLHANDLE );
    5856}
    5957
  • branches/kmk/Lucide/gui/toolbar.cpp

    r138 r309  
    3333
    3434
    35 #define INCL_WIN
    36 #include <os2.h>
     35#include "os2.h"
    3736
    3837#include <stdio.h>
     
    4039#include <string>
    4140
    42 #include <tb_spl.h>
     41#include "tb_spl.h"
    4342
    4443#include "lucide.h"
     
    9089                    if ( !shortValueOk )
    9190                    {
    92                         SHORT rc = (SHORT)WinSendDlgItemMsg( hwnd, TBID_ZOOM, LM_QUERYSELECTION,
    93                                                 MPFROMSHORT( LIT_CURSOR ), MPVOID );
     91                        SHORT rc = SHORT1FROMMR( WinSendDlgItemMsg( hwnd, TBID_ZOOM, LM_QUERYSELECTION,
     92                                                                    MPFROMSHORT( LIT_CURSOR ), MPVOID ) );
    9493                        if ( rc != LIT_NONE )
    9594                        {
  • branches/kmk/Lucide/gui/wwbtn.c

    r35 r309  
    77 */
    88
    9 #define INCL_WIN
    10 #define INCL_GPI
    11 #include <os2.h>
     9#include "os2.h"
    1210
    1311#include <stdio.h>
Note: See TracChangeset for help on using the changeset viewer.