00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 #include "camtypes.h"
00105
00106 #include "camconfig.h"
00107
00108 #include "GDrawIntf.h"
00109 #include "XaDrwOld.h"
00110 #include "GVersion.h"
00111
00112
00113 #include "gradtbl.h"
00114
00115 #include "grndrgn.h"
00116
00117 #include "camprofile.h"
00118
00119
00120
00121
00122
00123 GDrawAsm * GDrawAsm::Current = NULL;
00124 INT32 GDrawAsm::Instance = 0;
00125 GDrawAsm * GDrawAsm::sm_pListHead = NULL;
00126
00127
00128
00129 CRITICAL_SECTION CriticalSection::sm_Section;
00130 BOOL CriticalSection::sm_bInit = FALSE;
00131
00132
00133
00134 GDrawAsm::GDrawAsm() : GDrawContext()
00135 {
00136 m_pContext = NULL;
00137 Instance++;
00138 SaveArea = NULL;
00139 SaveAreaLength = 0;
00140 m_pPrevious = NULL;
00141 m_pNext = NULL;
00142
00143 m_ThreadID = 0;
00144 }
00145
00146
00147 GDrawAsm::GDrawAsm(DWORD ThreadID) : GDrawContext()
00148 {
00149 m_pContext = NULL;
00150 Instance++;
00151 SaveArea = NULL;
00152 SaveAreaLength = 0;
00153 m_pPrevious = NULL;
00154 m_pNext = NULL;
00155
00156 if (ThreadID == 0)
00157 ThreadID = wxThread::GetCurrentId();
00158
00159
00160 m_pNext = sm_pListHead;
00161 sm_pListHead = this;
00162
00163 m_ThreadID = ThreadID;
00164 }
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184 GDrawAsm* GDrawAsm::GetContextForCurrentThread(void)
00185 {
00186 CriticalSection Ralph;
00187
00188 GDrawAsm *pContext = sm_pListHead;
00189
00190 DWORD ThreadID = wxThread::GetCurrentId();
00191
00192 while (pContext && (ThreadID != pContext->m_ThreadID))
00193 {
00194 pContext = pContext->m_pNext;
00195 }
00196
00197 TRACE( wxT("GetContextForCurrentThread = %p"), pContext );
00198
00199 return(pContext);
00200 }
00201
00202
00203 extern "C" LPBYTE GDraw_Alloc(UINT32 Size)
00204 {
00205 LPBYTE Result = (LPBYTE)CCMalloc(Size);
00206
00207 #ifdef _DEBUG
00208 if (Result==NULL)
00209 TRACEALL( _T("GDraw failed to get %ld bytes\n"), Size);
00210 #endif
00211
00212 return Result;
00213 }
00214
00215 extern "C" void GDraw_Free(LPBYTE ptr)
00216 {
00217 CCFree(ptr);
00218 }
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238 BOOL GDrawAsm::Init()
00239 {
00240
00241 DWORD GVer = XaDraw_GetVersion();
00242
00243
00244
00245 if ( ( HIWORD(GVer) > (WORD)GDRAW_VERSION_MAJOR ) ||
00246 (( HIWORD(GVer) == (WORD)GDRAW_VERSION_MAJOR )
00247 #if GDRAW_VERSION_MINOR>0
00248 && ( LOWORD(GVer) >= (WORD)GDRAW_VERSION_MINOR)
00249 #endif
00250 )
00251 )
00252 {
00253 if (m_pContext)
00254 {
00255 XaDraw_Terminate(m_pContext);
00256
00257 }
00258
00259 CamProfile cp(CAMPROFILE_GDRAW);
00260
00261
00262 INT32 Len = XaDraw_ContextLength();
00263 if (Len > 0)
00264 {
00265 if (m_pContext == NULL)
00266 m_pContext = (GCONTEXT*)CCMalloc(Len);
00267 if (m_pContext)
00268 {
00269
00270
00271 XaDraw_Initialise(m_pContext, NULL);
00272 XaDraw_SetMemoryHandlers(m_pContext, GDraw_Alloc, GDraw_Free);
00273 return TRUE;
00274 }
00275 else
00276 {
00277 TRACEUSER( "Gerry", _T("Failed to claim context of %d bytes\n"), Len);
00278 }
00279 }
00280 }
00281
00282 return FALSE;
00283 }
00284
00285
00286 BOOL GDrawAsm::Init(GDrawAsm* pSource)
00287 {
00288
00289
00290 if (pSource->m_pContext == NULL)
00291 return(FALSE);
00292
00293 DWORD GVer = XaDraw_GetVersion();
00294
00295
00296
00297 if ( ( HIWORD(GVer) > (WORD)GDRAW_VERSION_MAJOR ) ||
00298 (( HIWORD(GVer) == (WORD)GDRAW_VERSION_MAJOR )
00299 #if GDRAW_VERSION_MINOR>0
00300 && ( LOWORD(GVer) >= (WORD)GDRAW_VERSION_MINOR)
00301 #endif
00302 )
00303 )
00304 {
00305 if (m_pContext)
00306 {
00307 XaDraw_Terminate(m_pContext);
00308
00309 }
00310
00311
00312 INT32 Len = XaDraw_ContextLength();
00313 if (Len > 0)
00314 {
00315 if (m_pContext == NULL)
00316 m_pContext = (GCONTEXT*)CCMalloc(Len);
00317 if (m_pContext)
00318 {
00319
00320 XaDraw_CopyContext(pSource->m_pContext, m_pContext);
00321 return TRUE;
00322 }
00323 else
00324 {
00325 TRACEUSER( "Gerry", _T("Failed to claim context of %d bytes\n"), Len);
00326 }
00327 }
00328 }
00329
00330 return FALSE;
00331 }
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350 GDrawAsm::~GDrawAsm()
00351 {
00352 CriticalSection Ralph;
00353
00354
00355
00356 if (Instance > 0)
00357 Instance--;
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369 if (this == GRenderRegion::GetStaticDrawContext())
00370 {
00371 TRACEUSER("Gerry", _T("Deleting current GDraw context at 0x%08x\n"), this);
00372 GRenderRegion::SetTempDrawContext(NULL);
00373 }
00374
00375 if (m_pContext)
00376 {
00377 CamProfile cp(CAMPROFILE_GDRAW);
00378 XaDraw_Terminate(m_pContext);
00379 CCFree(m_pContext);
00380
00381 m_pContext = NULL;
00382 }
00383
00384
00385 if (Current == this)
00386 Current = NULL;
00387
00388 if (SaveArea)
00389 {
00390
00391 CCFree((LPBYTE)SaveArea);
00392 SaveArea=NULL;
00393 SaveAreaLength = 0;
00394 }
00395
00396
00397 if (m_ThreadID != 0)
00398 {
00399
00400
00401 if (m_pPrevious == NULL || sm_pListHead == this)
00402 {
00403
00404 sm_pListHead = m_pNext;
00405 }
00406 else
00407 {
00408
00409 m_pPrevious->m_pNext = m_pNext;
00410 }
00411
00412
00413 if (m_pNext != NULL)
00414 {
00415
00416 m_pNext->m_pPrevious = m_pPrevious;
00417 }
00418 }
00419 }
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437 DWORD GDrawAsm::GetMaxBitmapWidth(void)
00438 {
00439 CamProfile cp(CAMPROFILE_GDRAW);
00440 return(XaDraw_GetMaxBitmapWidth());
00441 }
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459 DWORD GDrawAsm::GetMaxBitmapDepth(void)
00460 {
00461 CamProfile cp(CAMPROFILE_GDRAW);
00462 return(XaDraw_GetMaxBitmapDepth());
00463 }
00464
00465
00466
00467 #ifdef RALPH
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487 BOOL GDrawAsm::InitContext(GCONTEXT *Context, INT32 Index)
00488 {
00489 CriticalSection Ralph;
00490
00491
00492 if (!MakeCurrent())
00493 return(FALSE);
00494
00495
00496
00497 #if FALSE
00498
00499
00500 INT32 Length = GetContextLength();
00501 LPBYTE pBlock = CCMalloc(Length);
00502
00503 if (pBlock == NULL)
00504 return(FALSE);
00505
00506
00507 SaveContext((GCONTEXT*)pBlock);
00508
00509
00510 FILE *f = NULL;
00511
00512 switch (Index)
00513 {
00514 case 0:
00515 f = fopen("c:\\context\\normal.con", "wb");
00516 break;
00517
00518 case 1:
00519 f = fopen("c:\\context\\errord.con", "wb");
00520 break;
00521 }
00522
00523 if (f != NULL)
00524 {
00525
00526 fwrite(&pBlock, Length, 1, f);
00527
00528
00529 fclose(f);
00530 }
00531
00532 return(TRUE);
00533
00534 #else
00535
00536 CamProfile cp(CAMPROFILE_GDRAW);
00537 return(XaDrawOld_RestoreContext(Context)==0);
00538 #endif
00539 }
00540
00541 #endif
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560 INT32 GDrawAsm::GetContextLength()
00561 {
00562 CamProfile cp(CAMPROFILE_GDRAW);
00563 return(XaDraw_ContextLength());
00564 }
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582 BOOL GDrawAsm::SaveContext(GCONTEXT *Context)
00583 {
00584
00585 CamProfile cp(CAMPROFILE_GDRAW);
00586 return(XaDraw_CopyContext(m_pContext, Context)==0);
00587
00588 }
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606 BOOL GDrawAsm::RestoreContext(CONST GCONTEXT *Context)
00607 {
00608
00609 CamProfile cp(CAMPROFILE_GDRAW);
00610 return(XaDraw_CopyContext(Context, m_pContext)==0);
00611
00612 }
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651 BOOL GDrawAsm::MakeCurrent()
00652 {
00653
00654 if (this == Current)
00655 return(TRUE);
00656
00657 #if FALSE
00658 if (Current != NULL)
00659 {
00660 if (Current->SaveAreaLength != Current->GetContextLength())
00661 {
00662 if (Current->SaveArea != NULL)
00663 {
00664 TRACEUSER( "Gerry", _T("Freeing context of %d bytes at 0x%08x\n"), Current->SaveAreaLength, Current->SaveArea);
00665 CCFree((LPBYTE)(Current->SaveArea));
00666 Current->SaveArea = NULL;
00667 Current->SaveAreaLength = 0;
00668 }
00669
00670 Current->SaveAreaLength = Current->GetContextLength();
00671 Current->SaveArea = (GCONTEXT *) CCMalloc(Current->SaveAreaLength);
00672 TRACEUSER( "Gerry", _T("Claimed context of %d bytes at 0x%08x\n"), Current->SaveAreaLength, Current->SaveArea);
00673 }
00674
00675 if (Current->SaveArea == NULL)
00676 {
00677
00678 Current->SaveAreaLength = 0;
00679 return(FALSE);
00680 }
00681
00682 if (!(Current->SaveContext(Current->SaveArea)))
00683 return(FALSE);
00684 }
00685
00686
00687 if (SaveArea != NULL)
00688 RestoreContext(SaveArea);
00689 #endif
00690
00691
00692 Current = this;
00693
00694
00695 return (TRUE);
00696 }
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713 eError GDrawAsm::GetLastError()
00714 {
00715 CamProfile cp(CAMPROFILE_GDRAW);
00716 if (!MakeCurrent())
00717 return(GERROR_OUT_OF_MEMORY);
00718 else
00719 return(XaDraw_GetLastError(m_pContext));
00720 }
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736 INT32 GDrawAsm::GetGraduationTableSize()
00737 {
00738 CriticalSection Ralph;
00739
00740 if (!MakeCurrent())
00741 return(0);
00742
00743 CamProfile cp(CAMPROFILE_GDRAW);
00744
00745 return(XaColour_GetGraduationTableSize(m_pContext));
00746 }
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762 INT32 GDrawAsm::GetGraduationTableLength()
00763 {
00764 CamProfile cp(CAMPROFILE_GDRAW);
00765 return(XaColour_GetGraduationTableLength());
00766 }
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782 INT32 GDrawAsm::GetLongGraduationTableSize()
00783 {
00784 CriticalSection Ralph;
00785
00786 if (!MakeCurrent())
00787 return(0);
00788
00789 CamProfile cp(CAMPROFILE_GDRAW);
00790 return(XaColour_GetLongGraduationTableSize(m_pContext));
00791 }
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807 INT32 GDrawAsm::GetLongGraduationTableLength()
00808 {
00809 CamProfile cp(CAMPROFILE_GDRAW);
00810 return(XaColour_GetLongGraduationTableLength());
00811 }
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827 INT32 GDrawAsm::GetTransparentGraduationTableSize()
00828 {
00829 CriticalSection Ralph;
00830
00831 if (!MakeCurrent())
00832 return(0);
00833
00834 CamProfile cp(CAMPROFILE_GDRAW);
00835 return(XaColour_GetTransparentGraduationTableSize());
00836 }
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852 INT32 GDrawAsm::GetTransparentGraduationTableLength()
00853 {
00854 CamProfile cp(CAMPROFILE_GDRAW);
00855 return(XaColour_GetTransparentGraduationTableLength());
00856 }
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872 INT32 GDrawAsm::GetLongTransparentGraduationTableSize()
00873 {
00874 CriticalSection Ralph;
00875
00876 if (!MakeCurrent())
00877 return(0);
00878
00879 CamProfile cp(CAMPROFILE_GDRAW);
00880 return(XaColour_GetLongTransparentGraduationTableSize());
00881 }
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897 INT32 GDrawAsm::GetLongTransparentGraduationTableLength()
00898 {
00899 CamProfile cp(CAMPROFILE_GDRAW);
00900 return(XaColour_GetLongTransparentGraduationTableLength());
00901 }
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921 void GDrawAsm::SetStackLimit( LPVOID stack )
00922 {
00923 CriticalSection Ralph;
00924
00925 ERROR3("SetStackLimit() is not thread safe!!! Use SetStackSize() instead.");
00926
00927 if (!(MakeCurrent())) return;
00928 CamProfile cp(CAMPROFILE_GDRAW);
00929 XaDraw_SetStackLimit(m_pContext, stack);
00930 }
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949 void GDrawAsm::SetStackSize(DWORD StackSize)
00950 {
00951 CriticalSection Ralph;
00952
00953 if (!(MakeCurrent())) return;
00954 CamProfile cp(CAMPROFILE_GDRAW);
00955 XaDraw_SetStackSize(m_pContext, StackSize);
00956 }
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974 BOOL GDrawAsm::SetupBitmap( INT32 Width, INT32 Height, INT32 Depth, LPBYTE Bits, DWORD Format, BOOL DoBiCompression )
00975 {
00976 CriticalSection Ralph;
00977
00978 if (!(MakeCurrent())) return(FALSE);
00979
00980
00981 BITMAPINFOHEADER bmInfo;
00982
00983 bmInfo.biSize = sizeof(BITMAPINFOHEADER);
00984 bmInfo.biWidth = Width;
00985 bmInfo.biHeight = Height;
00986 bmInfo.biPlanes = 1;
00987 bmInfo.biBitCount = (WORD)Depth;
00988
00989 if(DoBiCompression == TRUE)
00990 {
00991
00992
00993 bmInfo.biCompression = 0x80000001;
00994 }
00995 else
00996 {
00997 bmInfo.biCompression = BI_RGB;
00998 }
00999
01000 bmInfo.biSizeImage = 0L;
01001 bmInfo.biXPelsPerMeter = 1000;
01002 bmInfo.biYPelsPerMeter = 1000;
01003 bmInfo.biClrUsed = 0;
01004 bmInfo.biClrImportant = 0;
01005
01006
01007 RECT BBox;
01008 GetChangedBBox(&BBox);
01009
01010 if(DoBiCompression == TRUE && Bits != NULL)
01011 {
01012
01013
01014
01015 DWORD* pSetBits = (DWORD*)Bits;
01016 DWORD BMPSIZE = (Width * Height);
01017 DWORD Index = 0;
01018
01019 while(Index < BMPSIZE)
01020 {
01021 pSetBits[Index++] = 0xFF000000;
01022 }
01023 }
01024
01025 if ( Depth == 8 )
01026 {
01027
01028
01029
01030 Format = 0;
01031 }
01032
01033 CamProfile cp(CAMPROFILE_GDRAW);
01034 #if defined(__WXMSW__) || !USE_wxBITMAP
01035 BOOL Result = XaDraw_SetDIBitmap(m_pContext, &bmInfo, Bits, Format) ? FALSE : TRUE;
01036 #else
01037 BOOL Result = XaDraw_SetInvertedDIBitmap(m_pContext, &bmInfo, Bits, Format) ? FALSE : TRUE;
01038 #endif
01039
01040
01041
01042
01043 return Result;
01044 }
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061 BOOL GDrawAsm::SetBitmap( CONST LPBITMAPINFOHEADER BitmapInfo, CONST LPBYTE Bitmap, DWORD BitmapFormat )
01062 {
01063 CriticalSection Ralph;
01064 CamProfile cp(CAMPROFILE_GDRAW);
01065
01066 #if defined(__WXMSW__) || !USE_wxBITMAP
01067 return (MakeCurrent() && (XaDraw_SetDIBitmap(m_pContext, BitmapInfo,Bitmap, BitmapFormat) ? FALSE : TRUE));
01068 #else
01069 return (MakeCurrent() && (XaDraw_SetInvertedDIBitmap(m_pContext, BitmapInfo,Bitmap, BitmapFormat) ? FALSE : TRUE));
01070 #endif
01071 }
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089 BOOL GDrawAsm::SetMatrix( GMATRIX* GMat)
01090 {
01091 CriticalSection Ralph;
01092 CamProfile cp(CAMPROFILE_GDRAW);
01093
01094 return (MakeCurrent() && (XaDraw_SetMatrix(m_pContext, GMat) ? FALSE : TRUE));
01095 }
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113 void GDrawAsm::SetAntialiasFlag( BOOL Flag )
01114 {
01115 CriticalSection Ralph;
01116 CamProfile cp(CAMPROFILE_GDRAW);
01117
01118 if (MakeCurrent()) XaDraw_SetAntialiasFlag(m_pContext, FALSE != Flag );
01119 }
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137 void GDrawAsm::SetAntialiasQualityFlag( BOOL Flag )
01138 {
01139 CriticalSection Ralph;
01140 CamProfile cp(CAMPROFILE_GDRAW);
01141
01142 if (MakeCurrent()) XaDraw_SetAntialiasQualityFlag(m_pContext, FALSE != Flag );
01143 }
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156 void GDrawAsm::SetTileSmoothingFlag( BOOL Flag )
01157 {
01158 CriticalSection Ralph;
01159 CamProfile cp(CAMPROFILE_GDRAW);
01160
01161 if (MakeCurrent()) XaColour_SetTileSmoothingFlag(m_pContext, FALSE != Flag );
01162 }
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174 void GDrawAsm::SetTileFilteringFlag( BOOL Flag )
01175 {
01176 CriticalSection Ralph;
01177 CamProfile cp(CAMPROFILE_GDRAW);
01178
01179 if (MakeCurrent()) XaColour_SetTileFilteringFlag(m_pContext, FALSE != Flag );
01180 }
01181
01182
01183
01184 void GDrawAsm::SetMaxFilterSize( UINT32 uSize )
01185 {
01186 CriticalSection Ralph;
01187 CamProfile cp(CAMPROFILE_GDRAW);
01188
01189 if ( MakeCurrent() )
01190 XaBitmap_SetMaxFilterSize(m_pContext,uSize);
01191 }
01192
01193
01194
01195 BOOL GDrawAsm::Blur( INT32 nBlur )
01196 {
01197 CriticalSection Ralph;
01198 CamProfile cp(CAMPROFILE_GDRAW);
01199
01200 return MakeCurrent() && (XaBitmap_Blur(m_pContext,nBlur) ? FALSE : TRUE);
01201 }
01202
01203
01204
01205 BOOL GDrawAsm::Sharpen( INT32 nSharpen )
01206 {
01207 CriticalSection Ralph;
01208 CamProfile cp(CAMPROFILE_GDRAW);
01209
01210 return MakeCurrent() && (XaBitmap_Sharpen(m_pContext,nSharpen) ? FALSE : TRUE);
01211 }
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230 void GDrawAsm::SetHintingFlag( BOOL Flag )
01231 {
01232 CriticalSection Ralph;
01233 CamProfile cp(CAMPROFILE_GDRAW);
01234
01235 if (MakeCurrent()) XaDraw_SetHintingFlag(m_pContext, FALSE != Flag );
01236 }
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254 void GDrawAsm::SetFlatness( DWORD Flat )
01255 {
01256 CriticalSection Ralph;
01257 CamProfile cp(CAMPROFILE_GDRAW);
01258
01259 if (MakeCurrent()) XaDraw_SetFlatness(m_pContext, Flat );
01260 }
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279 void GDrawAsm::TransformPath( LPPOINT IPoints, LPPOINT OPoints, DWORD Length, GMATRIX*GMat )
01280 {
01281 CriticalSection Ralph;
01282 CamProfile cp(CAMPROFILE_GDRAW);
01283
01284 if (MakeCurrent()) XaDraw_TransformPath(m_pContext, IPoints, OPoints, Length, GMat );
01285 }
01286
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314 INT32 GDrawAsm::MaxScale( CONST GMATRIX *Matrix, CONST RECT *BBox )
01315 {
01316 CriticalSection Ralph;
01317 CamProfile cp(CAMPROFILE_GDRAW);
01318
01319 if (!MakeCurrent()) return -1;
01320 return XaDraw_MaxScale(m_pContext, Matrix, BBox );
01321 }
01322
01324
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343 void GDrawAsm::SetHalftoneOrigin( DWORD x, DWORD y )
01344 {
01345 CriticalSection Ralph;
01346 CamProfile cp(CAMPROFILE_GDRAW);
01347
01348 if (MakeCurrent()) XaColour_SetHalftoneOrigin(m_pContext, x, y );
01349 }
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367 BOOL GDrawAsm::SetConversionPalette( PLOGPALETTE pPalette )
01368 {
01369 CriticalSection Ralph;
01370 CamProfile cp(CAMPROFILE_GDRAW);
01371
01372 return (MakeCurrent() && (XaColour_SetConversionPalette(m_pContext, pPalette ) ? FALSE : TRUE));
01373 }
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392
01393
01394 BOOL GDrawAsm::SetDitherStyle(DitherStyle Style)
01395 {
01396 CriticalSection Ralph;
01397 CamProfile cp(CAMPROFILE_GDRAW);
01398
01399 return (MakeCurrent() && (XaColour_SetDitherStyle(m_pContext,Style) ? FALSE : TRUE));
01400 }
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421 BOOL GDrawAsm::AddToGraduationTable( COLORREF Colour, BOOL HSV, GraduationTable* Table, DWORD Index)
01422 {
01423 CriticalSection Ralph;
01424 CamProfile cp(CAMPROFILE_GDRAW);
01425
01426 return (MakeCurrent() && (XaColour_AddToGraduationTable(m_pContext, Colour, HSV, Table, Index ) ? FALSE : TRUE));
01427 }
01428
01429
01430
01431
01432
01433
01434
01435
01436
01437
01438
01439
01440
01441
01442
01443
01444
01445
01446 BOOL GDrawAsm::BuildGraduationTable( COLORREF Start, COLORREF End, DWORD HSV, GraduationTable* Table)
01447 {
01448 CriticalSection Ralph;
01449 CamProfile cp(CAMPROFILE_GDRAW);
01450
01451 return (MakeCurrent() && (XaColour_BuildGraduationTable(m_pContext, Start, End, HSV, Table ) ? FALSE : TRUE));
01452 }
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470 BOOL GDrawAsm::BuildTransparencyTable( DWORD Start, DWORD End, TransparentGradTable* Table)
01471 {
01472 CriticalSection Ralph;
01473 CamProfile cp(CAMPROFILE_GDRAW);
01474
01475 return (MakeCurrent() && (XaColour_BuildTransparencyTable(m_pContext, Start, End, Table ) ? FALSE : TRUE));
01476 }
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487
01488
01489
01490
01491
01492
01493
01494 BOOL GDrawAsm::SetColour( COLORREF Colour )
01495 {
01496 CriticalSection Ralph;
01497 CamProfile cp(CAMPROFILE_GDRAW);
01498
01499 return (MakeCurrent() && (XaColour_SetColour(m_pContext, Colour ) ? FALSE : TRUE));
01500 }
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512
01513
01514
01515
01516
01517
01518 BOOL GDrawAsm::SetSolidColour( COLORREF Colour, DWORD BPP, DWORD Format )
01519 {
01520 CriticalSection Ralph;
01521 CamProfile cp(CAMPROFILE_GDRAW);
01522
01523 return (MakeCurrent() && (XaColour_SetSolidColour(m_pContext, Colour, BPP, Format ) ? FALSE : TRUE));
01524 }
01525
01526
01527
01528
01529
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542 BOOL GDrawAsm::SetWordColour( DWORD Colour )
01543 {
01544 CriticalSection Ralph;
01545 CamProfile cp(CAMPROFILE_GDRAW);
01546
01547 return (MakeCurrent() && (XaColour_SetWordColour(m_pContext, Colour ) ? FALSE : TRUE));
01548 }
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566
01567
01568 BOOL GDrawAsm::SetTransparency( COLORREF Colour, TransparencyEnum Trans)
01569 {
01570 CriticalSection Ralph;
01571 CamProfile cp(CAMPROFILE_GDRAW);
01572
01573 return (MakeCurrent() && (XaColour_SetTransparency(m_pContext, Colour, Trans ) ? FALSE : TRUE));
01574 }
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595 BOOL GDrawAsm::ConvertBitmap( LPBITMAPINFOHEADER SInfo, LPBYTE SBytes, LPBITMAPINFOHEADER DInfo,
01596 LPBYTE DBytes, INT32 Dither )
01597 {
01598 CriticalSection Ralph;
01599 CamProfile cp(CAMPROFILE_GDRAW);
01600
01601 return (MakeCurrent() && (XaColour_ConvertBitmap(m_pContext, SInfo, SBytes, DInfo, DBytes, Dither ) ? FALSE : TRUE));
01602 }
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621 const LOGPALETTE* GDrawAsm::SelectPalette( INT32 WhichPal )
01622 {
01623 CriticalSection Ralph;
01624 CamProfile cp(CAMPROFILE_GDRAW);
01625
01626 if (!MakeCurrent()) return NULL;
01627 return XaColour_SelectPalette(m_pContext, FALSE != WhichPal );
01628 }
01629
01630
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640
01641
01642
01643
01644
01645
01646
01647
01648
01649
01650
01651
01652
01653
01654
01655
01656
01657
01658 BOOL GDrawAsm::SetGraduation(
01659 DWORD Style,
01660 CONST GraduationTable *Table,
01661 CONST POINT *PointA,
01662 CONST POINT *PointB,
01663 CONST POINT *PointC
01664 )
01665 {
01666 CriticalSection Ralph;
01667 CamProfile cp(CAMPROFILE_GDRAW);
01668
01669 return (MakeCurrent() && (XaColour_SetGraduation(m_pContext, Style, Table, PointA, PointB, PointC ) ? FALSE : TRUE));
01670 }
01671
01672
01673
01674
01675
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687
01688
01689
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700 BOOL GDrawAsm::SetTransparentGraduation(
01701 DWORD Style,
01702 CONST TranspGradTable *Table,
01703 CONST POINT *PointA,
01704 CONST POINT *PointB,
01705 CONST POINT *PointC
01706 )
01707 {
01708 CriticalSection Ralph;
01709 CamProfile cp(CAMPROFILE_GDRAW);
01710
01711 Style = Style & 0xFFFF00FF;
01712 if (Table->IsLarge())
01713 Style |= 0x0100;
01714
01715 return (MakeCurrent() && (XaColour_SetTransparentGraduation(m_pContext, Style, Table->GetTable(), PointA, PointB, PointC ) ? FALSE : TRUE));
01716 }
01717
01718
01719
01720
01721
01722
01723
01724
01725
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744
01745
01746
01747 BOOL GDrawAsm::SetGraduation4(
01748 DWORD Style,
01749 CONST GraduationTable *Table,
01750 CONST POINT *PointA,
01751 CONST POINT *PointB,
01752 CONST POINT *PointC,
01753 CONST POINT *PointD
01754 )
01755 {
01756 CriticalSection Ralph;
01757 CamProfile cp(CAMPROFILE_GDRAW);
01758
01759 return (MakeCurrent() && (XaColour_SetGraduation4(m_pContext, Style, Table, PointA, PointB, PointC, PointD ) ? FALSE : TRUE));
01760 }
01761
01762
01763
01764
01765
01766
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790 BOOL GDrawAsm::SetTransparentGraduation4(
01791 DWORD Style,
01792 CONST TranspGradTable *Table,
01793 CONST POINT *PointA,
01794 CONST POINT *PointB,
01795 CONST POINT *PointC,
01796 CONST POINT *PointD
01797 )
01798 {
01799 CriticalSection Ralph;
01800 CamProfile cp(CAMPROFILE_GDRAW);
01801
01802 Style = Style & 0xFFFF00FF;
01803 if (Table->IsLarge())
01804 Style |= 0x0100;
01805
01806 return (MakeCurrent() && (XaColour_SetTransparentGraduation4(m_pContext, Style, Table->GetTable(), PointA, PointB, PointC, PointD ) ? FALSE : TRUE));
01807 }
01808
01809
01810
01811 BOOL GDrawAsm::SetBias( UINT32 uChannel,double fBias )
01812 {
01813 CriticalSection Ralph;
01814 CamProfile cp(CAMPROFILE_GDRAW);
01815
01816 return MakeCurrent() && (XaBitmap_SetBias(m_pContext,uChannel,fBias) ? FALSE : TRUE);
01817 }
01818
01819
01820
01821 BOOL GDrawAsm::SetGain( UINT32 uChannel,double fGain )
01822 {
01823 CriticalSection Ralph;
01824 CamProfile cp(CAMPROFILE_GDRAW);
01825
01826 return MakeCurrent() && (XaBitmap_SetGain(m_pContext,uChannel,fGain) ? FALSE : TRUE);
01827 }
01828
01829
01830
01831 BOOL GDrawAsm::SetBrightness( double fBrightness )
01832 {
01833 CriticalSection Ralph;
01834 CamProfile cp(CAMPROFILE_GDRAW);
01835
01836 return MakeCurrent() && (XaBitmap_SetBrightness(m_pContext,fBrightness) ? FALSE : TRUE);
01837 }
01838
01839
01840
01841 BOOL GDrawAsm::SetContrast( double fContrast )
01842 {
01843 CriticalSection Ralph;
01844 CamProfile cp(CAMPROFILE_GDRAW);
01845
01846 return MakeCurrent() && (XaBitmap_SetContrast(m_pContext,fContrast) ? FALSE : TRUE);
01847 }
01848
01849
01850
01851 BOOL GDrawAsm::SetGamma( double fGamma )
01852 {
01853 CriticalSection Ralph;
01854 CamProfile cp(CAMPROFILE_GDRAW);
01855
01856 return MakeCurrent() && (XaBitmap_SetGamma(m_pContext,fGamma) ? FALSE : TRUE);
01857 }
01858
01859
01860
01861 BOOL GDrawAsm::SetPostGamma( double fPostGamma )
01862 {
01863 CriticalSection Ralph;
01864 CamProfile cp(CAMPROFILE_GDRAW);
01865
01866 return MakeCurrent() && (XaBitmap_SetPostGamma(m_pContext,fPostGamma) ? FALSE : TRUE);
01867 }
01868
01869
01870
01871 BOOL GDrawAsm::SetSaturation( double fSaturation )
01872 {
01873 CriticalSection Ralph;
01874 CamProfile cp(CAMPROFILE_GDRAW);
01875
01876 return MakeCurrent() && (XaBitmap_SetSaturation(m_pContext,fSaturation) ? FALSE : TRUE);
01877 }
01878
01879
01880
01881 BOOL GDrawAsm::SetContone( UINT32 uContoneStyle, COLORREF rgbStart, COLORREF rgbEnd )
01882 {
01883 CriticalSection Ralph;
01884 CamProfile cp(CAMPROFILE_GDRAW);
01885
01886 return MakeCurrent() && (XaBitmap_SetContone(m_pContext,uContoneStyle,rgbStart,rgbEnd) ? FALSE : TRUE);
01887 }
01888
01889
01890
01891 BOOL GDrawAsm::SetInputRange( UINT32 uChannel, BYTE uStart, BYTE uEnd )
01892 {
01893 CriticalSection Ralph;
01894 CamProfile cp(CAMPROFILE_GDRAW);
01895
01896 return MakeCurrent() && (XaBitmap_SetInputRange(m_pContext,uChannel,uStart,uEnd) ? FALSE : TRUE);
01897 }
01898
01899
01900 BOOL GDrawAsm::SetOutputRange( UINT32 uChannel, BYTE uStart, BYTE uEnd )
01901 {
01902 CriticalSection Ralph;
01903 CamProfile cp(CAMPROFILE_GDRAW);
01904
01905 return MakeCurrent() && (XaBitmap_SetOutputRange(m_pContext,uChannel,uStart,uEnd) ? FALSE : TRUE);
01906 }
01907
01908
01909
01910 BOOL GDrawAsm::SetBitmapFill( LPBITMAPINFOHEADER bmInfo, LPBYTE lpBytes, DWORD Style, LPPOINT Points,
01911 COLORREF DefaultColour, LPRGBQUAD ColourTable,
01912 LPBYTE Red, LPBYTE Green, LPBYTE Blue, LPBYTE Trans, DWORD Offset)
01913 {
01914 CriticalSection Ralph;
01915 CamProfile cp(CAMPROFILE_GDRAW);
01916
01917 return (MakeCurrent() && (XaColour_SetTilePattern(m_pContext, bmInfo, lpBytes, Style, Points, Points+1, Points+2,
01918 DefaultColour, (CONST BGRT*)ColourTable, Red, Green, Blue, NULL, Offset)
01919 ? FALSE : TRUE));
01920 }
01921
01922 BOOL GDrawAsm::SetTransparentBitmapFill( LPBITMAPINFOHEADER bmInfo, LPBYTE lpBytes, DWORD Style, LPPOINT Points,
01923 COLORREF DefaultColour, BYTE* pTable, DWORD Offset)
01924 {
01925 CriticalSection Ralph;
01926 CamProfile cp(CAMPROFILE_GDRAW);
01927
01928 return (MakeCurrent() && (XaColour_SetTransparentTilePattern(m_pContext, bmInfo, lpBytes, Style, Points, Points+1, Points+2,
01929 DefaultColour, pTable, Offset)
01930 ? FALSE : TRUE));
01931 }
01932
01933 BOOL GDrawAsm::SetPerspectiveBitmapFill( LPBITMAPINFOHEADER bmInfo, LPBYTE lpBytes, DWORD Style, LPPOINT Points,
01934 COLORREF DefaultColour, LPRGBQUAD ColourTable,
01935 LPBYTE Red, LPBYTE Green, LPBYTE Blue, LPBYTE Trans, DWORD Offset)
01936 {
01937 CriticalSection Ralph;
01938 CamProfile cp(CAMPROFILE_GDRAW);
01939
01940 return (MakeCurrent() && (XaColour_SetTilePattern4(m_pContext, bmInfo, lpBytes, Style, Points, Points+1, Points+2, Points+3,
01941 DefaultColour, (CONST BGRT*)ColourTable, Red, Green, Blue, Trans, Offset)
01942 ? FALSE : TRUE));
01943 }
01944
01945 BOOL GDrawAsm::SetPerspectiveTransparentBitmapFill( LPBITMAPINFOHEADER bmInfo, LPBYTE lpBytes, DWORD Style, LPPOINT Points,
01946 COLORREF DefaultColour, BYTE* pTable, DWORD Offset)
01947 {
01948 CriticalSection Ralph;
01949 CamProfile cp(CAMPROFILE_GDRAW);
01950
01951 return (MakeCurrent() && (XaColour_SetTransparentTilePattern4(m_pContext, bmInfo, lpBytes, Style, Points, Points+1, Points+2, Points+3,
01952 DefaultColour, pTable, Offset)
01953 ? FALSE : TRUE));
01954 }
01955
01956
01957
01958
01959
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969
01970
01971 BOOL GDrawAsm::SetTransparencyLookupTable(CONST BYTE * Table)
01972 {
01973 CriticalSection Ralph;
01974 CamProfile cp(CAMPROFILE_GDRAW);
01975
01976 return (MakeCurrent() && (XaColour_SetTransparencyLookupTable(m_pContext,Table)
01977 ? FALSE : TRUE));
01978 }
01979
01980
01982
01984
01985
01986
01987
01988
01989
01990
01991
01992
01993
01994
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006 BOOL GDrawAsm::StrokePath( LPPOINT Points, const BYTE *Verbs, UINT32 Len, BOOL Close,
02007 DWORD LineWidth, CapStyles LineCaps, JoinStyles LineJoin,
02008 CONST DashType *Dash )
02009 {
02010 CriticalSection Ralph;
02011 CamProfile cp(CAMPROFILE_GDRAW);
02012
02013 return (MakeCurrent() && (XaDraw_StrokePath(m_pContext, Points, Verbs, Len, FALSE != Close, LineWidth,
02014 LineCaps, LineJoin, Dash ) ? FALSE : TRUE));
02015 }
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034 BOOL GDrawAsm::FillPath( LPPOINT Points, const BYTE *Verbs, UINT32 Length, DWORD Winding )
02035 {
02036 CriticalSection Ralph;
02037 CamProfile cp(CAMPROFILE_GDRAW);
02038
02039 return (MakeCurrent() && (XaDraw_FillPath(m_pContext, Points, Verbs, Length, Winding ) ? FALSE : TRUE));
02040 }
02041
02042
02043
02044
02045
02046
02047
02048
02049
02050
02051
02052
02053
02054
02055
02056
02057
02058
02059
02060 BOOL GDrawAsm::GetStatistics( LPPOINT Points, const BYTE *Verbs, UINT32 Length, DWORD Winding,
02061 STATISTICS * Stats )
02062 {
02063 CriticalSection Ralph;
02064 CamProfile cp(CAMPROFILE_GDRAW);
02065
02066 return (MakeCurrent() && ((XaDraw_GetStatistics(m_pContext, Points, Verbs, Length, Winding, Stats )) ? (FALSE || 1 ) : TRUE));
02067 }
02068
02069
02070
02071
02072
02073
02074
02075
02076
02077
02078
02079
02080
02081
02082
02083
02084
02085 BOOL GDrawAsm::FillRectangle( LPRECT Rect )
02086 {
02087 CriticalSection Ralph;
02088 CamProfile cp(CAMPROFILE_GDRAW);
02089
02090 return (MakeCurrent() && (XaDraw_FillRectangle(m_pContext, Rect ) ? FALSE : TRUE));
02091 }
02092
02093
02094
02095
02096
02097
02098
02099
02100
02101
02102
02103
02104
02105
02106
02107
02108
02109 BOOL GDrawAsm::FillPoint( LPPOINT Point )
02110 {
02111 CriticalSection Ralph;
02112 CamProfile cp(CAMPROFILE_GDRAW);
02113
02114 return (MakeCurrent() && (XaDraw_FillPoint(m_pContext, Point ) ? FALSE : TRUE));
02115 }
02116
02117
02118
02119
02120
02121
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141
02142
02143
02144
02145 INT32 GDrawAsm::StrokePathToPath(
02146 CONST POINT *IPoints,
02147 CONST BYTE *ITypes,
02148 DWORD ILength,
02149 POINT *OPoints,
02150 BYTE *OTypes,
02151 DWORD OLength,
02152 BOOL Close,
02153 DWORD LineWidth,
02154 CapStyles LineCaps,
02155 JoinStyles LineJoin,
02156 CONST DashType *Dash)
02157 {
02158 CriticalSection Ralph;
02159 CamProfile cp(CAMPROFILE_GDRAW);
02160
02161 if (!MakeCurrent()) return -1;
02162 return XaDraw_StrokePathToPath(m_pContext, IPoints, ITypes, ILength, OPoints, OTypes, OLength,
02163 FALSE != Close, LineWidth, LineCaps, LineJoin, Dash );
02164 }
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178
02179
02180
02181
02182 BOOL GDrawAsm::ClipRectangle( LPRECT Rect )
02183 {
02184 CriticalSection Ralph;
02185 CamProfile cp(CAMPROFILE_GDRAW);
02186
02187 return (MakeCurrent() && (XaDraw_ClipRectangle(m_pContext, Rect ) ? FALSE : TRUE));
02188 }
02189
02190
02191
02192
02193
02194
02195
02196
02197
02198
02199
02200
02201
02202
02203
02204
02205
02206
02207 void GDrawAsm::ClearChangedBBox()
02208 {
02209 CriticalSection Ralph;
02210 CamProfile cp(CAMPROFILE_GDRAW);
02211
02212 if (MakeCurrent()) XaDraw_ClearChangedBBox(m_pContext);
02213 }
02214
02215
02216
02217
02218
02219
02220
02221
02222
02223
02224
02225
02226
02227
02228
02229
02230
02231 BOOL GDrawAsm::GetChangedBBox( LPRECT Rect )
02232 {
02233 CriticalSection Ralph;
02234 CamProfile cp(CAMPROFILE_GDRAW);
02235
02236 return (MakeCurrent() && (XaDraw_GetChangedBBox(m_pContext, Rect ) ? FALSE : TRUE));
02237 }
02238
02239
02240
02241
02242
02243
02244
02245
02246
02247
02248
02249
02250
02251
02252
02253
02254
02255 BOOL GDrawAsm::SetChangedBBox( LPRECT Rect )
02256 {
02257 CriticalSection Ralph;
02258 CamProfile cp(CAMPROFILE_GDRAW);
02259
02260 return (MakeCurrent() && (XaDraw_SetChangedBBox(m_pContext, Rect ) ? FALSE : TRUE));
02261 }
02262
02263 COLORREF GDrawAsm::ConvertHSVtoRGB(COLORREF hsv)
02264 {
02265 CriticalSection Ralph;
02266 CamProfile cp(CAMPROFILE_GDRAW);
02267
02268 MakeCurrent();
02269 return XaColour_ConvertHSVtoRGB(hsv );
02270 }
02271
02272 COLORREF GDrawAsm::ConvertRGBtoHSV(COLORREF rgb)
02273 {
02274 CriticalSection Ralph;
02275 CamProfile cp(CAMPROFILE_GDRAW);
02276
02277 MakeCurrent();
02278 return XaColour_ConvertRGBtoHSV( rgb );
02279 }
02280
02281
02282
02283
02284
02285
02286 BOOL GDrawAsm::SetMiterLimit( DWORD MiterLimit)
02287 {
02288 CriticalSection Ralph;
02289 CamProfile cp(CAMPROFILE_GDRAW);
02290
02291 return (MakeCurrent() && (XaDraw_SetMiterLimit(m_pContext,MiterLimit) ? FALSE : TRUE));
02292 }
02293
02294 BOOL GDrawAsm::SetMatrixIntFlag( BOOL Flag)
02295 {
02296 return FALSE;
02297 }
02298
02299 BOOL GDrawAsm::SetDashAdjustmentFlag( BOOL Flag )
02300 {
02301 CriticalSection Ralph;
02302 CamProfile cp(CAMPROFILE_GDRAW);
02303
02304 return (MakeCurrent() && (XaDraw_SetDashAdjustmentFlag(m_pContext, FALSE != Flag) ? FALSE : TRUE));
02305 }
02306
02307 BOOL GDrawAsm::SetInvert( DWORD Colour )
02308 {
02309 CriticalSection Ralph;
02310 CamProfile cp(CAMPROFILE_GDRAW);
02311
02312 return (MakeCurrent() && (XaColour_SetInvert(m_pContext,Colour) ? FALSE : TRUE));
02313 }
02314
02315 BOOL GDrawAsm::InitialiseWithPalette( const LOGPALETTE* Palette )
02316 {
02317 CriticalSection Ralph;
02318 CamProfile cp(CAMPROFILE_GDRAW);
02319
02320 return (MakeCurrent() && (XaColour_InitialiseWithPalette(m_pContext,Palette) ? FALSE : TRUE));
02321 }
02322
02323 const BYTE* GDrawAsm::ReturnBrush()
02324 {
02325 CriticalSection Ralph;
02326 CamProfile cp(CAMPROFILE_GDRAW);
02327
02328 if (!MakeCurrent()) return NULL;
02329 return XaColour_ReturnBrush(m_pContext);
02330 }
02331
02332 const BYTE* GDrawAsm::ReturnBrushRGB()
02333 {
02334 CriticalSection Ralph;
02335 CamProfile cp(CAMPROFILE_GDRAW);
02336
02337 if (!MakeCurrent()) return NULL;
02338 return XaColour_ReturnBrushRGB(m_pContext);
02339 }
02340
02341
02342
02343
02344
02345
02346
02347
02348
02349
02350
02351
02352
02353
02354
02355
02356
02357
02358
02359
02360
02361
02362
02363
02364
02365
02366
02367
02368
02369
02370
02371
02372
02373
02374
02375
02376
02377 BOOL GDrawAsm::SetSeparationTables(const BGR *CyanSepTable,
02378 const BGR *MagentaSepTable,
02379 const BGR *YellowSepTable,
02380 const BGR *BlackSepTable,
02381 const BYTE *UnderColourRemovalTable,
02382 const BYTE *BlackGenerationTable)
02383 {
02384 CriticalSection Ralph;
02385 CamProfile cp(CAMPROFILE_GDRAW);
02386
02387 return(MakeCurrent() &&
02388 (XaColour_SetSeparationTables(m_pContext,CyanSepTable, MagentaSepTable,
02389 YellowSepTable, BlackSepTable,
02390 UnderColourRemovalTable, BlackGenerationTable)
02391 ? FALSE : TRUE));
02392 }
02393
02394
02395
02396
02397
02398
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408
02409
02410
02411
02412
02413
02414
02415
02416
02417
02418
02419
02420
02421
02422
02423
02424
02425
02426
02427
02428
02429 BOOL GDrawAsm::SetBitmapConversionTable( const BGR* BitmapConversionTable )
02430 {
02431 CriticalSection Ralph;
02432 CamProfile cp(CAMPROFILE_GDRAW);
02433
02434 return(MakeCurrent() &&
02435 (XaColour_SetBitmapConversionTable(m_pContext,BitmapConversionTable)
02436 ? FALSE : TRUE));
02437 }
02438
02439
02440 BOOL GDrawAsm::PlotBitmap( LPBITMAPINFOHEADER bmInfo, LPBYTE lpBytes, DWORD Style, LPPOINT Points,
02441 LPRGBQUAD ColourTable,
02442 LPBYTE Red, LPBYTE Green, LPBYTE Blue, LPBYTE Trans)
02443 {
02444 CriticalSection Ralph;
02445 CamProfile cp(CAMPROFILE_GDRAW);
02446
02447 return (MakeCurrent() && (XaBitmap_PlotTile(m_pContext, bmInfo, lpBytes, Style, Points, Points+1, Points+2,
02448 (CONST BGRT*)ColourTable, Red, Green, Blue, Trans)
02449 ? FALSE : TRUE));
02450 }
02451
02452 BOOL GDrawAsm::PlotPerspectiveBitmap( LPBITMAPINFOHEADER bmInfo, LPBYTE lpBytes, DWORD Style, LPPOINT Points,
02453 LPRGBQUAD ColourTable,
02454 LPBYTE Red, LPBYTE Green, LPBYTE Blue, LPBYTE Trans)
02455 {
02456 CriticalSection Ralph;
02457 CamProfile cp(CAMPROFILE_GDRAW);
02458
02459 return (MakeCurrent() && (XaBitmap_PlotTile4(m_pContext, bmInfo, lpBytes, Style, Points, Points+1, Points+2, Points+3,
02460 (CONST BGRT*)ColourTable, Red, Green, Blue, Trans)
02461 ? FALSE : TRUE));
02462 }
02463
02464 INT32 GDrawAsm::CalcStrokeBBox(
02465 CONST POINT *IPoints,
02466 CONST BYTE *ITypes,
02467 DWORD ILength,
02468 LPRECT Rect,
02469 BOOL Close,
02470 DWORD LineWidth,
02471 CapStyles LineCaps,
02472 JoinStyles LineJoin,
02473 CONST DashType *Dash)
02474 {
02475 CriticalSection Ralph;
02476 CamProfile cp(CAMPROFILE_GDRAW);
02477
02478 if (!MakeCurrent()) return -1;
02479 return XaDraw_CalcStrokeBBox(m_pContext, IPoints, ITypes, ILength, Rect,
02480 FALSE != Close, LineWidth, LineCaps, LineJoin, Dash );
02481 }
02482
02483 BOOL GDrawAsm::IsOverlap( LPPOINT Points, const BYTE *Verbs, UINT32 Length, DWORD Winding )
02484 {
02485 CriticalSection Ralph;
02486 CamProfile cp(CAMPROFILE_GDRAW);
02487
02488 return (MakeCurrent() && (XaDraw_IsOverlap(m_pContext, Points, Verbs, Length, Winding ) ? FALSE : TRUE));
02489 }
02490
02491 BOOL GDrawAsm::CalcBBox( LPPOINT Points, const BYTE *Verbs, DWORD Length, LPRECT Rect, BOOL Flatten)
02492 {
02493 CriticalSection Ralph;
02494 CamProfile cp(CAMPROFILE_GDRAW);
02495
02496 return (MakeCurrent() && (XaDraw_CalcBBox(m_pContext, Points, Verbs, Length, Rect, FALSE != Flatten ) ? FALSE: TRUE));
02497 }
02498
02499 INT32 GDrawAsm::MakeRegion( LPPOINT Points, const BYTE *Verbs, UINT32 Length, DWORD Winding, REGION *ORegion, UINT32 OLength)
02500 {
02501 CriticalSection Ralph;
02502 CamProfile cp(CAMPROFILE_GDRAW);
02503
02504 if (!MakeCurrent()) return -1;
02505 return XaDraw_MakeRegion(m_pContext, Points, Verbs, Length, Winding, ORegion, OLength );
02506 }
02507
02508 BOOL GDrawAsm::DeviceClipRectangle( LPRECT Rect)
02509 {
02510 CriticalSection Ralph;
02511 CamProfile cp(CAMPROFILE_GDRAW);
02512
02513 return (MakeCurrent() && (XaDraw_DeviceClipRectangle(m_pContext, Rect ) ? FALSE: TRUE));
02514 }
02515
02516 BOOL GDrawAsm::GetDeviceClipRectangle( LPRECT Rect)
02517 {
02518 CriticalSection Ralph;
02519 CamProfile cp(CAMPROFILE_GDRAW);
02520
02521 return (MakeCurrent() && (XaDraw_GetDeviceClipRectangle(m_pContext, Rect ) ? FALSE: TRUE));
02522 }
02523
02524 BOOL GDrawAsm::ClipRegion( const REGION* Region)
02525 {
02526 CriticalSection Ralph;
02527 CamProfile cp(CAMPROFILE_GDRAW);
02528
02529 return (MakeCurrent() && (XaDraw_ClipRegion(m_pContext, Region ) ? FALSE: TRUE));
02530 }
02531
02532 CONST REGION* GDrawAsm::GetClipRegion()
02533 {
02534 CriticalSection Ralph;
02535 CamProfile cp(CAMPROFILE_GDRAW);
02536
02537 return MakeCurrent() ? XaDraw_GetClipRegion(m_pContext) : NULL;
02538 }
02539
02540 BOOL GDrawAsm::HintPath(
02541 CONST POINT *Points,
02542 CONST BYTE *Types,
02543 UINT32 Length,
02544 BOOL Close,
02545 DWORD LineWidth)
02546 {
02547
02548 return FALSE;
02549 }
02550
02551 INT32 GDrawAsm::MakeUnclippedRegion(
02552 CONST POINT *Points,
02553 CONST BYTE *Types,
02554 UINT32 Length,
02555 DWORD Winding,
02556 REGION *ORegion,
02557 UINT32 OLength)
02558 {
02559 CriticalSection Ralph;
02560 CamProfile cp(CAMPROFILE_GDRAW);
02561
02562 if (!MakeCurrent()) return -1;
02563 return XaDraw_MakeUnclippedRegion(m_pContext, Points, Types, Length, Winding, ORegion, OLength );
02564 }
02565
02566
02567 BOOL GDrawAsm::FillRegion( CONST REGION *Region, CONST POINT *Offset )
02568 {
02569 CriticalSection Ralph;
02570 CamProfile cp(CAMPROFILE_GDRAW);
02571
02572 return (MakeCurrent() && (XaDraw_FillRegion(m_pContext, Region, Offset ) ? FALSE: TRUE));
02573 }
02574
02575 INT32 GDrawAsm::SetBevelContrast(UINT32 nContrast)
02576 {
02577 CriticalSection Ralph;
02578 CamProfile cp(CAMPROFILE_GDRAW);
02579
02580 if (!MakeCurrent())
02581 return -1;
02582
02583 return XaDraw_SetBevelContrast(m_pContext,nContrast) ? FALSE : TRUE;
02584 }
02585
02586 INT32 GDrawAsm::SetBevelLightness(UINT32 nContrast)
02587 {
02588 CriticalSection Ralph;
02589 CamProfile cp(CAMPROFILE_GDRAW);
02590
02591 if (!MakeCurrent())
02592 return -1;
02593
02594 return XaDraw_SetBevelLightness(m_pContext,nContrast);
02595 }
02596
02597 INT32 GDrawAsm::SetBevelDarkness(UINT32 nContrast)
02598 {
02599 CriticalSection Ralph;
02600 CamProfile cp(CAMPROFILE_GDRAW);
02601
02602 if (!MakeCurrent())
02603 return -1;
02604
02605 return XaDraw_SetBevelDarkness(m_pContext,nContrast);
02606 }
02607
02608 INT32 GDrawAsm::TranslateBevelValue(BYTE nIndex, BYTE Colour)
02609 {
02610 CriticalSection Ralph;
02611 CamProfile cp(CAMPROFILE_GDRAW);
02612
02613 if (!MakeCurrent())
02614 return -1;
02615
02616 return XaDraw_TranslateBevelValue(m_pContext,nIndex, Colour);
02617 }
02618
02619 BOOL GDrawAsm::Set3WayGraduation(DWORD Style,
02620 COLORREF ColourA, COLORREF ColourB, COLORREF ColourD,
02621 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
02622 {
02623 CriticalSection Ralph;
02624 CamProfile cp(CAMPROFILE_GDRAW);
02625
02626 return (MakeCurrent() && (
02627 XaColour_Set3WayGraduation(m_pContext,Style, ColourA, ColourB, ColourD, PointA, PointB, PointD)
02628 ? FALSE : TRUE) );
02629 }
02630
02631
02632 BOOL GDrawAsm::Set3WayGraduation4(DWORD Style,
02633 COLORREF ColourA, COLORREF ColourB, COLORREF ColourD,
02634 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
02635 {
02636 CriticalSection Ralph;
02637 CamProfile cp(CAMPROFILE_GDRAW);
02638
02639 return (MakeCurrent() && (
02640 XaColour_Set3WayGraduation4(m_pContext,Style, ColourA, ColourB, ColourD, PointA, PointB, PointC, PointD)
02641 ? FALSE : TRUE) );
02642 }
02643
02644
02645 BOOL GDrawAsm::Set4WayGraduation(DWORD Style,
02646 COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD,
02647 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
02648 {
02649 CriticalSection Ralph;
02650 CamProfile cp(CAMPROFILE_GDRAW);
02651
02652 return (MakeCurrent() && (
02653 XaColour_Set4WayGraduation(m_pContext,Style, ColourA, ColourB, ColourC, ColourD, PointA, PointB, PointD)
02654 ? FALSE : TRUE) );
02655 }
02656
02657
02658 BOOL GDrawAsm::Set4WayGraduation4(DWORD Style,
02659 COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD,
02660 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
02661 {
02662 CriticalSection Ralph;
02663 CamProfile cp(CAMPROFILE_GDRAW);
02664
02665 return (MakeCurrent() && (
02666 XaColour_Set4WayGraduation4(m_pContext,Style, ColourA, ColourB, ColourC, ColourD, PointA, PointB, PointC, PointD)
02667 ? FALSE : TRUE) );
02668 }
02669
02670
02671 BOOL GDrawAsm::SetTransparent3WayGraduation(DWORD Style,
02672 BYTE ValueA, BYTE ValueB, BYTE ValueD,
02673 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
02674 {
02675 CriticalSection Ralph;
02676 CamProfile cp(CAMPROFILE_GDRAW);
02677
02678 return (MakeCurrent() && (
02679 XaColour_SetTransparent3WayGraduation(m_pContext,Style, ValueA, ValueB, ValueD, PointA, PointB, PointD)
02680 ? FALSE : TRUE) );
02681 }
02682
02683
02684 BOOL GDrawAsm::SetTransparent3WayGraduation4(DWORD Style,
02685 BYTE ValueA, BYTE ValueB, BYTE ValueD,
02686 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
02687 {
02688 CriticalSection Ralph;
02689 CamProfile cp(CAMPROFILE_GDRAW);
02690
02691 return (MakeCurrent() && (
02692 XaColour_SetTransparent3WayGraduation4(m_pContext,Style, ValueA, ValueB, ValueD, PointA, PointB, PointC, PointD)
02693 ? FALSE : TRUE) );
02694 }
02695
02696
02697 BOOL GDrawAsm::SetTransparent4WayGraduation(DWORD Style,
02698 BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
02699 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
02700 {
02701 CriticalSection Ralph;
02702 CamProfile cp(CAMPROFILE_GDRAW);
02703
02704 return (MakeCurrent() && (
02705 XaColour_SetTransparent4WayGraduation(m_pContext,Style, ValueA, ValueB, ValueC, ValueD, PointA, PointB, PointD)
02706 ? FALSE : TRUE) );
02707 }
02708
02709
02710 BOOL GDrawAsm::SetTransparent4WayGraduation4(DWORD Style,
02711 BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
02712 CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
02713 {
02714 CriticalSection Ralph;
02715 CamProfile cp(CAMPROFILE_GDRAW);
02716
02717 return (MakeCurrent() && (
02718 XaColour_SetTransparent4WayGraduation4(m_pContext,Style, ValueA, ValueB, ValueC, ValueD, PointA, PointB, PointC, PointD)
02719 ? FALSE : TRUE) );
02720 }