Mercurial > pidgin
annotate plugins/musicmessaging/musicmessaging.c @ 11355:6903f2f6d61f
[gaim-migrate @ 13574]
Updated to continue work.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Muise <christian.muise@gmail.com> |
---|---|
date | Sat, 27 Aug 2005 16:35:58 +0000 |
parents | ce3b9969b399 |
children | 6ef19bbfb7cb |
rev | line source |
---|---|
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
1 /* |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
2 * Music messaging plugin for Gaim |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
3 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
4 * Copyright (C) 2005 Christian Muise. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
5 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
6 * This program is free software; you can redistribute it and/or |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
7 * modify it under the terms of the GNU General Public License as |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
8 * published by the Free Software Foundation; either version 2 of the |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
9 * License, or (at your option) any later version. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
10 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, but |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
12 * WITHOUT ANY WARRANTY; without even the implied warranty of |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
14 * General Public License for more details. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
15 * |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
19 * 02111-1307, USA. |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
20 */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
21 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
22 #include "internal.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
23 #include "gtkgaim.h" |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
24 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
25 #include "conversation.h" |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
26 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
27 #include "gtkconv.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
28 #include "gtkplugin.h" |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
29 #include "gtkutils.h" |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
30 |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
31 #include "notify.h" |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
32 #include "version.h" |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
33 #include "debug.h" |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
34 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
35 #define DBUS_API_SUBJECT_TO_CHANGE |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
36 #include <dbus/dbus.h> |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
37 #include "dbus-maybe.h" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
38 #include "dbus-bindings.h" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
39 #include "dbus-server.h" |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
40 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
41 #define MUSICMESSAGING_PLUGIN_ID "gtk-hazure-musicmessaging" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
42 #define MUSICMESSAGING_PREFIX "##MM##" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
43 #define MUSICMESSAGING_START_TAG "<a href=mm-plugin>" |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
44 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
45 /* Globals */ |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
46 /* List of sessions */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
47 GList *conversations; |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
48 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
49 /* Pointer to this plugin */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
50 GaimPlugin *plugin_pointer; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
51 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
52 /* Define types needed for DBus */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
53 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
54 /* Define the functions to export for use with DBus */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
55 DBUS_EXPORT void music_messaging_change_request (const char *command, const char *parameters); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
56 DBUS_EXPORT void music_messaging_change_confirmed (const char *command, const char *parameters); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
57 DBUS_EXPORT void music_messaging_change_failed (const char *id, const char *command, const char *parameters); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
58 DBUS_EXPORT void music_messaging_done_session (void); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
59 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
60 /* This file has been generated by the #dbus-analize-functions.py |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
61 script. It contains dbus wrappers for the four functions declared |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
62 above. */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
63 #include "music-messaging-bindings.c" |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
64 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
65 /* Exported functions */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
66 void music_messaging_change_request(const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
67 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
68 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
69 parameters, NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
70 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
71 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
72 void music_messaging_change_confirmed(const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
73 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
74 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
75 parameters, NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
76 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
77 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
78 void music_messaging_change_failed(const char *id, const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
79 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
80 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
81 parameters, NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
82 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
83 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
84 void music_messaging_done_session(void) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
85 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
86 gaim_notify_message(plugin_pointer, GAIM_NOTIFY_MSG_INFO, "Session", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
87 "Session Complete", NULL, NULL, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
88 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
89 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
90 typedef struct { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
91 GaimConversation *conv; /* pointer to the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
92 GtkWidget *seperator; /* seperator in the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
93 GtkWidget *button; /* button in the conversation */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
94 GPid pid; /* the pid of the score editor */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
95 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
96 gboolean started; /* session has started and editor run */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
97 gboolean originator; /* started the mm session */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
98 gboolean requested; /* received a request to start a session */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
99 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
100 } MMConversation; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
101 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
102 static gboolean start_session(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
103 static void run_editor(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
104 static void kill_editor(MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
105 static void add_button (MMConversation *mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
106 static void remove_widget (GtkWidget *button); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
107 static void init_conversation (GaimConversation *conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
108 static void conv_destroyed(GaimConversation *conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
109 static void intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
110 static void intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
111 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
112 |
11355
6903f2f6d61f
[gaim-migrate @ 13574]
Christian Muise <christian.muise@gmail.com>
parents:
11254
diff
changeset
|
113 /* DBus commands that can be sent to the editor */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
114 G_BEGIN_DECLS |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
115 DBusConnection *gaim_dbus_get_connection(void); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
116 G_END_DECLS |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
117 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
118 void send_change_request (const char *id, const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
119 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
120 DBusMessage *signal; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
121 signal = dbus_message_new_signal("/org/gscore/GScoreObject", "org.gscore.GScoreInterface", "gscore_change_request"); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
122 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
123 dbus_message_append_args(signal, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
124 DBUS_TYPE_STRING, &id, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
125 DBUS_TYPE_STRING, &command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
126 DBUS_TYPE_STRING, ¶meters, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
127 DBUS_TYPE_INVALID); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
128 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
129 dbus_connection_send(gaim_dbus_get_connection(), signal, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
130 dbus_message_unref(signal); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
131 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
132 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
133 void send_change_confirmed (const char *command, const char *parameters) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
134 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
135 DBusMessage *signal; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
136 signal = dbus_message_new_signal("/org/gscore/GScoreObject", "org.gscore.GScoreInterface", "gscore_change_confirmed"); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
137 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
138 dbus_message_append_args(signal, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
139 DBUS_TYPE_STRING, &command, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
140 DBUS_TYPE_STRING, ¶meters, |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
141 DBUS_TYPE_INVALID); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
142 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
143 dbus_connection_send(gaim_dbus_get_connection(), signal, NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
144 dbus_message_unref(signal); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
145 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
146 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
147 |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
148 static gboolean |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
149 plugin_load(GaimPlugin *plugin) { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
150 /* First, we have to register our four exported functions with the |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
151 main gaim dbus loop. Without this statement, the gaim dbus |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
152 code wouldn't know about our functions. */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
153 GAIM_DBUS_REGISTER_BINDINGS(plugin); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
154 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
155 gaim_notify_message(plugin, GAIM_NOTIFY_MSG_INFO, "Welcome", |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
156 "Welcome to music messaging.", NULL, NULL, NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
157 /* Keep the plugin for reference (needed for notify's) */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
158 plugin_pointer = plugin; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
159 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
160 /* Add the button to all the current conversations */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
161 gaim_conversation_foreach (init_conversation); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
162 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
163 /* Listen for any new conversations */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
164 void *conv_list_handle = gaim_conversations_get_handle(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
165 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
166 gaim_signal_connect(conv_list_handle, "conversation-created", |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
167 plugin, GAIM_CALLBACK(init_conversation), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
168 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
169 /* Listen for conversations that are ending */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
170 gaim_signal_connect(conv_list_handle, "deleting-conversation", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
171 plugin, GAIM_CALLBACK(conv_destroyed), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
172 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
173 /* Listen for sending/receiving messages to replace tags */ |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
174 gaim_signal_connect(conv_list_handle, "writing-im-msg", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
175 plugin, GAIM_CALLBACK(intercept_sent), NULL); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
176 gaim_signal_connect(conv_list_handle, "receiving-im-msg", |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
177 plugin, GAIM_CALLBACK(intercept_received), NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
178 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
179 return TRUE; |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
180 } |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
181 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
182 static gboolean |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
183 plugin_unload(GaimPlugin *plugin) { |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
184 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
185 gaim_notify_message(plugin, GAIM_NOTIFY_MSG_INFO, "Unloaded", |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
186 DATADIR, NULL, NULL, NULL); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
187 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
188 MMConversation *mmconv = NULL; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
189 while (g_list_length(conversations) > 0) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
190 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
191 mmconv = g_list_first(conversations)->data; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
192 conv_destroyed(mmconv->conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
193 } |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
194 return TRUE; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
195 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
196 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
197 static void intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
198 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
199 GaimConvIm *imData = gaim_conversation_get_im_data(conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
200 GaimConnection *connection = gaim_conversation_get_gc(conv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
201 const char *convName = gaim_conversation_get_name(conv); |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
202 /* const char *who = gaim_account_get_username(account); */ |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
203 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
204 if (0 == strncmp(*message, MUSICMESSAGING_PREFIX, strlen(MUSICMESSAGING_PREFIX))) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
205 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
206 message = 0; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
207 gaim_debug(GAIM_DEBUG_MISC, "gaim-musicmessaging", "Received MM Message\n"); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
208 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
209 else if (0 == strncmp(*message, MUSICMESSAGING_START_TAG, strlen(MUSICMESSAGING_START_TAG))) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
210 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
211 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
212 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
213 else |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
214 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
215 serv_send_im(connection, convName, *message, GAIM_MESSAGE_SEND); |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
216 gaim_conv_im_write (imData, NULL, *message, GAIM_MESSAGE_SEND, time(NULL)); |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
217 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
218 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
219 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
220 static void intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
221 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
222 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
223 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
224 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
225 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
226 static gboolean |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
227 start_session(MMConversation *mmconv) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
228 { |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
229 if (!mmconv->requested) |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
230 { |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
231 mmconv->originator = TRUE; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
232 } |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
233 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
234 run_editor(mmconv); |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
235 return TRUE; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
236 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
237 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
238 static void music_button_toggled (GtkWidget *widget, gpointer data) |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
239 { |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
240 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
241 { |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
242 start_session((MMConversation *) data); |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
243 } else { |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
244 ((MMConversation *)data)->started = FALSE; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
245 kill_editor((MMConversation *) data); |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
246 } |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
247 } |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
248 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
249 static void set_editor_path (GtkWidget *button, GtkWidget *text_field) |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
250 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
251 const char * path = gtk_entry_get_text((GtkEntry*)text_field); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
252 gaim_prefs_set_string("/plugins/gtk/musicmessaging/editor_path", path); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
253 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
254 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
255 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
256 static void run_editor (MMConversation *mmconv) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
257 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
258 GError *spawn_error = NULL; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
259 gchar * args[2]; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
260 args[0] = (gchar *)gaim_prefs_get_string("/plugins/gtk/musicmessaging/editor_path"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
261 args[1] = NULL; |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
262 if (!(g_spawn_async (".", args, NULL, 12, NULL, NULL, &(mmconv->pid), &spawn_error))) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
263 { |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
264 gaim_notify_error(plugin_pointer, "Error Running Editor", |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
265 "The following error has occured:", spawn_error->message); |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
266 mmconv->started = FALSE; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
267 } |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
268 else |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
269 { |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
270 mmconv->started = TRUE; |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
271 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
272 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
273 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
274 static void kill_editor (MMConversation *mmconv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
275 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
276 if (mmconv->pid) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
277 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
278 kill(mmconv->pid, SIGINT); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
279 mmconv->pid = 0; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
280 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
281 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
282 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
283 static void init_conversation (GaimConversation *conv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
284 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
285 MMConversation *mmconv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
286 mmconv = g_malloc(sizeof(MMConversation)); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
287 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
288 mmconv->conv = conv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
289 mmconv->started = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
290 mmconv->originator = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
291 mmconv->requested = FALSE; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
292 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
293 add_button(mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
294 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
295 conversations = g_list_append(conversations, mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
296 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
297 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
298 static void conv_destroyed (GaimConversation *conv) |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
299 { |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
300 MMConversation *mmconv_current = NULL; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
301 MMConversation *mmconv = NULL; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
302 guint i; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
303 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
304 for (i = 0; i < g_list_length(conversations); i++) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
305 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
306 mmconv_current = (MMConversation *)g_list_nth_data(conversations, i); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
307 if (conv == mmconv_current->conv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
308 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
309 mmconv = mmconv_current; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
310 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
311 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
312 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
313 remove_widget(mmconv->button); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
314 remove_widget(mmconv->seperator); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
315 if (mmconv->started) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
316 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
317 kill_editor(mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
318 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
319 conversations = g_list_remove(conversations, mmconv); |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
320 } |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
321 |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
322 static void add_button (MMConversation *mmconv) |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
323 { |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
324 GaimConversation *conv = mmconv->conv; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
325 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
326 GtkWidget *button, *image, *sep; |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
327 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
328 button = gtk_toggle_button_new(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
329 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
330 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
331 g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(music_button_toggled), mmconv); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
332 |
11254
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
333 /* gchar *file_path = g_build_filename (DATADIR, "pixmaps", "gaim", "buttons", "music.png", NULL); */ |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
334 gchar *file_path = "/usr/local/share/pixmaps/gaim/buttons/music.png"; |
ce3b9969b399
[gaim-migrate @ 13426]
Christian Muise <christian.muise@gmail.com>
parents:
11216
diff
changeset
|
335 image = gtk_image_new_from_file(file_path); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
336 |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
337 gtk_container_add((GtkContainer *)button, image); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
338 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
339 sep = gtk_vseparator_new(); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
340 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
341 mmconv->seperator = sep; |
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
342 mmconv->button = button; |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
343 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
344 gtk_widget_show(sep); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
345 gtk_widget_show(image); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
346 gtk_widget_show(button); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
347 |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
348 gtk_box_pack_start(GTK_BOX(GAIM_GTK_CONVERSATION(conv)->toolbar), sep, FALSE, FALSE, 0); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
349 gtk_box_pack_start(GTK_BOX(GAIM_GTK_CONVERSATION(conv)->toolbar), button, FALSE, FALSE, 0); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
350 } |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
351 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
352 static void remove_widget (GtkWidget *button) |
11169
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
353 { |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
354 gtk_widget_hide(button); |
778d5464a9b8
[gaim-migrate @ 13270]
Christian Muise <christian.muise@gmail.com>
parents:
11166
diff
changeset
|
355 gtk_widget_destroy(button); |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
356 } |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
357 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
358 static GtkWidget * |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
359 get_config_frame(GaimPlugin *plugin) |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
360 { |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
361 GtkWidget *ret; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
362 GtkWidget *vbox; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
363 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
364 GtkWidget *editor_path; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
365 GtkWidget *editor_path_label; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
366 GtkWidget *editor_path_button; |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
367 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
368 /* Outside container */ |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
369 ret = gtk_vbox_new(FALSE, 18); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
370 gtk_container_set_border_width(GTK_CONTAINER(ret), 10); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
371 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
372 /* Configuration frame */ |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
373 vbox = gaim_gtk_make_frame(ret, _("Music Messaging Configuration")); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
374 |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
375 /* Path to the score editor */ |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
376 editor_path = gtk_entry_new(); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
377 editor_path_label = gtk_label_new("Score Editor Path"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
378 editor_path_button = gtk_button_new_with_mnemonic(_("_Apply")); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
379 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
380 gtk_entry_set_text((GtkEntry*)editor_path, "/usr/local/bin/gscore"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
381 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
382 g_signal_connect(G_OBJECT(editor_path_button), "clicked", |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
383 G_CALLBACK(set_editor_path), editor_path); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
384 |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
385 gtk_box_pack_start(GTK_BOX(vbox), editor_path_label, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
386 gtk_box_pack_start(GTK_BOX(vbox), editor_path, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
387 gtk_box_pack_start(GTK_BOX(vbox), editor_path_button, FALSE, FALSE, 0); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
388 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
389 gtk_widget_show_all(ret); |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
390 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
391 return ret; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
392 } |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
393 |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
394 static GaimGtkPluginUiInfo ui_info = |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
395 { |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
396 get_config_frame |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
397 }; |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
398 |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
399 static GaimPluginInfo info = { |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
400 GAIM_PLUGIN_MAGIC, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
401 GAIM_MAJOR_VERSION, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
402 GAIM_MINOR_VERSION, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
403 GAIM_PLUGIN_STANDARD, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
404 GAIM_GTK_PLUGIN_TYPE, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
405 0, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
406 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
407 GAIM_PRIORITY_DEFAULT, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
408 |
11200
4295083cf489
[gaim-migrate @ 13328]
Christian Muise <christian.muise@gmail.com>
parents:
11169
diff
changeset
|
409 MUSICMESSAGING_PLUGIN_ID, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
410 "Music Messaging", |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
411 VERSION, |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
412 "Music Messaging Plugin for collabrative composition.", |
11216
1b32ad61e114
[gaim-migrate @ 13348]
Richard Laager <rlaager@wiktel.com>
parents:
11200
diff
changeset
|
413 "The Music Messaging Plugin allows a number of users to simultaneously work on a piece of music by editting a common score in real-time.", |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
414 "Christian Muise <christian.muise@gmail.com>", |
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
415 GAIM_WEBSITE, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
416 plugin_load, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
417 plugin_unload, |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
418 NULL, |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
419 &ui_info, |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
420 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
421 NULL, |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
422 NULL |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
423 }; |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
424 |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
425 static void |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
426 init_plugin(GaimPlugin *plugin) { |
11166
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
427 gaim_prefs_add_none("/plugins/gtk/musicmessaging"); |
268d5c498b64
[gaim-migrate @ 13267]
Christian Muise <christian.muise@gmail.com>
parents:
11108
diff
changeset
|
428 gaim_prefs_add_string("/plugins/gtk/musicmessaging/editor_path", "/usr/local/bin/gscore"); |
11088
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
429 } |
b8bfa71e5595
[gaim-migrate @ 13108]
Christian Muise <christian.muise@gmail.com>
parents:
diff
changeset
|
430 |
11108
641915a13cec
[gaim-migrate @ 13157]
Christian Muise <christian.muise@gmail.com>
parents:
11088
diff
changeset
|
431 GAIM_INIT_PLUGIN(musicmessaging, init_plugin, info); |