Changeset 79:67d24430822a
- Timestamp:
- 02/06/08 05:08:01 (1 year ago)
- Files:
-
- dwt/dwthelper/utils.d (modified) (3 diffs)
- dwt/internal/gdip/native.d (modified) (3 diffs)
- dwt/internal/win32/OS.d (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/dwthelper/utils.d
r78 r79 148 148 } 149 149 150 struct GCStats {150 private struct GCStats { 151 151 size_t poolsize; // total size of pool 152 152 size_t usedsize; // bytes allocated … … 155 155 size_t pageblocks; // number of blocks marked PAGE 156 156 } 157 extern(C) GCStats gc_stats(); 157 private extern(C) GCStats gc_stats(); 158 158 159 size_t RuntimeTotalMemory(){ 159 160 GCStats s = gc_stats(); … … 161 162 } 162 163 163 }164 164 165 165 dwt/internal/gdip/native.d
r78 r79 13 13 module dwt.internal.gdip.native; 14 14 15 private import dwt.internal.win32.WINTYPES; 16 // private import tango.core.Memory; 15 import dwt.internal.win32.WINTYPES; 16 import tango.sys.SharedLib : SharedLib; 17 import tango.util.log.Trace; 17 18 18 19 extern(Windows): … … 722 723 Status GdipSetStringFormatTabStops( Handle format, float firstTabOffset, int count, float* tabStops); 723 724 725 void loadLib_Gdip(){ 726 // do nothing in this version 727 } 724 728 725 729 } … … 1672 1676 ]; 1673 1677 1674 } 1675 1678 1679 void loadLib_Gdip(){ 1680 if (auto lib = SharedLib.load(`gdiplus.dll`)) { 1681 foreach( inout s; symbols ){ 1682 *s.symbol = lib.getSymbol( s.name.ptr ); 1683 if( s.symbol is null ){ 1684 Trace.formatln("gdiplus.dll: Symbol '{}' not found", s.name ); 1685 } 1686 } 1687 } else { 1688 Trace.formatln("Could not load the library gdiplus.dll"); 1689 } 1690 } 1691 1692 } 1676 1693 1677 1694 /****************************************************************************** dwt/internal/win32/OS.d
r78 r79 19 19 import dwt.internal.C; 20 20 import dwt.internal.Library; 21 import tango.sys.SharedLib : SharedLib; 22 import tango.util.log.Trace; 21 23 22 24 … … 58 60 59 61 public class OS : C { 62 63 struct Symbol { 64 char[] name; 65 void** symbol; 66 } 60 67 61 68 public static HINSTANCE GetLibraryHandle(){ … … 4072 4079 // UxTheme dummies until dynamic loading is in place. 4073 4080 // ---------------------------------------------------------------------------- 4074 public static { 4075 BOOL IsAppThemed(){ 4076 return 0; 4077 } 4078 4079 HRESULT DrawThemeBackground( 4081 public static extern(Windows) { 4082 BOOL function ( 4083 ) IsAppThemed; 4084 4085 HRESULT function( 4080 4086 HTHEME hTheme, 4081 4087 HDC hdc, … … 4084 4090 RECT *pRect, 4085 4091 RECT *pClipRect 4086 ) 4087 { 4088 return S_OK; 4089 } 4090 4091 4092 HRESULT DrawThemeEdge( 4092 ) DrawThemeBackground; 4093 4094 HRESULT function( 4093 4095 HTHEME hTheme, 4094 4096 HDC hdc, … … 4099 4101 UINT uFlags, 4100 4102 LPRECT pContentRect 4101 ) 4102 { 4103 return S_OK; 4104 } 4105 4106 4107 HRESULT DrawThemeIcon( 4103 ) DrawThemeEdge; 4104 4105 HRESULT function( 4108 4106 HTHEME hTheme, 4109 4107 HDC hdc, … … 4113 4111 HIMAGELIST himl, 4114 4112 int iImageIndex 4115 ) 4116 { 4117 return S_OK; 4118 } 4119 4120 4121 HRESULT DrawThemeParentBackground( 4113 ) DrawThemeIcon; 4114 4115 HRESULT function( 4122 4116 HWND hwnd, 4123 4117 HDC hdc, 4124 4118 RECT *prc 4125 ) 4126 { 4127 return S_OK; 4128 } 4129 4130 HRESULT DrawThemeText( 4119 ) DrawThemeParentBackground; 4120 4121 HRESULT function( 4131 4122 HTHEME hTheme, 4132 4123 HDC hdc, … … 4138 4129 DWORD dwTextFlags2, 4139 4130 LPCRECT pRect 4140 ) 4141 { 4142 return S_OK; 4143 } 4144 4145 HTHEME OpenThemeData( 4131 ) DrawThemeText; 4132 4133 HTHEME function( 4146 4134 HWND hwnd, 4147 4135 LPCWSTR pszClassList 4148 ) 4149 { 4150 return null; 4151 } 4152 4153 4154 HRESULT BufferedPaintInit(){ 4155 return S_OK; 4156 } 4157 4158 HRESULT CloseThemeData( 4136 ) OpenThemeData; 4137 4138 HRESULT function( 4139 )BufferedPaintInit; 4140 4141 HRESULT function( 4159 4142 HTHEME hTheme 4160 ){ 4161 return S_OK; 4162 } 4163 4164 4165 HRESULT BufferedPaintUnInit(){ 4166 return S_OK; 4167 } 4168 4169 HPAINTBUFFER BeginBufferedPaint( 4143 ) CloseThemeData; 4144 4145 HRESULT function( 4146 ) BufferedPaintUnInit; 4147 4148 HPAINTBUFFER function( 4170 4149 HDC hdcTarget, 4171 4150 RECT *prcTarget, … … 4173 4152 void*/+BP_PAINTPARAMS+/ pPaintParams, 4174 4153 HDC *phdc 4175 ){ 4176 return null; 4177 } 4178 4179 4180 HRESULT EndBufferedPaint( 4154 ) BeginBufferedPaint; 4155 4156 HRESULT function( 4181 4157 HPAINTBUFFER hBufferedPaint, 4182 4158 BOOL fUpdateTarget 4183 ){ 4184 return S_OK; 4185 } 4186 4187 HRESULT GetThemeTextExtent( 4159 ) EndBufferedPaint; 4160 4161 HRESULT function( 4188 4162 HTHEME hTheme, 4189 4163 HDC hdc, … … 4195 4169 LPCRECT pBoundingRect, 4196 4170 LPRECT pExtentRect 4197 ) 4198 { 4199 return S_OK; 4200 } 4201 4202 HRESULT SetWindowTheme( 4171 ) GetThemeTextExtent; 4172 4173 HRESULT function( 4203 4174 HWND hwnd, 4204 4175 LPCWSTR pszSubAppName, 4205 4176 LPCWSTR pszSubIdList 4206 ) 4207 { 4208 return S_OK; 4209 } 4177 ) SetWindowTheme; 4178 4210 4179 } // public static 4211 4180 4181 static Symbol[] Symbols_UxTheme = [ 4182 { "IsAppThemed", cast(void**)& IsAppThemed }, 4183 { "DrawThemeBackground", cast(void**)& DrawThemeBackground }, 4184 { "DrawThemeEdge", cast(void**)& DrawThemeEdge }, 4185 { "DrawThemeIcon", cast(void**)& DrawThemeIcon }, 4186 { "DrawThemeParentBackground", cast(void**)& DrawThemeParentBackground }, 4187 { "DrawThemeText", cast(void**)& DrawThemeText }, 4188 { "OpenThemeData", cast(void**)& OpenThemeData }, 4189 { "BufferedPaintInit", cast(void**)& BufferedPaintInit }, 4190 { "CloseThemeData", cast(void**)& CloseThemeData }, 4191 { "BufferedPaintUnInit", cast(void**)& BufferedPaintUnInit }, 4192 { "BeginBufferedPaint", cast(void**)& BeginBufferedPaint }, 4193 { "EndBufferedPaint", cast(void**)& EndBufferedPaint }, 4194 { "GetThemeTextExtent", cast(void**)& GetThemeTextExtent }, 4195 { "SetWindowTheme", cast(void**)& SetWindowTheme }, 4196 ]; 4197 4198 static void loadLib_UxTheme(){ 4199 if (auto lib = SharedLib.load(`uxtheme.dll`)) { 4200 foreach( inout s; Symbols_UxTheme ){ 4201 *s.symbol = lib.getSymbol( s.name.ptr ); 4202 if( s.symbol is null ){ 4203 Trace.formatln("UxTheme.dll: Symbol '{}' not found", s.name ); 4204 } 4205 } 4206 } else { 4207 Trace.formatln("Could not load the library UxTheme.dll"); 4208 } 4209 } 4212 4210 //---------------------------------------------------------------------- 4213 4211 // Coreimm.lib (WinCE) 4212 // this function vars exist primarily for link error elimination 4214 4213 //---------------------------------------------------------------------- 4215 4214 public static extern(Windows) { … … 4303 4302 ) ImmSetOpenStatus; 4304 4303 4305 } // public static 4304 } // public static extern(Windows) 4305 4306 static Symbol[] Symbols_CoreImm = [ 4307 { "ImmAssociateContext", cast(void**)& ImmAssociateContext }, 4308 { "ImmCreateContext", cast(void**)& ImmCreateContext }, 4309 { "ImmDestroyContext", cast(void**)& ImmDestroyContext }, 4310 { "ImmGetContext", cast(void**)& ImmGetContext }, 4311 { "ImmGetConversionStatus", cast(void**)& ImmGetConversionStatus }, 4312 { "ImmGetDefaultIMEWnd", cast(void**)& ImmGetDefaultIMEWnd }, 4313 { "ImmGetOpenStatus", cast(void**)& ImmGetOpenStatus }, 4314 { "ImmReleaseContext", cast(void**)& ImmReleaseContext }, 4315 { "ImmSetCompositionFont", cast(void**)& ImmSetCompositionFont }, 4316 { "ImmGetCompositionString", cast(void**)& ImmGetCompositionString }, 4317 { "ImmGetCompositionFont", cast(void**)& ImmGetCompositionFont }, 4318 { "ImmSetCompositionFont", cast(void**)& ImmSetCompositionFont }, 4319 { "ImmGetCompositionString", cast(void**)& ImmGetCompositionString }, 4320 { "ImmGetCompositionFont", cast(void**)& ImmGetCompositionFont }, 4321 { "ImmSetCompositionWindow", cast(void**)& ImmSetCompositionWindow }, 4322 { "ImmSetConversionStatus", cast(void**)& ImmSetConversionStatus }, 4323 { "ImmSetOpenStatus", cast(void**)& ImmSetOpenStatus }, 4324 ]; 4325 4326 static void loadLib_CoreImm(){ 4327 if (auto lib = SharedLib.load(`coreimm.dll`)) { 4328 foreach( inout s; Symbols_CoreImm ){ 4329 *s.symbol = lib.getSymbol( s.name.ptr ); 4330 if( s.symbol is null ){ 4331 Trace.formatln("CoreImm.dll: Symbol '{}' not found", s.name ); 4332 } 4333 } 4334 } else { 4335 Trace.formatln("Could not load the library coreimm.dll"); 4336 } 4337 } 4338 4306 4339 //------------------------------------------------------------------------ 4307 4340 /** All Natives */
