Mercurial > audlegacy
annotate src/audacious/ui_manager.c @ 2893:fb30d861b1f5 trunk
branch merge
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Sun, 24 Jun 2007 05:33:57 -0500 |
parents | 7dad846ec699 |
children | 062324422c40 2520e8b6cf5e |
rev | line source |
---|---|
2862
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
1 /* |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
2 * audacious: Cross-platform multimedia player. |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
3 * ui_manager.c: Code for working with GtkUIManager objects. |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
4 * |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
5 * Copyright (c) 2005-2007 Audacious development team. |
2313 | 6 * |
2862
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
7 * Redistribution and use in source and binary forms, with or without |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
8 * modification, are permitted provided that the following conditions are |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
9 * met: |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
10 * |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
11 * 1. Redistributions of source code must retain the above copyright notice, |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
12 * this list of conditions and the following disclaimer. |
2313 | 13 * |
2862
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
14 * 2. Redistributions in binary form must reproduce the above copyright |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
15 * notice, this list of conditions and the following disclaimer in the |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
16 * documentation and/or other materials provided with the distribution. |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
17 * |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
18 * 3. The name of the author may not be used to endorse or promote products |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
19 * derived from this software without specific prior written permission. |
2313 | 20 * |
2862
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
7dad846ec699
BSD relicensing (pass 3).
William Pitcock <nenolod@atheme.org>
parents:
2598
diff
changeset
|
31 * POSSIBILITY OF SUCH DAMAGE. |
2313 | 32 */ |
33 | |
34 #ifdef HAVE_CONFIG_H | |
35 # include "config.h" | |
36 #endif | |
37 | |
38 #include "ui_manager.h" | |
39 #include "actions-mainwin.h" | |
40 #include "actions-playlist.h" | |
41 #include "actions-equalizer.h" | |
42 | |
43 /* TODO ui_main.h is only included because ui_manager.c needs the values of | |
44 TimerMode enum; move that enum elsewhere so we can get rid of this include */ | |
45 #include "ui_main.h" | |
46 /* we need this to define values of visualization radio-actions */ | |
47 #include "widgets/widgetcore.h" | |
48 | |
49 #include "icons-stock.h" | |
50 | |
51 | |
52 static GtkUIManager *ui_manager; | |
53 | |
54 | |
55 /* toggle action entries */ | |
56 | |
57 static GtkToggleActionEntry toggleaction_entries_others[] = { | |
58 | |
59 { "autoscroll songname", NULL , N_("Autoscroll Songname"), NULL, | |
60 N_("Autoscroll Songname"), G_CALLBACK(action_autoscroll_songname) , FALSE }, | |
61 | |
62 { "stop after current song", NULL , N_("Stop after Current Song"), "<Ctrl>M", | |
63 N_("Stop after Current Song"), G_CALLBACK(action_stop_after_current_song) , FALSE }, | |
64 | |
65 { "anamode peaks", NULL , N_("Peaks"), NULL, | |
66 N_("Peaks"), G_CALLBACK(action_anamode_peaks) , FALSE }, | |
67 | |
68 { "playback repeat", NULL , N_("Repeat"), "R", | |
69 N_("Repeat"), G_CALLBACK(action_playback_repeat) , FALSE }, | |
70 | |
71 { "playback shuffle", NULL , N_("Shuffle"), "S", | |
72 N_("Shuffle"), G_CALLBACK(action_playback_shuffle) , FALSE }, | |
73 | |
74 { "playback no playlist advance", NULL , N_("No Playlist Advance"), "<Ctrl>N", | |
75 N_("No Playlist Advance"), G_CALLBACK(action_playback_noplaylistadvance) , FALSE }, | |
76 | |
77 { "show player", NULL , N_("Show Player"), "<Alt>M", | |
78 N_("Show Player"), G_CALLBACK(action_show_player) , FALSE }, | |
79 | |
80 { "show playlist editor", NULL , N_("Show Playlist Editor"), "<Alt>E", | |
81 N_("Show Playlist Editor"), G_CALLBACK(action_show_playlist_editor) , FALSE }, | |
82 | |
83 { "show equalizer", NULL , N_("Show Equalizer"), "<Alt>G", | |
84 N_("Show Equalizer"), G_CALLBACK(action_show_equalizer) , FALSE }, | |
85 | |
86 { "view always on top", NULL , N_("Always on Top"), "<Ctrl>O", | |
87 N_("Always on Top"), G_CALLBACK(action_view_always_on_top) , FALSE }, | |
88 | |
89 { "view put on all workspaces", NULL , N_("Put on All Workspaces"), "<Ctrl>S", | |
90 N_("Put on All Workspaces"), G_CALLBACK(action_view_on_all_workspaces) , FALSE }, | |
91 | |
92 { "roll up player", NULL , N_("Roll up Player"), "<Ctrl>W", | |
93 N_("Roll up Player"), G_CALLBACK(action_roll_up_player) , FALSE }, | |
94 | |
95 { "roll up playlist editor", NULL , N_("Roll up Playlist Editor"), "<Shift><Ctrl>W", | |
96 N_("Roll up Playlist Editor"), G_CALLBACK(action_roll_up_playlist_editor) , FALSE }, | |
97 | |
98 { "roll up equalizer", NULL , N_("Roll up Equalizer"), "<Ctrl><Alt>W", | |
99 N_("Roll up Equalizer"), G_CALLBACK(action_roll_up_equalizer) , FALSE }, | |
100 | |
101 { "view doublesize", NULL , N_("DoubleSize"), "<Ctrl>D", | |
102 N_("DoubleSize"), G_CALLBACK(action_view_doublesize) , FALSE }, | |
103 | |
104 { "view easy move", NULL , N_("Easy Move"), "<Ctrl>E", | |
105 N_("Easy Move"), G_CALLBACK(action_view_easymove) , FALSE } | |
106 }; | |
107 | |
108 | |
109 | |
110 /* radio action entries */ | |
111 | |
112 static GtkRadioActionEntry radioaction_entries_vismode[] = { | |
113 { "vismode analyzer", NULL , N_("Analyzer"), NULL, N_("Analyzer"), VIS_ANALYZER }, | |
114 { "vismode scope", NULL , N_("Scope"), NULL, N_("Scope"), VIS_SCOPE }, | |
115 { "vismode voiceprint", NULL , N_("Voiceprint"), NULL, N_("Voiceprint"), VIS_VOICEPRINT }, | |
116 { "vismode off", NULL , N_("Off"), NULL, N_("Off"), VIS_OFF } | |
117 }; | |
118 | |
119 static GtkRadioActionEntry radioaction_entries_anamode[] = { | |
120 { "anamode normal", NULL , N_("Normal"), NULL, N_("Normal"), ANALYZER_NORMAL }, | |
121 { "anamode fire", NULL , N_("Fire"), NULL, N_("Fire"), ANALYZER_FIRE }, | |
122 { "anamode vertical lines", NULL , N_("Vertical Lines"), NULL, N_("Vertical Lines"), ANALYZER_VLINES } | |
123 }; | |
124 | |
125 static GtkRadioActionEntry radioaction_entries_anatype[] = { | |
126 { "anatype lines", NULL , N_("Lines"), NULL, N_("Lines"), ANALYZER_LINES }, | |
127 { "anatype bars", NULL , N_("Bars"), NULL, N_("Bars"), ANALYZER_BARS } | |
128 }; | |
129 | |
130 static GtkRadioActionEntry radioaction_entries_scomode[] = { | |
131 { "scomode dot", NULL , N_("Dot Scope"), NULL, N_("Dot Scope"), SCOPE_DOT }, | |
132 { "scomode line", NULL , N_("Line Scope"), NULL, N_("Line Scope"), SCOPE_LINE }, | |
133 { "scomode solid", NULL , N_("Solid Scope"), NULL, N_("Solid Scope"), SCOPE_SOLID } | |
134 }; | |
135 | |
136 static GtkRadioActionEntry radioaction_entries_vprmode[] = { | |
137 { "vprmode normal", NULL , N_("Normal"), NULL, N_("Normal"), VOICEPRINT_NORMAL }, | |
138 { "vprmode fire", NULL , N_("Fire"), NULL, N_("Fire"), VOICEPRINT_FIRE }, | |
139 { "vprmode ice", NULL , N_("Ice"), NULL, N_("Ice"), VOICEPRINT_ICE } | |
140 }; | |
141 | |
142 static GtkRadioActionEntry radioaction_entries_wshmode[] = { | |
143 { "wshmode normal", NULL , N_("Normal"), NULL, N_("Normal"), VU_NORMAL }, | |
144 { "wshmode smooth", NULL , N_("Smooth"), NULL, N_("Smooth"), VU_SMOOTH } | |
145 }; | |
146 | |
147 static GtkRadioActionEntry radioaction_entries_refrate[] = { | |
148 { "refrate full", NULL , N_("Full (~50 fps)"), NULL, N_("Full (~50 fps)"), REFRESH_FULL }, | |
149 { "refrate half", NULL , N_("Half (~25 fps)"), NULL, N_("Half (~25 fps)"), REFRESH_HALF }, | |
150 { "refrate quarter", NULL , N_("Quarter (~13 fps)"), NULL, N_("Quarter (~13 fps)"), REFRESH_QUARTER }, | |
151 { "refrate eighth", NULL , N_("Eighth (~6 fps)"), NULL, N_("Eighth (~6 fps)"), REFRESH_EIGTH } | |
152 }; | |
153 | |
154 static GtkRadioActionEntry radioaction_entries_anafoff[] = { | |
155 { "anafoff slowest", NULL , N_("Slowest"), NULL, N_("Slowest"), FALLOFF_SLOWEST }, | |
156 { "anafoff slow", NULL , N_("Slow"), NULL, N_("Slow"), FALLOFF_SLOW }, | |
157 { "anafoff medium", NULL , N_("Medium"), NULL, N_("Medium"), FALLOFF_MEDIUM }, | |
158 { "anafoff fast", NULL , N_("Fast"), NULL, N_("Fast"), FALLOFF_FAST }, | |
159 { "anafoff fastest", NULL , N_("Fastest"), NULL, N_("Fastest"), FALLOFF_FASTEST } | |
160 }; | |
161 | |
162 static GtkRadioActionEntry radioaction_entries_peafoff[] = { | |
163 { "peafoff slowest", NULL , N_("Slowest"), NULL, N_("Slowest"), FALLOFF_SLOWEST }, | |
164 { "peafoff slow", NULL , N_("Slow"), NULL, N_("Slow"), FALLOFF_SLOW }, | |
165 { "peafoff medium", NULL , N_("Medium"), NULL, N_("Medium"), FALLOFF_MEDIUM }, | |
166 { "peafoff fast", NULL , N_("Fast"), NULL, N_("Fast"), FALLOFF_FAST }, | |
167 { "peafoff fastest", NULL , N_("Fastest"), NULL, N_("Fastest"), FALLOFF_FASTEST } | |
168 }; | |
169 | |
170 static GtkRadioActionEntry radioaction_entries_viewtime[] = { | |
171 { "view time elapsed", NULL , N_("Time Elapsed"), "<Ctrl>E", N_("Time Elapsed"), TIMER_ELAPSED }, | |
172 { "view time remaining", NULL , N_("Time Remaining"), "<Ctrl>R", N_("Time Remaining"), TIMER_REMAINING } | |
173 }; | |
174 | |
175 | |
176 | |
177 /* normal actions */ | |
178 | |
179 static GtkActionEntry action_entries_playback[] = { | |
180 | |
181 { "playback", NULL, N_("Playback") }, | |
182 | |
183 { "playback play cd", GTK_STOCK_CDROM , N_("Play CD"), "<Alt>C", | |
184 N_("Play CD"), G_CALLBACK(action_playback_playcd) }, | |
185 | |
186 { "playback play", GTK_STOCK_MEDIA_PLAY , N_("Play"), "X", | |
187 N_("Play"), G_CALLBACK(action_playback_play) }, | |
188 | |
189 { "playback pause", GTK_STOCK_MEDIA_PAUSE , N_("Pause"), "C", | |
190 N_("Pause"), G_CALLBACK(action_playback_pause) }, | |
191 | |
192 { "playback stop", GTK_STOCK_MEDIA_STOP , N_("Stop"), "V", | |
193 N_("Stop"), G_CALLBACK(action_playback_stop) }, | |
194 | |
195 { "playback previous", GTK_STOCK_MEDIA_PREVIOUS , N_("Previous"), "Z", | |
196 N_("Previous"), G_CALLBACK(action_playback_previous) }, | |
197 | |
198 { "playback next", GTK_STOCK_MEDIA_NEXT , N_("Next"), "B", | |
199 N_("Next"), G_CALLBACK(action_playback_next) } | |
200 }; | |
201 | |
202 | |
203 static GtkActionEntry action_entries_visualization[] = { | |
204 { "visualization", NULL, N_("Visualization") }, | |
205 { "vismode", NULL, N_("Visualization Mode") }, | |
206 { "anamode", NULL, N_("Analyzer Mode") }, | |
207 { "scomode", NULL, N_("Scope Mode") }, | |
208 { "vprmode", NULL, N_("Voiceprint Mode") }, | |
209 { "wshmode", NULL, N_("WindowShade VU Mode") }, | |
210 { "refrate", NULL, N_("Refresh Rate") }, | |
211 { "anafoff", NULL, N_("Analyzer Falloff") }, | |
212 { "peafoff", NULL, N_("Peaks Falloff") } | |
213 }; | |
214 | |
215 static GtkActionEntry action_entries_playlist[] = { | |
216 | |
217 { "playlist", NULL, N_("Playlist") }, | |
218 | |
219 { "playlist new", GTK_STOCK_NEW , N_("New Playlist"), "<Shift>N", | |
220 N_("New Playlist"), G_CALLBACK(action_playlist_new) }, | |
221 | |
222 { "playlist select next", GTK_STOCK_MEDIA_NEXT, N_("Select Next Playlist"), "<Shift>P", | |
223 N_("Select Next Playlist"), G_CALLBACK(action_playlist_next) }, | |
224 | |
225 { "playlist select previous", GTK_STOCK_MEDIA_PREVIOUS, N_("Select Previous Playlist"), "<Shift><Ctrl>P", | |
226 N_("Select Previous Playlist"), G_CALLBACK(action_playlist_prev) }, | |
227 | |
228 { "playlist delete", GTK_STOCK_DELETE , N_("Delete Playlist"), "<Shift>D", | |
229 N_("Delete Playlist"), G_CALLBACK(action_playlist_delete) }, | |
230 | |
231 { "playlist load", GTK_STOCK_OPEN, N_("Load List"), "O", | |
232 N_("Loads a playlist file into the selected playlist."), G_CALLBACK(action_playlist_load_list) }, | |
233 | |
234 { "playlist save", GTK_STOCK_SAVE, N_("Save List"), "<Shift>S", | |
235 N_("Saves the selected playlist."), G_CALLBACK(action_playlist_save_list) }, | |
236 | |
237 { "playlist save default", GTK_STOCK_SAVE, N_("Save Default List"), "<Alt>S", | |
238 N_("Saves the selected playlist to the default location."), | |
239 G_CALLBACK(action_playlist_save_default_list) }, | |
240 | |
241 { "playlist refresh", GTK_STOCK_REFRESH, N_("Refresh List"), "F5", | |
242 N_("Refreshes metadata associated with a playlist entry."), | |
243 G_CALLBACK(action_playlist_refresh_list) }, | |
244 | |
245 { "playlist manager", AUD_STOCK_PLAYLIST , N_("List Manager"), "P", | |
246 N_("Opens the playlist manager."), | |
247 G_CALLBACK(action_open_list_manager) } | |
248 }; | |
249 | |
250 static GtkActionEntry action_entries_view[] = { | |
251 | |
252 { "view", NULL, N_("View") } | |
253 }; | |
254 | |
255 static GtkActionEntry action_entries_playlist_add[] = { | |
256 { "playlist add cd", GTK_STOCK_CDROM, N_("Add CD..."), "<Shift>C", | |
257 N_("Adds a CD to the playlist."), | |
258 G_CALLBACK(action_playlist_add_cd) }, | |
259 | |
260 { "playlist add url", GTK_STOCK_NETWORK, N_("Add Internet Address..."), "<Ctrl>H", | |
261 N_("Adds a remote track to the playlist."), | |
262 G_CALLBACK(action_playlist_add_url) }, | |
263 | |
264 { "playlist add files", GTK_STOCK_ADD, N_("Add Files..."), "F", | |
265 N_("Adds files to the playlist."), | |
266 G_CALLBACK(action_playlist_add_files) }, | |
267 }; | |
268 | |
269 static GtkActionEntry action_entries_playlist_select[] = { | |
270 { "playlist search and select", GTK_STOCK_FIND, N_("Search and Select"), "<Ctrl>F", | |
271 N_("Searches the playlist and selects playlist entries based on specific criteria."), | |
272 G_CALLBACK(action_playlist_search_and_select) }, | |
273 | |
274 { "playlist invert selection", AUD_STOCK_SELECTINVERT , N_("Invert Selection"), NULL, | |
275 N_("Inverts the selected and unselected entries."), | |
276 G_CALLBACK(action_playlist_invert_selection) }, | |
277 | |
278 { "playlist select all", AUD_STOCK_SELECTALL , N_("Select All"), "<Ctrl>A", | |
279 N_("Selects all of the playlist entries."), | |
280 G_CALLBACK(action_playlist_select_all) }, | |
281 | |
282 { "playlist select none", AUD_STOCK_SELECTNONE , N_("Select None"), "<Shift><Ctrl>A", | |
283 N_("Deselects all of the playlist entries."), | |
284 G_CALLBACK(action_playlist_select_none) }, | |
285 }; | |
286 | |
287 static GtkActionEntry action_entries_playlist_delete[] = { | |
288 { "playlist clear queue", GTK_STOCK_REMOVE, N_("Clear Queue"), "<Shift>Q", | |
289 N_("Clears the queue associated with this playlist."), | |
290 G_CALLBACK(action_playlist_clear_queue) }, | |
291 | |
292 { "playlist remove unavailable", AUD_STOCK_REMOVEUNAVAIL , N_("Remove Unavailable Files"), NULL, | |
293 N_("Removes unavailable files from the playlist."), | |
294 G_CALLBACK(action_playlist_remove_unavailable) }, | |
295 | |
296 { "playlist remove dups menu", AUD_STOCK_REMOVEDUPS , N_("Remove Duplicates") }, | |
297 | |
298 { "playlist remove dups by title", AUD_STOCK_REMOVEDUPS , N_("By Title"), NULL, | |
299 N_("Removes duplicate entries from the playlist by title."), | |
300 G_CALLBACK(action_playlist_remove_dupes_by_title) }, | |
301 | |
302 { "playlist remove dups by filename", AUD_STOCK_REMOVEDUPS , N_("By Filename"), NULL, | |
303 N_("Removes duplicate entries from the playlist by filename."), | |
304 G_CALLBACK(action_playlist_remove_dupes_by_filename) }, | |
305 | |
306 { "playlist remove dups by full path", AUD_STOCK_REMOVEDUPS , N_("By Path + Filename"), NULL, | |
307 N_("Removes duplicate entries from the playlist by their full path."), | |
308 G_CALLBACK(action_playlist_remove_dupes_by_full_path) }, | |
309 | |
310 { "playlist remove all", GTK_STOCK_CLEAR, N_("Remove All"), NULL, | |
311 N_("Removes all entries from the playlist."), | |
312 G_CALLBACK(action_playlist_remove_all) }, | |
313 | |
314 { "playlist remove unselected", GTK_STOCK_REMOVE, N_("Remove Unselected"), NULL, | |
315 N_("Remove unselected entries from the playlist."), | |
316 G_CALLBACK(action_playlist_remove_unselected) }, | |
317 | |
318 { "playlist remove selected", GTK_STOCK_REMOVE, N_("Remove Selected"), "Delete", | |
319 N_("Remove selected entries from the playlist."), | |
320 G_CALLBACK(action_playlist_remove_selected) }, | |
321 }; | |
322 | |
323 static GtkActionEntry action_entries_playlist_sort[] = { | |
324 { "playlist randomize list", AUD_STOCK_RANDOMIZEPL , N_("Randomize List"), "<Ctrl><Shift>R", | |
325 N_("Randomizes the playlist."), | |
326 G_CALLBACK(action_playlist_randomize_list) }, | |
327 | |
328 { "playlist reverse list", AUD_STOCK_INVERTPL , N_("Reverse List"), NULL, | |
329 N_("Reverses the playlist."), | |
330 G_CALLBACK(action_playlist_reverse_list) }, | |
331 | |
332 { "playlist sort menu", AUD_STOCK_SORTBYTITLE , N_("Sort List") }, | |
333 | |
334 { "playlist sort by title", AUD_STOCK_SORTBYTITLE , N_("By Title"), NULL, | |
335 N_("Sorts the list by title."), | |
336 G_CALLBACK(action_playlist_sort_by_title) }, | |
337 | |
338 { "playlist sort by artist", AUD_STOCK_SORTBYARTIST , N_("By Artist"), NULL, | |
339 N_("Sorts the list by artist."), | |
340 G_CALLBACK(action_playlist_sort_by_artist) }, | |
341 | |
342 { "playlist sort by filename", AUD_STOCK_SORTBYFILENAME , N_("By Filename"), NULL, | |
343 N_("Sorts the list by filename."), | |
344 G_CALLBACK(action_playlist_sort_by_filename) }, | |
345 | |
346 { "playlist sort by full path", AUD_STOCK_SORTBYPATHFILE , N_("By Path + Filename"), NULL, | |
347 N_("Sorts the list by full pathname."), | |
348 G_CALLBACK(action_playlist_sort_by_full_path) }, | |
349 | |
350 { "playlist sort by date", AUD_STOCK_SORTBYARTIST , N_("By Date"), NULL, | |
351 N_("Sorts the list by modification time."), | |
352 G_CALLBACK(action_playlist_sort_by_date) }, | |
353 | |
354 { "playlist sort by track number", AUD_STOCK_SORTBYFILENAME , N_("By Track Number"), NULL, | |
355 N_("Sorts the list by track number."), | |
356 G_CALLBACK(action_playlist_sort_by_track_number) }, | |
357 | |
358 { "playlist sort by playlist entry", AUD_STOCK_SORTBYPATHFILE , N_("By Playlist Entry"), NULL, | |
359 N_("Sorts the list by playlist entry."), | |
360 G_CALLBACK(action_playlist_sort_by_playlist_entry) }, | |
361 | |
362 { "playlist sort selected menu", AUD_STOCK_SORTBYTITLE , N_("Sort Selected") }, | |
363 | |
364 { "playlist sort selected by title", AUD_STOCK_SORTBYTITLE , N_("By Title"), NULL, | |
365 N_("Sorts the list by title."), | |
366 G_CALLBACK(action_playlist_sort_selected_by_title) }, | |
367 | |
368 { "playlist sort selected by artist", AUD_STOCK_SORTBYARTIST, N_("By Artist"), NULL, | |
369 N_("Sorts the list by artist."), | |
370 G_CALLBACK(action_playlist_sort_selected_by_artist) }, | |
371 | |
372 { "playlist sort selected by filename", AUD_STOCK_SORTBYFILENAME , N_("By Filename"), NULL, | |
373 N_("Sorts the list by filename."), | |
374 G_CALLBACK(action_playlist_sort_selected_by_filename) }, | |
375 | |
376 { "playlist sort selected by full path", AUD_STOCK_SORTBYPATHFILE , N_("By Path + Filename"), NULL, | |
377 N_("Sorts the list by full pathname."), | |
378 G_CALLBACK(action_playlist_sort_selected_by_full_path) }, | |
379 | |
380 { "playlist sort selected by date", AUD_STOCK_SORTBYARTIST , N_("By Date"), NULL, | |
381 N_("Sorts the list by modification time."), | |
382 G_CALLBACK(action_playlist_sort_selected_by_date) }, | |
383 | |
384 { "playlist sort selected by track number", AUD_STOCK_SORTBYFILENAME , N_("By Track Number"), NULL, | |
385 N_("Sorts the list by track number."), | |
386 G_CALLBACK(action_playlist_sort_selected_by_track_number) }, | |
387 | |
388 { "playlist sort selected by playlist entry", AUD_STOCK_SORTBYPATHFILE, N_("By Playlist Entry"), NULL, | |
389 N_("Sorts the list by playlist entry."), | |
390 G_CALLBACK(action_playlist_sort_selected_by_playlist_entry) }, | |
391 }; | |
392 | |
393 static GtkActionEntry action_entries_others[] = { | |
394 | |
395 { "dummy", NULL, "dummy" }, | |
396 | |
397 { "current track info", AUD_STOCK_INFO , N_("View Track Details"), "I", | |
398 N_("View track details"), G_CALLBACK(action_current_track_info) }, | |
399 | |
400 { "playlist track info", AUD_STOCK_INFO , N_("View Track Details"), "<Alt>I", | |
401 N_("View track details"), G_CALLBACK(action_playlist_track_info) }, | |
402 | |
403 { "about audacious", GTK_STOCK_DIALOG_INFO , N_("About Audacious"), NULL, | |
404 N_("About Audacious"), G_CALLBACK(action_about_audacious) }, | |
405 | |
406 { "play file", GTK_STOCK_OPEN , N_("Play File"), "L", | |
407 N_("Load and play a file"), G_CALLBACK(action_play_file) }, | |
408 | |
409 { "play location", GTK_STOCK_NETWORK , N_("Play Location"), "<Ctrl>L", | |
410 N_("Play media from the selected location"), G_CALLBACK(action_play_location) }, | |
411 | |
412 { "preferences", GTK_STOCK_PREFERENCES , N_("Preferences"), "<Ctrl>P", | |
413 N_("Open preferences window"), G_CALLBACK(action_preferences) }, | |
414 | |
415 { "quit", GTK_STOCK_QUIT , N_("_Quit"), NULL, | |
416 N_("Quit Audacious"), G_CALLBACK(action_quit) }, | |
417 | |
418 { "ab set", NULL , N_("Set A-B"), "A", | |
419 N_("Set A-B"), G_CALLBACK(action_ab_set) }, | |
420 | |
2598 | 421 { "ab clear", NULL , N_("Clear A-B"), "<Shift>A", |
2313 | 422 N_("Clear A-B"), G_CALLBACK(action_ab_clear) }, |
423 | |
424 { "jump to playlist start", GTK_STOCK_GOTO_TOP , N_("Jump to Playlist Start"), "<Ctrl>Z", | |
425 N_("Jump to Playlist Start"), G_CALLBACK(action_jump_to_playlist_start) }, | |
426 | |
427 { "jump to file", GTK_STOCK_JUMP_TO , N_("Jump to File"), "J", | |
428 N_("Jump to File"), G_CALLBACK(action_jump_to_file) }, | |
429 | |
430 { "jump to time", GTK_STOCK_JUMP_TO , N_("Jump to Time"), "<Ctrl>J", | |
431 N_("Jump to Time"), G_CALLBACK(action_jump_to_time) }, | |
432 | |
433 { "queue toggle", AUD_STOCK_QUEUETOGGLE , N_("Queue Toggle"), "Q", | |
434 N_("Enables/disables the entry in the playlist's queue."), | |
435 G_CALLBACK(action_queue_toggle) }, | |
436 }; | |
437 | |
438 | |
439 static GtkActionEntry action_entries_equalizer[] = { | |
440 | |
441 { "equ preset load menu", NULL, N_("Load") }, | |
442 { "equ preset import menu", NULL, N_("Import") }, | |
443 { "equ preset save menu", NULL, N_("Save") }, | |
444 { "equ preset delete menu", NULL, N_("Delete") }, | |
445 | |
446 { "equ load preset", NULL, N_("Preset"), NULL, | |
447 N_("Load preset"), G_CALLBACK(action_equ_load_preset) }, | |
448 | |
449 { "equ load auto preset", NULL, N_("Auto-load preset"), NULL, | |
450 N_("Load auto-load preset"), G_CALLBACK(action_equ_load_auto_preset) }, | |
451 | |
452 { "equ load default preset", NULL, N_("Default"), NULL, | |
453 N_("Load default preset into equalizer"), G_CALLBACK(action_equ_load_default_preset) }, | |
454 | |
455 { "equ zero preset", NULL, N_("Zero"), NULL, | |
456 N_("Set equalizer preset levels to zero"), G_CALLBACK(action_equ_zero_preset) }, | |
457 | |
458 { "equ load preset file", NULL, N_("From file"), NULL, | |
459 N_("Load preset from file"), G_CALLBACK(action_equ_load_preset_file) }, | |
460 | |
461 { "equ load preset eqf", NULL, N_("From WinAMP EQF file"), NULL, | |
462 N_("Load preset from WinAMP EQF file"), G_CALLBACK(action_equ_load_preset_eqf) }, | |
463 | |
464 { "equ import winamp presets", NULL, N_("WinAMP Presets"), NULL, | |
465 N_("Import WinAMP presets"), G_CALLBACK(action_equ_import_winamp_presets) }, | |
466 | |
467 { "equ save preset", NULL, N_("Preset"), NULL, | |
468 N_("Save preset"), G_CALLBACK(action_equ_save_preset) }, | |
469 | |
470 { "equ save auto preset", NULL, N_("Auto-load preset"), NULL, | |
471 N_("Save auto-load preset"), G_CALLBACK(action_equ_save_auto_preset) }, | |
472 | |
473 { "equ save default preset", NULL, N_("Default"), NULL, | |
474 N_("Save default preset"), G_CALLBACK(action_equ_save_default_preset) }, | |
475 | |
476 { "equ save preset file", NULL, N_("To file"), NULL, | |
477 N_("Save preset to file"), G_CALLBACK(action_equ_save_preset_file) }, | |
478 | |
479 { "equ save preset eqf", NULL, N_("To WinAMP EQF file"), NULL, | |
480 N_("Save preset to WinAMP EQF file"), G_CALLBACK(action_equ_save_preset_eqf) }, | |
481 | |
482 { "equ delete preset", NULL, N_("Preset"), NULL, | |
483 N_("Delete preset"), G_CALLBACK(action_equ_delete_preset) }, | |
484 | |
485 { "equ delete auto preset", NULL, N_("Auto-load preset"), NULL, | |
486 N_("Delete auto-load preset"), G_CALLBACK(action_equ_delete_auto_preset) } | |
487 }; | |
488 | |
489 | |
490 | |
491 /* ***************************** */ | |
492 | |
493 | |
494 static GtkActionGroup * | |
495 ui_manager_new_action_group( const gchar * group_name ) | |
496 { | |
497 GtkActionGroup *group = gtk_action_group_new( group_name ); | |
498 gtk_action_group_set_translation_domain( group , PACKAGE_NAME ); | |
499 return group; | |
500 } | |
501 | |
502 void | |
503 ui_manager_init ( void ) | |
504 { | |
505 /* toggle actions */ | |
506 toggleaction_group_others = ui_manager_new_action_group("toggleaction_others"); | |
507 gtk_action_group_add_toggle_actions( | |
508 toggleaction_group_others , toggleaction_entries_others , | |
509 G_N_ELEMENTS(toggleaction_entries_others) , NULL ); | |
510 | |
511 /* radio actions */ | |
512 radioaction_group_anamode = ui_manager_new_action_group("radioaction_anamode"); | |
513 gtk_action_group_add_radio_actions( | |
514 radioaction_group_anamode , radioaction_entries_anamode , | |
515 G_N_ELEMENTS(radioaction_entries_anamode) , 0 , G_CALLBACK(action_anamode) , NULL ); | |
516 | |
517 radioaction_group_anatype = ui_manager_new_action_group("radioaction_anatype"); | |
518 gtk_action_group_add_radio_actions( | |
519 radioaction_group_anatype , radioaction_entries_anatype , | |
520 G_N_ELEMENTS(radioaction_entries_anatype) , 0 , G_CALLBACK(action_anatype) , NULL ); | |
521 | |
522 radioaction_group_scomode = ui_manager_new_action_group("radioaction_scomode"); | |
523 gtk_action_group_add_radio_actions( | |
524 radioaction_group_scomode , radioaction_entries_scomode , | |
525 G_N_ELEMENTS(radioaction_entries_scomode) , 0 , G_CALLBACK(action_scomode) , NULL ); | |
526 | |
527 radioaction_group_vprmode = ui_manager_new_action_group("radioaction_vprmode"); | |
528 gtk_action_group_add_radio_actions( | |
529 radioaction_group_vprmode , radioaction_entries_vprmode , | |
530 G_N_ELEMENTS(radioaction_entries_vprmode) , 0 , G_CALLBACK(action_vprmode) , NULL ); | |
531 | |
532 radioaction_group_wshmode = ui_manager_new_action_group("radioaction_wshmode"); | |
533 gtk_action_group_add_radio_actions( | |
534 radioaction_group_wshmode , radioaction_entries_wshmode , | |
535 G_N_ELEMENTS(radioaction_entries_wshmode) , 0 , G_CALLBACK(action_wshmode) , NULL ); | |
536 | |
537 radioaction_group_refrate = ui_manager_new_action_group("radioaction_refrate"); | |
538 gtk_action_group_add_radio_actions( | |
539 radioaction_group_refrate , radioaction_entries_refrate , | |
540 G_N_ELEMENTS(radioaction_entries_refrate) , 0 , G_CALLBACK(action_refrate) , NULL ); | |
541 | |
542 radioaction_group_anafoff = ui_manager_new_action_group("radioaction_anafoff"); | |
543 gtk_action_group_add_radio_actions( | |
544 radioaction_group_anafoff , radioaction_entries_anafoff , | |
545 G_N_ELEMENTS(radioaction_entries_anafoff) , 0 , G_CALLBACK(action_anafoff) , NULL ); | |
546 | |
547 radioaction_group_peafoff = ui_manager_new_action_group("radioaction_peafoff"); | |
548 gtk_action_group_add_radio_actions( | |
549 radioaction_group_peafoff , radioaction_entries_peafoff , | |
550 G_N_ELEMENTS(radioaction_entries_peafoff) , 0 , G_CALLBACK(action_peafoff) , NULL ); | |
551 | |
552 radioaction_group_vismode = ui_manager_new_action_group("radioaction_vismode"); | |
553 gtk_action_group_add_radio_actions( | |
554 radioaction_group_vismode , radioaction_entries_vismode , | |
555 G_N_ELEMENTS(radioaction_entries_vismode) , 0 , G_CALLBACK(action_vismode) , NULL ); | |
556 | |
557 radioaction_group_viewtime = ui_manager_new_action_group("radioaction_viewtime"); | |
558 gtk_action_group_add_radio_actions( | |
559 radioaction_group_viewtime , radioaction_entries_viewtime , | |
560 G_N_ELEMENTS(radioaction_entries_viewtime) , 0 , G_CALLBACK(action_viewtime) , NULL ); | |
561 | |
562 /* normal actions */ | |
563 action_group_playback = ui_manager_new_action_group("action_playback"); | |
564 gtk_action_group_add_actions( | |
565 action_group_playback , action_entries_playback , | |
566 G_N_ELEMENTS(action_entries_playback) , NULL ); | |
567 | |
568 action_group_playlist = ui_manager_new_action_group("action_playlist"); | |
569 gtk_action_group_add_actions( | |
570 action_group_playlist , action_entries_playlist , | |
571 G_N_ELEMENTS(action_entries_playlist) , NULL ); | |
572 | |
573 action_group_visualization = ui_manager_new_action_group("action_visualization"); | |
574 gtk_action_group_add_actions( | |
575 action_group_visualization , action_entries_visualization , | |
576 G_N_ELEMENTS(action_entries_visualization) , NULL ); | |
577 | |
578 action_group_view = ui_manager_new_action_group("action_view"); | |
579 gtk_action_group_add_actions( | |
580 action_group_view , action_entries_view , | |
581 G_N_ELEMENTS(action_entries_view) , NULL ); | |
582 | |
583 action_group_others = ui_manager_new_action_group("action_others"); | |
584 gtk_action_group_add_actions( | |
585 action_group_others , action_entries_others , | |
586 G_N_ELEMENTS(action_entries_others) , NULL ); | |
587 | |
588 action_group_playlist_add = ui_manager_new_action_group("action_playlist_add"); | |
589 gtk_action_group_add_actions( | |
590 action_group_playlist_add, action_entries_playlist_add, | |
591 G_N_ELEMENTS(action_entries_playlist_add), NULL ); | |
592 | |
593 action_group_playlist_select = ui_manager_new_action_group("action_playlist_select"); | |
594 gtk_action_group_add_actions( | |
595 action_group_playlist_select, action_entries_playlist_select, | |
596 G_N_ELEMENTS(action_entries_playlist_select), NULL ); | |
597 | |
598 action_group_playlist_delete = ui_manager_new_action_group("action_playlist_delete"); | |
599 gtk_action_group_add_actions( | |
600 action_group_playlist_delete, action_entries_playlist_delete, | |
601 G_N_ELEMENTS(action_entries_playlist_delete), NULL ); | |
602 | |
603 action_group_playlist_sort = ui_manager_new_action_group("action_playlist_sort"); | |
604 gtk_action_group_add_actions( | |
605 action_group_playlist_sort, action_entries_playlist_sort, | |
606 G_N_ELEMENTS(action_entries_playlist_sort), NULL ); | |
607 | |
608 action_group_equalizer = ui_manager_new_action_group("action_equalizer"); | |
609 gtk_action_group_add_actions( | |
610 action_group_equalizer, action_entries_equalizer, | |
611 G_N_ELEMENTS(action_entries_equalizer), NULL); | |
612 | |
613 /* ui */ | |
614 ui_manager = gtk_ui_manager_new(); | |
615 gtk_ui_manager_insert_action_group( ui_manager , toggleaction_group_others , 0 ); | |
616 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_anamode , 0 ); | |
617 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_anatype , 0 ); | |
618 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_scomode , 0 ); | |
619 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_vprmode , 0 ); | |
620 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_wshmode , 0 ); | |
621 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_refrate , 0 ); | |
622 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_anafoff , 0 ); | |
623 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_peafoff , 0 ); | |
624 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_vismode , 0 ); | |
625 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_viewtime , 0 ); | |
626 gtk_ui_manager_insert_action_group( ui_manager , action_group_playback , 0 ); | |
627 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist , 0 ); | |
628 gtk_ui_manager_insert_action_group( ui_manager , action_group_visualization , 0 ); | |
629 gtk_ui_manager_insert_action_group( ui_manager , action_group_view , 0 ); | |
630 gtk_ui_manager_insert_action_group( ui_manager , action_group_others , 0 ); | |
631 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_add , 0 ); | |
632 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_select , 0 ); | |
633 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_delete , 0 ); | |
634 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_sort , 0 ); | |
635 gtk_ui_manager_insert_action_group( ui_manager , action_group_equalizer , 0 ); | |
636 | |
637 return; | |
638 } | |
639 | |
640 | |
641 void | |
642 ui_manager_create_menus ( void ) | |
643 { | |
644 GError *gerr = NULL; | |
645 | |
646 /* attach xml menu definitions */ | |
647 gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/mainwin.ui" , &gerr ); | |
648 | |
649 if ( gerr != NULL ) | |
650 { | |
651 g_critical( "Error creating UI<ui/mainwin.ui>: %s" , gerr->message ); | |
652 g_error_free( gerr ); | |
653 return; | |
654 } | |
655 | |
656 /* create GtkMenu widgets using path from xml definitions */ | |
657 mainwin_songname_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/songname-menu" ); | |
658 mainwin_visualization_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/visualization" ); | |
659 mainwin_playback_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/playback" ); | |
660 mainwin_playlist_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/playlist" ); | |
661 mainwin_view_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/view" ); | |
662 mainwin_general_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu" ); | |
663 | |
664 gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/playlist.ui" , &gerr ); | |
665 | |
666 if ( gerr != NULL ) | |
667 { | |
668 g_critical( "Error creating UI<ui/playlist.ui>: %s" , gerr->message ); | |
669 g_error_free( gerr ); | |
670 return; | |
671 } | |
672 | |
673 playlistwin_popup_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/playlist-rightclick-menu"); | |
674 | |
675 playlistwin_pladd_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/add-menu"); | |
676 playlistwin_pldel_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/del-menu"); | |
677 playlistwin_plsel_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/select-menu"); | |
678 playlistwin_plsort_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/misc-menu"); | |
679 playlistwin_pllist_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/playlist-menu"); | |
680 | |
681 gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/equalizer.ui" , &gerr ); | |
682 | |
683 if ( gerr != NULL ) | |
684 { | |
685 g_critical( "Error creating UI<ui/equalizer.ui>: %s" , gerr->message ); | |
686 g_error_free( gerr ); | |
687 return; | |
688 } | |
689 | |
690 equalizerwin_presets_menu = ui_manager_get_popup_menu(ui_manager, "/equalizer-menus/preset-menu"); | |
691 | |
692 return; | |
693 } | |
694 | |
695 | |
696 GtkAccelGroup * | |
697 ui_manager_get_accel_group ( void ) | |
698 { | |
699 return gtk_ui_manager_get_accel_group( ui_manager ); | |
700 } | |
701 | |
702 | |
703 GtkWidget * | |
704 ui_manager_get_popup_menu ( GtkUIManager * self , const gchar * path ) | |
705 { | |
706 GtkWidget *menu_item = gtk_ui_manager_get_widget( self , path ); | |
707 | |
708 if (GTK_IS_MENU_ITEM(menu_item)) | |
709 return gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu_item)); | |
710 else | |
711 return NULL; | |
712 } | |
713 | |
714 | |
715 static void | |
716 menu_popup_pos_func (GtkMenu * menu , gint * x , gint * y , gboolean * push_in , gint * point ) | |
717 { | |
718 GtkRequisition requisition; | |
719 gint screen_width; | |
720 gint screen_height; | |
721 | |
722 gtk_widget_size_request(GTK_WIDGET(menu), &requisition); | |
723 | |
724 screen_width = gdk_screen_width(); | |
725 screen_height = gdk_screen_height(); | |
726 | |
727 *x = CLAMP(point[0] - 2, 0, MAX(0, screen_width - requisition.width)); | |
728 *y = CLAMP(point[1] - 2, 0, MAX(0, screen_height - requisition.height)); | |
729 | |
730 *push_in = FALSE; | |
731 } | |
732 | |
733 | |
734 void | |
735 ui_manager_popup_menu_show ( GtkMenu * menu , gint x , gint y , guint button , guint time ) | |
736 { | |
737 gint pos[2]; | |
738 pos[0] = x; | |
739 pos[1] = y; | |
740 | |
741 gtk_menu_popup( menu , NULL , NULL , | |
742 (GtkMenuPositionFunc) menu_popup_pos_func , pos , button , time ); | |
743 } |