Porównaj commity

...

2 Commity

Autor SHA1 Wiadomość Data
Ordissimo 504dcc8c7f Fix segfault resize preview 2023-02-13 21:57:46 +01:00
Ordissimo 52a56b6a5b Redesign of gtk3curve 2023-02-13 21:21:36 +01:00
15 zmienionych plików z 238 dodań i 365 usunięć

Wyświetl plik

@ -1,324 +0,0 @@
#include <gio/gio.h>
#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
# define SECTION __attribute__ ((section (".gresource.resource"), aligned (8)))
#else
# define SECTION
#endif
#ifdef _MSC_VER
static const SECTION union { const guint8 data[1223]; const double alignment; void * const ptr;} resource_resource_data = { {
0107, 0126, 0141, 0162, 0151, 0141, 0156, 0164, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000,
0030, 0000, 0000, 0000, 0344, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0007, 0000, 0000, 0000,
0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0002, 0000, 0000, 0000,
0004, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 0007, 0000, 0000, 0000, 0324, 0265, 0002, 0000,
0377, 0377, 0377, 0377, 0344, 0000, 0000, 0000, 0001, 0000, 0114, 0000, 0350, 0000, 0000, 0000,
0354, 0000, 0000, 0000, 0267, 0313, 0344, 0016, 0003, 0000, 0000, 0000, 0354, 0000, 0000, 0000,
0012, 0000, 0166, 0000, 0370, 0000, 0000, 0000, 0302, 0001, 0000, 0000, 0157, 0154, 0146, 0174,
0003, 0000, 0000, 0000, 0302, 0001, 0000, 0000, 0011, 0000, 0166, 0000, 0320, 0001, 0000, 0000,
0262, 0002, 0000, 0000, 0231, 0027, 0304, 0163, 0000, 0000, 0000, 0000, 0262, 0002, 0000, 0000,
0007, 0000, 0114, 0000, 0274, 0002, 0000, 0000, 0320, 0002, 0000, 0000, 0016, 0127, 0314, 0040,
0003, 0000, 0000, 0000, 0320, 0002, 0000, 0000, 0010, 0000, 0166, 0000, 0330, 0002, 0000, 0000,
0170, 0003, 0000, 0000, 0333, 0152, 0011, 0234, 0003, 0000, 0000, 0000, 0170, 0003, 0000, 0000,
0013, 0000, 0166, 0000, 0210, 0003, 0000, 0000, 0067, 0004, 0000, 0000, 0017, 0224, 0122, 0353,
0003, 0000, 0000, 0000, 0067, 0004, 0000, 0000, 0011, 0000, 0166, 0000, 0100, 0004, 0000, 0000,
0306, 0004, 0000, 0000, 0057, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0163, 0160, 0154, 0151,
0156, 0145, 0056, 0160, 0156, 0147, 0000, 0000, 0272, 0000, 0000, 0000, 0000, 0000, 0000, 0000,
0211, 0120, 0116, 0107, 0015, 0012, 0032, 0012, 0000, 0000, 0000, 0015, 0111, 0110, 0104, 0122,
0000, 0000, 0000, 0020, 0000, 0000, 0000, 0020, 0010, 0006, 0000, 0000, 0000, 0037, 0363, 0377,
0141, 0000, 0000, 0000, 0004, 0163, 0102, 0111, 0124, 0010, 0010, 0010, 0010, 0174, 0010, 0144,
0210, 0000, 0000, 0000, 0161, 0111, 0104, 0101, 0124, 0070, 0215, 0255, 0121, 0133, 0016, 0300,
0040, 0014, 0102, 0157, 0326, 0223, 0065, 0361, 0342, 0354, 0143, 0232, 0350, 0046, 0353, 0346,
0044, 0061, 0215, 0017, 0204, 0322, 0204, 0165, 0020, 0000, 0362, 0052, 0273, 0230, 0375, 0320,
0076, 0345, 0271, 0205, 0274, 0334, 0202, 0204, 0273, 0023, 0000, 0153, 0175, 0124, 0127, 0140,
0267, 0302, 0017, 0156, 0055, 0264, 0164, 0147, 0051, 0023, 0140, 0002, 0122, 0044, 0117, 0145,
0065, 0264, 0177, 0175, 0320, 0357, 0025, 0171, 0337, 0024, 0224, 0102, 0075, 0147, 0061, 0373,
0146, 0177, 0274, 0322, 0123, 0311, 0215, 0254, 0322, 0165, 0367, 0241, 0116, 0025, 0102, 0173,
0001, 0244, 0275, 0067, 0070, 0000, 0162, 0046, 0070, 0352, 0371, 0102, 0163, 0071, 0000, 0000,
0000, 0000, 0111, 0105, 0116, 0104, 0256, 0102, 0140, 0202, 0000, 0000, 0050, 0165, 0165, 0141,
0171, 0051, 0147, 0141, 0155, 0155, 0141, 0056, 0160, 0156, 0147, 0000, 0000, 0000, 0000, 0000,
0322, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0211, 0120, 0116, 0107, 0015, 0012, 0032, 0012,
0000, 0000, 0000, 0015, 0111, 0110, 0104, 0122, 0000, 0000, 0000, 0020, 0000, 0000, 0000, 0020,
0010, 0006, 0000, 0000, 0000, 0037, 0363, 0377, 0141, 0000, 0000, 0000, 0004, 0163, 0102, 0111,
0124, 0010, 0010, 0010, 0010, 0174, 0010, 0144, 0210, 0000, 0000, 0000, 0211, 0111, 0104, 0101,
0124, 0070, 0215, 0335, 0220, 0333, 0015, 0303, 0040, 0014, 0000, 0117, 0135, 0302, 0154, 0301,
0026, 0036, 0303, 0133, 0260, 0005, 0143, 0260, 0004, 0142, 0212, 0214, 0301, 0024, 0356, 0117,
0150, 0253, 0246, 0315, 0243, 0221, 0372, 0221, 0373, 0101, 0130, 0102, 0167, 0006, 0056, 0211,
0233, 0231, 0217, 0113, 0316, 0331, 0001, 0237, 0317, 0005, 0267, 0367, 0201, 0252, 0122, 0153,
0245, 0265, 0346, 0000, 0275, 0167, 0104, 0204, 0020, 0302, 0376, 0204, 0224, 0322, 0303, 0250,
0252, 0256, 0252, 0037, 0355, 0133, 0214, 0107, 0137, 0363, 0127, 0031, 0326, 0055, 0373, 0342,
0017, 0136, 0021, 0021, 0127, 0325, 0303, 0162, 0000, 0112, 0051, 0316, 0163, 0215, 0343, 0005,
0323, 0064, 0141, 0146, 0277, 0331, 0001, 0142, 0214, 0273, 0012, 0326, 0070, 0267, 0302, 0134,
0161, 0046, 0340, 0117, 0334, 0001, 0104, 0104, 0062, 0144, 0335, 0065, 0206, 0150, 0000, 0000,
0000, 0000, 0111, 0105, 0116, 0104, 0256, 0102, 0140, 0202, 0000, 0000, 0050, 0165, 0165, 0141,
0171, 0051, 0151, 0155, 0141, 0147, 0145, 0163, 0057, 0000, 0000, 0000, 0004, 0000, 0000, 0000,
0002, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0001, 0000, 0000, 0000,
0146, 0162, 0145, 0145, 0056, 0160, 0156, 0147, 0220, 0000, 0000, 0000, 0000, 0000, 0000, 0000,
0211, 0120, 0116, 0107, 0015, 0012, 0032, 0012, 0000, 0000, 0000, 0015, 0111, 0110, 0104, 0122,
0000, 0000, 0000, 0020, 0000, 0000, 0000, 0020, 0010, 0006, 0000, 0000, 0000, 0037, 0363, 0377,
0141, 0000, 0000, 0000, 0004, 0163, 0102, 0111, 0124, 0010, 0010, 0010, 0010, 0174, 0010, 0144,
0210, 0000, 0000, 0000, 0107, 0111, 0104, 0101, 0124, 0070, 0215, 0143, 0140, 0030, 0264, 0340,
0077, 0003, 0303, 0177, 0142, 0324, 0061, 0015, 0270, 0053, 0050, 0166, 0001, 0155, 0275, 0300,
0300, 0100, 0330, 0033, 0003, 0357, 0005, 0106, 0154, 0202, 0377, 0031, 0030, 0376, 0063, 0042,
0311, 0301, 0370, 0104, 0245, 0015, 0154, 0212, 0210, 0115, 0124, 0070, 0025, 0222, 0155, 0063,
0321, 0362, 0304, 0330, 0200, 0123, 0015, 0321, 0376, 0303, 0001, 0000, 0150, 0327, 0035, 0362,
0332, 0201, 0300, 0327, 0000, 0000, 0000, 0000, 0111, 0105, 0116, 0104, 0256, 0102, 0140, 0202,
0000, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0154, 0151, 0156, 0145, 0141, 0162, 0164, 0056,
0160, 0156, 0147, 0000, 0000, 0000, 0000, 0000, 0237, 0000, 0000, 0000, 0000, 0000, 0000, 0000,
0211, 0120, 0116, 0107, 0015, 0012, 0032, 0012, 0000, 0000, 0000, 0015, 0111, 0110, 0104, 0122,
0000, 0000, 0000, 0020, 0000, 0000, 0000, 0020, 0010, 0006, 0000, 0000, 0000, 0037, 0363, 0377,
0141, 0000, 0000, 0000, 0004, 0163, 0102, 0111, 0124, 0010, 0010, 0010, 0010, 0174, 0010, 0144,
0210, 0000, 0000, 0000, 0126, 0111, 0104, 0101, 0124, 0070, 0215, 0275, 0222, 0061, 0016, 0000,
0040, 0010, 0003, 0253, 0377, 0341, 0377, 0213, 0276, 0255, 0216, 0106, 0305, 0100, 0300, 0330,
0021, 0070, 0050, 0204, 0202, 0270, 0010, 0000, 0305, 0131, 0111, 0055, 0156, 0302, 0004, 0170,
0203, 0115, 0266, 0211, 0270, 0100, 0315, 0005, 0215, 0374, 0242, 0272, 0007, 0232, 0210, 0033,
0126, 0025, 0335, 0071, 0014, 0037, 0053, 0174, 0235, 0376, 0316, 0101, 0346, 0160, 0151, 0007,
0117, 0032, 0260, 0317, 0347, 0011, 0211, 0110, 0334, 0140, 0000, 0170, 0126, 0030, 0101, 0135,
0240, 0266, 0230, 0000, 0000, 0000, 0000, 0111, 0105, 0116, 0104, 0256, 0102, 0140, 0202, 0000,
0000, 0050, 0165, 0165, 0141, 0171, 0051, 0162, 0145, 0163, 0145, 0164, 0056, 0160, 0156, 0147,
0166, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0211, 0120, 0116, 0107, 0015, 0012, 0032, 0012,
0000, 0000, 0000, 0015, 0111, 0110, 0104, 0122, 0000, 0000, 0000, 0020, 0000, 0000, 0000, 0020,
0010, 0006, 0000, 0000, 0000, 0037, 0363, 0377, 0141, 0000, 0000, 0000, 0004, 0163, 0102, 0111,
0124, 0010, 0010, 0010, 0010, 0174, 0010, 0144, 0210, 0000, 0000, 0000, 0055, 0111, 0104, 0101,
0124, 0070, 0215, 0143, 0144, 0040, 0037, 0374, 0147, 0140, 0140, 0140, 0140, 0042, 0127, 0167,
0223, 0243, 0043, 0105, 0126, 0377, 0037, 0325, 0074, 0252, 0171, 0030, 0152, 0376, 0337, 0344,
0350, 0110, 0276, 0315, 0020, 0313, 0311, 0267, 0035, 0000, 0000, 0350, 0036, 0357, 0200, 0371,
0024, 0076, 0000, 0000, 0000, 0000, 0111, 0105, 0116, 0104, 0256, 0102, 0140, 0202, 0000, 0000,
0050, 0165, 0165, 0141, 0171, 0051
} };
#else /* _MSC_VER */
static const SECTION union { const guint8 data[1223]; const double alignment; void * const ptr;} resource_resource_data = {
"\107\126\141\162\151\141\156\164\000\000\000\000\000\000\000\000"
"\030\000\000\000\344\000\000\000\000\000\000\050\007\000\000\000"
"\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000"
"\004\000\000\000\005\000\000\000\007\000\000\000\324\265\002\000"
"\377\377\377\377\344\000\000\000\001\000\114\000\350\000\000\000"
"\354\000\000\000\267\313\344\016\003\000\000\000\354\000\000\000"
"\012\000\166\000\370\000\000\000\302\001\000\000\157\154\146\174"
"\003\000\000\000\302\001\000\000\011\000\166\000\320\001\000\000"
"\262\002\000\000\231\027\304\163\000\000\000\000\262\002\000\000"
"\007\000\114\000\274\002\000\000\320\002\000\000\016\127\314\040"
"\003\000\000\000\320\002\000\000\010\000\166\000\330\002\000\000"
"\170\003\000\000\333\152\011\234\003\000\000\000\170\003\000\000"
"\013\000\166\000\210\003\000\000\067\004\000\000\017\224\122\353"
"\003\000\000\000\067\004\000\000\011\000\166\000\100\004\000\000"
"\306\004\000\000\057\000\000\000\003\000\000\000\163\160\154\151"
"\156\145\056\160\156\147\000\000\272\000\000\000\000\000\000\000"
"\211\120\116\107\015\012\032\012\000\000\000\015\111\110\104\122"
"\000\000\000\020\000\000\000\020\010\006\000\000\000\037\363\377"
"\141\000\000\000\004\163\102\111\124\010\010\010\010\174\010\144"
"\210\000\000\000\161\111\104\101\124\070\215\255\121\133\016\300"
"\040\014\102\157\326\223\065\361\342\354\143\232\350\046\353\346"
"\044\061\215\017\204\322\204\165\020\000\362\052\273\230\375\320"
"\076\345\271\205\274\334\202\204\273\023\000\153\175\124\127\140"
"\267\302\017\156\055\264\164\147\051\023\140\002\122\044\117\145"
"\065\264\177\175\320\357\025\171\337\024\224\102\075\147\061\373"
"\146\177\274\322\123\311\215\254\322\165\367\241\116\025\102\173"
"\001\244\275\067\070\000\162\046\070\352\371\102\163\071\000\000"
"\000\000\111\105\116\104\256\102\140\202\000\000\050\165\165\141"
"\171\051\147\141\155\155\141\056\160\156\147\000\000\000\000\000"
"\322\000\000\000\000\000\000\000\211\120\116\107\015\012\032\012"
"\000\000\000\015\111\110\104\122\000\000\000\020\000\000\000\020"
"\010\006\000\000\000\037\363\377\141\000\000\000\004\163\102\111"
"\124\010\010\010\010\174\010\144\210\000\000\000\211\111\104\101"
"\124\070\215\335\220\333\015\303\040\014\000\117\135\302\154\301"
"\026\036\303\133\260\005\143\260\004\142\212\214\301\024\356\117"
"\150\253\246\315\243\221\372\221\373\101\130\102\167\006\056\211"
"\233\231\217\113\316\331\001\237\317\005\267\367\201\252\122\153"
"\245\265\346\000\275\167\104\204\020\302\376\204\224\322\303\250"
"\252\256\252\037\355\133\214\107\137\363\127\031\326\055\373\342"
"\017\136\021\021\127\325\303\162\000\112\051\316\163\215\343\005"
"\323\064\141\146\277\331\001\142\214\273\012\326\070\267\302\134"
"\161\046\340\117\334\001\104\104\062\144\335\065\206\150\000\000"
"\000\000\111\105\116\104\256\102\140\202\000\000\050\165\165\141"
"\171\051\151\155\141\147\145\163\057\000\000\000\004\000\000\000"
"\002\000\000\000\005\000\000\000\006\000\000\000\001\000\000\000"
"\146\162\145\145\056\160\156\147\220\000\000\000\000\000\000\000"
"\211\120\116\107\015\012\032\012\000\000\000\015\111\110\104\122"
"\000\000\000\020\000\000\000\020\010\006\000\000\000\037\363\377"
"\141\000\000\000\004\163\102\111\124\010\010\010\010\174\010\144"
"\210\000\000\000\107\111\104\101\124\070\215\143\140\030\264\340"
"\077\003\303\177\142\324\061\015\270\053\050\166\001\155\275\300"
"\300\100\330\033\003\357\005\106\154\202\377\031\030\376\063\042"
"\311\301\370\104\245\015\154\212\210\115\124\070\025\222\155\063"
"\321\362\304\330\200\123\015\321\376\303\001\000\150\327\035\362"
"\332\201\300\327\000\000\000\000\111\105\116\104\256\102\140\202"
"\000\000\050\165\165\141\171\051\154\151\156\145\141\162\164\056"
"\160\156\147\000\000\000\000\000\237\000\000\000\000\000\000\000"
"\211\120\116\107\015\012\032\012\000\000\000\015\111\110\104\122"
"\000\000\000\020\000\000\000\020\010\006\000\000\000\037\363\377"
"\141\000\000\000\004\163\102\111\124\010\010\010\010\174\010\144"
"\210\000\000\000\126\111\104\101\124\070\215\275\222\061\016\000"
"\040\010\003\253\377\341\377\213\276\255\216\106\305\100\300\330"
"\021\070\050\204\202\270\010\000\305\131\111\055\156\302\004\170"
"\203\115\266\211\270\100\315\005\215\374\242\272\007\232\210\033"
"\126\025\335\071\014\037\053\174\235\376\316\101\346\160\151\007"
"\117\032\260\317\347\011\211\110\334\140\000\170\126\030\101\135"
"\240\266\230\000\000\000\000\111\105\116\104\256\102\140\202\000"
"\000\050\165\165\141\171\051\162\145\163\145\164\056\160\156\147"
"\166\000\000\000\000\000\000\000\211\120\116\107\015\012\032\012"
"\000\000\000\015\111\110\104\122\000\000\000\020\000\000\000\020"
"\010\006\000\000\000\037\363\377\141\000\000\000\004\163\102\111"
"\124\010\010\010\010\174\010\144\210\000\000\000\055\111\104\101"
"\124\070\215\143\144\040\037\374\147\140\140\140\140\042\127\167"
"\223\243\043\105\126\377\037\325\074\252\171\030\152\376\337\344"
"\350\110\276\315\020\313\311\267\035\000\000\350\036\357\200\371"
"\024\076\000\000\000\000\111\105\116\104\256\102\140\202\000\000"
"\050\165\165\141\171\051" };
#endif /* !_MSC_VER */
static GStaticResource static_resource = { resource_resource_data.data, sizeof (resource_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
G_MODULE_EXPORT
GResource *resource_get_resource (void);
GResource *resource_get_resource (void)
{
return g_static_resource_get_resource (&static_resource);
}
/*
If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
destructors, in a usable way, including e.g. on library unload. If not you're on
your own.
Some compilers need #pragma to handle this, which does not work with macros,
so the way you need to use this is (for constructors):
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
#endif
G_DEFINE_CONSTRUCTOR(my_constructor)
static void my_constructor(void) {
...
}
*/
#ifndef __GTK_DOC_IGNORE__
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
#define G_HAS_CONSTRUCTORS 1
#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);
#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
/* Visual studio 2008 and later has _Pragma */
#include <stdlib.h>
#define G_HAS_CONSTRUCTORS 1
/* We do some weird things to avoid the constructors being optimized
* away on VS2015 if WholeProgramOptimization is enabled. First we
* make a reference to the array from the wrapper to make sure its
* references. Then we use a pragma to make sure the wrapper function
* symbol is always included at the link stage. Also, the symbols
* need to be extern (but not dllexport), even though they are not
* really used from another object file.
*/
/* We need to account for differences between the mangling of symbols
* for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
* with an underscore but symbols on x64/ARM/ARM64 are not.
*/
#ifdef _M_IX86
#define G_MSVC_SYMBOL_PREFIX "_"
#else
#define G_MSVC_SYMBOL_PREFIX ""
#endif
#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)
#define G_MSVC_CTOR(_func,_sym_prefix) \
static void _func(void); \
extern int (* _array ## _func)(void); \
int _func ## _wrapper(void) { _func(); g_slist_find (NULL, _array ## _func); return 0; } \
__pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
__pragma(section(".CRT$XCU",read)) \
__declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;
#define G_MSVC_DTOR(_func,_sym_prefix) \
static void _func(void); \
extern int (* _array ## _func)(void); \
int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL, _array ## _func); return 0; } \
__pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
__pragma(section(".CRT$XCU",read)) \
__declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;
#elif defined (_MSC_VER)
#define G_HAS_CONSTRUCTORS 1
/* Pre Visual studio 2008 must use #pragma section */
#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
section(".CRT$XCU",read)
#define G_DEFINE_CONSTRUCTOR(_func) \
static void _func(void); \
static int _func ## _wrapper(void) { _func(); return 0; } \
__declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;
#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
section(".CRT$XCU",read)
#define G_DEFINE_DESTRUCTOR(_func) \
static void _func(void); \
static int _func ## _constructor(void) { atexit (_func); return 0; } \
__declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;
#elif defined(__SUNPRO_C)
/* This is not tested, but i believe it should work, based on:
* http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
*/
#define G_HAS_CONSTRUCTORS 1
#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
init(_func)
#define G_DEFINE_CONSTRUCTOR(_func) \
static void _func(void);
#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
fini(_func)
#define G_DEFINE_DESTRUCTOR(_func) \
static void _func(void);
#else
/* constructors not supported for this compiler */
#endif
#endif /* __GTK_DOC_IGNORE__ */
#ifdef G_HAS_CONSTRUCTORS
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(resource_constructor)
#endif
G_DEFINE_CONSTRUCTOR(resource_constructor)
#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(resource_destructor)
#endif
G_DEFINE_DESTRUCTOR(resource_destructor)
#else
#warning "Constructor not supported on this compiler, linking in resources will not work"
#endif
static void resource_constructor (void)
{
g_static_resource_init (&static_resource);
}
static void resource_destructor (void)
{
g_static_resource_fini (&static_resource);
}

Wyświetl plik

@ -51,17 +51,15 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(GTK_CFLAGS)
@SET_MAKE@
# LIBGTKSANE_OBJS = gtk3curve.o gtk3gamma.o gtkpreview.o Gtk3CurveResource.o gimpruler.o
LIBGTKSANE_OBJS = gtk3curve.o gtk3gamma.o Gtk3CurveResource.o gtk3ruler.o
# LIBGTKSANE_LTOBJS = gtk3curve.lo gtk3gamma.lo gtkpreview.lo Gtk3CurveResource.lo gimpruler.lo
LIBGTKSANE_LTOBJS = gtk3curve.lo gtk3gamma.lo Gtk3CurveResource.lo gtk3ruler.lo
LIBGTKSANE_OBJS = gtk3curve.o gtk3gamma.o gtk3ruler.o utils-gtk.o
LIBGTKSANE_LTOBJS = gtk3curve.lo gtk3gamma.lo gtk3ruler.lo utils-gtk.lo
TARGETS = $(LIBGTKSANE_OBJS) $(GTK_LIBS)
TARGETS = libgtksane.a
DISTFILES = Makefile.in gtk3curve.c gtk3curve.h Gtk3CurveResource.c \
DISTFILES = Makefile.in gtk3curve.c gtk3curve.h \
gtk3gamma.c gtk3gamma.h gtk3ruler.c \
gtk3ruler.h images resource.xml
gtk3ruler.h utils-gtk.c utils-gtk.h
# gtk3gamma.c gtk3gamma.h gtkpreview.c gtkpreview.h gimpruler.c \

Wyświetl plik

@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include "gtk3curve.h"
#include "utils-gtk.h"
#ifdef DEBUG
#define DEBUG_INFO g_print
@ -178,7 +179,7 @@ static void gtk_gadget_class_intern_init (gpointer klass)
{
g_type_class_adjust_private_offset (klass, &Gtk3Curve_private_offset);
gtk3_curve_parent_class = g_type_class_peek_parent (klass);
gtk3_curve_class_init ((Gtk3CurveClass*) klass);
// gtk3_curve_class_init ((Gtk3CurveClass*) klass);
}
GType
@ -545,6 +546,7 @@ gtk3_curve_draw (GtkWidget *widget,
{
Gtk3CurvePrivate *priv;
GtkStyleContext *style_context;
GtkStyle *style;
GdkRGBA color;
gint last_x, last_y;
gint i;
@ -582,6 +584,12 @@ gtk3_curve_draw (GtkWidget *widget,
0, 0,
allocation.width + RADIUS * 2,
allocation.height + RADIUS * 2);
/*
vj_gtk_context_get_color (style_context,
"background-color",
gtk_style_context_get_state (style_context),
&color);
*/
gtk_style_context_get_color (style_context,
gtk_style_context_get_state (style_context),
&color);
@ -1113,7 +1121,7 @@ gtk3_curve_motion_notify (GtkWidget *widget,
{
GdkCursor *cursor;
priv->cursor_type = new_type;
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
cursor = gdk_cursor_new_for_display (gdk_display_get_default (),
priv->cursor_type);
gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
g_object_unref (cursor);
@ -1249,8 +1257,7 @@ gtk3_curve_size_graph (Gtk3Curve *curve)
gint width, height;
gfloat aspect;
GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET (curve));
GdkDisplay *gdk_display = gdk_window_get_display(gdk_window);
GdkDisplay *gdk_display = gdk_display_get_default ();
GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display);
gdk_monitor_get_geometry(monitor, &geom);
@ -1654,8 +1661,7 @@ gtk3_curve_set_vector (GtkWidget *widget, int veclen, gfloat vector[])
GdkRectangle geom;
gfloat rx, dx, ry;
gint i, height;
GdkWindow *gdk_window = gtk_widget_get_window(GTK_WIDGET (curve));
GdkDisplay *gdk_display = gdk_window_get_display(gdk_window);
GdkDisplay *gdk_display = gdk_display_get_default ();
GdkMonitor *monitor = gdk_display_get_primary_monitor(gdk_display);
gdk_monitor_get_geometry(monitor, &geom);

Wyświetl plik

@ -42,15 +42,142 @@
static void gtk3_gamma_curve_destroy (GtkWidget *object);
static void curve_type_changed_callback (GtkWidget *w, gpointer data);
static void button_realize_callback (GtkWidget *w);
static void button_toggled_callback (GtkWidget *w, gpointer data);
static void button_clicked_callback (GtkWidget *w, gpointer data);
static const gchar * button_images[] = {
"/images/spline.png" ,
"/images/linear.png" ,
"/images/free.png" ,
"/images/gamma.png" ,
"/images/reset.png"
/* XPM */
static const char * spline_xpm[] = {
"16 16 5 1",
" c None",
". c #000000",
"+ c #824141",
"@ c #FF0000",
"# c #7F7F7F",
" ..",
" +.",
" @ ",
" @ ",
" @ ",
" #.# @ ",
" ... @ ",
" +.+ @ ",
" @ @ @ ",
" @ @ @ ",
" @ @ @ ",
" @ @.+ ",
" @ ... ",
" @ #.# ",
".+ ",
".. "};
/* XPM */
static const char * lineart_xpm[] = {
"16 16 4 1",
" c None",
". c #000000",
"+ c #FF0000",
"@ c #BC2D2D",
" ..",
" ++++++.",
" ++ ",
" .@ ",
" ... ",
" @. ",
" + ",
" + ",
" + ",
" + ",
" + ",
" + ",
" + ",
" + ",
".@ ",
".. "};
/* XPM */
static const char * free_xpm[] = {
"16 16 2 1",
" c None",
". c #FF0000",
" ",
" ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . ",
" . . .....",
" . . ",
" . . ",
" . . ",
" . . ",
". "};
/* XPM */
static const char * gamma_xpm[] = {
"16 16 10 1",
" c None",
". c #000000",
"+ c #5E5E5E",
"@ c #8C8C8C",
"# c #464646",
"$ c #171717",
"% c #BBBBBB",
"& c #757575",
"* c #A4A4A4",
"= c #2F2F2F",
" ",
" ",
" ",
" .+ @.@ ",
" #$% &$* ",
" &@ ## ",
" . .@ ",
" # # ",
" #$@ ",
" *. ",
" &+ ",
" =. ",
" .. ",
" .= ",
" ",
" "};
/* XPM */
static const char * reset_xpm[] = {
"16 16 4 1",
" c None",
". c #000000",
"+ c #824141",
"@ c #FF0000",
" ..",
" +.",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
" @ ",
".+ ",
".. "};
static const gchar ** button_images[] = {
spline_xpm,
lineart_xpm,
free_xpm,
gamma_xpm,
reset_xpm
};
enum
@ -77,6 +204,7 @@ static void
gtk3_gamma_curve_init (Gtk3GammaCurve *curve)
{
GtkWidget *image = NULL;
GdkPixbuf *pixbuf = NULL;
GtkWidget *vbox;
int i;
@ -84,14 +212,11 @@ gtk3_gamma_curve_init (Gtk3GammaCurve *curve)
curve->gamma = 1.0;
// curve->table = gtk_table_new (1, 2, FALSE);
curve->table = gtk_grid_new ();
gtk_grid_set_column_homogeneous (GTK_GRID (curve->table), FALSE);
gtk_grid_set_row_homogeneous (GTK_GRID (curve->table), FALSE);
//gtk_table_set_col_spacings (GTK_TABLE (curve->table), 3);
gtk_container_add (GTK_CONTAINER (curve), curve->table);
// GTK4 => gtk_box_append (GTK_BOX (curve), curve->table);
curve->curve = gtk3_curve_new ();
g_signal_connect (curve->curve, "curve-type-changed",
@ -106,16 +231,15 @@ gtk3_gamma_curve_init (Gtk3GammaCurve *curve)
/* toggle buttons: */
for (i = 0; i < 3; ++i)
{
curve->button[i] = gtk_toggle_button_new ();
curve->button[i] = gtk_toggle_button_new ();
pixbuf = gdk_pixbuf_new_from_xpm_data(button_images[i]);
image = gtk_image_new_from_pixbuf(pixbuf);
image = gtk_image_new_from_resource (button_images[i]);
gtk_button_set_image (GTK_BUTTON (curve->button[i]), image);
// GTK 4 => gtk_button_set_child (GTK_BUTTON (curve->button[i]), image);
g_object_set_data (G_OBJECT (curve->button[i]), "_Gtk3GammaCurveIndex",
GINT_TO_POINTER (i));
gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]);
// GTK4 => gtk_box_append (GTK_BOX (vbox), curve->button[i]);
g_signal_connect (G_OBJECT (curve->button[i]), "toggled",
G_CALLBACK (button_toggled_callback), curve);
gtk_widget_show (curve->button[i]);
@ -126,14 +250,13 @@ gtk3_gamma_curve_init (Gtk3GammaCurve *curve)
{
curve->button[i] = gtk_button_new ();
image = gtk_image_new_from_resource (button_images[i]);
pixbuf = gdk_pixbuf_new_from_xpm_data(button_images[i]);
image = gtk_image_new_from_pixbuf(pixbuf);
gtk_button_set_image (GTK_BUTTON (curve->button[i]), image);
// GTK 4 => gtk_button_set_child (GTK_BUTTON (curve->button[i]), image);
g_object_set_data (G_OBJECT (curve->button[i]), "_Gtk3GammaCurveIndex",
GINT_TO_POINTER (i));
gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]);
// GTK4 => gtk_box_append (GTK_BOX (vbox), curve->button[i]);
g_signal_connect (G_OBJECT (curve->button[i]), "clicked",
G_CALLBACK (button_clicked_callback), curve);
gtk_widget_show (curve->button[i]);

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 11 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 144 B

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 210 B

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 159 B

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 118 B

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 186 B

Wyświetl plik

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource>
<file>images/spline.png</file>
<file>images/lineart.png</file>
<file>images/free.png</file>
<file>images/gamma.png</file>
<file>images/reset.png</file>
</gresource>
</gresources>

36
libgtk/utils-gtk.c 100644
Wyświetl plik

@ -0,0 +1,36 @@
/* reloaded - Linux VeeJay
* (C) 2002-2019 Niels Elburg <nwelburg@gmail.com>
* (C) 2019 Jerome Blanchi <d.j.a.y@free.fr>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
Utils for gtk
*/
#include "utils-gtk.h"
void vj_gtk_context_get_color (GtkStyleContext *context, const gchar *property, GtkStateFlags state, GdkRGBA *color)
{
GdkRGBA *c;
gtk_style_context_save (context);
gtk_style_context_get (context, state, property, &c, NULL);
*color = *c;
gdk_rgba_free (c);
gtk_style_context_restore (context);
}

28
libgtk/utils-gtk.h 100644
Wyświetl plik

@ -0,0 +1,28 @@
/* reloaded - Linux VeeJay
* (C) 2002-2019 Niels Elburg <nwelburg@gmail.com>
* (C) 2019 Jerome Blanchi <d.j.a.y@free.fr>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef VJUTILSGTK_H
#define VJUTILSGTK_H
#include <gtk/gtk.h>
void vj_gtk_context_get_color (GtkStyleContext *context, const gchar *property, GtkStateFlags state, GdkRGBA *color);
#endif

Wyświetl plik

@ -374,6 +374,7 @@ autobutton_update (GtkWidget * widget, GSGDialogElement * elem)
}
set_option (dialog, opt_num, &val, SANE_ACTION_SET_VALUE);
}
g_signal_emit_by_name (G_OBJECT (elem->data), "value_changed");
return FALSE;
}
@ -751,6 +752,14 @@ curve_new (GSGDialog * dialog, int optnum)
gamma = gtk3_gamma_curve_new ();
curve = GTK3_GAMMA_CURVE (gamma)->curve;
gtk3_curve_set_color_background_rgba (curve, 0.8, 0.8, 0.8, 0.5);
gtk3_curve_set_color_grid_rgba (curve, 0.0, 0.0, 0.0, 0.5);
gtk3_curve_set_color_curve_rgba (curve, 1.0, 1.0, 1.0, 1.0);
gtk3_curve_set_color_cpoint_rgba (curve, 0.8, 0.3, 0.3, 1.0);
gtk3_curve_set_use_theme_background(curve, FALSE);
gtk3_curve_set_grid_size (curve, GTK3_CURVE_GRID_SMALL);
// gtk3_curve_set_range (da, 0, WINDOW_WIDTH, 0, WINDOW_HEIGHT);
dev = dialog->dev;
opt = sane_get_option_descriptor (dev, optnum);
@ -801,7 +810,10 @@ curve_new (GSGDialog * dialog, int optnum)
fmin = min;
fmax = max;
}
// gtk_widget_set_size_request (curve, optlen-1, fmax);
gtk_widget_set_size_request (curve, 200, 200);
gtk3_curve_set_range (GTK_WIDGET (curve), 0, optlen - 1, fmin, fmax);
// gtk3_curve_set_range (da, 0, WINDOW_WIDTH, 0, WINDOW_HEIGHT);
status = sane_control_option (dev, optnum, SANE_ACTION_GET_VALUE,
optval, 0);
@ -826,7 +838,7 @@ curve_new (GSGDialog * dialog, int optnum)
static void
vector_new (GSGDialog * dialog, GtkWidget * vbox, int num_vopts, int *vopts)
{
GtkWidget *notebook, *label, *curve;
GtkWidget *notebook, *label, *curve = NULL;
const SANE_Option_Descriptor *opt;
int i;

Wyświetl plik

@ -297,9 +297,13 @@ paint_image (Preview * p)
if (p->preview_row == NULL)
p->preview_row = malloc (3 * gwidth);
else
p->preview_row = realloc (p->preview_row, 3 * gwidth);
memset (p->preview_row, 0xff, 3 * gwidth);
if (p->preview_data == NULL)
p->preview_data = malloc (3 * gwidth * gheight);
else
p->preview_data = realloc (p->preview_data, 3 * gwidth * gheight);
memset (p->preview_data, 0xff, 3 * gwidth * gheight);
gtk_widget_queue_draw (p->window);
@ -336,8 +340,8 @@ paint_image (Preview * p)
memcpy(p->preview_data + (size_t) dst_y * (size_t) gwidth * 3, p->preview_row, (size_t) gwidth * 3);
src_x = 0.0;
src_y += yscale;
gtk_widget_queue_draw (p->window);
}
gtk_widget_queue_draw (p->window);
}
static void
@ -456,7 +460,7 @@ preview_area_resize (GtkWidget * widget, GdkEventConfigure *event, gpointer data
update_selection (p);
paint_image (p);
gtk_widget_queue_draw (p->window);
//gtk_widget_queue_draw (p->window);
}
static void