1 /* 2 * theme.h 3 * vim: expandtab:ts=4:sts=4:sw=4 4 * 5 * Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com> 6 * 7 * This file is part of Profanity. 8 * 9 * Profanity is free software: you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation, either version 3 of the License, or 12 * (at your option) any later version. 13 * 14 * Profanity is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with Profanity. If not, see <https://www.gnu.org/licenses/>. 21 * 22 * In addition, as a special exception, the copyright holders give permission to 23 * link the code of portions of this program with the OpenSSL library under 24 * certain conditions as described in each individual source file, and 25 * distribute linked combinations including the two. 26 * 27 * You must obey the GNU General Public License in all respects for all of the 28 * code used other than OpenSSL. If you modify file(s) with this exception, you 29 * may extend this exception to your version of the file(s), but you are not 30 * obligated to do so. If you do not wish to do so, delete this exception 31 * statement from your version. If you delete this exception statement from all 32 * source files in the program, then also delete it here. 33 * 34 */ 35 36 #ifndef CONFIG_THEME_H 37 #define CONFIG_THEME_H 38 39 #include "config.h" 40 41 #include <glib.h> 42 43 #define THEME_DEFAULT 0 44 45 typedef enum { 46 THEME_TEXT, 47 THEME_TEXT_ME, 48 THEME_TEXT_THEM, 49 THEME_SPLASH, 50 THEME_HELP_HEADER, 51 THEME_ERROR, 52 THEME_INCOMING, 53 THEME_MENTION, 54 THEME_TRIGGER, 55 THEME_INPUT_TEXT, 56 THEME_TIME, 57 THEME_TITLE_TEXT, 58 THEME_TITLE_BRACKET, 59 THEME_TITLE_SCROLLED, 60 THEME_TITLE_UNENCRYPTED, 61 THEME_TITLE_ENCRYPTED, 62 THEME_TITLE_UNTRUSTED, 63 THEME_TITLE_TRUSTED, 64 THEME_TITLE_ONLINE, 65 THEME_TITLE_OFFLINE, 66 THEME_TITLE_AWAY, 67 THEME_TITLE_CHAT, 68 THEME_TITLE_DND, 69 THEME_TITLE_XA, 70 THEME_STATUS_TEXT, 71 THEME_STATUS_BRACKET, 72 THEME_STATUS_ACTIVE, 73 THEME_STATUS_CURRENT, 74 THEME_STATUS_NEW, 75 THEME_STATUS_TIME, 76 THEME_ME, 77 THEME_THEM, 78 THEME_ROOMINFO, 79 THEME_ROOMMENTION, 80 THEME_ROOMMENTION_TERM, 81 THEME_ROOMTRIGGER, 82 THEME_ROOMTRIGGER_TERM, 83 THEME_ONLINE, 84 THEME_OFFLINE, 85 THEME_AWAY, 86 THEME_CHAT, 87 THEME_DND, 88 THEME_XA, 89 THEME_TYPING, 90 THEME_GONE, 91 THEME_SUBSCRIBED, 92 THEME_UNSUBSCRIBED, 93 THEME_OTR_STARTED_TRUSTED, 94 THEME_OTR_STARTED_UNTRUSTED, 95 THEME_OTR_ENDED, 96 THEME_OTR_TRUSTED, 97 THEME_OTR_UNTRUSTED, 98 THEME_OCCUPANTS_HEADER, 99 THEME_ROSTER_HEADER, 100 THEME_ROSTER_ONLINE, 101 THEME_ROSTER_OFFLINE, 102 THEME_ROSTER_AWAY, 103 THEME_ROSTER_CHAT, 104 THEME_ROSTER_DND, 105 THEME_ROSTER_XA, 106 THEME_ROSTER_ONLINE_ACTIVE, 107 THEME_ROSTER_OFFLINE_ACTIVE, 108 THEME_ROSTER_AWAY_ACTIVE, 109 THEME_ROSTER_CHAT_ACTIVE, 110 THEME_ROSTER_DND_ACTIVE, 111 THEME_ROSTER_XA_ACTIVE, 112 THEME_ROSTER_ONLINE_UNREAD, 113 THEME_ROSTER_OFFLINE_UNREAD, 114 THEME_ROSTER_AWAY_UNREAD, 115 THEME_ROSTER_CHAT_UNREAD, 116 THEME_ROSTER_DND_UNREAD, 117 THEME_ROSTER_XA_UNREAD, 118 THEME_ROSTER_ROOM, 119 THEME_ROSTER_ROOM_UNREAD, 120 THEME_ROSTER_ROOM_TRIGGER, 121 THEME_ROSTER_ROOM_MENTION, 122 THEME_RECEIPT_SENT, 123 THEME_UNTRUSTED, 124 THEME_NONE, 125 THEME_WHITE, 126 THEME_WHITE_BOLD, 127 THEME_GREEN, 128 THEME_GREEN_BOLD, 129 THEME_RED, 130 THEME_RED_BOLD, 131 THEME_YELLOW, 132 THEME_YELLOW_BOLD, 133 THEME_BLUE, 134 THEME_BLUE_BOLD, 135 THEME_CYAN, 136 THEME_CYAN_BOLD, 137 THEME_BLACK, 138 THEME_BLACK_BOLD, 139 THEME_MAGENTA, 140 THEME_MAGENTA_BOLD, 141 THEME_TEXT_HISTORY, 142 THEME_CMD_WINS_UNREAD, 143 THEME_TRACKBAR, 144 } theme_item_t; 145 146 void theme_init(const char* const theme_name); 147 void theme_init_colours(void); 148 gboolean theme_load(const char* const theme_name, gboolean load_theme_prefs); 149 gboolean theme_exists(const char* const theme_name); 150 GSList* theme_list(void); 151 void theme_close(void); 152 int theme_hash_attrs(const char* str); 153 int theme_attrs(theme_item_t attrs); 154 char* theme_get_string(char* str); 155 void theme_free_string(char* str); 156 theme_item_t theme_main_presence_attrs(const char* const presence); 157 theme_item_t theme_roster_unread_presence_attrs(const char* const presence); 158 theme_item_t theme_roster_active_presence_attrs(const char* const presence); 159 theme_item_t theme_roster_presence_attrs(const char* const presence); 160 char* theme_get_bkgnd(void); 161 162 #endif 163