Guitarix
nsm.h
Go to the documentation of this file.
1
2/*************************************************************************/
3/* Copyright (C) 2012 Jonathan Moore Liles */
4/* */
5/* Permission to use, copy, modify, and/or distribute this software for */
6/* any purpose with or without fee is hereby granted, provided that the */
7/* above copyright notice and this permission notice appear in all */
8/* copies. */
9/* */
10/* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL */
11/* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED */
12/* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE */
13/* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL */
14/* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR */
15/* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER */
16/* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR */
17/* PERFORMANCE OF THIS SOFTWARE. */
18/*************************************************************************/
19
20
21/*************************************************************/
22/* A simple, callback based C API for NSM clients. */
23/* */
24/* Simplified Example: */
25/* */
26/* #include "nsm.h" */
27/* */
28/* int */
29/* cb_nsm_open ( const char *name, */
30/* const char *display_name, */
31/* const char *client_id, */
32/* char **out_msg, */
33/* void *userdata ) */
34/* { */
35/* do_open_stuff(); */
36/* return ERR_OK; */
37/* } */
38/* */
39/* int */
40/* cb_nsm_save ( char **out_msg, */
41/* void *userdata ) */
42/* { */
43/* do_save_stuff(); */
44/* return ERR_OK; */
45/* } */
46/* */
47/* static nsm_client_t *nsm = 0 */
48/* */
49/* int main( int argc, char **argv ) */
50/* { */
51/* const char *nsm_url = getenv( "NSM_URL" ); */
52/* */
53/* if ( nsm_url ) */
54/* { */
55/* nsm = nsm_new(); */
56/* */
57/* nsm_set_open_callback( nsm, cb_nsm_open, 0 ); */
58/* nsm_set_save_callback( nsm, cb_nsm_save, 0 ); */
59/* */
60/* if ( 0 == nsm_init( nsm, nsm_url ) ) */
61/* { */
62/* nsm_send_announce( nsm, "FOO", "", argv[0] ); */
63/* } */
64/* else */
65/* { */
66/* nsm_free( nsm ); */
67/* nsm = 0; */
68/* } */
69/* } */
70/* } */
71/*************************************************************/
72
73#ifndef _NSM_H
74#define _NSM_H
75
76#define NSM_API_VERSION_MAJOR 1
77#define NSM_API_VERSION_MINOR 0
78
79#include <lo/lo.h>
80#include <string.h>
81#include <sys/types.h>
82#include <unistd.h>
83#include <stdlib.h>
84#include <stdio.h>
85
86typedef void * nsm_client_t;
87typedef int (nsm_open_callback)( const char *name, const char *display_name, const char *client_id, char **out_msg, void *userdata );
88typedef int (nsm_save_callback)( char **out_msg, void *userdata );
89typedef void (nsm_show_gui_callback)( void *userdata );
90typedef void (nsm_hide_gui_callback)( void *userdata );
91typedef void (nsm_active_callback)( int b, void *userdata );
92typedef void (nsm_session_is_loaded_callback)( void *userdata );
93typedef int (nsm_broadcast_callback)( const char *, lo_message m, void *userdata );
94
95#define _NSM() ((struct _nsm_client_t*)nsm)
96
97#define NSM_EXPORT __attribute__((unused)) static
98
99/* private parts */
101{
102 const char *nsm_url;
103
104 lo_server _server;
105 lo_server_thread _st;
106 lo_address nsm_addr;
107
112
115
118
121
124
127
130
133};
134
135enum
136{
145 ERR_NOT_NOW = -8
147
149int
151{
152 return _NSM()->nsm_is_active;
153}
154
156const char *
158{
159 return _NSM()->_session_manager_name;
160}
161
163const char *
165{
166 return _NSM()->_session_manager_features;
167}
168
171nsm_new ( void )
172{
173 struct _nsm_client_t *nsm = (struct _nsm_client_t*)malloc( sizeof( struct _nsm_client_t ) );
174
175 nsm->nsm_url = 0;
176
177 nsm->nsm_is_active = 0;
178 nsm->nsm_client_id = 0;
179
180 nsm->_server = 0;
181 nsm->_st = 0;
182 nsm->nsm_addr = 0;
183 nsm->_session_manager_name = 0;
185
186 nsm->open = 0;
187 nsm->save = 0;
188 nsm->show = 0;
189 nsm->hide = 0;
190 nsm->active = 0;
191 nsm->session_is_loaded = 0;
192 nsm->broadcast = 0;
193
194 return (nsm_client_t *)nsm;
195}
196
197/*******************************************/
198/* CLIENT TO SERVER INFORMATIONAL MESSAGES */
199/*******************************************/
200
202void
204{
205 if ( _NSM()->nsm_is_active )
206 lo_send_from( _NSM()->nsm_addr, _NSM()->_server, LO_TT_IMMEDIATE, "/nsm/client/is_dirty", "" );
207}
208
210void
212{
213 if ( _NSM()->nsm_is_active )
214 lo_send_from( _NSM()->nsm_addr, _NSM()->_server, LO_TT_IMMEDIATE, "/nsm/client/is_clean", "" );
215}
216
218void
220{
221 if ( _NSM()->nsm_is_active )
222 lo_send_from( _NSM()->nsm_addr, _NSM()->_server, LO_TT_IMMEDIATE, "/nsm/client/gui_is_shown", "" );
223}
224
226void
228{
229 if ( _NSM()->nsm_is_active )
230 lo_send_from( _NSM()->nsm_addr, _NSM()->_server, LO_TT_IMMEDIATE, "/nsm/client/gui_is_hidden", "" );
231}
232
234void
236{
237 if ( _NSM()->nsm_is_active )
238 lo_send_from( _NSM()->nsm_addr, _NSM()->_server, LO_TT_IMMEDIATE, "/nsm/client/progress", "f", p );
239}
240
242void
243nsm_send_message ( nsm_client_t *nsm, int priority, const char *msg )
244{
245 if ( _NSM()->nsm_is_active )
246 lo_send_from( _NSM()->nsm_addr, _NSM()->_server, LO_TT_IMMEDIATE, "/nsm/client/message", "is", priority, msg );
247}
248
249NSM_EXPORT void
250nsm_send_announce ( nsm_client_t *nsm, const char *app_name, const char *capabilities, const char *process_name )
251{
252 lo_address to = lo_address_new_from_url( _NSM()->nsm_url );
253
254 if ( ! to )
255 {
256 fprintf( stderr, "NSM: Bad address!" );
257 return;
258 }
259
260 int pid = (int)getpid();
261
262 lo_send_from( to, _NSM()->_server, LO_TT_IMMEDIATE, "/nsm/server/announce", "sssiii",
263 app_name,
264 capabilities,
265 process_name,
268 pid );
269
270 lo_address_free( to );
271}
272
273NSM_EXPORT void
274nsm_send_broadcast ( nsm_client_t *nsm, lo_message msg )
275{
276 if ( _NSM()->nsm_is_active )
277 lo_send_message_from( _NSM()->nsm_addr, _NSM()->_server, "/nsm/server/broadcast", msg );
278}
279
280
281
283void
284nsm_check_wait ( nsm_client_t *nsm, int timeout )
285{
286 if ( lo_server_wait( _NSM()->_server, timeout ) )
287 while ( lo_server_recv_noblock( _NSM()->_server, 0 ) ) {}
288}
289
291void
293{
294 nsm_check_wait( nsm, 0 );
295}
296
297
299void
301{
302 lo_server_thread_start( _NSM()->_st );
303}
304
305
307void
309{
310 lo_server_thread_stop( _NSM()->_st );
311}
312
313
314
315NSM_EXPORT void
317{
318 if ( _NSM()->_st )
319 nsm_thread_stop( nsm );
320
321 if ( _NSM()->_st )
322 lo_server_thread_free( _NSM()->_st );
323 else
324 lo_server_free( _NSM()->_server );
325
326 lo_address_free(_NSM()->nsm_addr);
327 free(_NSM()->nsm_client_id);
330
331 free( _NSM() );
332}
333
334/*****************/
335/* SET CALLBACKS */
336/*****************/
337
339void
340nsm_set_open_callback( nsm_client_t *nsm, nsm_open_callback *open_callback, void *userdata )
341{
342 _NSM()->open = open_callback;
343 _NSM()->open_userdata = userdata;
344}
345
347void
348nsm_set_save_callback( nsm_client_t *nsm, nsm_save_callback *save_callback, void *userdata )
349{
350 _NSM()->save = save_callback;
351 _NSM()->save_userdata = userdata;
352
353}
354
356void
357nsm_set_show_callback( nsm_client_t *nsm, nsm_show_gui_callback *show_callback, void *userdata )
358{
359 _NSM()->show = show_callback;
360 _NSM()->show_userdata = userdata;
361}
362
364void
365nsm_set_hide_callback( nsm_client_t *nsm, nsm_hide_gui_callback *hide_callback, void *userdata )
366{
367 _NSM()->hide = hide_callback;
368 _NSM()->hide_userdata = userdata;
369}
370
372void
373nsm_set_active_callback( nsm_client_t *nsm, nsm_active_callback *active_callback, void *userdata )
374{
375 _NSM()->active = active_callback;
376 _NSM()->active_userdata = userdata;
377}
378
380void
381nsm_set_session_is_loaded_callback( nsm_client_t *nsm, nsm_session_is_loaded_callback *session_is_loaded_callback, void *userdata )
382{
383 _NSM()->session_is_loaded = session_is_loaded_callback;
384 _NSM()->session_is_loaded_userdata = userdata;
385}
386
387
389void
390nsm_set_broadcast_callback( nsm_client_t *nsm, nsm_broadcast_callback *broadcast_callback, void *userdata )
391{
392 _NSM()->broadcast = broadcast_callback;
393 _NSM()->broadcast_userdata = userdata;
394}
395
396
397
398/****************/
399/* OSC HANDLERS */
400/****************/
401
402#undef OSC_REPLY
403#undef OSC_REPLY_ERR
404
405#define OSC_REPLY( value ) lo_send_from( ((struct _nsm_client_t*)user_data)->nsm_addr, ((struct _nsm_client_t*)user_data)->_server, LO_TT_IMMEDIATE, "/reply", "ss", path, value )
406
407#define OSC_REPLY_ERR( errcode, value ) lo_send_from( ((struct _nsm_client_t*)user_data)->nsm_addr, ((struct _nsm_client_t*)user_data)->_server, LO_TT_IMMEDIATE, "/error", "sis", path, errcode, value )
408
409
410NSM_EXPORT int _nsm_osc_open ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
411{
412 (void) types;
413 (void) argc;
414 (void) msg;
415
416 char *out_msg = NULL;
417
418 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
419
420 nsm->nsm_client_id = strdup( &argv[2]->s );
421
422 if ( ! nsm->open )
423 return 0;
424
425 int r = nsm->open( &argv[0]->s, &argv[1]->s, &argv[2]->s, &out_msg, nsm->open_userdata );
426
427 if ( r )
428 OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") );
429 else
430 OSC_REPLY( "OK" );
431
432 if ( out_msg )
433 free( out_msg );
434
435 return 0;
436}
437
438NSM_EXPORT int _nsm_osc_save ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
439{
440 (void) types;
441 (void) argv;
442 (void) argc;
443 (void) msg;
444
445 char *out_msg = NULL;
446
447 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
448
449 if ( ! nsm->save )
450 return 0;
451
452 int r = nsm->save(&out_msg, nsm->save_userdata );
453
454 if ( r )
455 OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") );
456 else
457 OSC_REPLY( "OK" );
458
459 if ( out_msg )
460 free( out_msg );
461
462 return 0;
463}
464
465NSM_EXPORT int _nsm_osc_announce_reply ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
466{
467 (void) path;
468 (void) types;
469 (void) argc;
470
471 if ( strcmp( &argv[0]->s, "/nsm/server/announce" ) )
472 return -1;
473
474 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
475
476 fprintf( stderr, "NSM: Successfully registered. NSM says: %s\n", &argv[1]->s );
477
478
479 nsm->nsm_is_active = 1;
480 nsm->_session_manager_name = strdup( &argv[2]->s );
481 nsm->_session_manager_features = strdup( &argv[3]->s );
482 nsm->nsm_addr = lo_address_new_from_url( lo_address_get_url( lo_message_get_source( msg ) ));
483
484 if ( nsm->active )
485 nsm->active( nsm->nsm_is_active, nsm->active_userdata );
486
487 return 0;
488}
489
490NSM_EXPORT int _nsm_osc_error ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
491{
492 (void) path;
493 (void) types;
494 (void) argc;
495 (void) msg;
496
497 if ( strcmp( &argv[0]->s, "/nsm/server/announce" ) )
498 return -1;
499
500 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
501
502 fprintf( stderr, "NSM: Failed to register with NSM server: %s", &argv[2]->s );
503
504 nsm->nsm_is_active = 0;
505
506 if ( nsm->active )
507 nsm->active( nsm->nsm_is_active, nsm->active_userdata );
508
509 return 0;
510}
511
512NSM_EXPORT int _nsm_osc_session_is_loaded ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
513{
514 (void) path;
515 (void) types;
516 (void) argv;
517 (void) argc;
518 (void) msg;
519
520 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
521
522 if ( ! nsm->session_is_loaded )
523 return 0;
524
526
527 return 0;
528}
529
530NSM_EXPORT int _nsm_osc_show ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
531{
532
533 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
534
535 if ( ! nsm->show )
536 return 0;
537
538 nsm->show( nsm->show_userdata );
539
540 return 0;
541}
542
543NSM_EXPORT int _nsm_osc_hide ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
544{
545
546 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
547
548 if ( ! nsm->hide )
549 return 0;
550
551 nsm->hide( nsm->hide_userdata );
552
553 return 0;
554}
555
556NSM_EXPORT int _nsm_osc_broadcast ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
557{
558 (void) types;
559 (void) argv;
560 (void) argc;
561
562 struct _nsm_client_t *nsm = (struct _nsm_client_t*)user_data;
563
564 if ( ! nsm->broadcast )
565 return 0;
566
567 return nsm->broadcast( path, msg, nsm->broadcast_userdata );
568}
569
570
571
573int
574nsm_init ( nsm_client_t *nsm, const char *nsm_url )
575{
576 _NSM()->nsm_url = nsm_url;
577
578 lo_address addr = lo_address_new_from_url( nsm_url );
579 int proto = lo_address_get_protocol( addr );
580 lo_address_free( addr );
581
582 _NSM()->_server = lo_server_new_with_proto( NULL, proto, NULL );
583
584 if ( ! _NSM()->_server )
585 return -1;
586
587 lo_server_add_method( _NSM()->_server, "/error", "sis", _nsm_osc_error, _NSM() );
588 lo_server_add_method( _NSM()->_server, "/reply", "ssss", _nsm_osc_announce_reply, _NSM() );
589 lo_server_add_method( _NSM()->_server, "/nsm/client/open", "sss", _nsm_osc_open, _NSM() );
590 lo_server_add_method( _NSM()->_server, "/nsm/client/save", "", _nsm_osc_save, _NSM() );
591 lo_server_add_method( _NSM()->_server, "/nsm/client/session_is_loaded", "", _nsm_osc_session_is_loaded, _NSM() );
592 lo_server_add_method( _NSM()->_server, "/nsm/client/show_optional_gui", "", _nsm_osc_show, _NSM() );
593 lo_server_add_method( _NSM()->_server, "/nsm/client/hide_optional_gui", "", _nsm_osc_hide, _NSM() );
594 lo_server_add_method( _NSM()->_server, NULL, NULL, _nsm_osc_broadcast, _NSM() );
595
596 return 0;
597}
598
599
601int
603{
604 _NSM()->nsm_url = nsm_url;
605
606 lo_address addr = lo_address_new_from_url( nsm_url );
607 int proto = lo_address_get_protocol( addr );
608 lo_address_free( addr );
609
610 _NSM()->_st = lo_server_thread_new_with_proto( NULL, proto, NULL );
611 _NSM()->_server = lo_server_thread_get_server( _NSM()->_st );
612
613 if ( ! _NSM()->_server )
614 return -1;
615
616 lo_server_thread_add_method( _NSM()->_st, "/error", "sis", _nsm_osc_error, _NSM() );
617 lo_server_thread_add_method( _NSM()->_st, "/reply", "ssss", _nsm_osc_announce_reply, _NSM() );
618 lo_server_thread_add_method( _NSM()->_st, "/nsm/client/open", "sss", _nsm_osc_open, _NSM() );
619 lo_server_thread_add_method( _NSM()->_st, "/nsm/client/save", "", _nsm_osc_save, _NSM() );
620 lo_server_thread_add_method( _NSM()->_st, "/nsm/client/session_is_loaded", "", _nsm_osc_session_is_loaded, _NSM() );
621 lo_server_thread_add_method( _NSM()->_st, "/nsm/client/show_optional_gui", "", _nsm_osc_show, _NSM() );
622 lo_server_thread_add_method( _NSM()->_st, "/nsm/client/hide_optional_gui", "", _nsm_osc_hide, _NSM() );
623 lo_server_thread_add_method( _NSM()->_st, NULL, NULL, _nsm_osc_broadcast, _NSM() );
624
625 return 0;
626}
627
628#endif /* NSM_H */
NSM_EXPORT int _nsm_osc_announce_reply(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:465
NSM_EXPORT const char * nsm_get_session_manager_name(nsm_client_t *nsm)
Definition: nsm.h:157
NSM_EXPORT nsm_client_t * nsm_new(void)
Definition: nsm.h:171
void() nsm_active_callback(int b, void *userdata)
Definition: nsm.h:91
void() nsm_session_is_loaded_callback(void *userdata)
Definition: nsm.h:92
NSM_EXPORT void nsm_send_message(nsm_client_t *nsm, int priority, const char *msg)
Definition: nsm.h:243
#define NSM_API_VERSION_MINOR
Definition: nsm.h:77
#define OSC_REPLY_ERR(errcode, value)
Definition: nsm.h:407
NSM_EXPORT void nsm_thread_stop(nsm_client_t *nsm)
Definition: nsm.h:308
int() nsm_open_callback(const char *name, const char *display_name, const char *client_id, char **out_msg, void *userdata)
Definition: nsm.h:87
NSM_EXPORT int _nsm_osc_broadcast(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:556
NSM_EXPORT void nsm_thread_start(nsm_client_t *nsm)
Definition: nsm.h:300
NSM_EXPORT void nsm_check_wait(nsm_client_t *nsm, int timeout)
Definition: nsm.h:284
void() nsm_show_gui_callback(void *userdata)
Definition: nsm.h:89
NSM_EXPORT void nsm_set_broadcast_callback(nsm_client_t *nsm, nsm_broadcast_callback *broadcast_callback, void *userdata)
Definition: nsm.h:390
NSM_EXPORT int _nsm_osc_session_is_loaded(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:512
#define OSC_REPLY(value)
Definition: nsm.h:405
void() nsm_hide_gui_callback(void *userdata)
Definition: nsm.h:90
NSM_EXPORT int _nsm_osc_hide(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:543
NSM_EXPORT void nsm_set_save_callback(nsm_client_t *nsm, nsm_save_callback *save_callback, void *userdata)
Definition: nsm.h:348
NSM_EXPORT const char * nsm_get_session_manager_features(nsm_client_t *nsm)
Definition: nsm.h:164
NSM_EXPORT int nsm_init(nsm_client_t *nsm, const char *nsm_url)
Definition: nsm.h:574
NSM_EXPORT void nsm_send_broadcast(nsm_client_t *nsm, lo_message msg)
Definition: nsm.h:274
NSM_EXPORT int _nsm_osc_open(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:410
NSM_EXPORT void nsm_set_session_is_loaded_callback(nsm_client_t *nsm, nsm_session_is_loaded_callback *session_is_loaded_callback, void *userdata)
Definition: nsm.h:381
NSM_EXPORT void nsm_set_active_callback(nsm_client_t *nsm, nsm_active_callback *active_callback, void *userdata)
Definition: nsm.h:373
NSM_EXPORT void nsm_send_progress(nsm_client_t *nsm, float p)
Definition: nsm.h:235
@ ERR_UNSAVED_CHANGES
Definition: nsm.h:144
@ ERR_NO_SESSION_OPEN
Definition: nsm.h:143
@ ERR_BLACKLISTED
Definition: nsm.h:140
@ ERR_OK
Definition: nsm.h:137
@ ERR_NO_SUCH_FILE
Definition: nsm.h:142
@ ERR_NOT_NOW
Definition: nsm.h:145
@ ERR_LAUNCH_FAILED
Definition: nsm.h:141
@ ERR_INCOMPATIBLE_API
Definition: nsm.h:139
@ ERR_GENERAL
Definition: nsm.h:138
#define NSM_EXPORT
Definition: nsm.h:97
int() nsm_save_callback(char **out_msg, void *userdata)
Definition: nsm.h:88
#define _NSM()
Definition: nsm.h:95
void * nsm_client_t
Definition: nsm.h:86
NSM_EXPORT int nsm_init_thread(nsm_client_t *nsm, const char *nsm_url)
Definition: nsm.h:602
NSM_EXPORT int _nsm_osc_show(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:530
int() nsm_broadcast_callback(const char *, lo_message m, void *userdata)
Definition: nsm.h:93
NSM_EXPORT void nsm_send_is_clean(nsm_client_t *nsm)
Definition: nsm.h:211
NSM_EXPORT void nsm_check_nowait(nsm_client_t *nsm)
Definition: nsm.h:292
NSM_EXPORT int _nsm_osc_save(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:438
NSM_EXPORT void nsm_send_announce(nsm_client_t *nsm, const char *app_name, const char *capabilities, const char *process_name)
Definition: nsm.h:250
NSM_EXPORT void nsm_set_open_callback(nsm_client_t *nsm, nsm_open_callback *open_callback, void *userdata)
Definition: nsm.h:340
NSM_EXPORT int nsm_is_active(nsm_client_t *nsm)
Definition: nsm.h:150
NSM_EXPORT int _nsm_osc_error(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
Definition: nsm.h:490
#define NSM_API_VERSION_MAJOR
Definition: nsm.h:76
NSM_EXPORT void nsm_send_is_dirty(nsm_client_t *nsm)
Definition: nsm.h:203
NSM_EXPORT void nsm_free(nsm_client_t *nsm)
Definition: nsm.h:316
NSM_EXPORT void nsm_send_is_shown(nsm_client_t *nsm)
Definition: nsm.h:219
NSM_EXPORT void nsm_set_hide_callback(nsm_client_t *nsm, nsm_hide_gui_callback *hide_callback, void *userdata)
Definition: nsm.h:365
NSM_EXPORT void nsm_send_is_hidden(nsm_client_t *nsm)
Definition: nsm.h:227
NSM_EXPORT void nsm_set_show_callback(nsm_client_t *nsm, nsm_show_gui_callback *show_callback, void *userdata)
Definition: nsm.h:357
int nsm_is_active
Definition: nsm.h:108
nsm_active_callback * active
Definition: nsm.h:125
lo_address nsm_addr
Definition: nsm.h:106
char * _session_manager_features
Definition: nsm.h:111
void * save_userdata
Definition: nsm.h:117
nsm_hide_gui_callback * hide
Definition: nsm.h:122
char * _session_manager_name
Definition: nsm.h:110
nsm_show_gui_callback * show
Definition: nsm.h:119
void * broadcast_userdata
Definition: nsm.h:132
void * hide_userdata
Definition: nsm.h:123
nsm_save_callback * save
Definition: nsm.h:116
nsm_session_is_loaded_callback * session_is_loaded
Definition: nsm.h:128
char * nsm_client_id
Definition: nsm.h:109
void * open_userdata
Definition: nsm.h:114
lo_server_thread _st
Definition: nsm.h:105
nsm_broadcast_callback * broadcast
Definition: nsm.h:131
void * session_is_loaded_userdata
Definition: nsm.h:129
nsm_open_callback * open
Definition: nsm.h:113
void * active_userdata
Definition: nsm.h:126
lo_server _server
Definition: nsm.h:104
const char * nsm_url
Definition: nsm.h:102
void * show_userdata
Definition: nsm.h:120