57{
59
60 if (!_strnicmp(broam, "@xoblite", 8))
61 {
63
66 LPSTR tokens[4];
67 tokens[0] = token1;
68 tokens[1] = token2;
69 tokens[2] = token3;
70 tokens[3] = token4;
71
72 token1[0] = token2[0] = token3[0] = token4[0] = extra[0] = '\0';
74
75
76
77 if (!_stricmp(token2, "About"))
78 {
79 if (!_stricmp(token3, "Plugins"))
80 {
82 }
83 else if (!_stricmp(token3, "Style"))
84 {
91 sprintf(aboutStyle, "%s \nby %s \n%s \n\n%s \n\n%s ", a1, a2, a3, a4, a5);
93 }
94 else if (!_stricmp(token3, "Hide"))
95 {
97 }
98 else
99 {
101 ULONG* size = 0;
102 DWORD number = GetFileVersionInfoSize("Blackbox.exe", size);
103 GetFileVersionInfo("Blackbox.exe", NULL, number, (LPVOID)buffer);
104 void* value;
105 UINT bytes;
106 VerQueryValue(buffer, TEXT("\\StringFileInfo\\000004b0\\FileVersion"), &value, &bytes);
107
108 char title[32];
109 strcpy(title, "About xoblite...");
111
113 {
114 char buildType[32];
115 if (
pSettings->runningUnderWOW64) strcpy(buildType,
"64-bit on ");
116 else strcpy(buildType, "32-bit on ");
117 if (
pSettings->machineArchitecture == IMAGE_FILE_MACHINE_I386) strcat(buildType,
"Intel CPU");
118 else if (
pSettings->machineArchitecture == IMAGE_FILE_MACHINE_AMD64) strcat(buildType,
"AMD CPU");
119 else if (
pSettings->machineArchitecture == IMAGE_FILE_MACHINE_ARM64) strcat(buildType,
"ARM CPU");
120 else strcat(buildType, "unknown CPU");
121
122 sprintf(body, "xoblite\x99 %s | %s\n", (LPCSTR)value, buildType);
123 }
124 else sprintf(body, "xoblite\x99 %s\n", (LPCSTR)value);
125
126 strcat(body,
127 "\xA9 2002-2025 Karl Henrik Henriksson [qwilk/@xoblite]\n"
128 "\xA9 2001-2004 The Blackbox for Windows Development Team\n\n"
129 "Contains a heavily modified version of the BImage rendering engine\n"
130 "used in the original \"Blackbox\" window manager for the X Window System\n"
131 "\xA9 1997-2000 Bradley T Hughes\n"
132 "\xA9 2001-2002 Sean 'Shaleh' Perry\n\n"
133 "More information about xoblite can be found in the documentation... :)\n\n"
134 "http://xoblite.net/\n"
135 "https://github.com/xoblite/");
137 }
138
139 return true;
140 }
141
142
143
144 else if (!_stricmp(token2, "Run"))
145 {
147 return true;
148 }
149
150
151
152 else if (!_stricmp(token2, "CheckForUpdates"))
153 {
154 bool silent = false;
156 return true;
157 }
158
159
160
161 else if (!_stricmp(token2, "LoadPlugin"))
162 {
164 else
165 {
168 }
169 return true;
170 }
171 else if (!_stricmp(token2, "UnloadPlugin"))
172 {
173 if (token3[0] == '#')
174 {
175 int pluginNumber = atoi(&token3[1]) - 1;
176
177 if (!_stricmp(token4,
"<Yes>"))
pPluginManager->UnloadPlugin(NULL, pluginNumber);
178 else
179 {
182 sprintf(msg, "Are you sure you want to unload %s?", pluginName);
183
185 sprintf(popupBroam, "@xoblite UnloadPlugin %s <Yes>", token3);
186
188 }
189 }
191
192 return true;
193 }
194 else if (!_stricmp(token2, "TogglePluginLoaded"))
195 {
197 if (strlen(extra)) sprintf(path, "%s %s %s", token3, token4, extra);
198 else if (strlen(token4)) sprintf(path, "%s %s", token3, token4);
199 else strcpy(path, token3);
200
201 if (strlen(path))
202 {
206
209 }
210
211 return true;
212 }
213
214
215
216
217 else if (!_stricmp(token2, "Toolbar"))
218 {
221 else if (!_stricmp(token3, "Toggle"))
222 {
223 if (strlen(token4) > 0)
224 {
225 if (!_stricmp(token4, "Label"))
226 {
228 else pSettings->toolbarLabelHidden =
false;
230 }
231 else if (!_stricmp(token4, "DownUp"))
232 {
233 if (!
pSettings->toolbarDownUpButtonsHidden)
pSettings->toolbarDownUpButtonsHidden =
true;
234 else pSettings->toolbarDownUpButtonsHidden =
false;
236 }
237 else if (!_stricmp(token4, "LeftRight"))
238 {
239 if (!
pSettings->toolbarLeftRightButtonsHidden)
pSettings->toolbarLeftRightButtonsHidden =
true;
240 else pSettings->toolbarLeftRightButtonsHidden =
false;
242 }
243 else if (!_stricmp(token4, "Clock"))
244 {
246 else pSettings->toolbarClockHidden =
false;
248 }
249 else if (!_stricmp(token4, "Asymmetry"))
250 {
252 else pSettings->toolbarAllowAsymmetry =
false;
254 }
255
258 }
260 }
261 else if (!_stricmp(token3, "Placement"))
262 {
263 char placement[255];
264 sprintf(placement, "%s %s", token4, extra);
271 }
272 else if (!_stricmp(token3, "Orientation"))
273 {
274 if (!_stricmp(token4,
"Vertical"))
pSettings->toolbarVertical =
true;
279 }
280 else if (!_stricmp(token3, "ToggleOrientation"))
281 {
287 }
288 else if (!_stricmp(token3, "Transparency"))
289 {
290 if (!_stricmp(token4, "Label"))
291 {
292 pSettings->toolbarLabelTransparencyAlpha = atoi(extra);
294 }
295 else if (!_stricmp(token4, "WindowLabel"))
296 {
297 pSettings->toolbarWindowLabelTransparencyAlpha = atoi(extra);
298 WriteInt(
pSettings->xobrcFile,
"xoblite.toolbar.windowlabel.transparency.alpha:",
pSettings->toolbarWindowLabelTransparencyAlpha);
299 }
300 else if (!_stricmp(token4, "Clock"))
301 {
302 pSettings->toolbarClockTransparencyAlpha = atoi(extra);
304 }
305 else if (!_stricmp(token4, "Button"))
306 {
307 pSettings->toolbarButtonTransparencyAlpha = atoi(extra);
309 }
310 else if (!_stricmp(token4, "ActiveTask"))
311 {
312 pSettings->taskbarActiveTransparencyAlpha = atoi(extra);
314 }
315 else
316 {
317 pSettings->toolbarTransparencyAlpha = atoi(token4);
319 }
320
322 }
323 else if (!_stricmp(token3, "Button"))
324 {
325 if (!_stricmp(token4, "Down"))
326 {
327 strcpy(
pSettings->toolbarDownButtonOverride, extra);
329 return true;
330 }
331 else if (!_stricmp(token4, "Up"))
332 {
333 strcpy(
pSettings->toolbarUpButtonOverride, extra);
335 return true;
336 }
337 else if (!_stricmp(token4, "Left"))
338 {
339 strcpy(
pSettings->toolbarLeftButtonOverride, extra);
341 return true;
342 }
343 else if (!_stricmp(token4, "Right"))
344 {
345 strcpy(
pSettings->toolbarRightButtonOverride, extra);
347 return true;
348 }
349 }
350 else if (!_stricmp(token3, "MoveToMouse"))
351 {
354 }
355 else if (!_stricmp(token3, "MoveToTop"))
356 {
357 SetForegroundWindow(
pToolbar->hToolbarWnd);
359 }
360 else if (!_stricmp(token3, "ToggleRoundedCorners"))
361 {
363 else pSettings->toolbarRoundedCorners =
false;
366 }
367 else if (!_stricmp(token3,
"ToggleAlwaysOnTop"))
pToolbar->ToggleAlwaysOnTop();
368 else if (!_stricmp(token3, "ToggleSnapToEdges"))
369 {
371 else pSettings->toolbarSnapToEdges =
false;
373 }
374
375 return true;
376 }
377
378
379
380 else if (!_stricmp(token2, "Taskbar"))
381 {
382 if (!_stricmp(token3, "Hide"))
383 {
385 }
386 else if (!_stricmp(token3, "Mode"))
387 {
393 }
394 else if (!_stricmp(token3, "Items"))
395 {
396 pSettings->taskbarMaxItems = atoi(token4);
398 {
401 }
403 }
404 else if (!_stricmp(token3, "Sort"))
405 {
406 if (!_stricmp(token4, "Last"))
407 {
410 }
411 else if (!_stricmp(token4, "Follow"))
412 {
415 }
416 else
417 {
420 }
422 }
423 else if (!_stricmp(token3, "IconSaturation"))
424 {
425 pSettings->taskbarSaturationValue = atoi(token4);
428 }
429 else if (!_stricmp(token3, "IconHue"))
430 {
431 pSettings->taskbarHueIntensity = atoi(token4);
434 }
435 else if (!_stricmp(token3, "ToggleShowTaskWorkspace"))
436 {
438 else pSettings->taskbarShowTaskWorkspace =
false;
441 }
442 else if (!_stricmp(token3, "ToggleCurrentOnly"))
443 {
445 }
446 else if (!_stricmp(token3, "ToggleFlashing"))
447 {
451 }
452 else if (!_stricmp(token3, "ToggleActiveSatHue"))
453 {
455 else pSettings->taskbarActiveSatHue =
false;
458 }
459 else if (!_stricmp(token3, "ToggleActiveLivePreview"))
460 {
462 else pSettings->taskbarActiveLivePreview =
false;
465 }
466 else if (!_stricmp(token3, "ToggleInactiveBackground"))
467 {
468 if (!
pSettings->taskbarInactiveBackground)
pSettings->taskbarInactiveBackground =
true;
469 else pSettings->taskbarInactiveBackground =
false;
472 }
473 else if (!_stricmp(token3, "ToggleTooltips"))
474 {
476 }
477 else if (!_stricmp(token3, "QuitCurrentTask"))
478 {
479 HWND hwnd =
pTaskbar->GetActiveWindow();
480 if (IsIconic(hwnd)) ShowWindow(hwnd, SW_RESTORE);
481 SetForegroundWindow(hwnd);
482 PostMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
483 }
484 else if (!_stricmp(token3, "ZoomCurrentTask"))
485 {
486 HWND hwnd =
pTaskbar->GetActiveWindow();
487 if (!IsIconic(hwnd))
488 {
489 if (IsZoomed(hwnd)) ShowWindow(hwnd, SW_RESTORE);
490 else ShowWindow(hwnd, SW_MAXIMIZE);
491 }
492 }
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511 return true;
512 }
513
514
515
516 else if (!_stricmp(token2, "Dock"))
517 {
521 else if (!_stricmp(token3, "Placement"))
522 {
523 char placement[255];
524 sprintf(placement, "%s %s", token4, extra);
529 }
530 else if (!_stricmp(token3, "Orientation"))
531 {
532 if (!_stricmp(token4,
"Vertical"))
pSettings->dockVertical =
true;
537 }
538 else if (!_stricmp(token3, "ToggleOrientation"))
539 {
545 }
546 else if (!_stricmp(token3, "Transparency"))
547 {
548 pSettings->dockTransparencyAlpha = atoi(token4);
551 }
552 else if (!_stricmp(token3, "TogglePuzzlePositioning"))
553 {
555 else pSettings->dockPuzzlePositioning =
false;
558 }
559 else if (!_stricmp(token3, "ToggleAlwaysOnTop"))
560 {
562 }
563 else if (!_stricmp(token3, "ToggleSnapToEdges"))
564 {
568 }
569
570 return true;
571 }
572
573
574
575 else if (!_stricmp(token2, "Menu"))
576 {
577 if (!_stricmp(token3, "Show"))
578 {
579 if (!_stricmp(token4,
"Configuration")) SendMessage(
GetBBWnd(),
BB_MENU, 2, 0);
580 else if (!_stricmp(token4,
"Workspaces")) SendMessage(
GetBBWnd(),
BB_MENU, 1, 0);
583 }
584 else if (!_stricmp(token3, "Hide"))
585 {
587 }
588 else if (!_stricmp(token3, "Transparency"))
589 {
590 if (!_stricmp(token4, "Title"))
591 {
592 pSettings->menuTitleTransparencyAlpha = atoi(extra);
594 }
595 else if (!_stricmp(token4, "Frame"))
596 {
597 pSettings->menuFrameTransparencyAlpha = atoi(extra);
599 }
600 else if (!_stricmp(token4, "Grip"))
601 {
602 pSettings->menuGripTransparencyAlpha = atoi(extra);
604 }
605 else if (!_stricmp(token4, "Active"))
606 {
607 pSettings->menuActiveTransparencyAlpha = atoi(extra);
609 }
610 else
611 {
612 pSettings->menuTransparencyAlpha = atoi(token4);
614 }
615
616
617
618
619
620 }
621 else if (!_stricmp(token3, "ToggleRoundedCorners"))
622 {
624 else pSettings->menuRoundedCorners =
false;
628 return true;
629 }
630 else if (!_stricmp(token3, "ToggleSeparators"))
631 {
636 return true;
637 }
638 else if (!_stricmp(token3, "SetRCPath"))
639 {
644 }
645
646 return true;
647 }
648
649
650
651 else if (!_stricmp(token2, "Console"))
652 {
656 else if (!_stricmp(token3, "ToggleMaximized"))
657 {
659 }
660 else if (!_stricmp(token3, "Placement"))
661 {
662 char placement[255];
663 sprintf(placement, "%s %s", token4, extra);
668 }
669 else if (!_stricmp(token3, "Messages"))
670 {
671 if (!_stricmp(token4, "Maximized"))
672 {
673 pSettings->consoleMaximizedMessages = atoi(extra);
675 }
676 else if (!_stricmp(token4, "Restored"))
677 {
678 pSettings->consoleRestoredMessages = atoi(extra);
680 }
682 }
683 else if (!_stricmp(token3, "Transparency"))
684 {
685 pSettings->consoleTransparencyAlpha = atoi(token4);
688 }
689 else if (!_stricmp(token3, "ToggleDesktopMode"))
690 {
692 else pSettings->consoleDesktopMode =
false;
695 }
696 else if (!_stricmp(token3, "ToggleRoundedCorners"))
697 {
699 else pSettings->consoleRoundedCorners =
false;
702 }
703 else if (!_stricmp(token3, "ClearHistory"))
704 {
706 }
707
708 return true;
709 }
710
711
712
713 else if (!_stricmp(token2, "Desktop"))
714 {
715 if (!_stricmp(token3, "Toggle"))
716 {
717 if (!_stricmp(token4, "Clock"))
718 {
720 else pSettings->desktopClockHidden =
false;
723 return true;
724 }
725 else if (!_stricmp(token4, "Weekday"))
726 {
728 else pSettings->desktopWeekdayHidden =
false;
731 return true;
732 }
733 else if (!_stricmp(token4, "Date"))
734 {
736 else pSettings->desktopDateHidden =
false;
739 return true;
740 }
741 else if (!_stricmp(token4, "Greeting"))
742 {
744 else pSettings->desktopGreetingHidden =
false;
747 return true;
748 }
749 else if (!_stricmp(token4, "Indicator"))
750 {
751 if (!
pSettings->desktopWorkspaceIndicatorHidden)
pSettings->desktopWorkspaceIndicatorHidden =
true;
752 else pSettings->desktopWorkspaceIndicatorHidden =
false;
755 return true;
756 }
757 else if (!_stricmp(token4, "Border"))
758 {
760 else pSettings->desktopBorderHidden =
false;
763 return true;
764 }
765 else if (!_stricmp(token4, "ClockWeekdayDate"))
766 {
768 else pSettings->desktopClockHidden =
false;
770 else pSettings->desktopWeekdayHidden =
false;
772 else pSettings->desktopDateHidden =
false;
777 return true;
778 }
779 }
780 else if (!_stricmp(token3, "Clock"))
781 {
782 if (!_stricmp(token4, "Placement"))
783 {
787 return true;
788 }
789 else if (!_stricmp(token4,
"Regular") || !_stricmp(token4,
"Text") || !_stricmp(token4,
"Binary")) strcpy(
pSettings->desktopClockType, token4);
790 {
793 return true;
794 }
795 }
796 else if (!_stricmp(token3, "Weekday"))
797 {
798 if (!_stricmp(token4, "Placement"))
799 {
803 return true;
804 }
805 }
806 else if (!_stricmp(token3, "Date"))
807 {
808 if (!_stricmp(token4, "Placement"))
809 {
813 return true;
814 }
815 }
816 else if (!_stricmp(token3, "Greeting"))
817 {
818 if (!_stricmp(token4, "Placement"))
819 {
823 return true;
824 }
825 }
826 else if (!_stricmp(token3, "Color"))
827 {
828 if ((*token4 != '#') || (strlen(token4) != 7)) return false;
829
830 if (*token4 == '#') memmove(token4, token4+1, strlen(token4));
831 COLORREF color = strtol(token4, NULL, 16);
832 color = RGB(GetBValue(color), GetGValue(color), GetRValue(color));
834 return true;
835 }
836 else if (!_stricmp(token3, "Widget"))
837 {
838 if (!_stricmp(token4, "Color"))
839 {
840 if ((*extra != '#') || (strlen(extra) != 7)) return false;
841
842 if (*extra == '#') memmove(extra, extra +1, strlen(extra));
843 COLORREF color = strtol(extra, NULL, 16);
844 pSettings->desktopWidgetColor = RGB(GetBValue(color), GetGValue(color), GetRValue(color));
848 return true;
849 }
850 }
851 else if (!_stricmp(token3, "Click"))
852 {
853 if (!_stricmp(token4, "R"))
854 {
855 strcpy(
pSettings->desktopRClickOverride, extra);
857 return true;
858 }
859 else if (!_stricmp(token4, "M"))
860 {
861 strcpy(
pSettings->desktopMClickOverride, extra);
863 return true;
864 }
865 else if (!_stricmp(token4, "X1"))
866 {
867 strcpy(
pSettings->desktopX1ClickOverride, extra);
869 return true;
870 }
871 else if (!_stricmp(token4, "X2"))
872 {
873 strcpy(
pSettings->desktopX2ClickOverride, extra);
875 return true;
876 }
877 }
878
879 return false;
880 }
881
882
883
884 else if (!_stricmp(token2, "Hotkey"))
885 {
886 int hotkeyNumber = atoi(&token3[1]) - 1;
887
888 if (hotkeyNumber > (
int)
pHotkeys->hotkeyList.size())
return false;
890
891 return true;
892 }
893
894
895
896 else if (!_stricmp(token2, "Workspaces"))
897 {
898 if (isdigit(token3[0]))
899 {
900 int ws = atoi(token3);
901 if ((ws < 1) || (ws >
pSettings->numberOfWorkspaces))
902 {
904 return false;
905 }
906
908 }
909 else if (!_stricmp(token3, "Next"))
910 {
912 }
913 else if (!_stricmp(token3, "Previous"))
914 {
916 }
917 else if (!_stricmp(token3, "New"))
918 {
920 }
921 else if (!_stricmp(token3, "Remove"))
922 {
924 }
925 else if (!_stricmp(token3, "ToggleMousewheelChanging"))
926 {
928 else pSettings->mousewheelChanging =
false;
930 }
931 else if (!_stricmp(token3, "ToggleFollowActive"))
932 {
936 }
937 else if (!_stricmp(token3, "ToggleWallpaperPerWorkspace"))
938 {
940 else pSettings->wallpaperPerWorkspace =
false;
942 }
943 else if (!_stricmp(token3, "GatherWindows"))
944 {
946 }
947
948 return true;
949 }
950
951
952
953 else if (!_stricmp(token2, "Plugins"))
954 {
958
959
960 return true;
961 }
962
963
964
965 else if (!_stricmp(token2, "Global"))
966 {
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995 if (!_stricmp(token3, "HiDPI"))
996 {
997 bool savedWriteProtection =
pSettings->writeProtection;
999
1000
1001
1002 pSettings->scalingFactorHiDPI = atoi(token4);
1006
1007 pSettings->writeProtection = savedWriteProtection;
1008
1010
1011 char msg[255];
1012 if (savedWriteProtection) strcpy(msg, "Temporarily bypassing write protection: ");
1013 else strcpy(msg, "");
1014 sprintf(msg,
"xoblite HiDPI scaling factor set to %dx. ",
pSettings->scalingFactorHiDPI);
1016 }
1017 else if (!_stricmp(token3, "ToggleMultiMonitorPlacements"))
1018 {
1020 else pSettings->multimonPlacements =
false;
1022
1023
1029
1031 }
1032 else if (!_stricmp(token3, "ToggleSoundFX"))
1033 {
1037 }
1038 else if (!_stricmp(token3, "ToggleDesignerMode"))
1039 {
1040 char xDGUIpath[MAX_PATH];
1041 sprintf(xDGUIpath,
"%s\\%s",
pSettings->SF_blackboxPath,
"xDesignerGUI.dll");
1043 {
1047 }
1048 else
1049 {
1053 }
1055 }
1056 else if (!_stricmp(token3, "ToggleRootCommands"))
1057 {
1059 else pSettings->disableRootCommands =
false;
1061 }
1062 else if (!_stricmp(token3, "ToggleThemeFonts"))
1063 {
1065 {
1068 }
1069 else
1070 {
1073 }
1075 }
1076 else if (!_stricmp(token3, "ToggleScriptSupport"))
1077 {
1079 else pSettings->disableScriptSupport =
false;
1080
1082
1085 }
1086 else if (!_stricmp(token3, "SetEditor"))
1087 {
1088 if (strlen(token4) > 0)
1089 {
1090 if (strlen(extra)) sprintf(
pSettings->preferredEditor,
"\"%s %s\"", token4, extra);
1091 else sprintf(
pSettings->preferredEditor,
"\"%s\"", token4);
1093 }
1094 }
1095
1096 return true;
1097 }
1098
1099
1100
1101 else if (!_stricmp(token2, "Window"))
1102 {
1104
1105 HWND hwnd =
pTaskbar->GetActiveWindow();
1106 if (hwnd == NULL) return false;
1107
1108 if (!_stricmp(token3, "Toggle"))
1109 {
1110 if (!_stricmp(token4, "Sticky"))
1111 {
1114 }
1115 }
1116 else if (!_stricmp(token3, "Workspace"))
1117 {
1120 else if ((strlen(token4) > 0))
1121 {
1122 int workspace = atoi(&token4[0]) - 1;
1124 }
1125 }
1126 else if (!_stricmp(token3, "Zoom"))
1127 {
1128 if (!IsIconic(hwnd))
1129 {
1130 if (IsZoomed(hwnd)) ShowWindow(hwnd, SW_RESTORE);
1131 else ShowWindow(hwnd, SW_MAXIMIZE);
1132 }
1133 }
1134 else if (!_stricmp(token3,
"Shade"))
pDesktop->ShadeWindow();
1135 else if (!_stricmp(token3,
"Lower"))
pDesktop->LowerWindow();
1136 else if (!_stricmp(token3, "Grow"))
1137 {
1138 if (!_stricmp(token4,
"Width"))
pDesktop->GrowWindowWidth();
1139 else if (!_stricmp(token4,
"Height"))
pDesktop->GrowWindowHeight();
1140 }
1141 else if (!_stricmp(token3, "Tile"))
1142 {
1144 {
1149 }
1151 {
1156 }
1158 {
1163 }
1166 else
1167 {
1169 return false;
1170 }
1171 }
1173 else if (!_stricmp(token3, "Quit"))
1174 {
1175 if (IsIconic(hwnd)) ShowWindow(hwnd, SW_RESTORE);
1176 SetForegroundWindow(hwnd);
1177 PostMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
1178 }
1179
1180 return true;
1181 }
1182
1183
1184
1185 else if (!_stricmp(token2, "ToggleWriteProtection"))
1186 {
1188 {
1189
1190
1194 }
1195 else
1196 {
1197
1198
1202 }
1203
1204 return true;
1205 }
1206
1207
1208
1209 else if (!_stricmp(token2, "Edit"))
1210 {
1212
1213 if (!_stricmp(token3, "Style"))
1214 {
1216 }
1217 else if (!_stricmp(token3, "Configuration"))
1218 {
1220 }
1221 else if (!_stricmp(token3, "Menu"))
1222 {
1224 }
1225 else if (!_stricmp(token3, "Hotkeys"))
1226 {
1228 }
1229 else if (!_stricmp(token3, "Plugins"))
1230 {
1232 }
1233 else
1234 {
1237
1238
1239 sprintf(cmdPlusArgs,
"%s %s %s %s",
pSettings->preferredEditor, token3, token4, extra);
1240 }
1241
1243
1244 return true;
1245 }
1246
1247
1248
1249 else if (!_stricmp(token2, "Set"))
1250 {
1251 if (!_stricmp(token3, "Style"))
1252 {
1254 return true;
1255 }
1256 else if (!_stricmp(token3, "Theme"))
1257 {
1259 return true;
1260 }
1261 }
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277 else if (!_stricmp(token2, "Random"))
1278 {
1279 int type;
1282 else return false;
1283
1284 if (strlen(token4))
1285 {
1290 }
1291 else
1292 {
1295 }
1296
1299
1301 {
1303 return false;
1304 }
1305
1308
1309 return true;
1310 }
1311
1312
1313
1314 else if (!_stricmp(token2, "Designer"))
1315 {
1317 {
1319 return false;
1320 }
1321
1322 char feedback[64];
1323 feedback[0] = '\0';
1324
1325 if (!_stricmp(token3, "Select"))
1326 {
1327 if (!_strnicmp(token4, "Toolbar", 7))
1328 {
1330 else if (!_stricmp(token4,
"ToolbarLabel"))
pSettings->selectedElement =
pSettings->ToolbarLabel;
1331 else if (!_stricmp(token4,
"ToolbarWindowLabel"))
pSettings->selectedElement =
pSettings->ToolbarWindowLabel;
1332 else if (!_stricmp(token4,
"ToolbarClock"))
pSettings->selectedElement =
pSettings->ToolbarClock;
1333 else if (!_stricmp(token4,
"ToolbarButton"))
pSettings->selectedElement =
pSettings->ToolbarButton;
1334 else if (!_stricmp(token4,
"ToolbarButtonPressed"))
pSettings->selectedElement =
pSettings->ToolbarButtonPressed;
1335 else if (!_stricmp(token4,
"ToolbarBorder"))
pSettings->selectedElement =
pSettings->ToolbarBorder;
1336 }
1337 else if (!_strnicmp(token4, "Menu", 4))
1338 {
1339 if (!_stricmp(token4,
"MenuTitle"))
pSettings->selectedElement =
pSettings->MenuTitle;
1340 else if (!_stricmp(token4,
"MenuFrame"))
pSettings->selectedElement =
pSettings->MenuFrame;
1341 else if (!_stricmp(token4,
"MenuActive"))
pSettings->selectedElement =
pSettings->MenuActive;
1342 else if (!_stricmp(token4,
"MenuGrip"))
pSettings->selectedElement =
pSettings->MenuGrip;
1343 else if (!_stricmp(token4,
"MenuIndicator"))
pSettings->selectedElement =
pSettings->MenuIndicator;
1344 else if (!_stricmp(token4,
"MenuSeparator"))
pSettings->selectedElement =
pSettings->MenuSeparator;
1345 else if (!_stricmp(token4,
"MenuFrameBorder"))
pSettings->selectedElement =
pSettings->MenuFrameBorder;
1346 }
1348 else if (!_stricmp(token4,
"DockBorder"))
pSettings->selectedElement =
pSettings->DockBorder;
1349 else if (!_stricmp(token4,
"Console"))
pSettings->selectedElement =
pSettings->Console;
1350 else if (!_strnicmp(token4, "Window", 6))
1351 {
1352 if (!_strnicmp(&token4[6], "Title", 5))
1353 {
1354 if (!_stricmp(token4,
"WindowTitleFocus"))
pSettings->selectedElement =
pSettings->WindowTitleFocus;
1355 else if (!_stricmp(token4,
"WindowTitleUnfocus"))
pSettings->selectedElement =
pSettings->WindowTitleUnfocus;
1356 }
1357 else if (!_strnicmp(&token4[6], "Label", 5))
1358 {
1359 if (!_stricmp(token4,
"WindowLabelFocus"))
pSettings->selectedElement =
pSettings->WindowLabelFocus;
1360 else if (!_stricmp(token4,
"WindowLabelUnfocus"))
pSettings->selectedElement =
pSettings->WindowLabelUnfocus;
1361 }
1362 else if (!_strnicmp(&token4[6], "Button", 6))
1363 {
1364 if (!_stricmp(token4,
"WindowButtonFocus"))
pSettings->selectedElement =
pSettings->WindowButtonFocus;
1365 else if (!_stricmp(token4,
"WindowButtonUnfocus"))
pSettings->selectedElement =
pSettings->WindowButtonUnfocus;
1366 else if (!_stricmp(token4,
"WindowButtonPressed"))
pSettings->selectedElement =
pSettings->WindowButtonPressed;
1367 }
1368 else if (!_strnicmp(&token4[6], "Grip", 4))
1369 {
1370 if (!_stricmp(token4,
"WindowGripFocus"))
pSettings->selectedElement =
pSettings->WindowGripFocus;
1371 else if (!_stricmp(token4,
"WindowGripUnfocus"))
pSettings->selectedElement =
pSettings->WindowGripUnfocus;
1372 }
1373 else if (!_strnicmp(&token4[6], "Handle", 6))
1374 {
1375 if (!_stricmp(token4,
"WindowHandleFocus"))
pSettings->selectedElement =
pSettings->WindowHandleFocus;
1376 else if (!_stricmp(token4,
"WindowHandleUnfocus"))
pSettings->selectedElement =
pSettings->WindowHandleUnfocus;
1377 }
1378 }
1379 else if (!_strnicmp(token4,
"Hardware", 8))
pSettings->selectedElement =
pSettings->ExternalHardware;
1380
1381 else if (!_stricmp(token4, "Next") || !_stricmp(token4, "Previous") || strlen(token4) == 0)
1382 {
1383 if (!_stricmp(token4, "Previous"))
1384 {
1402
1415 }
1416 else
1417 {
1435
1448 }
1449 }
1450
1451 if (
pSettings->selectedElement ==
pSettings->Toolbar) strcpy(feedback,
"... Toolbar");
1452 else if (
pSettings->selectedElement ==
pSettings->ToolbarLabel) strcpy(feedback,
"... Toolbar Label");
1453 else if (
pSettings->selectedElement ==
pSettings->ToolbarWindowLabel) strcpy(feedback,
"... Toolbar WindowLabel");
1454 else if (
pSettings->selectedElement ==
pSettings->ToolbarClock) strcpy(feedback,
"... Toolbar Clock");
1455 else if (
pSettings->selectedElement ==
pSettings->ToolbarButton) strcpy(feedback,
"... Toolbar Button");
1456 else if (
pSettings->selectedElement ==
pSettings->ToolbarButtonPressed) strcpy(feedback,
"... Toolbar Button Pressed");
1457 else if (
pSettings->selectedElement ==
pSettings->ToolbarBorder) strcpy(feedback,
"... Toolbar Border");
1458 else if (
pSettings->selectedElement ==
pSettings->MenuTitle) strcpy(feedback,
"... Menu Title");
1459 else if (
pSettings->selectedElement ==
pSettings->MenuFrame) strcpy(feedback,
"... Menu Frame");
1460 else if (
pSettings->selectedElement ==
pSettings->MenuFrameBorder) strcpy(feedback,
"... Menu Frame Border");
1461 else if (
pSettings->selectedElement ==
pSettings->MenuActive) strcpy(feedback,
"... Menu Active");
1462 else if (
pSettings->selectedElement ==
pSettings->MenuGrip) strcpy(feedback,
"... Menu Grip");
1463 else if (
pSettings->selectedElement ==
pSettings->MenuIndicator) strcpy(feedback,
"... Menu Indicator");
1464 else if (
pSettings->selectedElement ==
pSettings->MenuSeparator) strcpy(feedback,
"... Menu Separator");
1465 else if (
pSettings->selectedElement ==
pSettings->Dock) strcpy(feedback,
"... Dock");
1466 else if (
pSettings->selectedElement ==
pSettings->DockBorder) strcpy(feedback,
"... Dock Border");
1467 else if (
pSettings->selectedElement ==
pSettings->Console) strcpy(feedback,
"... Console");
1468
1469 else if (
pSettings->selectedElement ==
pSettings->WindowTitleFocus) strcpy(feedback,
"... Window Title Focus");
1470 else if (
pSettings->selectedElement ==
pSettings->WindowTitleUnfocus) strcpy(feedback,
"... Window Title Unfocus");
1471 else if (
pSettings->selectedElement ==
pSettings->WindowLabelFocus) strcpy(feedback,
"... Window Label Focus");
1472 else if (
pSettings->selectedElement ==
pSettings->WindowLabelUnfocus) strcpy(feedback,
"... Window Label Unfocus");
1473 else if (
pSettings->selectedElement ==
pSettings->WindowButtonFocus) strcpy(feedback,
"... Window Button Focus");
1474 else if (
pSettings->selectedElement ==
pSettings->WindowButtonUnfocus) strcpy(feedback,
"... Window Button Unfocus");
1475 else if (
pSettings->selectedElement ==
pSettings->WindowButtonPressed) strcpy(feedback,
"... Window Button Pressed");
1476 else if (
pSettings->selectedElement ==
pSettings->WindowGripFocus) strcpy(feedback,
"... Window Grip Focus");
1477 else if (
pSettings->selectedElement ==
pSettings->WindowGripUnfocus) strcpy(feedback,
"... Window Grip Unfocus");
1478 else if (
pSettings->selectedElement ==
pSettings->WindowHandleFocus) strcpy(feedback,
"... Window Handle Focus");
1479 else if (
pSettings->selectedElement ==
pSettings->WindowHandleUnfocus) strcpy(feedback,
"... Window Handle Unfocus");
1480 else if (
pSettings->selectedElement ==
pSettings->ExternalHardware) strcpy(feedback,
"... Hardware");
1481
1482 if (strlen(feedback) > 0)
1483 {
1485
1487 sprintf(broam, "@xDesigner Feedback %s", feedback);
1489 }
1490
1491 return true;
1492 }
1493
1494
1495
1496 else if (!_stricmp(token3, "Modify"))
1497 {
1498 if (!_stricmp(token4, "Appearance"))
1499 {
1500 if (!_stricmp(extra, "Previous"))
1501 {
1502
1504 {
1505 switch (
pSettings->selectedElement->type)
1506 {
1513 }
1514 }
1518 {
1519 switch (
pSettings->selectedElement->type)
1520 {
1531 }
1532 }
1533 else switch (
pSettings->selectedElement->type)
1534 {
1553 }
1554 }
1555 else
1556 {
1557
1559 {
1560 switch (
pSettings->selectedElement->type)
1561 {
1568 }
1569 }
1573 {
1574 switch (
pSettings->selectedElement->type)
1575 {
1586 }
1587 }
1588 else switch (
pSettings->selectedElement->type)
1589 {
1608 }
1609 }
1610
1612 else pSettings->selectedElement->parentRelative =
false;
1613
1614 switch (
pSettings->selectedElement->type)
1615 {
1617 case B_SOLID: { strcpy(feedback,
"... Solid (1 color)");
break; }
1618 case B_HORIZONTAL: { strcpy(feedback,
"... Horizontal (2 colors)");
break; }
1619 case B_VERTICAL: { strcpy(feedback,
"... Vertical (2 colors)");
break; }
1620 case B_DIAGONAL: { strcpy(feedback,
"... Diagonal (2 colors)");
break; }
1621 case B_CROSSDIAGONAL: { strcpy(feedback,
"... CrossDiagonal (2 colors)");
break; }
1622 case B_PIPECROSS: { strcpy(feedback,
"... Pipecross (2 colors)");
break; }
1623 case B_ELLIPTIC: { strcpy(feedback,
"... Elliptic (2 colors)");
break; }
1624 case B_RECTANGLE: { strcpy(feedback,
"... Rectangle (2 colors)");
break; }
1625 case B_PYRAMID: { strcpy(feedback,
"... Pyramid (2 colors)");
break; }
1626 case B_MIRRORHORIZONTAL: { strcpy(feedback,
"... MirrorHorizontal (2 colors)");
break; }
1627 case B_MIRRORVERTICAL: { strcpy(feedback,
"... MirrorVertical (2 colors)");
break; }
1628 case B_SPLITSOLID: { strcpy(feedback,
"... SplitSolid (2 colors)");
break; }
1629 case B_SPLITHORIZONTAL: { strcpy(feedback,
"... SplitHorizontal (4 colors)");
break; }
1630 case B_SPLITVERTICAL: { strcpy(feedback,
"... SplitVertical (4 colors)");
break; }
1631 case B_SUPERHORIZONTAL: { strcpy(feedback,
"... SuperHorizontal (8 colors)");
break; }
1632 case B_SUPERVERTICAL: { strcpy(feedback,
"... SuperVertical (8 colors)");
break; }
1633 default: { strcpy(feedback, "... Error: Unsupported appearance!"); break; }
1634 }
1635
1637 }
1638
1639
1640
1641 else if (!_stricmp(token4, "Bevel"))
1642 {
1643
1647 {
1649 {
1652 strcpy(feedback, "... Raised Bevel1");
1653 }
1655 {
1657 {
1659 strcpy(feedback, "... Raised Bevel2");
1660 }
1661 else
1662 {
1665 strcpy(feedback, "... Sunken Bevel1");
1666 }
1667 }
1669 {
1671 {
1673 strcpy(feedback, "... Sunken Bevel2");
1674 }
1675 else
1676 {
1679 strcpy(feedback, "... Flat");
1680 }
1681 }
1682
1684 }
1685 else
1686 {
1688 strcpy(feedback, "--- Not available ---");
1689 }
1690 }
1691
1692
1693
1694 else if (!_stricmp(token4, "Interlaced"))
1695 {
1699 {
1700 if (!
pSettings->selectedElement->interlaced)
1701 {
1702 pSettings->selectedElement->interlaced =
true;
1703 strcpy(feedback, "... Interlace enabled");
1704 }
1705 else
1706 {
1707 pSettings->selectedElement->interlaced =
false;
1708 strcpy(feedback, "... Interlace disabled");
1709 }
1710
1712 }
1713 else strcpy(feedback, "--- Not available ---");
1714 }
1715
1716
1717
1718 else if (!_stricmp(token4, "Colors"))
1719 {
1721
1722 for (int n = 1; n <= 8; n++)
1723 {
1724 COLORREF* color;
1725 switch (n)
1726 {
1727 case 1: { color = &
pSettings->selectedElement->Color1;
break; }
1728 case 2: { color = &
pSettings->selectedElement->Color2;
break; }
1729 case 3: { color = &
pSettings->selectedElement->Color3;
break; }
1730 case 4: { color = &
pSettings->selectedElement->Color4;
break; }
1731 case 5: { color = &
pSettings->selectedElement->Color5;
break; }
1732 case 6: { color = &
pSettings->selectedElement->Color6;
break; }
1733 case 7: { color = &
pSettings->selectedElement->Color7;
break; }
1734 case 8: { color = &
pSettings->selectedElement->Color8;
break; }
1735 default: return false;
1736 }
1737
1738 if (!_stricmp(extra, "Greyscale"))
1739 {
1740 int greyscale = ((BYTE)GetRValue(*color) + (BYTE)GetGValue(*color) + (BYTE)GetBValue(*color)) / 3;
1742 strcpy(feedback, "... converted to greyscale!");
1743 }
1744 if (!_stricmp(extra, "Sepia"))
1745 {
1746 double r, g, b;
1747 r = (GetRValue(*color) * 0.393) + (GetGValue(*color) * 0.769) + (GetBValue(*color) * 0.189);
1748 if (r > 255) r = 255;
1749 g = (GetRValue(*color) * 0.349) + (GetGValue(*color) * 0.686) + (GetBValue(*color) * 0.168);
1750 if (g > 255) g = 255;
1751 b = (GetRValue(*color) * 0.272) + (GetGValue(*color) * 0.534) + (GetBValue(*color) * 0.131);
1752 if (b > 255) b = 255;
1753 *color = RGB((BYTE)r, (BYTE)g, (BYTE)b);
1754 strcpy(feedback, "... converted to sepia!");
1755 }
1756 else if (!_stricmp(extra, "Darken"))
1757 {
1758 double r = GetRValue(*color) * 0.9;
1759 double g = GetGValue(*color) * 0.9;
1760 double b = GetBValue(*color) * 0.9;
1761 *color = RGB((BYTE)r, (BYTE)g, (BYTE)b);
1762 strcpy(feedback, "... colors darkened!");
1763 }
1764 else if (!_stricmp(extra, "Lighten"))
1765 {
1766 bool ceilingHit = false;
1767 double r = GetRValue(*color) * 1.1;
1768 if (r > 255) ceilingHit = true;
1769 double g = GetGValue(*color) * 1.1;
1770 if (g > 255) ceilingHit = true;
1771 double b = GetBValue(*color) * 1.1;
1772 if (b > 255) ceilingHit = true;
1773 if (!ceilingHit)
1774 {
1775 *color = RGB((BYTE)r, (BYTE)g, (BYTE)b);
1776 strcpy(feedback, "... colors lightened!");
1777 }
1778 else strcpy(feedback, "... can not go further!");
1779 }
1780 else if (!_stricmp(extra, "Invert"))
1781 {
1782 BYTE r = 255 - GetRValue(*color);
1783 BYTE g = 255 - GetGValue(*color);
1784 BYTE b = 255 - GetBValue(*color);
1785 *color = RGB((BYTE)r, (BYTE)g, (BYTE)b);
1786 strcpy(feedback, "... colors inverted!");
1787 }
1788 else if (!_stricmp(extra, "Flip"))
1789 {
1793 else if ((
pSettings->selectedElement->type !=
B_SOLID) && (n<=2)) *color = colors[2-n];
1794 else break;
1795 strcpy(feedback, "... colors flipped!");
1796 }
1797 }
1798 }
1799
1800
1801
1803 {
1804
1805 if (*extra == '#') memmove(extra, extra + 1, strlen(extra));
1806 COLORREF newColor = strtol(extra, NULL, 16);
1807 newColor = RGB(GetBValue(newColor), GetGValue(newColor), GetRValue(newColor));
1808
1809 if (!_strnicmp(token4, "Color", 5))
1810 {
1811 int color = atoi(&token4[5]);
1812 switch (color)
1813 {
1814 case 1: {
pSettings->selectedElement->Color1 = newColor;
break; }
1815 case 2: {
pSettings->selectedElement->Color2 = newColor;
break; }
1816 case 3: {
pSettings->selectedElement->Color3 = newColor;
break; }
1817 case 4: {
pSettings->selectedElement->Color4 = newColor;
break; }
1818 case 5: {
pSettings->selectedElement->Color5 = newColor;
break; }
1819 case 6: {
pSettings->selectedElement->Color6 = newColor;
break; }
1820 case 7: {
pSettings->selectedElement->Color7 = newColor;
break; }
1821 case 8: {
pSettings->selectedElement->Color8 = newColor;
break; }
1822 default: break;
1823 }
1824 }
1825 else if (!_stricmp(token4,
"TextColor"))
pSettings->selectedElement->TextColor = newColor;
1826 else if (!_stricmp(token4, "OutlineColor"))
1827 {
1828 pSettings->selectedElement->OutlineColor = newColor;
1829 pSettings->selectedElement->FontOutline =
true;
1830 }
1831 else if (!_stricmp(token4, "ShadowColor"))
1832 {
1833 pSettings->selectedElement->ShadowColor = newColor;
1834 pSettings->selectedElement->FontShadow =
true;
1835 }
1836 else if (!_stricmp(token4,
"DisabledColor"))
pSettings->selectedElement->disabledColor = newColor;
1837 else if (!_stricmp(token4,
"GlyphColor"))
pSettings->selectedElement->BulletColor = newColor;
1838 else if (!_stricmp(token4,
"BorderColor"))
pSettings->selectedElement->borderColor = newColor;
1839 }
1840
1841
1842
1843 else if (!_stricmp(token4, "MarginWidth"))
1844 {
1848 {
1849 if (!_stricmp(extra,
"+"))
pSettings->selectedElement->marginWidth +=
pSettings->scalingFactorHiDPI;
1850 else if (!_stricmp(extra, "-"))
1851 {
1853 if (
pSettings->selectedElement->marginWidth < 0)
pSettings->selectedElement->marginWidth = 0;
1854 }
1855
1856 sprintf(feedback,
"... %d pixels (eq)", (
pSettings->selectedElement->marginWidth /
pSettings->scalingFactorHiDPI));
1857 }
1858 else strcpy(feedback, "--- Not available ---");
1859
1860
1861 }
1862
1863
1864
1865 else if (!_stricmp(token4, "BorderWidth"))
1866 {
1869 {
1870
1875 else styleItemPtr =
pSettings->selectedElement;
1876
1878 else if (!_stricmp(extra, "-"))
1879 {
1882 }
1883
1885 else styleItemPtr->
bordered =
false;
1886
1887 sprintf(feedback,
"... %d pixels (eq)", (styleItemPtr->
borderWidth /
pSettings->scalingFactorHiDPI));
1888 }
1889 else strcpy(feedback, "--- Not available ---");
1890
1891
1892 }
1893
1894
1895
1897 {
1908 {
1909 if (!_stricmp(token4, "Font"))
1910 {
1911 if (strlen(extra) > 0)
1912 {
1914 if (strchr(extra, '/'))
1915 {
1918 }
1919 else
1920 {
1921
1922 strncpy_s(
pSettings->selectedElement->Font,
sizeof(
pSettings->selectedElement->Font), extra, _TRUNCATE);
1923 pSettings->selectedElement->Font[
sizeof(
pSettings->selectedElement->Font) - 1] =
'\0';
1924 }
1925 }
1926 else
1927 {
1928 static LOGFONT lf;
1929 ZeroMemory(&lf, sizeof(lf));
1930 strcpy(lf.lfFaceName,
pSettings->selectedElement->Font);
1931 lf.lfHeight = -MulDiv((
pSettings->selectedElement->FontHeight /
pSettings->scalingFactorHiDPI), GetDeviceCaps(GetDC(NULL), LOGPIXELSY), 72);
1932 lf.lfWeight =
pSettings->selectedElement->FontWeight;
1933
1934 CHOOSEFONT cf;
1935 ZeroMemory(&cf, sizeof(cf));
1936 cf.lStructSize = sizeof(cf);
1937 cf.hwndOwner = NULL;
1938 cf.lpLogFont = &lf;
1939 cf.Flags = CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT;
1940
1941 if (ChooseFont(&cf) == TRUE)
1942 {
1943 if (strlen(lf.lfFaceName) > 0)
1944 {
1945 strcpy(
pSettings->selectedElement->Font, lf.lfFaceName);
1946 pSettings->selectedElement->FontHeight = cf.iPointSize / 10;
1947 if ((cf.nFontType == BOLD_FONTTYPE) || (lf.lfWeight >= FW_BOLD))
pSettings->selectedElement->FontWeight = FW_BOLD;
1948 else pSettings->selectedElement->FontWeight = FW_NORMAL;
1949
1950 sprintf(feedback,
"... %s/%d/",
pSettings->selectedElement->Font,
pSettings->selectedElement->FontHeight);
1951 if (
pSettings->selectedElement->FontWeight == FW_BOLD) strcat(feedback,
"Bold");
1952 else strcat(feedback, "Normal");
1954
1956 }
1957 }
1958 }
1959 }
1960 else if (!_stricmp(token4, "FontHeight"))
1961 {
1962 if (!_stricmp(extra,
"+"))
pSettings->selectedElement->FontHeight +=
pSettings->scalingFactorHiDPI;
1963 else if (!_stricmp(extra, "-"))
1964 {
1967 }
1968
1969 sprintf(feedback,
"... %d points (eq)", (
pSettings->selectedElement->FontHeight /
pSettings->scalingFactorHiDPI));
1971 }
1972 else if (!_stricmp(token4, "FontWeight"))
1973 {
1974 if (
pSettings->selectedElement->FontWeight == FW_NORMAL)
1975 {
1976 pSettings->selectedElement->FontWeight = FW_BOLD;
1977 strcpy(feedback, "... Bold");
1978 }
1979 else
1980 {
1981 pSettings->selectedElement->FontWeight = FW_NORMAL;
1982 strcpy(feedback, "... Normal");
1983 }
1984
1986 }
1987 }
1988 else strcpy(feedback, "--- Not available ---");
1989 }
1990
1991
1992
1993 else if (!_stricmp(token4, "Alignment"))
1994 {
1998 {
1999 if (
pSettings->selectedElement->Justify == DT_LEFT)
2000 {
2001 pSettings->selectedElement->Justify = DT_CENTER;
2002 strcpy(feedback, "... Center");
2003 }
2004 else if (
pSettings->selectedElement->Justify == DT_CENTER)
2005 {
2006 pSettings->selectedElement->Justify = DT_RIGHT;
2007 strcpy(feedback, "... Right");
2008 }
2009 else
2010 {
2011 pSettings->selectedElement->Justify = DT_LEFT;
2012 strcpy(feedback, "... Left");
2013 }
2014
2016 }
2017 else strcpy(feedback, "--- Not available ---");
2018 }
2019
2020
2021
2022 else if (!_stricmp(token4, "Outline"))
2023 {
2027 {
2028 if (!
pSettings->selectedElement->FontOutline)
2029 {
2030 pSettings->selectedElement->FontOutline =
true;
2031 strcpy(feedback, "... Outline enabled");
2032 }
2033 else
2034 {
2035 pSettings->selectedElement->FontOutline =
false;
2036 strcpy(feedback, "... Outline disabled");
2037 }
2038
2040 }
2041 else strcpy(feedback, "--- Not available ---");
2042 }
2043
2044
2045
2046 else if (!_stricmp(token4, "Shadow"))
2047 {
2051 {
2052 if (!
pSettings->selectedElement->FontShadow)
2053 {
2054 pSettings->selectedElement->FontShadow =
true;
2055 strcpy(feedback, "... Shadow enabled");
2056 }
2057 else
2058 {
2059 pSettings->selectedElement->FontShadow =
false;
2060 strcpy(feedback, "... Shadow disabled");
2061 }
2062
2064 }
2065 else strcpy(feedback, "--- Not available ---");
2066 }
2067
2068
2069
2070 else if (!_stricmp(token4, "MenuBullet"))
2071 {
2075
2077 {
2087 default: { strcpy(feedback, "... Error: Unsupported menu bullet type!"); break; }
2088 }
2089
2091 }
2092 else if (!_stricmp(token4, "MenuBulletPosition"))
2093 {
2094 if (!_stricmp(
pSettings->menuBulletPosition,
"Right")) strcpy(
pSettings->menuBulletPosition,
"Left");
2095 else strcpy(
pSettings->menuBulletPosition,
"Right");
2096 sprintf(feedback,
"... %s",
pSettings->menuBulletPosition);
2098 }
2099
2100
2101
2102
2103 if (strlen(feedback) > 0)
2104 {
2106 sprintf(broam, "@xDesigner Feedback %s", feedback);
2108 }
2109
2110
2111
2112
2113
2114
2116
2121 !_stricmp(token4, "MenuBullet") || !_stricmp(token4, "MenuBulletPosition"))
2122 {
2124 {
2127 }
2128 }
2133 {
2137 }
2139 {
2142 }
2144 {
2146 }
2152 {
2154 }
2156 {
2158 }
2159
2160 return true;
2161 }
2162
2163
2164
2165 else if (!_stricmp(token3, "Copy"))
2166 {
2171
2172 for (int n=1; n<=2; n++)
2173 {
2174 if (n == 1) strcpy(srcdest, token4);
2175 else strcpy(srcdest, extra);
2176
2177 if (!_strnicmp(srcdest, "Toolbar", 7))
2178 {
2179 if (!_stricmp(srcdest,
"Toolbar")) ptr =
pSettings->Toolbar;
2180 else if (!_stricmp(srcdest,
"ToolbarLabel")) ptr =
pSettings->ToolbarLabel;
2181 else if (!_stricmp(srcdest,
"ToolbarWindowLabel")) ptr =
pSettings->ToolbarWindowLabel;
2182 else if (!_stricmp(srcdest,
"ToolbarClock")) ptr =
pSettings->ToolbarClock;
2183 else if (!_stricmp(srcdest,
"ToolbarButton")) ptr =
pSettings->ToolbarButton;
2184 else if (!_stricmp(srcdest,
"ToolbarButtonPressed")) ptr =
pSettings->ToolbarButtonPressed;
2185 else if (!_stricmp(srcdest,
"ToolbarBorder")) ptr =
pSettings->ToolbarBorder;
2186 }
2187 else if (!_strnicmp(srcdest, "Menu", 4))
2188 {
2189 if (!_stricmp(srcdest,
"MenuTitle")) ptr =
pSettings->MenuTitle;
2190 else if (!_stricmp(srcdest,
"MenuFrame")) ptr =
pSettings->MenuFrame;
2191 else if (!_stricmp(srcdest,
"MenuActive")) ptr =
pSettings->MenuActive;
2192 else if (!_stricmp(srcdest,
"MenuGrip")) ptr =
pSettings->MenuGrip;
2193 else if (!_stricmp(srcdest,
"MenuIndicator")) ptr =
pSettings->MenuIndicator;
2194 else if (!_stricmp(srcdest,
"MenuSeparator")) ptr =
pSettings->MenuSeparator;
2195 else if (!_stricmp(srcdest,
"MenuFrameBorder")) ptr =
pSettings->MenuFrameBorder;
2196 }
2197 else if (!_stricmp(srcdest,
"Dock")) ptr =
pSettings->Dock;
2198 else if (!_stricmp(srcdest,
"DockBorder")) ptr =
pSettings->DockBorder;
2199 else if (!_stricmp(srcdest,
"Console")) ptr =
pSettings->Console;
2200 else if (!_strnicmp(srcdest, "Window", 6))
2201 {
2202 if (!_strnicmp(&srcdest[6], "Title", 5))
2203 {
2204 if (!_stricmp(srcdest,
"WindowTitleFocus")) ptr =
pSettings->WindowTitleFocus;
2205 else if (!_stricmp(srcdest,
"WindowTitleUnfocus")) ptr =
pSettings->WindowTitleUnfocus;
2206 }
2207 else if (!_strnicmp(&srcdest[6], "Label", 5))
2208 {
2209 if (!_stricmp(srcdest,
"WindowLabelFocus")) ptr =
pSettings->WindowLabelFocus;
2210 else if (!_stricmp(srcdest,
"WindowLabelUnfocus")) ptr =
pSettings->WindowLabelUnfocus;
2211 }
2212 else if (!_strnicmp(&srcdest[6], "Button", 6))
2213 {
2214 if (!_stricmp(srcdest,
"WindowButtonFocus")) ptr =
pSettings->WindowButtonFocus;
2215 else if (!_stricmp(srcdest,
"WindowButtonUnfocus")) ptr =
pSettings->WindowButtonUnfocus;
2216 else if (!_stricmp(srcdest,
"WindowButtonPressed")) ptr =
pSettings->WindowButtonPressed;
2217 }
2218 else if (!_strnicmp(&srcdest[6], "Grip", 4))
2219 {
2220 if (!_stricmp(srcdest,
"WindowGripFocus")) ptr =
pSettings->WindowGripFocus;
2221 else if (!_stricmp(srcdest,
"WindowGripUnfocus")) ptr =
pSettings->WindowGripUnfocus;
2222 }
2223 else if (!_strnicmp(&srcdest[6], "Handle", 6))
2224 {
2225 if (!_stricmp(srcdest,
"WindowHandleFocus")) ptr =
pSettings->WindowHandleFocus;
2226 else if (!_stricmp(srcdest,
"WindowHandleUnfocus")) ptr =
pSettings->WindowHandleUnfocus;
2227 }
2228 }
2229 else if (!_stricmp(srcdest,
"Hardware")) ptr =
pSettings->ExternalHardware;
2230 else return false;
2231
2232 if (n == 1) source = ptr;
2233 else destination = ptr;
2234 }
2235
2236
2237 CopyMemory(destination, source,
sizeof(
StyleItem));
2238 pSettings->selectedElement = destination;
2239
2240
2243 {
2246 }
2250
2252 }
2253
2254
2255
2256 else if (!_stricmp(token3, "Save"))
2257 {
2260 }
2261 }
2262
2263
2264
2265 else if (!_stricmp(token2, "Reconfigure"))
2266 {
2268 return true;
2269 }
2270
2271 else if (!_stricmp(token2, "Restart"))
2272 {
2274 return true;
2275 }
2276
2277 else if (!_stricmp(token2, "PausedRestart"))
2278 {
2279
2281 return true;
2282 }
2283
2284
2285
2286 else if (!_stricmp(token2, "MinimizeAll"))
2287 {
2289 return true;
2290 }
2291 else if (!_stricmp(token2, "RestoreAll"))
2292 {
2294 return true;
2295 }
2296
2297
2298
2299 else if (!_stricmp(token2, "Explorer"))
2300 {
2304
2305 return true;
2306 }
2307
2308 else if (!_stricmp(token2, "ToggleExplorer"))
2309 {
2311 return true;
2312 }
2313
2314 else if (!_stricmp(token2, "EmptyRecycleBin"))
2315 {
2316 SHEmptyRecycleBin(NULL, NULL, 0);
2317 return true;
2318 }
2319
2320
2321
2322 else if (!_stricmp(token2, "Statistics"))
2323 {
2324 char msg[255];
2325 sprintf(msg,
"xoblite says: \"Since launch, you have changed theme %d time%s, style %d time%s, and wallpaper %d time%s.\"",
pSettings->Statistics.changedTheme, ((
pSettings->Statistics.changedTheme != 1) ?
"s" :
""),
pSettings->Statistics.changedStyle, ((
pSettings->Statistics.changedStyle != 1) ?
"s" :
""),
pSettings->Statistics.changedWallpaper, ((
pSettings->Statistics.changedWallpaper != 1) ?
"s" :
""));
2327 sprintf(msg,
"\"You have also used hotkeys %d time%s, and (through various actions) triggered %d bro@m%s.\"",
pSettings->Statistics.usedAHotkey, ((
pSettings->Statistics.usedAHotkey != 1) ?
"s" :
""),
pSettings->Statistics.executedBroams, ((
pSettings->Statistics.executedBroams != 1) ?
"s" :
""));
2329 return true;
2330 }
2331
2332
2333
2334 else if (!_stricmp(token2, "Quit"))
2335 {
2336 if (!_stricmp(token3,
"<Yes>")) PostMessage(
GetBBWnd(),
BB_QUIT, 0, 0);
2337 else SendMessage(
GetBBWnd(),
BB_POPUPMESSAGE, (WPARAM)
"Are you sure you want to quit?", (LPARAM)
"@xoblite Quit <Yes>");
2338 return true;
2339 }
2340
2341
2342
2343 else if (!_stricmp(token2, "System"))
2344 {
2350 return true;
2351 }
2352 }
2353
2354
2355
2356 else if (!_strnicmp(broam, "@Script", 7))
2357 {
2359 {
2361
2363 LPSTR tokens[1];
2364 tokens[0] = token1;
2365
2366 token1[0] = script[0] = '\0';
2368
2369
2370 script[strlen(script) - 1] = '\0';
2372 }
2374
2375 return true;
2376 }
2377
2378
2379
2380 else if (!_strnicmp(broam, "@Callback", 9))
2381 {
2382
2383
2385 LPSTR tokens[4];
2386 tokens[0] = token1;
2387 tokens[1] = token2;
2388 tokens[2] = token3;
2389 token1[0] = token2[0] = token3[0] = extra[0] = '\0';
2391
2392 if ((token2[0] == '@') && strlen(token3))
2393 {
2395 sprintf(command, "%s %s", token2, token3);
2397 return false;
2398 }
2399 }
2400
2401
2402
2403 else if (!_strnicmp(broam, "@GoToURL", 8))
2404 {
2406 LPSTR tokens[1];
2407 tokens[0] = token1;
2408 token1[0] = extra[0] = '\0';
2411 return false;
2412 }
2413
2414
2415
2416 else if (!_strnicmp(broam, "@BBShowPlugins", 14) || !_strnicmp(broam, "@BBHidePlugins", 14)) return false;
2417 else if (!_strnicmp(broam, "@xDesigner Feedback", 19)) return false;
2418 else if (!_strnicmp(broam, "@xWebViewer Bookmark", 20) || !_strnicmp(broam, "@xWebViewer URL", 15)) return false;
2419 else if (!_strnicmp(broam, "@", 1))
2420 {
2422
2424 {
2426 }
2427 }
2429
2430
2431
2432 return false;
2433}
void ParseFontString(LPSTR string, StyleItem *item)
Definition BBApi.cpp:2669
void WriteBool(LPCSTR fp, LPCSTR keyword, bool value)
Definition BBApi.cpp:3131
void WriteInt(LPCSTR fp, LPCSTR keyword, int value)
Definition BBApi.cpp:3144
Desktop * pDesktop
Definition Blackbox.cpp:37
void WriteString(LPCSTR fp, LPCSTR keyword, LPSTR value)
Definition BBApi.cpp:3156
BYTE greyscale
Definition BBApi.cpp:3761
Workspaces * pWorkspaces
Definition Blackbox.cpp:51
bool SetTransparency(HWND hwnd, BYTE alpha)
Definition BBApi.cpp:3068
Taskbar * pTaskbar
Definition Blackbox.cpp:47
bool IsInString(LPCSTR inputString, LPCSTR searchString)
Definition BBApi.cpp:2519
LPSTR ReadString(LPCSTR fp, LPCSTR szString, LPSTR szDefault)
Definition BBApi.cpp:544
void BBSmartExecute(LPSTR inputString)
Definition BBApi.cpp:1767
void ToggleSticky(HWND window)
Definition BBApi.cpp:3006
MenuCommon * pMenuCommon
Definition Blackbox.cpp:41
Wallpaper * pWallpaper
Definition Blackbox.cpp:50
int BBTokenize(LPCSTR szString, char *lpszBuffers[], DWORD dwNumBuffers, LPSTR szExtraParameters)
Definition BBApi.cpp:316
LPSTR StrRemoveEncap(LPSTR string)
Definition BBApi.cpp:406
void ReplaceEnvVars(LPSTR string)
Definition BBApi.cpp:2594
void ReplaceShellFolders(LPSTR string)
Definition BBApi.cpp:2633
LPCSTR menuPath(LPCSTR other)
Definition BBApi.cpp:920
Settings * pSettings
Definition Blackbox.cpp:46
PluginManager * pPluginManager
Definition Blackbox.cpp:43
void WriteColor(LPCSTR fp, LPCSTR keyword, COLORREF value)
Definition BBApi.cpp:3165
HWND GetBBWnd()
Definition BBApi.cpp:128
#define BB_SHUTDOWN
Definition BBApi.h:175
#define BBRG_DOCK
Definition BBApi.h:231
#define BB_QUIT
Definition BBApi.h:145
#define PLUGIN_NAME
Definition BBApi.h:266
#define BEVEL1
Definition BBApi.h:108
#define B_VERTICAL
Definition BBApi.h:73
#define BB_TOGGLECONSOLE
Definition BBApi.h:173
#define BB_RESTART
Definition BBApi.h:146
#define B_MIRRORHORIZONTAL
Definition BBApi.h:95
#define B_CROSSDIAGONAL
Definition BBApi.h:75
#define BB_CONSOLEMESSAGE
Definition BBApi.h:165
#define B_SOLID
Definition BBApi.h:80
#define B_ELLIPTIC
Definition BBApi.h:77
#define BB_TOGGLEPLUGINS
Definition BBApi.h:167
#define CONSOLE_REGULAR_MESSAGE
Definition BBApi.h:297
#define BBRG_HARDWARE
Definition BBApi.h:232
#define BB_REDRAWGUI
Definition BBApi.h:220
#define BB_MENU
Definition BBApi.h:160
#define CONSOLE_PLAIN_MESSAGE
Definition BBApi.h:302
#define B_MIRRORVERTICAL
Definition BBApi.h:96
#define BBRG_TOOLBAR
Definition BBApi.h:221
#define B_HORIZONTAL
Definition BBApi.h:72
#define B_DIAGONAL
Definition BBApi.h:74
#define BB_BROADCAST
Definition BBApi.h:245
#define BB_RECONFIGURE
Definition BBApi.h:147
#define CONSOLE_SHELL_MESSAGE
Definition BBApi.h:301
#define B_SPLITSOLID
Definition BBApi.h:88
#define B_PIPECROSS
Definition BBApi.h:76
#define CONSOLE_ERROR_MESSAGE
Definition BBApi.h:300
#define BB_SETTHEME
Definition BBApi.h:151
#define BEVEL_RAISED
Definition BBApi.h:106
#define BEVEL_FLAT
Definition BBApi.h:105
#define B_SPLITHORIZONTAL
Definition BBApi.h:86
#define BB_WORKSPACE
Definition BBApi.h:183
#define B_SUPERVERTICAL
Definition BBApi.h:92
#define BB_SETSTYLE
Definition BBApi.h:148
#define BEVEL_SUNKEN
Definition BBApi.h:107
#define BBRG_DESKTOP
Definition BBApi.h:225
#define B_SPLITVERTICAL
Definition BBApi.h:87
#define BBRG_WINDOW
Definition BBApi.h:223
#define BB_POPUPMESSAGE
Definition BBApi.h:166
#define BB_TOGGLEDOCK
Definition BBApi.h:170
#define BEVEL2
Definition BBApi.h:109
#define B_PARENTRELATIVE
Definition BBApi.h:69
#define B_SUPERHORIZONTAL
Definition BBApi.h:91
#define MAX_LINE_LENGTH
Definition BBApi.h:64
#define B_PYRAMID
Definition BBApi.h:79
#define CONSOLE_INFORMATION_MESSAGE
Definition BBApi.h:298
#define BB_TOGGLETOOLBAR
Definition BBApi.h:171
#define BBRG_MENU
Definition BBApi.h:222
#define B_RECTANGLE
Definition BBApi.h:78
#define CONSOLE_INDENTED_MESSAGE
Definition BBApi.h:303
#define CONSOLE_WARNING_MESSAGE
Definition BBApi.h:299
Hotkeys * pHotkeys
Definition Blackbox.cpp:39
Toolbar * pToolbar
Definition Blackbox.cpp:48
Tooltips * pTooltips
Definition Blackbox.cpp:49
Console * pConsole
Definition Blackbox.cpp:36
HINSTANCE hMainInstance
Definition Blackbox.cpp:61
Dock * pDock
Definition Blackbox.cpp:38
void ExecuteScript(void *param)
Definition Broams.cpp:2440
unsigned int numberOfFiles
Definition Broams.cpp:47
bool FindRandomFile(LPSTR folder, int type, bool applyRandom)
Definition Broams.cpp:2460
unsigned int currentFile
Definition Broams.cpp:47
void ToggleExplorer()
Definition Broams.cpp:2560
unsigned int randomFile
Definition Broams.cpp:47
char pathToScan[MAX_PATH]
Definition Broams.cpp:48
void CreateRunBox(HINSTANCE hMainInstance, LPSTR commandString, LPSTR initString)
Definition Broams.cpp:2739
#define BROAM_RANDOM_STYLE
Definition Broams.h:36
#define BROAM_RANDOM_WALLPAPER
Definition Broams.h:37
void checkForUpdates(void *param)
Definition PluginManager.cpp:630
#define MENU_BULLET_TRIPLE
Definition Settings.h:59
#define PLACEMENT_CENTER_LEFT
Definition Settings.h:71
#define PLACEMENT_OPPOSITE_TOOLBAR
Definition Settings.h:78
#define PLACEMENT_LEFT_HALF
Definition Settings.h:80
#define TASKBAR_SORT_BY_LAST_USED
Definition Settings.h:49
#define PLACEMENT_TOP_CENTER
Definition Settings.h:69
#define TASKBAR_MODE_BARS
Definition Settings.h:43
#define PLACEMENT_CENTERED
Definition Settings.h:84
#define PLACEMENT_TOP_HALF
Definition Settings.h:82
#define MENU_BULLET_COMMENT
Definition Settings.h:60
#define PLACEMENT_BOTTOM_CENTER
Definition Settings.h:75
#define PLACEMENT_DEFAULT
Definition Settings.h:77
#define MENU_BULLET_SQUARE
Definition Settings.h:56
#define MENU_BULLET_QUAD
Definition Settings.h:62
#define MENU_BULLET_DIAMOND
Definition Settings.h:55
#define MENU_BULLET_CIRCLE
Definition Settings.h:58
#define MENU_BULLET_EMPTY
Definition Settings.h:54
#define TASKBAR_MODE_BARSICONS
Definition Settings.h:44
#define PLACEMENT_BOTTOM_LEFT
Definition Settings.h:74
#define MENU_BULLET_TRIANGLE
Definition Settings.h:57
#define MENU_BULLET_IMAGE
Definition Settings.h:63
#define TASKBAR_MODE_HIDDEN
Definition Settings.h:42
#define PLACEMENT_BOTTOM_HALF
Definition Settings.h:83
#define TASKBAR_SORT_DISABLED
Definition Settings.h:47
#define PLACEMENT_TOP_LEFT
Definition Settings.h:68
#define MENU_BULLET_GRID
Definition Settings.h:61
#define PLACEMENT_CENTER_CENTER
Definition Settings.h:72
#define PLACEMENT_TOP_RIGHT
Definition Settings.h:70
#define PLACEMENT_BOTTOM_RIGHT
Definition Settings.h:76
#define PLACEMENT_CENTER_RIGHT
Definition Settings.h:73
#define TASKBAR_MODE_ICONS
Definition Settings.h:45
#define TASKBAR_SORT_FOLLOW_ACTIVE
Definition Settings.h:48
#define PLACEMENT_RIGHT_HALF
Definition Settings.h:81
void PlaySoundFX(int sound)
Definition Sounds.cpp:40
@ SFX_MENU_SHOW
Definition Sounds.h:42
@ SFX_TOGGLE_ELEMENT
Definition Sounds.h:48
void UnregisterThemeFonts()
Definition Themes.cpp:293
void RegisterThemeFonts()
Definition Themes.cpp:229
int borderWidth
Definition BBApi.h:417
bool bordered
Definition BBApi.h:421