1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2010 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains the studio list handling code
9 **************************************************************************
11 * LADI Session Handler is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * LADI Session Handler is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
23 * or write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include "gtk_builder.h"
29 #include "../proxies/control_proxy.h"
32 static ladish_dynmenu_handle g_load_studio_list
;
33 static ladish_dynmenu_handle g_delete_studio_list
;
35 struct ladish_studio_list_closure
42 ladish_dynmenu_item_activate_callback item_activate_callback
,
43 void (* data_free
)());
47 #define closure_ptr ((struct ladish_studio_list_closure * )context)
53 const char * studio_name
)
55 closure_ptr
->callback(closure_ptr
->context
, studio_name
, NULL
, NULL
, NULL
);
68 ladish_dynmenu_item_activate_callback item_activate_callback
,
69 void (* data_free
)()),
72 struct ladish_studio_list_closure closure
;
74 closure
.callback
= callback
;
75 closure
.context
= context
;
77 return control_proxy_get_studio_list(add_item
, &closure
);
80 static void on_load_studio_wrapper(const char * name
, void * data
)
86 static void on_delete_studio_wrapper(const char * name
, void * data
)
89 on_delete_studio(name
);
92 bool create_studio_lists(void)
94 if (!ladish_dynmenu_create(
95 "menu_item_load_studio",
99 on_load_studio_wrapper
,
100 &g_load_studio_list
))
105 if (!ladish_dynmenu_create(
106 "menu_item_delete_studio",
107 "delete_studio_menu",
110 on_delete_studio_wrapper
,
111 &g_delete_studio_list
))
113 ladish_dynmenu_destroy(g_load_studio_list
);
120 void destroy_studio_lists(void)
122 ladish_dynmenu_destroy(g_delete_studio_list
);
123 ladish_dynmenu_destroy(g_load_studio_list
);