Exemple #1
0
static void disconnect_loading_messages(TPMediaPlayer * mp)
{
    USERDATA(mp);
    CM(ud);

    if (!ud->load_signal)
        return;

#if (CLUTTER_GST_MAJOR_VERSION<1)
    GstElement * pipeline=clutter_gst_video_texture_get_playbin(CLUTTER_GST_VIDEO_TEXTURE(cm));
#else
    GstElement * pipeline=clutter_gst_video_texture_get_pipeline(CLUTTER_GST_VIDEO_TEXTURE(cm));
#endif

    if (!pipeline)
        return;

    GstBus * bus=gst_pipeline_get_bus(GST_PIPELINE(pipeline));

    if (!bus)
        return;

    g_signal_handler_disconnect(bus,ud->load_signal);
    ud->load_signal=0;

    gst_object_unref(GST_OBJECT(bus));
}
Exemple #2
0
static int mp_set_audio_mute(TPMediaPlayer * mp,int mute)
{
    USERDATA(mp);
    CM(ud);

    int old_mute = ud->mute;

    ud->mute = mute ? 1 : 0;

    if ( old_mute != ud->mute )
    {
        if ( ud->mute )
        {
            ud->volume = clutter_media_get_audio_volume(cm);
            clutter_media_set_audio_volume(cm,0);
        }
        else
        {
            clutter_media_set_audio_volume(cm,ud->volume);
            ud->volume = 0;
        }
    }

    return 0;
}
Exemple #3
0
static int mp_get_duration(TPMediaPlayer * mp,double * seconds)
{
    USERDATA(mp);
    CM(ud);

    *seconds=clutter_media_get_duration(cm);
    return 0;
}
Exemple #4
0
static int mp_pause(TPMediaPlayer * mp)
{
    USERDATA(mp);
    CM(ud);

    clutter_media_set_playing(cm,FALSE);
    return 0;
}
Exemple #5
0
static int mp_set_viewport_geometry(TPMediaPlayer * mp,int left,int top,int width,int height)
{
    USERDATA(mp);
    CM(ud);

    clutter_actor_set_position(CLUTTER_ACTOR(cm),left,top);
    clutter_actor_set_size(CLUTTER_ACTOR(cm),width,height);
    return 0;
}
Exemple #6
0
static int mp_get_audio_mute(TPMediaPlayer * mp,int * mute)
{
    USERDATA(mp);
    CM(ud);

    *mute = ud->mute;

    return 0;
}
Exemple #7
0
static int mp_get_buffered_duration(TPMediaPlayer * mp,double * start_seconds,double * end_seconds)
{
    USERDATA(mp);
    CM(ud);

    *start_seconds=0;
    *end_seconds=clutter_media_get_duration(cm) * clutter_media_get_buffer_fill(cm);
    return 0;
}
Exemple #8
0
static int mp_seek(TPMediaPlayer * mp,double seconds)
{
    USERDATA(mp);
    CM(ud);

    if (!clutter_media_get_can_seek(cm))
        return 1;
    clutter_media_set_progress(cm,seconds/clutter_media_get_duration(cm));
    return 0;
}
Exemple #9
0
static int mp_load(TPMediaPlayer * mp,const char * uri,const char * extra)
{
    USERDATA(mp);
    CM(ud);

    clutter_media_set_uri(cm,uri);

#if (CLUTTER_GST_MAJOR_VERSION<1)
    GstElement * pipeline=clutter_gst_video_texture_get_playbin(CLUTTER_GST_VIDEO_TEXTURE(cm));
#else
    GstElement * pipeline=clutter_gst_video_texture_get_pipeline(CLUTTER_GST_VIDEO_TEXTURE(cm));
#endif

    if (!pipeline)
        return 1;

    GstStateChangeReturn r=gst_element_set_state(pipeline,GST_STATE_PAUSED);

    g_debug("STATE CHANGE RETURN IS %d",r);

    switch(r)
    {
        case GST_STATE_CHANGE_FAILURE:
        {
            return 2;
        }

        case GST_STATE_CHANGE_SUCCESS:
        case GST_STATE_CHANGE_NO_PREROLL:
        {
            get_stream_information(mp);
            tp_media_player_loaded(mp);
            break;
        }

        case GST_STATE_CHANGE_ASYNC:
        {
            // The state change happens asynchronously, so we connect a signal
            // handler to see when it is done

            GstBus * bus=gst_pipeline_get_bus(GST_PIPELINE(pipeline));

            if (!bus)
                return 3;

            ud->load_signal=g_signal_connect(bus,"message",G_CALLBACK(loading_messages),mp);

            gst_object_unref(GST_OBJECT(bus));

            break;
        }
    }

    return 0;
}
Exemple #10
0
static void mp_destroy(TPMediaPlayer *mp)
{
    USERDATA(mp);

    if (ud)
    {
        g_object_unref(G_OBJECT(ud->vt));
        g_free(ud);
        mp->user_data=NULL;
    }
}
Exemple #11
0
static int mp_play(TPMediaPlayer * mp)
{
    USERDATA(mp);
    CM(ud);

    clutter_media_set_playing(cm,TRUE);

    if (ud->media_type&TP_MEDIA_TYPE_VIDEO)
        clutter_actor_show(CLUTTER_ACTOR(cm));
    return 0;
}
Exemple #12
0
static int mp_get_video_size(TPMediaPlayer * mp,int * width,int * height)
{
    USERDATA(mp);

    if (!(ud->media_type&TP_MEDIA_TYPE_VIDEO))
        return TP_MEDIAPLAYER_ERROR_NA;

    *width=ud->video_width;
    *height=ud->video_height;

    return 0;
}
Exemple #13
0
static int mp_get_viewport_geometry(TPMediaPlayer * mp,int * left,int * top,int * width,int * height)
{
    USERDATA(mp);
    CM(ud);

    gfloat x,y,w,h;
    clutter_actor_get_position(CLUTTER_ACTOR(cm),&x,&y);
    clutter_actor_get_size(CLUTTER_ACTOR(cm),&w,&h);
    *left=x;
    *top=y;
    *width=w;
    *height=h;
    return 0;
}
Exemple #14
0
static int mp_set_audio_volume(TPMediaPlayer * mp,double volume)
{
    USERDATA(mp);
    CM(ud);

    if ( ud->mute )
    {
        ud->volume = volume;
    }
    else
    {
        clutter_media_set_audio_volume(cm,volume);
    }
    return 0;
}
Exemple #15
0
static int mp_get_audio_volume(TPMediaPlayer * mp,double * volume)
{
    USERDATA(mp);
    CM(ud);

    if ( ud->mute )
    {
        * volume = ud->volume;
    }
    else
    {
        *volume=clutter_media_get_audio_volume(cm);
    }
    return 0;
}
Exemple #16
0
static void loading_messages(GstBus * bus,GstMessage * message,TPMediaPlayer * mp)
{
    USERDATA(mp);

    switch(message->type)
    {
        //.....................................................................
        // When a tag is found

        case GST_MESSAGE_TAG:
        {
            GstTagList * tags=NULL;
            gst_message_parse_tag(message,&tags);
            if (tags)
            {
                gst_tag_list_foreach(tags,collect_tags,mp);
                gst_tag_list_free(tags);
            }
            break;
        }

        //.....................................................................
        // When the load is done - the stream is paused and ready to go

        case GST_MESSAGE_ASYNC_DONE:
        {
            get_stream_information(mp);

            // Now, notify that the stream is loaded

            tp_media_player_loaded(mp);

            // Disconnect this signal handler

            g_signal_handler_disconnect(bus,ud->load_signal);
            ud->load_signal=0;

            break;
        }
        default:
        {
        	// Default handler to make clang shut up
			break;
        }
    }
}
Exemple #17
0
static void mp_reset(TPMediaPlayer * mp)
{
    USERDATA(mp);
    CM(ud);

    disconnect_loading_messages(mp);

    ud->video_width=0;
    ud->video_height=0;
    ud->media_type=0;

    // Reset should do more - it should truly forget all about the resource

    clutter_media_set_playing(cm,FALSE);
    clutter_media_set_progress(cm,0);

    clutter_actor_hide(CLUTTER_ACTOR(cm));
}
int main(int argc, char **argv)
{
	XEvent					event;
	LFSTK_buttonClass		*button;
	LFSTK_toggleButtonClass	*toggle;
	LFSTK_labelClass		*label;
	unsigned				buttony=BORDER;
	const char				*lfstkfontstr;
	fontStruct				*lfstkfontstruct;
	unsigned				gadgetwidth;
	int						c=0;
	int						option_index=0;
	const char				*shortOpts="h?bis:w:";
	option 					longOptions[]=
		{
			{"window",1,0,'w'},
			{"detail",0,0,'d'},
			{"help",0,0,'h'},
			{0, 0, 0, 0}
		};

	startUpFont=strdup("sans");
	fontSize=strdup("10");

	while(1)
		{
			option_index=0;
			c=getopt_long_only(argc,argv,shortOpts,longOptions,&option_index);
			if (c==-1)
				break;
			switch (c)
				{
					case 'h':
					case '?':
						printHelp();
						exit(0);
					case 'd':
						useDetail=true;
						break;
					case 'w':
						parentWindow=atoi(optarg);
						break;
				}
		}

	if(argv[optind]==NULL)
		parseFontString("");
	else
		parseFontString(argv[optind]);

	mainWindow=new LFSTK_windowClass(0,0,WIDTH,HITE,"Font Selector",false);
	lfstkfontstr=mainWindow->globalLib->LFSTK_getGlobalString(NORMALCOLOUR,TYPEFONT);
	lfstkfontstruct=mainWindow->globalLib->LFSTK_loadFont(mainWindow->display,mainWindow->screen,lfstkfontstr);
	loadFontStrings();

	fontOffset=currentFont;
	if(fontOffset>(maxFonts-MAXPREVIEW))
		fontOffset=maxFonts-MAXPREVIEW;

//font select buttons
	for(int j=0;j<MAXPREVIEW;j++)
		{
			previews[j]=new LFSTK_buttonClass(mainWindow,fontsAZ[j+fontOffset],BORDER,buttony,WIDTH-(BORDER*2),BUTTONHITE,NorthWestGravity);
			previews[j]->LFSTK_setColourName(INACTIVECOLOUR,"white");
			previews[j]->LFSTK_setFontColourName(INACTIVECOLOUR,"black");
			previews[j]->LFSTK_setFontString(fontsAZ[j+fontOffset]);
			previews[j]->LFSTK_setCallBack(NULL,selectFontCB,USERDATA((j)));
			buttony+=BUTTONHITE+GAP;
		}
//style buttons
	gadgetwidth=mainWindow->globalLib->LFSTK_getTextwidth(mainWindow->display,lfstkfontstruct->data,"Bold")+BUTTONHITE;
	toggle=new LFSTK_toggleButtonClass(mainWindow,"Bold",BORDER,buttony,gadgetwidth,BUTTONHITE,NorthWestGravity);
	toggle->LFSTK_setValue(isBold);
	toggle->LFSTK_setCallBack(NULL,styleCB,USERDATA(BOLD));
	gadgetwidth=mainWindow->globalLib->LFSTK_getTextwidth(mainWindow->display,lfstkfontstruct->data,"Italic")+BUTTONHITE;
	toggle=new LFSTK_toggleButtonClass(mainWindow,"Italic",BORDER+BUTTONWIDTH+GAP,buttony,gadgetwidth,BUTTONHITE,NorthWestGravity);
	toggle->LFSTK_setValue(isItalic);
	toggle->LFSTK_setCallBack(NULL,styleCB,USERDATA(ITALIC));

//navigate
	button=new LFSTK_buttonClass(mainWindow,"↑",WIDTH-BORDER-(BUTTONWIDTH/4),buttony,BUTTONWIDTH/4,BUTTONHITE,NorthEastGravity);
	button->LFSTK_setCallBack(NULL,scrollCB,USERDATA(0));
	button=new LFSTK_buttonClass(mainWindow,"↓",WIDTH-BORDER-((BUTTONWIDTH/4)*2)-GAP,buttony,BUTTONWIDTH/4,BUTTONHITE,NorthEastGravity);
	button->LFSTK_setCallBack(NULL,scrollCB,USERDATA(1));
	buttony+=BUTTONHITE+GAP;

//size
	label=new LFSTK_labelClass(mainWindow,"Font Size",BORDER,buttony,BUTTONWIDTH,BUTTONHITE,NorthWestGravity);
	label->LFSTK_setLabelOriention(0);

	fontSizeEdit=new LFSTK_lineEditClass(mainWindow,fontSize,BORDER+BUTTONWIDTH+GAP,buttony,BUTTONWIDTH,BUTTONHITE,NorthWestGravity);
	buttony+=BUTTONHITE+GAP;

//font preview
	previewEdit=new LFSTK_lineEditClass(mainWindow,PREVIEWTEXT,BORDER,buttony,WIDTH-(BORDER*2),72,NorthWestGravity);
	previewEdit->LFSTK_setFontString(fontsAZ[currentFont]);

//dialog buttons
	button=new LFSTK_buttonClass(mainWindow,"Cancel",BORDER,HITE-BORDER-BUTTONHITE,BUTTONWIDTH,BUTTONHITE,SouthWestGravity);
	button->LFSTK_setCallBack(NULL,dialogCB,USERDATA(CANCEL));
	button=new LFSTK_buttonClass(mainWindow,"Apply",WIDTH-BORDER-BUTTONWIDTH,HITE-BORDER-BUTTONHITE,BUTTONWIDTH,BUTTONHITE,SouthEastGravity);
	button->LFSTK_setCallBack(NULL,dialogCB,USERDATA(APPLY));

	buildFontString();
	mainWindow->LFSTK_showWindow();
	mainWindow->LFSTK_setKeepAbove(true);
	if(parentWindow!=-1)
		mainWindow->LFSTK_setTransientFor(parentWindow);

	mainLoop=true;
	while(mainLoop==true)
		{
			XNextEvent(mainWindow->display,&event);
			mappedListener *ml=mainWindow->LFSTK_getMappedListener(event.xany.window);
			if(ml!=NULL)
				ml->function(ml->gadget,&event,ml->type);

			switch(event.type)
				{
				case KeyRelease:
					if(ml->gadget==fontSizeEdit)
						buildFontString();
					break;
					case LeaveNotify:
						break;
					case Expose:
						mainWindow->LFSTK_clearWindow();
						break;

					case ConfigureNotify:
						mainWindow->LFSTK_resizeWindow(event.xconfigurerequest.width,event.xconfigurerequest.height);
						break;

					case ClientMessage:
					case SelectionNotify:
						{
							if(event.xclient.message_type==XInternAtom(mainWindow->display, "WM_PROTOCOLS", 1) && (Atom)event.xclient.data.l[0] == XInternAtom(mainWindow->display, "WM_DELETE_WINDOW", 1))
							mainLoop=false;
						}
						break;
				}
		}

	for(int j=0;j<maxFonts;j++)
		free(fontsAZ[j]);
	free(fontsAZ);
	free(fontSize);
	free(startUpFont);
	delete mainWindow;
	return 0;
}
Exemple #19
0
static void * mp_get_viewport_texture(TPMediaPlayer * mp)
{
    USERDATA(mp);

    return ud->vt;
}
Exemple #20
0
static int mp_get_media_type(TPMediaPlayer * mp,int * type)
{
    USERDATA(mp);
    *type=ud->media_type;
    return 0;
}
Exemple #21
0
static void get_stream_information(TPMediaPlayer * mp)
{
    USERDATA(mp);
    CM(ud);

#if (CLUTTER_GST_MAJOR_VERSION < 1)
    GstElement * pipeline=clutter_gst_video_texture_get_playbin(CLUTTER_GST_VIDEO_TEXTURE(cm));
#else
    GstElement *pipeline=clutter_gst_video_texture_get_pipeline(CLUTTER_GST_VIDEO_TEXTURE(cm));
#endif

    if (!pipeline)
        return;

    //.........................................................................
    // Use stream info to get the type of each stream

#if (CLUTTER_GST_MAJOR_VERSION < 1)
    GValueArray * info_array=NULL;

    g_object_get(G_OBJECT(pipeline),"stream-info-value-array",&info_array,NULL);

    if (info_array)
    {
        // Each entry in the array is information for a single stream

        guint i;

        for (i=0;i<info_array->n_values;++i)
        {
            GValue * info_value=g_value_array_get_nth(info_array,i);

            if (G_VALUE_HOLDS(info_value,G_TYPE_OBJECT))
            {
                GObject * stream_info=g_value_get_object(info_value);

                if (stream_info)
                {
                    gint type = -1;

                    g_object_get(stream_info,"type",&type,NULL);

                    switch (type)
                    {
                        case 1:
                            ud->media_type|=TP_MEDIA_TYPE_AUDIO;
                            break;

                        case 2:
                            ud->media_type|=TP_MEDIA_TYPE_VIDEO;
                            break;
                    }
#if 0
                    // This lets you get the enum value associated with the stream type

                    GParamSpec *pspec;
                    GEnumValue *value;

                    pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(stream_info),"type");

                    value = g_enum_get_value(G_PARAM_SPEC_ENUM(pspec)->enum_class,type);

                    g_debug("  STREAM TYPE IS %d %s",type,value->value_nick);
#endif
                }
            }
        }

        g_value_array_free(info_array);
    }
#else
    gint n_audio, n_video;
    g_object_get(G_OBJECT(pipeline), "n-video", &n_video, NULL);
    g_object_get(G_OBJECT(pipeline), "n-audio", &n_audio, NULL);

    if(n_video) ud->media_type|=TP_MEDIA_TYPE_VIDEO;
    if(n_audio) ud->media_type|=TP_MEDIA_TYPE_AUDIO;
#endif

    //.........................................................................
    // If there is a video stream, we get the video sink and try to find the
    // video size

    if (ud->media_type&TP_MEDIA_TYPE_VIDEO)
    {
        GstElement * video_sink=NULL;

        g_object_get(G_OBJECT(pipeline),"video-sink",&video_sink,NULL);

        if (video_sink)
        {
            GstPad * pad=gst_element_get_static_pad(video_sink,"sink");

            if (pad)
            {
                // Get its video width and height

                gint width;
                gint height;

                if (gst_video_get_size(pad,&width,&height))
                {
                    ud->video_width=width;
                    ud->video_height=height;
                }
                gst_object_unref(GST_OBJECT(pad));
            }
            gst_object_unref(GST_OBJECT(video_sink));
        }
    }

#if 1

    if ( ud->media_type & TP_MEDIA_TYPE_AUDIO )
    {
        GstElement * audio_sink= gst_element_factory_make( "autoaudiosink", "TPAudioSink" );

        if(!audio_sink)
        {
        	g_debug("Failed to create autoaudiosink");
        }
        else
        {
			g_object_set(G_OBJECT(pipeline),"audio-sink",audio_sink,NULL);
		}
    }

#endif
}
int main(int argc, char **argv)
{
	XEvent					event;
	int						sx=0;
	int						sy=0;
	const geometryStruct	*geom;
	int						bwidth=96;
	int						bhite=24;
	int						spacing=bwidth+10;
	int						vspacing=bhite+10;
	int						xspace=10;
	int						cols[5];
	int						state;
	int						holdsy;
	LFSTK_fontButtonClass	*fontbutton;

	int						c=0;
	int						option_index=0;
	const char				*shortOpts="h?w:";
	option 					longOptions[]=
		{
			{"window",1,0,'w'},
			{"help",0,0,'h'},
			{0, 0, 0, 0}
		};
	while(1)
		{
			option_index=0;
			c=getopt_long_only(argc,argv,shortOpts,longOptions,&option_index);
			if (c==-1)
				break;
			switch (c)
				{
					case 'h':
					case '?':
						printf("-?,-h,--help\t\tPrint this help\n");
						printf("-w,--window\t\tSet transient for window\n");
						exit(0);
					case 'w':
						parentWindow=atoi(optarg);
						break;
				}
		}

	cols[0]=10;
	for(int j=1;j<5;j++)
		cols[j]=cols[j-1]+bwidth+xspace;

	wc=new LFSTK_windowClass(sx,sy,800,600,"LFS Tool Kit Prefs",false);
	wc->LFSTK_setDecorated(true);
	geom=wc->LFSTK_getWindowGeom();

	fc=new LFSTK_fileDialogClass(wc,"Select Window Tile","/",false);

	guibuttons[EXIT]=new LFSTK_buttonClass(wc,"Exit",10,geom->h-32,64,24,SouthWestGravity);
	guibuttons[EXIT]->LFSTK_setCallBack(NULL,callback,(void*)EXIT);

	guibuttons[APPLY]=new LFSTK_buttonClass(wc,"Apply",geom->w-74,geom->h-32,64,24,SouthEastGravity);
	guibuttons[APPLY]->LFSTK_setCallBack(NULL,callback,(void*)APPLY);

	guibuttons[PRINT]=new LFSTK_buttonClass(wc,"Test",(geom->w/2)-(64/2),geom->h-32,64,24,SouthGravity);
	guibuttons[PRINT]->LFSTK_setCallBack(NULL,callback,(void*)PRINT);

//buttons label
	sy=10;
	for(int j=LNORMBUTTONS;j<=LFONTCOLOUR;j++)
		{
			labels[j]=new LFSTK_labelClass(wc,labelnames[j],cols[j],sy,bwidth,24,NorthWestGravity);
			labels[j]->LFSTK_setLabelOriention(LEFT);
		}

//buttons
	sy+=vspacing;
	holdsy=sy;
	state=NORMALCOLOUR;
	for(int j=NORMAL;j<=INACTIVE;j++)
		{
			normalbuttons[j]=new LFSTK_buttonClass(wc,buttonnames[j],cols[0],sy,bwidth,24,NorthWestGravity);
			normalbuttons[j]->LFSTK_setActive(false);
			normalbuttons[j]->LFSTK_setColourName(INACTIVECOLOUR,wc->globalLib->LFSTK_getGlobalString(state,TYPEBUTTON));
			normalbuttons[j]->LFSTK_setFontColourName(INACTIVECOLOUR,wc->globalLib->LFSTK_getGlobalString(state,TYPEFONTCOLOUR));
			state++;
			sy+=vspacing;
		}
//button back col
	state=NORMALCOLOUR;
	sy=holdsy;
	for(int j=ENORMAL;j<=EINACTIVE;j++)
		{
			normaledits[j]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(state,TYPEBUTTON),cols[1],sy,bwidth,24,NorthWestGravity);
			state++;
			sy+=vspacing;
		}
//button font col
	state=NORMALCOLOUR;
	sy=holdsy;
	for(int j=EFONTNORMAL;j<=EFONTINACTIVE;j++)
		{
			normaledits[j]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(state,TYPEFONTCOLOUR),cols[2],sy,bwidth,24,NorthWestGravity);
			state++;
			sy+=vspacing;
		}

	fontbutton=new LFSTK_fontButtonClass(wc,"Select Font",cols[0],sy,bwidth,24,NorthWestGravity);
	fontbutton->LFSTK_setCallBack(NULL,fontCB,USERDATA(100));
	fontbutton->LFSTK_setLabelIsFont(false);
	normaledits[EFONTSTRING]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(NORMALCOLOUR,TYPEFONT),cols[1],sy,cols[3]-cols[1]-10,24,NorthWestGravity);
	sy+=vspacing;

//menu items labels
	state=0;
	for(int j=LMENUBUTTONS;j<=LMENUFONTCOLOUR;j++)
		{
			labels[j]=new LFSTK_labelClass(wc,labelnames[j],cols[state],sy,bwidth,24,NorthWestGravity);
			state++;
			labels[j]->LFSTK_setLabelOriention(LEFT);
		}
//menu items
	sy+=vspacing;
	holdsy=sy;
	state=NORMALCOLOUR;
	for(int j=MENUNORMAL;j<=MENUINACTIVE;j++)
		{
			normalbuttons[j]=new LFSTK_buttonClass(wc,buttonnames[j],cols[0],sy,bwidth,24,NorthWestGravity);
			normalbuttons[j]->LFSTK_setActive(false);
			normalbuttons[j]->LFSTK_setColourName(INACTIVECOLOUR,wc->globalLib->LFSTK_getGlobalString(state,TYPEBUTTON));
			normalbuttons[j]->LFSTK_setFontColourName(INACTIVECOLOUR,wc->globalLib->LFSTK_getGlobalString(state,TYPEMENUITEMFONTCOLOUR));
			state++;
			sy+=vspacing;
		}
//menu back col
	state=NORMALCOLOUR;
	sy=holdsy;
	for(int j=EMENUNORMAL;j<=EMENUINACTIVE;j++)
		{
			normaledits[j]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(state,TYPEMENUITEM),cols[1],sy,bwidth,24,NorthWestGravity);
			state++;
			sy+=vspacing;
		}
//menu font col
	state=NORMALCOLOUR;
	sy=holdsy;
	for(int j=EMENUFONTNORMAL;j<=EMENUFONTINACTIVE;j++)
		{
			normaledits[j]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(state,TYPEMENUITEMFONTCOLOUR),cols[2],sy,bwidth,24,NorthWestGravity);
			state++;
			sy+=vspacing;
		}

	fontbutton=new LFSTK_fontButtonClass(wc,"Select Font",cols[0],sy,bwidth,24,NorthWestGravity);
	fontbutton->LFSTK_setCallBack(NULL,fontCB,USERDATA(200));
	fontbutton->LFSTK_setLabelIsFont(false);
	normaledits[EMENUFONTSTRING]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(NORMALCOLOUR,TYPEMENUITEMFONT),cols[1],sy,cols[3]-cols[1]-10,24,NorthWestGravity);
	sy+=vspacing;

//window label and colour
	labels[LWINDOWCOLOUR]=new LFSTK_labelClass(wc,labelnames[LWINDOWCOLOUR],cols[0],sy,bwidth,24,NorthWestGravity);
	labels[LWINDOWCOLOUR]->LFSTK_setLabelOriention(LEFT);	
	normaledits[EWINDOWCOLOUR]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(NORMALCOLOUR,TYPEWINDOW),cols[1],sy,bwidth,24,NorthWestGravity);

//auto font colour
	autocolour=new LFSTK_toggleButtonClass(wc,"Auto Colour",cols[2],sy,bwidth,24,NorthWestGravity);
	autocolour->LFSTK_setCallBack(NULL,callback,(void*)PRINT);
	autocolour->LFSTK_setValue(wc->autoLabelColour);
	sy+=vspacing;

//theme parts
//use theme
	usetheme=new LFSTK_toggleButtonClass(wc,"Use Theme",cols[0],sy,bwidth,24,NorthWestGravity);
	usetheme->LFSTK_setCallBack(NULL,callback,(void*)PRINT);
	usetheme->LFSTK_setValue(wc->globalLib->LFSTK_getUseTheme());
	sy+=vspacing;

	getFileButton=new LFSTK_buttonClass(wc,labelnames[FWTILENAME],cols[0],sy,bwidth,24,NorthWestGravity);
	getFileButton->LFSTK_setCallBack(NULL,selectfile,USERDATA(EWINDOWTILE));
	normaledits[EWINDOWTILE]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(-1,TYPEWINDOWTILE),cols[1],sy,cols[3]-cols[1]-10,24,NorthWestGravity);

	sy+=vspacing;
	getFileButton=new LFSTK_buttonClass(wc,labelnames[FBTILENAME],cols[0],sy,bwidth,24,NorthWestGravity);
	getFileButton->LFSTK_setCallBack(NULL,selectfile,USERDATA(EBUTTONTILE));
	normaledits[EBUTTONTILE]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(-1,TYPEBUTTONTILE),cols[1],sy,cols[3]-cols[1]-10,24,NorthWestGravity);
	sy+=vspacing;
	getFileButton=new LFSTK_buttonClass(wc,labelnames[FMITEMNAME],cols[0],sy,bwidth,24,NorthWestGravity);
	getFileButton->LFSTK_setCallBack(NULL,selectfile,USERDATA(EMENUITEMTILE));
	normaledits[EMENUITEMTILE]=new LFSTK_lineEditClass(wc,wc->globalLib->LFSTK_getGlobalString(-1,TYPEMENUITEMTILE),cols[1],sy,cols[3]-cols[1]-10,24,NorthWestGravity);

	sy+=vspacing;
	labels[LSPACER]=new LFSTK_labelClass(wc,labelnames[LSPACER],0,sy,cols[3],8,NorthWestGravity);
	sy+=16;
	
	printf("Current Settings:\n\n");
	callback(NULL,(void*)PRINT);
	printf("\n\n");

	sy+=(vspacing);
	wc->LFSTK_resizeWindow(cols[3],sy);
	wc->LFSTK_showWindow(true);
	wc->LFSTK_setKeepAbove(true);
	if(parentWindow!=-1)
		wc->LFSTK_setTransientFor(parentWindow);

	mainloop=true;
	while(mainloop==true)
		{
			XNextEvent(wc->display,&event);
			mappedListener *ml=wc->LFSTK_getMappedListener(event.xany.window);
			if(ml!=NULL)
				ml->function(ml->gadget,&event,ml->type);
			switch(event.type)
				{
						break;
					case Expose:
						wc->LFSTK_setActive(true);
						wc->LFSTK_clearWindow();
						break;
					case ConfigureNotify:
						wc->LFSTK_resizeWindow(event.xconfigurerequest.width,event.xconfigurerequest.height,false);
						break;
					case ClientMessage:
					case SelectionNotify:
						if (event.xclient.message_type == XInternAtom(wc->display, "WM_PROTOCOLS", 1) && (Atom)event.xclient.data.l[0] == XInternAtom(wc->display, "WM_DELETE_WINDOW", 1))
							mainloop=false;
						if(wc->acceptDnd==true)
							{
								wc->LFSTK_handleDnD(&event);
							}
					default:
						break;
				}
		}

	delete wc;
	return(0);
}