Mercurial > mplayer.hg
comparison gui/app.c @ 33555:c5a19bbeac2b
Cosmetic: Rename some GUI variables and functions.
The new names are more intelligible and consistent.
List of changes:
guiIntfStruct -> guiInfo
appMPlayer -> guiApp
txSample -> guiImage (and member BPP -> Bpp)
mplDrawBuffer -> mainDrawBuffer
mplPBDrawBuffer -> playbarDrawBuffer
mplMenuDrawBuffer -> menuDrawBuffer
mpl.* -> ui.* (or mpl dropped)
.*bar.* -> .*playbar.*
URLItem -> urlItem
ChangeSkin -> uiChangeSkin
Convert32to1 -> bpRenderMask
author | ib |
---|---|
date | Sat, 18 Jun 2011 14:33:41 +0000 |
parents | f9d3084f2e95 |
children | dac15337cfb6 |
comparison
equal
deleted
inserted
replaced
33554:02d94048970e | 33555:c5a19bbeac2b |
---|---|
21 #include "interface.h" | 21 #include "interface.h" |
22 #include "skin/font.h" | 22 #include "skin/font.h" |
23 | 23 |
24 #include "libavutil/common.h" | 24 #include "libavutil/common.h" |
25 | 25 |
26 guiItems appMPlayer = { | 26 guiItems guiApp = { |
27 .IndexOfMainItems = -1, | 27 .IndexOfMainItems = -1, |
28 .IndexOfBarItems = -1, | 28 .IndexOfPlaybarItems = -1, |
29 .IndexOfMenuItems = -1 | 29 .IndexOfMenuItems = -1 |
30 }; | 30 }; |
31 | 31 |
32 static const evName evNames[] = { | 32 static const evName evNames[] = { |
33 { evNone, "evNone" }, | 33 { evNone, "evNone" }, |
34 { evPlay, "evPlay" }, | 34 { evPlay, "evPlay" }, |
90 | 90 |
91 void appFreeStruct(void) | 91 void appFreeStruct(void) |
92 { | 92 { |
93 int i; | 93 int i; |
94 | 94 |
95 appClearItem(&appMPlayer.main); | 95 appClearItem(&guiApp.main); |
96 appMPlayer.mainDecoration = 0; | 96 guiApp.mainDecoration = 0; |
97 | 97 |
98 appClearItem(&appMPlayer.sub); | 98 appClearItem(&guiApp.sub); |
99 | 99 |
100 appClearItem(&appMPlayer.bar); | 100 appClearItem(&guiApp.playbar); |
101 appMPlayer.barIsPresent = 0; | 101 guiApp.playbarIsPresent = 0; |
102 | 102 |
103 appClearItem(&appMPlayer.menu); | 103 appClearItem(&guiApp.menu); |
104 appClearItem(&appMPlayer.menuSelected); | 104 appClearItem(&guiApp.menuSelected); |
105 appMPlayer.menuIsPresent = 0; | 105 guiApp.menuIsPresent = 0; |
106 | 106 |
107 for (i = 0; i <= appMPlayer.IndexOfMainItems; i++) | 107 for (i = 0; i <= guiApp.IndexOfMainItems; i++) |
108 appClearItem(&appMPlayer.mainItems[i]); | 108 appClearItem(&guiApp.mainItems[i]); |
109 for (i = 0; i <= appMPlayer.IndexOfBarItems; i++) | 109 for (i = 0; i <= guiApp.IndexOfPlaybarItems; i++) |
110 appClearItem(&appMPlayer.barItems[i]); | 110 appClearItem(&guiApp.playbarItems[i]); |
111 for (i = 0; i <= appMPlayer.IndexOfMenuItems; i++) | 111 for (i = 0; i <= guiApp.IndexOfMenuItems; i++) |
112 appClearItem(&appMPlayer.menuItems[i]); | 112 appClearItem(&guiApp.menuItems[i]); |
113 | 113 |
114 appMPlayer.IndexOfMainItems = -1; | 114 guiApp.IndexOfMainItems = -1; |
115 appMPlayer.IndexOfBarItems = -1; | 115 guiApp.IndexOfPlaybarItems = -1; |
116 appMPlayer.IndexOfMenuItems = -1; | 116 guiApp.IndexOfMenuItems = -1; |
117 | 117 |
118 fntFreeFont(); | 118 fntFreeFont(); |
119 } | 119 } |
120 | 120 |
121 int appFindMessage(unsigned char *str) | 121 int appFindMessage(unsigned char *str) |
131 | 131 |
132 void btnModify(int event, float state) | 132 void btnModify(int event, float state) |
133 { | 133 { |
134 int i; | 134 int i; |
135 | 135 |
136 for (i = 0; i <= appMPlayer.IndexOfMainItems; i++) { | 136 for (i = 0; i <= guiApp.IndexOfMainItems; i++) { |
137 if (appMPlayer.mainItems[i].message == event) { | 137 if (guiApp.mainItems[i].message == event) { |
138 switch (appMPlayer.mainItems[i].type) { | 138 switch (guiApp.mainItems[i].type) { |
139 case itButton: | 139 case itButton: |
140 appMPlayer.mainItems[i].pressed = (int)state; | 140 guiApp.mainItems[i].pressed = (int)state; |
141 break; | 141 break; |
142 | 142 |
143 case itPotmeter: | 143 case itPotmeter: |
144 case itVPotmeter: | 144 case itVPotmeter: |
145 case itHPotmeter: | 145 case itHPotmeter: |
146 if (state < 0.0f) | 146 if (state < 0.0f) |
147 state = 0.0f; | 147 state = 0.0f; |
148 if (state > 100.0f) | 148 if (state > 100.0f) |
149 state = 100.0f; | 149 state = 100.0f; |
150 appMPlayer.mainItems[i].value = state; | 150 guiApp.mainItems[i].value = state; |
151 break; | 151 break; |
152 } | 152 } |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 for (i = 0; i <= appMPlayer.IndexOfBarItems; i++) { | 156 for (i = 0; i <= guiApp.IndexOfPlaybarItems; i++) { |
157 if (appMPlayer.barItems[i].message == event) { | 157 if (guiApp.playbarItems[i].message == event) { |
158 switch (appMPlayer.barItems[i].type) { | 158 switch (guiApp.playbarItems[i].type) { |
159 case itButton: | 159 case itButton: |
160 appMPlayer.barItems[i].pressed = (int)state; | 160 guiApp.playbarItems[i].pressed = (int)state; |
161 break; | 161 break; |
162 | 162 |
163 case itPotmeter: | 163 case itPotmeter: |
164 case itVPotmeter: | 164 case itVPotmeter: |
165 case itHPotmeter: | 165 case itHPotmeter: |
166 if (state < 0.0f) | 166 if (state < 0.0f) |
167 state = 0.0f; | 167 state = 0.0f; |
168 if (state > 100.0f) | 168 if (state > 100.0f) |
169 state = 100.0f; | 169 state = 100.0f; |
170 appMPlayer.barItems[i].value = state; | 170 guiApp.playbarItems[i].value = state; |
171 break; | 171 break; |
172 } | 172 } |
173 } | 173 } |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 void btnSet(int event, int set) | 177 void btnSet(int event, int set) |
178 { | 178 { |
179 int i; | 179 int i; |
180 | 180 |
181 for (i = 0; i <= appMPlayer.IndexOfMainItems; i++) | 181 for (i = 0; i <= guiApp.IndexOfMainItems; i++) |
182 if (appMPlayer.mainItems[i].message == event) | 182 if (guiApp.mainItems[i].message == event) |
183 appMPlayer.mainItems[i].pressed = set; | 183 guiApp.mainItems[i].pressed = set; |
184 | 184 |
185 for (i = 0; i <= appMPlayer.IndexOfBarItems; i++) | 185 for (i = 0; i <= guiApp.IndexOfPlaybarItems; i++) |
186 if (appMPlayer.barItems[i].message == event) | 186 if (guiApp.playbarItems[i].message == event) |
187 appMPlayer.barItems[i].pressed = set; | 187 guiApp.playbarItems[i].pressed = set; |
188 } | 188 } |