plugins/perl/perl-common.h

Sun, 17 Oct 2004 23:55:49 +0000

author
Sean Egan <seanegan@pidgin.im>
date
Sun, 17 Oct 2004 23:55:49 +0000
changeset 10108
0897c42d6cb9
parent 6921
3d49b89fc920
child 11170
d8941580d87f
permissions
-rw-r--r--

[gaim-migrate @ 11141]
Two things:
a. Added Enter as a gtk_binding to GtkIMHtml. This fixes everything.
Input methods now work. The "Enter sends" and "Ctrl-Enter sends" preferences
were removed and defaulted to yes and no respectively, BUT, in a very super-cool
turn of events, you can now add your own bindings to .gtkrc to make WHATEVER
YOU WANT send. Awesome. Someone should use g_signal_accumulator_true_handled
or something to make profiles and away messages able to insert newlines.

b. Removed "Use multi-colored screennames in chats," defaulted to yes, and
wrote a nifty algorithm to automatically adjust the colors to accomodate the
background (see http://gaim.sf.net/sean/porn-chat.png). People should play
around and tweak it a bit. The algorithm takes into consideration the
luminosity of the current background and the base hue to use for the screenname
in generating the new colors. Note that it does this while maintaining the hues.
Someone should optimize this so it skips over the floating point arithmatic when
the background color is white.

6508
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 #ifndef _GAIM_PERL_COMMON_H_
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 #define _GAIM_PERL_COMMON_H_
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3
6816
b14a3043ed09 [gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents: 6566
diff changeset
4 #include <glib.h>
b14a3043ed09 [gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents: 6566
diff changeset
5 #ifdef _WIN32
b14a3043ed09 [gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents: 6566
diff changeset
6 #undef pipe
b14a3043ed09 [gaim-migrate @ 7356]
Herman Bloggs <herman@bluedigits.com>
parents: 6566
diff changeset
7 #endif
6520
5386692555c9 [gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents: 6508
diff changeset
8 #include <XSUB.h>
5386692555c9 [gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents: 6508
diff changeset
9 #include <EXTERN.h>
5386692555c9 [gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents: 6508
diff changeset
10 #include <perl.h>
5386692555c9 [gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents: 6508
diff changeset
11
6566
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
12 #include "value.h"
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
13
6508
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 #define is_hvref(o) \
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 ((o) && SvROK(o) && SvRV(o) && (SvTYPE(SvRV(o)) == SVt_PVHV))
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 #define hvref(o) \
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 (is_hvref(o) ? (HV *)SvRV(o) : NULL);
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 #define GAIM_PERL_BOOT(x) \
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 { \
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 extern void boot_Gaim__##x(pTHX_ CV *cv); \
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 gaim_perl_callXS(boot_Gaim__##x, cv, mark); \
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 }
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25
6566
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
26 SV *newSVGChar(const char *str);
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
27
6508
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 void gaim_perl_callXS(void (*subaddr)(pTHX_ CV *cv), CV *cv, SV **mark);
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 void gaim_perl_bless_plain(const char *stash, void *object);
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 SV *gaim_perl_bless_object(void *object, const char *stash);
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 gboolean gaim_perl_is_ref_object(SV *o);
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 void *gaim_perl_ref_object(SV *o);
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33
6520
5386692555c9 [gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents: 6508
diff changeset
34 int execute_perl(const char *function, int argc, char **args);
5386692555c9 [gaim-migrate @ 7037]
Christian Hammond <chipx86@chipx86.com>
parents: 6508
diff changeset
35
6566
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
36 #if 0
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
37 gboolean gaim_perl_value_from_sv(GaimValue *value, SV *sv);
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
38 SV *gaim_perl_sv_from_value(const GaimValue *value);
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
39 #endif
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
40
6920
4f4931b005cb [gaim-migrate @ 7467]
Christian Hammond <chipx86@chipx86.com>
parents: 6816
diff changeset
41 void *gaim_perl_data_from_sv(GaimValue *value, SV *sv);
4f4931b005cb [gaim-migrate @ 7467]
Christian Hammond <chipx86@chipx86.com>
parents: 6816
diff changeset
42 SV *gaim_perl_sv_from_vargs(const GaimValue *value, va_list *args,
6921
3d49b89fc920 [gaim-migrate @ 7468]
Christian Hammond <chipx86@chipx86.com>
parents: 6920
diff changeset
43 void ***copy_arg);
6566
61eb35202526 [gaim-migrate @ 7088]
Christian Hammond <chipx86@chipx86.com>
parents: 6531
diff changeset
44
6508
57d1df1ca3a0 [gaim-migrate @ 7025]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 #endif /* _GAIM_PERL_COMMON_H_ */

mercurial