From: Yuuki Harano Date: Tue, 26 May 2020 11:38:38 +0000 (+0900) Subject: Change coding style X-Git-Tag: emacs-29.0.90~3791 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20dbd4e283229c98e8bbf1a60da66dde00036d77;p=emacs.git Change coding style * src/gtkutil.c (xg_display_open): (xg_get_image_for_pixmap): (xg_frame_resized): (xg_create_frame_widgets): (x_wm_set_size_hint): (xg_frame_restack): (xg_finish_scroll_bar_creation): (xg_update_scrollbar_pos): (xg_update_horizontal_scrollbar_pos): (xg_set_toolkit_scroll_bar_thumb): (xg_event_is_for_scrollbar): --- diff --git a/src/gtkutil.c b/src/gtkutil.c index ce08ffec375..97a8e4a5c1f 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -186,7 +186,7 @@ xg_display_open (char *display_name, GdkDisplay **dpy) #ifndef HAVE_PGTK gdpy = gdk_display_open (display_name); #else - gdpy = gdk_display_open (strlen(display_name) == 0 ? NULL : display_name); + gdpy = gdk_display_open (strlen (display_name) == 0 ? NULL : display_name); #endif request_sigio (); if (!gdpy_def && gdpy) @@ -1020,15 +1020,15 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight) width = FRAME_PIXEL_TO_TEXT_WIDTH (f, pixelwidth); height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelheight); - PGTK_TRACE("xg_frame_resized: pixel: %dx%d, text: %dx%d", pixelwidth, pixelheight, width, height); + PGTK_TRACE ("xg_frame_resized: pixel: %dx%d, text: %dx%d", pixelwidth, pixelheight, width, height); frame_size_history_add (f, Qxg_frame_resized, width, height, Qnil); - PGTK_TRACE("width: %d -> %d.", FRAME_TEXT_WIDTH(f), width); - PGTK_TRACE("height: %d -> %d.", FRAME_TEXT_HEIGHT(f), height); - PGTK_TRACE("pixelwidth: %d -> %d.", FRAME_PIXEL_WIDTH(f), pixelwidth); - PGTK_TRACE("pixelheight: %d -> %d.", FRAME_PIXEL_HEIGHT(f), pixelheight); + PGTK_TRACE ("width: %d -> %d.", FRAME_TEXT_WIDTH (f), width); + PGTK_TRACE ("height: %d -> %d.", FRAME_TEXT_HEIGHT (f), height); + PGTK_TRACE ("pixelwidth: %d -> %d.", FRAME_PIXEL_WIDTH (f), pixelwidth); + PGTK_TRACE ("pixelheight: %d -> %d.", FRAME_PIXEL_HEIGHT (f), pixelheight); if (width != FRAME_TEXT_WIDTH (f) || height != FRAME_TEXT_HEIGHT (f) @@ -1343,7 +1343,7 @@ xg_create_frame_widgets (struct frame *f) GtkWindowType type = GTK_WINDOW_TOPLEVEL; char *title = 0; - PGTK_TRACE("xg_create_frame_widgets."); + PGTK_TRACE ("xg_create_frame_widgets."); block_input (); #ifndef HAVE_PGTK // gtk_plug not found. @@ -1504,7 +1504,7 @@ xg_create_frame_widgets (struct frame *f) #else gtk_widget_set_can_focus (wfixed, TRUE); #ifdef HAVE_PGTK - gtk_widget_grab_focus(wfixed); + gtk_widget_grab_focus (wfixed); #endif gtk_window_set_resizable (GTK_WINDOW (wtop), TRUE); #endif @@ -1643,7 +1643,7 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position) base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 1) + FRAME_TOOLBAR_WIDTH (f); base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); - PGTK_TRACE("base: %dx%d\n", base_width, base_height); + PGTK_TRACE ("base: %dx%d\n", base_width, base_height); size_hints.base_width = base_width; size_hints.base_height = base_height; @@ -1771,7 +1771,7 @@ xg_frame_restack (struct frame *f1, struct frame *f2, bool above_flag) #ifndef HAVE_PGTK x_sync (f1); #else - gdk_flush(); + gdk_flush (); #endif } unblock_input (); @@ -4039,7 +4039,7 @@ xg_finish_scroll_bar_creation (struct frame *f, Emacs main window, which we draw over using Xlib. */ gtk_widget_realize (webox); #ifdef HAVE_PGTK - gtk_widget_show_all(webox); + gtk_widget_show_all (webox); #endif #ifndef HAVE_PGTK GTK_WIDGET_TO_X_WIN (webox); @@ -4049,11 +4049,15 @@ xg_finish_scroll_bar_creation (struct frame *f, xg_set_cursor (webox, FRAME_DISPLAY_INFO (f)->xg_cursor); #ifdef HAVE_PGTK - GtkStyleContext *ctxt = gtk_widget_get_style_context(wscroll); - gtk_style_context_add_provider(ctxt, GTK_STYLE_PROVIDER(FRAME_OUTPUT_DATA (f)->scrollbar_foreground_css_provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); - gtk_style_context_add_provider(ctxt, GTK_STYLE_PROVIDER(FRAME_OUTPUT_DATA (f)->scrollbar_background_css_provider), - GTK_STYLE_PROVIDER_PRIORITY_USER); + GtkStyleContext *ctxt = gtk_widget_get_style_context (wscroll); + gtk_style_context_add_provider (ctxt, + GTK_STYLE_PROVIDER (FRAME_OUTPUT_DATA (f)-> + scrollbar_foreground_css_provider), + GTK_STYLE_PROVIDER_PRIORITY_USER); + gtk_style_context_add_provider (ctxt, + GTK_STYLE_PROVIDER (FRAME_OUTPUT_DATA (f)-> + scrollbar_background_css_provider), + GTK_STYLE_PROVIDER_PRIORITY_USER); #endif bar->x_window = scroll_id; @@ -4212,7 +4216,7 @@ xg_update_scrollbar_pos (struct frame *f, /* Don't obscure any child frames. */ XLowerWindow (FRAME_X_DISPLAY (f), GTK_WIDGET_TO_X_WIN (webox)); #else - gdk_window_lower(gtk_widget_get_window(webox)); + gdk_window_lower (gtk_widget_get_window(webox)); #endif } @@ -4223,7 +4227,7 @@ xg_update_scrollbar_pos (struct frame *f, #ifndef HAVE_PGTK x_sync (f); #else - gdk_flush(); + gdk_flush (); #endif SET_FRAME_GARBAGED (f); cancel_mouse_face (f); @@ -4304,14 +4308,14 @@ xg_update_horizontal_scrollbar_pos (struct frame *f, /* Don't obscure any child frames. */ XLowerWindow (FRAME_X_DISPLAY (f), GTK_WIDGET_TO_X_WIN (webox)); #else - gdk_window_lower(gtk_widget_get_window(webox)); + gdk_window_lower (gtk_widget_get_window (webox)); #endif } #ifndef HAVE_PGTK x_sync (f); #else - gdk_flush(); + gdk_flush (); #endif SET_FRAME_GARBAGED (f); cancel_mouse_face (f); @@ -4341,8 +4345,8 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: ----------------------------------"); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: %p, %d, %d, %d.", bar, portion, position, whole); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: ----------------------------------"); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: %p, %d, %d, %d.", bar, portion, position, whole); if (wscroll && bar->dragging == -1) { GtkAdjustment *adj; @@ -4374,16 +4378,16 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, top = (gdouble) position / whole; shown = (gdouble) portion / whole; } - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: position=%d, portion=%d, whole=%d", position, portion, whole); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: top=%f, shown=%f", top, shown); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: position=%d, portion=%d, whole=%d", position, portion, whole); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: top=%f, shown=%f", top, shown); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: shown*range=%f", shown * XG_SB_RANGE); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: shown*range=%f", shown * XG_SB_RANGE); size = clip_to_bounds (1, shown * XG_SB_RANGE, XG_SB_RANGE); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: size=%d.", size); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: top*range=%f.", top * XG_SB_RANGE); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: max-size=%d.", XG_SB_MAX - size); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: size=%d.", size); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: top*range=%f.", top * XG_SB_RANGE); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: max-size=%d.", XG_SB_MAX - size); value = clip_to_bounds (XG_SB_MIN, top * XG_SB_RANGE, XG_SB_MAX - size); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: value=%d.", value); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: value=%d.", value); /* Assume all lines are of equal size. */ new_step = size / max (1, FRAME_LINES (f)); @@ -4393,7 +4397,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, if (old_size != size) { int old_step = gtk_adjustment_get_step_increment (adj); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: old_step=%d, new_step=%d", old_step, new_step); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: old_step=%d, new_step=%d", old_step, new_step); if (old_step != new_step) { gtk_adjustment_set_page_size (adj, size); @@ -4404,8 +4408,8 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, } } - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: changed=%d, old=%d, value=%d.", - changed, int_gtk_range_get_value (GTK_RANGE (wscroll)), value); + PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: changed=%d, old=%d, value=%d.", + changed, int_gtk_range_get_value (GTK_RANGE (wscroll)), value); if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value) { block_input (); @@ -4485,7 +4489,7 @@ xg_event_is_for_scrollbar (struct frame *f, const EVENT *event) #ifndef HAVE_PGTK GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); #else - GdkDisplay *gdpy = FRAME_X_DISPLAY(f); + GdkDisplay *gdpy = FRAME_X_DISPLAY (f); #endif GdkWindow *gwin; #ifdef HAVE_GTK3