Commit 64090a8
Merge branch 'master' of gitorious.org:birdfont/birdfont
Changed files (11)
modifiedNEWSmodifiedbirdfont/GtkWindow.valaaddedbirdfont_installdeletedinstallmodifiedlibbirdfont/ExportTool.valamodifiedlibbirdfont/MainWindow.valamodifiedlibbirdfont/NativeWindow.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/TextListener.valamodifiedscripts/export.shmodifiedscripts/macport_build.py
Diff
@@ -1,3 +1,10 @@+birdfont (0.22) stable;++ * Bugfixes for changes to make BirdFont run on Mac OS X+ * Preview is removed on Mac OS X++ -- Johan Mattsson <johan.mattsson.m@gmail.com> Sun Jul 6 21:28:000 CEST 2013+ birdfont (0.21) stable; * Bugfixes@@ -46,7 +46,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { bool scrollbar_supress_signal = false; /** Text input and callbacks to libbirdfont. */- TextListener text_listener = new TextListener ();+ TextListener text_listener = new TextListener ("", "", ""); Label text_input_label; Entry text_entry; HBox text_box;@@ -274,6 +274,10 @@ public class GtkWindow : Gtk.Window, NativeWindow { hide_text_input (); } + public void spawn (string command) {+ Process.spawn_command_line_async (command);+ }+ public void set_scrollbar_size (double size) { scrollbar.adjustment.page_size = size; }@@ -430,11 +434,13 @@ public class GtkWindow : Gtk.Window, NativeWindow { export_item.activate.connect (() => { ExportTool.export_all (); }); export_item.add_accelerator ("activate", accel_group, 'E', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); - Gtk.MenuItem preview_item = new Gtk.MenuItem.with_mnemonic(_("_Preview"));- file_menu.append (preview_item);- preview_item.activate.connect (() => { MenuTab.preview (); });- preview_item.add_accelerator ("activate", accel_group, 'P', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE);-+ if (!BirdFont.mac) {+ Gtk.MenuItem preview_item = new Gtk.MenuItem.with_mnemonic(_("_Preview"));+ file_menu.append (preview_item);+ preview_item.activate.connect (() => { MenuTab.preview (); });+ preview_item.add_accelerator ("activate", accel_group, 'P', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE);+ }+ Gtk.MenuItem description_item = new Gtk.MenuItem.with_mnemonic(_("Name and _description")); file_menu.append (description_item); description_item.activate.connect (() => { MenuTab.show_description (); });@@ -752,21 +758,18 @@ public class GtkWindow : Gtk.Window, NativeWindow { } public void hide_text_input () {- text_listener = new TextListener ();+ text_listener = new TextListener ("", "", ""); text_box.hide (); } - public void set_text_listener (string label, TextListener listener, string default_text, string button_label) {+ public void set_text_listener (TextListener listener) { text_listener = listener;- text_input_label.set_text (" " + label);- submit_text_button.set_label (button_label);+ text_input_label.set_text (" " + listener.label);+ submit_text_button.set_label (listener.button_label); text_box.show ();- text_entry.set_text (default_text);- listener.signal_submit.connect (() => {- hide_text_input ();- });+ text_entry.set_text (listener.default_text); text_entry.activate.connect (() => {- listener.signal_submit (text_entry.text);+ listener.set_text (text_entry.text); hide_text_input (); }); text_entry.grab_focus ();new file mode 100755@@ -0,0 +1,78 @@+#!/usr/bin/python +import os+import subprocess+import glob+from optparse import OptionParser+from scripts import config+from scripts import version++def install (file, dir):+ f = dest + prefix + dir + '/'+ s = file.rfind ('/')+ if s > -1:+ f += file[s + 1:]+ else:+ f += file+ print ("install: " + f)+ subprocess.check_output ('install -d ' + dest + prefix + dir, shell=True)+ subprocess.check_output ('install ' + file + ' ' + dest + prefix + dir + '/', shell=True)+ installed.write (f + "\n")++if not os.path.exists ("build/configured"):+ print ("Project is not configured")+ exit (1)++if not os.path.exists ("build/installed"):+ print ("Project is not built")+ exit (1)++parser = OptionParser()+parser.add_option ("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST")+parser.add_option ("-m", "--bsd-manpages", dest="nogzip", help="don't gzip manpages")++(options, args) = parser.parse_args()++if not options.dest:+ options.dest = ""++if not options.nogzip:+ bsd_manpages = True+else:+ bsd_manpages = False+ +prefix = config.PREFIX+dest = options.dest++# create uninstall file+installed = open ('build/installed', 'w')+installed.write ('build/installed\n')++# install it:+for file in os.listdir('./layout'):+ install ('layout/' + file, '/share/birdfont/layout')++for file in os.listdir('./icons'):+ install ('icons/' + file, '/share/birdfont/icons')++install ('resources/linux/birdfont.desktop', '/share/applications')+install ('resources/linux/birdfont.png', '/share/icons/hicolor/48x48/apps')++install ('build/bin/birdfont', '/bin')+install ('build/bin/birdfont-export', '/bin')+install ('build/libbirdfont.so.' + version.SO_VERSION, '/lib')+install ('build/libbirdfont.so', '/lib')++if not bsd_manpages:+ install ('build/birdfont.1.gz', '/share/man/man1')+ install ('build/birdfont-export.1.gz', '/share/man/man1')+else:+ install ('resources/linux/birdfont.1', '/man/man1')+ install ('resources/linux/birdfont-export.1', '/man/man1')+++# translations+for lang_dir in glob.glob('build/locale/*'):+ lc = lang_dir.replace ('build/locale/', "")+ install ('build/locale/' + lc + '/LC_MESSAGES/birdfont.mo', '/share/locale/' + lc + '/LC_MESSAGES' );++installed.close ()deleted file mode 100755@@ -1,78 +0,0 @@-#!/usr/bin/python -import os-import subprocess-import glob-from optparse import OptionParser-from scripts import config-from scripts import version--def install (file, dir):- f = dest + prefix + dir + '/'- s = file.rfind ('/')- if s > -1:- f += file[s + 1:]- else:- f += file- print ("install: " + f)- subprocess.check_output ('install -d ' + dest + prefix + dir, shell=True)- subprocess.check_output ('install ' + file + ' ' + dest + prefix + dir + '/', shell=True)- installed.write (f + "\n")--if not os.path.exists ("build/configured"):- print ("Project is not configured")- exit (1)--if not os.path.exists ("build/installed"):- print ("Project is not built")- exit (1)--parser = OptionParser()-parser.add_option ("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST")-parser.add_option ("-m", "--bsd-manpages", dest="nogzip", help="don't gzip manpages")--(options, args) = parser.parse_args()--if not options.dest:- options.dest = ""--if not options.nogzip:- bsd_manpages = True-else:- bsd_manpages = False- -prefix = config.PREFIX-dest = options.dest--# create uninstall file-installed = open ('build/installed', 'w')-installed.write ('build/installed\n')--# install it:-for file in os.listdir('./layout'):- install ('layout/' + file, '/share/birdfont/layout')--for file in os.listdir('./icons'):- install ('icons/' + file, '/share/birdfont/icons')--install ('resources/linux/birdfont.desktop', '/share/applications')-install ('resources/linux/birdfont.png', '/share/icons/hicolor/48x48/apps')--install ('build/bin/birdfont', '/bin')-install ('build/bin/birdfont-export', '/bin')-install ('build/libbirdfont.so.' + version.SO_VERSION, '/lib')-install ('build/libbirdfont.so', '/lib')--if not bsd_manpages:- install ('build/birdfont.1.gz', '/share/man/man1')- install ('build/birdfont-export.1.gz', '/share/man/man1')-else:- install ('resources/linux/birdfont.1', '/man/man1')- install ('resources/linux/birdfont-export.1', '/man/man1')---# translations-for lang_dir in glob.glob('build/locale/*'):- lc = lang_dir.replace ('build/locale/', "")- install ('build/locale/' + lc + '/LC_MESSAGES/birdfont.mo', '/share/locale/' + lc + '/LC_MESSAGES' );--installed.close ()@@ -160,6 +160,7 @@ public class ExportTool : GLib.Object { public static void export_all () { bool f;+ Preview preview; f = export_ttf_font (); if (!f) {@@ -170,6 +171,10 @@ public class ExportTool : GLib.Object { if (!f) { warning ("Failed to export svg font"); }+ + // create html file+ preview = new Preview ();+ preview.get_html_file (); } public static void generate_html_document (string html_file, Font font) {@@ -483,8 +488,9 @@ os.put_string ( foreach (string s in spawn_args) { c += s + " "; }-- Process.spawn_command_line_async (c);+ + print (@"Running: $(c)\n");+ MainWindow.native_window.spawn (c); } catch (SpawnError e) { warning (e.message); }@@ -102,12 +102,12 @@ public class MainWindow { } public static void update_glyph_sequence () { - TextListener listener = new TextListener (); + TextListener listener = new TextListener (_("Glyph sequence"), Preferences.get ("glyph_sequence"), _("Close")); listener.signal_text_input.connect ((text) => { Preferences.set ("glyph_sequence", text); get_glyph_canvas ().redraw (); }); - native_window.set_text_listener (_("Glyph sequence"), listener, Preferences.get ("glyph_sequence"), _("Close")); + native_window.set_text_listener (listener); } public static MainWindow get_singleton () { @@ -37,8 +37,10 @@ public interface NativeWindow : GLib.Object { public abstract void set_scrollbar_size (double size); public abstract void set_scrollbar_position (double position); + public abstract void spawn (string command);+ /** Request text input from the UI. */- public abstract void set_text_listener (string label, TextListener listener, string default_text, string button_label);+ public abstract void set_text_listener (TextListener listener); /** Remove the text listener and hode the text area. */ public abstract void hide_text_input ();@@ -334,6 +334,11 @@ public class OverView : FontDisplay { cr.move_to (x, caption_y); cr.show_text (character_string); + cr.show_text ("Q");+ + cr.move_to (0, 0);+ cr.show_text ("X");+ x += nail_width; index++; i++;@@ -18,8 +18,31 @@ namespace BirdFont { public class TextListener : GLib.Object {++ public string label;+ public string default_text;+ public string button_label;+ public signal void signal_text_input (string text); public signal void signal_submit (string text); ++ private string text;++ public TextListener (string label, string default_text, string button_label) {+ this.label = label;+ this.default_text = default_text;+ this.button_label = button_label;+ }+ + public void set_text (string t) {+ text = t;+ signal_text_input (text);+ }++ public void submit () {+ signal_text_input (text);+ signal_submit (text);+ } } }@@ -23,7 +23,7 @@ cd export git clone --no-hardlinks --local $rep -version=$(cat ../../scripts/version.py | grep "VERSION = '" | sed -e "s:VERSION = '::" | sed "s:'.*::g")+version=$(cat ../../scripts/version.py | grep "VERSION = '" | grep -v "SO_VERSION" | sed -e "s:VERSION = '::" | sed "s:'.*::g") mv birdfont birdfont-$version @@ -26,14 +26,14 @@ from run import run import configfile -def build(prefix, cc, cflags, ldflags):+def build(prefix, cc, cflags, ldflags, valac): compile_translations () #libbirdfont run("mkdir -p build/libbirdfont") run("mkdir -p build/bin") - run("""valac \+ run(valac + """\ -C \ --basedir build/libbirdfont/ \ --enable-experimental-non-null \@@ -78,7 +78,7 @@ def build(prefix, cc, cflags, ldflags): # birdfont run("mkdir -p build/birdfont") - run("""valac \+ run(valac + """\ -C \ --enable-experimental-non-null \ --enable-experimental \@@ -120,7 +120,7 @@ def build(prefix, cc, cflags, ldflags): # birdfont-export run("mkdir -p build/birdfont-export") - run("""valac \+ run(valac + """ \ -C \ --enable-experimental-non-null \ --enable-experimental \@@ -186,6 +186,7 @@ parser.add_option("-d", "--dest", dest="dest", help="install to this directory", parser.add_option("-c", "--cc", dest="cc", help="select the C compiler", metavar="CC") parser.add_option("-f", "--cflags", dest="cflags", help="set compiler flags", metavar="CFLAGS") parser.add_option("-l", "--ldflags", dest="ldflags", help="set linker flags", metavar="LDFLAGS")+parser.add_option("-v", "--valac", dest="valac", help="select vala compiler", metavar="VALAC") (options, args) = parser.parse_args() @@ -197,9 +198,11 @@ if not options.cflags: options.cflags = "" if not options.ldflags: options.ldflags = ""+if not options.valac:+ options.valac = "valac" build_app (options.prefix) -build (options.prefix, options.cc, options.cflags, options.ldflags)+build (options.prefix, options.cc, options.cflags, options.ldflags, options.valac)