Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backend/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "linux_input.h"
#include "linux_vt.h"
#include "twin_backend.h"
#include "twin_private.h"

#define FBDEV_NAME "FRAMEBUFFER"
Expand Down
2 changes: 1 addition & 1 deletion backend/sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <stdio.h>
#include <twin.h>

#include "twin_backend.h"
#include "twin_private.h"

typedef struct {
SDL_Window *win;
Expand Down
1 change: 0 additions & 1 deletion backend/vnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ All rights reserved.
#include <string.h>
#include <twin.h>

#include "twin_backend.h"
#include "twin_private.h"

#define SCREEN(x) ((twin_context_t *) x)->screen
Expand Down
2 changes: 1 addition & 1 deletion src/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <assert.h>
#include <twin.h>

#include "twin_backend.h"
#include "twin_private.h"

/* FIXME: Refine API design */

Expand Down
1 change: 0 additions & 1 deletion src/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <unistd.h>

#include "twin_backend.h"
#include "twin_private.h"

extern twin_backend_t g_twin_backend;
Expand Down
28 changes: 0 additions & 28 deletions src/twin_backend.h

This file was deleted.

17 changes: 16 additions & 1 deletion include/twin_private.h → src/twin_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef _TWIN_PRIVATE_H_
#define _TWIN_PRIVATE_H_

#include <stdbool.h>
#include <stdio.h>
#include <string.h>

Expand All @@ -16,7 +17,7 @@
/* FIXME: Both twin_private.h and log.h are private header files. They should
* be moved to src/ directory.
*/
#include "../src/log.h"
#include "log.h"

/* Boilerplate for compiler compatibility */
#ifndef __has_attribute
Expand Down Expand Up @@ -631,6 +632,20 @@ void _twin_button_init(twin_button_t *button,
twin_style_t font_style,
twin_dispatch_proc_t dispatch);

typedef struct twin_backend {
/* Initialize the backend */
twin_context_t *(*init)(int width, int height);

/* Configure the device */
/* FIXME: Refine the parameter list */
void (*configure)(twin_context_t *ctx);

bool (*poll)(twin_context_t *ctx);

/* Device cleanup when drawing is done */
void (*exit)(twin_context_t *ctx);
} twin_backend_t;

/*
* Visual effect stuff
*/
Expand Down