亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美视频在线播放| 亚洲国产人成综合网站| 亚洲色图都市小说| 日本女优在线视频一区二区| 99视频在线精品| 久久在线免费观看| 日本视频一区二区| 欧美三区在线观看| 一区二区三区国产| 盗摄精品av一区二区三区| 欧美不卡一区二区三区| 亚洲成在人线在线播放| 99久久99久久精品免费观看| 久久这里都是精品| 激情综合五月婷婷| 欧美一区二区三区啪啪| 亚洲一二三区不卡| 色婷婷亚洲综合| 洋洋成人永久网站入口| 成人视屏免费看| 国产欧美综合在线观看第十页| 免费看黄色91| 91精品国产综合久久久蜜臀图片 | 波多野结衣欧美| 精品国产污网站| 久久精品国产亚洲一区二区三区| 欧美狂野另类xxxxoooo| 亚洲一区二区av在线| 91亚洲精品久久久蜜桃网站| 国产精品久久久久久久久快鸭 | 亚洲国产成人精品视频| 91福利资源站| 亚洲一区在线播放| 欧美婷婷六月丁香综合色| 一区二区三区在线看| 色婷婷av一区二区三区gif| 中文字幕在线一区免费| 99r精品视频| 最新久久zyz资源站| 91麻豆免费观看| 亚洲一区在线观看免费观看电影高清| 色妹子一区二区| 午夜精品视频一区| 欧美一区二区三区视频| 国产在线精品不卡| 国产精品国产三级国产有无不卡 | 日韩成人免费在线| 日本欧美一区二区| 亚洲国产美国国产综合一区二区| 日韩欧美视频在线| 日韩va亚洲va欧美va久久| 欧美一区二区视频在线观看2022 | 国产婷婷一区二区| www.在线欧美| 丝袜诱惑亚洲看片| 2024国产精品| 91蜜桃免费观看视频| 日欧美一区二区| 久久久精品黄色| 91国产成人在线| 激情综合色综合久久综合| 中文字幕一区二区三中文字幕| 欧美体内she精高潮| 激情另类小说区图片区视频区| 国产欧美日韩激情| 欧美色手机在线观看| 国模无码大尺度一区二区三区| 国产精品久久久一本精品 | 91香蕉国产在线观看软件| 亚洲欧美激情视频在线观看一区二区三区| 欧美日韩免费观看一区三区| 国产一区日韩二区欧美三区| 亚洲激情av在线| 欧美精品一区二区高清在线观看| 波波电影院一区二区三区| 美女视频黄 久久| 亚洲情趣在线观看| 欧美成人精品福利| 一本色道久久综合精品竹菊| 日韩精品1区2区3区| 国产精品久久久久久久浪潮网站| 日韩一区二区三区免费看 | 亚洲天天做日日做天天谢日日欢| 欧美一级生活片| 色94色欧美sute亚洲线路二 | 色综合天天综合色综合av| 日本成人中文字幕在线视频| 中文字幕在线观看不卡视频| 欧美一区二区日韩| 在线精品视频免费观看| 成人免费视频caoporn| 蜜桃视频在线观看一区| 亚洲夂夂婷婷色拍ww47| 亚洲视频小说图片| 国产亚洲欧美日韩日本| 日韩情涩欧美日韩视频| 欧美人与z0zoxxxx视频| 91视频免费观看| fc2成人免费人成在线观看播放| 蜜桃久久久久久久| 香蕉久久夜色精品国产使用方法| 亚洲男人天堂一区| 中文字幕在线视频一区| 欧美国产综合一区二区| 国产人久久人人人人爽| 久久久久久久国产精品影院| 久久综合色婷婷| 日韩精品在线看片z| 欧美一级久久久| 91精品国产入口在线| 91精品国产福利在线观看| 欧美日韩一卡二卡三卡 | 精品久久99ma| 欧美一区二区网站| 日韩久久精品一区| 日韩一区二区视频| 久久综合色播五月| 国产日韩综合av| 国产欧美精品日韩区二区麻豆天美| 日韩精品一区在线观看| 久久免费精品国产久精品久久久久| 欧美r级在线观看| 国产香蕉久久精品综合网| 欧美激情中文不卡| 亚洲卡通欧美制服中文| 一区二区三区加勒比av| 亚洲网友自拍偷拍| 三级在线观看一区二区| 老司机午夜精品99久久| 国产一区二区影院| 成人午夜短视频| 97精品久久久午夜一区二区三区| 91同城在线观看| 欧美丝袜丝交足nylons图片| 欧美群妇大交群中文字幕| 91精品国产乱| www亚洲一区| ...xxx性欧美| 日日夜夜精品视频天天综合网| 蓝色福利精品导航| av成人动漫在线观看| 欧美日韩小视频| 666欧美在线视频| 欧美少妇一区二区| 国产一区二区成人久久免费影院| 亚洲成年人网站在线观看| 蜜臂av日日欢夜夜爽一区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 蜜桃精品视频在线| 国产.欧美.日韩| 欧美三级日韩在线| 久久在线观看免费| 亚洲永久精品大片| 国产一区二区三区在线观看免费视频 | 色婷婷久久综合| 日韩你懂的在线播放| 亚洲欧美综合另类在线卡通| 午夜精品久久久久久不卡8050| 国产一区二区精品久久| 欧洲一区二区三区在线| 久久综合九色综合欧美亚洲| 亚洲综合清纯丝袜自拍| 成人永久看片免费视频天堂| 欧美日韩一区三区四区| 国产精品综合在线视频| 日韩欧美国产系列| 日本一区二区三区在线不卡| 成人午夜免费视频| 3atv一区二区三区| 中文字幕中文在线不卡住| 精品在线一区二区| 欧美日韩国产不卡| 最新成人av在线| 国产精品自拍在线| 日韩欧美亚洲国产另类| 一区二区三区四区亚洲| 岛国av在线一区| www激情久久| 蜜臀va亚洲va欧美va天堂| 欧美日韩国产一区二区三区地区| 亚洲日本在线视频观看| 成人精品小蝌蚪| 国产欧美精品在线观看| 国产一区不卡视频| 精品久久免费看| 日韩和欧美的一区| 67194成人在线观看| 亚洲国产成人porn| 欧美日韩国产片| 亚洲最大的成人av| 在线视频国内自拍亚洲视频| 国产精品美女久久久久久久| 成人午夜电影网站| 777a∨成人精品桃花网| 精品一二线国产| 欧美精品vⅰdeose4hd| 欧美久久一区二区| 国产视频一区不卡| 国产美女视频91| 国产欧美一区二区精品秋霞影院|