Changeset 50
- Timestamp:
- Jun 11, 2006, 4:12:09 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Lucide/BIN/Lucide.lng
r48 r50 21 21 MENU_FIND=Find...\tCtrl+F 22 22 MENU_FINDAGAIN=Find again\tCtrl+G 23 MENU_SETTINGS=Settings 23 24 MENU_DOCUMENT=~Document 24 25 MENU_FIRST_PAGE=First page … … 64 65 MSGS_NO_SUIT_PLUG=Can't find suitable plugin for specified document! 65 66 MSGS_FILE_LOAD_ERROR=File load error! 67 MSGS_LOADING_DOCUMENT=Loading document, please wait... 66 68 67 69 # … … 126 128 AD_COPYRIGHTS=(c) by Eugene Romanenko, netlabs.org in co-operation with Serenity Systems International 127 129 AD_OK=OK 130 131 # 132 # Settings dialog 133 # 134 SD_SETTINGS=Settings 135 SD_DEFAULT_PAGE_LAYOUT=Default Page Layout: 136 SD_DEFAULT_ZOOM=Default Zoom: 137 SD_OK=~OK 138 SD_CANCEL=~Cancel -
trunk/Lucide/SOURCE/gui/Lucide.rc
r44 r50 40 40 MENUITEM "MENU_FIND", CM_FIND 41 41 MENUITEM "MENU_FINDAGAIN", CM_FINDAGAIN 42 MENUITEM SEPARATOR 43 MENUITEM "MENU_SETTINGS", CM_SETTINGS 42 44 END 43 45 -
trunk/Lucide/SOURCE/gui/Lucide_res.H
r35 r50 67 67 #define CM_FIND 203 68 68 #define CM_FINDAGAIN 204 69 #define CM_SETTINGS 205 69 70 70 71 #define CM_FIRSTPAGE 301 … … 116 117 #define IDC_NETLABSURL 12 117 118 119 #define IDD_SETTINGS 1006 120 #define IDC_DEFPGLAYOUT 10 121 #define IDC_DEFZOOM 11 122 118 123 #endif // __LUCIDE_RES_H -
trunk/Lucide/SOURCE/gui/dialogs.rc
r31 r50 91 91 92 92 END 93 94 DLGTEMPLATE IDD_SETTINGS 95 BEGIN 96 DIALOG "SD_SETTINGS", -1, 60, 94, 207, 71, WS_VISIBLE, FCF_SYSMENU | FCF_TITLEBAR 97 BEGIN 98 CONTROL "", -1, 2, 24, 203, 45, WC_STATIC, SS_GROUPBOX | DT_LEFT | DT_TOP | WS_VISIBLE | WS_GROUP 99 CONTROL "SD_DEFAULT_PAGE_LAYOUT", -1, 9, 48, 76, 14, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP 100 PRESPARAMS PP_FONTNAMESIZE "9.WarpSans" 101 CONTROL "", IDC_DEFPGLAYOUT, 88, 20, 111, 40, WC_COMBOBOX, CBS_DROPDOWNLIST | ES_ANY | WS_VISIBLE | WS_GROUP | WS_TABSTOP 102 PRESPARAMS PP_FONTNAMESIZE "9.WarpSans" 103 CONTROL "SD_DEFAULT_ZOOM", -1, 9, 28, 77, 14, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP 104 PRESPARAMS PP_FONTNAMESIZE "9.WarpSans" 105 CONTROL "", IDC_DEFZOOM, 88, -3, 111, 43, WC_COMBOBOX, CBS_DROPDOWNLIST | ES_ANY | WS_VISIBLE | WS_GROUP | WS_TABSTOP 106 PRESPARAMS PP_FONTNAMESIZE "9.WarpSans" 107 DEFPUSHBUTTON "SD_OK", DID_OK, 91, 4, 51, 14 108 PRESPARAMS PP_FONTNAMESIZE "9.WarpSans" 109 PUSHBUTTON "SD_CANCEL", DID_CANCEL, 152, 4, 51, 14 110 PRESPARAMS PP_FONTNAMESIZE "9.WarpSans" 111 END 112 END 113 -
trunk/Lucide/SOURCE/gui/docViewer.cpp
r40 r50 58 58 } 59 59 60 ULONG APIENTRY GPFHandler( PEXCEPTIONREPORTRECORD pxcptrec, 61 PEXCEPTIONREGISTRATIONRECORD prr, 62 PCONTEXTRECORD pcr, PVOID pv ); 63 64 60 65 typedef LuDocument_LuRectSequence *PLuRectSequence; 61 66 typedef LuDocument_LuLinkMapSequence *PLuLinkMapSequence; … … 96 101 drawareas = NULL; 97 102 drawareaIndex = 0; 103 closed = true; 98 104 // continuous view 99 105 continuous = false; … … 181 187 if ( doc != NULL ) 182 188 { 189 closed = false; 190 183 191 totalpages = doc->getPageCount( ev ); 184 192 bpp = doc->getBpp( ev ); 193 if ( !doc->isScalable( ev ) ) { 194 zoom = 1; 195 } 185 196 186 197 pagesizes = new LuSize[ totalpages ]; … … 205 216 enableAsynchDraw = doc->isAsynchRenderingSupported( ev ); 206 217 goToPage( 0 ); 218 219 if ( continuous ) { 220 drawPage(); 221 } 207 222 } 208 223 } … … 212 227 void DocumentViewer::close() 213 228 { 229 if ( closed ) { 230 return; 231 } 232 233 closed = true; 214 234 abortAsynch = true; 215 235 DosRequestMutexSem( todrawAccess, SEM_INDEFINITE_WAIT ); … … 236 256 doc = NULL; 237 257 totalpages = 0; 238 zoom = 1;239 258 currentpage = 0; 240 259 fullwidth = 0; … … 244 263 } 245 264 246 // sets the view mode247 void DocumentViewer::set ViewMode( ViewMode mode)248 { 249 continuous = ( mode== Continuous );265 // sets the page layout 266 void DocumentViewer::setPageLayout( PgLayout layout ) 267 { 268 continuous = ( layout == Continuous ); 250 269 if ( doc != NULL ) { 251 270 long pg = currentpage; … … 294 313 double pgpos = pagenumToPos( page ) / VScrollStep; 295 314 vertScroll( hWndDoc, MPFROM2SHORT( pgpos, SB_SLIDERPOSITION ), NULLHANDLE ); 296 //drawPage();297 315 } 298 316 else … … 755 773 } 756 774 } 757 758 775 WinDestroyMsgQueue( thmq ); 759 776 WinTerminate( thab ); … … 767 784 RECTL rcl; 768 785 HPS hps = WinBeginPaint( hwnd, 0L, &rcl ); 769 if ( hps != NULLHANDLE ) 770 { 771 RECTL rclWin = { 0 }; 772 WinQueryWindowRect( hwnd, &rclWin ); 773 if ( WinEqualRect( hab, &rcl, &rclWin ) ) { 774 GpiErase( hps ); 775 } 776 WinEndPaint( hps ); 777 } 778 779 RECTL rclPage = { 0, 0, width, height }; 780 if ( height < cyClient ) 781 { 782 rclPage.yBottom = cyClient - height; 783 rclPage.yTop = cyClient; 784 } 785 RECTL rclDraw = { 0 }; 786 if ( WinIntersectRect( hab, &rclDraw, &rcl, &rclPage ) ) 787 { 788 if ( ( drawareas != NULL ) && ( drawareas->size() > 0 ) ) { 789 if ( isSubrect( &((*drawareas)[0].drawrect), &rclDraw ) && 790 ( sVscrollInc == 0 ) && ( sHscrollInc == 0 ) ) { 791 return; 792 } 786 RECTL rclWin = { 0 }; 787 WinQueryWindowRect( hwnd, &rclWin ); 788 if ( WinEqualRect( hab, &rcl, &rclWin ) ) { 789 GpiErase( hps ); 790 } 791 WinEndPaint( hps ); 792 793 if ( doc != NULL ) 794 { 795 RECTL rclPage = { 0, 0, width, height }; 796 if ( height < cyClient ) 797 { 798 rclPage.yBottom = cyClient - height; 799 rclPage.yTop = cyClient; 800 } 801 RECTL rclDraw = { 0 }; 802 if ( WinIntersectRect( hab, &rclDraw, &rcl, &rclPage ) ) 803 { 804 if ( ( drawareas != NULL ) && ( drawareas->size() > 0 ) ) { 805 if ( isSubrect( &((*drawareas)[0].drawrect), &rclDraw ) && 806 ( sVscrollInc == 0 ) && ( sHscrollInc == 0 ) ) { 807 return; 808 } 809 } 810 811 abortAsynch = true; 812 DosRequestMutexSem( todrawAccess, SEM_INDEFINITE_WAIT ); 813 814 if ( drawareas == NULL ) { 815 drawareas = new DrawAreas; 816 } 817 if ( drawareas->size() == 0 ) { 818 PageDrawArea pda; 819 memset( &pda, 0, sizeof( pda ) ); 820 pda.pagenum = currentpage; 821 drawareas->push_back( pda ); 822 } 823 824 PageDrawArea *ppda = &((*drawareas)[0]); 825 826 if ( !WinIsRectEmpty( hab, &ppda->drawrect ) ) 827 { 828 if ( sVscrollInc > 0 ) { 829 ppda->drawrect.yTop += sVscrollInc; 830 } else if ( sVscrollInc < 0 ) { 831 ppda->drawrect.yBottom += sVscrollInc; 832 } 833 if ( sHscrollInc > 0 ) { 834 ppda->drawrect.xLeft -= sHscrollInc; 835 } else if ( sHscrollInc < 0 ) { 836 ppda->drawrect.xRight -= sHscrollInc; 837 } 838 } 839 WinUnionRect( hab, &ppda->drawrect, &ppda->drawrect, &rclDraw ); 840 ppda->startpos.x = sHscrollPos + ppda->drawrect.xLeft; 841 ppda->startpos.y = ( cyClient - ppda->drawrect.yTop ) + sVscrollPos; 842 843 // workaround ? 844 ppda->drawrect.xRight++; 845 ppda->drawrect.yTop++; 846 847 DosReleaseMutexSem( todrawAccess ); 848 DosPostEventSem( haveDraw ); 849 } 850 } 851 } 852 853 854 // handles WM_PAINT if continuous asynchronous rendering used 855 void DocumentViewer::wmPaintContAsynch( HWND hwnd ) 856 { 857 RECTL rcl, rclWin, rclDraw = { 0 }; 858 HPS hps = WinBeginPaint( hwnd, 0L, &rcl ); 859 GpiErase( hpsBuffer ); 860 BlitGraphicsBuffer( hps, hpsBuffer, &rcl ); 861 WinEndPaint( hps ); 862 863 if ( doc != NULL ) 864 { 865 if ( isSubrect( &savedRcl, &rcl ) && ( sVscrollInc == 0 ) && ( sHscrollInc == 0 ) ) { 866 return; 793 867 } 794 868 … … 796 870 DosRequestMutexSem( todrawAccess, SEM_INDEFINITE_WAIT ); 797 871 798 if ( drawareas == NULL ) { 799 drawareas = new DrawAreas; 800 } 801 if ( drawareas->size() == 0 ) { 802 PageDrawArea pda; 803 memset( &pda, 0, sizeof( pda ) ); 804 pda.pagenum = currentpage; 805 drawareas->push_back( pda ); 806 } 807 808 PageDrawArea *ppda = &((*drawareas)[0]); 809 810 if ( !WinIsRectEmpty( hab, &ppda->drawrect ) ) 811 { 812 if ( sVscrollInc > 0 ) { 813 ppda->drawrect.yTop += sVscrollInc; 814 } else if ( sVscrollInc < 0 ) { 815 ppda->drawrect.yBottom += sVscrollInc; 816 } 817 if ( sHscrollInc > 0 ) { 818 ppda->drawrect.xLeft -= sHscrollInc; 819 } else if ( sHscrollInc < 0 ) { 820 ppda->drawrect.xRight -= sHscrollInc; 821 } 822 } 823 WinUnionRect( hab, &ppda->drawrect, &ppda->drawrect, &rclDraw ); 824 ppda->startpos.x = sHscrollPos + ppda->drawrect.xLeft; 825 ppda->startpos.y = ( cyClient - ppda->drawrect.yTop ) + sVscrollPos; 826 827 // workaround ? 828 ppda->drawrect.xRight++; 829 ppda->drawrect.yTop++; 830 872 WinQueryWindowRect( hwnd, &rclWin ); 873 WinUnionRect( hab, &rcl, &rcl, &savedRcl ); 874 875 if ( sVscrollInc > 0 ) { 876 rcl.yTop += sVscrollInc; 877 } else if ( sVscrollInc < 0 ) { 878 rcl.yBottom += sVscrollInc; 879 } 880 if ( sHscrollInc > 0 ) { 881 rcl.xLeft -= sHscrollInc; 882 } else if ( sHscrollInc < 0 ) { 883 rcl.xRight -= sHscrollInc; 884 } 885 886 WinIntersectRect( hab, &rclDraw, &rcl, &rclWin ); 887 WinCopyRect( hab, &rcl, &rclDraw ); 888 WinCopyRect( hab, &savedRcl, &rcl ); 889 890 delete drawareas; 891 drawareas = findDrawAreas( &rcl ); 892 893 for ( int i = 0; i < drawareas->size(); i++ ) 894 { 895 PageDrawArea *pda = &(*drawareas)[ i ]; 896 897 // load links for page if not loaded before 898 if ( links[ pda->pagenum ] == NULL ) { 899 links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum ); 900 } 901 } 831 902 DosReleaseMutexSem( todrawAccess ); 832 903 DosPostEventSem( haveDraw ); 833 } 834 } 835 836 837 // handles WM_PAINT if continuous asynchronous rendering used 838 void DocumentViewer::wmPaintContAsynch( HWND hwnd ) 839 { 840 RECTL rcl, rclWin, rclDraw = { 0 }; 841 HPS hps = WinBeginPaint( hwnd, 0L, &rcl ); 842 if ( hps != NULLHANDLE ) { 843 GpiErase( hpsBuffer ); 844 BlitGraphicsBuffer( hps, hpsBuffer, &rcl ); 845 WinEndPaint( hps ); 846 } 847 848 if ( isSubrect( &savedRcl, &rcl ) && ( sVscrollInc == 0 ) && ( sHscrollInc == 0 ) ) { 849 return; 850 } 851 852 abortAsynch = true; 853 DosRequestMutexSem( todrawAccess, SEM_INDEFINITE_WAIT ); 854 855 WinQueryWindowRect( hwnd, &rclWin ); 856 WinUnionRect( hab, &rcl, &rcl, &savedRcl ); 857 858 if ( sVscrollInc > 0 ) { 859 rcl.yTop += sVscrollInc; 860 } else if ( sVscrollInc < 0 ) { 861 rcl.yBottom += sVscrollInc; 862 } 863 if ( sHscrollInc > 0 ) { 864 rcl.xLeft -= sHscrollInc; 865 } else if ( sHscrollInc < 0 ) { 866 rcl.xRight -= sHscrollInc; 867 } 868 869 WinIntersectRect( hab, &rclDraw, &rcl, &rclWin ); 870 WinCopyRect( hab, &rcl, &rclDraw ); 871 WinCopyRect( hab, &savedRcl, &rcl ); 872 873 delete drawareas; 874 drawareas = findDrawAreas( &rcl ); 875 876 for ( int i = 0; i < drawareas->size(); i++ ) 877 { 878 PageDrawArea *pda = &(*drawareas)[ i ]; 879 880 // load links for page if not loaded before 881 if ( links[ pda->pagenum ] == NULL ) { 882 links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum ); 883 } 884 } 885 DosReleaseMutexSem( todrawAccess ); 886 DosPostEventSem( haveDraw ); 887 888 determineCurrentPage(); 904 905 determineCurrentPage(); 906 } 889 907 } 890 908 … … 897 915 GpiErase( hpsBuffer ); 898 916 899 RECTL rclPage = { 0, 0, width, height }; 900 if ( height < cyClient ) 901 { 902 rclPage.yBottom = cyClient - height; 903 rclPage.yTop = cyClient; 904 } 905 RECTL rclDraw = { 0 }; 906 if ( WinIntersectRect( hab, &rclDraw, &rcl, &rclPage ) ) 907 { 908 spos_x = sHscrollPos + rclDraw.xLeft; 909 spos_y = (cyClient - rclDraw.yTop) + sVscrollPos; 910 LONG rclx = rclDraw.xRight - rclDraw.xLeft; 911 LONG rcly = rclDraw.yTop - rclDraw.yBottom; 912 913 pixbuf = new LuPixbuf( ev, rclx, rcly, bpp ); 914 POINTL aptlPoints[4]={ rclDraw.xLeft, rclDraw.yBottom, 915 rclDraw.xRight-1, rclDraw.yTop-1, 916 0, 0, rclx, rcly }; 917 918 doc->renderPageToPixbuf( ev, currentpage, spos_x, spos_y, 919 rclx, rcly, realzoom, 0, pixbuf ); 920 LONG lRop = ROP_SRCCOPY; 921 BITMAPINFO2 pbmi; 922 pbmi.cbFix = 16L; 923 pbmi.cx = rclx; 924 pbmi.cy = rcly; 925 pbmi.cPlanes = 1; 926 pbmi.cBitCount = bpp * 8; 927 GpiDrawBits( hpsBuffer, pixbuf->getDataPtr( ev ), &pbmi, 4L, 928 aptlPoints, lRop, BBO_IGNORE ); 929 930 drawSelection( currentpage, hpsBuffer, &rclDraw ); 931 drawFound( currentpage, hpsBuffer, &rclDraw ); 932 917 if ( doc != NULL ) 918 { 919 RECTL rclPage = { 0, 0, width, height }; 920 if ( height < cyClient ) 921 { 922 rclPage.yBottom = cyClient - height; 923 rclPage.yTop = cyClient; 924 } 925 RECTL rclDraw = { 0 }; 926 if ( WinIntersectRect( hab, &rclDraw, &rcl, &rclPage ) ) 927 { 928 spos_x = sHscrollPos + rclDraw.xLeft; 929 spos_y = (cyClient - rclDraw.yTop) + sVscrollPos; 930 LONG rclx = rclDraw.xRight - rclDraw.xLeft; 931 LONG rcly = rclDraw.yTop - rclDraw.yBottom; 932 933 pixbuf = new LuPixbuf( ev, rclx, rcly, bpp ); 934 POINTL aptlPoints[4]={ rclDraw.xLeft, rclDraw.yBottom, 935 rclDraw.xRight-1, rclDraw.yTop-1, 936 0, 0, rclx, rcly }; 937 938 doc->renderPageToPixbuf( ev, currentpage, spos_x, spos_y, 939 rclx, rcly, realzoom, 0, pixbuf ); 940 LONG lRop = ROP_SRCCOPY; 941 BITMAPINFO2 pbmi; 942 pbmi.cbFix = 16L; 943 pbmi.cx = rclx; 944 pbmi.cy = rcly; 945 pbmi.cPlanes = 1; 946 pbmi.cBitCount = bpp * 8; 947 GpiDrawBits( hpsBuffer, pixbuf->getDataPtr( ev ), &pbmi, 4L, 948 aptlPoints, lRop, BBO_IGNORE ); 949 950 drawSelection( currentpage, hpsBuffer, &rclDraw ); 951 drawFound( currentpage, hpsBuffer, &rclDraw ); 952 953 BlitGraphicsBuffer( hps, hpsBuffer, &rcl ); 954 delete pixbuf; 955 pixbuf = NULL; 956 } 957 } 958 else { 933 959 BlitGraphicsBuffer( hps, hpsBuffer, &rcl ); 934 delete pixbuf; 935 pixbuf = NULL; 936 } 937 960 } 938 961 WinEndPaint( hps ); 939 962 } … … 1038 1061 GpiErase( hpsBuffer ); 1039 1062 1040 delete drawareas; 1041 drawareas = findDrawAreas( &rcl ); 1042 1043 for ( int i = 0; i < drawareas->size(); i++ ) 1044 { 1045 PageDrawArea *pda = &(*drawareas)[ i ]; 1046 1047 // load links for page if not loaded before 1048 if ( links[ pda->pagenum ] == NULL ) { 1049 links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum ); 1050 } 1051 1052 spos_x = pda->startpos.x; 1053 //spos_y = ( cyClient - pda->drawrect.yTop ) + ( sVscrollPos * VScrollStep ); 1054 spos_y = pda->startpos.y; 1055 LONG rclx = pda->drawrect.xRight - pda->drawrect.xLeft; 1056 LONG rcly = pda->drawrect.yTop - pda->drawrect.yBottom; 1057 1058 pixbuf = new LuPixbuf( ev, rclx, rcly, bpp ); 1059 POINTL aptlPoints[4]={ pda->drawrect.xLeft, pda->drawrect.yBottom, 1060 pda->drawrect.xRight-1, pda->drawrect.yTop-1, 1061 0, 0, rclx, rcly }; 1062 1063 doc->renderPageToPixbuf( ev, pda->pagenum, spos_x, spos_y, 1064 rclx, rcly, realzoom, 0, pixbuf ); 1065 LONG lRop = ROP_SRCCOPY; 1066 BITMAPINFO2 pbmi; 1067 pbmi.cbFix = 16L; 1068 pbmi.cx = rclx; 1069 pbmi.cy = rcly; 1070 pbmi.cPlanes = 1; 1071 pbmi.cBitCount = bpp * 8; 1072 GpiDrawBits( hpsBuffer, pixbuf->getDataPtr( ev ), &pbmi, 4L, 1073 aptlPoints, lRop, BBO_IGNORE ); 1074 1075 drawSelection( pda->pagenum, hpsBuffer, &pda->drawrect ); 1076 drawFound( pda->pagenum, hpsBuffer, &pda->drawrect ); 1077 1078 delete pixbuf; 1079 pixbuf = NULL; 1080 } 1081 delete drawareas; 1082 drawareas = NULL; 1063 if ( doc != NULL ) 1064 { 1065 delete drawareas; 1066 drawareas = findDrawAreas( &rcl ); 1067 1068 for ( int i = 0; i < drawareas->size(); i++ ) 1069 { 1070 PageDrawArea *pda = &(*drawareas)[ i ]; 1071 1072 // load links for page if not loaded before 1073 if ( links[ pda->pagenum ] == NULL ) { 1074 links[ pda->pagenum ] = doc->getLinkMapping( ev, pda->pagenum ); 1075 } 1076 1077 spos_x = pda->startpos.x; 1078 //spos_y = ( cyClient - pda->drawrect.yTop ) + ( sVscrollPos * VScrollStep ); 1079 spos_y = pda->startpos.y; 1080 LONG rclx = pda->drawrect.xRight - pda->drawrect.xLeft; 1081 LONG rcly = pda->drawrect.yTop - pda->drawrect.yBottom; 1082 1083 pixbuf = new LuPixbuf( ev, rclx, rcly, bpp ); 1084 POINTL aptlPoints[4]={ pda->drawrect.xLeft, pda->drawrect.yBottom, 1085 pda->drawrect.xRight-1, pda->drawrect.yTop-1, 1086 0, 0, rclx, rcly }; 1087 1088 doc->renderPageToPixbuf( ev, pda->pagenum, spos_x, spos_y, 1089 rclx, rcly, realzoom, 0, pixbuf ); 1090 LONG lRop = ROP_SRCCOPY; 1091 BITMAPINFO2 pbmi; 1092 pbmi.cbFix = 16L; 1093 pbmi.cx = rclx; 1094 pbmi.cy = rcly; 1095 pbmi.cPlanes = 1; 1096 pbmi.cBitCount = bpp * 8; 1097 GpiDrawBits( hpsBuffer, pixbuf->getDataPtr( ev ), &pbmi, 4L, 1098 aptlPoints, lRop, BBO_IGNORE ); 1099 1100 drawSelection( pda->pagenum, hpsBuffer, &pda->drawrect ); 1101 drawFound( pda->pagenum, hpsBuffer, &pda->drawrect ); 1102 1103 delete pixbuf; 1104 pixbuf = NULL; 1105 } 1106 delete drawareas; 1107 drawareas = NULL; 1108 } 1083 1109 BlitGraphicsBuffer( hps, hpsBuffer, &rcl ); 1084 1110 WinEndPaint( hps ); 1085 1111 1086 determineCurrentPage(); 1112 if ( doc != NULL ) { 1113 determineCurrentPage(); 1114 } 1087 1115 } 1088 1116 -
trunk/Lucide/SOURCE/gui/docViewer.h
r40 r50 60 60 virtual ~DocumentViewer(); 61 61 62 void set ViewMode( ViewMode mode);62 void setPageLayout( PgLayout layout ); 63 63 64 64 HWND getHWND() { return hWndDocFrame; } … … 147 147 DrawAreas *drawareas; 148 148 int drawareaIndex; 149 bool closed; 149 150 150 151 // continuous view -
trunk/Lucide/SOURCE/gui/lucide.cpp
r40 r50 50 50 #include "findDlg.h" 51 51 #include "progressDlg.h" 52 #include "settingsDlg.h" 52 53 #include "docViewer.h" 53 54 #include "indexWindow.h" 55 #include "lusettings.h" 54 56 #include "luutils.h" 55 57 #include "tb_spl.h" … … 67 69 const char *showind = "ShowIndex"; 68 70 71 ULONG APIENTRY GPFHandler( PEXCEPTIONREPORTRECORD pxcptrec, 72 PEXCEPTIONREGISTRATIONRECORD prr, 73 PCONTEXTRECORD pcr, PVOID pv ); 69 74 70 75 HWND createToolbar( HWND hwnd ); … … 86 91 IndexWindow *indexWin = NULL; 87 92 FindDlg *findDlg = NULL; 93 LuSettings *settings = NULL; 88 94 char *title = NULL; 89 95 … … 291 297 } 292 298 293 void Lucide::set ViewMode( ViewMode mode)294 { 295 if ( mode== SinglePage )299 void Lucide::setPageLayout( PgLayout layout ) 300 { 301 if ( layout == SinglePage ) 296 302 { 297 303 WinSendMsg( hWndMenu, MM_SETITEMATTR, … … 312 318 } 313 319 314 docViewer->set ViewMode( mode);320 docViewer->setPageLayout( layout ); 315 321 } 316 322 … … 371 377 loadError = NULL; 372 378 373 #if 0 379 // Load document asynchronously 374 380 loadProgressDlg = new ProgressDlg( hWndFrame ); 375 loadProgressDlg->setText( "Loading document, please wait..." ); 381 char *ldmsg = newstrdupL( MSGS_LOADING_DOCUMENT ); 382 loadProgressDlg->setText( ldmsg ); 383 delete ldmsg; 376 384 loadProgressDlg->show( loadthread, NULL ); // doc will be loaded 377 385 delete loadProgressDlg; 378 #else379 docLoaded = doc->loadFile( ev, docName, NULL, &loadError );380 #endif381 386 382 387 if ( docLoaded ) 383 388 { 384 389 char *t = new char[ 2048 ]; 385 char _fn[ _MAX_ NAME ];390 char _fn[ _MAX_FNAME ]; 386 391 char _ex[ _MAX_EXT ]; 387 392 _splitpath( fn, NULL, NULL, _fn, _ex ); 388 strcpy( t, _fn ); 389 strcat( t, _ex ); 390 strcat( t, " - " ); 391 strcat( t, title ); 393 snprintf( t, 2048, "%s%s - %s", _fn, _ex, title ); 392 394 WinSetWindowText( hWndFrame, t ); 393 395 delete t; … … 602 604 return (MRESULT)FALSE; 603 605 606 case CM_SETTINGS: 607 { 608 SettingsDlg *d = new SettingsDlg( hWndFrame, settings ); 609 d->doDialog(); 610 return (MRESULT)FALSE; 611 } 612 604 613 case CM_FIRSTPAGE: 605 614 Lucide::goToPage( 0 ); … … 631 640 632 641 case CM_SINGLEPAGE: 633 Lucide::set ViewMode( SinglePage );642 Lucide::setPageLayout( SinglePage ); 634 643 return (MRESULT)FALSE; 635 644 636 645 case CM_CONTINUOUS: 637 Lucide::set ViewMode( Continuous );646 Lucide::setPageLayout( Continuous ); 638 647 return (MRESULT)FALSE; 639 648 … … 681 690 682 691 loadLang(); 692 693 settings = new LuSettings; 694 settings->load(); 683 695 684 696 pluginMan = new PluginManager; … … 737 749 findDlg = new FindDlg( hWndFrame ); 738 750 Lucide::checkMenus(); 751 Lucide::setPageLayout( settings->layout ); 752 Lucide::setZoom( settings->zoom ); 739 753 740 754 // ®ª § âì ®ª® ¯à®£à ¬¬ë … … 767 781 768 782 WinDestroyWindow( hWndFrame ); 769 WinDestroyMsgQueue( hmq );770 WinTerminate( hab );771 783 772 784 delete docViewer; … … 779 791 delete findDlg; 780 792 delete title; 781 793 delete settings; 794 795 WinDestroyMsgQueue( hmq ); 796 WinTerminate( hab ); 782 797 return 0; 783 798 } -
trunk/Lucide/SOURCE/gui/lucide.h
r35 r50 45 45 class ProgressDlg; 46 46 47 enum ViewMode { SinglePage, Continuous};47 enum PgLayout { SinglePage = 0, Continuous = 1 }; 48 48 49 49 struct LuWindowPos … … 89 89 static void setZoom( double zoom ); 90 90 static void enableCopy( bool enable ); 91 static void set ViewMode( ViewMode mode);91 static void setPageLayout( PgLayout layout ); 92 92 static void toggleFullscreen(); 93 93 }; -
trunk/Lucide/SOURCE/gui/luutils.cpp
r35 r50 45 45 46 46 #include "luutils.h" 47 #include "messages.h" 47 48 48 49 bool initCountryInfo(); … … 441 442 } 442 443 444 void setZoomValues( HWND lbox ) 445 { 446 std::string actsizetext = getLocalizedString( TBHINT_ACTUAL_SIZE ); 447 WinSetWindowText( lbox, actsizetext.c_str() ); 448 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), 449 MPFROMP( actsizetext.c_str() ) ); 450 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), 451 MPFROMP( getLocalizedString( TBHINT_FIT_WINDOW ).c_str() ) ); 452 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), 453 MPFROMP( getLocalizedString( TBHINT_FIT_WIDTH ).c_str() ) ); 454 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "12.5%" ) ); 455 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "25%" ) ); 456 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "50%" ) ); 457 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "100%" ) ); 458 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "125%" ) ); 459 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "150%" ) ); 460 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "200%" ) ); 461 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "300%" ) ); 462 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "400%" ) ); 463 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "800%" ) ); 464 WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "1600%" ) ); 465 } 466 467 double convZoom( SHORT v ) 468 { 469 double z = -3; 470 switch ( v ) 471 { 472 case 0: z = 1; break; 473 case 1: z = -2; break; 474 case 2: z = -1; break; 475 case 3: z = 0.125; break; 476 case 4: z = 0.25; break; 477 case 5: z = 0.5; break; 478 case 6: z = 1; break; 479 case 7: z = 1.25; break; 480 case 8: z = 1.5; break; 481 case 9: z = 2; break; 482 case 10: z = 3; break; 483 case 11: z = 4; break; 484 case 12: z = 8; break; 485 case 13: z = 16; break; 486 } 487 return z; 488 } -
trunk/Lucide/SOURCE/gui/luutils.h
r35 r50 66 66 void textToClipbrd( HAB hab, const char *text ); 67 67 void centerWindow( HWND parent, HWND hwnd ); 68 void setZoomValues( HWND lbox ); 69 double convZoom( SHORT v ); 68 70 #endif 69 71 -
trunk/Lucide/SOURCE/gui/makefile
r30 r50 2 2 3 3 TEST=0 4 VERSION=Beta 1 4 VERSION=Beta 1.1 5 5 6 6 !if $(TEST)==1 … … 36 36 linklab.obj wwbtn.obj intern.obj messages.obj indexWindow.obj \ 37 37 fontsInfoDlg.obj docInfoDlg.obj findDlg.obj progressDlg.obj \ 38 aboutDlg.obj 38 aboutDlg.obj settingsDlg.obj lusettings.obj 39 39 40 40 Lucide.exe: $(OBJS) Lucide.res … … 57 57 file $(OBJDIR)\progressDlg.obj 58 58 file $(OBJDIR)\aboutDlg.obj 59 file $(OBJDIR)\settingsDlg.obj 60 file $(OBJDIR)\lusettings.obj 59 61 file $(OBJDIR)\docViewer.obj 60 62 file $(OBJDIR)\indexWindow.obj … … 91 93 progressDlg.obj: progressDlg.cpp 92 94 aboutDlg.obj: aboutDlg.cpp 95 settingsDlg.obj: settingsDlg.cpp 96 lusettings.obj: lusettings.cpp 93 97 docViewer.obj: docViewer.cpp 94 98 indexWindow.obj: indexWindow.cpp -
trunk/Lucide/SOURCE/gui/messages.cpp
r35 r50 36 36 37 37 38 // Some menu item, which used not only in menu 39 const char *MENU_SINGLE_PAGE = "MENU_SINGLE_PAGE"; 40 const char *MENU_CONTINUOUS = "MENU_CONTINUOUS"; 41 42 38 43 // Toolbar hints 39 44 const char *TBHINT_OPEN = "TBHINT_OPEN"; … … 53 58 54 59 // Lucide messages 55 const char *MSGS_MAIN_WIN_TITLE = "MSGS_MAIN_WIN_TITLE"; 56 const char *MSGS_NO_SUIT_PLUG = "MSGS_NO_SUIT_PLUG"; 57 const char *MSGS_FILE_LOAD_ERROR = "MSGS_FILE_LOAD_ERROR"; 60 const char *MSGS_MAIN_WIN_TITLE = "MSGS_MAIN_WIN_TITLE"; 61 const char *MSGS_NO_SUIT_PLUG = "MSGS_NO_SUIT_PLUG"; 62 const char *MSGS_FILE_LOAD_ERROR = "MSGS_FILE_LOAD_ERROR"; 63 const char *MSGS_LOADING_DOCUMENT = "MSGS_LOADING_DOCUMENT"; 58 64 59 65 // Plugins List columns titles -
trunk/Lucide/SOURCE/gui/messages.h
r35 r50 37 37 38 38 39 // Some menu item, which used not only in menu 40 extern const char *MENU_SINGLE_PAGE; 41 extern const char *MENU_CONTINUOUS; 42 39 43 // Toolbar hints 40 44 extern const char *TBHINT_OPEN; … … 56 60 extern const char *MSGS_NO_SUIT_PLUG; 57 61 extern const char *MSGS_FILE_LOAD_ERROR; 62 extern const char *MSGS_LOADING_DOCUMENT; 58 63 59 64 // Plugins List columns titles -
trunk/Lucide/SOURCE/gui/progressDlg.cpp
r35 r50 22 22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 23 23 * 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 25 25 * terms of the LGPL, and not to allow others to use your version of this file 26 26 * under the terms of the CDDL, indicate your decision by deleting the 27 27 * provisions above and replace them with the notice and other provisions 28 28 * 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 30 30 * or the LGPL. 31 31 * … … 38 38 39 39 #include <process.h> 40 #include <stdio.h> 40 41 41 42 #include "luutils.h" … … 119 120 _this->hDialog = hwnd; 120 121 WinSetDlgItemText( hwnd, IDC_PTEXT, _this->text ); 122 WinEnableControl( hwnd, DID_CANCEL, _this->fn != NULL ); 121 123 122 124 _this->startPos = 0; … … 139 141 _this->pOldBarProc = WinSubclassWindow( hBar, progressBarProc ); 140 142 WinStartTimer( hBarHab, hBar, TID_PAINT, 1 ); 141 143 142 144 _beginthread( _this->threadFn, NULL, 65536, _this->threadData ); 143 145 … … 165 167 case DID_CANCEL: 166 168 WinEnableControl( hwnd, DID_CANCEL, FALSE ); 167 _this->fn( _this->data ); 169 if ( _this->fn != NULL ) { 170 _this->fn( _this->data ); 171 } 168 172 return (MRESULT)FALSE; 169 173 }; -
trunk/Lucide/SOURCE/gui/toolbar.cpp
r35 r50 22 22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 23 23 * 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 25 25 * terms of the LGPL, and not to allow others to use your version of this file 26 26 * under the terms of the CDDL, indicate your decision by deleting the 27 27 * provisions above and replace them with the notice and other provisions 28 28 * 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 30 30 * or the LGPL. 31 31 * … … 74 74 if ( ( controlId == TBID_ZOOM ) && ( notifyCode == CBN_ENTER ) ) 75 75 { 76 SHORT rc = (SHORT)WinSendDlgItemMsg( hwnd, TBID_ZOOM, LM_QUERYSELECTION,77 MPFROMSHORT( LIT_CURSOR ), MPVOID );78 if ( rc != LIT_NONE)76 bool shortValueOk = false; 77 SHORT sResult = 0; 78 if ( WinQueryDlgItemShort( hwnd, TBID_ZOOM, &sResult, FALSE ) ) 79 79 { 80 switch ( rc ) 80 if ( ( sResult > 0 ) && ( sResult < 1600 ) ) { 81 shortValueOk = true; 82 Lucide::setZoom( (double)sResult / 100.0 ); 83 } 84 } 85 86 if ( !shortValueOk ) 87 { 88 SHORT rc = (SHORT)WinSendDlgItemMsg( hwnd, TBID_ZOOM, LM_QUERYSELECTION, 89 MPFROMSHORT( LIT_CURSOR ), MPVOID ); 90 if ( rc != LIT_NONE ) 81 91 { 82 case 0: Lucide::setZoom( 1 ); break; 83 case 1: Lucide::setZoom( -2 ); break; 84 case 2: Lucide::setZoom( -1 ); break; 85 case 3: Lucide::setZoom( 0.125 ); break; 86 case 4: Lucide::setZoom( 0.25 ); break; 87 case 5: Lucide::setZoom( 0.5 ); break; 88 case 6: Lucide::setZoom( 1 ); break; 89 case 7: Lucide::setZoom( 1.25 ); break; 90 case 8: Lucide::setZoom( 1.5 ); break; 91 case 9: Lucide::setZoom( 2 ); break; 92 case 10: Lucide::setZoom( 3 ); break; 93 case 11: Lucide::setZoom( 4 ); break; 94 case 12: Lucide::setZoom( 8 ); break; 95 case 13: Lucide::setZoom( 16 ); break; 92 double z = convZoom( rc ); 93 if ( z >= -2 ) { 94 Lucide::setZoom( z ); 95 } 96 96 } 97 97 } … … 269 269 270 270 cs.ctrlHandle = WinCreateWindow( hToolBar, WC_COMBOBOX, NULL, 271 WS_VISIBLE | CBS_DROPDOWN LIST,271 WS_VISIBLE | CBS_DROPDOWN, 272 272 0,0,0,0, hToolBar, HWND_TOP, TBID_ZOOM, NULL, NULL ); 273 273 WinSetPresParam( cs.ctrlHandle, PP_FONTNAMESIZE, deffontlen, deffont ); 274 274 std::string actsizetext = getLocalizedString( TBHINT_ACTUAL_SIZE ); 275 WinSetWindowText( cs.ctrlHandle, actsizetext.c_str() ); 276 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), 277 MPFROMP( actsizetext.c_str() ) ); 278 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), 279 MPFROMP( getLocalizedString( TBHINT_FIT_WINDOW ).c_str() ) ); 280 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), 281 MPFROMP( getLocalizedString( TBHINT_FIT_WIDTH ).c_str() ) ); 282 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "12.5%" ) ); 283 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "25%" ) ); 284 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "50%" ) ); 285 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "100%" ) ); 286 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "125%" ) ); 287 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "150%" ) ); 288 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "200%" ) ); 289 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "300%" ) ); 290 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "400%" ) ); 291 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "800%" ) ); 292 WinSendMsg( cs.ctrlHandle, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "1600%" ) ); 275 setZoomValues( cs.ctrlHandle ); 293 276 cs.cx = 80; 294 277 cs.cy = -100; -
trunk/Lucide/SOURCE/plugins/ludjvu/ludjvu.cpp
r36 r50 218 218 { 219 219 LuDjvuDocumentData *somThis = LuDjvuDocumentGetData(somSelf); 220 220 221 221 double page_ratio; 222 222 double p_width = 0, p_height = 0; … … 242 242 while ( ddjvu_thumbnail_status( d->d_document, pagenum, 1 ) < DDJVU_JOB_OK ) { 243 243 ddjvu_message_wait( d->d_context ); 244 ddjvu_message_pop( d->d_context ); 245 } 246 244 ddjvu_message_pop( d->d_context ); 245 } 246 247 247 int t_width = thumb_width; 248 248 int t_height = thumb_height; -
trunk/Lucide/SOURCE/plugins/ludoc/lutypes.h
r35 r50 129 129 { 130 130 char *title; 131 char *format; /* eg, "pdf-1.5" */131 char *format; 132 132 char *author; 133 133 char *subject; -
trunk/Lucide/SOURCE/plugins/lupoppler/lupoppler.cpp
r44 r50 313 313 Environment *ev; 314 314 LuPixbuf *pixbuf; 315 Splash Bitmap *bitmap;315 SplashOutputDev *out; 316 316 void *fndata; 317 317 _asynchCallbackFn fnd; … … 328 328 DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &now, sizeof( long ) ); 329 329 long dist = ( now - cd->tmr ); 330 if ( ( dist > cd->delay ) || cd->forceDraw ) { 331 copy_page_to_pixbuf( cd->ev, cd->bitmap, cd->pixbuf ); 330 if ( ( dist > cd->delay ) || cd->forceDraw ) 331 { 332 // Note: we use out->getBitmap() on each iteration instead 333 // of remembering pointer to bitmap before call 334 // page->displaySlice() because OutputDev may change 335 // bitmap during page->displaySlice() processing. 336 copy_page_to_pixbuf( cd->ev, cd->out->getBitmap(), cd->pixbuf ); 332 337 cd->fnd( cd->fndata ); 333 338 cd->tmr = now; … … 362 367 acd.ev = ev; 363 368 acd.pixbuf = pixbuf; 364 acd. bitmap = document->output_dev->getBitmap();369 acd.out = document->output_dev; 365 370 acd.fndata = fndata; 366 371 acd.fnd = (_asynchCallbackFn)fnd; -
trunk/Lucide/SOURCE/plugins/lupoppler/makefile
r31 r50 20 20 DEL MAKE.CFG 21 21 22 lupplr.dll: lupoppler.obj ..\ludoc\ludoc.lib 22 lupplr.dll: lupoppler.obj ..\ludoc\ludoc.lib ..\..\..\..\poppler\poppler.lib 23 23 copy &&| 24 24 option quiet -
trunk/poppler/mypoppler/poppler/Page.cc
r27 r50 350 350 } 351 351 352 352 353 void Page::displaySlice(OutputDev *out, double hDPI, double vDPI, 353 354 int rotate, GBool useMediaBox, GBool crop,
Note: See TracChangeset
for help on using the changeset viewer.