소스 검색

rm ununsed files

ithewei 5 년 전
부모
커밋
a969840bce
7개의 변경된 파일14개의 추가작업 그리고 256개의 파일을 삭제
  1. 7 10
      CMake/vars.cmake
  2. 7 10
      Makefile.vars
  3. 0 69
      base/hgui.h
  4. 0 99
      base/hobj.h
  5. 0 11
      base/hplatform.h
  6. 0 55
      base/hvar.h
  7. 0 2
      hv.h

+ 7 - 10
CMake/vars.cmake

@@ -4,27 +4,24 @@ set(BASE_HEADERS
     base/hplatform.h
     base/hdef.h
     base/hatomic.h
-    base/hversion.h
+    base/herr.h
+    base/htime.h
+    base/hmath.h
     base/hbase.h
+    base/hversion.h
     base/hsysinfo.h
     base/hproc.h
-    base/hmath.h
-    base/htime.h
-    base/herr.h
-    base/hlog.h
-    base/hmutex.h
     base/hthread.h
+    base/hmutex.h
     base/hsocket.h
     base/hssl.h
+    base/hlog.h
     base/hbuf.h
-    base/hurl.h
-    base/hgui.h
     base/hmap.h
     base/hstring.h
-    base/hvar.h
-    base/hobj.h
     base/hfile.h
     base/hdir.h
+    base/hurl.h
     base/hscope.h
     base/hthreadpool.h
     base/hobjectpool.h

+ 7 - 10
Makefile.vars

@@ -9,28 +9,25 @@ BASE_HEADERS =  base/hplatform.h\
 				\
 				base/hdef.h\
 				base/hatomic.h\
-				base/hversion.h\
+				base/herr.h\
+				base/htime.h\
+				base/hmath.h\
 				base/hbase.h\
+				base/hversion.h\
 				base/hsysinfo.h\
 				base/hproc.h\
-				base/hmath.h\
-				base/htime.h\
-				base/herr.h\
-				base/hlog.h\
-				base/hmutex.h\
 				base/hthread.h\
+				base/hmutex.h\
 				base/hsocket.h\
 				base/hssl.h\
+				base/hlog.h\
 				base/hbuf.h\
-				base/hurl.h\
-				base/hgui.h\
 				\
 				base/hmap.h\
 				base/hstring.h\
-				base/hvar.h\
-				base/hobj.h\
 				base/hfile.h\
 				base/hdir.h\
+				base/hurl.h\
 				base/hscope.h\
 				base/hthreadpool.h\
 				base/hobjectpool.h\

+ 0 - 69
base/hgui.h

@@ -1,69 +0,0 @@
-#ifndef HV_GUI_H_
-#define HV_GUI_H_
-
-typedef unsigned int HColor;  // 0xAARRGGBB
-
-#define CLR_B(c)    (c         & 0xff)
-#define CLR_G(c)    ((c >> 8)  & 0xff)
-#define CLR_R(c)    ((c >> 16) & 0xff)
-#define CLR_A(c)    ((c >> 24) & 0xff)
-#define ARGB(a, r, g, b) MAKE_FOURCC(a, r, g, b)
-
-typedef struct hpoint_s {
-    int x;
-    int y;
-
-#ifdef __cplusplus
-    hpoint_s() {
-        x = y = 0;
-    }
-
-    hpoint_s(int x, int y) {
-        this->x = x;
-        this->y = y;
-    }
-#endif
-} HPoint;
-
-typedef struct hsize_s {
-    int w;
-    int h;
-
-#ifdef __cplusplus
-    hsize_s() {
-        w = h = 0;
-    }
-
-    hsize_s(int w, int h) {
-        this->w = w;
-        this->h = h;
-    }
-#endif
-} HSize;
-
-typedef struct hrect_s {
-    int x;
-    int y;
-    int w;
-    int h;
-
-#ifdef __cplusplus
-    hrect_s() {
-        x = y = w = h = 0;
-    }
-
-    hrect_s(int x, int y, int w, int h) {
-        this->x = x;
-        this->y = y;
-        this->w = w;
-        this->h = h;
-    }
-
-    int left()     {return x;}
-    int right()    {return x+w;}
-    int top()      {return y;}
-    int bottom()   {return y+h;}
-#endif
-} HRect;
-
-#endif // HV_GUI_H_

+ 0 - 99
base/hobj.h

@@ -1,99 +0,0 @@
-#ifndef HV_OBJ_H_
-#define HV_OBJ_H_
-
-#include <string>
-#include <map>
-#include <list>
-
-#include "hvar.h"
-
-typedef int (*HMethod)(void* userdata);
-
-class HObj {
-public:
-    HObj(HObj* parent = NULL) {
-        this->parent = parent;
-    }
-
-    virtual ~HObj() {
-        deleteAllChild();
-    }
-
-    void setName(char* name) {
-        this->name = name;
-    }
-
-    void setParent(HObj* parent) {
-        this->parent = parent;
-    }
-
-    bool addChild(HObj* child) {
-        children.push_back(child);
-        return true;
-    }
-
-    bool removeChild(HObj* child) {
-        auto iter = children.begin();
-        while (iter != children.end()) {
-            if (*iter == child) {
-                iter = children.erase(iter);
-                return true;
-            }
-            ++iter;
-        }
-        return false;
-    }
-
-    void deleteAllChild() {
-        auto iter = children.begin();
-        while (iter != children.end()) {
-            if (*iter) {
-                delete (*iter);
-            }
-            ++iter;
-        }
-        children.clear();
-    }
-
-    HObj* findChild(std::string name) {
-        for (auto iter = children.begin(); iter != children.end(); ++iter) {
-            if ((*iter)->name == name) {
-                return *iter;
-            }
-        }
-        return NULL;
-    }
-
-    HVar property(std::string key) {
-        auto iter = properties.find(key);
-        if (iter != properties.end()) {
-            return iter->second;
-        }
-        return HVar();
-    }
-
-    void setProperty(std::string key, HVar value) {
-        properties[key] = value;
-    }
-
-    HMethod method(std::string key) {
-        auto iter = methods.find(key);
-        if (iter != methods.end())
-            return iter->second;
-        return NULL;
-    }
-
-    void setMethod(std::string key, HMethod method) {
-        methods[key] = method;
-    }
-
-public:
-    HObj*               parent;
-    std::list<HObj*>    children;
-
-    std::string                     name;
-    std::map<std::string, HVar>     properties;
-    std::map<std::string, HMethod>  methods;
-};
-
-#endif // HV_OBJ_H_

+ 0 - 11
base/hplatform.h

@@ -255,17 +255,6 @@ typedef unsigned __int64    uint64_t;
 typedef float               float32_t;
 typedef double              float64_t;
 
-// sizeof(var) = 8
-typedef union {
-    bool        b;
-    char        ch;
-    char*       str;
-    long long   num;
-    float       f;
-    double      lf;
-    void*       ptr;
-} var;
-
 typedef int (*method_t)(void* userdata);
 typedef void (*procedure_t)(void* userdata);
 

+ 0 - 55
base/hvar.h

@@ -1,55 +0,0 @@
-#ifndef HV_VAR_H_
-#define HV_VAR_H_
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-class HVar {
-public:
-    enum Type {
-        UNKNOWN,
-        BOOLEAN,
-        INTEGER,
-        FLOAT,
-        STRING,
-        POINTER
-    } type;
-
-    union Data {
-        bool        b;
-        int64_t     i;
-        double      f;
-        char*       str;
-        void*       ptr;
-    } data;
-
-    HVar()          {memset(&data, 0, sizeof(data)); type = UNKNOWN;}
-    HVar(bool b)    {data.b = b; type = BOOLEAN;}
-    HVar(int64_t i) {data.i = i; type = INTEGER;}
-    HVar(double f)  {data.f = f; type = FLOAT;}
-    HVar(char* str) {
-        data.str = (char*)malloc(strlen(str)+1);
-        strcpy(data.str, str);
-        type = STRING;
-    }
-    HVar(void* ptr) {data.ptr = ptr; type = POINTER;}
-
-    ~HVar() {
-        if (type == STRING && data.str) {
-            free(data.str);
-            data.str = NULL;
-        }
-    }
-
-    bool    isNull()    {return type == UNKNOWN;}
-    bool    isValid()   {return type != UNKNOWN;}
-
-    bool    toBool()    {return data.b;}
-    int64_t toInt()     {return data.i;}
-    double  toFloat()   {return data.f;}
-    char*   toString()  {return data.str;}
-    void*   toPointer() {return data.ptr;}
-};
-
-#endif // HV_VAR_H_

+ 0 - 2
hv.h

@@ -33,8 +33,6 @@
 #ifdef __cplusplus
 #include "hmap.h"       // <map>
 #include "hstring.h"    // <string>
-#include "hvar.h"
-#include "hobj.h"
 #include "hfile.h"
 #include "hdir.h"
 #include "hurl.h"