From 9134fbccd359c823eec3aefc2a7927dab50481ef Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Mon, 10 Jun 2002 22:57:37 +0000 Subject: [PATCH] The preferences functionality is now in api/api.C. svn path=/trunk/boinc/; revision=109 --- lib/gfx_interface.C | 55 --------------------------------------------- lib/gfx_interface.h | 36 ----------------------------- 2 files changed, 91 deletions(-) delete mode 100644 lib/gfx_interface.C delete mode 100644 lib/gfx_interface.h diff --git a/lib/gfx_interface.C b/lib/gfx_interface.C deleted file mode 100644 index 0f5a6bc6d0..0000000000 --- a/lib/gfx_interface.C +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include -#include -#include "gfx_interface.h" -#include "parse.h" - -int GFX_INTERFACE::write_prefs(FILE *fout) { - fprintf( fout, - "\n" - " %d\n" - " %d\n" - " %d\n" - " %f\n" - " %d\n" - "", - width, height, depth, fps, shared_mem_key - ); - return 0; -} - -int GFX_INTERFACE::parse(FILE* fin) { - char buf[256]; - - fgets(buf, 256, fin); - if (!match_tag(buf, "")) { - fprintf(stderr, "GFX_INTERFACE::parse(): bad first tag %s\n", buf); - return -1; - } - - while(fgets(buf,256,fin)) { - if (match_tag(buf, "")) return 0; - else if (parse_int(buf, "", width)) continue; - else if (parse_int(buf, "", height)) continue; - else if (parse_int(buf, "", depth)) continue; - else if (parse_double(buf, "", fps)) continue; - else if (parse_int(buf, "", shared_mem_key)) continue; - else fprintf(stderr, "GFX_INTERFACE::parse(): unrecognized: %s\n", buf); - } - return -1; -} - -int GFX_INTERFACE::open_parse_prefs( void ) { - FILE *prefs; - int err; - - prefs = fopen( "prefs.xml", "r" ); - if( prefs == NULL ) - return -1; - - rewind( prefs ); - err = parse( prefs ); - fclose( prefs ); - - return err; -} diff --git a/lib/gfx_interface.h b/lib/gfx_interface.h deleted file mode 100644 index 9aec1088ce..0000000000 --- a/lib/gfx_interface.h +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include - -#define DRAW_OFFSCREEN 0x01 -#define DRAW_ONSCREEN 0x02 - -// Status flags -#define ERROR -1 -#define WAITING_FOR_APP 0 -#define APP_READY 1 -#define APP_REQUEST 2 -#define BUFFER_DIRTY 3 -#define BUFFER_CLEAN 4 - -#ifndef _GFX_INTERFACE -#define _GFX_INTERFACE - -struct GFX_INTERFACE { - int width, height; // in pixels - int depth; // in bits (8. 16, 24, etc) - double fps; // max frames per second to draw (can be < 1) - int draw_offscreen; // should we draw offscreen/onscreen/anything - int shared_mem_key; // key for graphics shared memory region - int offscreen_dirty; // is the offscreen buffer ready for blitting? - - int status; // status of graphics rendering (see flags above) - char *graphicsData; - int shared_mem_allocated; - - int write_prefs(FILE*); - int parse(FILE*); - int open_parse_prefs(); -}; - -#endif _GFX_INTERFACE