Tue, 10 Nov 2020 01:11:31 -0600
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Testing Done:
* Ran with arc-dark and adwatia.
* Stepped through the debugger to make sure it was detected right.
* Joined a muc with both themes, the colors change but there're impossible to see as most of that code is elsewhere and not addressed in this review request.
* Also noticed that nicks in mucs are doubled, not sure what, but it's that way with out this patch as well.
Reviewed at https://reviews.imfreedom.org/r/208/
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
1 | /* |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
2 | * Pidgin - Internet Messenger |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
20 | * along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
38816
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
22 | |
|
40502
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
39277
diff
changeset
|
23 | #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
39277
diff
changeset
|
24 | # error "only <pidgin.h> may be included directly" |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
39277
diff
changeset
|
25 | #endif |
|
875489636847
pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents:
39277
diff
changeset
|
26 | |
|
38816
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
27 | /** |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
28 | * SECTION:pidginstyle |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
29 | * @section_id: pidgin-pidginstyle |
|
38816
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
30 | * @short_description: <filename>gtkstyle.h</filename> |
|
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
31 | * @title: Style API |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
32 | * |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
33 | * The style API contains some helpers regarding #GtkStyle. |
|
38816
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
34 | */ |
|
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
35 | |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
36 | #ifndef PIDGIN_STYLE_H |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
37 | #define PIDGIN_STYLE_H |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | #include <gtk/gtk.h> |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | G_BEGIN_DECLS |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | /** |
|
38816
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
44 | * pidgin_style_is_dark: |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
45 | * @style: The #GtkStyle in use, or %NULL to use a cached version. |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | * |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
47 | * Gets whether or not dark mode is enabled. |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | * |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
49 | * Returns: %TRUE if dark mode is enabled and foreground colours should be |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
50 | * inverted. |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | */ |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | gboolean pidgin_style_is_dark(GtkStyle *style); |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | /** |
|
38816
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
56 | * pidgin_style_adjust_contrast: |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
57 | * @style: The #GtkStyle in use. |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
58 | * @color: (inout): Color to be lightened. Transformed color will be written |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
59 | * here. |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | * |
|
38816
9fd4f68ed211
Clean up gobject-introspection for gtkstyle.h
Gary Kramlich <grim@reaperworld.com>
parents:
38699
diff
changeset
|
61 | * Lighten a color if dark mode is enabled. |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | */ |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | |
|
39277
68c17ba18f33
pidgin: Fix GdkColor vs GdkRGBA -Wincompatible-pointer-types warnings
Mike Ruprecht <cmaiku@gmail.com>
parents:
38816
diff
changeset
|
64 | void pidgin_style_adjust_contrast(GtkStyle *style, GdkRGBA *color); |
|
38699
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | G_END_DECLS |
|
e7b5011e4728
Namespace the contrast stuff and move it to it's own file/namespace
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | |
|
40592
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
68 | #endif /* PIDGIN_STYLE_H */ |
|
559881c7bf92
Rename gtkstyle.[ch] to pidginstyle.[ch] and fix up the dark mode check.
Gary Kramlich <grim@reaperworld.com>
parents:
40502
diff
changeset
|
69 |