terminal: add API to remove displays
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 21 Jul 2012 13:44:41 +0000 (15:44 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 21 Jul 2012 13:44:41 +0000 (15:44 +0200)
This new function allows external subsystems to remove displays from the
terminal objects. It is required to make the terminal subsystem
independent of the uterm-video subsystem to allow different displays from
different video-objects to be part of a terminal.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/terminal.c
src/terminal.h

index 9b8f345..4ebd6f1 100644 (file)
@@ -417,3 +417,12 @@ int kmscon_terminal_add_display(struct kmscon_terminal *term,
 
        return add_display(term, disp);
 }
+
+void kmscon_terminal_remove_display(struct kmscon_terminal *term,
+                                   struct uterm_display *disp)
+{
+       if (!term || !disp)
+               return;
+
+       rm_display(term, disp);
+}
index 8ce0ea4..716b0e4 100644 (file)
@@ -64,5 +64,7 @@ void kmscon_terminal_close(struct kmscon_terminal *term);
 
 int kmscon_terminal_add_display(struct kmscon_terminal *term,
                                struct uterm_display *disp);
+void kmscon_terminal_remove_display(struct kmscon_terminal *term,
+                                   struct uterm_display *disp);
 
 #endif /* KMSCON_TERMINAL_H */