shl: move log.[ch] to shl_log.[ch]
[platform/upstream/kmscon.git] / src / text_bbulk.c
index 6684ab6..3f238c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * kmscon - Bit-Blitting Bulk Text Renderer Backend
  *
- * Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
+ * Copyright (c) 2012-2013 David Herrmann <dh.herrmann@googlemail.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files
@@ -36,9 +36,9 @@
 #include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
-#include "log.h"
+#include "shl_log.h"
 #include "text.h"
-#include "uterm.h"
+#include "uterm_video.h"
 
 #define LOG_SUBSYSTEM "text_bbulk"
 
@@ -112,6 +112,7 @@ static void bbulk_unset(struct kmscon_text *txt)
 
 static int bbulk_draw(struct kmscon_text *txt,
                      uint32_t id, const uint32_t *ch, size_t len,
+                     unsigned int width,
                      unsigned int posx, unsigned int posy,
                      const struct tsm_screen_attr *attr)
 {
@@ -121,6 +122,11 @@ static int bbulk_draw(struct kmscon_text *txt,
        struct uterm_video_blend_req *req;
        struct kmscon_font *font;
 
+       if (!width) {
+               bb->reqs[posy * txt->cols + posx].buf = NULL;
+               return 0;
+       }
+
        if (attr->bold)
                font = txt->bold_font;
        else
@@ -167,8 +173,9 @@ static int bbulk_render(struct kmscon_text *txt)
                                         txt->cols * txt->rows);
 }
 
-static const struct kmscon_text_ops kmscon_text_bbulk_ops = {
+struct kmscon_text_ops kmscon_text_bbulk_ops = {
        .name = "bbulk",
+       .owner = NULL,
        .init = bbulk_init,
        .destroy = bbulk_destroy,
        .set = bbulk_set,
@@ -178,21 +185,3 @@ static const struct kmscon_text_ops kmscon_text_bbulk_ops = {
        .render = bbulk_render,
        .abort = NULL,
 };
-
-int kmscon_text_bbulk_load(void)
-{
-       int ret;
-
-       ret = kmscon_text_register(&kmscon_text_bbulk_ops);
-       if (ret) {
-               log_error("cannot register bbulk renderer");
-               return ret;
-       }
-
-       return 0;
-}
-
-void kmscon_text_bbulk_unload(void)
-{
-       kmscon_text_unregister(kmscon_text_bbulk_ops.name);
-}