mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-19 20:20:18 +00:00
Added a GTK3-only helper to translate Pango font fields into font-family, font-size, font-style, font-weight, font-variant, and font-stretch CSS declarations while preserving GTK2 behavior under #if !HAVE_GTK3. Reused the GTK3 font CSS helper in the main UI font styling path to eliminate remaining Pango font: shorthand usage that triggers GTK3 theme parsing warnings. Exposed the GTK3 font CSS helper in gtkutil so callers can emit CSS-compliant font properties consistently.
67 lines
3.0 KiB
C
67 lines
3.0 KiB
C
/* ZoiteChat
|
|
* Copyright (C) 1998-2010 Peter Zelezny.
|
|
* Copyright (C) 2009-2013 Berke Viktor.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
*/
|
|
|
|
#ifndef ZOITECHAT_GTKUTIL_H
|
|
#define ZOITECHAT_GTKUTIL_H
|
|
|
|
#include <gtk/gtk.h>
|
|
#include "../common/fe.h"
|
|
#include "palette.h"
|
|
|
|
typedef void (*filereqcallback) (void *, char *file);
|
|
|
|
void gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *userdata, char *filter, char *extensions, int flags);
|
|
void gtkutil_destroy (GtkWidget * igad, GtkWidget * dgad);
|
|
void gtkutil_destroy_on_esc (GtkWidget *win);
|
|
GtkWidget *gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback,
|
|
void *userdata, char *labeltext);
|
|
GtkWidget *gtkutil_image_new_from_stock (const char *stock, GtkIconSize size);
|
|
GtkWidget *gtkutil_button_new_from_stock (const char *stock, const char *label);
|
|
#if HAVE_GTK3
|
|
const char *gtkutil_icon_name_from_stock (const char *stock_name);
|
|
#endif
|
|
void gtkutil_label_new (char *text, GtkWidget * box);
|
|
GtkWidget *gtkutil_entry_new (int max, GtkWidget * box, void *callback,
|
|
gpointer userdata);
|
|
void show_and_unfocus (GtkWidget * wid);
|
|
void gtkutil_set_icon (GtkWidget *win);
|
|
GtkWidget *gtkutil_window_new (char *title, char *role, int width, int height, int flags);
|
|
void gtkutil_copy_to_clipboard (GtkWidget *widget, GdkAtom selection,
|
|
const gchar *str);
|
|
GtkWidget *gtkutil_treeview_new (GtkWidget *box, GtkTreeModel *model,
|
|
GtkTreeCellDataFunc mapper, ...);
|
|
gboolean gtkutil_treemodel_string_to_iter (GtkTreeModel *model, gchar *pathstr, GtkTreeIter *iter_ret);
|
|
gboolean gtkutil_treeview_get_selected_iter (GtkTreeView *view, GtkTreeIter *iter_ret);
|
|
gboolean gtkutil_treeview_get_selected (GtkTreeView *view, GtkTreeIter *iter_ret, ...);
|
|
gboolean gtkutil_tray_icon_supported (GtkWindow *window);
|
|
#if HAVE_GTK3
|
|
void gtkutil_apply_palette (GtkWidget *widget, const GdkRGBA *bg, const GdkRGBA *fg,
|
|
const PangoFontDescription *font_desc);
|
|
void gtkutil_append_font_css (GString *css, const PangoFontDescription *font_desc);
|
|
#else
|
|
void gtkutil_apply_palette (GtkWidget *widget, const GdkColor *bg, const GdkColor *fg,
|
|
const PangoFontDescription *font_desc);
|
|
#endif
|
|
|
|
#if defined (WIN32) || defined (__APPLE__)
|
|
gboolean gtkutil_find_font (const char *fontname);
|
|
#endif
|
|
|
|
#endif
|