diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dea576..524c80a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,6 +134,7 @@ set( SOURCES src/config.c src/util/tracing.c src/mouse_actions.c src/drag_and_drop.c + src/default_icon.c src/clock/clock.c src/systray/systraybar.c src/launcher/launcher.c diff --git a/src/default_icon.c b/src/default_icon.c new file mode 100644 index 0000000..4f66778 --- /dev/null +++ b/src/default_icon.c @@ -0,0 +1,5 @@ +#include + +int default_icon_width = 48; +int default_icon_height = 48; +DATA32 default_icon_data[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220220039, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 320883335, 220220039, 0, 0, 0, 0, 3072807051, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173536397, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173470604, 3173536397, 3173536397, 3173536397, 3072741515, 270551687, 0, 0, 723536519, 4284054442, 4287540176, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286882764, 4286817228, 4286817227, 4286817227, 4286817227, 4286816971, 4286751435, 4286751435, 4286751179, 4286685642, 4286685642, 4286685386, 4286685386, 4286619850, 4286619850, 4286619850, 4286619850, 4287211470, 4283068065, 723536519, 0, 0, 723536519, 4283922857, 4284319677, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282281904, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4282216368, 4284451005, 4282936737, 723536519, 0, 0, 723536519, 4283725737, 4284319678, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4282348211, 4284319935, 4282805409, 723536519, 0, 0, 723536519, 4283594408, 4284254400, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4282479797, 4284254400, 4282673824, 723536519, 0, 0, 723536519, 4283397287, 4284254658, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4282677177, 4284189122, 4282542496, 723536519, 0, 0, 723536519, 4283200423, 4284254659, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4282808763, 4284254659, 4282476704, 723536519, 0, 0, 723536519, 4283068838, 4284254917, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4284189381, 4282345375, 723536519, 0, 0, 723536519, 4283068838, 4284254917, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283006399, 4283072192, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4283137985, 4284123847, 4282214047, 723536519, 0, 0, 723536519, 4283003047, 4284255175, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283072449, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4283138242, 4284123847, 4282214047, 723536519, 0, 0, 723536519, 4282937255, 4284847052, 4284124104, 4284124104, 4284124104, 4284124104, 4284124103, 4284124103, 4284124103, 4284124103, 4284124103, 4284058311, 4284058311, 4284058311, 4284058311, 4284058311, 4283992775, 4283992775, 4283992775, 4283992519, 4283992775, 4283992775, 4283992519, 4283992519, 4283992519, 4283992519, 4283992519, 4283992519, 4283992519, 4283992519, 4283992519, 4283992519, 4283926983, 4283926983, 4283926983, 4283926983, 4283926983, 4283926983, 4283861447, 4283861447, 4283861191, 4283861191, 4284518346, 4282148255, 723536519, 0, 0, 723536519, 4282147481, 4285106871, 4285106614, 4285106614, 4285106614, 4285106614, 4285106614, 4285041078, 4285041078, 4285041078, 4285041078, 4285041078, 4285041078, 4285041078, 4284975542, 4284975542, 4284975542, 4284975542, 4284975286, 4284975286, 4284975542, 4284975542, 4284975286, 4284975286, 4284975285, 4284975285, 4284975285, 4284975285, 4284975285, 4284975285, 4284975285, 4284975285, 4284975285, 4284909749, 4284909748, 4284909748, 4284909748, 4284909748, 4284909748, 4284909748, 4284909748, 4284909492, 4284909492, 4281884310, 723536519, 0, 0, 723536519, 4284645289, 4292928745, 4292862696, 4292862696, 4292797160, 4292797159, 4292797159, 4292797159, 4292797159, 4292731367, 4292731366, 4292731366, 4292731366, 4292731366, 4292731366, 4292731366, 4292731366, 4292731366, 4292665574, 4292665574, 4292731366, 4292731366, 4292665574, 4292665574, 4292665573, 4292665573, 4292665573, 4292599781, 4292599781, 4292599780, 4292599780, 4292599780, 4292599524, 4292533988, 4292533988, 4292533988, 4292533987, 4292533987, 4292533987, 4292533987, 4292533987, 4292533987, 4292599781, 4284579239, 723536519, 0, 0, 723536519, 4285039788, 4293783021, 4293519849, 4293519850, 4293519849, 4293519849, 4293519849, 4293519848, 4293519592, 4293519849, 4293454056, 4293454056, 4293454056, 4293454056, 4293454056, 4293454056, 4293454056, 4293453800, 4293453799, 4293388263, 4293388263, 4293388263, 4293388263, 4293388263, 4293388263, 4293322727, 4293388007, 4293388007, 4293322471, 4293322470, 4293322470, 4293322470, 4293322470, 4293322470, 4293322470, 4293322470, 4293322213, 4293256678, 4293256933, 4293256933, 4293256933, 4293256677, 4293519849, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4293717228, 4293454056, 4293388520, 4293388264, 4293388264, 4293388263, 4293388263, 4293388263, 4293388263, 4293388007, 4293388006, 4293388006, 4293388263, 4293322470, 4293322470, 4293322470, 4293322470, 4293322470, 4293322470, 4293256678, 4293256677, 4293256678, 4293256934, 4293256677, 4293256677, 4293256677, 4293256677, 4293256677, 4293256420, 4293256676, 4293256677, 4293256420, 4293190884, 4293190884, 4293190884, 4293190884, 4293125348, 4293125348, 4293190884, 4293190883, 4293190627, 4293454056, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4293651178, 4293322470, 4293322213, 4293256934, 4293256933, 4293256677, 4293256677, 4293256677, 4293256678, 4293256677, 4293256677, 4293256677, 4293256677, 4293256677, 4293256677, 4293191141, 4293190884, 4293191140, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293125092, 4293125091, 4293190627, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293059555, 4293059555, 4293124835, 4293124834, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293322470, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4293519849, 4293256420, 4293190884, 4293190884, 4293190884, 4293190884, 4293125348, 4293125348, 4293125092, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293124834, 4293059298, 4293059298, 4293059298, 4293059298, 4293059042, 4293059298, 4293059297, 4293059042, 4292993506, 4292993505, 4292993505, 4292993505, 4292993505, 4292993505, 4292993249, 4292993505, 4292927969, 4292993505, 4292927712, 4292927712, 4292927712, 4292927712, 4293322214, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4293454056, 4293059299, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059297, 4293059042, 4292993505, 4292993505, 4292993505, 4292993505, 4292993505, 4292993505, 4292993505, 4292927969, 4292993248, 4292993248, 4292927712, 4292927712, 4292927712, 4292927712, 4292927712, 4292927712, 4292927711, 4292927712, 4292861919, 4292927711, 4292861919, 4292861919, 4292861919, 4292861919, 4292861919, 4292861919, 4292861919, 4292861918, 4292796382, 4292796126, 4293190884, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4293388263, 4292993505, 4292993505, 4292993505, 4292993505, 4292993505, 4292927968, 4292927712, 4292927712, 4292927711, 4292927712, 4292927712, 4292927711, 4292862175, 4292862175, 4292861920, 4292861919, 4292861919, 4292861919, 4292861919, 4292861919, 4292861919, 4292796383, 4292796382, 4292861662, 4292796126, 4292796126, 4292796126, 4292796126, 4292796126, 4292796126, 4292796125, 4292795869, 4292795869, 4292795869, 4292730333, 4292730333, 4292730333, 4292730333, 4292730333, 4292730333, 4293125091, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4293256934, 4292861920, 4292927455, 4292861919, 4292861919, 4292861919, 4292861919, 4292861918, 4292861662, 4292796127, 4292796127, 4292796126, 4292796126, 4292796126, 4292796125, 4292796126, 4292795870, 4292796126, 4292730334, 4292730333, 4292730333, 4292730333, 4292730333, 4292730333, 4292730333, 4292730332, 4292664797, 4292664540, 4292664540, 4292664540, 4292664540, 4292664540, 4292664540, 4292664540, 4292664540, 4292664284, 4292598747, 4292598747, 4292598747, 4292598747, 4292598747, 4292993506, 4284908202, 723536519, 0, 0, 723536519, 4285039531, 4293256677, 4292795870, 4292795869, 4292730333, 4292795869, 4292730333, 4292730333, 4292730333, 4292730077, 4292730333, 4292730333, 4292664796, 4292664541, 4292664796, 4292664540, 4292664540, 4292664540, 4292664540, 4292664540, 4292664540, 4292664284, 4292664283, 4292598747, 4292598747, 4292598747, 4292598747, 4292598747, 4292598491, 4292598747, 4292598747, 4292533211, 4292533210, 4292532954, 4292532954, 4292532954, 4292532954, 4292532954, 4292532954, 4292467417, 4292467417, 4292467162, 4292993505, 4284908202, 723536519, 0, 0, 723536519, 4284973995, 4293125092, 4292664540, 4292664284, 4292664540, 4292598748, 4292598747, 4292599003, 4292598747, 4292598747, 4292598747, 4292598747, 4292598747, 4292598491, 4292598491, 4292598490, 4292532955, 4292532955, 4292532954, 4292598490, 4292532954, 4292532954, 4292467418, 4292467417, 4292467417, 4292467417, 4292467161, 4292467161, 4292532697, 4292467161, 4292467161, 4292467161, 4292401369, 4292401368, 4292466904, 4292401368, 4292401368, 4292466904, 4292401368, 4292401368, 4292401368, 4292401368, 4292861919, 4284908202, 723536519, 0, 0, 723536519, 4284973995, 4293059299, 4292532954, 4292532954, 4292532954, 4292532954, 4292467418, 4292467418, 4292532953, 4292532697, 4292467161, 4292467161, 4292467161, 4292467161, 4292467161, 4292467161, 4292467161, 4292467161, 4292401368, 4292466905, 4292401624, 4292401368, 4292401368, 4292401368, 4292401367, 4292335832, 4292401367, 4292335832, 4292401367, 4292335575, 4292335575, 4292335575, 4292335575, 4292335575, 4292335575, 4292335575, 4292270039, 4292335318, 4292270038, 4292269782, 4292269782, 4292269782, 4292796127, 4284908202, 723536519, 0, 0, 723536519, 4284973995, 4292993505, 4292467161, 4292401625, 4292401368, 4292401368, 4292401368, 4292401368, 4292401368, 4292335832, 4292401367, 4292401368, 4292401112, 4292335575, 4292335831, 4292335831, 4292335575, 4292335575, 4292335575, 4292335575, 4292270038, 4292270038, 4292269782, 4292269782, 4292269782, 4292269782, 4292269782, 4292269782, 4292269782, 4292203990, 4292204246, 4292269525, 4292203989, 4292204245, 4292203989, 4292203989, 4292203989, 4292203989, 4292203989, 4292203733, 4292138196, 4292138196, 4292730333, 4284908202, 723536519, 0, 0, 723536519, 4284973995, 4292927712, 4292335575, 4292335575, 4292270039, 4292335319, 4292269782, 4292269783, 4292269782, 4292269782, 4292269782, 4292269782, 4292269782, 4292269781, 4292204245, 4292204246, 4292203989, 4292203989, 4292203989, 4292203989, 4292203989, 4292203989, 4292138453, 4292203989, 4292138453, 4292138196, 4292203732, 4292138196, 4292138196, 4292138196, 4292072660, 4292137940, 4292072660, 4292072660, 4292072659, 4292072404, 4292072403, 4292072403, 4292072403, 4292072403, 4292072403, 4292072403, 4292664540, 4284908202, 723536519, 0, 0, 723536519, 4284973995, 4292861663, 4292203989, 4292203989, 4292203989, 4292203989, 4292203989, 4292203989, 4292203988, 4292203989, 4292138452, 4292138196, 4292138196, 4292138196, 4292138196, 4292138196, 4292138196, 4292138196, 4292137939, 4292072403, 4292137939, 4292072403, 4292072403, 4292137939, 4292072403, 4292072403, 4292072147, 4292072146, 4292006610, 4292006610, 4292006610, 4292006610, 4292006610, 4292006610, 4292006610, 4291941073, 4291940818, 4291940817, 4291940817, 4291940817, 4291940817, 4291940817, 4292664284, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4292796126, 4292072659, 4292137940, 4292137939, 4292072659, 4292072403, 4292072403, 4292072403, 4292072403, 4292072403, 4292072403, 4292006867, 4292072147, 4292006611, 4292006610, 4292006610, 4292006610, 4292006610, 4292006610, 4292006610, 4292006610, 4291940817, 4292006353, 4291940817, 4291940817, 4291940817, 4291940817, 4291940816, 4291940817, 4291940817, 4291940817, 4291875024, 4291875024, 4291875024, 4291875024, 4291874768, 4291809488, 4291875024, 4291875024, 4291875024, 4291874767, 4292532954, 4284973738, 723536519, 0, 0, 723536519, 4285039531, 4292730333, 4292006610, 4292006610, 4292006610, 4291941074, 4291940817, 4291940817, 4292006353, 4291940817, 4291940817, 4291940817, 4291940817, 4291940561, 4291875280, 4291875024, 4291875024, 4291875024, 4291875024, 4291875024, 4291875024, 4291875024, 4291875024, 4291875024, 4291809488, 4291809487, 4291809231, 4291809231, 4291809231, 4291809231, 4291809231, 4291743695, 4291809231, 4291808974, 4291743438, 4291808974, 4291743438, 4291743438, 4291743438, 4291743438, 4291743438, 4291743438, 4292467161, 4284908202, 723536519, 0, 0, 723536519, 4285039531, 4292664540, 4291875024, 4291875024, 4291875024, 4291875024, 4291875024, 4291875024, 4291875023, 4291809232, 4291874767, 4291809231, 4291809231, 4291809231, 4291809231, 4291809231, 4291809231, 4291808975, 4291809230, 4291743695, 4291743438, 4291743438, 4291743438, 4291743438, 4291743438, 4291743438, 4291743181, 4291743437, 4291677901, 4291677902, 4291677645, 4291677645, 4291677645, 4291677645, 4291677389, 4291677645, 4291677644, 4291611852, 4291611852, 4291611852, 4291611852, 4291611852, 4292466905, 4284908202, 723536519, 0, 0, 723536519, 4285039531, 4292598747, 4291809230, 4291743694, 4291808974, 4291808974, 4291743694, 4291743438, 4291743438, 4291743438, 4291743438, 4291743182, 4291677645, 4291677646, 4291677645, 4291677645, 4291677645, 4291677645, 4291677645, 4291677645, 4291677644, 4291677388, 4291611852, 4291612108, 4291611852, 4291611852, 4291611852, 4291611852, 4291611852, 4291611851, 4291546059, 4291611851, 4291546059, 4291546059, 4291546059, 4291546059, 4291546059, 4291546059, 4291480523, 4291480267, 4291480267, 4291480267, 4292335575, 4284973995, 723536519, 0, 0, 723536519, 4285039531, 4292532954, 4291677645, 4291612109, 4291677645, 4291677645, 4291612109, 4291611853, 4291611852, 4291611852, 4291611852, 4291611852, 4291611852, 4291611852, 4291546316, 4291546315, 4291546059, 4291546059, 4291546059, 4291546059, 4291546059, 4291546059, 4291545803, 4291546059, 4291480523, 4291546059, 4291480266, 4291480266, 4291480266, 4291480266, 4291480266, 4291480266, 4291480265, 4291480009, 4291480265, 4291414473, 4291414473, 4291414473, 4291414473, 4291414473, 4291414473, 4291414473, 4292335319, 4284973995, 723536519, 0, 0, 723536519, 4284973995, 4292467161, 4291546059, 4291546059, 4291546059, 4291546059, 4291546059, 4291546059, 4291480267, 4291480523, 4291480266, 4291480266, 4291480266, 4291480266, 4291480266, 4291480266, 4291414473, 4291480266, 4291414473, 4291414473, 4291414729, 4291414473, 4291414473, 4291414473, 4291414473, 4291414473, 4291414217, 4291348680, 4291348680, 4291348680, 4291348680, 4291348680, 4291348680, 4291348680, 4291348680, 4291348680, 4291282888, 4291348424, 4291282887, 4291282887, 4291282887, 4291282887, 4292203989, 4284973995, 723536519, 0, 0, 723536519, 4285039788, 4292401369, 4291480265, 4291480265, 4291480009, 4291414473, 4291414473, 4291414473, 4291348937, 4291414473, 4291414473, 4291414217, 4291414216, 4291414473, 4291348681, 4291348680, 4291348680, 4291348680, 4291348680, 4291348680, 4291283143, 4291348680, 4291282887, 4291282888, 4291282887, 4291282887, 4291282887, 4291282887, 4291282887, 4291282887, 4291217095, 4291217351, 4291217094, 4291217094, 4291217094, 4291217094, 4291217094, 4291217094, 4291151558, 4291151557, 4291151558, 4291151558, 4292203989, 4284973995, 723536519, 0, 0, 723536519, 4285039788, 4292335575, 4291348680, 4291348680, 4291348680, 4291348423, 4291282888, 4291282887, 4291282887, 4291282887, 4291282887, 4291282887, 4291282887, 4291282887, 4291282630, 4291282630, 4291217350, 4291282630, 4291217094, 4291217094, 4291217094, 4291217094, 4291217094, 4291217094, 4291151301, 4291151302, 4291216837, 4291151301, 4291151302, 4291151301, 4291151301, 4291151301, 4291151045, 4291085508, 4291085509, 4291085509, 4291085508, 4291085508, 4291085508, 4291085508, 4291085508, 4291085508, 4292138196, 4284973995, 723536519, 0, 0, 723536519, 4285039788, 4292269782, 4291282630, 4291217094, 4291217094, 4291217094, 4291217094, 4291216838, 4291217093, 4291151302, 4291151558, 4291151301, 4291151301, 4291151301, 4291151301, 4291151301, 4291151301, 4291151045, 4291151301, 4291085509, 4291085508, 4291085508, 4291085508, 4291085508, 4291085508, 4291085508, 4291085507, 4291085252, 4291019716, 4291019716, 4291019715, 4291019715, 4291019459, 4291019715, 4291019715, 4291019459, 4291019459, 4291019459, 4290953922, 4290953922, 4290953922, 4290953922, 4292072403, 4285039788, 723536519, 0, 0, 723536518, 4285039788, 4292203989, 4291085765, 4291151301, 4291151044, 4291085509, 4291085765, 4291085508, 4291151045, 4291085764, 4291085508, 4291085508, 4291085507, 4291085508, 4291085507, 4291019716, 4291019715, 4291085251, 4291019715, 4291019715, 4291019715, 4291019459, 4291019459, 4290954179, 4290953923, 4290954179, 4290954178, 4290953922, 4290953922, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4290888129, 4292006610, 4284973995, 740247684, 0, 16777216, 807224185, 4284908202, 4293454056, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293190884, 4293125091, 4293125091, 4293190884, 4293190628, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293125091, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293059298, 4293388263, 4284908202, 857423216, 83886080, 201326592, 1008153952, 4281029774, 4282147995, 4282147995, 4282147995, 4282147995, 4282147995, 4282147995, 4282147739, 4282016410, 4281161103, 4282147739, 4282082203, 4282016667, 4282016667, 4282016667, 4282016667, 4282016667, 4282016666, 4282016666, 4282016410, 4282016666, 4282016666, 4282016410, 4282016410, 4282016410, 4281950874, 4281950874, 4281950874, 4281950874, 4281950874, 4281950874, 4281950874, 4281950874, 4281885338, 4281030031, 4281885081, 4281885082, 4281885082, 4281885082, 4281885082, 4281885082, 4281885082, 4281819289, 4280898190, 1091907929, 318767104, 352321536, 1142173269, 4281622428, 4283597503, 4283597503, 4283597503, 4283597503, 4283597503, 4283597503, 4283597503, 4283334587, 4281425562, 4283597503, 4283531967, 4283531967, 4283531967, 4283531967, 4283531967, 4283531967, 4283531710, 4283531710, 4283466174, 4283531710, 4283531710, 4283466174, 4283466174, 4283466174, 4283466174, 4283466174, 4283466174, 4283466174, 4283466174, 4283466174, 4283400382, 4283400382, 4283400382, 4281359770, 4283334588, 4283400382, 4283400382, 4283400382, 4283334846, 4283334846, 4283334846, 4283334589, 4281425307, 1225927503, 469762048, 452984832, 1074799939, 4280963980, 4282147479, 4282147223, 4282147223, 4282147223, 4282147223, 4282147223, 4282147223, 4282081174, 4281160846, 4282081430, 4282147223, 4282147223, 4282147223, 4282147223, 4282147223, 4282147223, 4282147223, 4282147223, 4282147223, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4282081430, 4281160845, 4282081430, 4282081430, 4282081430, 4282081430, 4282081686, 4282081686, 4282081686, 4282147223, 4280963724, 1192173885, 587202560, 452984832, 688064268, 1998141026, 2098738268, 2232823895, 2350198355, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2366975570, 2400529745, 2316709716, 2182558297, 2065183838, 822215946, 587202560, 352321536, 520093696, 721420288, 872415232, 1023410176, 1124073472, 1140850688, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1124073472, 1140850688, 1174405120, 1107296256, 973078528, 838860800, 637534208, 486539264, 218103808, 369098752, 536870912, 654311424, 788529152, 855638016, 855638016, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 838860800, 855638016, 889192448, 838860800, 738197504, 620756992, 469762048, 318767104, 16777216, 117440512, 234881024, 352321536, 436207616, 486539264, 486539264, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 469762048, 486539264, 503316480, 486539264, 402653184, 318767104, 167772160, 50331648, 0, 0, 33554432, 83886080, 134217728, 184549376, 201326592, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 184549376, 201326592, 201326592, 167772160, 100663296, 50331648, 0, 0}; diff --git a/src/default_icon.h b/src/default_icon.h new file mode 100644 index 0000000..cfb8111 --- /dev/null +++ b/src/default_icon.h @@ -0,0 +1,10 @@ +#ifndef default_icon_h +#define default_icon_h + +#include + +extern int default_icon_width; +extern int default_icon_height; +extern DATA32 default_icon_data[]; + +#endif diff --git a/src/init.c b/src/init.c index 82010c6..6d3ac09 100644 --- a/src/init.c +++ b/src/init.c @@ -12,6 +12,7 @@ #include #include "config.h" +#include "default_icon.h" #include "drag_and_drop.h" #include "fps_distribution.h" #include "panel.h" @@ -55,6 +56,9 @@ void handle_cli_arguments(int argc, char **argv) } else if (strcmp(argv[i], "--test-verbose") == 0) { run_all_tests(true); exit(0); + } else if (strcmp(argv[i], "--dump-image-data") == 0) { + dump_image_data(argv[i+1], argv[i+2]); + exit(0); } else if (strcmp(argv[i], "-c") == 0) { if (i + 1 < argc) { i++; @@ -165,6 +169,22 @@ void create_default_elements() default_panel(); } +void load_default_task_icon() +{ + const gchar *const *data_dirs = g_get_system_data_dirs(); + for (int i = 0; data_dirs[i] != NULL; i++) { + gchar *path = g_build_filename(data_dirs[i], "tint2", "default_icon.png", NULL); + if (g_file_test(path, G_FILE_TEST_EXISTS)) + default_icon = load_image(path, TRUE); + g_free(path); + } + if (!default_icon) { + default_icon = imlib_create_image_using_data(default_icon_width, + default_icon_height, + default_icon_data); + } +} + void init_post_config() { server_init_visual(); @@ -175,20 +195,7 @@ void init_post_config() imlib_context_set_colormap(server.colormap); init_signals_postconfig(); - - // load default icon - const gchar *const *data_dirs = g_get_system_data_dirs(); - for (int i = 0; data_dirs[i] != NULL; i++) { - gchar *path = g_build_filename(data_dirs[i], "tint2", "default_icon.png", NULL); - if (g_file_test(path, G_FILE_TEST_EXISTS)) - default_icon = load_image(path, TRUE); - g_free(path); - } - if (!default_icon) { - fprintf(stderr, - RED "Could not load default_icon.png. Please check that tint2 has been installed correctly!" RESET - "\n"); - } + load_default_task_icon(); XSync(server.display, False); } diff --git a/src/util/common.c b/src/util/common.c index cf1d963..bce11cb 100644 --- a/src/util/common.c +++ b/src/util/common.c @@ -1114,3 +1114,63 @@ void adjust_color(Color *color, int alpha, int saturation, int brightness) color->rgb[1] = g / 255.; color->rgb[2] = b / 255.; } + +void dump_image_data(const char *file_name, const char *name) +{ + Imlib_Image image = load_image(file_name, false); + if (!image) { + fprintf(stderr, "tint2: Could not load image from file\n"); + return; + } + + gchar *header_name = g_strdup_printf("%s.h", name); + gchar *guard = g_strdup_printf("%s_h", name); + FILE *header = fopen(header_name, "wt"); + fprintf(header, + "#ifndef %s\n" + "#define %s\n" + "\n" + "#include \n" + "\n" + "extern int %s_width;\n" + "extern int %s_height;\n" + "extern DATA32 %s_data[];\n" + "\n" + "#endif\n", + guard, + guard, + name, + name, + name); + fclose(header); + g_free(guard); + g_free(header_name); + + imlib_context_set_image(image); + + gchar *source_name = g_strdup_printf("%s.c", name); + FILE *source = fopen(source_name, "wt"); + fprintf(source, + "#include <%s.h>\n" + "\n" + "int %s_width = %d;\n" + "int %s_height = %d;\n" + "DATA32 %s_data[] = {", + name, + name, + imlib_image_get_width(), + name, + imlib_image_get_height(), + name); + + size_t size = (size_t)imlib_image_get_width() * (size_t)imlib_image_get_height(); + DATA32 *data = imlib_image_get_data_for_reading_only(); + for (size_t i = 0; i < size; i++) { + fprintf(source, "%s%u", i == 0 ? "" : ", ", data[i]); + } + fprintf(source, "};\n"); + fclose(source); + g_free(source_name); + + imlib_free_image(); +} diff --git a/src/util/common.h b/src/util/common.h index a1f3d9d..4187e1c 100644 --- a/src/util/common.h +++ b/src/util/common.h @@ -149,6 +149,8 @@ GString *tint2_g_string_replace(GString *s, const char *from, const char *to); void get_image_mean_color(const Imlib_Image image, Color *mean_color); +void dump_image_data(const char *file_name, const char *name); + #define free_and_null(p) \ { \ free(p); \ diff --git a/tint2.files b/tint2.files index 8d61497..008f763 100644 --- a/tint2.files +++ b/tint2.files @@ -20,6 +20,9 @@ src/battery/battery.c src/battery/battery.h src/clock/clock.c src/clock/clock.h +src/default_icon.c +src/default_icon.c +src/default_icon.h src/execplugin/execplugin.c src/execplugin/execplugin.h src/launcher/launcher.c