]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Add new hooks for clearing and drawing parts of the screen
authorRay Strode <rstrode@redhat.com>
Wed, 16 Jul 2008 15:46:26 +0000 (11:46 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 29 Jul 2008 19:15:51 +0000 (15:15 -0400)
We now have a few controls in libplybootsplash that don't
don't the specific details of the loaded splash plugins
background.  These hooks will make it possible for the
controls to clear the screen prior to doing alpha composition.

src/libplybootsplash/ply-window.c
src/libplybootsplash/ply-window.h

index d7182037f227761f4b92714cf124fd88eccb723f..7f46c5afb589c3a9b9c62d43f82c4e369ce00ff3 100644 (file)
@@ -125,6 +125,12 @@ struct _ply_window
 
   ply_window_enter_handler_t enter_handler;
   void *enter_handler_user_data;
+
+  ply_window_draw_handler_t draw_handler;
+  void *draw_handler_user_data;
+
+  ply_window_erase_handler_t erase_handler;
+  void *erase_handler_user_data;
 };
 
 ply_window_t *
@@ -594,6 +600,30 @@ ply_window_get_foreground_color (ply_window_t *window)
   return window->foreground_color;
 }
 
+void
+ply_window_draw_area (ply_window_t *window,
+                      int           x,
+                      int           y,
+                      int           width,
+                      int           height)
+{
+  if (window->draw_handler != NULL)
+    window->draw_handler (window->draw_handler_user_data,
+                          x, y, width, height);
+}
+
+void
+ply_window_erase_area (ply_window_t *window,
+                       int           x,
+                       int           y,
+                       int           width,
+                       int           height)
+{
+  if (window->erase_handler != NULL)
+    window->erase_handler (window->erase_handler_user_data,
+                           x, y, width, height);
+}
+
 uint32_t
 ply_window_get_color_hex_value (ply_window_t       *window,
                                 ply_window_color_t  color)
@@ -720,6 +750,28 @@ ply_window_set_enter_handler (ply_window_t *window,
   window->enter_handler_user_data = user_data;
 }
 
+void
+ply_window_set_draw_handler (ply_window_t *window,
+                             ply_window_draw_handler_t draw_handler,
+                             void         *user_data)
+{
+  assert (window != NULL);
+
+  window->draw_handler = draw_handler;
+  window->draw_handler_user_data = user_data;
+}
+
+void
+ply_window_set_erase_handler (ply_window_t *window,
+                              ply_window_erase_handler_t erase_handler,
+                              void         *user_data)
+{
+  assert (window != NULL);
+
+  window->erase_handler = erase_handler;
+  window->erase_handler_user_data = user_data;
+}
+
 void
 ply_window_attach_to_event_loop (ply_window_t     *window,
                                  ply_event_loop_t *loop)
index a79d99b76ae993ae4ecc40012d7c98d75be37fb4..9ec719dddf06369fcc55c4828739fb23ee517811 100644 (file)
@@ -42,6 +42,17 @@ typedef void (* ply_window_escape_handler_t) (void *user_data);
 typedef void (* ply_window_enter_handler_t) (void *user_data,
                                              const char *line);
 
+typedef void (* ply_window_draw_handler_t) (void *user_data,
+                                            int   x,
+                                            int   y,
+                                            int   width,
+                                            int   height);
+typedef void (* ply_window_erase_handler_t) (void *user_data,
+                                             int   x,
+                                             int   y,
+                                             int   width,
+                                             int   height);
+
 typedef enum
 {
   PLY_WINDOW_MODE_TEXT,
@@ -77,6 +88,12 @@ void ply_window_set_escape_handler (ply_window_t *window,
 void ply_window_set_enter_handler (ply_window_t *window,
                                    ply_window_enter_handler_t enter_handler,
                                    void         *user_data);
+void ply_window_set_draw_handler (ply_window_t *window,
+                                  ply_window_draw_handler_t draw_handler,
+                                  void         *user_data);
+void ply_window_set_erase_handler (ply_window_t *window,
+                                   ply_window_erase_handler_t erase_handler,
+                                   void         *user_data);
 
 bool ply_window_open (ply_window_t *window);
 bool ply_window_take_console (ply_window_t *window);
@@ -100,6 +117,18 @@ void ply_window_set_foreground_color (ply_window_t       *window,
 ply_window_color_t ply_window_get_background_color (ply_window_t *window);
 ply_window_color_t ply_window_get_foreground_color (ply_window_t *window);
 
+void ply_window_draw_area (ply_window_t *window,
+                           int           x,
+                           int           y,
+                           int           width,
+                           int           height);
+
+void ply_window_erase_area (ply_window_t *window,
+                            int           x,
+                            int           y,
+                            int           width,
+                            int           height);
+
 uint32_t ply_window_get_color_hex_value (ply_window_t       *window,
                                          ply_window_color_t  color);
 void ply_window_set_color_hex_value (ply_window_t       *window,