fix switch statement
[nedit-bw.git] / ColoredWinMenu-transient.patch
blobabe126d017eb59ac920fae2d24134acdb104585f
1 Subject: "transient" support for ColoredWinMenu patch
3 ---
5 doc/help.etx | 6 +++++-
6 source/menu.c | 5 +++++
7 source/preferences.c | 16 ++++++++++++++++
8 source/preferences.h | 2 ++
9 4 files changed, 28 insertions(+), 1 deletion(-)
11 diff --quilt old/doc/help.etx new/doc/help.etx
12 --- old/doc/help.etx
13 +++ new/doc/help.etx
14 @@ -4624,10 +4624,14 @@ X Resources
16 Defines the color of read-only files in the Windows menu.
18 +**nedit.transientWinMenuColor**: yellow
20 + Defines the color of transient files in the Windows menu.
22 **nedit.backgroundWinMenuColor**: white
24 Defines the color of the background used for colored Windows menu items
25 - when using either the modified or read-only foreground color.
26 + when using either the modified, read-only or transient foreground color.
28 **nedit.multiClickTime**: (system specific)
30 diff --quilt old/source/menu.c new/source/menu.c
31 --- old/source/menu.c
32 +++ new/source/menu.c
33 @@ -4452,6 +4452,7 @@ static void setTransientAP(Widget text,
35 UpdateWindowTitle(window);
36 RefreshTabState(window);
37 + InvalidateWindowMenus();
40 static void setTabDistAP(Widget w, XEvent *event, String *args,
41 @@ -4847,6 +4848,10 @@ static void colorWindowMenuEntries(const
42 color = GetPrefRoMenuColor(&colorLength);
43 bgcolor = GetPrefBgMenuColor(&bgcolorLength);
45 + else if (window->transient == TRUE) {
46 + color = GetPrefTransMenuColor(&colorLength);
47 + bgcolor = GetPrefBgMenuColor(&bgcolorLength);
48 + }
49 else if (window->fileChanged == TRUE) {
50 color = GetPrefModMenuColor(&colorLength);
51 bgcolor = GetPrefBgMenuColor(&bgcolorLength);
52 diff --quilt old/source/preferences.c new/source/preferences.c
53 --- old/source/preferences.c
54 +++ new/source/preferences.c
55 @@ -369,6 +369,8 @@ static struct prefData {
56 int defMenuColorLength;
57 char bgMenuColor[MAX_COLOR_LENGTH];
58 int bgMenuColorLength;
59 + char transMenuColor[MAX_COLOR_LENGTH];
60 + int transMenuColorLength;
61 } PrefData;
63 /* Temporary storage for preferences strings which are discarded after being
64 @@ -1213,6 +1215,8 @@ static PrefDescripRec PrefDescrip[] = {
65 PrefData.defMenuColor, (void *)sizeof(PrefData.defMenuColor), False},
66 {"backgroundWinMenuColor", "BackgroundWinMenuColor", PREF_STRING, "white",
67 PrefData.bgMenuColor, (void *)sizeof(PrefData.bgMenuColor), False},
68 + {"transientWinMenuColor", "TransientWinMenuColor", PREF_STRING, "yellow",
69 + PrefData.transMenuColor, (void *)sizeof(PrefData.transMenuColor), False},
72 static XrmOptionDescRec OpTable[] = {
73 @@ -1581,6 +1585,7 @@ static void translatePrefFormats(int con
74 SetPrefRoMenuColorLength(PrefData.roMenuColor);
75 SetPrefDefMenuColorLength(PrefData.defMenuColor);
76 SetPrefBgMenuColorLength(PrefData.bgMenuColor);
77 + SetPrefTransMenuColorLength(PrefData.transMenuColor);
79 /* setup language mode dependent info of user menus (to increase
80 performance when switching between documents of different
81 @@ -2386,6 +2391,17 @@ void SetPrefBgMenuColorLength(const char
82 PrefData.bgMenuColorLength = strlen(string);
85 +const char *GetPrefTransMenuColor(int* length)
87 + *length = PrefData.transMenuColorLength;
88 + return PrefData.transMenuColor;
91 +void SetPrefTransMenuColorLength(const char* string)
93 + PrefData.transMenuColorLength = strlen(string);
96 int GetPrefOverrideVirtKeyBindings(void)
98 return PrefData.virtKeyOverride;
99 diff --quilt old/source/preferences.h new/source/preferences.h
100 --- old/source/preferences.h
101 +++ new/source/preferences.h
102 @@ -203,6 +203,8 @@ const char *GetPrefDefMenuColor(int* len
103 void SetPrefDefMenuColorLength(const char* string);
104 const char *GetPrefBgMenuColor(int* length);
105 void SetPrefBgMenuColorLength(const char* string);
106 +const char *GetPrefTransMenuColor(int* length);
107 +void SetPrefTransMenuColorLength(const char* string);
108 void SetPrefFindReplaceUsesSelection(int state);
109 int GetPrefFindReplaceUsesSelection(void);
110 int GetPrefStickyCaseSenseBtn(void);