summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build2
-rw-r--r--sdl2.c88
-rw-r--r--xmpp.c54
3 files changed, 0 insertions, 144 deletions
diff --git a/meson.build b/meson.build
index 8a21907..2154edf 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,4 @@
project('LimoX', 'c')
gtkdep = dependency('gtk4')
strophedep = dependency('libstrophe')
-sdl2dep = dependency('sdl2')
executable('limox', ['main.c', 'gtk.c', 'strophe.c', 'data.c'], dependencies : [gtkdep, strophedep])
-executable('limox_sdl2', ['main.c', 'sdl2.c', 'xmpp.c', 'data.c'], dependencies : [sdl2dep])
diff --git a/sdl2.c b/sdl2.c
deleted file mode 100644
index e034446..0000000
--- a/sdl2.c
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-/* mention the SDL2 documentation at http://wiki.libsdl.org/APIByCategory */
-
-
-#include <SDL2/SDL.h>
-#include <stdbool.h>
-
-#include "net.h"
-#include "data.h"
-
-
-void gui_run(void) {
-
- bool quit = false;
- SDL_Event event;
- SDL_Window* window;
- SDL_Renderer* renderer;
- SDL_Texture* texture;
- uint32_t* pixels;
-
- // init SDL2 and create window
- SDL_Init(SDL_INIT_VIDEO);
- window = SDL_CreateWindow("LimoX",
- SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480,
- 0
- );
-
- // output video driver to stderr
- fprintf(stderr, "SDL2 video driver: %s\n", SDL_GetCurrentVideoDriver());
-
- // create and initialize renderer, texture and pixel buffer
- renderer = SDL_CreateRenderer(window, -1, 0);
- texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888,
- SDL_TEXTUREACCESS_STATIC, 640, 480);
- pixels = malloc(sizeof(uint32_t) * 640 * 480);
- memset(pixels, 255, 640 * 480 * sizeof(uint32_t));
-
- // handle failed window creation
- if (window == NULL) {
- fprintf(stderr, "Failed to create SDL2 window!\n");
- return;
- } else {
- while (!quit) {
- SDL_UpdateTexture(texture, NULL, pixels, 640 * sizeof(uint32_t));
- SDL_WaitEvent(&event);
- switch (event.type)
- {
- case SDL_QUIT:
- quit = true;
- break;
- }
- SDL_RenderClear(renderer);
- SDL_RenderCopy(renderer, texture, NULL, NULL);
- SDL_RenderPresent(renderer);
- }
- SDL_DestroyWindow(window);
- }
-
- free(pixels);
-
- // TODO this seems to end in memory access errors but ... why?
- //SDL_DestroyTexture(texture);
- //SDL_DestroyRenderer(renderer);
-
- SDL_Quit();
-
-}
-
-void gui_connected(char* jid, char* password) {
-
-}
-
-void gui_disconnected(void) {
-
-}
-
-void gui_add_roster_item_widget(roster_item_t* item) {
-
-}
-
-void gui_add_chat_widget(chat_t* chat) {
-
-}
-
-void gui_add_message_widget(message_t* message, chat_t* chat) {
-
-}
diff --git a/xmpp.c b/xmpp.c
deleted file mode 100644
index 865b235..0000000
--- a/xmpp.c
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-
-/*
- * Get the domainpart of the Jabber ID (JID).
- * See https://datatracker.ietf.org/doc/html/rfc7622#section-3.2 for details.
- */
-char *domainpart(char *jid)
-{
- int start = 0; // inclusive
- int stop = strlen(jid); // exclusive
-
- for(int i=0; i<strlen(jid); i++) {
- if (jid[i] == '/') {
- stop = i;
- break;
- }
- }
-
- for(int i=0; i<strlen(jid); i++) {
- if (jid[i] == '@') {
- start = i + 1;
- break;
- }
- }
-
- char* retval = (char *)malloc((stop-start+1) * sizeof(char));
- memcpy(retval, jid+start, (stop-start)*sizeof(char));
- retval[stop] = '\0';
-
- return retval;
-}
-
-void net_init(void)
-{
- printf("net_init()\n");
-
- char* user_str = getenv("LIMOX_USER");
- char* pwd_str = getenv("LIMOX_PWD");
- char *domain = domainpart(user_str);
- printf("Trying to connect as '%s' with '%s'.\n", user_str, pwd_str);
- printf("Domainpart is '%s'.\n", domain);
-}
-
-void net_quit(void)
-{
- printf("net_quit()\n");
-}