(メッセージはありません)
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | Melody maid |
| 3 | - copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 3 | + copyright (c) 1998-2013 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 4 | 4 | |
| 5 | 5 | This program is free software: you can redistribute it and/or modify |
| 6 | 6 | it under the terms of the GNU General Public License as published by |
| @@ -78,7 +78,7 @@ | ||
| 78 | 78 | char *argv[]) |
| 79 | 79 | { |
| 80 | 80 | gboolean *arg_files; |
| 81 | - const gchar *file = NULL; | |
| 81 | + gchar *file; | |
| 82 | 82 | gint i, j, count; |
| 83 | 83 | GList *glist; |
| 84 | 84 | GObject *accel, *winmenu; |
| @@ -109,11 +109,13 @@ | ||
| 109 | 109 | SetErrorMode (SetErrorMode (0) | SEM_FAILCRITICALERRORS); |
| 110 | 110 | #endif /* G_OS_WIN32 */ |
| 111 | 111 | setlocale (LC_ALL, ""); |
| 112 | -#if ! GTK_CHECK_VERSION(3,0,0) | |
| 112 | +#if ! GTK_CHECK_VERSION(2,24,0) | |
| 113 | 113 | gtk_set_locale (); |
| 114 | -#endif /* not GTK_CHECK_VERSION(3,0,0) */ | |
| 114 | +#endif /* not GTK_CHECK_VERSION(2,24,0) */ | |
| 115 | 115 | gtk_init (&argc, &argv); |
| 116 | - bindtextdomain (PACKAGE, misc_spec_locale (argv[0])); | |
| 116 | + file = misc_spec_locale (argv[0]); | |
| 117 | + bindtextdomain (PACKAGE, file); | |
| 118 | + g_free (file); | |
| 117 | 119 | bind_textdomain_codeset (PACKAGE, "UTF-8"); |
| 118 | 120 | textdomain (PACKAGE); |
| 119 | 121 |
| @@ -172,7 +174,10 @@ | ||
| 172 | 174 | newfile = arg_n.flag; |
| 173 | 175 | /* ja:レジストリ */ |
| 174 | 176 | if (!arg_p.flag) |
| 175 | - file = NULL; | |
| 177 | + { | |
| 178 | + g_free (file); | |
| 179 | + file = NULL; | |
| 180 | + } | |
| 176 | 181 | /* ja:ウインドウサイズ */ |
| 177 | 182 | def_width = array[0]; |
| 178 | 183 | def_height = array[1]; |
| @@ -324,6 +329,7 @@ | ||
| 324 | 329 | |
| 325 | 330 | /* ja:キーファイルに書き込む */ |
| 326 | 331 | keyfile_write (file); |
| 332 | + g_free (file); | |
| 327 | 333 | |
| 328 | 334 | for (i = 0; i < genres; i++) |
| 329 | 335 | for (j = 0; j < 256; j++) |
| @@ -1,3 +1,7 @@ | ||
| 1 | +2013-05-29 Kazuki Iwamoto <iwm@maid.org> | |
| 2 | + | |
| 3 | + * version 0.4.2 | |
| 4 | + | |
| 1 | 5 | 2012-12-29 Kazuki Iwamoto <iwm@maid.org> |
| 2 | 6 | |
| 3 | 7 | * version 0.4.1 |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | gcommon |
| 3 | - copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 3 | + copyright (c) 1998-2013 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 4 | 4 | |
| 5 | 5 | This program is free software: you can redistribute it and/or modify |
| 6 | 6 | it under the terms of the GNU General Public License as published by |
| @@ -935,7 +935,7 @@ | ||
| 935 | 935 | const gchar *delimiter, |
| 936 | 936 | gint max_tokens) |
| 937 | 937 | { |
| 938 | - GList *glist = NULL, *gl; | |
| 938 | + GList *glist = NULL; | |
| 939 | 939 | gchar **ret, *s; |
| 940 | 940 | guint n = 0; |
| 941 | 941 | const gchar *remainder; |
| @@ -971,9 +971,11 @@ | ||
| 971 | 971 | ret = g_malloc ((n + 1) * sizeof (gchar *)); |
| 972 | 972 | ret[n] = NULL; |
| 973 | 973 | n = 0; |
| 974 | - for (gl = g_list_first (glist); gl; gl = g_list_next (gl)) | |
| 975 | - ret[n++] = gl->data; | |
| 976 | - g_list_free (glist); | |
| 974 | + while (glist) | |
| 975 | + { | |
| 976 | + ret[n++] = glist->data; | |
| 977 | + glist = g_list_delete_link (glist, glist); | |
| 978 | + } | |
| 977 | 979 | |
| 978 | 980 | return ret; |
| 979 | 981 | } |
| @@ -2843,8 +2845,7 @@ | ||
| 2843 | 2845 | } |
| 2844 | 2846 | } |
| 2845 | 2847 | str[j] = NULL; |
| 2846 | - leng += g_strv_length (args) * len + 1; | |
| 2847 | - path = g_malloc (leng * sizeof (gchar)); | |
| 2848 | + path = g_malloc ((leng + j * len + 1) * sizeof (gchar)); | |
| 2848 | 2849 | path[0] = '\0'; |
| 2849 | 2850 | for (i = 0; str[i]; i++) |
| 2850 | 2851 | { |
| @@ -2960,35 +2961,132 @@ | ||
| 2960 | 2961 | # endif /* not G_OS_WIN32 */ |
| 2961 | 2962 | } |
| 2962 | 2963 | #endif /* USE_GTK_EMULATE */ |
| 2964 | + | |
| 2965 | + | |
| 2966 | +#if ! GLIB_CHECK_VERSION(2,26,0) | |
| 2967 | +gchar * | |
| 2968 | +g_mkdtemp (gchar *tmpl) | |
| 2969 | +{ | |
| 2970 | + return g_mkdtemp_full (tmpl, 0700); | |
| 2971 | +} | |
| 2972 | + | |
| 2973 | + | |
| 2974 | +gchar * | |
| 2975 | +g_mkdtemp_full (gchar *tmpl, | |
| 2976 | + gint mode) | |
| 2977 | +{ | |
| 2978 | + gchar *xxxxxx; | |
| 2979 | + gint i; | |
| 2980 | + | |
| 2981 | + if (!tmpl) | |
| 2982 | + return NULL; | |
| 2983 | + xxxxxx = g_strrstr (tmpl, "XXXXXX"); | |
| 2984 | + if (!xxxxxx) | |
| 2985 | + { | |
| 2986 | + errno = EINVAL; | |
| 2987 | + return NULL; | |
| 2988 | + } | |
| 2989 | + for (i = 0; i < 1000000; i++) | |
| 2990 | + { | |
| 2991 | + gchar *p; | |
| 2992 | + gint j, n; | |
| 2993 | + | |
| 2994 | + p = xxxxxx + 5; | |
| 2995 | + n = i; | |
| 2996 | + for (j = 0; j < 6; j++) | |
| 2997 | + { | |
| 2998 | + *p = n % 10 + '0'; | |
| 2999 | + p--; | |
| 3000 | + n /= 10; | |
| 3001 | + } | |
| 3002 | + if (g_mkdir (tmpl, mode) == 0) | |
| 3003 | + return tmpl; | |
| 3004 | + else if (errno != EEXIST) | |
| 3005 | + return NULL; | |
| 3006 | + } | |
| 3007 | + errno = EEXIST; | |
| 3008 | + return NULL; | |
| 3009 | +} | |
| 3010 | +#endif /* not GLIB_CHECK_VERSION(2,26,0) */ | |
| 3011 | + | |
| 3012 | + | |
| 3013 | +#if ! GLIB_CHECK_VERSION(2,30,0) | |
| 3014 | +gchar * | |
| 3015 | +g_dir_make_tmp (const gchar *tmpl, | |
| 3016 | + GError **error) | |
| 3017 | +{ | |
| 3018 | + gchar *tmplate; | |
| 3019 | + const gchar *tmp; | |
| 3020 | + | |
| 3021 | + if (tmpl) | |
| 3022 | + { | |
| 3023 | + if (g_strchr (tmpl, G_DIR_SEPARATOR) | |
| 3024 | +# ifdef G_OS_WIN32 | |
| 3025 | + || g_strchr (tmpl, '/') | |
| 3026 | +# endif /* G_OS_WIN32 */ | |
| 3027 | + || !g_strstr (tmpl, "XXXXXX")) | |
| 3028 | + return NULL; | |
| 3029 | + tmp = tmpl; | |
| 3030 | + } | |
| 3031 | + else | |
| 3032 | + { | |
| 3033 | + tmp = ".XXXXXX"; | |
| 3034 | + } | |
| 3035 | + tmplate = g_build_filename (g_get_tmp_dir (), tmp, NULL); | |
| 3036 | + if (!g_mkdtemp (tmplate)) | |
| 3037 | + { | |
| 3038 | + g_free (tmplate); | |
| 3039 | + return NULL; | |
| 3040 | + } | |
| 3041 | + return tmplate; | |
| 3042 | +} | |
| 3043 | +#endif /* not GLIB_CHECK_VERSION(2,30,0) */ | |
| 3044 | + | |
| 3045 | + | |
| 2963 | 3046 | #if ! GLIB_CHECK_VERSION(2,6,0) && defined (G_OS_WIN32) |
| 2964 | 3047 | gint |
| 2965 | 3048 | g_mkdir (const gchar *filename, |
| 2966 | 3049 | gint mode) |
| 2967 | 3050 | { |
| 3051 | + int err; | |
| 3052 | + gint ret; | |
| 3053 | + LPTSTR lpszFile; | |
| 2968 | 3054 | # ifdef UNICODE |
| 2969 | 3055 | gchar *utf8str; |
| 2970 | - gint ret; | |
| 2971 | - LPWSTR lpszFile; | |
| 3056 | +# endif /* UNICODE */ | |
| 2972 | 3057 | |
| 3058 | +# ifdef UNICODE | |
| 2973 | 3059 | utf8str = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); |
| 3060 | + if (!utf8str) | |
| 3061 | + { | |
| 3062 | + errno = EINVAL; | |
| 3063 | + return -1; | |
| 3064 | + } | |
| 2974 | 3065 | lpszFile = g_utf8_to_utf16 (utf8str, -1, NULL, NULL, NULL); |
| 2975 | 3066 | g_free (utf8str); |
| 2976 | - ret = CreateDirectoryW (lpszFile, NULL); | |
| 3067 | +# else /* not UNICODE */ | |
| 3068 | + lpszFile = g_win32_locale_filename_from_utf8 (filename); | |
| 3069 | +# endif /* not UNICODE */ | |
| 3070 | + if (!lpszFile) | |
| 3071 | + { | |
| 3072 | + errno = EINVAL; | |
| 3073 | + return -1; | |
| 3074 | + } | |
| 3075 | + ret = _tmkdir (lpszFile, mode); | |
| 3076 | + err = errno; | |
| 2977 | 3077 | g_free (lpszFile); |
| 2978 | - return ret ? 0 : -1; | |
| 2979 | -# else /* UNICODE */ | |
| 2980 | - return CreateDirectoryA (filename, NULL) ? 0 : -1; | |
| 2981 | -# endif /* UNICODE */ | |
| 3078 | + errno = err; | |
| 3079 | + return ret; | |
| 2982 | 3080 | } |
| 2983 | 3081 | #endif /* ! GLIB_CHECK_VERSION(2,6,0) && defined (G_OS_WIN32) */ |
| 2984 | 3082 | |
| 2985 | 3083 | |
| 2986 | -#if ! GLIB_CHECK_VERSION(2,8,0) | |
| 3084 | +#if ! GLIB_CHECK_VERSION(2,8,0) && defined (G_OS_WIN32) | |
| 2987 | 3085 | gint |
| 2988 | 3086 | g_chmod (const gchar *filename, |
| 2989 | 3087 | gint mode) |
| 2990 | 3088 | { |
| 2991 | -#ifdef G_OS_WIN32 | |
| 3089 | + int err; | |
| 2992 | 3090 | gint ret; |
| 2993 | 3091 | LPTSTR lpszFile; |
| 2994 | 3092 | # ifdef UNICODE |
| @@ -3013,11 +3111,10 @@ | ||
| 3013 | 3111 | return -1; |
| 3014 | 3112 | } |
| 3015 | 3113 | ret = _tchmod (lpszFile, mode); |
| 3114 | + err = errno; | |
| 3016 | 3115 | g_free (lpszFile); |
| 3116 | + errno = err; | |
| 3017 | 3117 | return ret; |
| 3018 | -#else /* not G_OS_WIN32 */ | |
| 3019 | - return chmod (filename, mode); | |
| 3020 | -#endif /* not G_OS_WIN32 */ | |
| 3021 | 3118 | } |
| 3022 | 3119 | |
| 3023 | 3120 |
| @@ -3025,7 +3122,7 @@ | ||
| 3025 | 3122 | g_access (const gchar *filename, |
| 3026 | 3123 | gint mode) |
| 3027 | 3124 | { |
| 3028 | -#ifdef G_OS_WIN32 | |
| 3125 | + int err; | |
| 3029 | 3126 | gint ret; |
| 3030 | 3127 | LPTSTR lpszFile; |
| 3031 | 3128 | # ifdef UNICODE |
| @@ -3050,11 +3147,10 @@ | ||
| 3050 | 3147 | return -1; |
| 3051 | 3148 | } |
| 3052 | 3149 | ret = _taccess (lpszFile, mode); |
| 3150 | + err = errno; | |
| 3053 | 3151 | g_free (lpszFile); |
| 3152 | + errno = err; | |
| 3054 | 3153 | return ret; |
| 3055 | -#else /* not G_OS_WIN32 */ | |
| 3056 | - return access (filename, mode); | |
| 3057 | -#endif /* not G_OS_WIN32 */ | |
| 3058 | 3154 | } |
| 3059 | 3155 | |
| 3060 | 3156 |
| @@ -3061,7 +3157,7 @@ | ||
| 3061 | 3157 | gint g_creat (const gchar *filename, |
| 3062 | 3158 | gint mode) |
| 3063 | 3159 | { |
| 3064 | -#ifdef G_OS_WIN32 | |
| 3160 | + int err; | |
| 3065 | 3161 | gint ret; |
| 3066 | 3162 | LPTSTR lpszFile; |
| 3067 | 3163 | # ifdef UNICODE |
| @@ -3086,11 +3182,10 @@ | ||
| 3086 | 3182 | return -1; |
| 3087 | 3183 | } |
| 3088 | 3184 | ret = _tcreat (lpszFile, mode); |
| 3185 | + err = errno; | |
| 3089 | 3186 | g_free (lpszFile); |
| 3187 | + errno = err; | |
| 3090 | 3188 | return ret; |
| 3091 | -#else /* not G_OS_WIN32 */ | |
| 3092 | - return creat (filename, mode); | |
| 3093 | -#endif /* not G_OS_WIN32 */ | |
| 3094 | 3189 | } |
| 3095 | 3190 | |
| 3096 | 3191 |
| @@ -3097,7 +3192,7 @@ | ||
| 3097 | 3192 | gint |
| 3098 | 3193 | g_chdir (const gchar *path) |
| 3099 | 3194 | { |
| 3100 | -#ifdef G_OS_WIN32 | |
| 3195 | + int err; | |
| 3101 | 3196 | gint ret; |
| 3102 | 3197 | LPTSTR lpszPath; |
| 3103 | 3198 | # ifdef UNICODE |
| @@ -3122,13 +3217,12 @@ | ||
| 3122 | 3217 | return -1; |
| 3123 | 3218 | } |
| 3124 | 3219 | ret = _tchdir (lpszPath); |
| 3220 | + err = errno; | |
| 3125 | 3221 | g_free (lpszPath); |
| 3222 | + errno = err; | |
| 3126 | 3223 | return ret; |
| 3127 | -#else /* not G_OS_WIN32 */ | |
| 3128 | - return chdir (path); | |
| 3129 | -#endif /* not G_OS_WIN32 */ | |
| 3130 | 3224 | } |
| 3131 | -#endif /* not GLIB_CHECK_VERSION(2,8,0) */ | |
| 3225 | +#endif /* ! GLIB_CHECK_VERSION(2,8,0) && defined (G_OS_WIN32) */ | |
| 3132 | 3226 | |
| 3133 | 3227 | |
| 3134 | 3228 | #if ! GLIB_CHECK_VERSION(2,18,0) |
| @@ -3623,6 +3717,7 @@ | ||
| 3623 | 3717 | glist = g_list_last (glist); |
| 3624 | 3718 | glist->next = gl; |
| 3625 | 3719 | gl->prev = glist; |
| 3720 | + gl = g_list_first (glist); | |
| 3626 | 3721 | } |
| 3627 | 3722 | else |
| 3628 | 3723 | { |
| @@ -3656,6 +3751,46 @@ | ||
| 3656 | 3751 | |
| 3657 | 3752 | |
| 3658 | 3753 | GList * |
| 3754 | +g_list_insert (GList *glist, | |
| 3755 | + gpointer data, | |
| 3756 | + gint position) | |
| 3757 | +{ | |
| 3758 | + GList *gl; | |
| 3759 | + | |
| 3760 | + if (position < 0 || !(gl = g_list_nth (glist, position))) | |
| 3761 | + return g_list_append (glist, data); | |
| 3762 | + glist = g_malloc (sizeof (GList)); | |
| 3763 | + glist->data = data; | |
| 3764 | + glist->prev = gl->prev; | |
| 3765 | + glist->next = gl; | |
| 3766 | + if (gl->prev) | |
| 3767 | + gl->prev->next = glist; | |
| 3768 | + gl->prev = glist; | |
| 3769 | + return g_list_first (glist); | |
| 3770 | +} | |
| 3771 | + | |
| 3772 | + | |
| 3773 | +GList * | |
| 3774 | +g_list_insert_before (GList *glist, | |
| 3775 | + GList *sibling, | |
| 3776 | + gpointer data) | |
| 3777 | +{ | |
| 3778 | + if (sibling) | |
| 3779 | + { | |
| 3780 | + glist = g_malloc (sizeof (GList)); | |
| 3781 | + glist->data = data; | |
| 3782 | + glist->prev = sibling->prev; | |
| 3783 | + glist->next = sibling; | |
| 3784 | + if (sibling->prev) | |
| 3785 | + sibling->prev->next = glist; | |
| 3786 | + sibling->prev = glist; | |
| 3787 | + return g_list_first (glist); | |
| 3788 | + } | |
| 3789 | + return g_list_append (glist, data); | |
| 3790 | +} | |
| 3791 | + | |
| 3792 | + | |
| 3793 | +GList * | |
| 3659 | 3794 | g_list_insert_sorted (GList *glist, |
| 3660 | 3795 | gpointer data, |
| 3661 | 3796 | GCompareFunc compare) |
| @@ -3677,6 +3812,7 @@ | ||
| 3677 | 3812 | if (glist->next) |
| 3678 | 3813 | glist->next->prev = gl; |
| 3679 | 3814 | glist->next = gl; |
| 3815 | + glist = g_list_first (glist); | |
| 3680 | 3816 | } |
| 3681 | 3817 | else |
| 3682 | 3818 | { |
| @@ -3693,7 +3829,8 @@ | ||
| 3693 | 3829 | { |
| 3694 | 3830 | GList *gl; |
| 3695 | 3831 | |
| 3696 | - for (gl = g_list_first (glist); gl; gl = g_list_next (gl)) | |
| 3832 | + glist = g_list_first (glist); | |
| 3833 | + for (gl = glist; gl; gl = g_list_next (gl)) | |
| 3697 | 3834 | if (gl->data == data) |
| 3698 | 3835 | return g_list_delete_link (glist, gl); |
| 3699 | 3836 | return glist; |
| @@ -3704,8 +3841,6 @@ | ||
| 3704 | 3841 | g_list_remove_link (GList *glist, |
| 3705 | 3842 | GList *glink) |
| 3706 | 3843 | { |
| 3707 | - GList *gl = NULL; | |
| 3708 | - | |
| 3709 | 3844 | if (glink) |
| 3710 | 3845 | { |
| 3711 | 3846 | if (glink->prev) |
| @@ -3712,10 +3847,10 @@ | ||
| 3712 | 3847 | glink->prev->next = glink->next; |
| 3713 | 3848 | if (glink->next) |
| 3714 | 3849 | glink->next->prev = glink->prev; |
| 3715 | - gl = glink->prev ? glink->prev : glink->next; | |
| 3850 | + glist = glink->prev ? glink->prev : glink->next; | |
| 3716 | 3851 | glink->prev = glink->next = NULL; |
| 3717 | 3852 | } |
| 3718 | - return glist == glink ? gl : glist; | |
| 3853 | + return g_list_first (glist); | |
| 3719 | 3854 | } |
| 3720 | 3855 | |
| 3721 | 3856 |
| @@ -3723,11 +3858,30 @@ | ||
| 3723 | 3858 | g_list_delete_link (GList *glist, |
| 3724 | 3859 | GList *glink) |
| 3725 | 3860 | { |
| 3861 | + glist = g_list_remove_link (glist, glink); | |
| 3862 | + g_free (glink); | |
| 3863 | + return glist; | |
| 3864 | +} | |
| 3865 | + | |
| 3866 | + | |
| 3867 | +GList * | |
| 3868 | +g_list_remove_all (GList *glist, | |
| 3869 | + gconstpointer data) | |
| 3870 | +{ | |
| 3726 | 3871 | GList *gl; |
| 3727 | 3872 | |
| 3728 | - gl = g_list_remove_link (glist, glink); | |
| 3729 | - g_free (glink); | |
| 3730 | - return gl; | |
| 3873 | + gl = glist = g_list_first (glist); | |
| 3874 | + while (gl) | |
| 3875 | + { | |
| 3876 | + GList *next; | |
| 3877 | + | |
| 3878 | + next = g_list_next (gl); | |
| 3879 | + if (gl->data == data) | |
| 3880 | + glist = g_list_delete_link (glist, gl); | |
| 3881 | + gl = next; | |
| 3882 | + } | |
| 3883 | + return glist; | |
| 3884 | + | |
| 3731 | 3885 | } |
| 3732 | 3886 | |
| 3733 | 3887 |
| @@ -3737,8 +3891,34 @@ | ||
| 3737 | 3891 | while (glist) |
| 3738 | 3892 | glist = g_list_delete_link (glist, glist); |
| 3739 | 3893 | } |
| 3894 | +#endif /* USE_GTK_EMULATE */ | |
| 3740 | 3895 | |
| 3741 | 3896 | |
| 3897 | +#if ! GLIB_CHECK_VERSION(2,28,0) | |
| 3898 | +void g_list_free_full (GList *glist, | |
| 3899 | + GDestroyNotify destroy) | |
| 3900 | +{ | |
| 3901 | + g_list_foreach (glist, (GFunc)destroy, NULL); | |
| 3902 | + g_list_free (glist); | |
| 3903 | +} | |
| 3904 | +#endif /* not GLIB_CHECK_VERSION(2,28,0) */ | |
| 3905 | + | |
| 3906 | + | |
| 3907 | +#ifdef USE_GTK_EMULATE | |
| 3908 | +GList * | |
| 3909 | +g_list_alloc (void) | |
| 3910 | +{ | |
| 3911 | + return g_malloc0 (sizeof (GList)); | |
| 3912 | +} | |
| 3913 | + | |
| 3914 | + | |
| 3915 | +void | |
| 3916 | +g_list_free_1 (GList *glist) | |
| 3917 | +{ | |
| 3918 | + g_free (glist); | |
| 3919 | +} | |
| 3920 | + | |
| 3921 | + | |
| 3742 | 3922 | guint |
| 3743 | 3923 | g_list_length (GList *glist) |
| 3744 | 3924 | { |
| @@ -3751,6 +3931,163 @@ | ||
| 3751 | 3931 | |
| 3752 | 3932 | |
| 3753 | 3933 | GList * |
| 3934 | +g_list_copy (GList *glist) | |
| 3935 | +{ | |
| 3936 | + GList *gl = NULL; | |
| 3937 | + | |
| 3938 | + for (glist = g_list_first (glist); glist; glist = g_list_next (glist)) | |
| 3939 | + gl = g_list_append (gl, glist->data); | |
| 3940 | + return gl; | |
| 3941 | +} | |
| 3942 | +#endif /* USE_GTK_EMULATE */ | |
| 3943 | + | |
| 3944 | + | |
| 3945 | +#if ! GLIB_CHECK_VERSION(2,34,0) | |
| 3946 | +GList * | |
| 3947 | +g_list_copy_deep (GList *glist, | |
| 3948 | + GCopyFunc func, | |
| 3949 | + gpointer user_data) | |
| 3950 | +{ | |
| 3951 | + if (func) | |
| 3952 | + { | |
| 3953 | + GList *gl = NULL; | |
| 3954 | + | |
| 3955 | + for (glist = g_list_first (glist); glist; glist = g_list_next (glist)) | |
| 3956 | + gl = g_list_append (gl, func (glist->data, user_data)); | |
| 3957 | + return gl; | |
| 3958 | + } | |
| 3959 | + return g_list_copy (glist); | |
| 3960 | +} | |
| 3961 | +#endif /* not GLIB_CHECK_VERSION(2,34,0) */ | |
| 3962 | + | |
| 3963 | + | |
| 3964 | +#ifdef USE_GTK_EMULATE | |
| 3965 | +GList * | |
| 3966 | +g_list_reverse (GList *glist) | |
| 3967 | +{ | |
| 3968 | + GList *gl = NULL; | |
| 3969 | + | |
| 3970 | + while (glist) | |
| 3971 | + { | |
| 3972 | + gl = glist; | |
| 3973 | + glist = glist->next; | |
| 3974 | + gl->next = gl->prev; | |
| 3975 | + gl->prev = glist; | |
| 3976 | + } | |
| 3977 | + return gl; | |
| 3978 | +} | |
| 3979 | + | |
| 3980 | + | |
| 3981 | +GList * | |
| 3982 | +g_list_sort (GList *glist, | |
| 3983 | + GCompareFunc compare_func) | |
| 3984 | +{ | |
| 3985 | + if (glist && compare_func) | |
| 3986 | + { | |
| 3987 | + glist = g_list_first (glist); | |
| 3988 | + while (glist->next) | |
| 3989 | + { | |
| 3990 | + GList *gl, *glist_small; | |
| 3991 | + | |
| 3992 | + gl = glist_small = glist; | |
| 3993 | + while ((gl = g_list_next (gl))) | |
| 3994 | + if (compare_func (gl->data, glist_small->data) < 0) | |
| 3995 | + glist_small = gl; | |
| 3996 | + if (glist != glist_small) | |
| 3997 | + { | |
| 3998 | + GList *prev, *next; | |
| 3999 | + | |
| 4000 | + prev = glist->prev; | |
| 4001 | + next = glist->next; | |
| 4002 | + glist->prev = glist_small->prev; | |
| 4003 | + glist->next = glist_small->next; | |
| 4004 | + glist_small->prev = prev; | |
| 4005 | + glist_small->next = next; | |
| 4006 | + glist = glist_small; | |
| 4007 | + } | |
| 4008 | + glist = glist->next; | |
| 4009 | + } | |
| 4010 | + glist = g_list_first (glist); | |
| 4011 | + } | |
| 4012 | + return glist; | |
| 4013 | +} | |
| 4014 | +#endif /* USE_GTK_EMULATE */ | |
| 4015 | + | |
| 4016 | + | |
| 4017 | +#if ! GLIB_CHECK_VERSION(2,10,0) | |
| 4018 | +GList * | |
| 4019 | +g_list_insert_sorted_with_data (GList *glist, | |
| 4020 | + gpointer data, | |
| 4021 | + GCompareDataFunc func, | |
| 4022 | + gpointer user_data) | |
| 4023 | +{ | |
| 4024 | + if (func) | |
| 4025 | + { | |
| 4026 | + GList *gl; | |
| 4027 | + | |
| 4028 | + for (gl = g_list_last (glist); gl; gl = g_list_previous (gl)) | |
| 4029 | + if (func (gl->data, data, user_data) <= 0) | |
| 4030 | + break; | |
| 4031 | + if (gl) | |
| 4032 | + { | |
| 4033 | + glist = gl; | |
| 4034 | + gl = g_malloc (sizeof (GList)); | |
| 4035 | + gl->data = data; | |
| 4036 | + gl->prev = glist; | |
| 4037 | + gl->next = glist->next; | |
| 4038 | + if (glist->next) | |
| 4039 | + glist->next->prev = gl; | |
| 4040 | + glist->next = gl; | |
| 4041 | + glist = g_list_first (glist); | |
| 4042 | + } | |
| 4043 | + else | |
| 4044 | + { | |
| 4045 | + glist = g_list_prepend (glist, data); | |
| 4046 | + } | |
| 4047 | + } | |
| 4048 | + return glist; | |
| 4049 | +} | |
| 4050 | +#endif /* not GLIB_CHECK_VERSION(2,10,0) */ | |
| 4051 | + | |
| 4052 | + | |
| 4053 | +#ifdef USE_GTK_EMULATE | |
| 4054 | +GList * | |
| 4055 | +g_list_sort_with_data (GList *glist, | |
| 4056 | + GCompareDataFunc compare_func, | |
| 4057 | + gpointer user_data) | |
| 4058 | +{ | |
| 4059 | + if (glist && compare_func) | |
| 4060 | + { | |
| 4061 | + glist = g_list_first (glist); | |
| 4062 | + while (glist->next) | |
| 4063 | + { | |
| 4064 | + GList *gl, *glist_small; | |
| 4065 | + | |
| 4066 | + gl = glist_small = glist; | |
| 4067 | + while ((gl = g_list_next (gl))) | |
| 4068 | + if (compare_func (gl->data, glist_small->data, user_data) < 0) | |
| 4069 | + glist_small = gl; | |
| 4070 | + if (glist != glist_small) | |
| 4071 | + { | |
| 4072 | + GList *prev, *next; | |
| 4073 | + | |
| 4074 | + prev = glist->prev; | |
| 4075 | + next = glist->next; | |
| 4076 | + glist->prev = glist_small->prev; | |
| 4077 | + glist->next = glist_small->next; | |
| 4078 | + glist_small->prev = prev; | |
| 4079 | + glist_small->next = next; | |
| 4080 | + glist = glist_small; | |
| 4081 | + } | |
| 4082 | + glist = glist->next; | |
| 4083 | + } | |
| 4084 | + glist = g_list_first (glist); | |
| 4085 | + } | |
| 4086 | + return glist; | |
| 4087 | +} | |
| 4088 | + | |
| 4089 | + | |
| 4090 | +GList * | |
| 3754 | 4091 | g_list_concat (GList *glist1, |
| 3755 | 4092 | GList *glist2) |
| 3756 | 4093 | { |
| @@ -3761,10 +4098,30 @@ | ||
| 3761 | 4098 | glist1->next = glist2; |
| 3762 | 4099 | glist2->prev = glist1; |
| 3763 | 4100 | } |
| 3764 | - return glist1 ? glist1 : glist2; | |
| 4101 | + return g_list_first (glist1 ? glist1 : glist2); | |
| 3765 | 4102 | } |
| 3766 | 4103 | |
| 3767 | 4104 | |
| 4105 | +void | |
| 4106 | +g_list_foreach (GList *glist, | |
| 4107 | + GFunc func, | |
| 4108 | + gpointer user_data) | |
| 4109 | +{ | |
| 4110 | + if (func) | |
| 4111 | + { | |
| 4112 | + glist = g_list_first (glist); | |
| 4113 | + while (glist) | |
| 4114 | + { | |
| 4115 | + gpointer data; | |
| 4116 | + | |
| 4117 | + data = glist->data; | |
| 4118 | + glist = g_list_next (glist); | |
| 4119 | + func (data, user_data); | |
| 4120 | + } | |
| 4121 | + } | |
| 4122 | +} | |
| 4123 | + | |
| 4124 | + | |
| 3768 | 4125 | GList * |
| 3769 | 4126 | g_list_first (GList *glist) |
| 3770 | 4127 | { |
| @@ -3785,16 +4142,32 @@ | ||
| 3785 | 4142 | } |
| 3786 | 4143 | |
| 3787 | 4144 | |
| 4145 | +GList * | |
| 4146 | +g_list_nth (GList *glist, | |
| 4147 | + guint n) | |
| 4148 | +{ | |
| 4149 | + while (glist && n-- > 0) | |
| 4150 | + glist = g_list_next (glist); | |
| 4151 | + return glist; | |
| 4152 | +} | |
| 4153 | + | |
| 4154 | + | |
| 3788 | 4155 | gpointer |
| 3789 | 4156 | g_list_nth_data (GList *glist, |
| 3790 | 4157 | guint n) |
| 3791 | 4158 | { |
| 3792 | - guint i; | |
| 3793 | - GList *gl; | |
| 4159 | + glist = g_list_nth (glist, n); | |
| 4160 | + return glist ? glist->data : NULL; | |
| 4161 | +} | |
| 3794 | 4162 | |
| 3795 | - for (i = 0, gl = g_list_first (glist); | |
| 3796 | - i < n && gl; i++, gl = g_list_next (gl)); | |
| 3797 | - return gl ? gl->data : NULL; | |
| 4163 | + | |
| 4164 | +GList * | |
| 4165 | +g_list_nth_prev (GList *glist, | |
| 4166 | + guint n) | |
| 4167 | +{ | |
| 4168 | + while (glist && n-- > 0) | |
| 4169 | + glist = g_list_previous (glist); | |
| 4170 | + return glist; | |
| 3798 | 4171 | } |
| 3799 | 4172 | |
| 3800 | 4173 |
| @@ -3802,11 +4175,12 @@ | ||
| 3802 | 4175 | g_list_find (GList *glist, |
| 3803 | 4176 | gconstpointer data) |
| 3804 | 4177 | { |
| 3805 | - GList *gl; | |
| 3806 | - | |
| 3807 | - for (gl = g_list_first (glist); gl; gl = g_list_next (gl)) | |
| 3808 | - if (gl->data == data) | |
| 3809 | - return gl; | |
| 4178 | + while (glist) | |
| 4179 | + { | |
| 4180 | + if (glist->data == data) | |
| 4181 | + return glist; | |
| 4182 | + glist = g_list_next (glist); | |
| 4183 | + } | |
| 3810 | 4184 | return NULL; |
| 3811 | 4185 | } |
| 3812 | 4186 |
| @@ -3817,16 +4191,48 @@ | ||
| 3817 | 4191 | GCompareFunc compare) |
| 3818 | 4192 | { |
| 3819 | 4193 | if (compare) |
| 4194 | + while (glist) | |
| 4195 | + { | |
| 4196 | + if (compare (glist->data, data) == 0) | |
| 4197 | + return glist; | |
| 4198 | + glist = g_list_next (glist); | |
| 4199 | + } | |
| 4200 | + return NULL; | |
| 4201 | +} | |
| 4202 | + | |
| 4203 | + | |
| 4204 | +gint | |
| 4205 | +g_list_position (GList *glist, | |
| 4206 | + GList *llink) | |
| 4207 | +{ | |
| 4208 | + gint n = 0; | |
| 4209 | + | |
| 4210 | + while (glist) | |
| 3820 | 4211 | { |
| 3821 | - while (glist) | |
| 3822 | - { | |
| 3823 | - if (compare (glist->data, data) == 0) | |
| 3824 | - return glist; | |
| 3825 | - glist = g_list_next (glist); | |
| 3826 | - } | |
| 4212 | + if (glist == llink) | |
| 4213 | + return n; | |
| 4214 | + n++; | |
| 4215 | + glist = g_list_next (glist); | |
| 3827 | 4216 | } |
| 3828 | - return NULL; | |
| 4217 | + return -1; | |
| 3829 | 4218 | } |
| 4219 | + | |
| 4220 | + | |
| 4221 | +gint | |
| 4222 | +g_list_index (GList *glist, | |
| 4223 | + gconstpointer data) | |
| 4224 | +{ | |
| 4225 | + gint n = 0; | |
| 4226 | + | |
| 4227 | + while (glist) | |
| 4228 | + { | |
| 4229 | + if (glist->data == data) | |
| 4230 | + return n; | |
| 4231 | + n++; | |
| 4232 | + glist = g_list_next (glist); | |
| 4233 | + } | |
| 4234 | + return -1; | |
| 4235 | +} | |
| 3830 | 4236 | #endif /* USE_GTK_EMULATE */ |
| 3831 | 4237 | |
| 3832 | 4238 |
| @@ -3890,8 +4296,7 @@ | ||
| 3890 | 4296 | GList *glist; |
| 3891 | 4297 | |
| 3892 | 4298 | hash = hash_table->hash_func (key) & HASH_TABLE_MASK; |
| 3893 | - for (glist = g_list_first (hash_table->glist[hash]); | |
| 3894 | - glist; glist = g_list_next (glist)) | |
| 4299 | + for (glist = hash_table->glist[hash]; glist; glist = g_list_next (glist)) | |
| 3895 | 4300 | { |
| 3896 | 4301 | GHashNode *node; |
| 3897 | 4302 |
| @@ -3983,7 +4388,7 @@ | ||
| 3983 | 4388 | { |
| 3984 | 4389 | GList *glist; |
| 3985 | 4390 | |
| 3986 | - for (glist = g_list_first (hash_table->glist[i]); | |
| 4391 | + for (glist = hash_table->glist[i]; | |
| 3987 | 4392 | glist; glist = g_list_next (glist)) |
| 3988 | 4393 | { |
| 3989 | 4394 | GHashNode *node; |
| @@ -4006,8 +4411,7 @@ | ||
| 4006 | 4411 | GList *glist; |
| 4007 | 4412 | |
| 4008 | 4413 | hash = hash_table->hash_func (key) & HASH_TABLE_MASK; |
| 4009 | - for (glist = g_list_first (hash_table->glist[hash]); | |
| 4010 | - glist; glist = g_list_next (glist)) | |
| 4414 | + for (glist = hash_table->glist[hash]; glist; glist = g_list_next (glist)) | |
| 4011 | 4415 | { |
| 4012 | 4416 | GHashNode *node; |
| 4013 | 4417 |
| @@ -4044,7 +4448,7 @@ | ||
| 4044 | 4448 | { |
| 4045 | 4449 | GList *glist; |
| 4046 | 4450 | |
| 4047 | - glist = g_list_first (hash_table->glist[i]); | |
| 4451 | + glist = hash_table->glist[i]; | |
| 4048 | 4452 | while (glist) |
| 4049 | 4453 | { |
| 4050 | 4454 | GList *gl; |
| @@ -4774,7 +5178,7 @@ | ||
| 4774 | 5178 | g_strcspn (const gchar *s, |
| 4775 | 5179 | const gchar *reject) |
| 4776 | 5180 | { |
| 4777 | - return s && reject ? strcspn (s, reject) : 0; | |
| 5181 | + return !s ? 0 : !reject ? g_strlen (s) : strcspn (s, reject); | |
| 4778 | 5182 | } |
| 4779 | 5183 | |
| 4780 | 5184 |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | misc |
| 3 | - copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 3 | + copyright (c) 1998-2013 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 4 | 4 | |
| 5 | 5 | This program is free software: you can redistribute it and/or modify |
| 6 | 6 | it under the terms of the GNU General Public License as published by |
| @@ -25,177 +25,8 @@ | ||
| 25 | 25 | G_BEGIN_DECLS |
| 26 | 26 | |
| 27 | 27 | |
| 28 | -#define MISC_CREATE_MENU_BAR 1 | |
| 29 | -#define MISC_CREATE_MENU_SHELL 2 | |
| 30 | -#define MISC_CREATE_MENU_SEPARATOR 3 | |
| 31 | -#define MISC_CREATE_MENU_STOCK 4 | |
| 32 | -#define MISC_CREATE_MENU_ITEM 5 | |
| 33 | -#define MISC_CREATE_MENU_CHECK 6 | |
| 34 | -#define MISC_CREATE_MENU_RADIO 7 | |
| 35 | -#define MISC_CREATE_MENU_TERMINAL 0 | |
| 36 | -#define MISC_CREATE_MENU_ELLIPSIS 8 | |
| 37 | -#define MISC_CREATE_MENU_NOIMAGE 16 | |
| 38 | -#define MISC_CREATE_MENU_DISABLE 32 | |
| 39 | -#define MISC_CREATE_MENU_MASK 7 | |
| 40 | - | |
| 41 | - | |
| 42 | -typedef struct _MiscCreateMenuEntry | |
| 43 | -{ | |
| 44 | - gchar *path; | |
| 45 | - gchar *name; | |
| 46 | - gchar *accel; | |
| 47 | - const gchar **xpm; | |
| 48 | - guint menu_type; | |
| 49 | - void (*func) (GtkWidget *widget, gpointer user_data); | |
| 50 | - gpointer user_data; | |
| 51 | - GtkWidget *widget; | |
| 52 | -} MiscCreateMenuEntry; | |
| 53 | -typedef struct _MiscCreateToolbarEntry | |
| 54 | -{ | |
| 55 | - gchar *path; | |
| 56 | - gchar *name; | |
| 57 | - const gchar **xpm; | |
| 58 | - void (*func) (GtkWidget *widget, gpointer user_data); | |
| 59 | - gpointer user_data; | |
| 60 | - GtkToolItem *tool_item; | |
| 61 | -} MiscCreateToolbarEntry; | |
| 62 | - | |
| 63 | - | |
| 64 | 28 | /****************************************************************************** |
| 65 | 29 | * * |
| 66 | -* ja:メニュー/ツールバー関数群 * | |
| 67 | -* * | |
| 68 | -******************************************************************************/ | |
| 69 | -/* ja:メニューを作成する | |
| 70 | - entries,メニュー構造体 | |
| 71 | - accel_group,アクセルグループ */ | |
| 72 | -void | |
| 73 | -misc_create_menu (MiscCreateMenuEntry *entries, | |
| 74 | - GtkAccelGroup *accel_group); | |
| 75 | - | |
| 76 | - | |
| 77 | -/* ja:メニューを検索する | |
| 78 | - entries,メニュー構造体 | |
| 79 | - path,パス | |
| 80 | - RET,メニューアイテム */ | |
| 81 | -GtkWidget * | |
| 82 | -misc_find_menu (MiscCreateMenuEntry *entries, | |
| 83 | - const gchar *path); | |
| 84 | - | |
| 85 | - | |
| 86 | -/* ja:ツールバーを作成する | |
| 87 | - entries,ツールバー構造体 | |
| 88 | - RET,ツールバー */ | |
| 89 | -GtkWidget * | |
| 90 | -misc_create_toolbar (MiscCreateToolbarEntry *entries); | |
| 91 | - | |
| 92 | - | |
| 93 | -/* ja:ツールバーを検索する | |
| 94 | - entries,ツールバー構造体 | |
| 95 | - path,パス | |
| 96 | - RET,ツールアイテム */ | |
| 97 | -GtkToolItem * | |
| 98 | -misc_find_toolbar (MiscCreateToolbarEntry *entries, | |
| 99 | - const gchar *path); | |
| 100 | - | |
| 101 | - | |
| 102 | -/****************************************************************************** | |
| 103 | -* * | |
| 104 | -* ja:特定ファイル関数群 * | |
| 105 | -* * | |
| 106 | -******************************************************************************/ | |
| 107 | -/* ja:ユーザ設定ファイルを取得する | |
| 108 | - group,グループ | |
| 109 | - name,アプリケーション名 | |
| 110 | - file,ファイル名 | |
| 111 | - RET,ユーザ設定ファイル */ | |
| 112 | -const gchar * | |
| 113 | -misc_spec_config (const gchar *group, | |
| 114 | - const gchar *name, | |
| 115 | - const gchar *file); | |
| 116 | - | |
| 117 | - | |
| 118 | -/* ja:ロケールのディレクトリを取得する | |
| 119 | - prgname,プログラム | |
| 120 | - RET,ロケールのディレクトリ */ | |
| 121 | -const gchar * | |
| 122 | -misc_spec_locale (const gchar *prgname); | |
| 123 | - | |
| 124 | - | |
| 125 | -/****************************************************************************** | |
| 126 | -* * | |
| 127 | -* ja:クローズボタン関数群 * | |
| 128 | -* * | |
| 129 | -******************************************************************************/ | |
| 130 | -/* ja:クローズボタンのイメージを取得する | |
| 131 | - RET,イメージ,NULL:エラー */ | |
| 132 | -GtkWidget * | |
| 133 | -misc_close_image (void); | |
| 134 | - | |
| 135 | - | |
| 136 | -/* ja:クローズボタンを取得する | |
| 137 | - RET,ボタン,NULL:エラー */ | |
| 138 | -GtkWidget * | |
| 139 | -misc_close_button (void); | |
| 140 | - | |
| 141 | - | |
| 142 | -/****************************************************************************** | |
| 143 | -* * | |
| 144 | -* ja:低レベル関数群 * | |
| 145 | -* * | |
| 146 | -******************************************************************************/ | |
| 147 | -/* ja:mnemonicをテキストに変換する | |
| 148 | - mnemonic,mnemonic | |
| 149 | - RET,テキスト */ | |
| 150 | -gchar * | |
| 151 | -misc_mnemonic_to_text (const gchar *mnemonic); | |
| 152 | - | |
| 153 | - | |
| 154 | -/* ja:スクロールバーを設定する | |
| 155 | - scroll,スクロールウイジット | |
| 156 | - func,シグナル関数 | |
| 157 | - func_data,データ | |
| 158 | - min,最小値 | |
| 159 | - max,最大値 | |
| 160 | - page,ページ | |
| 161 | - pos,位置 */ | |
| 162 | -void | |
| 163 | -misc_set_scroll_bar (GtkWidget *scroll, | |
| 164 | - GCallback func, | |
| 165 | - gpointer func_data, | |
| 166 | - const gint min, | |
| 167 | - const gint max, | |
| 168 | - const gint page, | |
| 169 | - const gint pos); | |
| 170 | - | |
| 171 | - | |
| 172 | -/* ja:Windowの内容をスクロールする | |
| 173 | - widget,ウイジット | |
| 174 | - dx,X軸方向の移動 | |
| 175 | - dy,Y軸方向の移動 | |
| 176 | - x,スクロールする範囲の右上X座標 | |
| 177 | - y,スクロールする範囲の右上Y座標 | |
| 178 | - width,スクロールする範囲の幅 | |
| 179 | - height,スクロールする範囲の高さ */ | |
| 180 | -void | |
| 181 | -misc_scroll_window (GtkWidget *widget, | |
| 182 | - const gint dx, | |
| 183 | - const gint dy, | |
| 184 | - const gint x, | |
| 185 | - const gint y, | |
| 186 | - const gint width, | |
| 187 | - const gint height); | |
| 188 | - | |
| 189 | - | |
| 190 | -/* ja:ESCが押されたとき */ | |
| 191 | -gboolean | |
| 192 | -misc_dialog_key_press (GtkWidget *widget, | |
| 193 | - GdkEventKey *event, | |
| 194 | - gpointer user_data); | |
| 195 | - | |
| 196 | - | |
| 197 | -/****************************************************************************** | |
| 198 | -* * | |
| 199 | 30 | * ja:数値文字列関数群 * |
| 200 | 31 | * * |
| 201 | 32 | ******************************************************************************/ |
| @@ -279,6 +110,29 @@ | ||
| 279 | 110 | |
| 280 | 111 | /****************************************************************************** |
| 281 | 112 | * * |
| 113 | +* ja:特定ファイル関数群 * | |
| 114 | +* * | |
| 115 | +******************************************************************************/ | |
| 116 | +/* ja:ユーザ設定ファイルを取得する | |
| 117 | + group,グループ | |
| 118 | + name,アプリケーション名 | |
| 119 | + file,ファイル名 | |
| 120 | + RET,ユーザ設定ファイル */ | |
| 121 | +gchar * | |
| 122 | +misc_spec_config (const gchar *group, | |
| 123 | + const gchar *name, | |
| 124 | + const gchar *file); | |
| 125 | + | |
| 126 | + | |
| 127 | +/* ja:ロケールのディレクトリを取得する | |
| 128 | + prgname,プログラム | |
| 129 | + RET,ロケールのディレクトリ */ | |
| 130 | +gchar * | |
| 131 | +misc_spec_locale (const gchar *prgname); | |
| 132 | + | |
| 133 | + | |
| 134 | +/****************************************************************************** | |
| 135 | +* * | |
| 282 | 136 | * ja:日時文字列関数群 * |
| 283 | 137 | * * |
| 284 | 138 | ******************************************************************************/ |
| @@ -354,6 +208,154 @@ | ||
| 354 | 208 | const gchar sign); |
| 355 | 209 | |
| 356 | 210 | |
| 211 | +#ifndef USE_GTK_EMULATE | |
| 212 | +/****************************************************************************** | |
| 213 | +* * | |
| 214 | +* ja:メニュー/ツールバー関数群 * | |
| 215 | +* * | |
| 216 | +******************************************************************************/ | |
| 217 | +#define MISC_CREATE_MENU_BAR 1 | |
| 218 | +#define MISC_CREATE_MENU_SHELL 2 | |
| 219 | +#define MISC_CREATE_MENU_SEPARATOR 3 | |
| 220 | +#define MISC_CREATE_MENU_STOCK 4 | |
| 221 | +#define MISC_CREATE_MENU_ITEM 5 | |
| 222 | +#define MISC_CREATE_MENU_CHECK 6 | |
| 223 | +#define MISC_CREATE_MENU_RADIO 7 | |
| 224 | +#define MISC_CREATE_MENU_TERMINAL 0 | |
| 225 | +#define MISC_CREATE_MENU_ELLIPSIS 8 | |
| 226 | +#define MISC_CREATE_MENU_NOIMAGE 16 | |
| 227 | +#define MISC_CREATE_MENU_DISABLE 32 | |
| 228 | +#define MISC_CREATE_MENU_MASK 7 | |
| 229 | + | |
| 230 | + | |
| 231 | +typedef struct _MiscCreateMenuEntry | |
| 232 | +{ | |
| 233 | + gchar *path; | |
| 234 | + gchar *name; | |
| 235 | + gchar *accel; | |
| 236 | + const gchar **xpm; | |
| 237 | + guint menu_type; | |
| 238 | + void (*func) (GtkWidget *widget, gpointer user_data); | |
| 239 | + gpointer user_data; | |
| 240 | + GtkWidget *widget; | |
| 241 | +} MiscCreateMenuEntry; | |
| 242 | +typedef struct _MiscCreateToolbarEntry | |
| 243 | +{ | |
| 244 | + gchar *path; | |
| 245 | + gchar *name; | |
| 246 | + const gchar **xpm; | |
| 247 | + void (*func) (GtkWidget *widget, gpointer user_data); | |
| 248 | + gpointer user_data; | |
| 249 | + GtkToolItem *tool_item; | |
| 250 | +} MiscCreateToolbarEntry; | |
| 251 | + | |
| 252 | + | |
| 253 | +/* ja:メニューを作成する | |
| 254 | + entries,メニュー構造体 | |
| 255 | + accel_group,アクセルグループ */ | |
| 256 | +void | |
| 257 | +misc_create_menu (MiscCreateMenuEntry *entries, | |
| 258 | + GtkAccelGroup *accel_group); | |
| 259 | + | |
| 260 | + | |
| 261 | +/* ja:メニューを検索する | |
| 262 | + entries,メニュー構造体 | |
| 263 | + path,パス | |
| 264 | + RET,メニューアイテム */ | |
| 265 | +GtkWidget * | |
| 266 | +misc_find_menu (MiscCreateMenuEntry *entries, | |
| 267 | + const gchar *path); | |
| 268 | + | |
| 269 | + | |
| 270 | +/* ja:ツールバーを作成する | |
| 271 | + entries,ツールバー構造体 | |
| 272 | + RET,ツールバー */ | |
| 273 | +GtkWidget * | |
| 274 | +misc_create_toolbar (MiscCreateToolbarEntry *entries); | |
| 275 | + | |
| 276 | + | |
| 277 | +/* ja:ツールバーを検索する | |
| 278 | + entries,ツールバー構造体 | |
| 279 | + path,パス | |
| 280 | + RET,ツールアイテム */ | |
| 281 | +GtkToolItem * | |
| 282 | +misc_find_toolbar (MiscCreateToolbarEntry *entries, | |
| 283 | + const gchar *path); | |
| 284 | + | |
| 285 | + | |
| 286 | +/****************************************************************************** | |
| 287 | +* * | |
| 288 | +* ja:クローズボタン関数群 * | |
| 289 | +* * | |
| 290 | +******************************************************************************/ | |
| 291 | +/* ja:クローズボタンのイメージを取得する | |
| 292 | + RET,イメージ,NULL:エラー */ | |
| 293 | +GtkWidget * | |
| 294 | +misc_close_image (void); | |
| 295 | + | |
| 296 | + | |
| 297 | +/* ja:クローズボタンを取得する | |
| 298 | + RET,ボタン,NULL:エラー */ | |
| 299 | +GtkWidget * | |
| 300 | +misc_close_button (void); | |
| 301 | + | |
| 302 | + | |
| 303 | +/****************************************************************************** | |
| 304 | +* * | |
| 305 | +* ja:低レベル関数群 * | |
| 306 | +* * | |
| 307 | +******************************************************************************/ | |
| 308 | +/* ja:mnemonicをテキストに変換する | |
| 309 | + mnemonic,mnemonic | |
| 310 | + RET,テキスト */ | |
| 311 | +gchar * | |
| 312 | +misc_mnemonic_to_text (const gchar *mnemonic); | |
| 313 | + | |
| 314 | + | |
| 315 | +/* ja:スクロールバーを設定する | |
| 316 | + scroll,スクロールウイジット | |
| 317 | + func,シグナル関数 | |
| 318 | + func_data,データ | |
| 319 | + min,最小値 | |
| 320 | + max,最大値 | |
| 321 | + page,ページ | |
| 322 | + pos,位置 */ | |
| 323 | +void | |
| 324 | +misc_set_scroll_bar (GtkWidget *scroll, | |
| 325 | + GCallback func, | |
| 326 | + gpointer func_data, | |
| 327 | + const gint min, | |
| 328 | + const gint max, | |
| 329 | + const gint page, | |
| 330 | + const gint pos); | |
| 331 | + | |
| 332 | + | |
| 333 | +/* ja:Windowの内容をスクロールする | |
| 334 | + widget,ウイジット | |
| 335 | + dx,X軸方向の移動 | |
| 336 | + dy,Y軸方向の移動 | |
| 337 | + x,スクロールする範囲の右上X座標 | |
| 338 | + y,スクロールする範囲の右上Y座標 | |
| 339 | + width,スクロールする範囲の幅 | |
| 340 | + height,スクロールする範囲の高さ */ | |
| 341 | +void | |
| 342 | +misc_scroll_window (GtkWidget *widget, | |
| 343 | + const gint dx, | |
| 344 | + const gint dy, | |
| 345 | + const gint x, | |
| 346 | + const gint y, | |
| 347 | + const gint width, | |
| 348 | + const gint height); | |
| 349 | + | |
| 350 | + | |
| 351 | +/* ja:ESCが押されたとき */ | |
| 352 | +gboolean | |
| 353 | +misc_dialog_key_press (GtkWidget *widget, | |
| 354 | + GdkEventKey *event, | |
| 355 | + gpointer user_data); | |
| 356 | +#endif /* not USE_GTK_EMULATE */ | |
| 357 | + | |
| 358 | + | |
| 357 | 359 | G_END_DECLS |
| 358 | 360 | |
| 359 | 361 |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | gcommon |
| 3 | - copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 3 | + copyright (c) 1998-2013 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 4 | 4 | |
| 5 | 5 | This program is free software: you can redistribute it and/or modify |
| 6 | 6 | it under the terms of the GNU General Public License as published by |
| @@ -1474,6 +1474,13 @@ | ||
| 1474 | 1474 | #endif /* not GLIB_CHECK_VERSION(2,26,0) */ |
| 1475 | 1475 | |
| 1476 | 1476 | |
| 1477 | +#if ! GLIB_CHECK_VERSION(2,26,0) | |
| 1478 | +gchar *g_mkdtemp (gchar *tmpl); | |
| 1479 | +gchar *g_mkdtemp_full (gchar *tmpl, gint mode); | |
| 1480 | +#endif /* not GLIB_CHECK_VERSION(2,26,0) */ | |
| 1481 | +#if ! GLIB_CHECK_VERSION(2,30,0) | |
| 1482 | +gchar *g_dir_make_tmp (const gchar *tmpl, GError **error); | |
| 1483 | +#endif /* not GLIB_CHECK_VERSION(2,30,0) */ | |
| 1477 | 1484 | #if ! GLIB_CHECK_VERSION(2,22,0) |
| 1478 | 1485 | # define g_mapped_file_unref(file) g_mapped_file_free(file) |
| 1479 | 1486 | #endif /* not GLIB_CHECK_VERSION(2,22,0) */ |
| @@ -1498,10 +1505,17 @@ | ||
| 1498 | 1505 | # define g_freopen freopen |
| 1499 | 1506 | #endif /* not GLIB_CHECK_VERSION(2,6,0) */ |
| 1500 | 1507 | #if ! GLIB_CHECK_VERSION(2,8,0) |
| 1508 | +# ifdef G_OS_WIN32 | |
| 1501 | 1509 | gint g_chmod (const gchar *filename, gint mode); |
| 1502 | 1510 | gint g_access (const gchar *filename, gint mode); |
| 1503 | 1511 | gint g_creat (const gchar *filename, gint mode); |
| 1504 | 1512 | gint g_chdir (const gchar *path); |
| 1513 | +# else /* not G_OS_WIN32 */ | |
| 1514 | +# define g_chmod chmod | |
| 1515 | +# define g_access access | |
| 1516 | +# define g_creat creat | |
| 1517 | +# define g_chdir chdir | |
| 1518 | +# endif /* not G_OS_WIN32 */ | |
| 1505 | 1519 | #endif /* not GLIB_CHECK_VERSION(2,8,0) */ |
| 1506 | 1520 | #if ! GLIB_CHECK_VERSION(2,18,0) |
| 1507 | 1521 | # ifdef G_OS_WIN32 |
| @@ -1583,25 +1597,63 @@ | ||
| 1583 | 1597 | struct _GList *prev; |
| 1584 | 1598 | struct _GList *next; |
| 1585 | 1599 | } GList; |
| 1600 | +typedef gint (*GCompareDataFunc) (gconstpointer a, gconstpointer b, gpointer user_data); | |
| 1586 | 1601 | typedef gint (*GCompareFunc) (gconstpointer a, gconstpointer b); |
| 1602 | +#endif /* USE_GTK_EMULATE */ | |
| 1603 | +#if ! GLIB_CHECK_VERSION(2,4,0) | |
| 1604 | +typedef gpointer (*GCopyFunc) (gconstpointer src, gpointer data); | |
| 1605 | +#endif /* not GLIB_CHECK_VERSION(2,4,0) */ | |
| 1606 | +#ifdef USE_GTK_EMULATE | |
| 1607 | +typedef void (*GDestroyNotify) (gpointer data); | |
| 1608 | +typedef void (*GFunc) (gpointer data, gpointer user_data); | |
| 1587 | 1609 | |
| 1588 | 1610 | |
| 1589 | 1611 | GList *g_list_append (GList *list, gpointer data); |
| 1590 | 1612 | GList *g_list_prepend (GList *glist, gpointer data); |
| 1613 | +GList *g_list_insert (GList *glist, gpointer data, gint position); | |
| 1614 | +GList *g_list_insert_before (GList *glist, GList *sibling, gpointer data); | |
| 1591 | 1615 | GList *g_list_insert_sorted (GList *glist, gpointer data, GCompareFunc compare); |
| 1592 | 1616 | GList *g_list_remove (GList *glist, gconstpointer data); |
| 1593 | 1617 | GList *g_list_remove_link (GList *glist, GList *glink); |
| 1594 | 1618 | GList *g_list_delete_link (GList *glist, GList *glink); |
| 1619 | +GList *g_list_remove_all (GList *glist, gconstpointer data); | |
| 1595 | 1620 | void g_list_free (GList *glist); |
| 1621 | +#endif /* USE_GTK_EMULATE */ | |
| 1622 | +#if ! GLIB_CHECK_VERSION(2,28,0) | |
| 1623 | +void g_list_free_full (GList *glist, GDestroyNotify destroy); | |
| 1624 | +#endif /* not GLIB_CHECK_VERSION(2,28,0) */ | |
| 1625 | +#ifdef USE_GTK_EMULATE | |
| 1626 | +GList *g_list_alloc (void); | |
| 1627 | +void g_list_free_1 (GList *glist); | |
| 1628 | +# define g_list_free1 g_list_free_1 | |
| 1596 | 1629 | guint g_list_length (GList *glist); |
| 1630 | +GList *g_list_copy (GList *glist); | |
| 1631 | +#endif /* USE_GTK_EMULATE */ | |
| 1632 | +#if ! GLIB_CHECK_VERSION(2,34,0) | |
| 1633 | +GList *g_list_copy_deep (GList *glist, GCopyFunc func, gpointer user_data); | |
| 1634 | +#endif /* not GLIB_CHECK_VERSION(2,34,0) */ | |
| 1635 | +#ifdef USE_GTK_EMULATE | |
| 1636 | +GList *g_list_reverse (GList *glist); | |
| 1637 | +GList *g_list_sort (GList *glist, GCompareFunc compare_func); | |
| 1638 | +#endif /* USE_GTK_EMULATE */ | |
| 1639 | +#if ! GLIB_CHECK_VERSION(2,10,0) | |
| 1640 | +GList *g_list_insert_sorted_with_data (GList *glist, gpointer data, GCompareDataFunc func, gpointer user_data); | |
| 1641 | +#endif /* not GLIB_CHECK_VERSION(2,10,0) */ | |
| 1642 | +#ifdef USE_GTK_EMULATE | |
| 1643 | +GList *g_list_sort_with_data (GList *glist, GCompareDataFunc compare_func, gpointer user_data); | |
| 1597 | 1644 | GList *g_list_concat (GList *glist1, GList *glist2); |
| 1645 | +void g_list_foreach (GList *glist, GFunc func, gpointer user_data); | |
| 1598 | 1646 | GList *g_list_first (GList *glist); |
| 1599 | 1647 | GList *g_list_last (GList *glist); |
| 1600 | 1648 | # define g_list_previous(glist) ((glist)?((GList *)(glist))->prev:NULL) |
| 1601 | 1649 | # define g_list_next(glist) ((glist)?((GList *)(glist))->next:NULL) |
| 1650 | +GList *g_list_nth (GList *glist, guint n); | |
| 1602 | 1651 | gpointer g_list_nth_data (GList *glist, guint n); |
| 1652 | +GList *g_list_nth_prev (GList *glist, guint n); | |
| 1603 | 1653 | GList *g_list_find (GList *glist, gconstpointer data); |
| 1604 | 1654 | GList *g_list_find_custom (GList *glist, gconstpointer data, GCompareFunc compare); |
| 1655 | +gint g_list_position (GList *glist, GList *llink); | |
| 1656 | +gint g_list_index (GList *glist, gconstpointer data); | |
| 1605 | 1657 | #endif /* USE_GTK_EMULATE */ |
| 1606 | 1658 | |
| 1607 | 1659 |
| @@ -1614,7 +1666,6 @@ | ||
| 1614 | 1666 | typedef gboolean (*GEqualFunc) (gconstpointer a, gconstpointer b); |
| 1615 | 1667 | typedef void (*GHFunc) (gpointer key, gpointer value, gpointer user_data); |
| 1616 | 1668 | typedef gboolean (*GHRFunc) (gpointer key, gpointer value, gpointer user_data); |
| 1617 | -typedef void (*GDestroyNotify) (gpointer data); | |
| 1618 | 1669 | |
| 1619 | 1670 | |
| 1620 | 1671 | GHashTable *g_hash_table_new (GHashFunc hash_func, GEqualFunc key_equal_func); |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | misc |
| 3 | - copyright (c) 1998-2012 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 3 | + copyright (c) 1998-2013 Kazuki Iwamoto http://www.maid.org/ iwm@maid.org | |
| 4 | 4 | |
| 5 | 5 | This program is free software: you can redistribute it and/or modify |
| 6 | 6 | it under the terms of the GNU General Public License as published by |
| @@ -26,749 +26,6 @@ | ||
| 26 | 26 | |
| 27 | 27 | /****************************************************************************** |
| 28 | 28 | * * |
| 29 | -* ja:メニュー/ツールバー関数群 * | |
| 30 | -* * | |
| 31 | -******************************************************************************/ | |
| 32 | -/* ja:メニューを作成する | |
| 33 | - entries,メニュー構造体 | |
| 34 | - accel_group,アクセルグループ */ | |
| 35 | -void | |
| 36 | -misc_create_menu (MiscCreateMenuEntry *entries, | |
| 37 | - GtkAccelGroup *accel_group) | |
| 38 | -{ | |
| 39 | - gint i; | |
| 40 | - | |
| 41 | - for (i = 0; (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 42 | - != MISC_CREATE_MENU_TERMINAL; i++) | |
| 43 | - switch (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 44 | - { | |
| 45 | - case MISC_CREATE_MENU_BAR: | |
| 46 | - entries[i].widget = gtk_menu_bar_new (); | |
| 47 | - break; | |
| 48 | - case MISC_CREATE_MENU_SHELL: | |
| 49 | - { | |
| 50 | - gchar *path, *p; | |
| 51 | - gint j; | |
| 52 | - | |
| 53 | - entries[i].widget = gtk_menu_new (); | |
| 54 | - path = g_strdup (entries[i].path); | |
| 55 | - p = g_strrchr (path, '/'); | |
| 56 | - *p = '\0'; | |
| 57 | - for (j = 0; j < i; j++) | |
| 58 | - if (g_strcmp (entries[j].path, path) == 0) | |
| 59 | - { | |
| 60 | - gtk_menu_item_set_submenu (GTK_MENU_ITEM (entries[j].widget), | |
| 61 | - entries[i].widget); | |
| 62 | - break; | |
| 63 | - } | |
| 64 | - g_free (path); | |
| 65 | - } | |
| 66 | - break; | |
| 67 | - default: | |
| 68 | - { | |
| 69 | - gchar *path, *p; | |
| 70 | - gint j; | |
| 71 | - | |
| 72 | - switch (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 73 | - { | |
| 74 | - case MISC_CREATE_MENU_STOCK: | |
| 75 | - if (entries[i].menu_type & MISC_CREATE_MENU_NOIMAGE) | |
| 76 | - { | |
| 77 | - GtkStockItem stock_item; | |
| 78 | - | |
| 79 | - gtk_stock_lookup (entries[i].name, &stock_item); | |
| 80 | - entries[i].widget = gtk_image_menu_item_new_with_mnemonic | |
| 81 | - (stock_item.label); | |
| 82 | - } | |
| 83 | - else | |
| 84 | - { | |
| 85 | - entries[i].widget = gtk_image_menu_item_new_from_stock | |
| 86 | - (entries[i].name, | |
| 87 | - entries[i].accel ? NULL : accel_group); | |
| 88 | - } | |
| 89 | - break; | |
| 90 | - case MISC_CREATE_MENU_ITEM: | |
| 91 | - if (entries[i].xpm | |
| 92 | - && !(entries[i].menu_type & MISC_CREATE_MENU_NOIMAGE)) | |
| 93 | - { | |
| 94 | - GdkPixbuf *pixbuf; | |
| 95 | - | |
| 96 | - entries[i].widget = gtk_image_menu_item_new_with_mnemonic | |
| 97 | - (_(entries[i].name)); | |
| 98 | - pixbuf = gdk_pixbuf_new_from_xpm_data (entries[i].xpm); | |
| 99 | - gtk_image_menu_item_set_image | |
| 100 | - (GTK_IMAGE_MENU_ITEM (entries[i].widget), | |
| 101 | - gtk_image_new_from_pixbuf (pixbuf)); | |
| 102 | - g_object_unref (pixbuf); | |
| 103 | - } | |
| 104 | - else | |
| 105 | - { | |
| 106 | - entries[i].widget = gtk_menu_item_new_with_mnemonic | |
| 107 | - (_(entries[i].name)); | |
| 108 | - } | |
| 109 | - break; | |
| 110 | - case MISC_CREATE_MENU_CHECK: | |
| 111 | - entries[i].widget = gtk_check_menu_item_new_with_mnemonic | |
| 112 | - (_(entries[i].name)); | |
| 113 | - break; | |
| 114 | - case MISC_CREATE_MENU_RADIO: | |
| 115 | - entries[i].widget = gtk_radio_menu_item_new_with_mnemonic | |
| 116 | - (i > 0 | |
| 117 | - && (entries[i - 1].menu_type & MISC_CREATE_MENU_MASK) | |
| 118 | - == MISC_CREATE_MENU_RADIO | |
| 119 | - ? gtk_radio_menu_item_get_group | |
| 120 | - (GTK_RADIO_MENU_ITEM (entries[i - 1].widget)) | |
| 121 | - : NULL, _(entries[i].name)); | |
| 122 | - break; | |
| 123 | - default: | |
| 124 | - entries[i].widget = gtk_separator_menu_item_new (); | |
| 125 | - } | |
| 126 | - if (entries[i].menu_type & MISC_CREATE_MENU_ELLIPSIS) | |
| 127 | - { | |
| 128 | - gchar *mnemonic; | |
| 129 | - GtkWidget *label; | |
| 130 | - | |
| 131 | - label = gtk_bin_get_child (GTK_BIN (entries[i].widget)); | |
| 132 | - mnemonic = g_strconcat | |
| 133 | - (gtk_label_get_label (GTK_LABEL (label)), "...", NULL); | |
| 134 | - gtk_label_set_text_with_mnemonic (GTK_LABEL (label), mnemonic); | |
| 135 | - g_free (mnemonic); | |
| 136 | - } | |
| 137 | - path = g_strdup (entries[i].path); | |
| 138 | - p = g_strrchr (path, '/') + 1 ; | |
| 139 | - *p = '\0'; | |
| 140 | - for (j = 0; j < i; j++) | |
| 141 | - if (g_strcmp (entries[j].path, path) == 0) | |
| 142 | - { | |
| 143 | - gtk_menu_shell_append (GTK_MENU_SHELL (entries[j].widget), | |
| 144 | - entries[i].widget); | |
| 145 | - break; | |
| 146 | - } | |
| 147 | - g_free (path); | |
| 148 | - if (accel_group && entries[i].accel && entries[i].accel[0] != '\0') | |
| 149 | - { | |
| 150 | - guint key; | |
| 151 | - GdkModifierType mods; | |
| 152 | - | |
| 153 | - gtk_accelerator_parse (entries[i].accel, &key, &mods); | |
| 154 | - gtk_widget_add_accelerator (entries[i].widget, "activate", | |
| 155 | - accel_group, key, mods, | |
| 156 | - GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); | |
| 157 | - } | |
| 158 | - if (entries[i].func) | |
| 159 | - g_signal_connect (G_OBJECT (entries[i].widget), | |
| 160 | - (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 161 | - == MISC_CREATE_MENU_CHECK | |
| 162 | - || (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 163 | - == MISC_CREATE_MENU_RADIO | |
| 164 | - ? "toggled" : "activate", | |
| 165 | - G_CALLBACK (entries[i].func), entries[i].user_data); | |
| 166 | - if (entries[i].menu_type & MISC_CREATE_MENU_DISABLE) | |
| 167 | - gtk_widget_set_sensitive (entries[i].widget, FALSE); | |
| 168 | - } | |
| 169 | - } | |
| 170 | -} | |
| 171 | - | |
| 172 | - | |
| 173 | -/* ja:メニューを検索する | |
| 174 | - entries,メニュー構造体 | |
| 175 | - path,パス | |
| 176 | - RET,メニューアイテム */ | |
| 177 | -GtkWidget * | |
| 178 | -misc_find_menu (MiscCreateMenuEntry *entries, | |
| 179 | - const gchar *path) | |
| 180 | -{ | |
| 181 | - gint i; | |
| 182 | - | |
| 183 | - for (i = 0; entries[i].menu_type != MISC_CREATE_MENU_TERMINAL; i++) | |
| 184 | - if (g_strcmp (entries[i].path, path) == 0) | |
| 185 | - return entries[i].widget; | |
| 186 | - return NULL; | |
| 187 | -} | |
| 188 | - | |
| 189 | - | |
| 190 | -/* ja:ツールバーを作成する | |
| 191 | - entries,ツールバー構造体 | |
| 192 | - RET,ツールバー */ | |
| 193 | -GtkWidget * | |
| 194 | -misc_create_toolbar (MiscCreateToolbarEntry *entries) | |
| 195 | -{ | |
| 196 | - gint i; | |
| 197 | -#if ! GTK_CHECK_VERSION(2,12,0) | |
| 198 | - GtkTooltips *tooltips; | |
| 199 | -#endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 200 | - GtkWidget *toolbar; | |
| 201 | - | |
| 202 | - toolbar = gtk_toolbar_new (); | |
| 203 | -#if GTK_CHECK_VERSION(2,16,0) | |
| 204 | - gtk_orientable_set_orientation (GTK_ORIENTABLE (toolbar), | |
| 205 | - GTK_ORIENTATION_HORIZONTAL); | |
| 206 | -#else /* not GTK_CHECK_VERSION(2,16,0) */ | |
| 207 | - gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), | |
| 208 | - GTK_ORIENTATION_HORIZONTAL); | |
| 209 | -#endif /* not GTK_CHECK_VERSION(2,16,0) */ | |
| 210 | - gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS); | |
| 211 | -#if ! GTK_CHECK_VERSION(2,14,0) | |
| 212 | - gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), TRUE); | |
| 213 | -#endif /* not GTK_CHECK_VERSION(2,14,0) */ | |
| 214 | -#if GTK_CHECK_VERSION(2,4,0) | |
| 215 | - gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE); | |
| 216 | -#endif /* GTK_CHECK_VERSION(2,4,0) */ | |
| 217 | -#if ! GTK_CHECK_VERSION(2,12,0) | |
| 218 | - tooltips = gtk_tooltips_new (); | |
| 219 | -#endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 220 | - for (i = 0; entries[i].path; i++) | |
| 221 | - { | |
| 222 | - if (entries[i].name) | |
| 223 | - { | |
| 224 | - if (entries[i].xpm) | |
| 225 | - { | |
| 226 | - GdkPixbuf *pixbuf; | |
| 227 | - | |
| 228 | - pixbuf = gdk_pixbuf_new_from_xpm_data (entries[i].xpm); | |
| 229 | -#if GTK_CHECK_VERSION(2,4,0) | |
| 230 | - entries[i].tool_item = gtk_tool_button_new | |
| 231 | - (gtk_image_new_from_pixbuf (pixbuf), _(entries[i].name)); | |
| 232 | -# if GTK_CHECK_VERSION(2,12,0) | |
| 233 | - gtk_tool_item_set_tooltip_text (entries[i].tool_item, | |
| 234 | - _(entries[i].name)); | |
| 235 | -# else /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 236 | - gtk_tool_item_set_tooltip (entries[i].tool_item, tooltips, | |
| 237 | - _(entries[i].name), _(entries[i].name)); | |
| 238 | -# endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 239 | -#else /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 240 | - entries[i].tool_item = gtk_toolbar_append_item | |
| 241 | - (GTK_TOOLBAR (toolbar), | |
| 242 | - _(entries[i].name), | |
| 243 | - _(entries[i].name), | |
| 244 | - _(entries[i].name), | |
| 245 | - gtk_image_new_from_pixbuf (pixbuf), | |
| 246 | - G_CALLBACK (entries[i].func), | |
| 247 | - NULL); | |
| 248 | -#endif /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 249 | - g_object_unref (pixbuf); | |
| 250 | - } | |
| 251 | - else | |
| 252 | - { | |
| 253 | - gchar *text; | |
| 254 | - GtkStockItem stock_item; | |
| 255 | - | |
| 256 | - gtk_stock_lookup (entries[i].name, &stock_item); | |
| 257 | - text = misc_mnemonic_to_text (stock_item.label); | |
| 258 | -#if GTK_CHECK_VERSION(2,4,0) | |
| 259 | - entries[i].tool_item = gtk_tool_button_new_from_stock | |
| 260 | - (entries[i].name); | |
| 261 | -# if GTK_CHECK_VERSION(2,12,0) | |
| 262 | - gtk_tool_item_set_tooltip_text (entries[i].tool_item, text); | |
| 263 | -# else /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 264 | - gtk_tool_item_set_tooltip (entries[i].tool_item, tooltips, | |
| 265 | - text, text); | |
| 266 | -# endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 267 | -#else /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 268 | - entries[i].tool_item = gtk_toolbar_insert_stock | |
| 269 | - (GTK_TOOLBAR (toolbar), | |
| 270 | - entries[i].name, | |
| 271 | - text, | |
| 272 | - text, | |
| 273 | - G_CALLBACK (entries[i].func), | |
| 274 | - NULL, | |
| 275 | - -1); | |
| 276 | -#endif /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 277 | - g_free (text); | |
| 278 | - } | |
| 279 | -#if GTK_CHECK_VERSION(2,4,0) | |
| 280 | - if (entries[i].func) | |
| 281 | - g_signal_connect (G_OBJECT (entries[i].tool_item), "clicked", | |
| 282 | - G_CALLBACK (entries[i].func), entries[i].user_data); | |
| 283 | -#endif /* GTK_CHECK_VERSION(2,4,0) */ | |
| 284 | - } | |
| 285 | - else | |
| 286 | - { | |
| 287 | -#if GTK_CHECK_VERSION(2,4,0) | |
| 288 | - entries[i].tool_item = gtk_separator_tool_item_new (); | |
| 289 | -#else /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 290 | - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); | |
| 291 | -#endif /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 292 | - } | |
| 293 | -#if GTK_CHECK_VERSION(2,4,0) | |
| 294 | - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), entries[i].tool_item, i); | |
| 295 | -#endif /* GTK_CHECK_VERSION(2,4,0) */ | |
| 296 | - } | |
| 297 | - return toolbar; | |
| 298 | -} | |
| 299 | - | |
| 300 | - | |
| 301 | -/* ja:ツールバーを検索する | |
| 302 | - entries,ツールバー構造体 | |
| 303 | - path,パス | |
| 304 | - RET,ツールアイテム */ | |
| 305 | -GtkToolItem * | |
| 306 | -misc_find_toolbar (MiscCreateToolbarEntry *entries, | |
| 307 | - const gchar *path) | |
| 308 | -{ | |
| 309 | - gint i; | |
| 310 | - | |
| 311 | - for (i = 0; entries[i].path; i++) | |
| 312 | - if (g_strcmp (entries[i].path, path) == 0) | |
| 313 | - return entries[i].tool_item; | |
| 314 | - return NULL; | |
| 315 | -} | |
| 316 | - | |
| 317 | - | |
| 318 | -/****************************************************************************** | |
| 319 | -* * | |
| 320 | -* ja:特定ファイル関数群 * | |
| 321 | -* * | |
| 322 | -******************************************************************************/ | |
| 323 | -/* ja:ユーザ設定ファイルを取得する | |
| 324 | - group,グループ | |
| 325 | - name,アプリケーション名 | |
| 326 | - file,ファイル名 | |
| 327 | - RET,ユーザ設定ファイル */ | |
| 328 | -const gchar * | |
| 329 | -misc_spec_config (const gchar *group, | |
| 330 | - const gchar *name, | |
| 331 | - const gchar *file) | |
| 332 | -{ | |
| 333 | - const static gchar *config = NULL; | |
| 334 | - gchar *filename; | |
| 335 | -#if ! GLIB_CHECK_VERSION(2,6,0) && defined (G_OS_WIN32) | |
| 336 | - LPITEMIDLIST pidl = NULL; | |
| 337 | -#endif /* ! GLIB_CHECK_VERSION(2,6,0) && defined (G_OS_WIN32) */ | |
| 338 | - | |
| 339 | - if (config) | |
| 340 | - return config; | |
| 341 | -#ifdef G_OS_WIN32 | |
| 342 | - filename = g_strconcat (file, ".ini", NULL); | |
| 343 | -# if GLIB_CHECK_VERSION(2,6,0) | |
| 344 | - config = g_build_filename (g_get_user_config_dir (), | |
| 345 | - group, name, filename, NULL); | |
| 346 | - if (!config) | |
| 347 | - { | |
| 348 | - LPITEMIDLIST pidl = NULL; | |
| 349 | -# endif /* GLIB_CHECK_VERSION(2,6,0) */ | |
| 350 | - if (SHGetSpecialFolderLocation (NULL, CSIDL_APPDATA, &pidl) == S_OK) | |
| 351 | - { | |
| 352 | -# if ! GLIB_CHECK_VERSION(2,6,0) | |
| 353 | - TCHAR szPath[MAX_PATH + 1]; | |
| 354 | -# endif /* not GLIB_CHECK_VERSION(2,6,0) */ | |
| 355 | - | |
| 356 | -# if GLIB_CHECK_VERSION(2,6,0) | |
| 357 | - if (G_WIN32_HAVE_WIDECHAR_API ()) | |
| 358 | - { | |
| 359 | - WCHAR szPath[MAX_PATH + 1]; | |
| 360 | -# endif /* GLIB_CHECK_VERSION(2,6,0) */ | |
| 361 | -# if GLIB_CHECK_VERSION(2,6,0) || defined (UNICODE) | |
| 362 | - if (SHGetPathFromIDListW (pidl, szPath)) | |
| 363 | - { | |
| 364 | - gchar *utf8str; | |
| 365 | - | |
| 366 | - utf8str = g_utf16_to_utf8 (szPath, -1, NULL, NULL, NULL); | |
| 367 | - if (utf8str) | |
| 368 | - { | |
| 369 | - gchar *dir; | |
| 370 | - | |
| 371 | - dir = g_filename_from_utf8 | |
| 372 | - (utf8str, -1, NULL, NULL, NULL); | |
| 373 | - g_free (utf8str); | |
| 374 | - if (dir) | |
| 375 | - { | |
| 376 | - config = g_build_filename | |
| 377 | - (dir, group, name, filename, NULL); | |
| 378 | - g_free (dir); | |
| 379 | - } | |
| 380 | - } | |
| 381 | - } | |
| 382 | -# endif /* GLIB_CHECK_VERSION(2,6,0) || defined (UNICODE) */ | |
| 383 | -# if GLIB_CHECK_VERSION(2,6,0) | |
| 384 | - } | |
| 385 | - else | |
| 386 | - { | |
| 387 | - CHAR szPath[MAX_PATH + 1]; | |
| 388 | -# endif /* GLIB_CHECK_VERSION(2,6,0) */ | |
| 389 | -# if GLIB_CHECK_VERSION(2,6,0) || ! defined (UNICODE) | |
| 390 | - if (SHGetPathFromIDListA (pidl, szPath)) | |
| 391 | -# if GLIB_CHECK_VERSION(2,6,0) | |
| 392 | - { | |
| 393 | - gchar *utf8str; | |
| 394 | - | |
| 395 | - utf8str = g_locale_to_utf8 (szPath, -1, NULL, NULL, NULL); | |
| 396 | - if (utf8str) | |
| 397 | - { | |
| 398 | - gchar *path; | |
| 399 | - | |
| 400 | - path = g_filename_from_utf8 | |
| 401 | - (utf8str, -1, NULL, NULL, NULL); | |
| 402 | - if (path) | |
| 403 | - { | |
| 404 | - config = g_build_filename | |
| 405 | - (path, group, name, filename, NULL); | |
| 406 | - g_free (path); | |
| 407 | - } | |
| 408 | - g_free (utf8str); | |
| 409 | - } | |
| 410 | - } | |
| 411 | -# else /* not GLIB_CHECK_VERSION(2,6,0) */ | |
| 412 | - config = g_build_filename | |
| 413 | - (szPath, group, name, filename, NULL); | |
| 414 | -# endif /* not GLIB_CHECK_VERSION(2,6,0) */ | |
| 415 | -# endif /* GLIB_CHECK_VERSION(2,6,0) || ! defined (UNICODE) */ | |
| 416 | -# if GLIB_CHECK_VERSION(2,6,0) | |
| 417 | - } | |
| 418 | -# endif /* GLIB_CHECK_VERSION(2,6,0) */ | |
| 419 | - CoTaskMemFree (pidl); | |
| 420 | - } | |
| 421 | -# if GLIB_CHECK_VERSION(2,6,0) | |
| 422 | - } | |
| 423 | -# else /* not GLIB_CHECK_VERSION(2,6,0) */ | |
| 424 | - else | |
| 425 | - { | |
| 426 | - config = NULL; | |
| 427 | - } | |
| 428 | -# endif /* not GLIB_CHECK_VERSION(2,6,0) */ | |
| 429 | - if (!config) | |
| 430 | - config = g_build_filename (g_get_home_dir (), group, name, filename, NULL); | |
| 431 | -#else /* not G_OS_WIN32 */ | |
| 432 | - gchar *dir; | |
| 433 | - | |
| 434 | - dir = g_strconcat (".", group, NULL); | |
| 435 | - filename = g_strconcat (file, ".conf", NULL); | |
| 436 | - config = g_build_filename (g_get_home_dir (), dir, name, filename, NULL); | |
| 437 | - g_free (dir); | |
| 438 | -#endif /* not G_OS_WIN32 */ | |
| 439 | - g_free (filename); | |
| 440 | - return config; | |
| 441 | -} | |
| 442 | - | |
| 443 | - | |
| 444 | -/* ja:ロケールのディレクトリを取得する | |
| 445 | - prgname,プログラム | |
| 446 | - RET,ロケールのディレクトリ */ | |
| 447 | -const gchar * | |
| 448 | -misc_spec_locale (const gchar *prgname) | |
| 449 | -{ | |
| 450 | -#ifdef LOCALEDIR | |
| 451 | - return LOCALEDIR; | |
| 452 | -#else /* not LOCALEDIR */ | |
| 453 | - static gchar *locale = NULL; | |
| 454 | - gchar *dirname, *path; | |
| 455 | -# ifdef G_OS_WIN32 | |
| 456 | - gchar *tmp; | |
| 457 | -# endif /* G_OS_WIN32 */ | |
| 458 | - | |
| 459 | - if (locale) | |
| 460 | - return locale; | |
| 461 | - path = fileio_get_full_path (prgname); | |
| 462 | - dirname = g_path_get_dirname (path); | |
| 463 | - g_free (path); | |
| 464 | - locale = g_build_filename (dirname, "locale", NULL); | |
| 465 | - g_free (dirname); | |
| 466 | -# ifdef G_OS_WIN32 | |
| 467 | - if (!g_file_test (locale, G_FILE_TEST_EXISTS)) | |
| 468 | - { | |
| 469 | - g_free (locale); | |
| 470 | -# if GLIB_CHECK_VERSION(2,16,0) | |
| 471 | - dirname = g_win32_get_package_installation_directory_of_module (NULL); | |
| 472 | - locale = g_build_filename (dirname, "share", "locale", NULL); | |
| 473 | - g_free (dirname); | |
| 474 | -# else /* not GLIB_CHECK_VERSION(2,16,0) */ | |
| 475 | - locale = g_win32_get_package_installation_subdirectory | |
| 476 | - (NULL, prgname, "share" G_DIR_SEPARATOR_S "locale"); | |
| 477 | -# endif /* not GLIB_CHECK_VERSION(2,16,0) */ | |
| 478 | - } | |
| 479 | - tmp = g_win32_locale_filename_from_utf8 (locale); | |
| 480 | - g_free (locale); | |
| 481 | - locale = tmp; | |
| 482 | -# endif /* G_OS_WIN32 */ | |
| 483 | - return locale; | |
| 484 | -#endif /* not LOCALEDIR */ | |
| 485 | -} | |
| 486 | - | |
| 487 | - | |
| 488 | -/****************************************************************************** | |
| 489 | -* * | |
| 490 | -* ja:クローズボタン関数群 * | |
| 491 | -* * | |
| 492 | -******************************************************************************/ | |
| 493 | -/* ja:クローズボタンのイメージを取得する | |
| 494 | - RET,イメージ,NULL:エラー */ | |
| 495 | -GtkWidget * | |
| 496 | -misc_close_image (void) | |
| 497 | -{ | |
| 498 | - GtkIconSet *icon_set; | |
| 499 | - GtkWidget *image = NULL; | |
| 500 | - | |
| 501 | - icon_set = gtk_icon_factory_lookup_default (GTK_STOCK_CLOSE); | |
| 502 | - if (icon_set) | |
| 503 | - { | |
| 504 | - GdkPixbuf *pixbuf; | |
| 505 | - | |
| 506 | - pixbuf = gtk_icon_set_render_icon (icon_set, | |
| 507 | - gtk_widget_get_default_style (), | |
| 508 | - GTK_TEXT_DIR_NONE, | |
| 509 | - GTK_STATE_NORMAL, | |
| 510 | - GTK_ICON_SIZE_MENU, | |
| 511 | - NULL, NULL); | |
| 512 | - if (pixbuf) | |
| 513 | - { | |
| 514 | - if (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB | |
| 515 | - && gdk_pixbuf_get_n_channels (pixbuf) == 4 | |
| 516 | - && gdk_pixbuf_get_has_alpha (pixbuf) | |
| 517 | - && gdk_pixbuf_get_bits_per_sample (pixbuf) == 8) | |
| 518 | - { | |
| 519 | - int width, height, rowstride; | |
| 520 | - gint x, y, left, top, right, bottom; | |
| 521 | - guchar *pixels; | |
| 522 | - | |
| 523 | - pixels = gdk_pixbuf_get_pixels (pixbuf); | |
| 524 | - width = gdk_pixbuf_get_width (pixbuf); | |
| 525 | - height = gdk_pixbuf_get_height (pixbuf); | |
| 526 | - rowstride = gdk_pixbuf_get_rowstride (pixbuf); | |
| 527 | - for (x = 0; x < width; x++) | |
| 528 | - for (y = 0; y < height; y++) | |
| 529 | - if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 530 | - goto loop_left; | |
| 531 | - loop_left: left = x; | |
| 532 | - for (y = 0; y < height; y++) | |
| 533 | - for (x = 0; x < width; x++) | |
| 534 | - if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 535 | - goto loop_top; | |
| 536 | - loop_top: top = y; | |
| 537 | - for (x = width - 1; x >= 0; x--) | |
| 538 | - for (y = 0; y < height; y++) | |
| 539 | - if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 540 | - goto loop_right; | |
| 541 | - loop_right: right = x; | |
| 542 | - for (y = height - 1; y >= 0; y--) | |
| 543 | - for (x = 0; x < width; x++) | |
| 544 | - if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 545 | - goto loop_bottom; | |
| 546 | - loop_bottom: bottom = y; | |
| 547 | - if (left <= right && top <= bottom) | |
| 548 | - { | |
| 549 | - int w, h, r; | |
| 550 | - guchar *p; | |
| 551 | - gint i; | |
| 552 | - GdkPixbuf *b; | |
| 553 | - | |
| 554 | - w = right - left + 1; | |
| 555 | - h = bottom - top + 1; | |
| 556 | - b = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, w, h); | |
| 557 | - p = gdk_pixbuf_get_pixels (b); | |
| 558 | - r = gdk_pixbuf_get_rowstride (b); | |
| 559 | - for (x = 0; x < w; x++) | |
| 560 | - for (y = 0; y < h; y++) | |
| 561 | - for (i = 0; i < 4; i++) | |
| 562 | - p[y * r + x * 4 + i] | |
| 563 | - = pixels[(y + top) * rowstride + (x + left) * 4 + i]; | |
| 564 | - image = gtk_image_new_from_pixbuf (b); | |
| 565 | - g_object_unref (b); | |
| 566 | - } | |
| 567 | - } | |
| 568 | - g_object_unref (pixbuf); | |
| 569 | - } | |
| 570 | - } | |
| 571 | - if (!image) | |
| 572 | - image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); | |
| 573 | - if (!image) | |
| 574 | - { | |
| 575 | - GdkPixbuf *pixbuf; | |
| 576 | - const static gchar *xpm[] = { | |
| 577 | -"12 13 4 1", | |
| 578 | -" c None", | |
| 579 | -"X c #000000", | |
| 580 | -"+ c #808080", | |
| 581 | -". c #FFFFFF", | |
| 582 | -"+++++++++++.", | |
| 583 | -"+.........+.", | |
| 584 | -"+. +.", | |
| 585 | -"+.XX XX+.", | |
| 586 | -"+. XX XX +.", | |
| 587 | -"+. XXXX +.", | |
| 588 | -"+. XX +.", | |
| 589 | -"+. XXXX +.", | |
| 590 | -"+. XX XX +.", | |
| 591 | -"+.XX XX+.", | |
| 592 | -"+. +.", | |
| 593 | -"+++++++++++.", | |
| 594 | -"............"}; | |
| 595 | - | |
| 596 | - pixbuf = gdk_pixbuf_new_from_xpm_data (xpm); | |
| 597 | - image = gtk_image_new_from_pixbuf (pixbuf); | |
| 598 | - g_object_unref (pixbuf); | |
| 599 | - } | |
| 600 | - return image; | |
| 601 | -} | |
| 602 | - | |
| 603 | - | |
| 604 | -/* ja:クローズボタンを取得する | |
| 605 | - RET,ボタン,NULL:エラー */ | |
| 606 | -GtkWidget * | |
| 607 | -misc_close_button (void) | |
| 608 | -{ | |
| 609 | - GtkWidget *button = NULL, *image; | |
| 610 | - | |
| 611 | - image = misc_close_image (); | |
| 612 | - if (image) | |
| 613 | - { | |
| 614 | - button = gtk_button_new (); | |
| 615 | - gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); | |
| 616 | - gtk_container_add (GTK_CONTAINER (button), image); | |
| 617 | - gtk_widget_show (image); | |
| 618 | - } | |
| 619 | - return button; | |
| 620 | -} | |
| 621 | - | |
| 622 | - | |
| 623 | -/****************************************************************************** | |
| 624 | -* * | |
| 625 | -* ja:低レベル関数群 * | |
| 626 | -* * | |
| 627 | -******************************************************************************/ | |
| 628 | -/* ja:mnemonicをテキストに変換する | |
| 629 | - mnemonic,mnemonic | |
| 630 | - RET,テキスト */ | |
| 631 | -gchar * | |
| 632 | -misc_mnemonic_to_text (const gchar *mnemonic) | |
| 633 | -{ | |
| 634 | - gchar *text; | |
| 635 | - gint i; | |
| 636 | - | |
| 637 | - if (!mnemonic) | |
| 638 | - return NULL; | |
| 639 | - text = g_strdup (mnemonic); | |
| 640 | - for (i = 0; text[i] != '\0'; i++) | |
| 641 | - if (text[i] == '(' && text[i + 1] == '_' | |
| 642 | - && g_ascii_isalpha (text[i + 2]) && text[i + 3] == ')') | |
| 643 | - { | |
| 644 | - g_memmove (text + i, text + i + 4, g_strlen (text + i) - 3); | |
| 645 | - break; | |
| 646 | - } | |
| 647 | - else if (text[i] == '_' && g_ascii_isalpha (text[i + 1])) | |
| 648 | - { | |
| 649 | - g_memmove (text + i, text + i + 2, g_strlen (text + i) - 1); | |
| 650 | - break; | |
| 651 | - } | |
| 652 | - return text; | |
| 653 | -} | |
| 654 | - | |
| 655 | - | |
| 656 | -/* ja:スクロールバーを設定する | |
| 657 | - scroll,スクロールウイジット | |
| 658 | - func,シグナル関数 | |
| 659 | - func_data,データ | |
| 660 | - min,最小値 | |
| 661 | - max,最大値 | |
| 662 | - page,ページ | |
| 663 | - pos,位置 */ | |
| 664 | -void | |
| 665 | -misc_set_scroll_bar (GtkWidget *scroll, | |
| 666 | - GCallback func, | |
| 667 | - gpointer func_data, | |
| 668 | - const gint min, | |
| 669 | - const gint max, | |
| 670 | - const gint page, | |
| 671 | - const gint pos) | |
| 672 | -{ | |
| 673 | - GtkAdjustment *adjust; | |
| 674 | - | |
| 675 | - adjust = GTK_ADJUSTMENT (gtk_adjustment_new (pos, min, max, 1, page, page)); | |
| 676 | - gtk_range_set_adjustment (GTK_RANGE (scroll), adjust); | |
| 677 | - if (func) | |
| 678 | - g_signal_connect (G_OBJECT (adjust), "value-changed", func, func_data); | |
| 679 | -} | |
| 680 | - | |
| 681 | - | |
| 682 | -/* ja:Windowの内容をスクロールする | |
| 683 | - widget,ウイジット | |
| 684 | - dx,X軸方向の移動 | |
| 685 | - dy,Y軸方向の移動 | |
| 686 | - x,スクロールする範囲の右上X座標 | |
| 687 | - y,スクロールする範囲の右上Y座標 | |
| 688 | - width,スクロールする範囲の幅 | |
| 689 | - height,スクロールする範囲の高さ */ | |
| 690 | -void | |
| 691 | -misc_scroll_window (GtkWidget *widget, | |
| 692 | - const gint dx, | |
| 693 | - const gint dy, | |
| 694 | - const gint x, | |
| 695 | - const gint y, | |
| 696 | - const gint width, | |
| 697 | - const gint height) | |
| 698 | -{ | |
| 699 | - if (ABS (dx) > width || ABS (dy) > height) | |
| 700 | - { | |
| 701 | - gtk_widget_queue_draw_area (widget, x, y, width, height); | |
| 702 | - } | |
| 703 | - else if (dx != 0 || dy != 0) | |
| 704 | - { | |
| 705 | -#if GTK_CHECK_VERSION(2,24,0) | |
| 706 | - cairo_t *cr; | |
| 707 | - gint w, h, xx, yy; | |
| 708 | - GdkPixbuf *pixbuf; | |
| 709 | - GdkWindow *window; | |
| 710 | - | |
| 711 | - window = gtk_widget_get_window (widget); | |
| 712 | - cr = gdk_cairo_create (window); | |
| 713 | - w = width - ABS (dx); | |
| 714 | - h = height - ABS (dy); | |
| 715 | -# if GTK_CHECK_VERSION(3,0,0) | |
| 716 | - pixbuf = gdk_pixbuf_get_from_window (window, | |
| 717 | - dx > 0 ? x : x - dx, dy > 0 ? y : y - dy, w, h); | |
| 718 | -# else /* not GTK_CHECK_VERSION(3,0,0) */ | |
| 719 | - pixbuf = gdk_pixbuf_get_from_drawable (NULL, window, | |
| 720 | - gdk_colormap_get_system (), | |
| 721 | - dx > 0 ? x : x - dx, dy > 0 ? y : y - dy, | |
| 722 | - 0, 0, w, h); | |
| 723 | -# endif /* not GTK_CHECK_VERSION(3,0,0) */ | |
| 724 | - xx = dx > 0 ? x + dx : x; | |
| 725 | - yy = dy > 0 ? y + dy : y; | |
| 726 | - gdk_cairo_set_source_pixbuf (cr, pixbuf, xx, yy); | |
| 727 | - g_object_unref (pixbuf); | |
| 728 | - cairo_rectangle (cr, xx, yy, w, h); | |
| 729 | - cairo_fill (cr); | |
| 730 | - cairo_destroy (cr); | |
| 731 | -#else /* not GTK_CHECK_VERSION(2,24,0) */ | |
| 732 | - GdkGC *gc; | |
| 733 | - | |
| 734 | - gc = gdk_gc_new (gtk_widget_get_window (widget)); | |
| 735 | - gdk_gc_set_exposures (gc, TRUE); | |
| 736 | - gdk_draw_drawable (gtk_widget_get_window (widget), | |
| 737 | - gc, | |
| 738 | - gtk_widget_get_window (widget), | |
| 739 | - dx > 0 ? x : x - dx, | |
| 740 | - dy > 0 ? y : y - dy, | |
| 741 | - dx > 0 ? x + dx : x, | |
| 742 | - dy > 0 ? y + dy : y, | |
| 743 | - width - ABS (dx), | |
| 744 | - height - ABS (dy)); | |
| 745 | - g_object_unref (gc); | |
| 746 | -#endif /* not GTK_CHECK_VERSION(2,24,0) */ | |
| 747 | - if (dx != 0) | |
| 748 | - gtk_widget_queue_draw_area (widget, dx > 0 ? x : x + width + dx, y, | |
| 749 | - ABS (dx), height); | |
| 750 | - if (dy != 0) | |
| 751 | - gtk_widget_queue_draw_area (widget, x, dy > 0 ? y : y + height + dy, | |
| 752 | - width, ABS (dy)); | |
| 753 | - } | |
| 754 | - gdk_window_process_updates (gtk_widget_get_window (widget), TRUE); | |
| 755 | -} | |
| 756 | - | |
| 757 | - | |
| 758 | -/* ja:ESCが押されたとき */ | |
| 759 | -gboolean | |
| 760 | -misc_dialog_key_press (GtkWidget *widget, | |
| 761 | - GdkEventKey *event, | |
| 762 | - gpointer user_data) | |
| 763 | -{ | |
| 764 | - if (event->keyval == GDK_KEY_Escape) | |
| 765 | - gtk_dialog_response (GTK_DIALOG (widget), GTK_RESPONSE_NONE); | |
| 766 | - return FALSE; | |
| 767 | -} | |
| 768 | - | |
| 769 | - | |
| 770 | -/****************************************************************************** | |
| 771 | -* * | |
| 772 | 29 | * ja:数値文字列関数群 * |
| 773 | 30 | * * |
| 774 | 31 | ******************************************************************************/ |
| @@ -1196,6 +453,81 @@ | ||
| 1196 | 453 | |
| 1197 | 454 | /****************************************************************************** |
| 1198 | 455 | * * |
| 456 | +* ja:特定ファイル関数群 * | |
| 457 | +* * | |
| 458 | +******************************************************************************/ | |
| 459 | +/* ja:ユーザ設定ファイルを取得する | |
| 460 | + group,グループ | |
| 461 | + name,アプリケーション名 | |
| 462 | + file,ファイル名 | |
| 463 | + RET,ユーザ設定ファイル */ | |
| 464 | +gchar * | |
| 465 | +misc_spec_config (const gchar *group, | |
| 466 | + const gchar *name, | |
| 467 | + const gchar *file) | |
| 468 | +{ | |
| 469 | + gchar *config, *filename; | |
| 470 | + | |
| 471 | +#ifdef G_OS_WIN32 | |
| 472 | + filename = g_strconcat (file, ".ini", NULL); | |
| 473 | + config = g_build_filename (g_get_user_config_dir (), | |
| 474 | + group, name, filename, NULL); | |
| 475 | +#else /* not G_OS_WIN32 */ | |
| 476 | + gchar *dir; | |
| 477 | + | |
| 478 | + dir = g_strconcat (".", group, NULL); | |
| 479 | + filename = g_strconcat (file, ".conf", NULL); | |
| 480 | + config = g_build_filename (g_get_home_dir (), dir, name, filename, NULL); | |
| 481 | + g_free (dir); | |
| 482 | +#endif /* not G_OS_WIN32 */ | |
| 483 | + g_free (filename); | |
| 484 | + return config; | |
| 485 | +} | |
| 486 | + | |
| 487 | + | |
| 488 | +/* ja:ロケールのディレクトリを取得する | |
| 489 | + prgname,プログラム | |
| 490 | + RET,ロケールのディレクトリ */ | |
| 491 | +gchar * | |
| 492 | +misc_spec_locale (const gchar *prgname) | |
| 493 | +{ | |
| 494 | +#ifdef LOCALEDIR | |
| 495 | + return g_strdup (LOCALEDIR); | |
| 496 | +#else /* not LOCALEDIR */ | |
| 497 | + gchar *locale, *dirname, *path; | |
| 498 | +# ifdef G_OS_WIN32 | |
| 499 | + gchar *tmp; | |
| 500 | +# endif /* G_OS_WIN32 */ | |
| 501 | + | |
| 502 | + path = fileio_get_full_path (prgname); | |
| 503 | + dirname = g_path_get_dirname (path); | |
| 504 | + g_free (path); | |
| 505 | + locale = g_build_filename (dirname, "locale", NULL); | |
| 506 | + g_free (dirname); | |
| 507 | +# ifdef G_OS_WIN32 | |
| 508 | + if (!g_file_test (locale, G_FILE_TEST_EXISTS)) | |
| 509 | + { | |
| 510 | + g_free (locale); | |
| 511 | +# if GLIB_CHECK_VERSION(2,16,0) | |
| 512 | + dirname = g_win32_get_package_installation_directory_of_module (NULL); | |
| 513 | + locale = g_build_filename (dirname, "share", "locale", NULL); | |
| 514 | + g_free (dirname); | |
| 515 | +# else /* not GLIB_CHECK_VERSION(2,16,0) */ | |
| 516 | + locale = g_win32_get_package_installation_subdirectory | |
| 517 | + (NULL, prgname, "share" G_DIR_SEPARATOR_S "locale"); | |
| 518 | +# endif /* not GLIB_CHECK_VERSION(2,16,0) */ | |
| 519 | + } | |
| 520 | + tmp = g_win32_locale_filename_from_utf8 (locale); | |
| 521 | + g_free (locale); | |
| 522 | + locale = tmp; | |
| 523 | +# endif /* G_OS_WIN32 */ | |
| 524 | + return locale; | |
| 525 | +#endif /* not LOCALEDIR */ | |
| 526 | +} | |
| 527 | + | |
| 528 | + | |
| 529 | +/****************************************************************************** | |
| 530 | +* * | |
| 1199 | 531 | * ja:日時文字列関数群 * |
| 1200 | 532 | * * |
| 1201 | 533 | ******************************************************************************/ |
| @@ -1304,9 +636,8 @@ | ||
| 1304 | 636 | glong value; |
| 1305 | 637 | |
| 1306 | 638 | value = g_strtol (cymdhms, &endptr, 0); |
| 1307 | - if (g_strcasecmp (endptr, "u") == 0) | |
| 639 | + if (g_ascii_strcasecmp (endptr, "u") == 0) | |
| 1308 | 640 | dt0 = g_date_time_new_from_unix_utc (value); |
| 1309 | - | |
| 1310 | 641 | } |
| 1311 | 642 | else |
| 1312 | 643 | { |
| @@ -1321,7 +652,7 @@ | ||
| 1321 | 652 | gdouble value; |
| 1322 | 653 | |
| 1323 | 654 | value = g_strtod (tmp, &endptr); |
| 1324 | - if (g_strcasecmp (endptr, "s") == 0) | |
| 655 | + if (g_ascii_strcasecmp (endptr, "s") == 0) | |
| 1325 | 656 | dt0 = g_date_time_add_seconds (dt1, value); |
| 1326 | 657 | } |
| 1327 | 658 | else |
| @@ -1330,15 +661,15 @@ | ||
| 1330 | 661 | glong value; |
| 1331 | 662 | |
| 1332 | 663 | value = g_strtol (tmp, &endptr, 0); |
| 1333 | - if (g_strcasecmp (endptr, "y") == 0) | |
| 664 | + if (g_ascii_strcasecmp (endptr, "y") == 0) | |
| 1334 | 665 | dt0 = g_date_time_add_years (dt1, value); |
| 1335 | 666 | else if (g_strcmp (endptr, "M") == 0) |
| 1336 | 667 | dt0 = g_date_time_add_months (dt1, value); |
| 1337 | - else if (g_strcasecmp (endptr, "w") == 0) | |
| 668 | + else if (g_ascii_strcasecmp (endptr, "w") == 0) | |
| 1338 | 669 | dt0 = g_date_time_add_weeks (dt1, value); |
| 1339 | - else if (g_strcasecmp (endptr, "d") == 0) | |
| 670 | + else if (g_ascii_strcasecmp (endptr, "d") == 0) | |
| 1340 | 671 | dt0 = g_date_time_add_days (dt1, value); |
| 1341 | - else if (g_strcasecmp (endptr, "h") == 0) | |
| 672 | + else if (g_ascii_strcasecmp (endptr, "h") == 0) | |
| 1342 | 673 | dt0 = g_date_time_add_hours (dt1, value); |
| 1343 | 674 | else if (g_strcmp (endptr, "m") == 0) |
| 1344 | 675 | dt0 = g_date_time_add_minutes (dt1, value); |
| @@ -1446,3 +777,578 @@ | ||
| 1446 | 777 | } |
| 1447 | 778 | return epoch; |
| 1448 | 779 | } |
| 780 | + | |
| 781 | + | |
| 782 | +#ifndef USE_GTK_EMULATE | |
| 783 | +/****************************************************************************** | |
| 784 | +* * | |
| 785 | +* ja:メニュー/ツールバー関数群 * | |
| 786 | +* * | |
| 787 | +******************************************************************************/ | |
| 788 | +/* ja:メニューを作成する | |
| 789 | + entries,メニュー構造体 | |
| 790 | + accel_group,アクセルグループ */ | |
| 791 | +void | |
| 792 | +misc_create_menu (MiscCreateMenuEntry *entries, | |
| 793 | + GtkAccelGroup *accel_group) | |
| 794 | +{ | |
| 795 | + gint i; | |
| 796 | + | |
| 797 | + for (i = 0; (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 798 | + != MISC_CREATE_MENU_TERMINAL; i++) | |
| 799 | + switch (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 800 | + { | |
| 801 | + case MISC_CREATE_MENU_BAR: | |
| 802 | + entries[i].widget = gtk_menu_bar_new (); | |
| 803 | + break; | |
| 804 | + case MISC_CREATE_MENU_SHELL: | |
| 805 | + { | |
| 806 | + gchar *path, *p; | |
| 807 | + gint j; | |
| 808 | + | |
| 809 | + entries[i].widget = gtk_menu_new (); | |
| 810 | + path = g_strdup (entries[i].path); | |
| 811 | + p = g_strrchr (path, '/'); | |
| 812 | + *p = '\0'; | |
| 813 | + for (j = 0; j < i; j++) | |
| 814 | + if (g_strcmp (entries[j].path, path) == 0) | |
| 815 | + { | |
| 816 | + gtk_menu_item_set_submenu (GTK_MENU_ITEM (entries[j].widget), | |
| 817 | + entries[i].widget); | |
| 818 | + break; | |
| 819 | + } | |
| 820 | + g_free (path); | |
| 821 | + } | |
| 822 | + break; | |
| 823 | + default: | |
| 824 | + { | |
| 825 | + gchar *path, *p; | |
| 826 | + gint j; | |
| 827 | + | |
| 828 | + switch (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 829 | + { | |
| 830 | + case MISC_CREATE_MENU_STOCK: | |
| 831 | + if (entries[i].menu_type & MISC_CREATE_MENU_NOIMAGE) | |
| 832 | + { | |
| 833 | + GtkStockItem stock_item; | |
| 834 | + | |
| 835 | + gtk_stock_lookup (entries[i].name, &stock_item); | |
| 836 | + entries[i].widget = gtk_image_menu_item_new_with_mnemonic | |
| 837 | + (stock_item.label); | |
| 838 | + } | |
| 839 | + else | |
| 840 | + { | |
| 841 | + entries[i].widget = gtk_image_menu_item_new_from_stock | |
| 842 | + (entries[i].name, | |
| 843 | + entries[i].accel ? NULL : accel_group); | |
| 844 | + } | |
| 845 | + break; | |
| 846 | + case MISC_CREATE_MENU_ITEM: | |
| 847 | + if (entries[i].xpm | |
| 848 | + && !(entries[i].menu_type & MISC_CREATE_MENU_NOIMAGE)) | |
| 849 | + { | |
| 850 | + GdkPixbuf *pixbuf; | |
| 851 | + | |
| 852 | + entries[i].widget = gtk_image_menu_item_new_with_mnemonic | |
| 853 | + (_(entries[i].name)); | |
| 854 | + pixbuf = gdk_pixbuf_new_from_xpm_data (entries[i].xpm); | |
| 855 | + gtk_image_menu_item_set_image | |
| 856 | + (GTK_IMAGE_MENU_ITEM (entries[i].widget), | |
| 857 | + gtk_image_new_from_pixbuf (pixbuf)); | |
| 858 | + g_object_unref (pixbuf); | |
| 859 | + } | |
| 860 | + else | |
| 861 | + { | |
| 862 | + entries[i].widget = gtk_menu_item_new_with_mnemonic | |
| 863 | + (_(entries[i].name)); | |
| 864 | + } | |
| 865 | + break; | |
| 866 | + case MISC_CREATE_MENU_CHECK: | |
| 867 | + entries[i].widget = gtk_check_menu_item_new_with_mnemonic | |
| 868 | + (_(entries[i].name)); | |
| 869 | + break; | |
| 870 | + case MISC_CREATE_MENU_RADIO: | |
| 871 | + entries[i].widget = gtk_radio_menu_item_new_with_mnemonic | |
| 872 | + (i > 0 | |
| 873 | + && (entries[i - 1].menu_type & MISC_CREATE_MENU_MASK) | |
| 874 | + == MISC_CREATE_MENU_RADIO | |
| 875 | + ? gtk_radio_menu_item_get_group | |
| 876 | + (GTK_RADIO_MENU_ITEM (entries[i - 1].widget)) | |
| 877 | + : NULL, _(entries[i].name)); | |
| 878 | + break; | |
| 879 | + default: | |
| 880 | + entries[i].widget = gtk_separator_menu_item_new (); | |
| 881 | + } | |
| 882 | + if (entries[i].menu_type & MISC_CREATE_MENU_ELLIPSIS) | |
| 883 | + { | |
| 884 | + gchar *mnemonic; | |
| 885 | + GtkWidget *label; | |
| 886 | + | |
| 887 | + label = gtk_bin_get_child (GTK_BIN (entries[i].widget)); | |
| 888 | + mnemonic = g_strconcat | |
| 889 | + (gtk_label_get_label (GTK_LABEL (label)), "...", NULL); | |
| 890 | + gtk_label_set_text_with_mnemonic (GTK_LABEL (label), mnemonic); | |
| 891 | + g_free (mnemonic); | |
| 892 | + } | |
| 893 | + path = g_strdup (entries[i].path); | |
| 894 | + p = g_strrchr (path, '/') + 1 ; | |
| 895 | + *p = '\0'; | |
| 896 | + for (j = 0; j < i; j++) | |
| 897 | + if (g_strcmp (entries[j].path, path) == 0) | |
| 898 | + { | |
| 899 | + gtk_menu_shell_append (GTK_MENU_SHELL (entries[j].widget), | |
| 900 | + entries[i].widget); | |
| 901 | + break; | |
| 902 | + } | |
| 903 | + g_free (path); | |
| 904 | + if (accel_group && entries[i].accel && entries[i].accel[0] != '\0') | |
| 905 | + { | |
| 906 | + guint key; | |
| 907 | + GdkModifierType mods; | |
| 908 | + | |
| 909 | + gtk_accelerator_parse (entries[i].accel, &key, &mods); | |
| 910 | + gtk_widget_add_accelerator (entries[i].widget, "activate", | |
| 911 | + accel_group, key, mods, | |
| 912 | + GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED); | |
| 913 | + } | |
| 914 | + if (entries[i].func) | |
| 915 | + g_signal_connect (G_OBJECT (entries[i].widget), | |
| 916 | + (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 917 | + == MISC_CREATE_MENU_CHECK | |
| 918 | + || (entries[i].menu_type & MISC_CREATE_MENU_MASK) | |
| 919 | + == MISC_CREATE_MENU_RADIO | |
| 920 | + ? "toggled" : "activate", | |
| 921 | + G_CALLBACK (entries[i].func), entries[i].user_data); | |
| 922 | + if (entries[i].menu_type & MISC_CREATE_MENU_DISABLE) | |
| 923 | + gtk_widget_set_sensitive (entries[i].widget, FALSE); | |
| 924 | + } | |
| 925 | + } | |
| 926 | +} | |
| 927 | + | |
| 928 | + | |
| 929 | +/* ja:メニューを検索する | |
| 930 | + entries,メニュー構造体 | |
| 931 | + path,パス | |
| 932 | + RET,メニューアイテム */ | |
| 933 | +GtkWidget * | |
| 934 | +misc_find_menu (MiscCreateMenuEntry *entries, | |
| 935 | + const gchar *path) | |
| 936 | +{ | |
| 937 | + gint i; | |
| 938 | + | |
| 939 | + for (i = 0; entries[i].menu_type != MISC_CREATE_MENU_TERMINAL; i++) | |
| 940 | + if (g_strcmp (entries[i].path, path) == 0) | |
| 941 | + return entries[i].widget; | |
| 942 | + return NULL; | |
| 943 | +} | |
| 944 | + | |
| 945 | + | |
| 946 | +/* ja:ツールバーを作成する | |
| 947 | + entries,ツールバー構造体 | |
| 948 | + RET,ツールバー */ | |
| 949 | +GtkWidget * | |
| 950 | +misc_create_toolbar (MiscCreateToolbarEntry *entries) | |
| 951 | +{ | |
| 952 | + gint i; | |
| 953 | +#if ! GTK_CHECK_VERSION(2,12,0) | |
| 954 | + GtkTooltips *tooltips; | |
| 955 | +#endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 956 | + GtkWidget *toolbar; | |
| 957 | + | |
| 958 | + toolbar = gtk_toolbar_new (); | |
| 959 | +#if GTK_CHECK_VERSION(2,16,0) | |
| 960 | + gtk_orientable_set_orientation (GTK_ORIENTABLE (toolbar), | |
| 961 | + GTK_ORIENTATION_HORIZONTAL); | |
| 962 | +#else /* not GTK_CHECK_VERSION(2,16,0) */ | |
| 963 | + gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), | |
| 964 | + GTK_ORIENTATION_HORIZONTAL); | |
| 965 | +#endif /* not GTK_CHECK_VERSION(2,16,0) */ | |
| 966 | + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS); | |
| 967 | +#if ! GTK_CHECK_VERSION(2,14,0) | |
| 968 | + gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), TRUE); | |
| 969 | +#endif /* not GTK_CHECK_VERSION(2,14,0) */ | |
| 970 | +#if GTK_CHECK_VERSION(2,4,0) | |
| 971 | + gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE); | |
| 972 | +#endif /* GTK_CHECK_VERSION(2,4,0) */ | |
| 973 | +#if ! GTK_CHECK_VERSION(2,12,0) | |
| 974 | + tooltips = gtk_tooltips_new (); | |
| 975 | +#endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 976 | + for (i = 0; entries[i].path; i++) | |
| 977 | + { | |
| 978 | + if (entries[i].name) | |
| 979 | + { | |
| 980 | + if (entries[i].xpm) | |
| 981 | + { | |
| 982 | + GdkPixbuf *pixbuf; | |
| 983 | + | |
| 984 | + pixbuf = gdk_pixbuf_new_from_xpm_data (entries[i].xpm); | |
| 985 | +#if GTK_CHECK_VERSION(2,4,0) | |
| 986 | + entries[i].tool_item = gtk_tool_button_new | |
| 987 | + (gtk_image_new_from_pixbuf (pixbuf), _(entries[i].name)); | |
| 988 | +# if GTK_CHECK_VERSION(2,12,0) | |
| 989 | + gtk_tool_item_set_tooltip_text (entries[i].tool_item, | |
| 990 | + _(entries[i].name)); | |
| 991 | +# else /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 992 | + gtk_tool_item_set_tooltip (entries[i].tool_item, tooltips, | |
| 993 | + _(entries[i].name), _(entries[i].name)); | |
| 994 | +# endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 995 | +#else /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 996 | + entries[i].tool_item = gtk_toolbar_append_item | |
| 997 | + (GTK_TOOLBAR (toolbar), | |
| 998 | + _(entries[i].name), | |
| 999 | + _(entries[i].name), | |
| 1000 | + _(entries[i].name), | |
| 1001 | + gtk_image_new_from_pixbuf (pixbuf), | |
| 1002 | + G_CALLBACK (entries[i].func), | |
| 1003 | + NULL); | |
| 1004 | +#endif /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 1005 | + g_object_unref (pixbuf); | |
| 1006 | + } | |
| 1007 | + else | |
| 1008 | + { | |
| 1009 | + gchar *text; | |
| 1010 | + GtkStockItem stock_item; | |
| 1011 | + | |
| 1012 | + gtk_stock_lookup (entries[i].name, &stock_item); | |
| 1013 | + text = misc_mnemonic_to_text (stock_item.label); | |
| 1014 | +#if GTK_CHECK_VERSION(2,4,0) | |
| 1015 | + entries[i].tool_item = gtk_tool_button_new_from_stock | |
| 1016 | + (entries[i].name); | |
| 1017 | +# if GTK_CHECK_VERSION(2,12,0) | |
| 1018 | + gtk_tool_item_set_tooltip_text (entries[i].tool_item, text); | |
| 1019 | +# else /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 1020 | + gtk_tool_item_set_tooltip (entries[i].tool_item, tooltips, | |
| 1021 | + text, text); | |
| 1022 | +# endif /* not GTK_CHECK_VERSION(2,12,0) */ | |
| 1023 | +#else /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 1024 | + entries[i].tool_item = gtk_toolbar_insert_stock | |
| 1025 | + (GTK_TOOLBAR (toolbar), | |
| 1026 | + entries[i].name, | |
| 1027 | + text, | |
| 1028 | + text, | |
| 1029 | + G_CALLBACK (entries[i].func), | |
| 1030 | + NULL, | |
| 1031 | + -1); | |
| 1032 | +#endif /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 1033 | + g_free (text); | |
| 1034 | + } | |
| 1035 | +#if GTK_CHECK_VERSION(2,4,0) | |
| 1036 | + if (entries[i].func) | |
| 1037 | + g_signal_connect (G_OBJECT (entries[i].tool_item), "clicked", | |
| 1038 | + G_CALLBACK (entries[i].func), entries[i].user_data); | |
| 1039 | +#endif /* GTK_CHECK_VERSION(2,4,0) */ | |
| 1040 | + } | |
| 1041 | + else | |
| 1042 | + { | |
| 1043 | +#if GTK_CHECK_VERSION(2,4,0) | |
| 1044 | + entries[i].tool_item = gtk_separator_tool_item_new (); | |
| 1045 | +#else /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 1046 | + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); | |
| 1047 | +#endif /* not GTK_CHECK_VERSION(2,4,0) */ | |
| 1048 | + } | |
| 1049 | +#if GTK_CHECK_VERSION(2,4,0) | |
| 1050 | + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), entries[i].tool_item, i); | |
| 1051 | +#endif /* GTK_CHECK_VERSION(2,4,0) */ | |
| 1052 | + } | |
| 1053 | + return toolbar; | |
| 1054 | +} | |
| 1055 | + | |
| 1056 | + | |
| 1057 | +/* ja:ツールバーを検索する | |
| 1058 | + entries,ツールバー構造体 | |
| 1059 | + path,パス | |
| 1060 | + RET,ツールアイテム */ | |
| 1061 | +GtkToolItem * | |
| 1062 | +misc_find_toolbar (MiscCreateToolbarEntry *entries, | |
| 1063 | + const gchar *path) | |
| 1064 | +{ | |
| 1065 | + gint i; | |
| 1066 | + | |
| 1067 | + for (i = 0; entries[i].path; i++) | |
| 1068 | + if (g_strcmp (entries[i].path, path) == 0) | |
| 1069 | + return entries[i].tool_item; | |
| 1070 | + return NULL; | |
| 1071 | +} | |
| 1072 | + | |
| 1073 | + | |
| 1074 | +/****************************************************************************** | |
| 1075 | +* * | |
| 1076 | +* ja:クローズボタン関数群 * | |
| 1077 | +* * | |
| 1078 | +******************************************************************************/ | |
| 1079 | +/* ja:クローズボタンのイメージを取得する | |
| 1080 | + RET,イメージ,NULL:エラー */ | |
| 1081 | +GtkWidget * | |
| 1082 | +misc_close_image (void) | |
| 1083 | +{ | |
| 1084 | + GtkIconSet *icon_set; | |
| 1085 | + GtkWidget *image = NULL; | |
| 1086 | + | |
| 1087 | + icon_set = gtk_icon_factory_lookup_default (GTK_STOCK_CLOSE); | |
| 1088 | + if (icon_set) | |
| 1089 | + { | |
| 1090 | + GdkPixbuf *pixbuf; | |
| 1091 | + | |
| 1092 | + pixbuf = gtk_icon_set_render_icon (icon_set, | |
| 1093 | + gtk_widget_get_default_style (), | |
| 1094 | + GTK_TEXT_DIR_NONE, | |
| 1095 | + GTK_STATE_NORMAL, | |
| 1096 | + GTK_ICON_SIZE_MENU, | |
| 1097 | + NULL, NULL); | |
| 1098 | + if (pixbuf) | |
| 1099 | + { | |
| 1100 | + if (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB | |
| 1101 | + && gdk_pixbuf_get_n_channels (pixbuf) == 4 | |
| 1102 | + && gdk_pixbuf_get_has_alpha (pixbuf) | |
| 1103 | + && gdk_pixbuf_get_bits_per_sample (pixbuf) == 8) | |
| 1104 | + { | |
| 1105 | + int width, height, rowstride; | |
| 1106 | + gint x, y, left, top, right, bottom; | |
| 1107 | + guchar *pixels; | |
| 1108 | + | |
| 1109 | + pixels = gdk_pixbuf_get_pixels (pixbuf); | |
| 1110 | + width = gdk_pixbuf_get_width (pixbuf); | |
| 1111 | + height = gdk_pixbuf_get_height (pixbuf); | |
| 1112 | + rowstride = gdk_pixbuf_get_rowstride (pixbuf); | |
| 1113 | + for (x = 0; x < width; x++) | |
| 1114 | + for (y = 0; y < height; y++) | |
| 1115 | + if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 1116 | + goto loop_left; | |
| 1117 | + loop_left: left = x; | |
| 1118 | + for (y = 0; y < height; y++) | |
| 1119 | + for (x = 0; x < width; x++) | |
| 1120 | + if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 1121 | + goto loop_top; | |
| 1122 | + loop_top: top = y; | |
| 1123 | + for (x = width - 1; x >= 0; x--) | |
| 1124 | + for (y = 0; y < height; y++) | |
| 1125 | + if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 1126 | + goto loop_right; | |
| 1127 | + loop_right: right = x; | |
| 1128 | + for (y = height - 1; y >= 0; y--) | |
| 1129 | + for (x = 0; x < width; x++) | |
| 1130 | + if (pixels[y * rowstride + x * 4 + 3] > 0) | |
| 1131 | + goto loop_bottom; | |
| 1132 | + loop_bottom: bottom = y; | |
| 1133 | + if (left <= right && top <= bottom) | |
| 1134 | + { | |
| 1135 | + int w, h, r; | |
| 1136 | + guchar *p; | |
| 1137 | + gint i; | |
| 1138 | + GdkPixbuf *b; | |
| 1139 | + | |
| 1140 | + w = right - left + 1; | |
| 1141 | + h = bottom - top + 1; | |
| 1142 | + b = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, w, h); | |
| 1143 | + p = gdk_pixbuf_get_pixels (b); | |
| 1144 | + r = gdk_pixbuf_get_rowstride (b); | |
| 1145 | + for (x = 0; x < w; x++) | |
| 1146 | + for (y = 0; y < h; y++) | |
| 1147 | + for (i = 0; i < 4; i++) | |
| 1148 | + p[y * r + x * 4 + i] | |
| 1149 | + = pixels[(y + top) * rowstride + (x + left) * 4 + i]; | |
| 1150 | + image = gtk_image_new_from_pixbuf (b); | |
| 1151 | + g_object_unref (b); | |
| 1152 | + } | |
| 1153 | + } | |
| 1154 | + g_object_unref (pixbuf); | |
| 1155 | + } | |
| 1156 | + } | |
| 1157 | + if (!image) | |
| 1158 | + image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); | |
| 1159 | + if (!image) | |
| 1160 | + { | |
| 1161 | + GdkPixbuf *pixbuf; | |
| 1162 | + const static gchar *xpm[] = { | |
| 1163 | +"12 13 4 1", | |
| 1164 | +" c None", | |
| 1165 | +"X c #000000", | |
| 1166 | +"+ c #808080", | |
| 1167 | +". c #FFFFFF", | |
| 1168 | +"+++++++++++.", | |
| 1169 | +"+.........+.", | |
| 1170 | +"+. +.", | |
| 1171 | +"+.XX XX+.", | |
| 1172 | +"+. XX XX +.", | |
| 1173 | +"+. XXXX +.", | |
| 1174 | +"+. XX +.", | |
| 1175 | +"+. XXXX +.", | |
| 1176 | +"+. XX XX +.", | |
| 1177 | +"+.XX XX+.", | |
| 1178 | +"+. +.", | |
| 1179 | +"+++++++++++.", | |
| 1180 | +"............"}; | |
| 1181 | + | |
| 1182 | + pixbuf = gdk_pixbuf_new_from_xpm_data (xpm); | |
| 1183 | + image = gtk_image_new_from_pixbuf (pixbuf); | |
| 1184 | + g_object_unref (pixbuf); | |
| 1185 | + } | |
| 1186 | + return image; | |
| 1187 | +} | |
| 1188 | + | |
| 1189 | + | |
| 1190 | +/* ja:クローズボタンを取得する | |
| 1191 | + RET,ボタン,NULL:エラー */ | |
| 1192 | +GtkWidget * | |
| 1193 | +misc_close_button (void) | |
| 1194 | +{ | |
| 1195 | + GtkWidget *button = NULL, *image; | |
| 1196 | + | |
| 1197 | + image = misc_close_image (); | |
| 1198 | + if (image) | |
| 1199 | + { | |
| 1200 | + button = gtk_button_new (); | |
| 1201 | + gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); | |
| 1202 | + gtk_container_add (GTK_CONTAINER (button), image); | |
| 1203 | + gtk_widget_show (image); | |
| 1204 | + } | |
| 1205 | + return button; | |
| 1206 | +} | |
| 1207 | + | |
| 1208 | + | |
| 1209 | +/****************************************************************************** | |
| 1210 | +* * | |
| 1211 | +* ja:低レベル関数群 * | |
| 1212 | +* * | |
| 1213 | +******************************************************************************/ | |
| 1214 | +/* ja:mnemonicをテキストに変換する | |
| 1215 | + mnemonic,mnemonic | |
| 1216 | + RET,テキスト */ | |
| 1217 | +gchar * | |
| 1218 | +misc_mnemonic_to_text (const gchar *mnemonic) | |
| 1219 | +{ | |
| 1220 | + gchar *text; | |
| 1221 | + gint i; | |
| 1222 | + | |
| 1223 | + if (!mnemonic) | |
| 1224 | + return NULL; | |
| 1225 | + text = g_strdup (mnemonic); | |
| 1226 | + for (i = 0; text[i] != '\0'; i++) | |
| 1227 | + if (text[i] == '(' && text[i + 1] == '_' | |
| 1228 | + && g_ascii_isalpha (text[i + 2]) && text[i + 3] == ')') | |
| 1229 | + { | |
| 1230 | + g_memmove (text + i, text + i + 4, g_strlen (text + i) - 3); | |
| 1231 | + break; | |
| 1232 | + } | |
| 1233 | + else if (text[i] == '_' && g_ascii_isalpha (text[i + 1])) | |
| 1234 | + { | |
| 1235 | + g_memmove (text + i, text + i + 2, g_strlen (text + i) - 1); | |
| 1236 | + break; | |
| 1237 | + } | |
| 1238 | + return text; | |
| 1239 | +} | |
| 1240 | + | |
| 1241 | + | |
| 1242 | +/* ja:スクロールバーを設定する | |
| 1243 | + scroll,スクロールウイジット | |
| 1244 | + func,シグナル関数 | |
| 1245 | + func_data,データ | |
| 1246 | + min,最小値 | |
| 1247 | + max,最大値 | |
| 1248 | + page,ページ | |
| 1249 | + pos,位置 */ | |
| 1250 | +void | |
| 1251 | +misc_set_scroll_bar (GtkWidget *scroll, | |
| 1252 | + GCallback func, | |
| 1253 | + gpointer func_data, | |
| 1254 | + const gint min, | |
| 1255 | + const gint max, | |
| 1256 | + const gint page, | |
| 1257 | + const gint pos) | |
| 1258 | +{ | |
| 1259 | + GtkAdjustment *adjust; | |
| 1260 | + | |
| 1261 | + adjust = GTK_ADJUSTMENT (gtk_adjustment_new (pos, min, max, 1, page, page)); | |
| 1262 | + gtk_range_set_adjustment (GTK_RANGE (scroll), adjust); | |
| 1263 | + if (func) | |
| 1264 | + g_signal_connect (G_OBJECT (adjust), "value-changed", func, func_data); | |
| 1265 | +} | |
| 1266 | + | |
| 1267 | + | |
| 1268 | +/* ja:Windowの内容をスクロールする | |
| 1269 | + widget,ウイジット | |
| 1270 | + dx,X軸方向の移動 | |
| 1271 | + dy,Y軸方向の移動 | |
| 1272 | + x,スクロールする範囲の右上X座標 | |
| 1273 | + y,スクロールする範囲の右上Y座標 | |
| 1274 | + width,スクロールする範囲の幅 | |
| 1275 | + height,スクロールする範囲の高さ */ | |
| 1276 | +void | |
| 1277 | +misc_scroll_window (GtkWidget *widget, | |
| 1278 | + const gint dx, | |
| 1279 | + const gint dy, | |
| 1280 | + const gint x, | |
| 1281 | + const gint y, | |
| 1282 | + const gint width, | |
| 1283 | + const gint height) | |
| 1284 | +{ | |
| 1285 | + if (ABS (dx) > width || ABS (dy) > height) | |
| 1286 | + { | |
| 1287 | + gtk_widget_queue_draw_area (widget, x, y, width, height); | |
| 1288 | + } | |
| 1289 | + else if (dx != 0 || dy != 0) | |
| 1290 | + { | |
| 1291 | +#if GTK_CHECK_VERSION(2,24,0) | |
| 1292 | + cairo_t *cr; | |
| 1293 | + gint w, h, xx, yy; | |
| 1294 | + GdkPixbuf *pixbuf; | |
| 1295 | + GdkWindow *window; | |
| 1296 | + | |
| 1297 | + window = gtk_widget_get_window (widget); | |
| 1298 | + cr = gdk_cairo_create (window); | |
| 1299 | + w = width - ABS (dx); | |
| 1300 | + h = height - ABS (dy); | |
| 1301 | +# if GTK_CHECK_VERSION(3,0,0) | |
| 1302 | + pixbuf = gdk_pixbuf_get_from_window (window, | |
| 1303 | + dx > 0 ? x : x - dx, dy > 0 ? y : y - dy, w, h); | |
| 1304 | +# else /* not GTK_CHECK_VERSION(3,0,0) */ | |
| 1305 | + pixbuf = gdk_pixbuf_get_from_drawable (NULL, window, | |
| 1306 | + gdk_colormap_get_system (), | |
| 1307 | + dx > 0 ? x : x - dx, dy > 0 ? y : y - dy, | |
| 1308 | + 0, 0, w, h); | |
| 1309 | +# endif /* not GTK_CHECK_VERSION(3,0,0) */ | |
| 1310 | + xx = dx > 0 ? x + dx : x; | |
| 1311 | + yy = dy > 0 ? y + dy : y; | |
| 1312 | + gdk_cairo_set_source_pixbuf (cr, pixbuf, xx, yy); | |
| 1313 | + g_object_unref (pixbuf); | |
| 1314 | + cairo_rectangle (cr, xx, yy, w, h); | |
| 1315 | + cairo_fill (cr); | |
| 1316 | + cairo_destroy (cr); | |
| 1317 | +#else /* not GTK_CHECK_VERSION(2,24,0) */ | |
| 1318 | + GdkGC *gc; | |
| 1319 | + | |
| 1320 | + gc = gdk_gc_new (gtk_widget_get_window (widget)); | |
| 1321 | + gdk_gc_set_exposures (gc, TRUE); | |
| 1322 | + gdk_draw_drawable (gtk_widget_get_window (widget), | |
| 1323 | + gc, | |
| 1324 | + gtk_widget_get_window (widget), | |
| 1325 | + dx > 0 ? x : x - dx, | |
| 1326 | + dy > 0 ? y : y - dy, | |
| 1327 | + dx > 0 ? x + dx : x, | |
| 1328 | + dy > 0 ? y + dy : y, | |
| 1329 | + width - ABS (dx), | |
| 1330 | + height - ABS (dy)); | |
| 1331 | + g_object_unref (gc); | |
| 1332 | +#endif /* not GTK_CHECK_VERSION(2,24,0) */ | |
| 1333 | + if (dx != 0) | |
| 1334 | + gtk_widget_queue_draw_area (widget, dx > 0 ? x : x + width + dx, y, | |
| 1335 | + ABS (dx), height); | |
| 1336 | + if (dy != 0) | |
| 1337 | + gtk_widget_queue_draw_area (widget, x, dy > 0 ? y : y + height + dy, | |
| 1338 | + width, ABS (dy)); | |
| 1339 | + } | |
| 1340 | + gdk_window_process_updates (gtk_widget_get_window (widget), TRUE); | |
| 1341 | +} | |
| 1342 | + | |
| 1343 | + | |
| 1344 | +/* ja:ESCが押されたとき */ | |
| 1345 | +gboolean | |
| 1346 | +misc_dialog_key_press (GtkWidget *widget, | |
| 1347 | + GdkEventKey *event, | |
| 1348 | + gpointer user_data) | |
| 1349 | +{ | |
| 1350 | + if (event->keyval == GDK_KEY_Escape) | |
| 1351 | + gtk_dialog_response (GTK_DIALOG (widget), GTK_RESPONSE_NONE); | |
| 1352 | + return FALSE; | |
| 1353 | +} | |
| 1354 | +#endif /* not USE_GTK_EMULATE */ |
| @@ -222,6 +222,7 @@ | ||
| 222 | 222 | iwmcrt\maincrtstartup.obj \ |
| 223 | 223 | iwmcrt\onexit.obj \ |
| 224 | 224 | iwmcrt\security.obj \ |
| 225 | + iwmcrt\set_invalid_parameter_handler.obj \ | |
| 225 | 226 | iwmcrt\stat32.obj \ |
| 226 | 227 | iwmcrt\stat32i64.obj \ |
| 227 | 228 | iwmcrt\stat64i32.obj \ |
| @@ -313,6 +314,9 @@ | ||
| 313 | 314 | iwmcrt\security.obj: $(TOP)\$*.c |
| 314 | 315 | $(CC) $(CLFLAGS) $** |
| 315 | 316 | |
| 317 | +iwmcrt\set_invalid_parameter_handler.obj: $(TOP)\$*.c | |
| 318 | + $(CC) $(CLFLAGS) $** | |
| 319 | + | |
| 316 | 320 | iwmcrt\stat32.obj: $(TOP)\$*.c |
| 317 | 321 | $(CC) $(CLFLAGS) $** |
| 318 | 322 |
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | dnl version number |
| 6 | 6 | MAJOR_VERSION=0 |
| 7 | 7 | MINOR_VERSION=4 |
| 8 | -MICRO_VERSION=1 | |
| 8 | +MICRO_VERSION=2 | |
| 9 | 9 | EXTRA_VERSION= |
| 10 | 10 | VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION |
| 11 | 11 |
| @@ -112,15 +112,22 @@ | ||
| 112 | 112 | AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h complex.h dirent.h fcntl.h netdb.h netinet/in.h resolv.h stdint.h sys/file.h sys/mman.h sys/param.h sys/select.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h unistd.h utime.h) |
| 113 | 113 | |
| 114 | 114 | dnl ************************************************************** |
| 115 | -dnl Checks for typedefs, structures, and compiler characteristics. | |
| 115 | +dnl Checks for typedefs and structures. | |
| 116 | 116 | dnl ************************************************************** |
| 117 | 117 | AC_C_CONST |
| 118 | 118 | AC_C_VOLATILE |
| 119 | 119 | AC_STRUCT_TM |
| 120 | 120 | AC_TYPE_SIZE_T |
| 121 | -if test "$CC" = 'gcc'; then | |
| 121 | + | |
| 122 | +dnl ************************************************************** | |
| 123 | +dnl Checks for compiler characteristics. | |
| 124 | +dnl ************************************************************** | |
| 125 | +if test "$GCC" = 'yes'; then | |
| 122 | 126 | CFLAGS="$CFLAGS -Wall" |
| 123 | 127 | fi |
| 128 | +if $LD --help 2> /dev/null | grep as-needed > /dev/null; then | |
| 129 | + LDFLAGS="$LDFLAGS -Wl,--no-as-needed" | |
| 130 | +fi | |
| 124 | 131 | |
| 125 | 132 | dnl ************************************************************** |
| 126 | 133 | dnl Checks for library functions. |
| @@ -28,6 +28,6 @@ | ||
| 28 | 28 | _PVFV *__onexitend = NULL; |
| 29 | 29 | _PVFV __xc_a[] = {NULL}; |
| 30 | 30 | _PVFV __xc_z[] = {NULL}; |
| 31 | -_PVFV __xi_a[] = {NULL}; | |
| 32 | -_PVFV __xi_z[] = {NULL}; | |
| 31 | +_PIFV __xi_a[] = {NULL}; | |
| 32 | +_PIFV __xi_z[] = {NULL}; | |
| 33 | 33 | int _fltused = 0x9875; |
| @@ -29,6 +29,7 @@ | ||
| 29 | 29 | #endif /* __cplusplus */ |
| 30 | 30 | |
| 31 | 31 | |
| 32 | +typedef int (__cdecl *_PIFV)(void); | |
| 32 | 33 | typedef void (__cdecl *_PVFV)(void); |
| 33 | 34 | |
| 34 | 35 |
| @@ -37,12 +38,17 @@ | ||
| 37 | 38 | |
| 38 | 39 | extern _PVFV *__onexitbegin; |
| 39 | 40 | extern _PVFV *__onexitend; |
| 40 | -extern _PVFV __xc_a[]; | |
| 41 | -extern _PVFV __xc_z[]; | |
| 42 | -extern _PVFV __xi_a[]; | |
| 43 | -extern _PVFV __xi_z[]; | |
| 44 | 41 | |
| 42 | +#pragma section (".CRT$XCA", long, read) | |
| 43 | +#pragma section (".CRT$XCZ", long, read) | |
| 44 | +#pragma section (".CRT$XIA", long, read) | |
| 45 | +#pragma section (".CRT$XIZ", long, read) | |
| 46 | +extern __declspec (allocate (".CRT$XCA")) _PVFV __xc_a[]; | |
| 47 | +extern __declspec (allocate (".CRT$XCZ")) _PVFV __xc_z[]; | |
| 48 | +extern __declspec (allocate (".CRT$XIA")) _PIFV __xi_a[]; | |
| 49 | +extern __declspec (allocate (".CRT$XIZ")) _PIFV __xi_z[]; | |
| 45 | 50 | |
| 51 | + | |
| 46 | 52 | #ifdef __cplusplus |
| 47 | 53 | } |
| 48 | 54 | #endif /* __cplusplus */ |
| @@ -25,6 +25,7 @@ | ||
| 25 | 25 | maincrtstartup.c \ |
| 26 | 26 | onexit.c \ |
| 27 | 27 | security.c \ |
| 28 | + set_invalid_parameter_handler.c \ | |
| 28 | 29 | stat32.c \ |
| 29 | 30 | stat32i64.c \ |
| 30 | 31 | stat64i32.c \ |
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | # Melody maid ja.po |
| 2 | -# Copyright (C) 1998-2012 Kazuki Iwamoto | |
| 3 | -# Kazuki Iwamoto <iwm@maid.org>, 1998-2012. | |
| 2 | +# Copyright (C) 1998-2013 Kazuki Iwamoto | |
| 3 | +# Kazuki Iwamoto <iwm@maid.org>, 1998-2013. | |
| 4 | 4 | # |
| 5 | 5 | msgid "" |
| 6 | 6 | msgstr "" |
| 7 | -"Project-Id-Version: mmaid 0.4.1\n" | |
| 8 | -"Report-Msgid-Bugs-To: \n" | |
| 9 | -"POT-Creation-Date: 2012-12-13 15:28+0900\n" | |
| 7 | +"Project-Id-Version: mmaid 0.4.2\n" | |
| 8 | +"Report-Msgid-Bugs-To: http://www.maid.org/\n" | |
| 9 | +"POT-Creation-Date: 2013-05-29 03:59+0900\n" | |
| 10 | 10 | "PO-Revision-Date: 2004-01-04 23:14+0900\n" |
| 11 | 11 | "Last-Translator: Kazuki Iwamoto <iwm@maid.org>\n" |
| 12 | 12 | "Language-Team: Kazuki Iwamoto <iwm@maid.org>\n" |
| @@ -14,7 +14,6 @@ | ||
| 14 | 14 | "Content-Type: text/plain; charset=UTF-8\n" |
| 15 | 15 | "Content-Transfer-Encoding: 8bit\n" |
| 16 | 16 | |
| 17 | -#. ja:中途半端にライセンスが表示されているとき | |
| 18 | 17 | #: misc/license.c:75 |
| 19 | 18 | msgid "Scroll is too fast! Do you really view the license?" |
| 20 | 19 | msgstr "スクロールが速すぎます! 本当にライセンスを読みましたか?" |
| @@ -23,7 +22,6 @@ | ||
| 23 | 22 | msgid "License" |
| 24 | 23 | msgstr "ライセンス" |
| 25 | 24 | |
| 26 | -#. ja:ラベル | |
| 27 | 25 | #: misc/license.c:132 |
| 28 | 26 | msgid "View the license. Please scroll to view the entire license text." |
| 29 | 27 | msgstr "" |
| @@ -30,7 +28,6 @@ | ||
| 30 | 28 | "ライセンスをお読みください。すべてのライセンス文を読むためにスクロールしてく" |
| 31 | 29 | "ださい。" |
| 32 | 30 | |
| 33 | -#. ja:ラジオボタン | |
| 34 | 31 | #: misc/license.c:135 |
| 35 | 32 | msgid "I agree." |
| 36 | 33 | msgstr "同意する" |
| @@ -39,7 +36,6 @@ | ||
| 39 | 36 | msgid "I deny." |
| 40 | 37 | msgstr "同意しない" |
| 41 | 38 | |
| 42 | -#. ja:メインウインドウ | |
| 43 | 39 | #: orz/orzcharlist.c:326 src/mm_list.c:378 |
| 44 | 40 | msgid "Character Encoding" |
| 45 | 41 | msgstr "文字符号化方式" |
| @@ -48,7 +44,6 @@ | ||
| 48 | 44 | msgid "Registered Character Encoding" |
| 49 | 45 | msgstr "登録されている文字符号化方式" |
| 50 | 46 | |
| 51 | -#. ja:チェックボタン | |
| 52 | 47 | #: orz/orzpref.c:137 |
| 53 | 48 | msgid "_New File" |
| 54 | 49 | msgstr "新規ファイルを開く(_N)" |
| @@ -57,7 +52,6 @@ | ||
| 57 | 52 | msgid "_Open Window" |
| 58 | 53 | msgstr "新規ウインドウを開く(_O)" |
| 59 | 54 | |
| 60 | -#. ja:ラベル | |
| 61 | 55 | #: orz/orzpref.c:168 |
| 62 | 56 | msgid "H_istory" |
| 63 | 57 | msgstr "ファイルの履歴(_I)" |
| @@ -70,7 +64,6 @@ | ||
| 70 | 64 | msgid "_Height" |
| 71 | 65 | msgstr "高さ(_H)" |
| 72 | 66 | |
| 73 | -#. ja:ラジオボタン | |
| 74 | 67 | #: orz/orzpref.c:175 |
| 75 | 68 | msgid "_Top" |
| 76 | 69 | msgstr "上(_T)" |
| @@ -87,7 +80,6 @@ | ||
| 87 | 80 | msgid "_Bottom" |
| 88 | 81 | msgstr "下(_B)" |
| 89 | 82 | |
| 90 | -#. ja:フレームとボックス | |
| 91 | 83 | #: orz/orzpref.c:191 src/mmaid.c:100 src/sigmain.c:165 |
| 92 | 84 | msgid "Window Size" |
| 93 | 85 | msgstr "ウインドウのサイズ" |
| @@ -128,27 +120,23 @@ | ||
| 128 | 120 | msgid "Abort" |
| 129 | 121 | msgstr "中断" |
| 130 | 122 | |
| 131 | -#: src/add.c:49 src/add.c:88 src/command.c:1223 src/command.c:1243 | |
| 123 | +#: src/add.c:49 src/add.c:88 src/command.c:1218 src/command.c:1238 | |
| 132 | 124 | #: src/edit.c:48 src/edit.c:82 src/root.c:73 src/root.c:93 |
| 133 | 125 | msgid "Browse" |
| 134 | 126 | msgstr "参照" |
| 135 | 127 | |
| 136 | -#. ja:ボタン | |
| 137 | 128 | #: src/add.c:184 src/edit.c:585 src/root.c:219 |
| 138 | 129 | msgid "_Browse..." |
| 139 | 130 | msgstr "参照(_B)..." |
| 140 | 131 | |
| 141 | -#. ja:チェックボタン | |
| 142 | 132 | #: src/add.c:423 src/edit.c:535 |
| 143 | 133 | msgid "T_rack" |
| 144 | 134 | msgstr "トラック(_R)" |
| 145 | 135 | |
| 146 | -#. ja:ラベル | |
| 147 | 136 | #: src/add.c:439 src/edit.c:589 src/menu.c:30 |
| 148 | 137 | msgid "_File" |
| 149 | 138 | msgstr "ファイル(_F)" |
| 150 | 139 | |
| 151 | -#. ja:ラベル | |
| 152 | 140 | #: src/add.c:440 src/edit.c:217 |
| 153 | 141 | msgid "_Title" |
| 154 | 142 | msgstr "タイトル(_T)" |
| @@ -173,12 +161,12 @@ | ||
| 173 | 161 | msgid "_Genre" |
| 174 | 162 | msgstr "ジャンル(_G)" |
| 175 | 163 | |
| 176 | -#: src/add.c:446 src/command.c:501 src/edit.c:223 src/export.c:146 | |
| 164 | +#: src/add.c:446 src/command.c:505 src/edit.c:223 src/export.c:146 | |
| 177 | 165 | #: src/menu.c:71 |
| 178 | 166 | msgid "Character _Encoding" |
| 179 | 167 | msgstr "文字符号化方式(_E)" |
| 180 | 168 | |
| 181 | -#: src/command.c:172 src/command.c:652 | |
| 169 | +#: src/command.c:176 src/command.c:649 | |
| 182 | 170 | #, c-format |
| 183 | 171 | msgid "" |
| 184 | 172 | "%s\n" |
| @@ -191,50 +179,47 @@ | ||
| 191 | 179 | "\n" |
| 192 | 180 | "上書きしますか?" |
| 193 | 181 | |
| 194 | -#: src/command.c:329 | |
| 182 | +#: src/command.c:333 | |
| 195 | 183 | msgid "Root Directory Error" |
| 196 | 184 | msgstr "ルートディレクトリエラー" |
| 197 | 185 | |
| 198 | -#. ja:チェックボタン | |
| 199 | -#: src/command.c:391 | |
| 186 | +#: src/command.c:395 | |
| 200 | 187 | msgid "_Header" |
| 201 | 188 | msgstr "ヘッダ(_H)" |
| 202 | 189 | |
| 203 | -#. ja:ラジオボタン | |
| 204 | -#: src/command.c:395 | |
| 190 | +#: src/command.c:399 | |
| 205 | 191 | msgid "_iDB File" |
| 206 | 192 | msgstr "iDBファイル(_I)" |
| 207 | 193 | |
| 208 | -#: src/command.c:397 | |
| 194 | +#: src/command.c:401 | |
| 209 | 195 | msgid "_Play List" |
| 210 | 196 | msgstr "プレイリスト(_P)" |
| 211 | 197 | |
| 212 | -#: src/command.c:399 | |
| 198 | +#: src/command.c:403 | |
| 213 | 199 | msgid "Relative" |
| 214 | 200 | msgstr "相対" |
| 215 | 201 | |
| 216 | -#: src/command.c:401 | |
| 202 | +#: src/command.c:405 | |
| 217 | 203 | msgid "Absolute" |
| 218 | 204 | msgstr "絶対" |
| 219 | 205 | |
| 220 | -#: src/command.c:403 | |
| 206 | +#: src/command.c:407 | |
| 221 | 207 | msgid "File Name" |
| 222 | 208 | msgstr "ファイル名" |
| 223 | 209 | |
| 224 | -#. ja:ラベル | |
| 225 | -#: src/command.c:496 | |
| 210 | +#: src/command.c:500 | |
| 226 | 211 | msgid "_Path" |
| 227 | 212 | msgstr "パス(_P)" |
| 228 | 213 | |
| 229 | -#: src/command.c:499 | |
| 214 | +#: src/command.c:503 | |
| 230 | 215 | msgid "_Separator" |
| 231 | 216 | msgstr "区切り(_S)" |
| 232 | 217 | |
| 233 | -#: src/command.c:504 | |
| 218 | +#: src/command.c:508 | |
| 234 | 219 | msgid "_Root" |
| 235 | 220 | msgstr "ルート(_R)" |
| 236 | 221 | |
| 237 | -#: src/command.c:710 | |
| 222 | +#: src/command.c:705 | |
| 238 | 223 | #, c-format |
| 239 | 224 | msgid "" |
| 240 | 225 | "File %s was edited.\n" |
| @@ -243,69 +228,67 @@ | ||
| 243 | 228 | "ファイル %s の内容が変更されています。\n" |
| 244 | 229 | "保存されている状態に戻しますか?" |
| 245 | 230 | |
| 246 | -#: src/command.c:749 src/export.c:104 | |
| 231 | +#: src/command.c:744 src/export.c:104 | |
| 247 | 232 | msgid "Export" |
| 248 | 233 | msgstr "エクスポート" |
| 249 | 234 | |
| 250 | -#. ja:ファイルが存在しないとき | |
| 251 | -#: src/command.c:779 | |
| 235 | +#: src/command.c:774 | |
| 252 | 236 | msgid "File Open Error" |
| 253 | 237 | msgstr "ファイルオープンエラー" |
| 254 | 238 | |
| 255 | -#. ja:既存のタグを保持し、かつ既にタグがあるとき | |
| 256 | -#: src/command.c:785 | |
| 239 | +#: src/command.c:780 | |
| 257 | 240 | msgid "Have Tag" |
| 258 | 241 | msgstr "タグがある" |
| 259 | 242 | |
| 260 | -#: src/command.c:817 | |
| 243 | +#: src/command.c:812 | |
| 261 | 244 | msgid "Success" |
| 262 | 245 | msgstr "成功" |
| 263 | 246 | |
| 264 | -#: src/command.c:820 | |
| 247 | +#: src/command.c:815 | |
| 265 | 248 | msgid "Invalid Character Encoding of Title" |
| 266 | 249 | msgstr "タイトルが不正な文字符号化方式" |
| 267 | 250 | |
| 268 | -#: src/command.c:823 | |
| 251 | +#: src/command.c:818 | |
| 269 | 252 | msgid "Invalid Character Encoding of Artist" |
| 270 | 253 | msgstr "アーチストが不正な文字符号化方式" |
| 271 | 254 | |
| 272 | -#: src/command.c:826 | |
| 255 | +#: src/command.c:821 | |
| 273 | 256 | msgid "Invalid Character Encoding of Album" |
| 274 | 257 | msgstr "アルバムが不正な文字符号化方式" |
| 275 | 258 | |
| 276 | -#: src/command.c:829 | |
| 259 | +#: src/command.c:824 | |
| 277 | 260 | msgid "Invalid Character Encoding of Year" |
| 278 | 261 | msgstr "西暦が不正な文字符号化方式" |
| 279 | 262 | |
| 280 | -#: src/command.c:832 | |
| 263 | +#: src/command.c:827 | |
| 281 | 264 | msgid "Invalid Character Encoding of Comment" |
| 282 | 265 | msgstr "コメントが不正な文字符号化方式" |
| 283 | 266 | |
| 284 | -#: src/command.c:835 | |
| 267 | +#: src/command.c:830 | |
| 285 | 268 | msgid "Invalid Length of Title" |
| 286 | 269 | msgstr "タイトルが長すぎる" |
| 287 | 270 | |
| 288 | -#: src/command.c:838 | |
| 271 | +#: src/command.c:833 | |
| 289 | 272 | msgid "Invalid Length of Artist" |
| 290 | 273 | msgstr "アーチストが長すぎる" |
| 291 | 274 | |
| 292 | -#: src/command.c:841 | |
| 275 | +#: src/command.c:836 | |
| 293 | 276 | msgid "Invalid Length of Album" |
| 294 | 277 | msgstr "アルバムが長すぎる" |
| 295 | 278 | |
| 296 | -#: src/command.c:844 | |
| 279 | +#: src/command.c:839 | |
| 297 | 280 | msgid "Invalid Length of Year" |
| 298 | 281 | msgstr "西暦が長すぎる" |
| 299 | 282 | |
| 300 | -#: src/command.c:847 | |
| 283 | +#: src/command.c:842 | |
| 301 | 284 | msgid "Invalid Length of Comment" |
| 302 | 285 | msgstr "コメントが長すぎる" |
| 303 | 286 | |
| 304 | -#: src/command.c:850 | |
| 287 | +#: src/command.c:845 | |
| 305 | 288 | msgid "Error" |
| 306 | 289 | msgstr "エラー" |
| 307 | 290 | |
| 308 | -#: src/command.c:1288 | |
| 291 | +#: src/command.c:1283 | |
| 309 | 292 | msgid "Search" |
| 310 | 293 | msgstr "検索" |
| 311 | 294 |
| @@ -313,7 +296,6 @@ | ||
| 313 | 296 | msgid "Edit" |
| 314 | 297 | msgstr "編集" |
| 315 | 298 | |
| 316 | -#. ja:チェックボタン | |
| 317 | 299 | #: src/export.c:126 |
| 318 | 300 | msgid "_Hold existing tags" |
| 319 | 301 | msgstr "既存のタグを保持する(_H)" |
| @@ -393,7 +375,6 @@ | ||
| 393 | 375 | "ファイル %s の内容が変更されています\n" |
| 394 | 376 | "保存しますか?" |
| 395 | 377 | |
| 396 | -#. 000 | |
| 397 | 378 | #: src/genre.c:23 |
| 398 | 379 | msgid "Blues" |
| 399 | 380 | msgstr "ブルース" |
| @@ -410,7 +391,6 @@ | ||
| 410 | 391 | msgid "Dance" |
| 411 | 392 | msgstr "ダンス" |
| 412 | 393 | |
| 413 | -#. 004 | |
| 414 | 394 | #: src/genre.c:24 |
| 415 | 395 | msgid "Disco" |
| 416 | 396 | msgstr "ディスコ" |
| @@ -427,7 +407,6 @@ | ||
| 427 | 407 | msgid "Hip-Hop" |
| 428 | 408 | msgstr "ヒップ・ホップ" |
| 429 | 409 | |
| 430 | -#. 008 | |
| 431 | 410 | #: src/genre.c:25 |
| 432 | 411 | msgid "Jazz" |
| 433 | 412 | msgstr "ジャズ" |
| @@ -444,7 +423,6 @@ | ||
| 444 | 423 | msgid "Oldies" |
| 445 | 424 | msgstr "オールディーズ" |
| 446 | 425 | |
| 447 | -#. 012 | |
| 448 | 426 | #: src/genre.c:26 |
| 449 | 427 | msgid "Other" |
| 450 | 428 | msgstr "その他" |
| @@ -461,7 +439,6 @@ | ||
| 461 | 439 | msgid "Rap" |
| 462 | 440 | msgstr "ラップ" |
| 463 | 441 | |
| 464 | -#. 016 | |
| 465 | 442 | #: src/genre.c:27 |
| 466 | 443 | msgid "Reggae" |
| 467 | 444 | msgstr "レゲエ" |
| @@ -478,7 +455,6 @@ | ||
| 478 | 455 | msgid "Industrial" |
| 479 | 456 | msgstr "インダストリアル" |
| 480 | 457 | |
| 481 | -#. 020 | |
| 482 | 458 | #: src/genre.c:28 |
| 483 | 459 | msgid "Alternative" |
| 484 | 460 | msgstr "オルタナティヴ" |
| @@ -495,7 +471,6 @@ | ||
| 495 | 471 | msgid "Pranks" |
| 496 | 472 | msgstr "プランクス" |
| 497 | 473 | |
| 498 | -#. 024 | |
| 499 | 474 | #: src/genre.c:29 |
| 500 | 475 | msgid "Soundtrack" |
| 501 | 476 | msgstr "サウンドトラック" |
| @@ -512,7 +487,6 @@ | ||
| 512 | 487 | msgid "Trip-Hop" |
| 513 | 488 | msgstr "トリップ・ホップ" |
| 514 | 489 | |
| 515 | -#. 028 | |
| 516 | 490 | #: src/genre.c:30 |
| 517 | 491 | msgid "Vocal" |
| 518 | 492 | msgstr "ボーカル" |
| @@ -529,7 +503,6 @@ | ||
| 529 | 503 | msgid "Trance" |
| 530 | 504 | msgstr "トランス" |
| 531 | 505 | |
| 532 | -#. 032 | |
| 533 | 506 | #: src/genre.c:31 |
| 534 | 507 | msgid "Classical" |
| 535 | 508 | msgstr "クラシカル" |
| @@ -546,7 +519,6 @@ | ||
| 546 | 519 | msgid "House" |
| 547 | 520 | msgstr "ハウス" |
| 548 | 521 | |
| 549 | -#. 036 | |
| 550 | 522 | #: src/genre.c:32 |
| 551 | 523 | msgid "Game" |
| 552 | 524 | msgstr "ゲーム" |
| @@ -563,7 +535,6 @@ | ||
| 563 | 535 | msgid "Noise" |
| 564 | 536 | msgstr "ノイズ" |
| 565 | 537 | |
| 566 | -#. 040 | |
| 567 | 538 | #: src/genre.c:33 |
| 568 | 539 | msgid "AlternRock" |
| 569 | 540 | msgstr "アルターンロック" |
| @@ -580,7 +551,6 @@ | ||
| 580 | 551 | msgid "Punk" |
| 581 | 552 | msgstr "パンク" |
| 582 | 553 | |
| 583 | -#. 044 | |
| 584 | 554 | #: src/genre.c:34 |
| 585 | 555 | msgid "Space" |
| 586 | 556 | msgstr "スペース" |
| @@ -597,7 +567,6 @@ | ||
| 597 | 567 | msgid "Instrumental Rock" |
| 598 | 568 | msgstr "インストゥルメンタルロック" |
| 599 | 569 | |
| 600 | -#. 048 | |
| 601 | 570 | #: src/genre.c:35 |
| 602 | 571 | msgid "Ethnic" |
| 603 | 572 | msgstr "エスニック" |
| @@ -614,7 +583,6 @@ | ||
| 614 | 583 | msgid "Techno-Industrial" |
| 615 | 584 | msgstr "テクノ・インダストリアル" |
| 616 | 585 | |
| 617 | -#. 052 | |
| 618 | 586 | #: src/genre.c:36 |
| 619 | 587 | msgid "Electronic" |
| 620 | 588 | msgstr "エレクトロニック" |
| @@ -631,7 +599,6 @@ | ||
| 631 | 599 | msgid "Dream" |
| 632 | 600 | msgstr "ドリーム" |
| 633 | 601 | |
| 634 | -#. 056 | |
| 635 | 602 | #: src/genre.c:37 |
| 636 | 603 | msgid "Southern Rock" |
| 637 | 604 | msgstr "サザンロック" |
| @@ -648,7 +615,6 @@ | ||
| 648 | 615 | msgid "Gangsta" |
| 649 | 616 | msgstr "ガングスタ" |
| 650 | 617 | |
| 651 | -#. 060 | |
| 652 | 618 | #: src/genre.c:38 |
| 653 | 619 | msgid "Top 40" |
| 654 | 620 | msgstr "トップ40" |
| @@ -665,7 +631,6 @@ | ||
| 665 | 631 | msgid "Jungle" |
| 666 | 632 | msgstr "ジャングル" |
| 667 | 633 | |
| 668 | -#. 064 | |
| 669 | 634 | #: src/genre.c:39 |
| 670 | 635 | msgid "Native American" |
| 671 | 636 | msgstr "ネイティブアメリカン" |
| @@ -682,7 +647,6 @@ | ||
| 682 | 647 | msgid "Psychadelic" |
| 683 | 648 | msgstr "サイケデリック" |
| 684 | 649 | |
| 685 | -#. 068 | |
| 686 | 650 | #: src/genre.c:40 |
| 687 | 651 | msgid "Rave" |
| 688 | 652 | msgstr "レイブ" |
| @@ -699,7 +663,6 @@ | ||
| 699 | 663 | msgid "Lo-Fi" |
| 700 | 664 | msgstr "ローファイ" |
| 701 | 665 | |
| 702 | -#. 072 | |
| 703 | 666 | #: src/genre.c:41 |
| 704 | 667 | msgid "Tribal" |
| 705 | 668 | msgstr "トライバル" |
| @@ -716,7 +679,6 @@ | ||
| 716 | 679 | msgid "Polka" |
| 717 | 680 | msgstr "ポルカ" |
| 718 | 681 | |
| 719 | -#. 076 | |
| 720 | 682 | #: src/genre.c:42 |
| 721 | 683 | msgid "Retro" |
| 722 | 684 | msgstr "レトロ" |
| @@ -733,49 +695,6 @@ | ||
| 733 | 695 | msgid "Hard Rock" |
| 734 | 696 | msgstr "ハードロック" |
| 735 | 697 | |
| 736 | -#. 080 | |
| 737 | -#. 084 | |
| 738 | -#. 088 | |
| 739 | -#. 092 | |
| 740 | -#. 096 | |
| 741 | -#. 100 | |
| 742 | -#. 104 | |
| 743 | -#. 108 | |
| 744 | -#. 112 | |
| 745 | -#. 116 | |
| 746 | -#. 120 | |
| 747 | -#. 124 | |
| 748 | -#. 128 | |
| 749 | -#. 132 | |
| 750 | -#. 136 | |
| 751 | -#. 140 | |
| 752 | -#. 144 | |
| 753 | -#. 148 | |
| 754 | -#. 152 | |
| 755 | -#. 156 | |
| 756 | -#. 160 | |
| 757 | -#. 164 | |
| 758 | -#. 168 | |
| 759 | -#. 172 | |
| 760 | -#. 176 | |
| 761 | -#. 180 | |
| 762 | -#. 184 | |
| 763 | -#. 188 | |
| 764 | -#. 192 | |
| 765 | -#. 196 | |
| 766 | -#. 200 | |
| 767 | -#. 204 | |
| 768 | -#. 208 | |
| 769 | -#. 212 | |
| 770 | -#. 216 | |
| 771 | -#. 220 | |
| 772 | -#. 224 | |
| 773 | -#. 228 | |
| 774 | -#. 232 | |
| 775 | -#. 236 | |
| 776 | -#. 240 | |
| 777 | -#. 244 | |
| 778 | -#. 248 | |
| 779 | 698 | #: src/genre.c:85 |
| 780 | 699 | msgid "Heavy Rock" |
| 781 | 700 | msgstr "ヘビーロック" |
| @@ -792,7 +711,6 @@ | ||
| 792 | 711 | msgid "Seiyu" |
| 793 | 712 | msgstr "声優" |
| 794 | 713 | |
| 795 | -#. 252 | |
| 796 | 714 | #: src/genre.c:86 |
| 797 | 715 | msgid "Tecno Ambient" |
| 798 | 716 | msgstr "テクノアンビエント" |
| @@ -917,7 +835,6 @@ | ||
| 917 | 835 | msgid "Process" |
| 918 | 836 | msgstr "プロセス" |
| 919 | 837 | |
| 920 | -#. ja:ラベル | |
| 921 | 838 | #: src/process.c:89 |
| 922 | 839 | msgid "_Play" |
| 923 | 840 | msgstr "演奏(_P)" |
| @@ -926,7 +843,6 @@ | ||
| 926 | 843 | msgid "_Stop" |
| 927 | 844 | msgstr "停止(_S)" |
| 928 | 845 | |
| 929 | -#. ja:ラベル | |
| 930 | 846 | #: src/root.c:318 |
| 931 | 847 | msgid "_Find Path" |
| 932 | 848 | msgstr "検索パス(_F)" |