Commit Graph

38 Commits

Author SHA1 Message Date
Christian Kreibich 91bac7739a Added querying for multiple configs. If you have a group of configuration
settings that you want to refer to under the same key (e.g. the apps that
a launcher starts up etc), use

void Epplet_modify_multi_config(char *key, char **values, int num);

And if you want to query for a group of settings, use this:

char **Epplet_query_multi_config(char *key, int *num);

Note that you have to free() the returned array here. The key is internally
encoded into __key__1 for the first string, __key__2 for the second etc.

I put some testing code for this into ConfigTestEpplet.c The epplet will
remember all the command line parameters you give on startup and dump
them.

Also extended E-Mountbox so that the users can now define the patterns
in the device or mountpoint and corresponding icons themselves. Currently
still via the config file, but the dialog is there. Not functional yet,
though.


SVN revision: 1612
1999-12-13 17:38:52 +00:00
Tom Gilbert c598b0c3ce Just some comments to explain stuff better.
SVN revision: 1597
1999-12-12 16:01:50 +00:00
Tom Gilbert ad8c5fe782 Thu Dec 09 20:49:42 GMT 1999
(gilbertt)

Hrm. If nobody minds... I've added:

Window Epplet_create_window_borderless(int w,int h,char *title, char vertical);

In case anyone fancies a borderless window. Or two. For displaying things. In
windows. Without borders. For whatever reason. Erm. I'll stop now.


SVN revision: 1564
1999-12-09 15:40:08 +00:00
Michael Jennings 9cbe26bb39 Mon Dec 6 20:18:45 PST 1999
(KainX)

E-Slides now has a full-featured working config dialog.  Damn good work, Tom.


SVN revision: 1523
1999-12-06 23:29:54 +00:00
Tom Gilbert da9f7b42f2 Sat Dec 04 23:02:13 GMT 1999
(gilbertt)

By popular demand:

/* A cut down version for image-only buttons */
Epplet_gadget   Epplet_create_image_button(char *image, int x, int y,
                                     int w, int h,
                                     void (*func) (void *data), void *data);

That's the last of them! No more =P


SVN revision: 1499
1999-12-04 18:33:47 +00:00
Tom Gilbert d769f660e9 Sat Dec 04 22:59:21 GMT 1999
(gilbertt)

Oops. Make that:

/* A cut down version for text-only buttons */
Epplet_gadget   Epplet_create_text_button(char *label, int x, int y,
                                     int w, int h,
                                     void (*func) (void *data), void *data);

/* A cut down version for stdimage-only buttons */
Epplet_gadget   Epplet_create_std_button(char *std, int x, int y,
                                     void (*func) (void *data), void *data);

STD images do not need w or h parameters.

=P


SVN revision: 1498
1999-12-04 18:23:52 +00:00
Tom Gilbert 59e7b0ab11 Sat Dec 04 22:46:57 GMT 1999
(gilbertt)

Added some less complex button functions, left the old one in place, so as
not to break anyone's lovely epplets :)

Here's what you got:

/* A cut down version for text-only buttons */
Epplet_gadget   Epplet_create_text_button(char *label, int x, int y,
                                     int w, int h,
                                     void (*func) (void *data), void *data);
/* A cut down version for stdimage-only buttons */
Epplet_gadget   Epplet_create_std_button(char *std, int x, int y,
                                     int w, int h,
                                     void (*func) (void *data), void *data);

Those window things in the original one should really be buried in the api,
and not public, but I won't break anyone's code. There ya go :)


SVN revision: 1497
1999-12-04 18:19:04 +00:00
Tom Gilbert eb5b17c67f Sat Dec 04 01:05:38 GMT 1999
(gilbertt)

So, say hello to Epplet_create_window_config.

It rules ;)

Here's the definition:

Window Epplet_create_window_config(int w,int h,char *title,
         void (*ok_func) (void *data),void *ok_data,
         void (*apply_func) (void *data),void *apply_data,
         void (*cancel_func) (void *data),void *cancel_data);

You can picture what it does, and check it out in E-ScreenSave. (Press the
"Lock" button).

The cool thing is that if you supply NULL for any of the callbacks, that
button won't be added to the dialog. So, for an Ok, Cancel dialog, just
supply NULL for apply_func.

I have added explanation to the epplet.h file, and would like people to bang
at this now? I will set my epplets up to use the new functions fully over
the weekend. This will help me find any problems, as I haven't tested adding
every type of gadget to config windows yet, there may still be redraw issues
I missed.

Its pretty nice now though, and I have checked for memory leaks and bad
handling, please point out anything dubious you see. The api will become
more rich over the next few days, then it should stabilise.

Any feature suggestions, send 'em now :)


SVN revision: 1493
1999-12-03 20:56:49 +00:00
Tom Gilbert 48ce42038e Fri Dec 03 23:47:45 GMT 1999
(gilbertt)

Okay. Lots has changed. It was pretty inconsistant to have loads of
functions returning or requiring a "Window win" paramater, and mine dealing
with "Epplet_window" parameters. I had to lose one, so I lost the one which
caused no breakage. Mine :)

I still use Epplet_window internally to encapsulate data on a per-window
basis. However, all public functions deal with "Window win" again. Now
things are consistant. The Epplet_window type is now private and hidden.

To do this, I have implemented a little lookup function to relate
Epplet_windows to Windows, which should be more than adequate for our needs.

You can now declare a delete event handler for your whole epplet, although I
may change to per-window delete event handlers if people request it.

If you return 1 from the delete event handler, or don't supply one, or
supply NULL, the window will be destroyed for you, if you return 0, the
delete event will be ignored. Use this to do things like saying "hrm, those
two settings cannot coexist" or "that file does not exist" etc.

I'm nearly finished with the window functions now, and will next add
convenience wrappers such as Epplet_create_window_config(...) to add ok,
apply and save buttons and setup callbacks for you, and some other stuff
too.

I'd appreciate it if people would poke around and see what they think, I'm
new at this Xlib stuf...


SVN revision: 1490
1999-12-03 19:34:55 +00:00
Tom Gilbert 34f7e90373 Fri Dec 03 20:22:56 GMT 1999
(gilbertt)

Removed the int x, and int y properties for Epplet_create_window, as they
were pretty pointless, and I hate it when windows decide where they should
go ;)


SVN revision: 1487
1999-12-03 16:05:33 +00:00
Tom Gilbert aad5f10990 Fri Dec 03 20:11:23 GMT 1999
(gilbertt)

Right. You can now specify a "vertical" property for your new window. Works
the same as the vertical parameter in Epplet_init. Uses the same
imageclasses too.

I had a big headache debugging this, it just didn't seem to work, I knew
BrushedMetal (the theme I use) had a different (green) vertical pixmap, but
the windows always came up grey. Just when I was about to go mental, I found
this in epplet.cfg:

__ICLASS __BGN
  __NAME EPPLET_BACKGROUND_HORIZONTAL
  __NORMAL "epplets/images/bg.png"
  __EDGE_SCALING   2 2 2 2
__END

__ICLASS __BGN
  __NAME EPPLET_BACKGROUND_VERTICAL
  __NORMAL "epplets/images/bg.png"
  __EDGE_SCALING   2 2 2 2
__END

Gah. No wonder the images weren't changing!

Is there a reason for this? If not, could it be changed to:

__ICLASS __BGN
  __NAME EPPLET_BACKGROUND_HORIZONTAL
  __NORMAL "epplets/images/bg.png"
  __EDGE_SCALING   2 2 2 2
__END

__ICLASS __BGN
  __NAME EPPLET_BACKGROUND_VERTICAL
  __NORMAL "epplets/images/bg_v.png"
  __EDGE_SCALING   2 2 2 2
__END

Please?

Anyway, the vertical stuff works now, and probably did an hour ago, before I
went off chasing nonexistant bugs :)

I also tidied up some other stuff, and killed another global :)

See E-ScreenSave in cvs for an example, press the "lock" button to see it in
action :)


SVN revision: 1486
1999-12-03 15:59:17 +00:00
Tom Gilbert ded180a361 Thu Dec 02 23:07:45 GMT 1999
(gilbertt)

Ok. More config window stuff.

Fun fun. I had to create a new type, Epplet_window to hold some window info,
and a stack to push and pop contexts for adding gadgets to different new
windows. This stuff works real well, and I am chuffed with it :)

The extra windows now redraw themselves on exposes, and new gadgets can be
added to them successfully. W00p.

I had to implement some new stuff, so please check nothing is broke (I am
not finished, but I don't want to commit code that breaks stuff).

Here are some details on the new stuff :)

---------------
PUBLIC STUFF

typedef struct epplet_window
{
    Window win;
    int w;
    int h;
    Pixmap bg_pmap;
    Pixmap bg_mask;
    Pixmap bg_bg;
}EppWindow;
typedef EppWindow *Epplet_window;

Epplet_window Epplet_create_window(int w,int h,int x,int y,char *title);
void Epplet_window_show(Epplet_window win);
void Epplet_window_hide(Epplet_window win);
void Epplet_window_destroy(Epplet_window win);
void Epplet_window_push_context(Epplet_window newwin);
Epplet_window Epplet_window_pop_context(void);
---------------
PRIVATE STUFF

static Epplet_window context_win;       /* Current context win */
static int          window_stack_pos;   /* For context changes */
static Epplet_window window_stack[20];  /* For context changes */
static Epplet_window mainwin;           /* Always the main epplet window */

static int          window_num = 0;     /* For window list */
static Epplet_window *windows = NULL;   /* List of windows to loop though */

/* For Keeping a list of windows owned by the epplet, to loop through and
 * do stuff with. */
static void         Epplet_register_window(Epplet_window win);
static void         Epplet_unregister_window(Epplet_window win);

/* Redraw all epplet windows (excluding the main epplet window) */
static void         Epplet_draw_windows(void);
/* Redraw window win */
static void         Epplet_draw_window(Epplet_window win);

/* Refresh window backgrounds on theme change */
static void Epplet_refresh_backgrounds(void);

-------------
I also added an item to GadGeneral so that I can find what window a gadget
was created on:

typedef struct gad_general
{
   GadType             type;
   char                visible;
   Epplet_window       parent;
}
GadGeneral;

-------------

Not to mention the reworking of code which draws or handles windows.

I have more tinkering to do in the event handling, to catch delete_events,
and to filter out mouseovers etc for separate windows. Tomorrow :)


SVN revision: 1478
1999-12-02 19:08:48 +00:00
Tom Gilbert 4d1ca43a00 Wed Dec 01 23:05:13 GMT 1999
(gilbertt)

api changes.

Ok. I have added some functions to the api, they are not yet perfect, but
they compile cleanly and don't create any problems. Don't use them yet
though, the api may change.

Window Epplet_create_window(int w,int h,int x,int y,char *title);
void Epplet_window_show(Window win);
void Epplet_window_hide(Window win);
void Epplet_window_destroy(Window win);
void Epplet_window_switch_context(Window newwin);
void Epplet_window_reset_context(void);

All of these functions are in place and work. I have yet to add code to
handle delete_events. At the moment, if you close the dialog window, the
epplet exits. This is clearly not intended ;) I'll fix it tomorrow, its late
here now.

You can even switch context and add widgets to your new window with no
problems ;)

Other things to fix tomorrow is the event handling stuff which assumes only
one window will be around...

I am currently using E-ScreenSave as my test epplet for this code, as I know
only about 2 people use it ;) Try it to see the code working.


SVN revision: 1472
1999-12-01 19:12:33 +00:00
Michael Jennings 8ab0c9d1cf Mon Nov 29 19:03:00 PST 1999
(KainX)

Applied and modified significantly a patch to support E-NetFlame on Solaris.
Thanks to Tomas Calvo Gomez <tcalvo@tid.es> and Mark Bowyer
<Moredhel@earthling.net> for supplying the Solaris-isms. :-)


SVN revision: 1458
1999-11-29 23:21:26 +00:00
Richard Barnes 7194de932b Textbox bugfixes (I hope), thanks for bitching, guys *ducks*
SVN revision: 1418
1999-11-27 17:58:33 +00:00
Michael Jennings 2238745548 Fri Nov 12 12:35:49 PST 1999
(KainX)

Cleaning up the epplets is becoming a morning routine for me.... =P


SVN revision: 1279
1999-11-12 20:13:03 +00:00
Michael Jennings db5f7faf82 Feh.
SVN revision: 1276
1999-11-12 19:52:16 +00:00
Richard Barnes bf855d9279 Ok. E-Exec now does command history of up to 15 items. Added
Epplet_change_textbox. Not thoroughly tested, but isn't that what users
are for? *runs*


SVN revision: 1261
1999-11-12 03:46:39 +00:00
Richard Barnes f7bb9a97d5 uh...uhuhuhuuhuh...this is gonna be cool...
SVN revision: 1250
1999-11-11 03:02:47 +00:00
Christian Kreibich 811247cb78 Esnprintf is in the house now :)
SVN revision: 1242
1999-11-10 23:37:53 +00:00
Richard Barnes a72703c512 added headers for the textbox functions and brief descriptions
SVN revision: 1227
1999-11-09 18:25:10 +00:00
Christian Kreibich 19eec1c40e Epplet_run_command() now returns the exit code of
the command.


SVN revision: 1177
1999-11-04 15:43:04 +00:00
Michael Jennings 55639cbe7d Thu Nov 4 16:00:26 PST 1999
(KainX)

E-Slides, a slideshow epplet.  This is just the initial version; more features
coming soon.  :-)

Also some API additions/bugfixes.


SVN revision: 1176
1999-11-04 14:53:40 +00:00
Carsten Haitzler d41a4c2b94 misjng prototype :)
SVN revision: 1044
1999-10-30 10:04:44 +00:00
Carsten Haitzler 8c3bb5530a add patches for std buttons for popups.. and fix epplets...
SVN revision: 1040
1999-10-28 23:30:09 +00:00
Michael Jennings 607ee975fe Tue Oct 26 16:06:43 PDT 1999
(KainX)

Okay, don't kill me.  I had to change the API again because it was broken.
Epplet_load_config() now takes no parameters.  I also renamed some functions,
which the following command should help you do:

perl -p -i.bak -e \
	's/config_data_with_def/config_def/g; s/_config_data/_config/g;' \
	<files>

That all goes on a single line, BTW.  And replace <files> with the names of
your .c files.  You must now specify any defaults by calling
Epplet_query_config_def() instead and passing the default to that function.

I also added the ability to right-justify label text by specifying a negative
x coordinate.  See E-Time for a sample.


SVN revision: 989
1999-10-26 15:48:35 +00:00
Michael Jennings d01fc8f7dc Sun Oct 24 13:05:15 PDT 1999
(KainX)

Added Epplet_query_config_data_with_def().  See the header file for syntax.
For some reason, the compiler didn't like it when I spelled out "default."


SVN revision: 964
1999-10-24 13:10:22 +00:00
Mandrake 87606b4ccd Sat Oct 23 21:00:30 PDT 1999
(Mandrake)

Second patch from horms about popup entry removal


SVN revision: 961
1999-10-23 21:07:31 +00:00
Mandrake e75aa717fe Sat Oct 23 10:03:02 PDT 1999
(Mandrake)

Added patch from horms (horms@valinux.com) to allow you to remove popup entries


SVN revision: 958
1999-10-23 10:15:45 +00:00
Michael Jennings 0a4e2ce260 Fri Oct 22 22:48:20 PDT 1999
(KainX)

Multiple instance and config file support for E-Cpu, E-Net, and E-Biff. :-)


SVN revision: 954
1999-10-22 23:12:12 +00:00
Michael Jennings 9898d36b95 Fri Oct 22 21:43:33 PDT 1999
(KainX)

Alright, I've got the config stuff working as planned.  Epplet_Init() has the
same parameters as it used to.  If you use config files, make sure to call
Epplet_load_config() AFTER calling Epplet_Init() but BEFORE attempting to
access config data.

Also note the function name changes:  Epplet_save_config(),
Epplet_query_config_data(), and Epplet_modify_config_data().


SVN revision: 951
1999-10-22 22:09:18 +00:00
Christian Kreibich 5231296117 Ok, the config file management should work now. Lock files are used
for instance accounting, every epplet has its own directory in
~/.enlightenment/epplet_config/<epplet-name>, transparent config file
handling is provided. Users only need to query for settings and change
settings. Config settings are saved automatically on exit, which
means that users MUST call Epplet_cleanup() before exiting. Every
epplet instance has its own config file. Also added a mechanism for
defining default settings.

Updated all epplets accordingly.

Look at ConfigTestEpplet.c for the details. It shows what instance it
is running as and keeps a record on how many times that instance
has been run in the config files.


SVN revision: 949
1999-10-22 16:43:22 +00:00
Carsten Haitzler ab93e42a20 add get data for timers :)
SVN revision: 919
1999-10-20 22:23:29 +00:00
Christian Kreibich e5d23bbf3c The beginnings of a config file manager. Mostly works,
but I haven't tested it enough yet.

The idea is to run
Epplet_load_config_file("~/.whaterver");
assuming that the config file looks e.g. this:

a_number 	123
some_word 	hello
my_string 	hello world

and then query for the keys in the first column using

char * s;

s = Epplet_query_config_file("my_string");
if (s)
  {
    /* s is now "hello world". */
  }


Hope that's a good idea.

Cheers,
-- Christian.


SVN revision: 838
1999-10-18 15:50:58 +00:00
Carsten Haitzler 0a414ad2c2 add 2 calls :)
SVN revision: 836
1999-10-18 15:04:54 +00:00
Carsten Haitzler f11a42a32c add dialog ok call for epplets :)
SVN revision: 825
1999-10-13 22:31:43 +00:00
Carsten Haitzler 9552ddec4a add abotu call....... to header file
SVN revision: 822
1999-10-13 21:14:51 +00:00
Michael Jennings 278d66d3ad Make EROOT and EBIN available to all epplets.
SVN revision: 818
1999-10-13 19:20:44 +00:00