Skip to content

Commit 8ae245e

Browse files
author
Yuuki Harano
committed
起動しなくなったので修正。
1 parent 9ada678 commit 8ae245e

File tree

5 files changed

+63
-42
lines changed

5 files changed

+63
-42
lines changed

src/ftfont.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,31 +1145,34 @@ ftfont_open2 (struct frame *f,
11451145
color = is_color_font(ft_face);
11461146
if (!color)
11471147
{
1148-
int min_distance = INT_MAX;
1149-
bool magnify = true;
1150-
1151-
for (FT_Int i = 0; i < ft_face->num_fixed_sizes; i++)
1148+
if (FT_Set_Pixel_Sizes (ft_face, size, size) != 0)
11521149
{
1153-
int distance = ft_face->available_sizes[i].height - (int) size;
1150+
int min_distance = INT_MAX;
1151+
bool magnify = true;
11541152

1155-
/* Prefer down-scaling to upscaling. */
1156-
if (magnify == (distance < 0) ? abs (distance) <= min_distance
1157-
: magnify)
1153+
for (FT_Int i = 0; i < ft_face->num_fixed_sizes; i++)
11581154
{
1159-
magnify = distance < 0;
1160-
min_distance = abs (distance);
1161-
strike_index = i;
1155+
int distance = ft_face->available_sizes[i].height - (int) size;
1156+
1157+
/* Prefer down-scaling to upscaling. */
1158+
if (magnify == (distance < 0) ? abs (distance) <= min_distance
1159+
: magnify)
1160+
{
1161+
magnify = distance < 0;
1162+
min_distance = abs (distance);
1163+
strike_index = i;
1164+
}
11621165
}
1163-
}
11641166

1165-
if (strike_index < 0 || FT_Select_Size (ft_face, strike_index) != 0)
1166-
{
1167-
if (cache_data->face_refcount == 0)
1167+
if (strike_index < 0 || FT_Select_Size (ft_face, strike_index) != 0)
11681168
{
1169-
FT_Done_Face (ft_face);
1170-
cache_data->ft_face = NULL;
1169+
if (cache_data->face_refcount == 0)
1170+
{
1171+
FT_Done_Face (ft_face);
1172+
cache_data->ft_face = NULL;
1173+
}
1174+
return Qnil;
11711175
}
1172-
return Qnil;
11731176
}
11741177
}
11751178
else
@@ -1182,7 +1185,7 @@ ftfont_open2 (struct frame *f,
11821185
cache_data->ft_face = NULL;
11831186
}
11841187
return Qnil;
1185-
}
1188+
}
11861189
}
11871190

11881191
cache_data->face_refcount++;

src/pgtkfns.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
349349
name; names set this way will never override names set by the user's
350350
lisp code. */
351351
void
352-
x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
352+
pgtk_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
353353
{
354354
PGTK_TRACE ("x_implicitly_set_name");
355355

@@ -805,11 +805,11 @@ x_set_override_redirect (struct frame *f, Lisp_Object new_value, Lisp_Object old
805805
{
806806
/* Here (xfwm) override_redirect can be changed for invisible
807807
frames only. */
808-
x_make_frame_invisible (f);
808+
pgtk_make_frame_invisible (f);
809809

810810
xg_set_override_redirect (f, new_value);
811811

812-
x_make_frame_visible (f);
812+
pgtk_make_frame_visible (f);
813813
FRAME_OVERRIDE_REDIRECT (f) = !NILP (new_value);
814814
}
815815
}
@@ -1510,14 +1510,14 @@ This function is an internal primitive--use `make-frame' instead. */)
15101510
= gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
15111511

15121512
if (EQ (visibility, Qicon))
1513-
x_iconify_frame (f);
1513+
pgtk_iconify_frame (f);
15141514
else
15151515
{
15161516
if (EQ (visibility, Qunbound))
15171517
visibility = Qt;
15181518

15191519
if (!NILP (visibility))
1520-
x_make_frame_visible (f);
1520+
pgtk_make_frame_visible (f);
15211521
}
15221522

15231523
store_frame_param (f, Qvisibility, visibility);
@@ -1982,7 +1982,7 @@ check_x_display_info (Lisp_Object frame)
19821982

19831983

19841984
void
1985-
x_set_scroll_bar_default_width (struct frame *f)
1985+
pgtk_set_scroll_bar_default_width (struct frame *f)
19861986
{
19871987
int unit = FRAME_COLUMN_WIDTH (f);
19881988
int minw = xg_get_default_scrollbar_width (f);
@@ -1992,7 +1992,7 @@ x_set_scroll_bar_default_width (struct frame *f)
19921992
}
19931993

19941994
void
1995-
x_set_scroll_bar_default_height (struct frame *f)
1995+
pgtk_set_scroll_bar_default_height (struct frame *f)
19961996
{
19971997
int height = FRAME_LINE_HEIGHT (f);
19981998
int min_height = xg_get_default_scrollbar_height (f);
@@ -2002,7 +2002,7 @@ x_set_scroll_bar_default_height (struct frame *f)
20022002
}
20032003

20042004
/* terms impl this instead of x-get-resource directly */
2005-
char *
2005+
const char *
20062006
pgtk_get_string_resource (XrmDatabase rdb, const char *name, const char *class)
20072007
{
20082008
/* remove appname prefix; TODO: allow for !="Emacs" */
@@ -2412,7 +2412,7 @@ x_hide_tip (bool delete)
24122412
tip_frame = Qnil;
24132413
}
24142414
else
2415-
x_make_frame_invisible (XFRAME (tip_frame));
2415+
pgtk_make_frame_invisible (XFRAME (tip_frame));
24162416

24172417
was_open = Qt;
24182418
}

src/pgtkgui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ typedef int Window;
6969
typedef struct _GdkDisplay Display;
7070

7171
/* Xism */
72-
typedef Lisp_Object XrmDatabase;
72+
typedef void *XrmDatabase;
7373

7474

7575
/* some sort of attempt to normalize rectangle handling.. seems a bit much

src/pgtkterm.c

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,12 @@ x_set_window_size (struct frame *f,
517517
}
518518

519519
void
520-
x_iconify_frame (struct frame *f)
520+
pgtk_iconify_frame (struct frame *f)
521521
/* --------------------------------------------------------------------------
522522
External: Iconify window
523523
-------------------------------------------------------------------------- */
524524
{
525-
PGTK_TRACE("x_iconify_frame");
525+
PGTK_TRACE("pgtk_iconify_frame");
526526

527527
/* Don't keep the highlight on an invisible frame. */
528528
if (FRAME_DISPLAY_INFO (f)->highlight_frame == f)
@@ -579,12 +579,12 @@ x_iconify_frame (struct frame *f)
579579
}
580580

581581
void
582-
x_make_frame_visible (struct frame *f)
582+
pgtk_make_frame_visible (struct frame *f)
583583
/* --------------------------------------------------------------------------
584584
External: Show the window (X11 semantics)
585585
-------------------------------------------------------------------------- */
586586
{
587-
PGTK_TRACE("x_make_frame_visible");
587+
PGTK_TRACE("pgtk_make_frame_visible");
588588
#if 0
589589
NSTRACE ("x_make_frame_visible");
590590
/* XXX: at some points in past this was not needed, as the only place that
@@ -633,12 +633,12 @@ x_make_frame_visible (struct frame *f)
633633

634634

635635
void
636-
x_make_frame_invisible (struct frame *f)
636+
pgtk_make_frame_invisible (struct frame *f)
637637
/* --------------------------------------------------------------------------
638638
External: Hide the window (X11 semantics)
639639
-------------------------------------------------------------------------- */
640640
{
641-
PGTK_TRACE("x_make_frame_invisible");
641+
PGTK_TRACE("pgtk_make_frame_invisible");
642642
#if 0
643643
NSView *view;
644644
NSTRACE ("x_make_frame_invisible");
@@ -651,9 +651,9 @@ x_make_frame_invisible (struct frame *f)
651651
}
652652

653653
Lisp_Object
654-
x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
654+
pgtk_new_font (struct frame *f, Lisp_Object font_object, int fontset)
655655
{
656-
PGTK_TRACE("x_new_font");
656+
PGTK_TRACE("pgtk_new_font");
657657
struct font *font = XFONT_OBJECT (font_object);
658658
// EmacsView *view = FRAME_NS_VIEW (f);
659659
int font_ascent, font_descent;
@@ -2921,6 +2921,7 @@ pgtk_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
29212921
PGTK_TRACE("draw_window_cursor: %d, %d, %d, %d, %d, %d.",
29222922
x, y, cursor_type, cursor_width, on_p, active_p);
29232923
struct frame *f = XFRAME (WINDOW_FRAME (w));
2924+
PGTK_TRACE("%p\n", f->output_data.pgtk);
29242925

29252926
if (on_p)
29262927
{
@@ -3614,10 +3615,10 @@ extern frame_parm_handler pgtk_frame_parm_handlers[];
36143615
static struct redisplay_interface pgtk_redisplay_interface =
36153616
{
36163617
pgtk_frame_parm_handlers,
3617-
produce_glyphs,
3618-
write_glyphs,
3619-
insert_glyphs,
3620-
clear_end_of_line,
3618+
gui_produce_glyphs,
3619+
gui_write_glyphs,
3620+
gui_insert_glyphs,
3621+
gui_clear_end_of_line,
36213622
pgtk_scroll_run,
36223623
pgtk_after_update_window_line,
36233624
pgtk_update_window_begin,
@@ -3633,6 +3634,7 @@ static struct redisplay_interface pgtk_redisplay_interface =
36333634
pgtk_draw_glyph_string,
36343635
pgtk_define_frame_cursor,
36353636
pgtk_clear_frame_area,
3637+
pgtk_clear_under_internal_border,
36363638
pgtk_draw_window_cursor,
36373639
pgtk_draw_vertical_window_border,
36383640
pgtk_draw_window_divider,
@@ -4680,6 +4682,12 @@ pgtk_create_terminal (struct pgtk_display_info *dpyinfo)
46804682
terminal->delete_terminal_hook = pgtk_delete_terminal;
46814683
terminal->query_frame_background_color = pgtk_query_frame_background_color;
46824684
terminal->defined_color_hook = pgtk_defined_color;
4685+
terminal->set_new_font_hook = pgtk_new_font;
4686+
terminal->implicit_set_name_hook = pgtk_implicitly_set_name;
4687+
terminal->iconify_frame_hook = pgtk_iconify_frame;
4688+
terminal->set_scroll_bar_default_width_hook = pgtk_set_scroll_bar_default_width;
4689+
terminal->set_scroll_bar_default_height_hook = pgtk_set_scroll_bar_default_height;
4690+
46834691
/* Other hooks are NULL by default. */
46844692

46854693
return terminal;

src/pgtkterm.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ extern char *pgtk_xlfd_to_fontname (const char *xlfd);
521521
/* Implemented in pgtkfns. */
522522
extern void pgtk_set_doc_edited (void);
523523
extern const char *pgtk_get_defaults_value (const char *key);
524-
extern char *pgtk_get_string_resource (XrmDatabase rdb, const char *name, const char *class);
524+
extern const char *pgtk_get_string_resource (XrmDatabase rdb, const char *name, const char *class);
525+
extern void pgtk_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval);
525526

526527
/* Color management implemented in pgtkterm. */
527528
extern bool pgtk_defined_color (struct frame *f,
@@ -580,4 +581,13 @@ extern void init_pgtkterm (void);
580581
extern void mark_pgtkterm(void);
581582
extern void pgtk_delete_terminal (struct terminal *terminal);
582583

584+
extern void pgtk_make_frame_visible (struct frame *f);
585+
extern void pgtk_make_frame_invisible (struct frame *f);
586+
extern void x_wm_set_size_hint (struct frame *, long, bool);
587+
extern void x_free_frame_resources (struct frame *);
588+
extern void pgtk_iconify_frame (struct frame *f);
589+
extern void x_focus_frame (struct frame *f, bool noactivate);
590+
extern void pgtk_set_scroll_bar_default_width (struct frame *f);
591+
extern void pgtk_set_scroll_bar_default_height (struct frame *f);
592+
583593
#endif /* HAVE_PGTK */

0 commit comments

Comments
 (0)