Commit Graph

111 Commits

Author SHA1 Message Date
Christian Kreibich 5489ee8f21 Put the cursor where it should be when clicking in a textbox.
SVN revision: 1997
2000-01-31 16:23:48 +00:00
Wayde Milas 7e40e68d81 Added Epplet_default_bind_GL, a quick and dirty default binding for people
to use if the new Epplet_bind_double_GL confuses the hell out of em and they
dont need Epplet_bind_double_GL various buffer settings.


SVN revision: 1975
2000-01-25 21:51:46 +00:00
Wayde Milas f467bc0d4a Altered the api so that you can define ALL the nitty gritty GLX stuf like
accumulation buffers for red, green, blue, alpha channels, depth buffers,
stencil buffers, ect. I'll Add default easier to use calls next.


SVN revision: 1973
2000-01-25 21:07:05 +00:00
Wayde Milas 79b565d620 Ok, the Demo now works corretly. Lighting works on the cube but NOT on the
square. The square doesnt have and back face normals and i really dont want
to set any up, since its just supposed to show how to draw a simple non
lighted polygon with colors. Next task is to solidify the glx epplet epi.


SVN revision: 1971
2000-01-25 17:04:56 +00:00
Wayde Milas 44f512f364 Well, I broke alot of stuff in the Demo. The important part is that the
light mapped cube works. I need to totally redo the api interface to
enable the correct stecil, depth, and accumulation minimums.


SVN revision: 1970
2000-01-25 04:48:59 +00:00
Michael Jennings 027a5161aa Not needed.
SVN revision: 1942
2000-01-18 23:43:54 +00:00
Wayde Milas a04cdb79cc Finnished the abstraction. Single and double buffer binds now only need
and Epplet_gadget drawingarea.


SVN revision: 1929
2000-01-15 03:10:38 +00:00
Michael Jennings 5eb1a92d91 Somebody has some really screwy indenting going on here.
SVN revision: 1926
2000-01-15 02:30:43 +00:00
Wayde Milas f4b3b253be Added double bufering binding.
SVN revision: 1924
2000-01-15 01:12:46 +00:00
Wayde Milas a7d077c7e4 Added GLX routines to epplet.c and epplet.h. Added OpenGL lib checking
and header checking (I hope) to configure.in and acconfig.h


SVN revision: 1920
2000-01-15 00:42:59 +00:00
Tom Gilbert 1eaafd4598 Thu Jan 6 11:57:10 GMT 2000
(gilbertt)

Okay. I'm trying to make epplets gnome-session friendly (dunno why =P).

People complain about the automatic respawning, so I have added a configure
option --disable-auto-respawn to prevent epplets remembering to restart
(they still remember location, sticky etc).

*I have not tested this* because I refuse to run gnome-session on this box,
but I see no reason why it shouldn't be ok.


SVN revision: 1861
2000-01-06 00:16:38 +00:00
Christian Kreibich 3ea5ee7eed Textboxes can now be hidden.
SVN revision: 1775
1999-12-27 19:55:30 +00:00
Christian Kreibich d0c758d6c7 Added a destructor for RGB_buf's. From epplet.h:
/* free an RGB buffer */
void            Epplet_free_rgb_buf(RGB_buf buf);

I think the user shouldn't have to think about the internals of an RGB_buf
in order to free it.


SVN revision: 1695
1999-12-20 15:41:23 +00:00
Michael Jennings 69f99ab980 Thu Dec 16 19:56:24 PST 1999
(KainX)

API changes here, all in order to make E-Disk and E-MemWatch be able to toggle
between the old arrangement and the new.  So basically, you can now move
gadgets to new locations.


SVN revision: 1647
1999-12-16 21:17:27 +00:00
Richard Barnes b32f1a4dc0 Textbox editing fixes. There are still weird bugs. Mostly with scrolling.
Let me know if you notice any. Help me fix them if you dare to look at
the code. *evil grin*


SVN revision: 1627
1999-12-14 21:33:46 +00:00
Richard Barnes 635c811f6c Textbox fixes...
SVN revision: 1626
1999-12-14 21:18:51 +00:00
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
Michael Jennings 30a09f8ebf Misc. oopses.
SVN revision: 1610
1999-12-13 16:28:08 +00:00
Richard Barnes 75f41fbbfe Forgot to make cursor position reset itself when the textbox does...
SVN revision: 1609
1999-12-13 15:31:58 +00:00
Richard Barnes f87010fab4 More textbox editing fixes.
Left/Right arrows work. Home/End work. Backspace/Del work.
Test and give me feedback, I need it...


SVN revision: 1607
1999-12-13 12:46:22 +00:00
Richard Barnes eb5049a9f9 Textbox editing slightly less quirky...
SVN revision: 1601
1999-12-13 09:36:21 +00:00
Richard Barnes a12d859739 Editing support for textboxes is bad^H^H^Hgoood....mmmmkay?
Still a little quirky, but I figured it was good enough to commit for now...


SVN revision: 1600
1999-12-12 23:12:45 +00:00
Richard Barnes a76cefae0d Scrolls better now....hopefully...
SVN revision: 1586
1999-12-10 20:38:54 +00:00
Tom Gilbert 35fcaafcd1 Fri Dec 10 18:28:12 GMT 1999
(gilbertt)

Changed the epplet window classname to epplet-window (was epplet-config
(oops))


SVN revision: 1574
1999-12-10 13:05:59 +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 c48a6258b0 Wed Dec 8 15:41:25 PST 1999
(KainX)

Applied a patch from Michael Roberts <m.t.roberts@student.murdoch.edu.au> so
that invisible gadgets won't try to redraw themselves.


SVN revision: 1558
1999-12-08 18:35:38 +00:00
Michael Jennings 7ee92cdd38 Mon Dec 6 21:48:52 PST 1999
(KainX)

Dialog for E-Biff too.


SVN revision: 1528
1999-12-07 00:59:24 +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 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
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
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 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 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 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 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
Richard Barnes 10af2854ff More fun with focus...
SVN revision: 1450
1999-11-28 22:59:25 +00:00