a880add55117afe9fcfe9a766a54d5d971e3bea9
[devious] / devious.h
1 /*
2  * Devious: UPNP Control Point for Maemo 5
3  *
4  * Copyright (C) 2009 Kyle Cronan
5  *
6  * Author: Kyle Cronan <kyle@pbx.org>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation; version 3 of the License, or (at your option)
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
16  * Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this library; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24 #ifndef INCLUDED_DEVIOUS_H
25 #define INCLUDED_DEVIOUS_H 1
26
27 #define APPLICATION_NAME "Devious"
28 #define PLAY_WINDOW_TITLE "Now playing"
29 #define CHOOSE_TARGET "Choose target"
30 #define ROW_HEIGHT 75
31 #define ICON_WIDTH 90
32 #define ICON_XALIGN 0.6
33 #define MEDIA_RENDERER "urn:schemas-upnp-org:device:MediaRenderer:*"
34 #define MEDIA_SERVER "urn:schemas-upnp-org:device:MediaServer:*"
35 #define CONTENT_DIR "urn:schemas-upnp-org:service:ContentDirectory"
36 #define CONNECTION_MANAGER "urn:schemas-upnp-org:service:ConnectionManager"
37 #define AV_TRANSPORT "urn:schemas-upnp-org:service:AVTransport"
38 #define MAX_BROWSE 64
39
40 struct proxy {
41     GtkTreeRowReference *row;
42     GUPnPDeviceProxy *proxy;
43     char *name;
44     struct proxy_set *set;
45     char **protocols;
46     GtkTreeRowReference *current_selection;
47 };
48
49 struct proxy_set {
50     GHashTable *renderers;
51     GHashTable *servers;
52     GtkListStore *renderer_list;
53     GtkListStore *server_list;
54     GdkPixbuf *icon;
55     HildonPickerButton *renderer_picker;
56     GUPnPDIDLLiteParser *didl_parser;
57 };
58
59 struct browse_data {
60     GUPnPServiceProxy *content_dir;
61     gchar *id;
62     guint32 starting_index;
63     GtkListStore *list;
64     GUPnPDIDLLiteParser *didl_parser;
65 };
66
67 enum {
68     COL_ICON = 0,
69     COL_LABEL,
70     COL_ID,
71     COL_CONTENT,
72     COL_CONTAINER,
73     NUM_COLS
74 };
75
76
77 void browse(GUPnPServiceProxy *content_dir, const char *container_id,
78             guint32 starting_index, guint32 requested_count,
79             GtkListStore *list, GUPnPDIDLLiteParser *didl_parser);
80
81 void set_panarea_padding(GtkWidget *child, gpointer data);
82
83 GtkWidget *new_selector(GtkListStore *list);
84
85 void content_select(HildonTouchSelector *selector, gint column, gpointer data);
86
87 GtkWidget *content_window(struct proxy *server, char *title,
88                           GtkListStore **list);
89
90 void server_select(HildonTouchSelector *selector, gint column, gpointer data);
91
92 GtkWidget *main_window(HildonProgram *program, struct proxy_set *proxy_set);
93
94 void add_renderer(GUPnPDeviceProxy *proxy, struct proxy_set *proxy_set);
95
96 void add_server(GUPnPDeviceProxy *proxy, struct proxy_set *proxy_set);
97
98 void remove_server(GUPnPDeviceProxy *proxy, struct proxy_set *proxy_set);
99
100 void device_proxy_available(GUPnPControlPoint *cp,
101                             GUPnPDeviceProxy *proxy, gpointer user_data);
102
103 void init_upnp(struct proxy_set *proxy_set);
104
105 #endif /* INCLUDED_DEVIOUS_H */