亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c

?? Linux環境下手寫輸入程序。手寫輸入
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*cellwriter -- a character recognition input methodCopyright (C) 2007 Michael Levin <risujin@risujin.org>This program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.*/#include "config.h"#include "common.h"#include <stdlib.h>#include <string.h>#include <signal.h>#include <stdio.h>#include <errno.h>#ifdef HAVE_GNOME#include <libgnome/libgnome.h>#endif/* recognize.c */extern int strength_sum;void recognize_init(void);void recognize_sync(void);void samples_write(void);void sample_read(void);void update_enabled_samples(void);int samples_loaded(void);/* cellwidget.c */extern int training, corrections, rewrites, characters, inputs;void cell_widget_cleanup(void);/* options.c */void options_sync(void);/* keyevent.c */extern int key_recycles, key_overwrites, key_disable_overwrite;int key_event_init(void);void key_event_cleanup(void);void bad_keycodes_write(void);void bad_keycodes_read(void);/*        Variable argument parsing*/char *nvav(int *plen, const char *fmt, va_list va){	static char buffer[2][16000];	static int which;	int len;	which = !which;	len = g_vsnprintf(buffer[which], sizeof(buffer[which]), fmt, va);	if (plen)		*plen = len;	return buffer[which];}char *nva(int *plen, const char *fmt, ...){	va_list va;	char *string;	va_start(va, fmt);	string = nvav(plen, fmt, va);	va_end(va);	return string;}char *va(const char *fmt, ...){	va_list va;	char *string;	va_start(va, fmt);	string = nvav(NULL, fmt, va);	va_end(va);	return string;}/*        GDK colors*/static int check_color_range(int value){        if (value < 0)                value = 0;        if (value > 65535)                value = 65535;        return value;}void scale_gdk_color(const GdkColor *base, GdkColor *out, double value){        out->red = check_color_range(base->red * value);        out->green = check_color_range(base->green * value);        out->blue = check_color_range(base->blue * value);}void gdk_color_to_hsl(const GdkColor *src,                      double *hue, double *sat, double *lit)/* Source: http://en.wikipedia.org/wiki/HSV_color_space           #Conversion_from_RGB_to_HSL_or_HSV */{        double max = src->red, min = src->red;        /* Find largest and smallest channel */        if (src->green > max)                max = src->green;        if (src->green < min)                min = src->green;        if (src->blue > max)                max = src->blue;        if (src->blue < min)                min = src->blue;        /* Hue depends on max/min */        if (max == min)                *hue = 0;        else if (max == src->red) {                *hue = (src->green - src->blue) / (max - min) / 6.;                if (*hue < 0.)                        *hue += 1.;        } else if (max == src->green)                *hue = ((src->blue - src->red) / (max - min) + 2.) / 6.;        else if (max == src->blue)                *hue = ((src->red - src->green) / (max - min) + 4.) / 6.;        /* Lightness */        *lit = (max + min) / 2 / 65535;        /* Saturation depends on lightness */        if (max == min)                *sat = 0.;        else if (*lit <= 0.5)                *sat = (max - min) / (max + min);        else                *sat = (max - min) / (65535 * 2 - (max + min));}void hsl_to_gdk_color(GdkColor *src, double hue, double sat, double lit)/* Source: http://en.wikipedia.org/wiki/HSV_color_space           #Conversion_from_RGB_to_HSL_or_HSV */{        double q, p, t[3];        int i;        /* Clamp ranges */        if (hue < 0)                hue -= (int)hue - 1.;        if (hue > 1)                hue -= (int)hue;        if (sat < 0)                sat = 0;        if (sat > 1)                sat = 1;        if (lit < 0)                lit = 0;        if (lit > 1)                lit = 1;        /* Special case for gray */        if (sat == 0.) {                src->red = lit * 65535;                src->green = lit * 65535;                src->blue = lit * 65535;                return;        }        q = (lit < 0.5) ? lit * (1 + sat) : lit + sat - (lit * sat);        p = 2 * lit - q;        t[0] = hue + 1 / 3.;        t[1] = hue;        t[2] = hue - 1 / 3.;        for (i = 0; i < 3; i++) {                if (t[i] < 0.)                        t[i] += 1.;                if (t[i] > 1.)                        t[i] -= 1.;                if (t[i] >= 2 / 3.)                        t[i] = p;                else if (t[i] >= 0.5)                        t[i] = p + ((q - p) * 6 * (2 / 3. - t[i]));                else if (t[i] >= 1 / 6.)                        t[i] = q;                else                        t[i] = p + ((q - p) * 6 * t[i]);        }        src->red = t[0] * 65535;        src->green = t[1] * 65535;        src->blue = t[2] * 65535;}void shade_gdk_color(const GdkColor *base, GdkColor *out, double value){        double hue, sat, lit;        gdk_color_to_hsl(base, &hue, &sat, &lit);        sat *= value;        lit += value - 1.;        hsl_to_gdk_color(out, hue, sat, lit);}void highlight_gdk_color(const GdkColor *base, GdkColor *out, double value)/* Shades brighter or darker depending on the luminance of the base color */{        double lum = (0.3 * base->red + 0.59 * base->green +                      0.11 * base->blue) / 65535;        value = lum < 0.5 ? 1. + value : 1. - value;        shade_gdk_color(base, out, value);}/*        Profile*//* Profile format version */#define PROFILE_VERSION 0int profile_read_only, keyboard_only = FALSE;static GIOChannel *channel;static char profile_buf[4096], *profile_end = NULL, profile_swap,            *force_profile = NULL, *profile_tmp = NULL;static int force_read_only;static int is_space(int ch){        return ch == ' ' || ch == '\t' || ch == '\r';}static int profile_open_channel(const char *type, const char *path)/* Tries to open a profile channel, returns TRUE if it succeeds */{        GError *error = NULL;        if (!g_file_test(path, G_FILE_TEST_IS_REGULAR) &&            g_file_test(path, G_FILE_TEST_EXISTS)) {                g_warning("Failed to open %s profile '%s': Not a regular file",                          type, path);                return FALSE;        }        channel = g_io_channel_new_file(path, profile_read_only ? "r" : "w",                                        &error);        if (!error)                return TRUE;        g_warning("Failed to open %s profile '%s' for %s: %s",                  type, path, profile_read_only ? "reading" : "writing",                  error->message);        g_error_free(error);        return FALSE;}static void create_user_dir(void)/* Make sure the user directory exists */{        char *path;        path = g_build_filename(g_get_home_dir(), "." PACKAGE, NULL);        if (g_mkdir_with_parents(path, 0755))                g_warning("Failed to create user directory '%s'", path);        g_free(path);}static int profile_open_read(void)/* Open the profile file for reading. Returns TRUE if the profile was opened   successfully. */{        char *path;        profile_read_only = TRUE;        /* Try opening a command-line specified profile first */        if (force_profile &&            profile_open_channel("command-line specified", force_profile))                return TRUE;        /* Open user's profile */        path = g_build_filename(g_get_home_dir(), "." PACKAGE, "profile", NULL);        if (profile_open_channel("user's", path)) {                g_free(path);                return TRUE;        }        g_free(path);        /* Open system profile */        path = g_build_filename(PKGDATADIR, "profile", NULL);        if (profile_open_channel("system", path)) {                g_free(path);                return TRUE;        }        g_free(path);        return FALSE;}static int profile_open_write(void)/* Open a temporary profile file for writing. Returns TRUE if the profile was   opened successfully. */{        GError *error;        gint fd;        if (force_read_only) {                g_debug("Not saving profile, opened in read-only mode");                return FALSE;        }        profile_read_only = FALSE;        /* Open a temporary file as a channel */        error = NULL;        fd = g_file_open_tmp(PACKAGE ".XXXXXX", &profile_tmp, &error);        if (error) {                g_warning("Failed to open tmp file while saving "                          "profile: %s", error->message);                return FALSE;        }        channel = g_io_channel_unix_new(fd);        if (!channel) {                g_warning("Failed to create channel from temporary file");                return FALSE;        }        return TRUE;}static int move_file(char *from, char *to)/* The standard library rename() cannot move across filesystems so we need a   function that can emulate that. This function will copy a file, byte-by-byte   but is not as safe as rename(). */{        GError *error = NULL;        GIOChannel *src_channel, *dest_channel;        gchar buffer[4096];        /* Open source file for reading */        src_channel = g_io_channel_new_file(from, "r", &error);        if (error) {                g_warning("move_file() failed to open src '%s': %s",                          from, error->message);                return FALSE;        }        /* Open destination file for writing */        dest_channel = g_io_channel_new_file(to, "w", &error);        if (error) {                g_warning("move_file() failed to open dest '%s': %s",                          to, error->message);                g_io_channel_unref(src_channel);                return FALSE;        }        /* Copy data in blocks */        for (;;) {                gsize bytes_read, bytes_written;                /* Read a block in */                g_io_channel_read_chars(src_channel, buffer, sizeof (buffer),                                        &bytes_read, &error);                if (bytes_read < 1 || error)                        break;                /* Write the block out */                g_io_channel_write_chars(dest_channel, buffer, bytes_read,                                         &bytes_written, &error);                if (bytes_written < bytes_read || error) {                        g_warning("move_file() error writing to '%s': %s",                                  to, error->message);                        g_io_channel_unref(src_channel);                        g_io_channel_unref(dest_channel);                        return FALSE;                }        }        /* Close channels */        g_io_channel_unref(src_channel);        g_io_channel_unref(dest_channel);        g_debug("move_file() copied '%s' to '%s'", from, to);        /* Should be safe to delete the old file now */        if (remove(from))                log_errno("move_file() failed to delete src");        return TRUE;}static int profile_close(void)/* Close the currently open profile and, if we just wrote the profile to a   temporary file, move it in place of the old profile */{        char *path = NULL;        if (!channel)                return FALSE;        g_io_channel_unref(channel);        if (!profile_tmp || profile_read_only)                return TRUE;        /* For some bizarre reason we may not have managed to create the           temporary file */        if (!g_file_test(profile_tmp, G_FILE_TEST_EXISTS)) {                g_warning("Tmp profile '%s' does not exist", profile_tmp);                return FALSE;        }        /* Use command-line specified profile path first then the user's           home directory profile */        path = force_profile;        if (!path)                path = g_build_filename(g_get_home_dir(),                                        "." PACKAGE, "profile", NULL);        if (g_file_test(path, G_FILE_TEST_EXISTS)) {                g_message("Replacing '%s' with '%s'", path, profile_tmp);                /* Don't write over non-regular files */                if (!g_file_test(path, G_FILE_TEST_IS_REGULAR)) {                        g_warning("Old profile '%s' is not a regular file",                                  path);                        goto error_recovery;                }                /* Remove the old profile */                if (remove(path)) {                        log_errno("Failed to delete old profile");                        goto error_recovery;                }        }        else                g_message("Creating new profile '%s'", path);        /* Move the temporary profile file in place of the old one */        if (rename(profile_tmp, path)) {                log_errno("rename() failed to move tmp profile in place");                if (!move_file(profile_tmp, path))                        goto error_recovery;        }        if (path != force_profile)                g_free(path);        return TRUE;error_recovery:        g_warning("Recover tmp profile at '%s'", profile_tmp);        return FALSE;}const char *profile_read(void)/* Read a token from the open profile */{        GError *error = NULL;        char *token;        if (!channel)                return "";        if (!profile_end)                profile_end = profile_buf;        *profile_end = profile_swap;seek_profile_end:        /* Get the next token from the buffer */        for (; is_space(*profile_end); profile_end++);        token = profile_end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情综合在线| 欧美日本精品一区二区三区| 不卡av免费在线观看| 色婷婷综合久久久久中文| 555夜色666亚洲国产免| 久久亚洲精精品中文字幕早川悠里| 亚洲视频免费看| 蜜臀久久久久久久| 99re成人精品视频| 久久午夜色播影院免费高清| 午夜欧美视频在线观看 | 欧美日韩免费观看一区二区三区| 精品免费99久久| 亚洲福利视频一区| www.欧美日韩| 国产欧美一区二区精品忘忧草| 视频一区二区三区中文字幕| 日本伦理一区二区| 国产精品午夜免费| 国产九色精品成人porny| 欧美丰满一区二区免费视频| 一区二区三区四区在线免费观看| 成人一区二区视频| 久久免费视频色| 免费日本视频一区| 欧美人伦禁忌dvd放荡欲情| 日韩毛片在线免费观看| 成人午夜免费视频| 国产亚洲欧美日韩日本| 激情综合亚洲精品| 日韩欧美国产午夜精品| 秋霞午夜av一区二区三区| 欧美日韩国产首页| 亚洲va欧美va人人爽| 欧美体内she精高潮| 亚洲精品乱码久久久久久日本蜜臀| 成人动漫一区二区在线| 国产精品福利一区| 成人av网站免费观看| 国产精品国模大尺度视频| av在线播放成人| 亚洲人成网站影音先锋播放| 99re成人在线| 亚洲va欧美va人人爽午夜| 欧美精品一级二级三级| 蜜桃一区二区三区在线| 久久先锋资源网| 国产精品传媒入口麻豆| 91网上在线视频| 亚洲大片免费看| 日韩午夜在线影院| 九九久久精品视频| 色综合婷婷久久| 亚洲一二三区不卡| 7777精品伊人久久久大香线蕉的| 亚洲五码中文字幕| 欧美日韩在线精品一区二区三区激情| 五月天亚洲婷婷| 日韩你懂的电影在线观看| 国产高清精品在线| 亚洲激情图片小说视频| 91精品在线免费观看| 国产精品一区专区| 亚洲欧美电影院| 91精品国产麻豆| 久久99久久99精品免视看婷婷| 中文字幕精品一区二区精品绿巨人 | 日韩一区二区三区在线视频| 国产在线精品一区二区不卡了| caoporn国产精品| 五月天精品一区二区三区| 久久久久亚洲蜜桃| 色婷婷一区二区三区四区| 久久成人免费网| 亚洲欧美偷拍另类a∨色屁股| 欧美高清一级片在线| 成人激情动漫在线观看| 日韩一区精品字幕| 国产精品福利一区| 日韩午夜三级在线| youjizz久久| 国产调教视频一区| 欧美蜜桃一区二区三区| 成人一区在线看| 麻豆国产精品一区二区三区| 亚洲天堂a在线| 精品乱人伦一区二区三区| 色8久久人人97超碰香蕉987| 国产在线视视频有精品| 亚洲国产精品精华液网站| 国产人成一区二区三区影院| 88在线观看91蜜桃国自产| 99re在线精品| 亚洲摸摸操操av| 国产午夜精品久久久久久久| 91精品在线免费| 欧美日韩不卡一区二区| 成人福利视频网站| 狠狠色丁香久久婷婷综合_中| 亚洲一区二区三区自拍| 国产精品每日更新在线播放网址| 日韩一级大片在线| 欧美日韩国产一级二级| 欧美午夜片在线看| 91蝌蚪porny九色| 成人精品视频一区| 国产精品国产三级国产普通话蜜臀 | 国产日韩欧美一区二区三区乱码| 欧美视频三区在线播放| 91日韩精品一区| www..com久久爱| 成人国产精品视频| 成人精品视频.| 99在线视频精品| 成年人网站91| 亚洲精选在线视频| 伊人色综合久久天天人手人婷| 中文字幕一区二区在线观看| 久久久精品国产免大香伊| www久久久久| 久久久五月婷婷| 国产日韩欧美精品在线| 久久精品视频一区| 日本一区二区三区在线不卡| 国产性色一区二区| 国产精品国产自产拍在线| 国产精品对白交换视频| 亚洲色图都市小说| 欧洲一区在线观看| 91国内精品野花午夜精品| 91国模大尺度私拍在线视频| 欧美性色aⅴ视频一区日韩精品| 欧美性大战久久久久久久蜜臀| 欧美日韩五月天| 欧美成人性战久久| 亚洲国产精华液网站w| 亚洲日本欧美天堂| 五月婷婷另类国产| 久草热8精品视频在线观看| 福利一区二区在线观看| 一本久久a久久精品亚洲| 欧美日韩中文国产| 国产精品资源在线观看| 91亚洲大成网污www| 欧美偷拍一区二区| 久久婷婷一区二区三区| 亚洲男人天堂av| 久久成人久久鬼色| 91在线云播放| 日韩欧美一区二区免费| 日本一区二区三区在线观看| 一区二区高清免费观看影视大全| 视频一区在线播放| 国产激情视频一区二区三区欧美 | 91福利精品视频| 日韩美女天天操| 中文字幕精品在线不卡| 亚洲国产aⅴ成人精品无吗| 久久97超碰国产精品超碰| av一二三不卡影片| 欧美性xxxxxxxx| 久久久欧美精品sm网站| 亚洲成人1区2区| 成人免费看片app下载| 91麻豆精品国产91久久久更新时间| 久久久久久99久久久精品网站| 亚洲欧美激情插| 国产综合一区二区| 日本道色综合久久| 精品国产一区二区亚洲人成毛片| 国产精品国产三级国产aⅴ无密码| 日韩电影在线免费看| av在线不卡免费看| 久久久亚洲精品一区二区三区| 亚洲国产精品久久人人爱蜜臀| 成人午夜av影视| 精品国产髙清在线看国产毛片| 伊人夜夜躁av伊人久久| 国产精品亚洲午夜一区二区三区| 欧美挠脚心视频网站| 日韩伦理av电影| 成人自拍视频在线观看| 精品99久久久久久| 日日摸夜夜添夜夜添亚洲女人| 国产精品亚洲第一区在线暖暖韩国| 日本少妇一区二区| 欧美性大战久久久久久久| 亚洲色图欧美在线| 99久久伊人精品| 国产精品久久久久天堂| 国产高清成人在线| 丰满少妇在线播放bd日韩电影| 日韩欧美国产电影| 免费av网站大全久久| 日韩视频一区二区三区| 午夜精品福利在线| 欧美精品精品一区| 亚洲一区二区视频| 欧美色综合天天久久综合精品| 亚洲乱码中文字幕综合|