Fix window icons.

This commit is contained in:
Jonathan Moore Liles 2013-04-11 16:37:10 -07:00
parent 6ec8f6e85e
commit 5d35f37d4e
14 changed files with 42 additions and 104 deletions

View File

@ -18,10 +18,11 @@ Function {open_url( const char *url )} {open return_type void
class About_Dialog {open class About_Dialog {open
} { } {
Function {About_Dialog( const char *logo_filename )} {} { Function {About_Dialog( const char *logo_filename, const char *xclass )} {open
code {make_window( logo_filename );} {} } {
code {make_window( logo_filename, xclass );} {}
} }
Function {run()} {return_type void Function {run()} {open return_type void
} { } {
code {window->show(); code {window->show();
@ -30,7 +31,7 @@ while ( window->shown() )
delete window;} {} 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 { Fl_Window window {
label About label About
@ -40,8 +41,9 @@ if ( logo_box->image() )
{ {
((Fl_Shared_Image*)logo_box->image())->release(); ((Fl_Shared_Image*)logo_box->image())->release();
logo_box->image( 0 ); logo_box->image( 0 );
}} open }} open selected
private xywh {1183 305 560 695} type Double xclass {Non-DAW} visible private xywh {879 215 560 695} type Double
code0 {o->xclass( xclass );} visible
} { } {
Fl_Tabs {} {open Fl_Tabs {} {open
xywh {0 352 558 296} 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 { Fl_Box logo_box {
label VERSION selected label VERSION
xywh {5 5 550 305} color 48 labelfont 1 labelsize 18 align 16 xywh {5 5 550 305} color 48 labelfont 1 labelsize 18 align 16
code0 {o->image( Fl_Shared_Image::get( logo_filename ) );} code0 {o->image( Fl_Shared_Image::get( logo_filename ) );}
code1 {o->label( VERSION );} code1 {o->label( VERSION );}

@ -1 +1 @@
Subproject commit 77fb243ae95a4c1818cc10545655ff34160da2b5 Subproject commit 3afbfcc84c2b2c8d89ab016ec1d2c7cdafa40a19

View File

@ -313,7 +313,7 @@ void Mixer::cb_menu(Fl_Widget* o) {
} }
else if ( ! strcmp( picked, "&Help/&About" ) ) 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 ); ab.logo_box->label( VERSION );

View File

@ -57,12 +57,9 @@
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_XPM
#include "FL/Fl.H" #include "FL/Fl.H"
#include "FL/x.H" #include "FL/x.H"
#include <X11/xpm.h> #include "FL/Fl_PNG_Image.H"
#include "../icons/icon-16x16.xpm"
#endif
/* TODO: put these in a header */ /* TODO: put these in a header */
#define USER_CONFIG_DIR ".non-mixer/" #define USER_CONFIG_DIR ".non-mixer/"
@ -125,6 +122,7 @@ check_sigterm ( void * )
} }
} }
int int
main ( int argc, char **argv ) main ( int argc, char **argv )
{ {
@ -216,20 +214,11 @@ main ( int argc, char **argv )
free( name ); free( name );
} }
Pixmap p, mask;
if ( ! no_ui ) if ( ! no_ui )
{ {
Fl::visual( FL_DOUBLE | FL_RGB ); 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::visible_focus( 0 );
fl_register_images(); fl_register_images();
@ -239,6 +228,7 @@ main ( int argc, char **argv )
Fl_Double_Window *main_window; Fl_Double_Window *main_window;
{ {
Fl_Double_Window *o = main_window = new Fl_Double_Window( 800, 600, "Non Mixer" ); 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 ) if ( ! no_ui )
{ {
#ifdef HAVE_XPM o->show( 0,0 );
o->icon((char *)p);
#endif
o->show( 0, 0 );
} }
} }
Plugin_Module::spawn_discover_thread(); Plugin_Module::spawn_discover_thread();

View File

@ -66,7 +66,7 @@ src/main.C
target = 'non-mixer', target = 'non-mixer',
includes = ['.', 'src', '..', '../nonlib'], includes = ['.', 'src', '..', '../nonlib'],
use = ['nonlib', 'fl_widgets'], 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}') install_path = '${BINDIR}')
bld( features = 'subst', bld( features = 'subst',

View File

@ -83,7 +83,7 @@ decl {extern Fl_Color velocity_colors[];} {private local
} }
widget_class Visual_Metronome {open widget_class Visual_Metronome {open
xywh {638 936 100 100} type Double visible xywh {640 936 100 100} type Double visible
} { } {
Fl_Slider progress { Fl_Slider progress {
private xywh {139 115 1149 23} type Horizontal box FLAT_BOX color 7 selection_color 54 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 else
draw_child( *progress ); draw_child( *progress );
// _flip = ! _flip;} {selected // _flip = ! _flip;} {}
}
} }
decl {int _bpb} {private local decl {int _bpb} {private local
} }
@ -338,9 +337,10 @@ if ( Fl::event() == FL_SHORTCUT && Fl::event_key() == FL_Escape )
return; return;
if ( maybe_save_song() ) if ( maybe_save_song() )
quit();} open quit();} open selected
xywh {832 231 865 805} type Double color 47 resizable xywh {834 231 865 805} type Double color 47 resizable
code0 {o->color( FL_BACKGROUND_COLOR );} xclass non size_range {700 509 0 0} visible code0 {o->color( FL_BACKGROUND_COLOR );}
code1 {o->xclass( APP_NAME );} size_range {700 509 0 0} visible
} { } {
Fl_Group {} {open Fl_Group {} {open
xywh {0 30 865 70} box FLAT_BOX xywh {0 30 865 70} box FLAT_BOX
@ -1232,7 +1232,7 @@ config.follow_playhead = val ? true : false;}
} }
MenuItem {} { MenuItem {} {
label {&About} 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 ); ab.logo_box->label( VERSION );

View File

@ -31,13 +31,6 @@
#include "phrase.H" #include "phrase.H"
#include <signal.h> #include <signal.h>
#ifdef HAVE_XPM
#include "FL/Fl.H"
#include "FL/x.H"
#include <X11/xpm.h>
#include "../icons/icon-16x16.xpm"
#endif
// extern const char *BUILD_ID; // extern const char *BUILD_ID;
// extern const char *VERSION; // extern const char *VERSION;
@ -229,14 +222,6 @@ main ( int argc, char **argv )
WARNING( "Xdbe not supported, FLTK will fake double buffering." ); 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( SIGTERM, sigterm_handler );
::signal( SIGHUP, sigterm_handler ); ::signal( SIGHUP, sigterm_handler );
::signal( SIGINT, sigterm_handler ); ::signal( SIGINT, sigterm_handler );
@ -272,9 +257,6 @@ main ( int argc, char **argv )
ui = new UI; ui = new UI;
#ifdef HAVE_XPM
ui->main_window->icon((char *)p);
#endif
ui->main_window->show( 0, 0 ); ui->main_window->show( 0, 0 );
instance_name = strdup( APP_NAME ); instance_name = strdup( APP_NAME );

View File

@ -68,7 +68,7 @@ src/transport.C
target = 'non-sequencer', target = 'non-sequencer',
includes = ['.', 'src', 'src/gui', '../FL', '../nonlib'], includes = ['.', 'src', 'src/gui', '../FL', '../nonlib'],
use = ['nonlib', 'fl_widgets'], use = ['nonlib', 'fl_widgets'],
uselib = [ 'JACK', 'SIGCPP', 'LIBLO', 'XPM', 'NTK', 'NTK_IMAGES', 'PTHREAD'], uselib = [ 'JACK', 'SIGCPP', 'LIBLO', 'NTK', 'NTK_IMAGES', 'PTHREAD'],
install_path = '${BINDIR}') install_path = '${BINDIR}')
bld( features = 'subst', bld( features = 'subst',

View File

@ -49,14 +49,8 @@
#include <time.h> #include <time.h>
#include <getopt.h> #include <getopt.h>
#define APP_NAME "Non Session Manager" #define APP_NAME "Non-Session-Manager"
#define APP_TITLE "Non Session Manager"
#ifdef HAVE_XPM
#include "FL/Fl.H"
#include "FL/x.H"
#include <X11/xpm.h>
#include "../icons/icon-16x16.xpm"
#endif
// static lo_address nsm_addr = NULL; // static lo_address nsm_addr = NULL;
static time_t last_ping_response; static time_t last_ping_response;
@ -1251,15 +1245,6 @@ cb_main ( Fl_Widget *, void * )
int int
main (int argc, char **argv ) 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_register_images();
Fl::lock(); Fl::lock();
@ -1267,7 +1252,7 @@ main (int argc, char **argv )
Fl_Double_Window *main_window; 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 ); main_window->xclass( APP_NAME );
@ -1282,9 +1267,6 @@ main (int argc, char **argv )
o->callback( (Fl_Callback*)cb_main, main_window ); o->callback( (Fl_Callback*)cb_main, main_window );
#ifdef HAVE_XPM
o->icon((char *)p);
#endif
o->show( 0, NULL ); o->show( 0, NULL );
} }

View File

@ -43,7 +43,7 @@ src/session-manager.C
''', ''',
target = 'non-session-manager', target = 'non-session-manager',
includes = ['.', 'src', '../nonlib', '..' ], includes = ['.', 'src', '../nonlib', '..' ],
uselib = [ 'LIBLO', 'XPM', 'NTK', 'NTK_IMAGES' ], uselib = [ 'LIBLO', 'NTK', 'NTK_IMAGES' ],
use = [ 'fl_widgets', 'nonlib'], use = [ 'fl_widgets', 'nonlib'],
install_path = '${BINDIR}') install_path = '${BINDIR}')
@ -71,7 +71,7 @@ src/NSM_Proxy_UI.fl
''', ''',
target = 'nsm-proxy-gui', target = 'nsm-proxy-gui',
includes = ['.', 'src'], includes = ['.', 'src'],
uselib = [ 'LIBLO', 'XPM', 'NTK', 'NTK_IMAGES ' ], uselib = [ 'LIBLO', 'NTK', 'NTK_IMAGES ' ],
install_path = '${BINDIR}') install_path = '${BINDIR}')
bld.program( source = ''' bld.program( source = '''

View File

@ -100,6 +100,9 @@ decl {extern nsm_client_t *nsm;} {private global
decl {extern char *user_config_dir;} {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} 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 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} label {Non Timeline}
callback {if ( Fl::event_key() != FL_Escape ) callback {if ( Fl::event_key() != FL_Escape )
timeline->command_quit();} open timeline->command_quit();} open
xywh {516 306 1025 770} type Double resizable xywh {520 266 1025 770} type Double resizable
class TLE_Window xclass Non_DAW size_range {900 300 0 0} visible code0 {o->xclass( APP_NAME );}
class TLE_Window size_range {900 300 0 0} visible
} { } {
Fl_Group {} {open Fl_Group {} {open
xywh {0 -53 1025 126} box FLAT_BOX xywh {0 -53 1025 126} box FLAT_BOX
@ -623,7 +627,7 @@ timeline->redraw();}
} }
MenuItem {} { MenuItem {} {
label {&About} 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 ); ab.logo_box->label( VERSION );
@ -656,14 +660,14 @@ ab.run();}
code0 {o->spacing( 2 );} code0 {o->spacing( 2 );}
} { } {
Fl_Box {} { Fl_Box {} {
label PLAYHEAD selected label PLAYHEAD
private xywh {301 30 137 41} box FLAT_BOX color 47 private xywh {301 30 137 41} box FLAT_BOX color 47
code0 {o->type( Clock::HMS );} code0 {o->type( Clock::HMS );}
code1 {o->run( &transport->frame );} code1 {o->run( &transport->frame );}
class Clock class Clock
} }
Fl_Box {} { Fl_Box {} {
label PLAYHEAD selected label PLAYHEAD
xywh {440 30 137 41} box FLAT_BOX color 47 xywh {440 30 137 41} box FLAT_BOX color 47
code0 {o->type( Clock::BBT );} code0 {o->type( Clock::BBT );}
code1 {o->run( &transport->frame );} code1 {o->run( &transport->frame );}
@ -1001,7 +1005,8 @@ if ( logo_box->image() )
((Fl_Shared_Image*)logo_box->image())->release(); ((Fl_Shared_Image*)logo_box->image())->release();
logo_box->image( NULL ); logo_box->image( NULL );
}} open }} 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 {} { Fl_Value_Output {} {
label {Sample Rate} label {Sample Rate}

View File

@ -53,13 +53,6 @@
extern void set_nsm_callbacks ( nsm_client_t *nsm ); extern void set_nsm_callbacks ( nsm_client_t *nsm );
#ifdef HAVE_XPM
#include "FL/Fl.H"
#include "FL/x.H"
#include <X11/xpm.h>
#include "../icons/icon-16x16.xpm"
#endif
Engine *engine; Engine *engine;
Timeline *timeline; Timeline *timeline;
Transport *transport; 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::init();
Thread thread( "UI" ); Thread thread( "UI" );
@ -251,9 +236,6 @@ main ( int argc, char **argv )
timeline->init_osc( osc_port ); timeline->init_osc( osc_port );
#ifdef HAVE_XPM
tle->main_window->icon((char *)p);
#endif
tle->main_window->show( 0, NULL ); tle->main_window->show( 0, NULL );
char *nsm_url = getenv( "NSM_URL" ); char *nsm_url = getenv( "NSM_URL" );

View File

@ -91,7 +91,7 @@ src/main.C
''', ''',
target = 'non-timeline', target = 'non-timeline',
includes = ['.', 'src', '..', '../nonlib'], includes = ['.', 'src', '..', '../nonlib'],
uselib = [ 'JACK', 'LIBLO', 'SNDFILE', 'XPM', 'NTK', 'NTK_IMAGES', 'PTHREAD'], uselib = [ 'JACK', 'LIBLO', 'SNDFILE', 'NTK', 'NTK_IMAGES', 'PTHREAD'],
use = [ 'fl_widgets', 'nonlib'], use = [ 'fl_widgets', 'nonlib'],
install_path = '${BINDIR}') install_path = '${BINDIR}')

View File

@ -89,9 +89,6 @@ def configure(conf):
conf.check_cfg(package='jack', uselib_store='JACK', args="--cflags --libs", conf.check_cfg(package='jack', uselib_store='JACK', args="--cflags --libs",
atleast_version='0.103.0', mandatory=True) 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", conf.check_cfg(package='liblo', uselib_store='LIBLO',args="--cflags --libs",
atleast_version='0.26', mandatory=True) atleast_version='0.26', mandatory=True)