Commit Graph

284 Commits

Author SHA1 Message Date
Tom Gilbert eeaff8aff5 indentation again
SVN revision: 1494
1999-12-03 21:01:10 +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
Michael Jennings 180b8b08ea Added stuff to the focus in/out handlers. I skipped Tom's in case he's
testing shit. :-)


SVN revision: 1492
1999-12-03 19:52:28 +00:00
Tom Gilbert 15be7f974f *cough*
Indentation.


SVN revision: 1491
1999-12-03 19:37:46 +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 081d458688 Well we can do without that little nasty...
SVN revision: 1489
1999-12-03 16:18:49 +00:00
Michael Jennings 3b64b82b55 A rule to rebuild epplet.h without having to re-run configure/autogen.
SVN revision: 1488
1999-12-03 16:12:11 +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 a5be2dfb39 Fri Dec 03 19:25:16 GMT 1999
(gilbertt)

*cough*
Should prolly free the background pixmaps when I destroy a window, right?
Thought so.
I was wondering where all my memory was going...
;)


SVN revision: 1485
1999-12-03 15:08:23 +00:00
Tom Gilbert 137ade0aa3 Fri Dec 03 18:34:47 GMT 1999
(gilbertt)

Hrm. Bye bye hardcoding, hello malloc()ed context stack. Improved the test
app further.


SVN revision: 1484
1999-12-03 14:17:56 +00:00
Tom Gilbert 768eebf738 Fri Dec 03 17:20:15 GMT 1999
(gilbertt)

More config window stuff. Fixed a memleak, and now destroying an
Epplet_window also destroys any child gadgets attached to the window. I
think this works better, let me know otherwise.

I also cleaned up a couple of things, fixed adding buttons to new windows,
and improved the test epplet to be a better demo (E-ScreenSave right now).

I removed the Epplet_draw_window* functions, 'cos I don't need them :) What
I actually needed to do was fix Epplet_draw_image - so I have :)

Lots more to do tonight :)


SVN revision: 1483
1999-12-03 13:07:03 +00:00
Tom Gilbert aee668e72b Lost a couple of mangy old globals ;)
SVN revision: 1480
1999-12-02 19:27:13 +00:00
Tom Gilbert 7ad33df533 Missed some warnings among all that make output ;)
None left now :)


SVN revision: 1479
1999-12-02 19:11:29 +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
Michael Jennings 3fe418dd58 Added auto_setbg to automatically set your background to the current image
at every switch.


SVN revision: 1477
1999-12-01 23:23:17 +00:00
Michael Jennings 664df20d8c Wed Dec 1 19:11:13 PST 1999
(KainX)

For one thing, I think I've fixed the seg fault in E-MoonClock.  Here's
hoping.

I also added the background setting functionality to E-Slides, but this time
it was done *right*. :-)  Take a look and see for yourself.  If you look at
the code, it also demonstrates how to use E IPC to set backgrounds.


SVN revision: 1476
1999-12-01 23:09:48 +00:00
Tom Gilbert 47cfd5e95f Put the indentation back to how it should be :)
SVN revision: 1475
1999-12-01 19:30:19 +00:00
Tom Gilbert 586fb5e90c A more useful test app.
SVN revision: 1474
1999-12-01 19:28:34 +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
Tom Gilbert f317508254 (please don't notice this KainX)
(please don't notice this KainX)
(please don't notice this KainX)
(please don't notice this KainX)
s/free/XFree
(please don't notice this KainX)
(please don't notice this KainX)
(please don't notice this KainX)
(please don't notice this KainX)


SVN revision: 1463
1999-11-30 16:53:33 +00:00
Tom Gilbert 9ce2ad30c3 Tue Nov 30 17:48:31 GMT 1999
(gilbertt)

E-ScreenShoot.c E-SD.c E-ScreenSave.c

Urm. Should've done this before. Removed some duplication, and one omission
in my cloaking code. Silly really, most people won't notice any difference,
but I will :)


SVN revision: 1462
1999-11-30 14:45:32 +00:00
Michael Jennings 2f3ce3aef4 This should work on Linux 2.0.x now.
SVN revision: 1461
1999-11-30 00:58:32 +00:00
Michael Jennings 3e6a527f10 Mon Nov 29 20:34:40 PST 1999
(KainX)

All the network stats stuff has been moved to a centralized location, and all
the network stats epplets have been converted to use the new functions.  Thus,
all network epplets can now have a portable interface to the data without
having to worry about portability; the backend takes care of it.

I also added copyright statements and a license to all my epplets.  And I
removed my name from the E-Mountbox copyright since my contributions were
negligible. :-)


SVN revision: 1460
1999-11-30 00:52:31 +00:00
Michael Jennings 26747a14ea Those variables were actually needed, cK. :-)
SVN revision: 1459
1999-11-29 23:52:59 +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
Christian Kreibich 7e989c8e19 Added Epplet_unremember to E-Mountbox. Added layout options to
E-Mixer and updated docs. Tom, change as you see fit, ok?


SVN revision: 1457
1999-11-29 21:50:40 +00:00
Michael Jennings c62780f399 Mon Nov 29 17:08:23 PST 1999
(KainX)

This fixes the bug E-Slides demonstrated in the focus stuff.  Doesn't seem to
break anything else as far as I can tell....


SVN revision: 1456
1999-11-29 21:25:54 +00:00
Michael Jennings 8e16291969 Mon Nov 29 16:03:53 PST 1999
(KainX)

Added support for specifying the width and height (in epplet units, 16 pixels)
of the E-Slides window.  -w <width> and -h <height> are the options.  The
default is the traditional 3x3, of course.  Note that this cannot be done via
config file options since the size is set before the config loader can be
called.


SVN revision: 1455
1999-11-29 20:23:05 +00:00
Tom Gilbert d343608385 Dammit. The random cloak code was slightly off. I screwed it up by removing
an anim without decrementing a number. Fixed.


SVN revision: 1454
1999-11-29 18:31:01 +00:00
Michael Jennings fea3c90571 Damnit, who put C++ comments in? I specifically said not to use them.
SVN revision: 1453
1999-11-29 18:00:00 +00:00
Laurence J. Lane 6c730b1e68 that evil install-data-hook was eating small domestic pets and data
files with "C", "V" or "S" in the name, it had to be stopped


SVN revision: 1452
1999-11-29 11:33:38 +00:00
Tom Gilbert 6680bc8f5d Mon Nov 29 14:08:10 GMT 1999
(gilbertt)

Tidied up E-UrlWatch lots. Its pretty lean now.


SVN revision: 1451
1999-11-29 10:29:22 +00:00
Richard Barnes 10af2854ff More fun with focus...
SVN revision: 1450
1999-11-28 22:59:25 +00:00
Richard Barnes 1a79294f41 Change to something more like ClickToFocus. The gadgets won't *keep* the focus
unless you click them. This probably needs a little more work...


SVN revision: 1449
1999-11-28 22:33:31 +00:00
Richard Barnes c588207445 Make focusing between an epplet and it's gadget's work a little better. Basically added sloppy-focus. The epplet remembers which gadget last had focus and, if none currently have focus and the last_gadget was a textboxes, passes key events to it.
SVN revision: 1448
1999-11-28 22:08:49 +00:00
Tom Gilbert 517bc09e71 Mon Nov 29 01:08:58 GMT 1999
(gilbertt)

Hrm. A segfault with a certain form of url. Fixed.


SVN revision: 1446
1999-11-28 21:31:57 +00:00
Tom Gilbert 1b47bfe241 Ok. This should be better, the list code was a bit messy. Now its super cool
:)


SVN revision: 1445
1999-11-28 20:44:37 +00:00
Tom Gilbert 3c94fbc165 Hrm. Duplicates are no longer added to the popup.
SVN revision: 1435
1999-11-28 19:07:34 +00:00
Tom Gilbert ba3c47ab02 forgot this
SVN revision: 1431
1999-11-28 18:17:44 +00:00
Tom Gilbert 6f5f6103ae Sun Nov 28 21:52:12 GMT 1999
(gilbertt)

Made the screensaver lock command configurable in E-ScreenSave.


SVN revision: 1430
1999-11-28 18:17:18 +00:00
Carsten Haitzler ea9b3ecfc9 atexit() added to E-Time
SVN revision: 1429
1999-11-28 17:53:06 +00:00
Tom Gilbert b0d77efe53 Sun Nov 28 21:06:21 GMT 1999
(gilbertt)

Added a popup containing a history of the urls you launch, of the urls found
in the file being watched. This is cool :)


SVN revision: 1428
1999-11-28 17:31:59 +00:00
Tom Gilbert b3b4eae813 *cough*
Check the return from malloc in the strdup function in utils.c


SVN revision: 1427
1999-11-28 16:32:59 +00:00
Tom Gilbert 6508a63aa4 Sun Nov 28 20:04:45 GMT 1999
(gilbertt)

Fixed some overzealous free()ing (no checks) in Epplet_gadget_destroy()


SVN revision: 1426
1999-11-28 16:31:23 +00:00
Tom Gilbert 3c1f201311 More sensible default options. Please blow away your old configs ;)
SVN revision: 1423
1999-11-28 15:02:28 +00:00
Tom Gilbert 4bf297095d d'oh
SVN revision: 1422
1999-11-27 21:48:24 +00:00
Tom Gilbert b732ee2c88 Sun Nov 28 01:12:11 GMT 1999
(gilbertt)

Added some help dox for E-UrlWatch.


SVN revision: 1421
1999-11-27 21:45:32 +00:00
Tom Gilbert 6637ec0708 well that didn't work
SVN revision: 1420
1999-11-27 18:27:47 +00:00
Tom Gilbert 6c732e8f06 Just trying something
SVN revision: 1419
1999-11-27 18:17:58 +00:00