[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk 27a92f7 072/100: Add font chooser functionality
From: |
Yuuki Harano |
Subject: |
feature/pgtk 27a92f7 072/100: Add font chooser functionality |
Date: |
Tue, 24 Nov 2020 08:02:40 -0500 (EST) |
branch: feature/pgtk
commit 27a92f7b1541f172182e4b3308259ba37d3d5e1f
Author: Jeff Walsh <fejfighter@gmail.com>
Commit: Jeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>
Add font chooser functionality
* src/pgtkfns.c (Fpgtk_popup_font_panel): repurpose X/gtk font chooser code
(syms_of_pgtkfns): add new symbol
---
src/pgtkfns.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 900a899..a4da330 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -1617,6 +1617,44 @@ Some window managers may refuse to restack windows. */)
return Qt;
}
+DEFUN ("pgtk-popup-font-panel", Fpgtk_popup_font_panel, Spgtk_popup_font_panel,
+ 0, 1, "",
+ doc: /* Pop up the font panel. */)
+ (Lisp_Object frame)
+{
+ struct frame *f = decode_window_system_frame (frame);
+
+ Lisp_Object font;
+ Lisp_Object font_param;
+ char *default_name = NULL;
+ ptrdiff_t count = SPECPDL_INDEX ();
+
+ block_input ();
+
+ XSETFONT (font, FRAME_FONT (f));
+ font_param = Ffont_get (font, QCname);
+ if (STRINGP (font_param))
+ default_name = xlispstrdup (font_param);
+ else
+ {
+ font_param = Fframe_parameter (frame, Qfont_parameter);
+ if (STRINGP (font_param))
+ default_name = xlispstrdup (font_param);
+ }
+
+ font = xg_get_font (f, default_name);
+ xfree (default_name);
+
+ unblock_input ();
+
+ if (NILP (font))
+ quit ();
+
+ return unbind_to (count, font);
+}
+
+
+
#ifdef HAVE_GSETTINGS
#define RESOURCE_KEY_MAX_LEN 128
@@ -3089,6 +3127,7 @@ be used as the image of the icon representing the frame.
*/);
defsubr (&Spgtk_frame_geometry);
defsubr (&Spgtk_frame_edges);
defsubr (&Spgtk_frame_restack);
+ defsubr (&Spgtk_popup_font_panel);
defsubr (&Spgtk_set_mouse_absolute_pixel_position);
defsubr (&Spgtk_mouse_absolute_pixel_position);
defsubr (&Sx_display_mm_width);
- branch feature/pgtk created (now d6ef9af), Yuuki Harano, 2020/11/24
- feature/pgtk 1b621c8 004/100: Don't mark name_list_element as it's not required, Yuuki Harano, 2020/11/24
- feature/pgtk 526f727 036/100: Let gtk handle scaling., Yuuki Harano, 2020/11/24
- feature/pgtk 68b99a3 021/100: Implement invisible-pointer to create blinking effect, Yuuki Harano, 2020/11/24
- feature/pgtk 53cb431 007/100: replace listn with list., Yuuki Harano, 2020/11/24
- feature/pgtk 592badc 014/100: Early toolbar improvements, Yuuki Harano, 2020/11/24
- feature/pgtk 9d9c828 025/100: TIMERFD support for PGTK, prevent calling when timerfd<0, Yuuki Harano, 2020/11/24
- feature/pgtk fbba846 017/100: Addframe highlighting support, Yuuki Harano, 2020/11/24
- feature/pgtk 0056ca2 064/100: * src/pgtkterm.h: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk f761a09 065/100: * src/pgtkim.c: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 27a92f7 072/100: Add font chooser functionality,
Yuuki Harano <=
- feature/pgtk 9752896 042/100: Bring pgtk more inline with X11-cairo builds, Yuuki Harano, 2020/11/24
- feature/pgtk 164800d 013/100: Add Preferred geometry settings, Yuuki Harano, 2020/11/24
- feature/pgtk 383ced7 071/100: Fix migrating Child frames, Yuuki Harano, 2020/11/24
- feature/pgtk 3b161dd 066/100: * src/pgtkselect.h: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 89cbe37 070/100: * src/keyboard.c (make_lispy_event): Fix coding style, Yuuki Harano, 2020/11/24
- feature/pgtk f6d8c59 001/100: Introduce Pure GTK3 port, Yuuki Harano, 2020/11/24
- feature/pgtk a9c8a56 006/100: Fix xdg-open handling, Yuuki Harano, 2020/11/24
- feature/pgtk ed1f7d1 008/100: Simplify compilaiton condtion, Yuuki Harano, 2020/11/24
- feature/pgtk cdc04b4 010/100: Implement menubar for pgtk emacs, Yuuki Harano, 2020/11/24
- feature/pgtk 85441c9 016/100: Add Stipple support for PGTK, Yuuki Harano, 2020/11/24