Commit 9f083d1
Notifications when export of a font is done and a fix for a memory leak Notifications depends on libnotify
Changed files (7)
modifiedbirdfont/GtkWindow.valamodifiedconfiguremodifieddodo.pymodifiedfonts/BetecknaBirdfont.bfmodifiedlibbirdfont/KerningDisplay.valamodifiedlibbirdfont/PenTool.valamodifiedscripts/build.py
Diff
@@ -21,6 +21,7 @@ using Gdk; using BirdFont; using WebKit; using Gdk;+using Notify; namespace BirdFont { @@ -63,6 +64,8 @@ public class GtkWindow : Gtk.Window, NativeWindow { } public void init () {+ Notify.init ("Fonts have been exported.");+ description = new DescriptionForm (); clipboard = Clipboard.get_for_display (get_display (), Gdk.SELECTION_CLIPBOARD);@@ -892,9 +895,20 @@ public class GtkWindow : Gtk.Window, NativeWindow { } public void* export_thread () {+ IdleSource idle = new IdleSource ();+ ExportCallback.export_fonts (); MenuTab.stop_background_thread (); MenuTab.signal_file_exported ();++ idle.set_callback (() => {+ Notify.Notification export_notification;+ export_notification = new Notify.Notification ("BirdFont", t_("Your fonts have been exported."), null);+ export_notification.show ();+ return false;+ });+ idle.attach (null);+ return null; } @@ -61,7 +61,8 @@ def configure (): 'gtk+-2.0', 'libxml-2.0', 'webkit-1.0', - 'libsoup-2.4'+ 'libsoup-2.4',+ 'libnotify' ] for lib in libs:@@ -47,7 +47,8 @@ LIBS = [ 'cairo', 'gdk-pixbuf-2.0', 'webkit-1.0',- config.GEE+ config.GEE,+ 'libnotify' ] def task_build ():@@ -62,7 +62,7 @@ </collection> <collection unicode="U+46"> <selected id="1"/>- <glyph id="1" left="-28" right="17">+ <glyph id="1" left="-28" right="22.611111111111104"> <path stroke="0" data="B 7.2389587504,45.8529398907 C 7.2389587504,45.8529398907 -2.2777258567,45.8529398907 7.2389587504,45.8529398907 C -2.2777258567,45.8529398907 -10.1228773152,45.8917012750 -18.8037953479,45.9110819672 M -18.6624182988,24.1867540984 M 0.9020844335,24.2589726776 M 0.9167729581,16.5132240437 M -18.8331723971,16.4593661202 M -18.6305931621,-18.0341857923 M -28.0018718507,-18.0859016393 M -28.0073800474,53.7602622951 M 7.1232866193,53.7284371585 C 7.1618439963,51.1032714026 7.1108640249,50.0725308487 7.2389587504,45.8529398907" /> </glyph> </collection>@@ -73,12 +73,15 @@ </glyph> </collection> <collection unicode="U+53">- <selected id="2"/>+ <selected id="3"/> <glyph id="1" left="-28" right="36"> <path stroke="0" data="B -1.9568750011,47.2855625275 C -6.3626752962,47.1756539354 -12.4360348295,42.5578496272 -12.6190653479,37.8786090557 T C -12.8136078648,32.9050601324 -11.0459886131,30.0606951720 -3.4028257041,26.5915809869 T C 3.5759758811,23.4240101968 7.0980904229,21.9693822267 12.7324420084,16.7740710245 T C 16.4603981969,13.3366049286 18.6021456870,9.0906731550 18.3384713259,1.2407893408 T C 18.1462374367,-4.4822308616 14.8160510552,-10.3817887770 9.8655858193,-13.7165723751 C 5.6304017838,-16.5695757783 0.2791626829,-17.7849650236 -6.6687765882,-17.8053221019 T C -14.0367917988,-17.8269099795 -19.5063722411,-14.8346837575 -25.2635565797,-11.1586949959 M -21.1876982812,-3.3002763703 C -16.4903520265,-6.8824132579 -12.9851134742,-9.0096768528 -5.7011935489,-9.4329644278 T C -1.8675535137,-9.6557472440 1.9380632691,-8.6956718256 4.6783750865,-7.0126693575 C 7.5175787371,-5.2689337571 9.5068417950,-2.1378861596 9.6114470576,0.9965808604 T C 9.7821859867,6.1127244368 8.4172198126,9.2794192953 5.5475927405,11.6707751887 T C 0.4043531754,15.9568081596 -3.7704564030,17.2486842266 -11.2109985690,20.3738741987 T C -19.7070359950,23.9423951981 -22.3287467322,30.8408708556 -22.1664868872,37.8538853826 T C -21.9215515417,48.4402084252 -10.4940590257,54.6206553818 -1.7545977511,54.7888739993 T C 5.0270340296,54.9194079861 11.1569718237,52.1735217363 13.4666642789,49.9904395567 M 8.8134609201,43.3446108653 C 6.5255829318,45.4778051394 3.4086221716,47.4194120443 -1.9568750011,47.2855625275 T" /> </glyph> <glyph id="2" left="-28" right="36">- <path stroke="0" data="S -0.8443527421,47.3354857046 D -4.1410510360,47.0960996418 -11.4997239115,41.6770644775 -11.7161868250,38.1716273312 T D -11.9462645211,34.4457100851 -8.4292744792,29.4100003551 -2.7570993205,26.6794201071 T D 2.4220373093,24.1861881833 10.4989167449,19.7109215797 13.4243263556,16.6285208826 T D 16.0424002248,13.8699489924 18.7369787690,6.7257297559 18.4063656941,0.8442815898 T D 18.1653296034,-3.4436349541 13.3663431643,-11.5013606995 9.5979786583,-13.9179938492 D 6.3740954396,-15.9854944836 -1.8145019869,-17.7348129640 -7.0244731220,-17.6324401551 T D -12.5494417599,-17.5238778341 -19.6675301852,-15.1039540570 -22.4393180957,-13.5950493875 D -21.8444971268,-11.5425001093 -20.8531288453,-8.1215846456 -20.0600342201,-5.3848522747 D -16.9699941905,-6.7296611689 -11.3225125946,-8.8433491703 -5.8681316083,-9.2840592184 T D -2.9974062941,-9.5160117524 2.4802244453,-8.3142320677 4.5634297391,-7.0986985752 D 6.7218132890,-5.8393011959 9.5445483463,-1.5513331098 9.6760524872,0.7971469628 T D 9.8906963362,4.6303859667 7.9653859661,9.7187161006 5.8542025935,11.5603620892 T D 2.0703235116,14.8611486637 -5.1775749919,18.1702943025 -10.7036463596,20.6395665205 T D -17.0136313193,23.4591230409 -21.3677039713,33.1037331775 -21.1273015742,38.3594063986 T D -20.7644080673,46.2929782330 -7.0285142915,54.8541560815 -0.4727406060,54.8323186058 T D 4.6143971221,54.8153731998 12.4462230375,53.2616764100 14.9567863099,51.9707583298 D 14.0221027784,50.1954830381 12.4642968926,47.2366908853 11.2180521839,44.8696571631 D 8.8238247881,46.1205228373 3.3894885534,47.6429213592 -0.8443527421,47.3354857046 T" />+ <path stroke="0" data="S 0.0254742867,46.0336284552 D -4.7615536160,46.0336284552 -12.0378766662,42.0414403700 -12.0378766662,37.9624655874 T D -12.0378766662,34.2294513802 -7.6689439007,29.4100003551 -2.7570993205,26.6794201071 T D 2.2667965970,23.8865485623 10.1187514556,19.5208389351 13.0441610663,16.4384382380 T D 15.6622349355,13.6798663478 19.3623741148,5.9181269446 19.0317610399,0.0366787785 T D 18.7907249492,-4.2512377654 13.7134899543,-11.7617207920 9.9451254483,-14.1783539417 D 6.7212422296,-16.2458545761 -1.8145019869,-17.7348129640 -7.0244731220,-17.6324401551 T D -12.5494417599,-17.5238778341 -19.6675301852,-15.1039540570 -22.4393180957,-13.5950493875 D -21.8444971268,-11.5425001093 -20.5927687528,-6.8735523813 -19.7996741276,-4.1368200104 D -16.7799115459,-6.2957276814 -10.5657702491,-8.0910283604 -7.9589018836,-8.2080574843 T D -5.0817188163,-8.3372217406 1.6312927287,-7.8645643182 4.0176623718,-6.8194703242 T D 6.0962798943,-5.9091542318 9.5347520634,-1.7452322938 9.5347520634,0.6069267124 T D 9.5347520634,4.5991147975 7.1273219411,9.2836246480 5.0028448681,11.1099193521 T D 1.1764052708,14.3992965173 -3.8083742853,16.6981415744 -9.3730678472,19.6891532974 T D -17.1282091490,23.8575263244 -22.0183468791,32.7012970556 -22.0183468791,37.9624655874 T D -22.0183468791,46.0336284552 -7.9857049214,54.8570554227 -0.4727406060,54.8323186058 T D 4.6143977704,54.8155689441 12.4462230375,53.2616764100 14.9567863099,51.9707583298 D 14.0221027784,50.1954830381 11.2521892083,46.4045681348 10.0059444996,44.0375344126 D 7.6117171038,45.2884000868 4.0176623718,46.0336284552 0.0254742867,46.0336284552 T" />+ </glyph>+ <glyph id="3" left="-28" right="22.121212121212114">+ <path stroke="0" data="S -6.0438616648,23.4494935574 Q 10.3312786796,15.7246927403 9.9839005095,1.9629004414 Q 10.0485174460,-17.9837584059 -11.9628976595,-17.9837584059 Q -19.4152958304,-17.2762795711 -23.7272303218,-14.9066971712 Q -26.2425254418,-13.5244407712 -28.0552767703,-12.0647224111 L -28.0552767703,-2.0763491700 Q -25.3566411397,-4.5558008448 -22.5639926226,-6.4518085663 Q -18.0365169964,-9.5256392662 -12.6595610712,-10.1624121634 Q 0.0601442048,-10.0300537879 0.0601442048,1.9929880764 Q -0.9854144203,8.5334469564 -9.9282290363,13.4611203163 Q -28.0552767703,23.4494935574 -28.0552767703,36.0274450463 Q -27.9070984941,44.8062340881 -21.9543462379,50.4535035283 Q -16.8013789821,55.1497415596 -7.1840239656,55.2600454313 Q 2.8473166935,55.3750974088 7.2967160160,52.3969365658 L 6.5965958306,44.5246330922 Q 2.8930467072,45.7828596806 0.6735863108,46.2620844186 Q -3.2621156461,47.0158079991 -7.4439927722,46.9119773463 Q -18.0935606387,46.7420391030 -17.9867598237,35.9551567876 Q -18.0669035291,29.5534994270 -6.0438616648,23.4494935574" /> </glyph> </collection> <collection unicode="U+61">@@ -113,15 +116,15 @@ <selected id="1"/> <glyph id="1" left="-28" right="28"> <path stroke="0" data="B -18.7821306640,-17.9663335780 C -21.7911361284,-17.9663061740 -23.3676267899,-17.9724994699 -27.8091470574,-17.9662513661 C -27.8810596257,5.9319781421 -27.9529721940,29.8302076503 -28.0248847623,53.7284371585 M -18.4730596257,53.7645464481 M -18.7821306640,-17.9663335780" />- <path stroke="0" data="B -21.1445427729,53.7581120944 M 8.5899705015,53.7581120944 M 8.9203539823,44.8377581121 M -22.4660766962,44.8377581121 M -21.1445427729,53.7581120944" />- <path stroke="0" data="B -21.1445427729,24.3539823009 M 0.6607669617,24.3539823009 M 0.6607669617,16.0943952802 M -21.8053097345,15.7640117994 M -21.1445427729,24.3539823009" />- <path stroke="0" data="B -21.8053097345,-9.8407079646 M 10.5722713864,-10.0058997050 M 10.4070796460,-17.9351032448 M -21.1445427729,-17.9351032448 M -21.8053097345,-9.8407079646" />+ <path stroke="0" data="B -21.1445427729,53.7581120944 M 7.8989898990,54.0101010101 C 7.8989898990,51.9191919192 7.8989898990,48.7441077441 7.8989898990,46.1111111111 M -23.4874407795,46.1111111111 M -21.1445427729,53.7581120944" />+ <path stroke="0" data="B -19.9797979798,24.0404040404 M 3.9494949495,24.0404040404 M 3.9494949495,15.9090909091 M -21.8053097345,15.7640117994 M -19.9797979798,24.0404040404" />+ <path stroke="0" data="B -22.0707070707,-10.1111111111 M 9.9898989899,-10.1111111111 M 9.9898989899,-18.0101010101 M -21.1445427729,-17.9351032448 M -22.0707070707,-10.1111111111" /> </glyph> </collection> <collection unicode="U+66"> <selected id="1"/> <glyph id="1" left="-19" right="30">- <path stroke="0" data="B 15.6298142077,45.8529398907 C 22.6298142077,45.8529398907 6.1131296005,45.8529398907 15.6298142077,45.8529398907 C 6.1131296005,45.8529398907 -1.7320218579,45.8917012750 -10.4129398907,45.9110819672 M -10.2715628415,24.1867540984 M 9.2929398907,24.2589726776 M 9.3076284153,16.5132240437 M -10.4423169399,16.4593661202 M -10.2397377049,-18.0341857923 M -19.6110163934,-18.0859016393 M -19.6165245902,53.7602622951 M 15.5141420765,53.7284371585 C 15.5526994536,51.1032714026 15.5017194821,50.0725308487 15.6298142077,45.8529398907" />+ <path stroke="0" data="B -8.9040404040,46.1111111111 M -8.9040404040,24.0404040404 M 12.9343434343,24.0404040404 M 12.9490319589,16.2946554065 M -9.0747945024,16.3130160622 M -8.9040404040,-18.0101010101 M -18.8939393939,-18.0101010101 M -18.8939393939,54.0101010101 M 15.0252525253,54.0101010101 L 15.0252525253,46.1111111111 C 9.0429292929,46.1111111111 -0.2231223712,46.0917304189 -8.9040404040,46.1111111111" /> </glyph> </collection> <collection unicode="U+67">@@ -188,9 +191,9 @@ <path stroke="0" data="B -94.5347008547,7.4981211527 M -104.9174319742,7.4203943767 M -105.0502407174,-17.8432349727 M -114.5426997338,-17.8080437158 M -114.5078144879,53.8006557377 C -106.7988891691,53.7967795993 -100.4818731000,54.0095836350 -91.3810385316,53.7890273224 T C -83.2254110313,53.5913778525 -68.6465924986,49.5859224557 -69.2783425342,31.4734915698 T C -69.6090468645,21.9921160440 -75.0619616959,13.7986552240 -82.6575849797,10.0517823549 T C -84.9661532555,8.9129802427 -90.8975898564,7.5253491439 -94.5347008547,7.4981211527 T" /> <path stroke="0" data="B -105.2668964551,45.5616174863 M -105.1542844332,15.4372686937 C -101.2108235953,15.4256402784 -99.1757823445,15.1826345944 -95.2384318341,15.4023834478 T C -80.8441950706,16.2057452558 -78.2778889845,25.9973977142 -78.2891089627,30.7947593293 T C -78.3212912173,44.5550278276 -89.3152639821,45.4847301034 -91.5600549250,45.5438688525 T C -97.7215430792,45.7061925215 -100.6979492784,45.5557012750 -105.2668964551,45.5616174863" /> </glyph>- <glyph id="4" left="-114.13516137095797" right="-53.968660968660956">- <path stroke="0" data="S -94.5347008547,6.8599445145 L -104.9174319742,6.7822177385 L -105.0502407174,-17.8432349727 L -114.5426997338,-17.8080437158 L -114.5078144879,53.8006557377 D -108.7261204988,53.7977486339 -100.5212119882,53.7808687038 -97.7628049134,53.7890273224 T D -90.7774838462,53.8096880040 -80.9454767767,51.3179688714 -77.1705379209,48.3935675868 D -73.8888071569,45.8512488821 -69.9589134588,37.7946316549 -69.9165191724,31.4734915698 T D -69.8617188011,23.3025597591 -76.3226908785,12.3833045280 -82.0194083415,9.5731498762 T D -83.7508345483,8.7190482921 -91.8068676060,6.8803655079 -94.5347008547,6.8599445145 T" />- <path stroke="0" data="S -105.2668964551,45.5616174863 L -105.1542844332,15.4372686937 D -102.1966888048,15.4285473822 -98.1914447169,15.2375718077 -95.2384318341,15.4023834478 T D -86.1176375580,15.9114273034 -78.6832300723,25.5243998908 -78.9272856009,30.7947593293 T D -79.1162927720,34.8763539309 -81.7934733593,39.8915003052 -83.5925182575,41.5118653357 D -86.3374527415,43.9841748666 -93.2387025685,45.4911497047 -97.9418213068,45.5438688525 T D -100.2910803298,45.5702026409 -101.8401860726,45.5571803278 -105.2668964551,45.5616174863" />+ <glyph id="4" left="-113.13516137095797" right="-58.135161370957974">+ <path stroke="0" data="S -98.1881051176,45.9398340249 D -100.0968188105,45.9398340249 -101.8782849239,45.9398340249 -103.9142461964,45.9398340249 L -104.0414937759,19.7268326418 D -101.0838981475,19.7181113303 -97.9336099585,19.7268326418 -95.8976486860,19.7268326418 T D -89.5205574787,19.7268326418 -81.1369294606,26.9799446750 -81.1369294606,32.9605809129 T D -81.1369294606,37.0325034578 -85.1843017118,43.2261299803 -88.5580318367,44.8847694921 D -90.4071575536,45.7939802934 -95.3496926019,45.9398340249 -98.1881051176,45.9398340249" />+ <path stroke="0" data="S -93.0982019364,11.9647302905 D -95.2191815139,11.9306450369 -102.0479285751,12.0079659660 -104.1687413555,11.9647302905 L -104.1687413555,-17.9384508990 L -113.0760719225,-17.9384508990 L -113.0411866766,53.6702485545 D -107.2594926875,53.6673414507 -98.8653536700,53.9564315353 -97.4246196404,53.9564315353 T D -94.4630348458,53.9564315353 -85.7792540446,53.4580203647 -83.4934235298,52.4507876740 D -78.1180590433,50.0824853746 -71.7755738350,39.5638307526 -71.7206085754,32.3243430152 T D -71.6627971811,24.8394383262 -84.2995622027,12.1082039786 -93.0982019364,11.9647302905 T" /> </glyph> </collection> <collection unicode="U+72">@@ -266,8 +269,10 @@ <path stroke="0" data="B -2.1474926254,-21.0737463127 M -25.7699115044,53.7581120944 M -15.1976401180,53.7581120944 M -15.1976401180,53.7581120944 M 0.0000000000,6.1828908555 M 21.2820849094,53.5929203540 M 41.7935103245,6.1828908555 M 59.6342182891,53.5929203540 M 68.5545722714,53.5929203540 M 42.6471186304,-20.5781710914 M 20.9793510324,32.1456437042 M -2.1474926254,-21.0737463127" /> </glyph> </collection>+<kerning left="F" right="a" hadjustment="0.0000000000" /> <kerning left="e" right="l" hadjustment="-1.0000000000" /> <kerning left="t" right="a" hadjustment="17.0000000000" />+<kerning left="S" right="a" hadjustment="9.0000000000" /> <kerning left="o" right="n" hadjustment="-5.0000000000" /> <kerning left="a" right="n" hadjustment="0.0000000000" /> <kerning left="l" right="o" hadjustment="-3.0000000000" />@@ -287,5 +292,7 @@ <kerning left="o" right="i" hadjustment="1.3333333333" /> <kerning left="b" right="i" hadjustment="18.3333333333" /> <kerning left="n" right="t" hadjustment="0.3333333333" />+<kerning left="a" right="S" hadjustment="-2.0000000000" />+<kerning left="S" right="S" hadjustment="0.0000000000" /> <kerning left="a" right="v" hadjustment="-13.0000000000" /> </font>@@ -542,6 +542,7 @@ public class KerningDisplay : FontDisplay { unichar c; if (MenuTab.suppress_event) { // don't update kerning while saving font+ warning ("A background thread uses the current font."); return; } @@ -69,8 +69,8 @@ public class PenTool : Tool { /** Move curve handle instead of control point. */ private bool last_selected_is_handle = false; - static List<Path> clockwise;- static List<Path> counter_clockwise;+ static Gee.ArrayList<Path> clockwise;+ static Gee.ArrayList<Path> counter_clockwise; public static double path_stroke_width = 0; @@ -87,8 +87,8 @@ public class PenTool : Tool { active_path = new Path (); selected_point = new EditPoint ();- clockwise = new List<Path> ();- counter_clockwise = new List<Path> ();+ clockwise = new Gee.ArrayList<Path> ();+ counter_clockwise = new Gee.ArrayList<Path> (); tie_icon = Icons.get_icon ("tie_is_active.png"); @@ -103,17 +103,17 @@ public class PenTool : Tool { press_action.connect ((self, b, x, y) => { // retain path direction Glyph glyph = MainWindow.get_current_glyph ();- clockwise = new List<Path> ();- counter_clockwise = new List<Path> ();+ clockwise = new Gee.ArrayList<Path> ();+ counter_clockwise = new Gee.ArrayList<Path> (); begin_action_x = x; begin_action_y = y; foreach (Path p in glyph.path_list) { if (p.is_clockwise ()) {- clockwise.append (p);+ clockwise.add (p); } else {- counter_clockwise.append (p);+ counter_clockwise.add (p); } } @@ -519,13 +519,8 @@ public class PenTool : Tool { Glyph g = MainWindow.get_current_glyph (); // don't retain direction- while (clockwise.length () > 0) {- clockwise.remove_link (clockwise.first ());- }- - while (counter_clockwise.length () > 0) {- counter_clockwise.remove_link (counter_clockwise.first ());- }+ clockwise.clear ();+ counter_clockwise.clear (); foreach (Path p in g.active_paths) { if (p.is_open () && !p.has_direction ()) {@@ -639,13 +634,8 @@ public class PenTool : Tool { } if (reverse) {- while (clockwise.length () > 0) {- clockwise.remove_link (clockwise.first ()); // FIXME: use gee container here- }-- while (counter_clockwise.length () > 0) {- counter_clockwise.remove_link (counter_clockwise.first ());- }+ clockwise.clear ();+ counter_clockwise.clear (); } } @@ -235,6 +235,7 @@ def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull --pkg gdk-pixbuf-2.0 \ --pkg webkit-1.0 \ --pkg gtk+-2.0\+ --pkg libnotify\ --pkg libbirdfont""") run("mv birdfont/*.c build/birdfont/") @@ -248,6 +249,7 @@ def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull $(pkg-config --cflags glib-2.0) \ $(pkg-config --cflags gdk-pixbuf-2.0) \ $(pkg-config --cflags webkit-1.0) \+ $(pkg-config --cflags libnotify) \ -I ./build/libbirdfont/""") run("mv ./*.o build/birdfont/") @@ -262,5 +264,6 @@ def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull $(pkg-config --libs gdk-pixbuf-2.0) \ $(pkg-config --libs webkit-1.0) \ $(pkg-config --libs gtk+-2.0) \+ $(pkg-config --libs libnotify) \ -o ./build/bin/birdfont""")