From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UViIW-0008Ni-Pk for mharc-grub-devel@gnu.org; Fri, 26 Apr 2013 09:02:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UViIT-0008K1-VY for grub-devel@gnu.org; Fri, 26 Apr 2013 09:02:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UViIO-0004BX-GL for grub-devel@gnu.org; Fri, 26 Apr 2013 09:02:41 -0400 Received: from collab.rosalab.ru ([217.199.216.181]:56439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UViIO-00049U-0j for grub-devel@gnu.org; Fri, 26 Apr 2013 09:02:36 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by collab.rosalab.ru (Postfix) with ESMTP id 3885629C2D8 for ; Fri, 26 Apr 2013 17:02:33 +0400 (MSK) X-Virus-Scanned: amavisd-new at rosalab.ru Received: from collab.rosalab.ru ([127.0.0.1]) by localhost (collab.rosalab.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G6JXTqdK8YV3 for ; Fri, 26 Apr 2013 17:02:26 +0400 (MSK) Received: from icedphoenix.localnet (unknown [10.168.1.56]) by collab.rosalab.ru (Postfix) with ESMTPSA id C47E429C25F for ; Fri, 26 Apr 2013 17:02:26 +0400 (MSK) From: Vladimir Testov To: grub-devel@gnu.org Subject: [RFC][PATCH] [1/2] remove outdated code Date: Fri, 26 Apr 2013 17:02:26 +0400 Message-ID: <5448241.n3eBNpiEnS@icedphoenix> User-Agent: KMail/4.10.2 (Linux/3.8.0-19-generic; KDE/4.10.2; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1531162.LeoTrbjnYu" Content-Transfer-Encoding: 7Bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 217.199.216.181 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Apr 2013 13:02:43 -0000 This is a multi-part message in MIME format. --nextPart1531162.LeoTrbjnYu Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi folks, There is some oudated and unused code. I suggest we should remove it. -- With best regards, _______________________________ Vladimir Testov, ROSA Laboratory. www.rosalab.ru --nextPart1531162.LeoTrbjnYu Content-Disposition: attachment; filename="grub-remove-outdated-code.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="grub-remove-outdated-code.patch" diff -Naur grub-new3/docs/grub.texi grub-new4/docs/grub.texi --- grub-new3/docs/grub.texi 2013-04-19 03:55:05.000000000 +0400 +++ grub-new4/docs/grub.texi 2013-04-26 11:58:20.041859276 +0400 @@ -1898,9 +1898,6 @@ @item title-text @tab Specifies the text to display at the top center of the screen as a title. @item title-font @tab Defines the font used for the title message at the top of the screen. @item title-color @tab Defines the color of the title message. -@item message-font @tab Defines the font used for messages, such as when GRUB is unable to automatically boot an entry. -@item message-color @tab Defines the color of the message text. -@item message-bg-color @tab Defines the background color of the message text area. @item desktop-image @tab Specifies the image to use as the background. It will be scaled to fit the screen size. @item desktop-color @tab Specifies the color for the background if *desktop-image* is not specified. @item terminal-box @tab Specifies the file name pattern for the styled box slices used for the command line terminal window. For example, ``terminal-box: terminal_*.png'' will use the images ``terminal_c.png`` as the center area, ``terminal_n.png`` as the north (top) edge, ``terminal_nw.png`` as the northwest (upper left) corner, and so on. If the image for any slice is not found, it will simply be left empty. diff -Naur grub-new3/grub-core/gfxmenu/theme_loader.c grub-new4/grub-core/gfxmenu/theme_loader.c --- grub-new3/grub-core/gfxmenu/theme_loader.c 2013-02-25 16:54:27.000000000 +0400 +++ grub-new4/grub-core/gfxmenu/theme_loader.c 2013-04-24 12:50:05.143117525 +0400 @@ -126,7 +126,7 @@ if (! grub_strcmp ("title-font", name)) view->title_font = grub_font_get (value); else if (! grub_strcmp ("message-font", name)) - view->message_font = grub_font_get (value); + return GRUB_ERR_NONE; else if (! grub_strcmp ("terminal-font", name)) { grub_free (view->terminal_font_name); @@ -137,9 +137,9 @@ else if (! grub_strcmp ("title-color", name)) grub_video_parse_color (value, &view->title_color); else if (! grub_strcmp ("message-color", name)) - grub_video_parse_color (value, &view->message_color); + return GRUB_ERR_NONE; else if (! grub_strcmp ("message-bg-color", name)) - grub_video_parse_color (value, &view->message_bg_color); + return GRUB_ERR_NONE; else if (! grub_strcmp ("desktop-image", name)) { struct grub_video_bitmap *raw_bitmap; diff -Naur grub-new3/grub-core/gfxmenu/view.c grub-new4/grub-core/gfxmenu/view.c --- grub-new3/grub-core/gfxmenu/view.c 2013-04-08 13:00:36.000000000 +0400 +++ grub-new4/grub-core/gfxmenu/view.c 2013-04-24 12:34:44.999051941 +0400 @@ -70,26 +70,14 @@ view->canvas = 0; view->title_font = default_font; - view->message_font = default_font; view->terminal_font_name = grub_strdup ("Fixed 10"); view->title_color = default_fg_color; - view->message_color = default_bg_color; - view->message_bg_color = default_fg_color; view->desktop_image = 0; view->desktop_color = default_bg_color; view->terminal_box = grub_gfxmenu_create_box (0, 0); view->title_text = grub_strdup (_("GRUB Boot Menu")); - view->progress_message_text = 0; view->theme_path = 0; - /* Set the timeout bar's frame. */ - view->progress_message_frame.width = view->screen.width * 4 / 5; - view->progress_message_frame.height = 50; - view->progress_message_frame.x = view->screen.x - + (view->screen.width - view->progress_message_frame.width) / 2; - view->progress_message_frame.y = view->screen.y - + view->screen.height - 90 - 20 - view->progress_message_frame.height; - if (grub_gfxmenu_view_load_theme (view, theme_path) != 0) { grub_gfxmenu_view_destroy (view); @@ -110,7 +98,6 @@ view->terminal_box->destroy (view->terminal_box); grub_free (view->terminal_font_name); grub_free (view->title_text); - grub_free (view->progress_message_text); grub_free (view->theme_path); if (view->canvas) view->canvas->component.ops->destroy (view->canvas); @@ -155,14 +142,6 @@ x, y); } -struct progress_value_data -{ - int visible; - int start; - int end; - int value; -}; - struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications; static void @@ -236,32 +215,6 @@ update_menu_visit, view); } -static void -draw_message (grub_gfxmenu_view_t view) -{ - char *text = view->progress_message_text; - grub_video_rect_t f = view->progress_message_frame; - if (! text) - return; - - grub_font_t font = view->message_font; - grub_video_color_t color = grub_video_map_rgba_color (view->message_color); - - /* Border. */ - grub_video_fill_rect (color, - f.x-1, f.y-1, f.width+2, f.height+2); - /* Fill. */ - grub_video_fill_rect (grub_video_map_rgba_color (view->message_bg_color), - f.x, f.y, f.width, f.height); - - /* Center the text. */ - int text_width = grub_font_get_string_width (font, text); - int x = f.x + (f.width - text_width) / 2; - int y = (f.y + (f.height - grub_font_get_descent (font)) / 2 - + grub_font_get_ascent (font) / 2); - grub_font_draw_string (text, font, color, x, y); -} - void grub_gfxmenu_view_redraw (grub_gfxmenu_view_t view, const grub_video_rect_t *region) @@ -275,8 +228,6 @@ if (view->canvas) view->canvas->component.ops->paint (view->canvas, region); draw_title (view); - if (grub_video_have_common_points (&view->progress_message_frame, region)) - draw_message (view); } void @@ -410,70 +361,3 @@ border_width); grub_gfxterm_decorator_hook = grub_gfxmenu_draw_terminal_box; } - -/* FIXME: previously notifications were displayed in special case. - Is it necessary? - */ -#if 0 -/* Sets MESSAGE as the progress message for the view. - MESSAGE can be 0, in which case no message is displayed. */ -static void -set_progress_message (grub_gfxmenu_view_t view, const char *message) -{ - grub_free (view->progress_message_text); - if (message) - view->progress_message_text = grub_strdup (message); - else - view->progress_message_text = 0; -} - -static void -notify_booting (grub_menu_entry_t entry, void *userdata) -{ - grub_gfxmenu_view_t view = (grub_gfxmenu_view_t) userdata; - - char *s = grub_malloc (100 + grub_strlen (entry->title)); - if (!s) - return; - - grub_sprintf (s, "Booting '%s'", entry->title); - set_progress_message (view, s); - grub_free (s); - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); - grub_video_swap_buffers (); - if (view->double_repaint) - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); -} - -static void -notify_fallback (grub_menu_entry_t entry, void *userdata) -{ - grub_gfxmenu_view_t view = (grub_gfxmenu_view_t) userdata; - - char *s = grub_malloc (100 + grub_strlen (entry->title)); - if (!s) - return; - - grub_sprintf (s, "Falling back to '%s'", entry->title); - set_progress_message (view, s); - grub_free (s); - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); - grub_video_swap_buffers (); - if (view->double_repaint) - grub_gfxmenu_view_redraw (view, &view->progress_message_frame); -} - -static void -notify_execution_failure (void *userdata __attribute__ ((unused))) -{ -} - - -static struct grub_menu_execute_callback execute_callback = -{ - .notify_booting = notify_booting, - .notify_fallback = notify_fallback, - .notify_failure = notify_execution_failure -}; - -#endif diff -Naur grub-new3/include/grub/gfxmenu_view.h grub-new4/include/grub/gfxmenu_view.h --- grub-new3/include/grub/gfxmenu_view.h 2013-04-19 04:01:17.926936694 +0400 +++ grub-new4/include/grub/gfxmenu_view.h 2013-04-24 12:29:40.203816750 +0400 @@ -91,16 +91,12 @@ grub_video_rect_t screen; grub_font_t title_font; - grub_font_t message_font; char *terminal_font_name; grub_video_rgba_color_t title_color; - grub_video_rgba_color_t message_color; - grub_video_rgba_color_t message_bg_color; struct grub_video_bitmap *desktop_image; grub_video_rgba_color_t desktop_color; grub_gfxmenu_box_t terminal_box; char *title_text; - char *progress_message_text; char *theme_path; grub_gui_container_t canvas; @@ -109,8 +105,6 @@ int selected; - grub_video_rect_t progress_message_frame; - grub_menu_t menu; int nested; --nextPart1531162.LeoTrbjnYu--