pidgin/plugins/adiumthemes/message-style.h

Fri, 16 Sep 2011 06:10:04 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Fri, 16 Sep 2011 06:10:04 +0000
changeset 32534
0fb9ddb72e3e
parent 32513
9352b4c92d13
permissions
-rw-r--r--

Add a WebKit Development plugin, that allows opening the builtin
inspector on a view. To use, activate the plugin, right-click a view,
and select 'Inspect Element'.

32513
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
1 /* pidgin
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
2 *
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
5 * source distribution.
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
6 *
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
7 * This program is free software; you can redistribute it and/or modify
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
8 * it under the terms of the GNU General Public License as published by
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
10 * (at your option) any later version.
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
11 *
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
12 * This program is distributed in the hope that it will be useful,
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
15 * GNU General Public License for more details.
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
16 *
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
17 * You should have received a copy of the GNU General Public License
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
18 * along with this program; if not, write to the Free Software
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
20 *
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
21 */
32485
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
22
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
23 #include <glib.h>
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
24
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
25 /*
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
26 * I'm going to allow a different style for each PidginConversation.
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
27 * This way I can do two things: 1) change the theme on the fly and not
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
28 * change existing themes, and 2) Use a different theme for IMs and
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
29 * chats.
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
30 */
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
31 typedef struct _PidginMessageStyle {
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
32 int ref_counter;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
33
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
34 /* current config options */
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
35 char *variant; /* allowed to be NULL if there are no variants */
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
36
32487
13f307997f1a Instead of using references, use copy's. Sigh, I know this is a memory inefficient
Arnold Noronha <tdrhq@soc.pidgin.im>
parents: 32486
diff changeset
37 /* Info.plist keys that change with Variant */
32485
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
38
32487
13f307997f1a Instead of using references, use copy's. Sigh, I know this is a memory inefficient
Arnold Noronha <tdrhq@soc.pidgin.im>
parents: 32486
diff changeset
39 /* Static Info.plist keys */
32485
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
40 int message_view_version;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
41 char *cf_bundle_name;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
42 char *cf_bundle_identifier;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
43 char *cf_bundle_get_info_string;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
44 char *default_font_family;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
45 int default_font_size;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
46 gboolean shows_user_icons;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
47 gboolean disable_combine_consecutive;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
48 gboolean default_background_is_transparent;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
49 gboolean disable_custom_background;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
50 char *default_background_color;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
51 gboolean allow_text_colors;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
52 char *image_mask;
32486
c44fe7ecb3dd load the default variant. Bring back basestyle.css.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents: 32485
diff changeset
53 char *default_variant;
c44fe7ecb3dd load the default variant. Bring back basestyle.css.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents: 32485
diff changeset
54
32485
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
55 /* paths */
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
56 char *style_dir;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
57 char *template_path;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
58
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
59 /* caches */
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
60 char *template_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
61 char *header_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
62 char *footer_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
63 char *incoming_content_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
64 char *outgoing_content_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
65 char *incoming_next_content_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
66 char *outgoing_next_content_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
67 char *status_html;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
68 char *basestyle_css;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
69 } PidginMessageStyle;
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
70
32513
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
71 PidginMessageStyle *pidgin_message_style_load(const char *styledir);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
72 PidginMessageStyle *pidgin_message_style_copy(const PidginMessageStyle *style);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
73 void pidgin_message_style_save_state(const PidginMessageStyle *style);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
74 void pidgin_message_style_unref(PidginMessageStyle *style);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
75 void pidgin_message_style_read_info_plist(PidginMessageStyle *style, const char *variant);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
76 char *pidgin_message_style_get_variant(PidginMessageStyle *style);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
77 GList *pidgin_message_style_get_variants(PidginMessageStyle *style);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
78 void pidgin_message_style_set_variant(PidginMessageStyle *style, const char *variant);
32485
b932922007bc Separated the MessageStyle loading code from the actual rendering code.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
diff changeset
79
32513
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
80 char *pidgin_message_style_get_css(PidginMessageStyle *style);
9352b4c92d13 Clean up this WebKit stuff. Fix up broken merging, mark unfinished
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32488
diff changeset
81

mercurial