From 5d35f37d4e55438ce1a5d031cd802ab05c626bb6 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Thu, 11 Apr 2013 16:37:10 -0700 Subject: [PATCH] Fix window icons. --- FL/About_Dialog.fl | 16 +++++++++------- lib/ntk | 2 +- mixer/src/Mixer.C | 2 +- mixer/src/main.C | 22 +++++----------------- mixer/wscript | 2 +- sequencer/src/gui/ui.fl | 14 +++++++------- sequencer/src/main.C | 18 ------------------ sequencer/wscript | 2 +- session-manager/src/session-manager.C | 24 +++--------------------- session-manager/wscript | 4 ++-- timeline/src/TLE.fl | 17 +++++++++++------ timeline/src/main.C | 18 ------------------ timeline/wscript | 2 +- wscript | 3 --- 14 files changed, 42 insertions(+), 104 deletions(-) diff --git a/FL/About_Dialog.fl b/FL/About_Dialog.fl index 994e3e2..3cda9f8 100644 --- a/FL/About_Dialog.fl +++ b/FL/About_Dialog.fl @@ -18,10 +18,11 @@ Function {open_url( const char *url )} {open return_type void class About_Dialog {open } { - Function {About_Dialog( const char *logo_filename )} {} { - code {make_window( logo_filename );} {} + Function {About_Dialog( const char *logo_filename, const char *xclass )} {open + } { + code {make_window( logo_filename, xclass );} {} } - Function {run()} {return_type void + Function {run()} {open return_type void } { code {window->show(); @@ -30,7 +31,7 @@ while ( window->shown() ) delete window;} {} } - Function {make_window( const char *logo_filename )} {open private + Function {make_window( const char *logo_filename, const char *xclass )} {open private } { Fl_Window window { label About @@ -40,8 +41,9 @@ if ( logo_box->image() ) { ((Fl_Shared_Image*)logo_box->image())->release(); logo_box->image( 0 ); -}} open - private xywh {1183 305 560 695} type Double xclass {Non-DAW} visible +}} open selected + private xywh {879 215 560 695} type Double + code0 {o->xclass( xclass );} visible } { Fl_Tabs {} {open xywh {0 352 558 296} @@ -81,7 +83,7 @@ You should have received a copy of the GNU General Public License along with thi } } Fl_Box logo_box { - label VERSION selected + label VERSION xywh {5 5 550 305} color 48 labelfont 1 labelsize 18 align 16 code0 {o->image( Fl_Shared_Image::get( logo_filename ) );} code1 {o->label( VERSION );} diff --git a/lib/ntk b/lib/ntk index 77fb243..3afbfcc 160000 --- a/lib/ntk +++ b/lib/ntk @@ -1 +1 @@ -Subproject commit 77fb243ae95a4c1818cc10545655ff34160da2b5 +Subproject commit 3afbfcc84c2b2c8d89ab016ec1d2c7cdafa40a19 diff --git a/mixer/src/Mixer.C b/mixer/src/Mixer.C index 98c2029..f8dfbdc 100644 --- a/mixer/src/Mixer.C +++ b/mixer/src/Mixer.C @@ -313,7 +313,7 @@ void Mixer::cb_menu(Fl_Widget* o) { } else if ( ! strcmp( picked, "&Help/&About" ) ) { - About_Dialog ab( PIXMAP_PATH "/non-mixer/icon-256x256.png" ); + About_Dialog ab( PIXMAP_PATH "/non-mixer/icon-256x256.png", APP_NAME ); ab.logo_box->label( VERSION ); diff --git a/mixer/src/main.C b/mixer/src/main.C index abea660..56477c2 100644 --- a/mixer/src/main.C +++ b/mixer/src/main.C @@ -57,12 +57,9 @@ #include #include -#ifdef HAVE_XPM #include "FL/Fl.H" #include "FL/x.H" -#include -#include "../icons/icon-16x16.xpm" -#endif +#include "FL/Fl_PNG_Image.H" /* TODO: put these in a header */ #define USER_CONFIG_DIR ".non-mixer/" @@ -125,6 +122,7 @@ check_sigterm ( void * ) } } + int main ( int argc, char **argv ) { @@ -216,20 +214,11 @@ main ( int argc, char **argv ) free( name ); } - - Pixmap p, mask; if ( ! no_ui ) { Fl::visual( FL_DOUBLE | FL_RGB ); -#ifdef HAVE_XPM - fl_open_display(); - - XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), - (char**)icon_16x16, &p, &mask, NULL); -#endif - Fl::visible_focus( 0 ); fl_register_images(); @@ -239,6 +228,7 @@ main ( int argc, char **argv ) Fl_Double_Window *main_window; + { Fl_Double_Window *o = main_window = new Fl_Double_Window( 800, 600, "Non Mixer" ); { @@ -257,11 +247,9 @@ main ( int argc, char **argv ) if ( ! no_ui ) { -#ifdef HAVE_XPM - o->icon((char *)p); -#endif - o->show( 0, 0 ); + o->show( 0,0 ); } + } Plugin_Module::spawn_discover_thread(); diff --git a/mixer/wscript b/mixer/wscript index c645ec8..3e78418 100644 --- a/mixer/wscript +++ b/mixer/wscript @@ -66,7 +66,7 @@ src/main.C target = 'non-mixer', includes = ['.', 'src', '..', '../nonlib'], use = ['nonlib', 'fl_widgets'], - uselib = [ 'JACK', 'LIBLO', 'LRDF', 'XPM', 'NTK', 'NTK_IMAGES', 'PTHREAD', 'DL', 'M' ], + uselib = [ 'JACK', 'LIBLO', 'LRDF', 'NTK', 'NTK_IMAGES', 'PTHREAD', 'DL', 'M' ], install_path = '${BINDIR}') bld( features = 'subst', diff --git a/sequencer/src/gui/ui.fl b/sequencer/src/gui/ui.fl index 9fb7d71..3de9386 100644 --- a/sequencer/src/gui/ui.fl +++ b/sequencer/src/gui/ui.fl @@ -83,7 +83,7 @@ decl {extern Fl_Color velocity_colors[];} {private local } widget_class Visual_Metronome {open - xywh {638 936 100 100} type Double visible + xywh {640 936 100 100} type Double visible } { Fl_Slider progress { private xywh {139 115 1149 23} type Horizontal box FLAT_BOX color 7 selection_color 54 @@ -131,8 +131,7 @@ if ( damage() & FL_DAMAGE_CHILD ) else draw_child( *progress ); -// _flip = ! _flip;} {selected - } +// _flip = ! _flip;} {} } decl {int _bpb} {private local } @@ -338,9 +337,10 @@ if ( Fl::event() == FL_SHORTCUT && Fl::event_key() == FL_Escape ) return; if ( maybe_save_song() ) - quit();} open - xywh {832 231 865 805} type Double color 47 resizable - code0 {o->color( FL_BACKGROUND_COLOR );} xclass non size_range {700 509 0 0} visible + quit();} open selected + xywh {834 231 865 805} type Double color 47 resizable + code0 {o->color( FL_BACKGROUND_COLOR );} + code1 {o->xclass( APP_NAME );} size_range {700 509 0 0} visible } { Fl_Group {} {open xywh {0 30 865 70} box FLAT_BOX @@ -1232,7 +1232,7 @@ config.follow_playhead = val ? true : false;} } MenuItem {} { label {&About} - callback {About_Dialog ab( PIXMAP_PATH "/non-sequencer/icon-256x256.png" ); + callback {About_Dialog ab( PIXMAP_PATH "/non-sequencer/icon-256x256.png", APP_NAME ); ab.logo_box->label( VERSION ); diff --git a/sequencer/src/main.C b/sequencer/src/main.C index 2b50508..46a1861 100644 --- a/sequencer/src/main.C +++ b/sequencer/src/main.C @@ -31,13 +31,6 @@ #include "phrase.H" #include -#ifdef HAVE_XPM -#include "FL/Fl.H" -#include "FL/x.H" -#include -#include "../icons/icon-16x16.xpm" -#endif - // extern const char *BUILD_ID; // extern const char *VERSION; @@ -229,14 +222,6 @@ main ( int argc, char **argv ) WARNING( "Xdbe not supported, FLTK will fake double buffering." ); } -#ifdef HAVE_XPM - fl_open_display(); - Pixmap p, mask; - - XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), - (char**)icon_16x16, &p, &mask, NULL); -#endif - ::signal( SIGTERM, sigterm_handler ); ::signal( SIGHUP, sigterm_handler ); ::signal( SIGINT, sigterm_handler ); @@ -272,9 +257,6 @@ main ( int argc, char **argv ) ui = new UI; -#ifdef HAVE_XPM - ui->main_window->icon((char *)p); -#endif ui->main_window->show( 0, 0 ); instance_name = strdup( APP_NAME ); diff --git a/sequencer/wscript b/sequencer/wscript index 2a3b1c8..bd428df 100644 --- a/sequencer/wscript +++ b/sequencer/wscript @@ -68,7 +68,7 @@ src/transport.C target = 'non-sequencer', includes = ['.', 'src', 'src/gui', '../FL', '../nonlib'], use = ['nonlib', 'fl_widgets'], - uselib = [ 'JACK', 'SIGCPP', 'LIBLO', 'XPM', 'NTK', 'NTK_IMAGES', 'PTHREAD'], + uselib = [ 'JACK', 'SIGCPP', 'LIBLO', 'NTK', 'NTK_IMAGES', 'PTHREAD'], install_path = '${BINDIR}') bld( features = 'subst', diff --git a/session-manager/src/session-manager.C b/session-manager/src/session-manager.C index bafb9ea..0b62498 100644 --- a/session-manager/src/session-manager.C +++ b/session-manager/src/session-manager.C @@ -49,14 +49,8 @@ #include #include -#define APP_NAME "Non Session Manager" - -#ifdef HAVE_XPM -#include "FL/Fl.H" -#include "FL/x.H" -#include -#include "../icons/icon-16x16.xpm" -#endif +#define APP_NAME "Non-Session-Manager" +#define APP_TITLE "Non Session Manager" // static lo_address nsm_addr = NULL; static time_t last_ping_response; @@ -1251,15 +1245,6 @@ cb_main ( Fl_Widget *, void * ) int main (int argc, char **argv ) { - -#ifdef HAVE_XPM - fl_open_display(); - Pixmap p, mask; - - XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), - (char**)icon_16x16, &p, &mask, NULL); -#endif - fl_register_images(); Fl::lock(); @@ -1267,7 +1252,7 @@ main (int argc, char **argv ) Fl_Double_Window *main_window; { - Fl_Double_Window *o = main_window = new Fl_Double_Window( 800, 600, APP_NAME ); + Fl_Double_Window *o = main_window = new Fl_Double_Window( 800, 600, APP_TITLE ); { main_window->xclass( APP_NAME ); @@ -1282,9 +1267,6 @@ main (int argc, char **argv ) o->callback( (Fl_Callback*)cb_main, main_window ); -#ifdef HAVE_XPM - o->icon((char *)p); -#endif o->show( 0, NULL ); } diff --git a/session-manager/wscript b/session-manager/wscript index f0dd50a..fc3a7d4 100644 --- a/session-manager/wscript +++ b/session-manager/wscript @@ -43,7 +43,7 @@ src/session-manager.C ''', target = 'non-session-manager', includes = ['.', 'src', '../nonlib', '..' ], - uselib = [ 'LIBLO', 'XPM', 'NTK', 'NTK_IMAGES' ], + uselib = [ 'LIBLO', 'NTK', 'NTK_IMAGES' ], use = [ 'fl_widgets', 'nonlib'], install_path = '${BINDIR}') @@ -71,7 +71,7 @@ src/NSM_Proxy_UI.fl ''', target = 'nsm-proxy-gui', includes = ['.', 'src'], - uselib = [ 'LIBLO', 'XPM', 'NTK', 'NTK_IMAGES ' ], + uselib = [ 'LIBLO', 'NTK', 'NTK_IMAGES ' ], install_path = '${BINDIR}') bld.program( source = ''' diff --git a/timeline/src/TLE.fl b/timeline/src/TLE.fl index dac02fd..4568504 100644 --- a/timeline/src/TLE.fl +++ b/timeline/src/TLE.fl @@ -100,6 +100,9 @@ decl {extern nsm_client_t *nsm;} {private global decl {extern char *user_config_dir;} {private global } +decl {extern char *APP_NAME;} {selected private global +} + class TLE_Window {open : {public Fl_Overlay_Window} } { Function {TLE_Window(int W, int H, const char *L = 0) : Fl_Overlay_Window( W, H, L )} {open @@ -249,8 +252,9 @@ Loggable::progress_callback( &TLE::progress_cb, this );} {} label {Non Timeline} callback {if ( Fl::event_key() != FL_Escape ) timeline->command_quit();} open - xywh {516 306 1025 770} type Double resizable - class TLE_Window xclass Non_DAW size_range {900 300 0 0} visible + xywh {520 266 1025 770} type Double resizable + code0 {o->xclass( APP_NAME );} + class TLE_Window size_range {900 300 0 0} visible } { Fl_Group {} {open xywh {0 -53 1025 126} box FLAT_BOX @@ -623,7 +627,7 @@ timeline->redraw();} } MenuItem {} { label {&About} - callback {About_Dialog ab( PIXMAP_PATH "/non-timeline/icon-256x256.png" ); + callback {About_Dialog ab( PIXMAP_PATH "/non-timeline/icon-256x256.png", "Non-Timeline" ); ab.logo_box->label( VERSION ); @@ -656,14 +660,14 @@ ab.run();} code0 {o->spacing( 2 );} } { Fl_Box {} { - label PLAYHEAD selected + label PLAYHEAD private xywh {301 30 137 41} box FLAT_BOX color 47 code0 {o->type( Clock::HMS );} code1 {o->run( &transport->frame );} class Clock } Fl_Box {} { - label PLAYHEAD selected + label PLAYHEAD xywh {440 30 137 41} box FLAT_BOX color 47 code0 {o->type( Clock::BBT );} code1 {o->run( &transport->frame );} @@ -1001,7 +1005,8 @@ if ( logo_box->image() ) ((Fl_Shared_Image*)logo_box->image())->release(); logo_box->image( NULL ); }} open - private xywh {1398 301 520 775} type Double modal visible + private xywh {1189 128 520 775} type Double + code0 {o->xclass( APP_NAME );} modal visible } { Fl_Value_Output {} { label {Sample Rate} diff --git a/timeline/src/main.C b/timeline/src/main.C index 0d5bbbb..66eac9c 100644 --- a/timeline/src/main.C +++ b/timeline/src/main.C @@ -53,13 +53,6 @@ extern void set_nsm_callbacks ( nsm_client_t *nsm ); -#ifdef HAVE_XPM -#include "FL/Fl.H" -#include "FL/x.H" -#include -#include "../icons/icon-16x16.xpm" -#endif - Engine *engine; Timeline *timeline; Transport *transport; @@ -159,14 +152,6 @@ main ( int argc, char **argv ) } -#ifdef HAVE_XPM - fl_open_display(); - Pixmap p, mask; - - XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), - (char**)icon_16x16, &p, &mask, NULL); -#endif - Thread::init(); Thread thread( "UI" ); @@ -251,9 +236,6 @@ main ( int argc, char **argv ) timeline->init_osc( osc_port ); -#ifdef HAVE_XPM - tle->main_window->icon((char *)p); -#endif tle->main_window->show( 0, NULL ); char *nsm_url = getenv( "NSM_URL" ); diff --git a/timeline/wscript b/timeline/wscript index 6514e32..d64812a 100644 --- a/timeline/wscript +++ b/timeline/wscript @@ -91,7 +91,7 @@ src/main.C ''', target = 'non-timeline', includes = ['.', 'src', '..', '../nonlib'], - uselib = [ 'JACK', 'LIBLO', 'SNDFILE', 'XPM', 'NTK', 'NTK_IMAGES', 'PTHREAD'], + uselib = [ 'JACK', 'LIBLO', 'SNDFILE', 'NTK', 'NTK_IMAGES', 'PTHREAD'], use = [ 'fl_widgets', 'nonlib'], install_path = '${BINDIR}') diff --git a/wscript b/wscript index e40a286..19ae65d 100644 --- a/wscript +++ b/wscript @@ -89,9 +89,6 @@ def configure(conf): conf.check_cfg(package='jack', uselib_store='JACK', args="--cflags --libs", atleast_version='0.103.0', mandatory=True) - conf.check_cfg(package='xpm', uselib_store='XMP',args="--cflags --libs", - atleast_version='2.0.0', mandatory=True) - conf.check_cfg(package='liblo', uselib_store='LIBLO',args="--cflags --libs", atleast_version='0.26', mandatory=True)