[gqq] Re: [gqq] 再次切换回gtkmm2.4

  • From: Eros <authurg@xxxxxxxxx>
  • To: gqq@xxxxxxxxxxxxx
  • Date: Tue, 4 Jan 2011 11:30:58 +0800

还是我的废话一大堆~~~ 见谅 ^_^

不如整体包含在一个命名空间里面吧 GNOME_QQ?

文件加上前缀 gqq_ 类加上前缀GQQ_ 全局变量也加上前缀 gqq_

还有 把debug 宏和函数 独立出来吧~~ 这样debug的功能更加独立一点

同时 global 里面是全局变量定义

类型定义的话 这个我有一个疑问 gtkmm的变量类型不是与 gtk一样的么?

如果重新定义的话 还是要加上前缀 和 放在命名空间里面比较好吧

#ifndef _OL_DEBUG_H_
#define _OL_DEBUG_H_

#include <stdio.h>

enum OlDebugLevel {
  OL_LOG_NONE = -1,
  OL_ERROR = 0,
  OL_DEBUG = 1,
  OL_INFO = 2,
  OL_N_LEVELS,
};

#define ol_logf(level, ...)           do {ol_log_printf (level,        \
                                                         __FILE__,     \
                                                         __LINE__,     \
                                                         __FUNCTION__, \
                                                         __VA_ARGS__); }
while (0)
#define ol_log_func()                 do {ol_logf (OL_INFO, "%s\n",
__FUNCTION__); } while (0)
#define ol_debugf(...)                do {ol_logf (OL_DEBUG, __VA_ARGS__); }
while (0)
#define ol_debug(...)                 do {ol_logf (OL_DEBUG, "%s\n",
__VA_ARGS__); } while (0)
#define ol_errorf(...)                do {ol_logf (OL_ERROR, __VA_ARGS__); }
while (0)
#define ol_error(...)                 do {ol_logf (OL_ERROR, "%s\n",
__VA_ARGS__); } while (0)
#define ol_infof(...)                 do {ol_logf (OL_INFO, __VA_ARGS__); }
while (0)
#define ol_info(...)                  do {ol_logf (OL_INFO, "%s\n",
__VA_ARGS__); } while (0)
#define ol_assert(assertion)          do {if (!(assertion)) {      \
      ol_logf (OL_ERROR, "assert %s failed\n", #assertion);        \
      return;                                                      \
    }} while (0)
#define ol_assert_ret(assertion, ret) do {if (!(assertion)) {   \
      ol_logf (OL_ERROR, "assert %s failed\n", #assertion);     \
      return (ret);                                             \
    }} while (0)

void ol_log_printf (int level, const char *file, int line, const char
*funcname,
                    const char *fmt, ...);

/**
 * @brief Sets the message level to be logged
 *
 * @param level The level of message to be logged. There are 4 levels:<br />
 *                OL_LOG_NONE: Log nothing
 *                OL_ERROR: Log only messages with OL_ERROR
 *                OL_DEBUG: Log messages with OL_ERROR and OL_DEBUG
 *                OL_INFO: Log all messages
 */
void ol_log_set_level (enum OlDebugLevel level);

/**
 * @brief Sets the file to store log messages.
 *
 * @param logfile The filename of the log file. if logfile is "-", it
represents
 *                standard output
 * @return Return 1 if succeeded, or 0 if failed.
 */
int ol_log_set_file (const char *logfile);

#endif /* _OL_DEBUG_H_ */

这个是 OSD Lyrics 的 debug 头文件 觉得很有参考价值

在 2011年1月3日 下午10:49,Eros <authurg@xxxxxxxxx>写道:

> 因为正在看源代码 废话比较多~~ 有没有必要 把 UI 协议 功能 的源代码用文件夹分开?
>
> 在 2011年1月3日 下午10:42,Eros <authurg@xxxxxxxxx>写道:
>
> 恩 觉得自己有点指手画脚了 :P 那个界面貌似先全是英文界面 然后增加中文翻译文件吧 以避免编码不同的问题?
>>
>> 在 2011年1月3日 下午10:39,Eros <authurg@xxxxxxxxx>写道:
>>
>> 有没有必要 用sqlite支持数据存储呢?
>>>
>>> 在 2011年1月3日 下午9:15,纵横天下 <zhtx10@xxxxxxxxx>写道:
>>>
>>> 由于gtkmm 3.0比较遥远,而且现在编的话变化可能比较多,考虑再三,还是换回
>>>> GTKMM 2.x
>>>>
>>>> 目前在做读取qqlist,因为gtkmm 2.x加组合框项太麻烦,所以先暂时用DBG输出,
>>>> 对于组合框继续研究。
>>>>
>>>>
>>>>
>>>> 附笔:我的FC实在是没有新版的GLIB、GTK和GTKMM,所以如是
>>>>
>>>>
>>>
>>>
>>> --
>>> 我只是在代码中爬行的一只虫子...
>>>
>>
>>
>>
>> --
>> 我只是在代码中爬行的一只虫子...
>>
>
>
>
> --
> 我只是在代码中爬行的一只虫子...
>



-- 
我只是在代码中爬行的一只虫子...

Other related posts: