Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Programming question interface skins and plugins
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
strider3700
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2003
Posts: 94

PostPosted: Sun May 25, 2003 5:03 pm    Post subject: Programming question interface skins and plugins Reply with quote

I hope this is an appropriate forum for this.

I'm wondering how someone goes about making a program that can have different interface skins. My current guess is keep all of the information completely seperate from the interface, and keep the program logic seperate from interace logic. Then provide a nice interface between the program logic/data that different GUI's can connect to. Does this sound correct? On something like xine is the gui a seperate program that gets stopped and a new one started when a new skin is selected or how do you go about loading a new skin?

I'm also wondering what you guys recommend for the use of plugins to enhance the base program. Would you treat plugins as seperate programs and then just call them from the base program, or would you find someway of enhancing the original program to run them directly. How does the industry tend to handle these things?

Thanks for any info, I'm trying to do something with a GUI when almost all of my experience is backend server based with vt220 terminals.

Jamie
Back to top
View user's profile Send private message
Jeff Binder
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2002
Posts: 117
Location: RPI (Troy, NY, US, etc.)

PostPosted: Sun May 25, 2003 6:08 pm    Post subject: Reply with quote

Ususally a skin is defined by some kind of format that indicates where interface elements are placed, and what they do. This language is generally interpreted. For example, look at part of a Xine skin:

Code:
skin.name           = cloudy
skin.version        = 2
skin.date           = 2002.01.09
skin.author         = Daniel Erat <dan_erat@pobox.com>
skin.url            = http://www.pobox.com/~dan_erat/
skin.load_command   = xset +fp $(SKIN_PARENT_PATH)/cloudy
skin.unload_command = xset -fp $(SKIN_PARENT_PATH)/cloudy

## Main GUI ##
skin.BackGround {
   coords {
     x = 0
     y = 0
        }
   pixmap = MainBg.png
}

skin.Close {
   coords {
     x = 576
     y = 8
   }
   pixmap = MainClose.png
}

skin.Eject {
   coords {
     x = 477
     y = 33
   }
   pixmap = MainEject.png
}


It defines where each button is and which image to use for it. To implement this you would basically have your program read in the skin, and add the interface elements as it encounters them.

If you don't want to go to all the trouble of implementing this yourself, you might want to check out Guile, which is an interpreter for the Scheme programming language designed to be used from within a C (or C++) program for this type of thing.
_________________
Anyone who attributes a quote to themself is a pompous fool.
--me
Back to top
View user's profile Send private message
strider3700
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2003
Posts: 94

PostPosted: Mon May 26, 2003 11:29 pm    Post subject: Reply with quote

Thanks Jeff that will be quite useful.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum