Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

sysmet.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

BOOL APIENTRY _SwapMouseButton (BOOL fSwapButtons)
BOOL APIENTRY _SetDoubleClickTime (UINT dtTime)
VOID SetSysColor (UINT icol, DWORD rgb, UINT uOptions)
BOOL APIENTRY xxxSetSysColors (PUNICODE_STRING pProfileUserName, int cicol, PUINT picolor, COLORREF *prgb, UINT uOptions)


Function Documentation

BOOL APIENTRY _SetDoubleClickTime UINT  dtTime  ) 
 

Definition at line 74 of file sysmet.c.

References APIENTRY, BOOL, CheckWinstaWriteAttributesAccess(), FALSE, gdtDblClk, gpsi, InitTooltipDelay(), NULL, PpiCurrent, tagWINDOWSTATION::rpdeskList, tagDESKTOP::rpdeskNext, tagDESKTOP::spwndTooltip, and TRUE.

Referenced by xxxSystemParametersInfo().

00076 { 00077 PWINDOWSTATION pwinsta = PpiCurrent()->rpwinsta; 00078 00079 /* 00080 * Blow it off if the caller doesn't have the proper access rights 00081 */ 00082 if (!CheckWinstaWriteAttributesAccess()) { 00083 return FALSE; 00084 } 00085 00086 if (!dtTime) { 00087 dtTime = 500; 00088 } else if (dtTime > 5000) { 00089 dtTime = 5000; 00090 } 00091 00092 gdtDblClk = dtTime; 00093 gpsi->dtLBSearch = dtTime * 4; // dtLBSearch = 4 * gdtDblClk 00094 gpsi->dtScroll = gpsi->dtLBSearch / 5; // dtScroll = 4/5 * gdtDblClk 00095 /* 00096 * This value should be set through SPI_SETMENUSHOWDELAY 00097 * gdtMNDropDown = gpsi->dtScroll; // gdtMNDropDown = 4/5 * gdtDblClk 00098 */ 00099 00100 /* 00101 * Recalculate delays for tooltip windows on all desktops. 00102 */ 00103 if (pwinsta != NULL) { 00104 PDESKTOP pdesk; 00105 for (pdesk = pwinsta->rpdeskList; pdesk; pdesk = pdesk->rpdeskNext) { 00106 InitTooltipDelay((PTOOLTIPWND)pdesk->spwndTooltip); 00107 } 00108 } 00109 00110 return TRUE; 00111 }

BOOL APIENTRY _SwapMouseButton BOOL  fSwapButtons  ) 
 

Definition at line 25 of file sysmet.c.

References tagPROCESSINFO::amwinsta, APIENTRY, BOOL, FALSE, gbMouseButtonsRecentlySwapped, PpiCurrent, RETURN_IF_ACCESS_DENIED, and SYSMET.

Referenced by xxxSystemParametersInfo().

00027 { 00028 BOOL fSwapOld; 00029 PPROCESSINFO ppiCurrent = PpiCurrent(); 00030 00031 /* 00032 * Blow it off if the caller doesn't have the proper access rights 00033 */ 00034 RETURN_IF_ACCESS_DENIED(ppiCurrent->amwinsta, 00035 WINSTA_READATTRIBUTES | WINSTA_WRITEATTRIBUTES, 00036 FALSE); 00037 00038 if (!(ppiCurrent->W32PF_Flags & W32PF_IOWINSTA)) { 00039 RIPERR0(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION, 00040 RIP_WARNING, 00041 "SwapMouseButton invalid on a non-interactive WindowStation."); 00042 00043 return FALSE; 00044 } 00045 00046 fSwapOld = SYSMET(SWAPBUTTON); 00047 SYSMET(SWAPBUTTON) = fSwapButtons; 00048 00049 /* 00050 * Give xxxButtonEvent a hint that a mouse button event may have to be 00051 * left/right swapped to correspond with our current async key state. 00052 * Toggle the global since an even number of SwapMouseButtons has no effect. 00053 */ 00054 if (fSwapButtons != fSwapOld) { 00055 gbMouseButtonsRecentlySwapped = !gbMouseButtonsRecentlySwapped; 00056 } 00057 00058 /* 00059 * Return previous state 00060 */ 00061 return fSwapOld; 00062 }

VOID SetSysColor UINT  icol,
DWORD  rgb,
UINT  uOptions
 

Definition at line 121 of file sysmet.c.

References DWORD, tagDISPLAYINFO::fAnyPalette, gpDispInfo, gpsi, tagDISPLAYINFO::hdcScreen, NULL, SSCF_16COLORS, SSCF_FORCESOLIDCOLOR, SSCF_SETMAGICCOLORS, SYSHBRUSH, and VOID().

Referenced by xxxSetSysColors().

00126 { 00127 00128 if ((uOptions & SSCF_SETMAGICCOLORS) && gpDispInfo->fAnyPalette) { 00129 union { 00130 DWORD rgb; 00131 PALETTEENTRY pe; 00132 } peMagic; 00133 00134 peMagic.rgb = rgb; 00135 00136 /* 00137 * when any of the 3D colors are changing, call GDI to 00138 * set the apropiate "magic" color 00139 * 00140 * the four magic colors are reserved like so 00141 * 00142 * 8 - UI color (3D shadow) 00143 * 9 - UI color (3D face) 00144 * 00145 * F6 - UI color (3D hilight) 00146 * F7 - UI color (desktop) 00147 * 00148 * NOTE (3D hilight) inverts to (3D shadow) 00149 * (3D face) inverts to sys gray 00150 * 00151 */ 00152 00153 switch (icol) 00154 { 00155 case COLOR_3DSHADOW: 00156 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 8); 00157 break; 00158 00159 case COLOR_3DFACE: 00160 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 9); 00161 break; 00162 00163 case COLOR_3DHILIGHT: 00164 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 246); 00165 break; 00166 00167 case COLOR_DESKTOP: 00168 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 247); 00169 break; 00170 } 00171 } 00172 00173 if (uOptions & SSCF_16COLORS) { 00174 /* 00175 * Force solid colors for all elements in 16 color or less modes. 00176 */ 00177 rgb = GreGetNearestColor(gpDispInfo->hdcScreen, rgb); 00178 } else if (uOptions & SSCF_FORCESOLIDCOLOR) { 00179 /* 00180 * Force solid colors for certain window elements. 00181 */ 00182 switch (icol) { 00183 00184 /* 00185 * These can be dithers 00186 */ 00187 case COLOR_DESKTOP: 00188 case COLOR_ACTIVEBORDER: 00189 case COLOR_INACTIVEBORDER: 00190 case COLOR_APPWORKSPACE: 00191 case COLOR_INFOBK: 00192 case COLOR_GRADIENTACTIVECAPTION: 00193 case COLOR_GRADIENTINACTIVECAPTION: 00194 break; 00195 00196 default: 00197 rgb = GreGetNearestColor(gpDispInfo->hdcScreen, rgb); 00198 break; 00199 } 00200 } 00201 00202 gpsi->argbSystem[icol] = rgb; 00203 if (SYSHBRUSH(icol) == NULL) { 00204 /* 00205 * This is the first time we're setting up the system colors. 00206 * We need to create the brush 00207 */ 00208 SYSHBRUSH(icol) = GreCreateSolidBrush(rgb); 00209 GreMarkUndeletableBrush(SYSHBRUSH(icol)); 00210 GreSetBrushOwnerPublic(SYSHBRUSH(icol)); 00211 } else { 00212 GreSetSolidBrush(SYSHBRUSH(icol), rgb); 00213 } 00214 }

BOOL APIENTRY xxxSetSysColors PUNICODE_STRING  pProfileUserName,
int  cicol,
PUINT  picolor,
COLORREF *  prgb,
UINT  uOptions
 

Definition at line 225 of file sysmet.c.

References APIENTRY, BOOL, CheckWinstaWriteAttributesAccess(), FALSE, gpDispInfo, tagDISPLAYINFO::hdcScreen, L, NULL, PWND_BROADCAST, RecolorDeskPattern(), SetSysColor(), SSCF_16COLORS, SSCF_NOTIFY, SSCF_SETMAGICCOLORS, TRUE, UINT, xxxRedrawScreen, xxxSendNotifyMessage(), and xxxSetWindowNCMetrics().

00231 { 00232 int i; 00233 UINT icol; 00234 COLORREF rgb; 00235 00236 /* 00237 * Blow it off if the caller doesn't have the proper access rights 00238 */ 00239 if ((uOptions & SSCF_NOTIFY) && !CheckWinstaWriteAttributesAccess()) { 00240 return FALSE; 00241 } 00242 00243 if (GreGetDeviceCaps(gpDispInfo->hdcScreen, NUMCOLORS) <= 16) { 00244 uOptions |= SSCF_16COLORS; 00245 } 00246 00247 if (uOptions & SSCF_SETMAGICCOLORS) { 00248 /* 00249 * Set the Magic colors first 00250 */ 00251 for(i = 0; i < cicol; i++) { 00252 icol = picolor[i]; 00253 rgb = prgb[i]; 00254 if ( icol == COLOR_3DFACE || 00255 icol == COLOR_3DSHADOW || 00256 icol == COLOR_3DHILIGHT || 00257 icol == COLOR_DESKTOP) { 00258 00259 SetSysColor(icol, rgb, uOptions); 00260 } 00261 } 00262 } 00263 00264 for (i = 0; i < cicol; i++) { 00265 00266 icol = *picolor++; 00267 rgb = *prgb++; 00268 00269 if (icol >= COLOR_MAX) 00270 continue; 00271 00272 if ((uOptions & SSCF_SETMAGICCOLORS) && 00273 (icol == COLOR_3DFACE || 00274 icol == COLOR_3DSHADOW || 00275 icol == COLOR_3DHIGHLIGHT || 00276 icol == COLOR_DESKTOP)) { 00277 continue; 00278 } 00279 00280 SetSysColor(icol, rgb, uOptions); 00281 } 00282 00283 if (uOptions & SSCF_NOTIFY) { 00284 00285 /* 00286 * Recolor all the current desktop 00287 */ 00288 RecolorDeskPattern(); 00289 00290 /* 00291 * Render the system bitmaps in new colors before we broadcast 00292 */ 00293 00294 xxxSetWindowNCMetrics(pProfileUserName,NULL, FALSE, -1); 00295 00296 00297 /* 00298 * Notify everyone that the colors have changed. 00299 */ 00300 xxxSendNotifyMessage(PWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0L); 00301 00302 /* 00303 * Just redraw the entire screen. Trying to just draw the parts 00304 * that were changed isn't worth it, since Control Panel always 00305 * resets every color anyway. 00306 * 00307 * Anyway, it could get messy, sending apps NCPAINT messages without 00308 * accumulating update regions too. 00309 */ 00310 xxxRedrawScreen(); 00311 } 00312 00313 return TRUE; 00314 }


Generated on Sat May 15 19:45:44 2004 for test by doxygen 1.3.7