浏览代码

libdriver: doxygen documentation updated
variable `name` added to `driver` data structure


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46978 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 14 年之前
父节点
当前提交
56e90d28a5
共有 3 个文件被更改,包括 56 次插入15 次删除
  1. 2 0
      lib/driver/driver.h
  2. 18 14
      lib/driver/init.c
  3. 36 1
      lib/driver/parse_ftcap.c

+ 2 - 0
lib/driver/driver.h

@@ -21,6 +21,8 @@ extern struct GFONT_CAP *ftcap;
 
 struct driver
 {
+    char *name;
+    
     void (*Box)(double, double, double, double);
     void (*Erase)(void);
     int (*Graph_set)(void);

+ 18 - 14
lib/driver/init.c

@@ -1,17 +1,17 @@
+/*!
+  \file lib/driver/init.c
+
+  \brief Display Driver - initialization
+
+  (C) 2006-2011 by the GRASS Development Team
+
+  This program is free software under the GNU General Public License
+  (>=v2). Read the file COPYING that comes with GRASS for details.
+
+  \author Glynn Clements <glynn gclements.plus.com> (original contributor)
+  \author Huidae Cho <grass4u gmail.com>
+*/
 
-/****************************************************************************
- *
- * MODULE:       driver
- * AUTHOR(S):    Glynn Clements <glynn gclements.plus.com> (original contributor)
- *               Huidae Cho <grass4u gmail.com>
- * PURPOSE:      
- * COPYRIGHT:    (C) 2006-2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- *****************************************************************************/
 #include <grass/config.h>
 
 #include <stdio.h>
@@ -39,6 +39,11 @@ double text_sinrot;
 double text_cosrot;
 int matrix_valid;
 
+/*!
+  \brief Initialize display driver
+
+  \param pointer to driver structure
+*/
 void LIB_init(const struct driver *drv)
 {
     const char *p;
@@ -47,7 +52,6 @@ void LIB_init(const struct driver *drv)
     ftcap = parse_fontcap();
 
     /* initialize graphics */
-
     p = getenv("GRASS_WIDTH");
     screen_width = (p && atoi(p)) ? atoi(p) : DEF_WIDTH;
 

+ 36 - 1
lib/driver/parse_ftcap.c

@@ -1,3 +1,17 @@
+/*!
+  \file lib/driver/parse_ftcap.c
+
+  \brief Display Driver - fontcaps
+
+  (C) 2006-2011 by the GRASS Development Team
+
+  This program is free software under the GNU General Public License
+  (>=v2). Read the file COPYING that comes with GRASS for details.
+
+  \author Glynn Clements <glynn gclements.plus.com> (original contributor)
+  \author Huidae Cho <grass4u gmail.com>
+*/
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -7,11 +21,23 @@
 #include <grass/fontcap.h>
 #include "driverlib.h"
 
+/*!
+  \brief Check if font exists
+*/
 int font_exists(const char *name)
 {
     return access(name, R_OK) >= 0;
 }
 
+/*!
+  \brief Parse fontcap entry
+
+  \param e pointer to GFONT_CAP struct
+  \param str ?
+
+  \return 1 on success
+  \return 0 on failure
+*/
 int parse_fontcap_entry(struct GFONT_CAP *e, const char *str)
 {
     char name[GNAME_MAX], longname[GNAME_MAX], path[GPATH_MAX], encoding[128];
@@ -39,6 +65,11 @@ int parse_fontcap_entry(struct GFONT_CAP *e, const char *str)
     return 1;
 }
 
+/*!
+  \brief Parse fontcaps
+
+  \return pointer to GFONT_CAP structure
+*/
 struct GFONT_CAP *parse_fontcap(void)
 {
     char *capfile, file[GPATH_MAX];
@@ -85,6 +116,11 @@ struct GFONT_CAP *parse_fontcap(void)
     return fonts;
 }
 
+/*!
+  \brief Free allocated GFONT_CAP structure
+
+  \param fpcap pointer to GFONT_CAP to be freed
+*/
 void free_fontcap(struct GFONT_CAP *ftcap)
 {
     int i;
@@ -101,4 +137,3 @@ void free_fontcap(struct GFONT_CAP *ftcap)
 
     G_free(ftcap);
 }
-