From bfb711ddc810c59bb64c0a5d2fd43b4f8bba90d4 Mon Sep 17 00:00:00 2001 From: mazze Date: Tue, 11 Dec 2007 00:28:20 +0000 Subject: [PATCH] Deleted gtk-mui because the author himself stated in a thread at aros-exec that it's too outdated. git-svn-id: https://svn.aros.org/svn/aros/trunk/contrib@27438 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- mui/gtk-mui/Makefile.AROS | 177 -- mui/gtk-mui/README | 380 ---- mui/gtk-mui/classes/button.c | 244 --- mui/gtk-mui/classes/checkbutton.c | 248 --- mui/gtk-mui/classes/classes.h | 269 --- mui/gtk-mui/classes/classext.c | 103 -- mui/gtk-mui/classes/custom.c | 493 ------ mui/gtk-mui/classes/entry.c | 216 --- mui/gtk-mui/classes/fixed.c | 314 ---- mui/gtk-mui/classes/menu.c | 194 --- mui/gtk-mui/classes/notebook.c | 365 ---- mui/gtk-mui/classes/progressbar.c | 278 --- mui/gtk-mui/classes/radiobutton.c | 280 --- mui/gtk-mui/classes/rootgroup.c | 224 --- mui/gtk-mui/classes/spinbutton.c | 375 ---- mui/gtk-mui/classes/table.c | 399 ----- mui/gtk-mui/classes/timer.c | 172 -- mui/gtk-mui/classes/togglebutton.c | 412 ----- mui/gtk-mui/classes/toolbar.c | 137 -- mui/gtk-mui/debug.c | 99 -- mui/gtk-mui/debug.h | 92 - mui/gtk-mui/examples/arrow.c | 72 - mui/gtk-mui/examples/buttons.c | 92 - mui/gtk-mui/examples/dial_test.c | 67 - mui/gtk-mui/examples/entry.c | 107 -- mui/gtk-mui/examples/eurocalc/Makefile | 21 - mui/gtk-mui/examples/eurocalc/callbacks.c | 55 - mui/gtk-mui/examples/eurocalc/callbacks.h | 10 - mui/gtk-mui/examples/eurocalc/drx.png | Bin 627 -> 0 bytes mui/gtk-mui/examples/eurocalc/euro_16x16.png | Bin 714 -> 0 bytes mui/gtk-mui/examples/eurocalc/interface.c | 97 -- mui/gtk-mui/examples/eurocalc/interface.h | 6 - mui/gtk-mui/examples/eurocalc/main.c | 42 - mui/gtk-mui/examples/eurocalc/mmakefile.src | 9 - mui/gtk-mui/examples/eurocalc/support.c | 124 -- mui/gtk-mui/examples/eurocalc/support.h | 49 - mui/gtk-mui/examples/filesel.c | 40 - mui/gtk-mui/examples/fixed.c | 72 - mui/gtk-mui/examples/frame.c | 44 - mui/gtk-mui/examples/gpassutil/Makefile | 28 - mui/gtk-mui/examples/gpassutil/callbacks.c | 147 -- mui/gtk-mui/examples/gpassutil/callbacks.h | 34 - mui/gtk-mui/examples/gpassutil/gpass.readme | 29 - mui/gtk-mui/examples/gpassutil/interface.c | 326 ---- mui/gtk-mui/examples/gpassutil/interface.h | 6 - mui/gtk-mui/examples/gpassutil/main.c | 49 - mui/gtk-mui/examples/gpassutil/mmakefile.src | 11 - mui/gtk-mui/examples/gpassutil/support.c | 116 -- mui/gtk-mui/examples/gpassutil/support.h | 49 - mui/gtk-mui/examples/gtk.png | Bin 1137 -> 0 bytes mui/gtk-mui/examples/gtkdial.c | 746 -------- mui/gtk-mui/examples/gtkdial.h | 91 - mui/gtk-mui/examples/menu.c | 134 -- mui/gtk-mui/examples/mmakefile.src | 31 - mui/gtk-mui/examples/notebook.c | 174 -- mui/gtk-mui/examples/progressbar.c | 198 --- mui/gtk-mui/examples/radiobuttons.c | 80 - mui/gtk-mui/examples/rangewidgets.c | 293 ---- mui/gtk-mui/examples/spinbutton.c | 223 --- mui/gtk-mui/examples/table.c | 99 -- mui/gtk-mui/examples/tictactoe.c | 162 -- mui/gtk-mui/examples/tictactoe.h | 62 - mui/gtk-mui/examples/toolbar.c | 209 --- mui/gtk-mui/examples/tooltips.c | 54 - mui/gtk-mui/examples/ttt_test.c | 44 - mui/gtk-mui/g_lib.c | 503 ------ mui/gtk-mui/gdk/gdk.h | 2 - mui/gtk-mui/gdk/gdk_draw.c | 164 -- mui/gtk-mui/gdk/gdk_window.c | 111 -- mui/gtk-mui/gdk/gdkcolor.c | 75 - mui/gtk-mui/gdk/gdkcolor.h | 172 -- mui/gtk-mui/gdk/gdkconfig.h | 24 - mui/gtk-mui/gdk/gdkdrawable.h | 425 ----- mui/gtk-mui/gdk/gdkevents.h | 534 ------ mui/gtk-mui/gdk/gdkgc.c | 110 -- mui/gtk-mui/gdk/gdkgc.h | 276 --- mui/gtk-mui/gdk/gdkmui.c | 68 - mui/gtk-mui/gdk/gdkmui.h | 36 - mui/gtk-mui/gdk/gdktypes.h | 218 --- mui/gtk-mui/gdk/gdkvisual.h | 105 -- mui/gtk-mui/gdk/gdkwindow.h | 608 ------- mui/gtk-mui/gdk/gobject/gtype.h | 3 - mui/gtk-mui/gdk/gobject/gvalue.h | 50 - mui/gtk-mui/gdk/gobject/gvaluecollector.h | 55 - mui/gtk-mui/gdk/mmakefile.src | 21 - mui/gtk-mui/glib.h | 11 - mui/gtk-mui/glib/config.h | 0 mui/gtk-mui/glib/g_object.c | 232 --- mui/gtk-mui/glib/garray.h | 175 -- mui/gtk-mui/glib/gfileutils.c | 1490 ---------------- mui/gtk-mui/glib/gfileutils.h | 108 -- mui/gtk-mui/glib/gmacros.h | 46 - mui/gtk-mui/glib/gmem.h | 0 mui/gtk-mui/glib/gobject/gobject.h | 127 -- mui/gtk-mui/glib/gobject/gsignal.h | 54 - mui/gtk-mui/glib/gobject/gtype.h | 162 -- mui/gtk-mui/glib/gobject/gvalue.h | 50 - mui/gtk-mui/glib/gobject/gvaluecollector.h | 55 - mui/gtk-mui/glib/gobject/mmakefile.src | 17 - mui/gtk-mui/glib/gsignal.c | 360 ---- mui/gtk-mui/glib/gslist.c | 774 --------- mui/gtk-mui/glib/gslist.h | 106 -- mui/gtk-mui/glib/gstrfuncs.h | 30 - mui/gtk-mui/glib/gstrfuncs2.c | 105 -- mui/gtk-mui/glib/gtypes.h | 61 - mui/gtk-mui/glib/mem.h | 2 - mui/gtk-mui/glib/mmakefile.src | 21 - mui/gtk-mui/gtk-mui.c | 973 ----------- mui/gtk-mui/gtk-mui.notes | 210 --- mui/gtk-mui/gtk.h | 41 - mui/gtk-mui/gtk/gtk.h | 1096 ------------ mui/gtk-mui/gtk/gtkadjustment.h | 105 -- mui/gtk-mui/gtk/gtkbox.h | 11 - mui/gtk-mui/gtk/gtkcontainer.h | 17 - mui/gtk-mui/gtk/gtkenums.h | 462 ----- mui/gtk-mui/gtk/gtkmain.h | 0 mui/gtk-mui/gtk/gtkobject.h | 31 - mui/gtk-mui/gtk/gtkprogressbar.h | 56 - mui/gtk-mui/gtk/gtkrange.h | 164 -- mui/gtk-mui/gtk/gtkrequisition.h | 11 - mui/gtk-mui/gtk/gtksettings.h | 141 -- mui/gtk-mui/gtk/gtksignal.h | 0 mui/gtk-mui/gtk/gtkstock.h | 126 -- mui/gtk-mui/gtk/gtkstyle.h | 919 ---------- mui/gtk-mui/gtk/gtktable.h | 0 mui/gtk-mui/gtk/gtktogglebutton.h | 0 mui/gtk-mui/gtk/gtktoolbar.h | 271 --- mui/gtk-mui/gtk/gtktoolitem.h | 123 -- mui/gtk-mui/gtk/gtkvbox.h | 16 - mui/gtk-mui/gtk/gtkwidget.h | 90 - mui/gtk-mui/gtk/mmakefile.src | 31 - mui/gtk-mui/gtk_arrow.c | 85 - mui/gtk-mui/gtk_button.c | 100 -- mui/gtk-mui/gtk_checkbutton.c | 95 - mui/gtk-mui/gtk_custom.c | 59 - mui/gtk-mui/gtk_entry.c | 251 --- mui/gtk-mui/gtk_filesel.c | 206 --- mui/gtk-mui/gtk_fixed.c | 92 - mui/gtk-mui/gtk_frame.c | 82 - mui/gtk-mui/gtk_globals.c | 71 - mui/gtk-mui/gtk_globals.h | 70 - mui/gtk-mui/gtk_grab.c | 63 - mui/gtk-mui/gtk_handle_box.c | 56 - mui/gtk-mui/gtk_hooks.c | 77 - mui/gtk-mui/gtk_image.c | 109 -- mui/gtk-mui/gtk_init.c | 273 --- mui/gtk-mui/gtk_label.c | 165 -- mui/gtk-mui/gtk_menu.c | 397 ----- mui/gtk-mui/gtk_notebook.c | 111 -- mui/gtk-mui/gtk_object.c | 46 - mui/gtk-mui/gtk_paint.c | 2401 -------------------------- mui/gtk-mui/gtk_progressbar.c | 142 -- mui/gtk-mui/gtk_radio.c | 124 -- mui/gtk-mui/gtk_scrollbar.c | 554 ------ mui/gtk-mui/gtk_separator.c | 55 - mui/gtk-mui/gtk_spinbutton.c | 159 -- mui/gtk-mui/gtk_style.c | 345 ---- mui/gtk-mui/gtk_table.c | 151 -- mui/gtk-mui/gtk_timer.c | 163 -- mui/gtk-mui/gtk_toolbar.c | 332 ---- mui/gtk-mui/gtk_tooltips.c | 129 -- mui/gtk-mui/gtk_window.c | 212 --- mui/gtk-mui/gtkstock.h | 5 - mui/gtk-mui/include/SDI_compiler.h | 203 --- mui/gtk-mui/include/SDI_hook.h | 202 --- mui/gtk-mui/mgtk_aros.h | 47 - mui/gtk-mui/mmakefile.src | 86 - mui/gtk-mui/mui.h | 63 - mui/gtk-mui/pango/mmakefile.src | 12 - mui/gtk-mui/pango/pango.h | 29 - 170 files changed, 30035 deletions(-) delete mode 100644 mui/gtk-mui/Makefile.AROS delete mode 100644 mui/gtk-mui/README delete mode 100644 mui/gtk-mui/classes/button.c delete mode 100644 mui/gtk-mui/classes/checkbutton.c delete mode 100644 mui/gtk-mui/classes/classes.h delete mode 100644 mui/gtk-mui/classes/classext.c delete mode 100644 mui/gtk-mui/classes/custom.c delete mode 100644 mui/gtk-mui/classes/entry.c delete mode 100644 mui/gtk-mui/classes/fixed.c delete mode 100644 mui/gtk-mui/classes/menu.c delete mode 100644 mui/gtk-mui/classes/notebook.c delete mode 100644 mui/gtk-mui/classes/progressbar.c delete mode 100644 mui/gtk-mui/classes/radiobutton.c delete mode 100644 mui/gtk-mui/classes/rootgroup.c delete mode 100644 mui/gtk-mui/classes/spinbutton.c delete mode 100644 mui/gtk-mui/classes/table.c delete mode 100644 mui/gtk-mui/classes/timer.c delete mode 100644 mui/gtk-mui/classes/togglebutton.c delete mode 100644 mui/gtk-mui/classes/toolbar.c delete mode 100644 mui/gtk-mui/debug.c delete mode 100644 mui/gtk-mui/debug.h delete mode 100644 mui/gtk-mui/examples/arrow.c delete mode 100644 mui/gtk-mui/examples/buttons.c delete mode 100644 mui/gtk-mui/examples/dial_test.c delete mode 100644 mui/gtk-mui/examples/entry.c delete mode 100644 mui/gtk-mui/examples/eurocalc/Makefile delete mode 100644 mui/gtk-mui/examples/eurocalc/callbacks.c delete mode 100644 mui/gtk-mui/examples/eurocalc/callbacks.h delete mode 100644 mui/gtk-mui/examples/eurocalc/drx.png delete mode 100644 mui/gtk-mui/examples/eurocalc/euro_16x16.png delete mode 100644 mui/gtk-mui/examples/eurocalc/interface.c delete mode 100644 mui/gtk-mui/examples/eurocalc/interface.h delete mode 100644 mui/gtk-mui/examples/eurocalc/main.c delete mode 100644 mui/gtk-mui/examples/eurocalc/mmakefile.src delete mode 100644 mui/gtk-mui/examples/eurocalc/support.c delete mode 100644 mui/gtk-mui/examples/eurocalc/support.h delete mode 100644 mui/gtk-mui/examples/filesel.c delete mode 100644 mui/gtk-mui/examples/fixed.c delete mode 100644 mui/gtk-mui/examples/frame.c delete mode 100644 mui/gtk-mui/examples/gpassutil/Makefile delete mode 100644 mui/gtk-mui/examples/gpassutil/callbacks.c delete mode 100644 mui/gtk-mui/examples/gpassutil/callbacks.h delete mode 100644 mui/gtk-mui/examples/gpassutil/gpass.readme delete mode 100644 mui/gtk-mui/examples/gpassutil/interface.c delete mode 100644 mui/gtk-mui/examples/gpassutil/interface.h delete mode 100644 mui/gtk-mui/examples/gpassutil/main.c delete mode 100644 mui/gtk-mui/examples/gpassutil/mmakefile.src delete mode 100644 mui/gtk-mui/examples/gpassutil/support.c delete mode 100644 mui/gtk-mui/examples/gpassutil/support.h delete mode 100644 mui/gtk-mui/examples/gtk.png delete mode 100644 mui/gtk-mui/examples/gtkdial.c delete mode 100644 mui/gtk-mui/examples/gtkdial.h delete mode 100644 mui/gtk-mui/examples/menu.c delete mode 100755 mui/gtk-mui/examples/mmakefile.src delete mode 100644 mui/gtk-mui/examples/notebook.c delete mode 100644 mui/gtk-mui/examples/progressbar.c delete mode 100644 mui/gtk-mui/examples/radiobuttons.c delete mode 100644 mui/gtk-mui/examples/rangewidgets.c delete mode 100644 mui/gtk-mui/examples/spinbutton.c delete mode 100644 mui/gtk-mui/examples/table.c delete mode 100644 mui/gtk-mui/examples/tictactoe.c delete mode 100644 mui/gtk-mui/examples/tictactoe.h delete mode 100644 mui/gtk-mui/examples/toolbar.c delete mode 100644 mui/gtk-mui/examples/tooltips.c delete mode 100644 mui/gtk-mui/examples/ttt_test.c delete mode 100644 mui/gtk-mui/g_lib.c delete mode 100644 mui/gtk-mui/gdk/gdk.h delete mode 100644 mui/gtk-mui/gdk/gdk_draw.c delete mode 100644 mui/gtk-mui/gdk/gdk_window.c delete mode 100644 mui/gtk-mui/gdk/gdkcolor.c delete mode 100644 mui/gtk-mui/gdk/gdkcolor.h delete mode 100644 mui/gtk-mui/gdk/gdkconfig.h delete mode 100644 mui/gtk-mui/gdk/gdkdrawable.h delete mode 100644 mui/gtk-mui/gdk/gdkevents.h delete mode 100644 mui/gtk-mui/gdk/gdkgc.c delete mode 100644 mui/gtk-mui/gdk/gdkgc.h delete mode 100644 mui/gtk-mui/gdk/gdkmui.c delete mode 100644 mui/gtk-mui/gdk/gdkmui.h delete mode 100644 mui/gtk-mui/gdk/gdktypes.h delete mode 100644 mui/gtk-mui/gdk/gdkvisual.h delete mode 100644 mui/gtk-mui/gdk/gdkwindow.h delete mode 100644 mui/gtk-mui/gdk/gobject/gtype.h delete mode 100644 mui/gtk-mui/gdk/gobject/gvalue.h delete mode 100644 mui/gtk-mui/gdk/gobject/gvaluecollector.h delete mode 100755 mui/gtk-mui/gdk/mmakefile.src delete mode 100644 mui/gtk-mui/glib.h delete mode 100644 mui/gtk-mui/glib/config.h delete mode 100644 mui/gtk-mui/glib/g_object.c delete mode 100644 mui/gtk-mui/glib/garray.h delete mode 100644 mui/gtk-mui/glib/gfileutils.c delete mode 100644 mui/gtk-mui/glib/gfileutils.h delete mode 100644 mui/gtk-mui/glib/gmacros.h delete mode 100644 mui/gtk-mui/glib/gmem.h delete mode 100644 mui/gtk-mui/glib/gobject/gobject.h delete mode 100644 mui/gtk-mui/glib/gobject/gsignal.h delete mode 100644 mui/gtk-mui/glib/gobject/gtype.h delete mode 100644 mui/gtk-mui/glib/gobject/gvalue.h delete mode 100644 mui/gtk-mui/glib/gobject/gvaluecollector.h delete mode 100755 mui/gtk-mui/glib/gobject/mmakefile.src delete mode 100644 mui/gtk-mui/glib/gsignal.c delete mode 100644 mui/gtk-mui/glib/gslist.c delete mode 100644 mui/gtk-mui/glib/gslist.h delete mode 100644 mui/gtk-mui/glib/gstrfuncs.h delete mode 100644 mui/gtk-mui/glib/gstrfuncs2.c delete mode 100644 mui/gtk-mui/glib/gtypes.h delete mode 100644 mui/gtk-mui/glib/mem.h delete mode 100755 mui/gtk-mui/glib/mmakefile.src delete mode 100644 mui/gtk-mui/gtk-mui.c delete mode 100644 mui/gtk-mui/gtk-mui.notes delete mode 100644 mui/gtk-mui/gtk.h delete mode 100644 mui/gtk-mui/gtk/gtk.h delete mode 100644 mui/gtk-mui/gtk/gtkadjustment.h delete mode 100644 mui/gtk-mui/gtk/gtkbox.h delete mode 100644 mui/gtk-mui/gtk/gtkcontainer.h delete mode 100644 mui/gtk-mui/gtk/gtkenums.h delete mode 100644 mui/gtk-mui/gtk/gtkmain.h delete mode 100644 mui/gtk-mui/gtk/gtkobject.h delete mode 100644 mui/gtk-mui/gtk/gtkprogressbar.h delete mode 100644 mui/gtk-mui/gtk/gtkrange.h delete mode 100644 mui/gtk-mui/gtk/gtkrequisition.h delete mode 100644 mui/gtk-mui/gtk/gtksettings.h delete mode 100644 mui/gtk-mui/gtk/gtksignal.h delete mode 100644 mui/gtk-mui/gtk/gtkstock.h delete mode 100644 mui/gtk-mui/gtk/gtkstyle.h delete mode 100644 mui/gtk-mui/gtk/gtktable.h delete mode 100644 mui/gtk-mui/gtk/gtktogglebutton.h delete mode 100644 mui/gtk-mui/gtk/gtktoolbar.h delete mode 100644 mui/gtk-mui/gtk/gtktoolitem.h delete mode 100644 mui/gtk-mui/gtk/gtkvbox.h delete mode 100644 mui/gtk-mui/gtk/gtkwidget.h delete mode 100755 mui/gtk-mui/gtk/mmakefile.src delete mode 100644 mui/gtk-mui/gtk_arrow.c delete mode 100644 mui/gtk-mui/gtk_button.c delete mode 100644 mui/gtk-mui/gtk_checkbutton.c delete mode 100644 mui/gtk-mui/gtk_custom.c delete mode 100644 mui/gtk-mui/gtk_entry.c delete mode 100644 mui/gtk-mui/gtk_filesel.c delete mode 100644 mui/gtk-mui/gtk_fixed.c delete mode 100644 mui/gtk-mui/gtk_frame.c delete mode 100644 mui/gtk-mui/gtk_globals.c delete mode 100644 mui/gtk-mui/gtk_globals.h delete mode 100644 mui/gtk-mui/gtk_grab.c delete mode 100644 mui/gtk-mui/gtk_handle_box.c delete mode 100644 mui/gtk-mui/gtk_hooks.c delete mode 100644 mui/gtk-mui/gtk_image.c delete mode 100644 mui/gtk-mui/gtk_init.c delete mode 100644 mui/gtk-mui/gtk_label.c delete mode 100644 mui/gtk-mui/gtk_menu.c delete mode 100644 mui/gtk-mui/gtk_notebook.c delete mode 100644 mui/gtk-mui/gtk_object.c delete mode 100644 mui/gtk-mui/gtk_paint.c delete mode 100644 mui/gtk-mui/gtk_progressbar.c delete mode 100644 mui/gtk-mui/gtk_radio.c delete mode 100644 mui/gtk-mui/gtk_scrollbar.c delete mode 100644 mui/gtk-mui/gtk_separator.c delete mode 100644 mui/gtk-mui/gtk_spinbutton.c delete mode 100644 mui/gtk-mui/gtk_style.c delete mode 100644 mui/gtk-mui/gtk_table.c delete mode 100644 mui/gtk-mui/gtk_timer.c delete mode 100644 mui/gtk-mui/gtk_toolbar.c delete mode 100644 mui/gtk-mui/gtk_tooltips.c delete mode 100644 mui/gtk-mui/gtk_window.c delete mode 100644 mui/gtk-mui/gtkstock.h delete mode 100644 mui/gtk-mui/include/SDI_compiler.h delete mode 100644 mui/gtk-mui/include/SDI_hook.h delete mode 100644 mui/gtk-mui/mgtk_aros.h delete mode 100755 mui/gtk-mui/mmakefile.src delete mode 100644 mui/gtk-mui/mui.h delete mode 100755 mui/gtk-mui/pango/mmakefile.src delete mode 100644 mui/gtk-mui/pango/pango.h diff --git a/mui/gtk-mui/Makefile.AROS b/mui/gtk-mui/Makefile.AROS deleted file mode 100644 index b2b224403..000000000 --- a/mui/gtk-mui/Makefile.AROS +++ /dev/null @@ -1,177 +0,0 @@ -# $Id: Makefile.AROS,v 1.15 2005/12/12 16:23:43 itix Exp $ - -# for aros adapted morphos makefile - -#CC = -#RANLIB = -#AR = - -# Copy examples exes to TARGETDIR -TARGETDIR=aros - -# ============== DEBUG OFF ============== -CDEFS = -CFLAGS = $(CDEFS) -O3 -Wall -I. -Iinclude -Iclasses -I/home/oli/aros/AROS-20050718-i386-linux-system/Development/include/ - -# ============== DEBUG ON ============== -#CDEFS = -DMGTK_DEBUG -DENABLE_RT=1 -#CDEFS = -DMGTK_DEBUG -#CFLAGS = $(CDEFS) -O3 -g -Wall -I. -Iinclude -Iclasses -I/home/oli/aros/AROS-20050718-i386-linux-system/Development/include/ - -STATICLIBS = -lmui -larossupport -lamiga -larosc -larosm - -OBJS = debug.o \ - g_lib.o \ - glib/gslist.o \ - glib/g_object.o \ - glib/gsignal.o \ - glib/gstrfuncs2.o \ - gdk/gdk_window.o \ - gdk/gdk_draw.o \ - gdk/gdkcolor.o \ - gdk/gdkgc.o \ - gdk/gdkmui.o \ - gtk_init.o \ - gtk_globals.o \ - gtk_window.o \ - gtk_style.o \ - gtk_grab.o \ - gtk_hooks.o \ - gtk_menu.o \ - gtk_button.o \ - gtk_checkbutton.o \ - gtk_table.o \ - gtk_entry.o \ - gtk_image.o \ - gtk_label.o \ - gtk_radio.o \ - gtk_separator.o \ - gtk_scrollbar.o \ - gtk_arrow.o \ - gtk_tooltips.o \ - gtk_filesel.o \ - gtk_frame.o \ - gtk_spinbutton.o \ - gtk_notebook.o \ - gtk_progressbar.o \ - gtk_timer.o \ - gtk_fixed.o \ - gtk_paint.o \ - gtk_handle_box.o \ - gtk_toolbar.o \ - gtk_object.o \ - gtk_custom.o \ - gtk-mui.o \ - classes/rootgroup.o \ - classes/custom.o \ - classes/table.o \ - classes/notebook.o \ - classes/progressbar.o \ - classes/timer.o \ - classes/fixed.o \ - classes/button.o \ - classes/spinbutton.o \ - classes/checkbutton.o \ - classes/togglebutton.o \ - classes/radiobutton.o \ - classes/menu.o \ - classes/entry.o \ - classes/toolbar.o \ - classes/classext.o - - -ECHO = echo -ECHE = echo -e -BOLD = -NRML = - -COMPILING = @$(ECHE) "compiling $(BOLD)$@$(NRML)..." -LINKING = @$(ECHE) "linking $(BOLD)$@$(NRML)..." -STRIPPING = @$(ECHE) "stripping $(BOLD)$@$(NRML)..." -ARCHIVING = @$(ECHE) "archiving $(BOLD)$@$(NRML)..." - -%.o: %.c - $(COMPILING) - $(CC) $(CFLAGS) -o $@ -c $*.c - -all: libgtk-mui.a - -classes/rootgroup.o: classes/classes.h -classes/table.o: classes/classes.h - -libgtk-mui.a: $(OBJS) - $(ARCHIVING) - $(AR) rc libgtk-mui.a $(OBJS) - -clean: - rm -f $(OBJS) *.a - -ex-clean: - rm -f examples/*.o examples/arrow examples/entry examples/filesel examples/frame examples/menu examples/radiobuttons examples/rangewidgets examples/table examples/tooltips examples/spinbutton examples/notebook examples/progressbar examples/fixed examples/buttons examples/toolbar examples/ttt_test examples/*.o - -test: examples - cp examples/arrow examples/entry examples/filesel examples/frame examples/menu examples/radiobuttons examples/rangewidgets examples/table examples/tooltips examples/spinbutton examples/notebook examples/progressbar examples/fixed examples/ttt_test examples/buttons examples/toolbar examples/gpassutil/gpass examples/eurocalc/eurocalc examples/*.png examples/eurocalc/*.png examples/dial_test $(TARGETDIR) - -examples: libgtk-mui.a arrow entry filesel frame menu radiobuttons rangewidgets table tooltips spinbutton notebook progressbar fixed tictactoe buttons toolbar gpass eurocalc dial - -arrow: examples/arrow.c - $(CC) $(CFLAGS) examples/arrow.c -o examples/arrow -L. -lgtk-mui $(STATICLIBS) - -entry: examples/entry.c - $(CC) $(CFLAGS) examples/entry.c -o examples/entry -L. -lgtk-mui $(STATICLIBS) - -filesel: examples/filesel.c - $(CC) $(CFLAGS) examples/filesel.c -o examples/filesel -L. -lgtk-mui $(STATICLIBS) - -frame: examples/frame.c - $(CC) $(CFLAGS) examples/frame.c -o examples/frame -L. -lgtk-mui $(STATICLIBS) - -menu: examples/menu.c - $(CC) $(CFLAGS) examples/menu.c -o examples/menu -L. -lgtk-mui $(STATICLIBS) - -radiobuttons: examples/radiobuttons.c - $(CC) $(CFLAGS) examples/radiobuttons.c -o examples/radiobuttons -L. -lgtk-mui $(STATICLIBS) - -rangewidgets: examples/rangewidgets.c - $(CC) $(CFLAGS) examples/rangewidgets.c -o examples/rangewidgets -L. -lgtk-mui $(STATICLIBS) - -table: examples/table.c - $(CC) $(CFLAGS) examples/table.c -o examples/table -L. -lgtk-mui $(STATICLIBS) - -tooltips: examples/tooltips.c - $(CC) $(CFLAGS) examples/tooltips.c -o examples/tooltips -L. -lgtk-mui $(STATICLIBS) - -spinbutton: examples/spinbutton.c - $(CC) $(CFLAGS) examples/spinbutton.c -o examples/spinbutton -L. -lgtk-mui $(STATICLIBS) - -notebook: examples/notebook.c - $(CC) $(CFLAGS) examples/notebook.c -o examples/notebook -L. -lgtk-mui $(STATICLIBS) - -progressbar: examples/progressbar.c - $(CC) $(CFLAGS) examples/progressbar.c -o examples/progressbar -L. -lgtk-mui $(STATICLIBS) - -fixed: examples/fixed.c - $(CC) $(CFLAGS) examples/fixed.c -o examples/fixed -L. -lgtk-mui $(STATICLIBS) - -buttons: examples/buttons.c - $(CC) $(CFLAGS) examples/buttons.c -o examples/buttons -L. -lgtk-mui $(STATICLIBS) - -toolbar: examples/toolbar.c - $(CC) $(CFLAGS) examples/toolbar.c -o examples/toolbar -L. -lgtk-mui $(STATICLIBS) - -tictactoe: examples/tictactoe.c examples/tictactoe.h examples/ttt_test.c - $(CC) examples/tictactoe.c $(CFLAGS) -c -o examples/tictactoe.o - $(CC) examples/ttt_test.c $(CFLAGS) -c -o examples/ttt_test.o - $(CC) examples/ttt_test.o examples/tictactoe.o -o examples/ttt_test -L. -lgtk-mui $(STATICLIBS) - -dial: libgtk-mui.a examples/dial_test.c examples/gtkdial.c examples/gtkdial.h - $(CC) examples/dial_test.c $(CFLAGS) -c -o examples/dial_test.o - $(CC) examples/gtkdial.c $(CFLAGS) -c -o examples/gtkdial.o - $(CC) examples/dial_test.o examples/gtkdial.o -o examples/dial_test -L. -lgtk-mui $(STATICLIBS) - -gpass: libgtk-mui.a - (cd examples/gpassutil;make) - -eurocalc: libgtk-mui.a - (cd examples/eurocalc;make) - diff --git a/mui/gtk-mui/README b/mui/gtk-mui/README deleted file mode 100644 index efcadab10..000000000 --- a/mui/gtk-mui/README +++ /dev/null @@ -1,380 +0,0 @@ -======================== - GTK-MUI Library -======================== - -$Id: README,v 1.1 2005/12/03 09:14:25 o1i Exp $ - -This library is the result of bounty #30 of the Team Aros: -"GTK+ 2.x wrapper to Zune/MUI (initial version)" - -Objectives: - -1. Create a wrapper for GTK+ 2.x to Zune/MUI. -2. A minimum documentation is required on which calls port to which, - and any appropriate comments on how the two systems interact. -3. When writing the source code, the future possibility should be - kept in mind to use it with the appropriate #Defines for all - of the Amiga operating systems. -4. Since a wrapper allows to emulate GTK step by step, no complete - wrapper is required yet. For this bounty, a basic version containing - the functions mentioned below will be sufficient. - To fulfill this initial bounty, the following GTK functions need - to be wrapped to Zune/MUI: - gtk_adjustment_changed - gtk_adjustment_new - gtk_arrow_new - gtk_box_pack_start - gtk_button_new - gtk_button_new_with_label - gtk_check_button_new_with_label - gtk_container_add - gtk_container_set_border_width - gtk_entry_get_text - gtk_entry_new - gtk_entry_set_text - gtk_file_selection_get_filename - gtk_file_selection_new - gtk_file_selection_set_filename - gtk_fixed_new - gtk_frame_new - gtk_handle_box_new - gtk_hbox_new - gtk_hscrollbar_new - gtk_hseparator_new - gtk_label_new - gtk_main - gtk_main_quit - gtk_menu_bar_new - gtk_menu_item_new - gtk_menu_item_new_with_label - gtk_menu_item_set_submenu - gtk_menu_new - gtk_menu_shell_append - gtk_notebook_new - gtk_object_unref - gtk_paint_arrow - gtk_paint_box - gtk_paint_check - gtk_paint_extension - gtk_paint_flat_box - gtk_paint_focus - gtk_paint_option - gtk_paint_shadow - gtk_paint_slider - gtk_progress_bar_new - gtk_radio_button_group - gtk_radio_button_new_with_label - gtk_range_get_adjustment - gtk_rc_get_style_by_paths - gtk_signal_connect - gtk_signal_connect_object - gtk_spin_button_get_value_as_float - gtk_spin_button_new - gtk_spin_button_set_wrap - gtk_style_apply_default_background - gtk_style_attach - gtk_table_attach - gtk_table_new - gtk_table_set_col_spacings - gtk_table_set_row_spacings - gtk_toggle_button_set_active - gtk_toolbar_new - gtk_tooltips_force_window - gtk_tooltips_new - gtk_vbox_new - gtk_vscrollbar_new - gtk_widget_destroy - gtk_widget_grab_default - gtk_widget_realize - gtk_widget_set_rc_style - gtk_widget_set_sensitive - gtk_widget_set_state - gtk_widget_set_usize - gtk_widget_show - gtk_widget_show_all - gtk_widget_style_get - gtk_window_new - gtk_window_set_modal - gtk_window_set_title - gtk_window_set_transient_for - -Well, 1,3 and 4 are done, so I try to write some documentation within -this file ;). - -==================================================== -License -==================================================== - -GTK-MUI is published under the LGPL -(http://www.gnu.org/licenses/lgpl.txt). - -==================================================== -How to use this library as a normal user (non-coder) -==================================================== - -You can use list library to port GTK programs to your preferred -AmigaOS flavour. There is *no* use for this library, if you are -not writing a program, sorry ;). - -==================================================== -Operating System Requirements -==================================================== - -This library is developed for AROS, Makefiles for MorphOS (itix) -and AmigaOS4 (Andrea Palmatè) are provided AS THEY ARE and -not supported by the author, as I own neither MorphOS nor AmigaOS4. - -ATM the AROS library is a static link library for use with C programs. - -==================================================== -How to use this library as a programmer -==================================================== - -==================== -Installation -==================== -Copy library: - -libgtk-mui.a -> .../aros/sdk/i386-aros/lib/libgtk-mui.a - -Copy headers: - -gtk/*.h -> .../aros/sdk/i386-aros/include/gtk/ -gdk/*.h -> .../aros/sdk/i386-aros/include/gdk/ -pango/* -> .../aros/sdk/i386-aros/include/pango/ -glib/*.h -> .../aros/sdk/i386-aros/include/glib/ -glib/gobject/*.h -> .../aros/sdk/i386-aros/include/glib/gobject/ - -If you think, the includes are a mess, well, you are right ATM. -gtk.h contains too much, I hope to find some time to clean it up (soon?). - -==================== -Linking -==================== - -Most GTK C sources come with a Makefile, which contains something -like this: - -arrow: arrow.c - $(CC) arrow.c -o arrow $(DEPRECTATED) `pkg-config gtk+-2.0 --cflags --libs` - -On my Linux machine, pkg-config output looks like this: - -ksh-aros > pkg-config gtk+-2.0 --cflags --libs --DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/opt/gnome/include/gtk-2.0 -I/opt/gnome/lib/gtk-2.0/include -I/usr/X11R6/include -I/opt/gnome/include/atk-1.0 -I/opt/gnome/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include -L/opt/gnome/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 - -As pkg-config knwos nothing about gtk-mui, you should convert the -Makefile in that way: - -arrow: arrow.c - $(CC) arrow.c -o arrow -lgtk-mui -lmui -larossupport -lamiga -larosc -larosm - -If you get no errors, GOOD ;), but unlikely. GTK-MUI contains only -a (small) subset of all possible GTK, GDK, GLIB, PANGO, GNOME or -whatever functions. So if the linker reports some missing functions, -read the next chapter ;). - -==================================================== -How to implement a new (missing) widget -==================================================== - -Best way to start is, to search for an already existing widget, -which has similiar functions as the missing one. Look how it -is implemented and try to implement the missing one ;). - -Ok, some basic rules: - -- add a type IS_NEWWIDGET to mgtkWidgetType in gtk.h -- start with the gtk_new_widget_new function. Following simple example: - - GtkWidget *gtk_hseparator_new(void) { - GtkWidget *ret; - - ret=mgtk_widget_new(IS_SEPARATOR); - ret->MuiObject=RectangleObject, MUIA_Rectangle_HBar, TRUE, MUIA_FixHeight, 8, End; - - return ret; - } - - widget->MuiObject is the MuiObject, which can display the widget. - -- if the new widget can cause events (a button, which can be pressed, - etc) you most likely need a MUI custom class for this widget. - Then the new function should look like this: - - GtkWidget *gtk_toggle_button_new(void) { - - GtkWidget *button; - - button=mgtk_widget_new(IS_TOGGLEBUTTON); - button->MuiObject=(APTR) NewObject(CL_ToggleButton->mcc_Class, NULL,MA_Widget,button,TAG_DONE); - - return button; - } - - Every custom MUI class must accept MA_Widget, so if the class - wants to cause a GTK-event, the object can find its widget. - - - classes/togglebutton.c is a quite complete example to look at - - don't forget to call the create_new_class and delete_new_class - functions in gtk_init.c - -==================================================== -GTK-MUI internals -==================================================== - -The most important struct is the GtkWidget struct, I -will give a short (and not complete) overview, which -magic is hidden there: - -Every widget contains a GObject: - -struct _GObject { - int badmagic; - struct internalGObject *gobjs; - guint ref_count; -}; - -badmagic is a fixed value, which can be used, to -test if this is a GObject (or not). - -gobjs are used, to store user data in the object, -with g_object_set_data for example. - -ref_count ist the normal ref_count of GLib, although -increased and decreased in most functions, not really -used up to now. - -GTK-MUI internal values of a GtkWidget: - -struct _GtkWidget { - GObject object; - /* The above described GObject */ - int type; - /* GTK-MUI type, IS_SEPERATOR etc. */ - GtkWidget *parent; - /* parent GtkWidget or NULL, if not set */ - APTR MuiWin; - /* if !IS_WINDOW, this points to the MUI root Window - * (do not rely on this, might be NULL) - */ - APTR MuiWinMenustrip; - /* MuiWindow Menustrip, if type==IS_WINDOW */ - APTR MuiGroup; - /* MuiGroup, if type==IS_WINDOW */ - Object *MuiObject; - /* MUI Object to display this widget */ - mgtk_signal_connect_data *mgtk_signal_connect_data; - /* all signal handlers are stored here */ - mgtkMUIClass mainclass; - /* main class tree (area, window, application), defines what - * kind of tags and methods are available - */ - GtkWidget *nextObject; - /* A second MUI Object or widget, if stored. Not clearly defined, - * should not be necessary to use - */ -}; - -And then, we have the global structure mgtk: - -struct _mgtk { - APTR MuiApp; - /* MUI application pointer */ - APTR MuiRoot; - /* MUI Root Window Object */ - APTR MuiRootStrip; - /* MUI Root Window Object Menu Strip*/ - APTR Group; - /* MUI Root Window Group Object */ - GSList *windows; - /* all GTK windows in a linked list */ - GtkWidget *grab; - /* the widget getting all keystrokes.. TODO */ - guint mgtk_signal_count; - /* the next free number for a (custom) signal type */ - mgtk_SignalType *mgtk_signal; - /* All GTK (custom) signals */ - GType mgtk_fundamental_count; - /* the next free number for a (custom) widget type */ - mgtk_Fundamental *mgtk_fundamental; - /* All custom widget types */ - GtkStyle *default_style; - /* default GTK style for all widgets */ - guint white_black_optained; - LONG white_pen; - LONG black_pen; - guint other_pens_optained; - struct Screen *screen; - struct DrawInfo *dri; - APTR visualinfo; - /* some pen/screen magic */ -}; - - -==================================================== -Debugging the library -==================================================== - -The library can be built with debug output enabled or disabled. If you -build it without -DDEBUG, then on AROS - -DebOut : won't print any output -WarnOut : print to STDOUT -ErrOut : print to STDOUT - -with -DDEBUG - -DebOut : print to D(bug -WarnOut : print to DebOut and STDOUT -ErrOut : print to DebOut and STDOUT - -All debug output is printed through DebOut at the moment, errors and -warnings are most times printed through printf, next version will -remove the printfs ;). - -DebOut might give wrong values, when you print floating point values. - -==================================================== -Useful links -==================================================== -Home of GTK: -http://www.gtk.org/ - -Home of GTK-MUI: -http://sourceforge.net/projects/gtk-mui/ - -GTK function overview: -http://www.gtk.org/api/2.6/gtk/ix01.html - -GTK+ 2.0 Tutorial: -http://www.gtk.org/tutorial/index.html - -GLIB signals: -http://developer.gnome.org/doc/API/2.0/gobject/gobject-Signals.html - - -==================================================== -Thanks to -==================================================== - -- Senex and all other donators of this bounty, this shows a - programmer, that his work is appreciated -- Ilkka Lehtoranta (itix) for: - working on the library a few days - showing me how to write custom classes - the table and root class - MorphOS port (although not current at the moment) - The hours you helped this project have been very important, the - current quality would have been impossible without you. -- Andrea Palmatè for: - Amiga OS4 port - telling me how bad my inlcudes are ;) -- Adam Olivier for: - initial AROS port help -- Stefan Haubenthal for: - sending me some smaller patches - trying to build this mess on his machine - -Oliver Brunner (o1i), gtk-mui "at" oliver-brunner.de - diff --git a/mui/gtk-mui/classes/button.c b/mui/gtk-mui/classes/button.c deleted file mode 100644 index df407fb8c..000000000 --- a/mui/gtk-mui/classes/button.c +++ /dev/null @@ -1,244 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; - Object *box; - Object *button; - struct MUI_EventHandlerNode HandlerNode; -}; - -/******************************************* - * MUIHook_button - * - * emit the right signal(s) - *******************************************/ -HOOKPROTO(MUIHook_button, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - guint pressed; - - DebOut("MUIHook_button called\n"); - widget=mgtk_get_widget_from_obj(obj); - DebOut(" widget=%x\n",(int) widget); - - pressed=xget(obj,MUIA_Selected); - - if(pressed) { - DebOut(" emit newstyle pressed signal \n"); - g_signal_emit(widget,g_signal_lookup("pressed",0),0); - } - else { /* released */ - DebOut(" emit newstyle released signal \n"); - g_signal_emit(widget,g_signal_lookup("released",0),0); - DebOut(" emit newstyle clicked signal\n"); - g_signal_emit(widget,g_signal_lookup("clicked",0),0); - } - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_button, MUIHook_button); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - Object *button; - GtkWidget *widget; - const char *label; - struct TagItem *tstate, *tag; - - DebOut("mNew (button)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("button: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - label=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - case MA_Button_Label: - label = (const char *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/button.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - DebOut(" widget=%d\n",widget); - - if(label) { - /* MUI buttons are Text.mui objects which copies label to an internal - * buffer always unless MUIA_Text_Copy, FALSE. We can retrieve label - * by reading MUIA_Text_Contents. -itix - */ - button=MUI_MakeObject(MUIO_Button, (ULONG)label); - } - else { - button=VGroup, - GroupSpacing(0), - MUIA_Background, MUII_ButtonBack, - ButtonFrame, - MUIA_InputMode , MUIV_InputMode_RelVerify, - End; - } - - /* setup internal hooks */ - - if (button) - { - SetAttrs(button, MUIA_CycleChain, 1, MUIA_Weight, 0, TAG_DONE); - - DoMethod(button,MUIM_Notify,MUIA_Selected,MUIV_EveryTime, button,2,MUIM_CallHook,&MyMuiHook_button); - - data->widget=widget; - - data->button=NULL; - DoMethod(obj,OM_ADDMEMBER,button); - data->button=button; - } - else - { - CoerceMethod(cl, obj, OM_DISPOSE); - obj = NULL; - } - } - - return (ULONG)obj; -} - -/******************************************* - * mGet - * - * MA_Widget: GtkWidget of this radio - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) { - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -static int mAddMember(struct Data *data, Object *obj,struct opMember *msg,struct IClass *cl) { - - DebOut("button.c: mAddMember(%lx,%lx)\n",obj,msg->opam_Object); - - if(data->button) { - /* now someone added a new object to us, so don't add it to the - * group object, but to the button!*/ - DebOut(" data->button,OM_ADDMEMBER,msg->opam_Object\n"); - DoMethod(data->button,OM_ADDMEMBER,msg->opam_Object); - return TRUE; - } - else { - /* if !data->button, we want to add the button to the object, - * so just pass it to the original method */ - DebOut(" DoSuperMethodA(cl, obj, (Msg)msg)\n"); - return DoSuperMethodA(cl, obj, (Msg)msg); - } -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - case OM_ADDMEMBER : return mAddMember (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_button_class(void) -{ - DebOut("mgtk_create_button_class()\n"); - - CL_Button = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_Button=%lx\n",CL_Button); - - return CL_RadioButton ? 1 : 0; -} - -void mgtk_delete_button_class(void) -{ - if (CL_Button) - { - MUI_DeleteCustomClass(CL_Button); - } -} diff --git a/mui/gtk-mui/classes/checkbutton.c b/mui/gtk-mui/classes/checkbutton.c deleted file mode 100644 index fba0d76f2..000000000 --- a/mui/gtk-mui/classes/checkbutton.c +++ /dev/null @@ -1,248 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; - Object *box; - Object *check; - Object *labelobj; -}; - -/******************************************* - * mgtk_check_value_update(GtkWidget *widget) - * - *******************************************/ - /*internal */ -static void mgtk_check_value_update0(GtkWidget *widget,struct Data *data, int b) { - - DebOut("mgtk_check_value_update0(%x,%x,%d)\n",widget,data,b); - - DebOut(" data->check=%lx\n",data->check); - setcheckmark(data->check,b); - widget->active=b; -} - -/******************************************* - * MUIHook_checkbutton - *******************************************/ -HOOKPROTO(MUIHook_check, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_check called\n"); - widget=mgtk_get_widget_from_obj(obj); - DebOut(" widget=%x\n",(int) widget); - - widget->active=xget(widget->MuiObject,MA_Toggle_Value); - - DebOut(" emit toggled signal\n"); - g_signal_emit(widget,g_signal_lookup("toggled",0),0); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_check, MUIHook_check); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - Object *box; - Object *check; - Object *labelobj; - GtkWidget *widget; - const char *label; - struct TagItem *tstate, *tag; - - DebOut("mNew (checkbutton)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("checkbutton: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - label=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - case MA_Check_Label: - label = (const char *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/checkbutton.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - DebOut(" widget=%d\n",widget); - - box=(APTR) HGroup, - MUIA_CycleChain, 1, - End; - - check=(APTR) MUI_MakeObject(MUIO_Checkmark, label); - - labelobj=Label1(label); - - DoMethod(obj,OM_ADDMEMBER,box); - DoMethod(box,OM_ADDMEMBER,check); - DoMethod(box,OM_ADDMEMBER,labelobj); - DoMethod(box,OM_ADDMEMBER,HSpace(0)); - - /* setup internal hooks */ - DoMethod(check,MUIM_Notify,MUIA_Selected,MUIV_EveryTime, check,2,MUIM_CallHook,&MyMuiHook_check); - - data->box=box; - data->check=check; - data->labelobj=labelobj; - data->widget=widget; - } - - return (ULONG)obj; -} - -/******************************************* - * mSet - * - * MA_Toggle_Value only usefull TAG here - * MA_Check_String_Value *private* - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - struct TagItem *tstate, *tag; - GtkWidget *widget; - - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); - - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Toggle_Value: - DebOut("mSet(%lx) to %d\n",obj,tag->ti_Data); - widget=mgtk_get_widget_from_obj(obj); - mgtk_check_value_update0(widget,data,(int)tag->ti_Data); - break; - } - } -} - -/******************************************* - * mGet - * - * MA_Toggle_Value: value as string - * MA_Widget: GtkWidget of this check - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) { - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - case MA_Toggle_Value : - rc=xget(data->check, MUIA_Selected); - DebOut("mGet: MA_Toggle_Value =%d\n", rc); - break; - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_checkbutton_class(void) -{ - DebOut("mgtk_create_checkbutton_class()\n"); - - CL_CheckButton = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_CheckButton=%lx\n",CL_CheckButton); - - return CL_CheckButton ? 1 : 0; -} - -void mgtk_delete_checkbutton_class(void) -{ - if (CL_CheckButton) - { - MUI_DeleteCustomClass(CL_CheckButton); - } -} diff --git a/mui/gtk-mui/classes/classes.h b/mui/gtk-mui/classes/classes.h deleted file mode 100644 index 4987899a4..000000000 --- a/mui/gtk-mui/classes/classes.h +++ /dev/null @@ -1,269 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#ifndef GTKMUI_CLASSES_H -#define GTKMUI_CLASSES_H - -#ifndef SDI_HOOK_H -#ifndef __AROS__ /* AROS misses SDI_hook.h ..? */ -#define MGTK_HOOK_OBJECT_POINTER Object * -#define MGTK_HOOK_APTR APTR -#define MGTK_USERFUNC_INIT -#define MGTK_USERFUNC_EXIT -#include -#else -#include "mgtk_aros.h" -#endif -#endif - -#ifndef MUII_ImageButtonBack -#define MUII_ImageButtonBack MUII_ButtonBack -#endif - -#include "gtk.h" - -/* Some great VaporWare ideas. -** -*/ - -#define GETDATA struct Data *data = (struct Data *)INST_DATA(cl, obj) -#define DOSUPER DoSuperMethodA(cl, obj, (Msg)msg); - -/********************************************************************** - Some macros -**********************************************************************/ - -#ifdef __AMIGAOS4__ - /* does this work ? */ - #define MGTK_NEWLIST(MyList) NEWMINLIST(MyList) -#else /* !OS4 */ - #ifndef NEWLIST - #define NEWLIST(MyList) \ - do { \ - struct MinList *_MyList = (struct MinList *)(MyList); \ - _MyList->mlh_TailPred = (struct MinNode *)_MyList; \ - _MyList->mlh_Tail = (struct MinNode *)NULL; \ - _MyList->mlh_Head = (struct MinNode *)&_MyList->mlh_Tail; \ - } while (0) - #endif /* !NEWLIST */ - #ifndef MGTK_NEWLIST - #define MGTK_NEWLIST(MyList) NEWLIST(&MyList) - #endif -#endif /* OS4 */ - -#ifndef ADDTAIL -#define ADDTAIL(MyList,MyNode) \ -do { \ - struct MinList *_MyList = (struct MinList *)(MyList); \ - struct MinNode *_MyNode = (struct MinNode *)(MyNode); \ - struct MinNode *OldPredNode; \ - OldPredNode = _MyList->mlh_TailPred; \ - _MyNode->mln_Succ = (struct MinNode *)&_MyList->mlh_Tail; \ - _MyNode->mln_Pred = OldPredNode; \ - OldPredNode->mln_Succ = _MyNode; \ - _MyList->mlh_TailPred = _MyNode; \ -} while (0) -#endif /* !ADDTAIL */ - -#ifndef REMOVE -#define REMOVE(MyNode) \ -({ \ - struct MinNode *_MyNode = (struct MinNode *)(MyNode); \ - struct MinNode *PredNode; \ - struct MinNode *SuccNode; \ - PredNode = _MyNode->mln_Pred; \ - SuccNode = _MyNode->mln_Succ; \ - PredNode->mln_Succ = SuccNode; \ - SuccNode->mln_Pred = PredNode; \ - _MyNode; \ -}) -#endif /* !REMOVE */ - -#ifndef ForeachNode -#define ForeachNode(l,n) \ -for ( \ - n = (void *)(((struct List *)(l))->lh_Head); \ - ((struct Node *)(n))->ln_Succ; \ - n = (void *)(((struct Node *)(n))->ln_Succ) \ -) -#endif - - -#ifdef __MORPHOS__ -/*************** MorphOS ******************/ - - #define DISPATCHERARG struct IClass *cl = (struct IClass *)REG_A0; APTR obj = (APTR)REG_A2; Msg msg = (Msg)REG_A1; - #define BEGINMTABLE static ULONG mDispatcherPPC(void); static struct EmulLibEntry mDispatcher = { TRAP_LIB, 0, (void (*)())&mDispatcherPPC }; static ULONG mDispatcherPPC(void) { DISPATCHERARG - #define SETUPHOOK(x, func, data) { struct Hook *h = (x); h->h_Entry = (HOOKFUNC)&HookEntry; h->h_SubEntry = (HOOKFUNC)&func; h->h_Data = (APTR)data; } - -#else - -#ifdef __AROS__ -/*************** AROS ********************/ - - #define BEGINMTABLE AROS_UFH3(static ULONG,mDispatcher,AROS_UFHA(struct IClass*, cl, a0), AROS_UFHA(APTR, obj, a2), AROS_UFHA(Msg, msg, a1)) - #define SETUPHOOK(x, func, data) { struct Hook *h = (x); h->h_Entry = (HOOKFUNC)&func; h->h_Data = (APTR)data; } - -#else -/************* AmigaOS 3/4 ***************/ - #define BEGINMTABLE static ULONG mDispatcher(REG(a0, struct IClass *cl), REG(a2, APTR obj), REG(a1, Msg msg)) { - -/************* AmigaOS 4 ***************/ -#ifdef __AMIGAOS4__ - #define SETUPHOOK(x, func, data) { struct Hook *h = (x); h->h_Entry = (HOOKFUNC)func; h->h_Data = (APTR)data; } -#else -/************* AmigaOS 3 ***************/ - -#endif -#endif -#endif - -#define ENDMTABLE return DoSuperMethodA(cl, obj, msg); } - -/********************************************************************** - Classes -**********************************************************************/ - -int mgtk_create_rootgroup_class(void); -void mgtk_delete_rootgroup_class(void); -int mgtk_create_table_class(void); -void mgtk_delete_table_class(void); -int mgtk_create_spinbutton_class(void); -void mgtk_delete_spinbutton_class(void); -int mgtk_create_notebook_class(void); -void mgtk_delete_notebook_class(void); -int mgtk_create_progressbar_class(void); -void mgtk_delete_progressbar_class(void); -int mgtk_create_timer_class(void); -void mgtk_delete_timer_class(void); -int mgtk_create_fixed_class(void); -void mgtk_delete_fixed_class(void); -int mgtk_create_checkbutton_class(void); -void mgtk_delete_checkbutton_class(void); -int mgtk_create_togglebutton_class(void); -void mgtk_delete_togglebutton_class(void); -int mgtk_create_radiobutton_class(void); -void mgtk_delete_radiobutton_class(void); -int mgtk_create_button_class(void); -void mgtk_delete_button_class(void); -int mgtk_create_menu_class(void); -void mgtk_delete_menu_class(void); -int mgtk_create_entry_class(void); -void mgtk_delete_entry_class(void); -int mgtk_create_toolbar_class(void); -void mgtk_delete_toolbar_class(void); -int mgtk_create_custom_class(void); -void mgtk_delete_custom_class(void); - - -ULONG mgtk_askminmax(struct IClass *cl, APTR obj, struct MUIP_AskMinMax *msg, LONG defwidth, LONG defheight); - -/********************************************************************** - Tags & methods -**********************************************************************/ - -#define GTK_TAGBASE 0xfece0000 - -enum -{ - MA_RootGroup_Resizable = GTK_TAGBASE, - - /* These are extensions to standard area class tags */ - - MA_DefWidth, - MA_DefHeight, - - /* Tables */ - - MM_Table_Attach, - MA_Table_Columns, - MA_Table_Rows, - MA_Table_VertSpacing, - MA_Table_HorizSpacing, - - /* common */ - MA_Widget, - - /* spinbutton */ - MA_Spin_Value, - MA_Spin_String_Value, - - /* notebook */ - MA_Note_Append_Child, - MA_Note_Prepend_Child, - MA_Note_Label, - MA_Note_Get_Child_Nr, - - /* timer */ - MA_Timer_Intervall, - MA_Timer_Function, - MA_Timer_Data, - MUIM_Class5_Trigger, - - /* progressbar */ - MA_Pulse, - - /* fixed */ - MA_Fixed_Move, - - /* checkbutton */ - MA_Check_Label, - /* radiobutton */ - MA_Radio_Label, - - /* checkbutton */ - /* togglebutton */ - /* radiobutton */ - MA_Toggle_Value, - - /* button */ - MA_Button_Label, - -}; - -struct MUIP_Table_Attach { - ULONG MethodID; - GtkWidget *widget; - ULONG left; - ULONG right; - ULONG top; - ULONG bottom; -}; - -struct MA_Fixed_Move_Data { - GtkWidget *widget; - int x; - int y; -}; - -GtkWidget *mgtk_get_widget_from_obj(Object *obj); - -#endif /* GTKMUI_CLASSES_H */ - diff --git a/mui/gtk-mui/classes/classext.c b/mui/gtk-mui/classes/classext.c deleted file mode 100644 index 14ac67f59..000000000 --- a/mui/gtk-mui/classes/classext.c +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -#ifdef __MORPHOS__ -#include -#endif - -/********************************************************************** - mgtk_askminmax - - This is like standard mAskMinMax() but supports user defined - default width/height -**********************************************************************/ - -ULONG mgtk_askminmax(struct IClass *cl, APTR obj, struct MUIP_AskMinMax *msg, LONG defwidth, LONG defheight) -{ - struct MUI_MinMax *mm = msg->MinMaxInfo; - - DoSuperMethodA(cl, obj, msg); - - if (defwidth < 0) - defwidth = mm->DefWidth; - else if (defwidth == 0) - defwidth = mm->MinWidth; - else - { - if (defwidth < mm->MinWidth) - defwidth = mm->MinWidth; - else if (defwidth > mm->MaxWidth) - defwidth = mm->MaxWidth; - } - - if (defheight < 0) - defheight = mm->DefHeight; - else if (defheight == 0) - defheight = mm->MinHeight; - else - { - if (defheight < mm->MinHeight) - defheight = mm->MinHeight; - else if (defheight > mm->MaxHeight) - defheight = mm->MaxHeight; - } - - mm->DefWidth = defwidth; - mm->DefHeight = defheight; - - return 0; -} - -/**************************** - * mgtk_get_widget_from_obj - * - * get the GtkWidget of a - * MUI object - ****************************/ -GtkWidget *mgtk_get_widget_from_obj(Object *obj) { - Object *o; - - o=obj; - while(!xget(o,MA_Widget)) { - DebOut(" o=%x\n",o); - o=_parent(o); - } - return (GtkWidget *) xget(o,MA_Widget); -} - diff --git a/mui/gtk-mui/classes/custom.c b/mui/gtk-mui/classes/custom.c deleted file mode 100644 index e5cc53c75..000000000 --- a/mui/gtk-mui/classes/custom.c +++ /dev/null @@ -1,493 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -/* custom class -** -** works as a basis for custom widgets -*/ - -#include -#include -#include -#include - -#include "classes.h" -#include "gtk_globals.h" -#include "gtk.h" -#include "debug.h" - -struct Data { - LONG is_resizable; - LONG defwidth, defheight; - GtkWidget *widget; - - /* old stuff */ - struct Hook LayoutHook; - struct MinList ChildList; - - ULONG columns, rows, vertspacing, horizspacing; -}; - -struct CustomNode { - struct MinNode node; - GtkWidget *widget; - UWORD left, right, top, bottom; -}; - - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg, ULONG is_new); - -#ifndef __AROS__ -HOOKPROTO(LayoutHook, ULONG, APTR obj, struct MUI_LayoutMsg *lm) { -#else -AROS_UFH3(static ULONG, LayoutHook, AROS_UFHA(struct Hook *, hook, a0), AROS_UFHA(APTR, obj, a2), AROS_UFHA(struct MUI_LayoutMsg *, lm, a1)) -#endif - - GtkWidget *widget; - GtkRequisition req; - void (*callme)(GtkWidget *widget,GtkRequisition *requisition); - - DebOut("LayoutHook(%lx,..)\n",obj); - - switch (lm->lm_Type) { - case MUILM_MINMAX: { - - widget=mgtk_get_widget_from_obj(obj); - - DebOut(" widget=%lx\n",widget); - if(widget->class) { - DebOut(" widget->class=%lx\n",widget->class); - if(widget->class->size_request) { - callme=(void *) widget->class->size_request; - DebOut(" calling widget->class->size_request: %lx\n",callme); - (*callme)(widget,&req); - DebOut(" req->width=%d\n",req.width); - DebOut(" req->height=%d\n",req.height); - } - } - - lm->lm_MinMax.MinWidth = 0; - lm->lm_MinMax.MinHeight = 0; - lm->lm_MinMax.DefWidth = req.width; - lm->lm_MinMax.DefHeight = req.height; - lm->lm_MinMax.MaxWidth = 1024; - lm->lm_MinMax.MaxHeight = 1024; - } - return 0; - -#if 0 - case MUILM_LAYOUT: { - struct Data *data = hook->h_Data; - struct CustomNode *node; - ULONG mincw, minch, defcw, defch, maxcw, maxch; - - if (data->columns && data->rows) - { - struct CustomNode *node; - ULONG cw, ch; - - cw = lm->lm_Layout.Width / data->columns; - ch = lm->lm_Layout.Height / data->rows; /* +1 ? */ - - ForeachNode(&data->ChildList, node) - { - if (!MUI_Layout(node->widget->MuiObject, - node->left * cw, - node->top * ch , - (node->right - node->left) * cw, - (node->bottom - node->top ) * ch, - 0)) - { - return FALSE; - } - } - } - } -#endif - return TRUE; - } - - return MUILM_UNKNOWN; -} - -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - GtkWidget *widget; - struct TagItem *tstate, *tag; - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - DebOut("mNew(custom)\n"); - - if (!obj) { - ErrOut("custom: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) { - switch (tag->ti_Tag) { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - DebOut(" widget=%lx\n",widget); - break; - } - } - - if(!widget) { - ErrOut("classes/custom.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - data->widget=widget; - - SETUPHOOK(&data->LayoutHook, LayoutHook, data); - MGTK_NEWLIST(data->ChildList); - -#if 0 - data->vertspacing = 0; - data->horizspacing = 0; -#endif - data->defwidth = -1; - data->defheight = -1; - data->is_resizable = 1; - - set(obj, MUIA_Group_LayoutHook, &data->LayoutHook); - mSet(data, obj, (APTR)msg, TRUE); - } - - return (ULONG)obj; -} - -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) { - ULONG rc; - - switch (msg->opg_AttrID) { -#if 0 - case MA_Custom_VertSpacing : rc = data->vertspacing; break; - case MA_Custom_HorizSpacing: rc = data->horizspacing; break; -#endif - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg, ULONG is_new) -{ - struct TagItem *tstate, *tag; - ULONG relayout = 0; - - tstate = msg->ops_AttrList; - - while ((tag = NextTagItem(&tstate))) { - switch (tag->ti_Tag) - { - case MA_Widget : - data->widget=(GtkWidget *)tag->ti_Data; - break; - case MA_DefWidth: - if (data->defwidth != tag->ti_Data) - { - data->defwidth = tag->ti_Data; - relayout = 1; - } - break; - - case MA_DefHeight: - if (data->defheight != tag->ti_Data) - { - data->defheight = tag->ti_Data; - relayout = 1; - } - break; - } - } - - if (relayout) { - DoMethod(obj, MUIM_Group_InitChange); - DoMethod(obj, MUIM_Group_ExitChange); - } -} - -#if 0 -static VOID mRemMember(struct Data *data, struct opMember *msg) -{ - struct CustomNode *node; - - ForeachNode(&data->ChildList, node) - { - if (node->widget->MuiObject == msg->opam_Object) - { - REMOVE(node); - mgtk_freemem(node, sizeof(*node)); - return; - } - } -} - -struct Custom_Attach { - GtkWidget *widget; - ULONG left; - ULONG right; - ULONG top; - ULONG bottom; -}; - -static ULONG mAttach(struct Data *data, APTR obj, struct MUIP_Custom_Attach *in) { - struct CustomNode *node; - struct Custom_Attach *msg; - - DebOut("mAttach(..)\n"); - - DebOut("WARNING: BAD HACK INSIDE, TODO!!\n"); - /* for some reason, parameter handling sux here ?? */ - msg=(struct MUIP_Custom_Attach *) in->widget; - - /* but now, we got a correct message */ - DebOut("msg=%lx\n",msg); - - node = mgtk_allocmem(sizeof(*node), MEMF_ANY); - - if (node) - { - ADDTAIL(&data->ChildList, node); - - node->widget = msg->widget; - node->left = msg->left; - node->right = msg->right; - node->top = msg->top; - node->bottom = msg->bottom; - - DebOut(" msg->widget: %lx\n",msg->widget); - DebOut(" msg->widget->MuiObject: %lx\n",msg->widget->MuiObject); - DebOut(" obj: %lx\n",obj); - DoMethod(obj, MUIM_Group_InitChange); - DoMethod(obj, OM_ADDMEMBER, msg->widget->MuiObject); - DoMethod(obj, MUIM_Group_ExitChange); - } - - return 0; -} -#endif - -static ULONG mAskMinMax(struct Data *data, APTR obj, struct MUIP_AskMinMax *msg, struct IClass *cl) -{ - DebOut("mAskMinMax(%lx,%lx,%lx,%lx)\n",data,obj,msg,cl); - - DoSuperMethodA(cl, obj, msg); - - if (!data->is_resizable || data->defwidth >=0 || data->defheight >= 0) { - struct MUI_MinMax *mm = msg->MinMaxInfo; - struct Window *window = _window(obj); - LONG defwidth, defheight; - LONG bl,br,bt,bb; - - /* during window_show, _window(obj) is NULL, - on AROS accessing window->BorderLeft crashes - with a core dump - */ - DebOut(" window: %lx\n",window); - - if(window) { - bl=window->BorderLeft; - br=window->BorderRight; - bt=window->BorderTop; - bb=window->BorderBottom; - } - else { - /* ? */ - bl=0; - br=0; - bt=0; - bb=0; - } - - if (data->defwidth < 0) { - defwidth = mm->DefWidth; - } - else if (data->defwidth == 0) { - defwidth = mm->MinWidth; - } - else { - defwidth = data->defwidth - bl - br; - - if (defwidth < mm->MinWidth) { - DebOut("outsch!\n"); - defwidth = mm->MinWidth; - } - else if (defwidth > mm->MaxWidth) { - DebOut("outsch2! %d\n",mm->MaxWidth); - defwidth = mm->MaxWidth; - } - } - - if (data->defheight < 0) - defheight = mm->DefHeight; - else if (data->defheight == 0) - defheight = mm->MinHeight; - else - { - defheight = data->defheight - bt - bb; - - if (defheight < mm->MinHeight) - defheight = mm->MinHeight; - else if (defheight > mm->MaxHeight) - defheight = mm->MaxHeight; - } - - DebOut("defheight=%d\n",defheight); - DebOut("defwidth=%d\n",defwidth); - - if (!data->is_resizable) - { - mm->MinWidth = mm->DefWidth = mm->MaxWidth = defwidth; - mm->MinHeight = mm->DefHeight = mm->MaxHeight = defheight; - } - else - { - mm->DefWidth = defwidth; - mm->DefHeight = defheight; - } - } - - return 0; -} - - -static ULONG mDraw(struct IClass *cl,struct Data *data,Object *obj,struct MUIP_Draw *msg) -{ - gint ret; - GtkWidget *widget; - GdkEventExpose *event; - static gint (*callme)(GtkWidget *widget, GdkEventExpose *event); - static void (*callme2) (GtkWidget *widget, GtkAllocation *allocation); - - - /* - ** let our superclass draw itself first, area class would - ** e.g. draw the frame and clear the whole region. What - ** it does exactly depends on msg->flags. - */ - - DoSuperMethodA(cl,obj,msg); - - /* - ** if MADF_DRAWOBJECT isn't set, we shouldn't draw anything. - ** MUI just wanted to update the frame or something like that. - */ - - if (!(msg->flags & MADF_DRAWOBJECT)) { - return(0); - } - - /* - ** ok, everything ready to render... - */ - - DebOut("custom.c:mDraw(%lx,..)\n",obj); - - widget=mgtk_get_widget_from_obj(obj); - - widget->allocation.width=_mright(obj)-_mleft(obj); - widget->allocation.height=_mbottom(obj)-_mtop(obj); - - DebOut(" widget->allocation.width=%d\n",widget->allocation.width); - DebOut(" widget->allocation.height=%d\n",widget->allocation.height); - - DebOut(" widget=%lx\n",widget); - if(widget->class) { - DebOut(" widget->class=%lx\n",widget->class); - if(widget->class->size_allocate) { - callme2=widget->class->size_allocate; - DebOut(" calling widget->class->size_allocate: %lx\n",callme2); - (*callme2)(widget,&widget->allocation); - } - else { - DebOut(" no expose_event defined in widget class\n"); - } - - if(widget->class->expose_event) { - callme=widget->class->expose_event; - DebOut(" calling widget->class->expose_event: %lx\n",callme); - event=g_new0(GdkEventExpose,1); - event->count=0; - ret=(*callme)(widget,event); - g_free(event); - DebOut(" ret=%d\n",ret); - } - else { - DebOut(" no expose_event defined in widget class\n"); - } - } - else { - DebOut(" no widget class for this widget\n"); - } - - return(0); -} - -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg, FALSE); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - case MUIM_AskMinMax : return mAskMinMax (data, obj, (APTR)msg, cl); - case MUIM_Draw : return mDraw (cl, data, obj, (APTR)msg); -#if 0 - case OM_REMMEMBER : mRemMember (data, (APTR)msg); break; - case MM_Custom_Attach: return mAttach (data, obj, (APTR)msg); -#endif - } - -ENDMTABLE - -int mgtk_create_custom_class(void) { - CL_Custom = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - return CL_Custom ? 1 : 0; -} - -void mgtk_delete_custom_class(void) { - if (CL_Custom) { - MUI_DeleteCustomClass(CL_Custom); - } -} diff --git a/mui/gtk-mui/classes/entry.c b/mui/gtk-mui/classes/entry.c deleted file mode 100644 index b2f6838eb..000000000 --- a/mui/gtk-mui/classes/entry.c +++ /dev/null @@ -1,216 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; -}; - -/******************************************* - * MUIHook_entry - *******************************************/ -HOOKPROTO(MUIHook_entry, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_entry(%x) called\n", (int) obj); - widget=mgtk_get_widget_from_obj(obj); - - g_signal_emit_by_name(widget,"activate",0); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_entry, MUIHook_entry); - -/******************************************* - * MUIHook_entry2 - *******************************************/ -/* -HOOKPROTO(MUIHook_entry2, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_entry2(%x) called\n", (int) obj); - widget=mgtk_get_widget_from_obj(obj); - - g_signal_emit_by_name(widget,"changed",0); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_entry2, MUIHook_entry2); -*/ - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - GtkWidget *widget; - struct TagItem *tstate, *tag; - - DebOut("mNew (entry)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("entry: unable to create object!"); - return (ULONG) NULL; - } - - set(obj,MUIA_Frame, MUIV_Frame_String); - set(obj,MUIA_CycleChain, 1); - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) { - switch (tag->ti_Tag) { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/entry.c: mNew: MA_Widget not supplied!\n"); - return (ULONG) NULL; - } - - DebOut(" widget=%lx\n",widget); - - /* setup internal hooks */ - DoMethod(obj,MUIM_Notify,MUIA_String_Acknowledge,MUIV_EveryTime, obj,2,MUIM_CallHook,&MyMuiHook_entry); - /* - DoMethod(obj,MUIM_Notify,MUIA_String_Contents,MUIV_EveryTime, obj,2,MUIM_CallHook,&MyMuiHook_entry2); - */ - - if (obj) { - GETDATA; - - data->widget=widget; - } - - return (ULONG)obj; -} - -/******************************************* - * mSet - * - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); -#if 0 - struct TagItem *tstate, *tag; - GtkWidget *widget; - - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - } - } -#endif -} - -/******************************************* - * mGet - * - * MA_Widget: GtkWidget - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) -{ - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); -/* case MUIM_Draw : return(mDraw (cl,obj,(APTR)msg));*/ - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_entry_class(void) -{ - DebOut("mgtk_create_entry_class()\n"); - - CL_Entry = MUI_CreateCustomClass(NULL, MUIC_String, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_Entry=%lx\n",CL_Entry); - - return CL_Entry ? 1 : 0; -} - -void mgtk_delete_entry_class(void) -{ - if (CL_Entry) - { - MUI_DeleteCustomClass(CL_Entry); - } -} diff --git a/mui/gtk-mui/classes/fixed.c b/mui/gtk-mui/classes/fixed.c deleted file mode 100644 index da4d722fd..000000000 --- a/mui/gtk-mui/classes/fixed.c +++ /dev/null @@ -1,314 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -/* fixed class - * - * heavily based on itix's table class - */ - -#include -#include -#include -#include - -#include "classes.h" -#include "gtk_globals.h" -#include "gtk.h" -#include "debug.h" - -/*********************************************************************/ - -struct Data { - GtkWidget *widget; - struct Hook LayoutHook; - struct MinList ChildList; -}; - -struct FixedNode { - struct MinNode node; - GtkWidget *widget; - int x; - int y; -}; - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg, ULONG is_new); - -#ifndef __AROS__ -HOOKPROTO(LayoutHook, ULONG, APTR obj, struct MUI_LayoutMsg *lm) -{ -#else -AROS_UFH3(static ULONG, LayoutHook, AROS_UFHA(struct Hook *, hook, a0), AROS_UFHA(APTR, obj, a2), AROS_UFHA(struct MUI_LayoutMsg *, lm, a1)) -#endif - switch (lm->lm_Type) { - - case MUILM_MINMAX: { - - struct Data *data = hook->h_Data; - struct FixedNode *node; - ULONG mincw, minch, defcw, defch, maxcw, maxch; - - mincw = 0; - minch = 0; - defcw = 0; //data->horizspacing; - defch = 0; //data->vertspacing; - maxcw = 0; - maxch = 0; - - /* find minimum/maximum width and height needed */ - ForeachNode(&data->ChildList, node) { - - ULONG w, h; - - w = _minwidth(node->widget->MuiObject); - h = _minheight(node->widget->MuiObject); - - if(w + node->x > mincw) { - mincw=w + node->x; - } - if(h + node->y > minch) { - minch=h + node->y; - } - - // calculate default cell width/height - - w = _defwidth(node->widget->MuiObject); - h = _defheight(node->widget->MuiObject); - - if(w + node->x > defcw) { - defcw=w + node->x; - } - if(h + node->y > defcw) { - defch=h + node->y; - } - - // calculate max cell width/height - - w = _maxwidth(node->widget->MuiObject); - h = _maxheight(node->widget->MuiObject); - - if(w + node->x > maxcw) { - maxcw=w + node->x; - } - if(h + node->y > defcw) { - maxch=h + node->y; - } - } - lm->lm_MinMax.MinWidth = mincw; - lm->lm_MinMax.MinHeight = minch; - lm->lm_MinMax.DefWidth = defcw; - lm->lm_MinMax.DefHeight = defch; - lm->lm_MinMax.MaxWidth = maxcw; - lm->lm_MinMax.MaxHeight = maxch; - /* - DebOut(" mincw=%d\n",mincw); - DebOut(" minch=%d\n",minch); - DebOut(" maxcw=%d\n",maxcw); - DebOut(" maxcw=%d\n",maxcw); - */ - } - return 0; - - case MUILM_LAYOUT: { - struct Data *data = hook->h_Data; - - struct FixedNode *node; - - ForeachNode(&data->ChildList, node) { - if (!MUI_Layout(node->widget->MuiObject, - node->x, - node->y, - _minwidth(node->widget->MuiObject), - _minheight(node->widget->MuiObject), - 0)) { - return FALSE; - } - } - } - return TRUE; - } - - return MUILM_UNKNOWN; -} - -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - - GtkWidget *widget; - struct TagItem *tstate, *tag; - - DebOut("mNew(fixed)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if (!obj) { - ErrOut("fixed: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - - tstate=((struct opSet *)msg)->ops_AttrList; - widget=NULL; - - while ((tag = (struct TagItem *) NextTagItem((APTR) &tstate))) { - switch (tag->ti_Tag) { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/fixed.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - data->widget=widget; - - SETUPHOOK(&data->LayoutHook, LayoutHook, data); - MGTK_NEWLIST(data->ChildList); - - set(obj, MUIA_Group_LayoutHook, &data->LayoutHook); - mSet(data, obj, (APTR)msg, TRUE); - } - - return (ULONG)obj; -} - -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) -{ - ULONG rc; - - switch (msg->opg_AttrID) - { - case MA_Widget: - rc = (ULONG) data->widget; - break; - - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - - return TRUE; -} - -void fixed_move(struct Data *data,APTR obj,struct MA_Fixed_Move_Data *movedata) { - - struct FixedNode *node; - struct FixedNode *mynode; - - DebOut("fixed_move(%lx,%lx,%lx)\n",data,obj,movedata); - DebOut(" x=%d\n",movedata->x); - DebOut(" y=%d\n",movedata->y); - - /* check, if we already have placed this object before */ - mynode=NULL; - ForeachNode(&data->ChildList, node) { - if(node->widget == movedata->widget) { - mynode=node; - } - } - if(!mynode) { - mynode = mgtk_allocmem(sizeof(*node), MEMF_ANY); - ADDTAIL(&data->ChildList, mynode); - mynode->widget=movedata->widget; - } - - /* now we have our node in mynode */ - mynode->x=movedata->x; - mynode->y=movedata->y; - - /* relayout */ - DoMethod(obj, MUIM_Group_InitChange); - DoMethod(obj, MUIM_Group_ExitChange); - - /* relayout parent (our size might have changed) */ - if(_parent(obj)) { - DoMethod(_parent(obj), MUIM_Group_InitChange); - DoMethod(_parent(obj), MUIM_Group_ExitChange); - } -} - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg, ULONG is_new) -{ - struct TagItem *tstate, *tag; - - tstate = msg->ops_AttrList; - - while ((tag = NextTagItem(&tstate))) { - - switch (tag->ti_Tag) { - case MA_Fixed_Move: - fixed_move(data,obj,(struct MA_Fixed_Move_Data *)tag->ti_Data); - break; - } - } -} - -static VOID mRemMember(struct Data *data, struct opMember *msg) { - struct FixedNode *node; - - ForeachNode(&data->ChildList, node) { - if (node->widget->MuiObject == msg->opam_Object) - { - REMOVE(node); - mgtk_freemem(node, sizeof(*node)); - return; - } - } -} - -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg, FALSE); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - case OM_REMMEMBER : mRemMember (data, (APTR)msg); break; - } - -ENDMTABLE - -int mgtk_create_fixed_class(void) { - - CL_Fixed = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - return CL_Fixed ? 1 : 0; -} - -void mgtk_delete_fixed_class(void) { - - if (CL_Fixed) { - MUI_DeleteCustomClass(CL_Fixed); - } -} diff --git a/mui/gtk-mui/classes/menu.c b/mui/gtk-mui/classes/menu.c deleted file mode 100644 index e49a1ec49..000000000 --- a/mui/gtk-mui/classes/menu.c +++ /dev/null @@ -1,194 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; -}; - - -/******************************************* - * MUIHook_menu - *******************************************/ -HOOKPROTO(MUIHook_menu, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_menu(%x) called\n", (int) obj); - widget=mgtk_get_widget_from_obj(obj); - - g_signal_emit_by_name(widget,"activate",0); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_menu, MUIHook_menu); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) -{ - GtkWidget *widget; - struct TagItem *tstate, *tag; - - DebOut("mNew (menu)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("menu: unable to create object!"); - return (ULONG) NULL; - } - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/menu.c: mNew: MA_Widget not supplied!\n"); - return (ULONG) NULL; - } - - DebOut(" widget=%d\n",widget); - - /* setup internal hooks */ - DoMethod(obj,MUIM_Notify,MUIA_Menuitem_Trigger,MUIV_EveryTime, obj,2,MUIM_CallHook,&MyMuiHook_menu); - - if (obj) - { - GETDATA; - - data->widget=widget; - } - - return (ULONG)obj; -} - -/******************************************* - * mSet - * - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); -#if 0 - struct TagItem *tstate, *tag; - GtkWidget *widget; - - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - } - } -#endif -} - -/******************************************* - * mGet - * - * MA_Widget: GtkWidget - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) -{ - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_menu_class(void) -{ - DebOut("mgtk_create_menu_class()\n"); - - CL_Menu = MUI_CreateCustomClass(NULL, MUIC_Menuitem, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_Menu=%lx\n",CL_Menu); - - return CL_Menu ? 1 : 0; -} - -void mgtk_delete_menu_class(void) -{ - if (CL_Menu) - { - MUI_DeleteCustomClass(CL_Menu); - } -} diff --git a/mui/gtk-mui/classes/notebook.c b/mui/gtk-mui/classes/notebook.c deleted file mode 100644 index c17b31473..000000000 --- a/mui/gtk-mui/classes/notebook.c +++ /dev/null @@ -1,365 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; - Object *registergroup; - Object **mychild; - char **mylabel; - unsigned int nrchilds; -}; - -static Object *mgtk_note_new(Object **child,char **label) { - Object *reg; - int i; - - DebOut("mgtk_note_new(%lx,%lx)\n",child,label); - - reg=RegisterGroup(label), - MUIA_Register_Frame, TRUE, - End; - - i=0; - while(label[i]) { - DoMethod(reg,OM_ADDMEMBER,child[i]); - i++; - } - - return reg; -} - -static void mgtk_note_add_child(Object *obj,struct Data *data,GtkWidget *newchild, int prepend) { - struct List *list; - struct Node *state; - Object *reg; - Object *o; - Object **childs; - char **labels; - int i; - - DebOut("mgtk_add_child(%lx,%lx,%d)\n",obj,newchild,prepend); - - reg=data->registergroup; - - DoMethod(obj,MUIM_Group_InitChange); - - if(!data->nrchilds) { - /* this is the first child, so remove dummy child */ - list=(struct List *) xget(reg,MUIA_Group_ChildList); - state = list->lh_Head; - o = NextObject( &state ); - DoMethod(reg,OM_REMMEMBER,o); - MUI_DisposeObject(o); - g_free(data->mylabel[0]); - DebOut(" removed dummy object\n"); - } - - childs=g_new(Object *,(data->nrchilds)+2); - labels=g_new(char *,(data->nrchilds)+2); - - /* copy old content, and remove children from old register */ - DebOut(" copy old content and remove children\n"); - i=prepend; - - while(inrchilds) { - DebOut(" %d: %lx,%s\n",i,data->mychild[i],data->mylabel[i-prepend]); - childs[i]=data->mychild[i-prepend]; - DoMethod(reg,OM_REMMEMBER,data->mychild[i-prepend]); - labels[i]=data->mylabel[i-prepend]; - i++; - } - DebOut(" add new child\n"); - DebOut(" newchild->MuiObject=%lx\n",newchild->MuiObject); - DebOut(" newchild->title=>%s<\n",newchild->title); - -#warning g_strdup(2+newchild->title) .. why +2 ?? - - if(!prepend) { - childs[i]=newchild->MuiObject; - if(newchild->title) { - /* ??? TODO : labels[i]=g_strdup(2+newchild->title);*/ - labels[i]=g_strdup(2+newchild->title); - } - else { - labels[i]=g_strdup_printf("page %d",i+1); - } - } - else { - childs[0]=newchild->MuiObject; - if(newchild->title) { - /* ??? TODO : labels[0]=g_strdup(2+newchild->title);*/ - labels[0]=g_strdup(2+newchild->title); - } - else { - labels[0]=g_strdup_printf("page 0"); - } - } - - i++; - childs[i]=NULL; - labels[i]=NULL; - - /* now we have everything, - * so get rid of the old (now empty) register - */ - - DoMethod(obj,OM_REMMEMBER,reg); - MUI_DisposeObject(reg); - g_free(data->mychild); - g_free(data->mylabel); - - /* create and add new reg */ - reg=mgtk_note_new(childs,labels); - DoMethod(obj,OM_ADDMEMBER,reg); - - data->nrchilds++; - - data->mychild=childs; - data->mylabel=labels; - - DoMethod(obj,MUIM_Group_ExitChange); -} - -static void mgtk_append_child(Object *obj,struct Data *data,GtkWidget *newchild) { - mgtk_note_add_child(obj,data,newchild, FALSE); -} - -static void mgtk_prepend_child(Object *obj,struct Data *data,GtkWidget *newchild) { - mgtk_note_add_child(obj,data,newchild, TRUE); -} - -/******************************************* - * MUIHook_notebook - *******************************************/ -HOOKPROTO(MUIHook_notebook, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_notebook(%x) called\n", (int) obj); - widget=mgtk_get_widget_from_obj(obj); - -/*TODO - mgtk_notebook_value_update(widget); - */ - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_notebook, MUIHook_notebook); - -/******************************************* - * mNew - * - * requires MA_Widget! - * we create a empty Notebook, as MUI does - * not like empty Registers, we fill it - * with a dummy. - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) -{ - GtkWidget *widget; - struct TagItem *tstate, *tag; - Object *registergroup; - Object **childs; - char **labels; - - DebOut("mNew (notebook)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("notebook: unable to create object!"); - return (ULONG) NULL; - } - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - while ((tag = (struct TagItem *) NextTagItem((APTR) &tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/spinbutton.c: mNew: MA_Widget not supplied!\n"); - return (ULONG) NULL; - } - - DebOut(" widget=%d\n",widget); - - /* setup internal hooks */ -/* TODO DoMethod(text,MUIM_Notify,MUIA_String_Acknowledge,MUIV_EveryTime, text,2,MUIM_CallHook,&MyMuiHook_spinbutton);*/ - - childs=g_new(Object *,2); - labels=g_new(char *,2); - -#ifdef MGTK_DEBUG - childs[0]=TextObject,MUIA_Text_Contents,"DUMMY OBJECT",End; - labels[0]=g_strdup("DUMMY LABEL"); -#else - childs[0]=TextObject,MUIA_Text_Contents,"",End; - labels[0]=g_strdup(""); -#endif - - childs[1]=NULL; - labels[1]=NULL; - - registergroup=mgtk_note_new(childs,labels); - - DoMethod(obj,OM_ADDMEMBER,registergroup); - - if (obj) - { - GETDATA; - - data->widget=widget; - data->registergroup=registergroup; - data->mylabel=labels; - data->mychild=childs; - data->nrchilds=0; - } - - return (ULONG)obj; -} - -/******************************************* - * mSet - * - * MA_Spin_Value only usefull TAG here - * MA_Spin_String_Value *private* - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - struct TagItem *tstate, *tag; - - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); - - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Note_Append_Child: - /* data needs to be a widget */ - DebOut("mSet append to %lx: %lx\n",obj,tag->ti_Data); - mgtk_append_child(obj,data,(GtkWidget *) tag->ti_Data); - break; - case MA_Note_Prepend_Child: - /* data needs to be a widget */ - DebOut("mSet append to %lx: %lx\n",obj,tag->ti_Data); - mgtk_prepend_child(obj,data,(GtkWidget *) tag->ti_Data); - break; - case MUIA_Group_ActivePage: - set(data->registergroup,MUIA_Group_ActivePage,tag->ti_Data); - break; - } - - } -} - -/******************************************* - * mGet - * - * MA_Widget: GtkWidget of this spin - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) -{ - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - case MUIA_Group_ActivePage: - return xget(data->registergroup,MUIA_Group_ActivePage); - break; - default: - return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_notebook_class(void) -{ - DebOut("mgtk_create_notebook_class()\n"); - - CL_NoteBook = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_NoteBook=%lx\n",CL_NoteBook); - - return CL_NoteBook ? 1 : 0; -} - -void mgtk_delete_notebook_class(void) -{ - if (CL_NoteBook) - { - MUI_DeleteCustomClass(CL_NoteBook); - } -} diff --git a/mui/gtk-mui/classes/progressbar.c b/mui/gtk-mui/classes/progressbar.c deleted file mode 100644 index 844d6f56d..000000000 --- a/mui/gtk-mui/classes/progressbar.c +++ /dev/null @@ -1,278 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -/* This class ca be both, busy or progress bar. - * To switch use MA_Pulse: - * 1: busy mode - * 0: activity mode - * - * TODO: - * in GTK you can display the current value of a progress bar with - * the string pattern %P, in MUI it is %ld, so if you want it - * to work, you will have to do a conversion. - */ - -#include -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; - Object *progressbar; - Object *busy; - gchar *text; -}; - -/******************************************* - * MUIHook_progressbar - *******************************************/ -HOOKPROTO(MUIHook_progressbar, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_progressbar(%x) called\n", (int) obj); - widget=mgtk_get_widget_from_obj(obj); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_progressbar, MUIHook_progressbar); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) -{ - GtkWidget *widget; - Object *progressbar; - struct TagItem *tstate, *tag; - gchar *text; - - DebOut("mNew (progressbar)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("progressbar: unable to create object!"); - return (ULONG) NULL; - } - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - while ((tag = (struct TagItem *) NextTagItem((APTR) &tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/progressbar.c: mNew: MA_Widget not supplied!\n"); - return (ULONG) NULL; - } - - DebOut(" widget=%d\n",widget); - - text=g_strdup(""); - - progressbar=GaugeObject, - GaugeFrame, -/* MUIA_Gauge_InfoText, "%ld %%",*/ - MUIA_Gauge_InfoText, text, - MUIA_Gauge_Horiz, TRUE, - End; - - DoMethod(obj,OM_ADDMEMBER,progressbar); - - if (obj) - { - GETDATA; - - data->widget=widget; - data->progressbar=progressbar; - data->busy=NULL; - data->text=text; - } - - return (ULONG)obj; -} - -static void pulse(struct Data *data,ULONG busy) { - Object *obj; - - DebOut("pulse(%lx,%d)\n",data,busy); - - obj=data->widget->MuiObject; - - /* do we have to switch !? */ - if((!data->busy) && busy) { - /* yes, replace with busy bar */ - DoMethod(obj,MUIM_Group_InitChange); - - DoMethod(obj,OM_REMMEMBER,data->progressbar); - DisposeObject(data->progressbar); - data->progressbar=NULL; - - data->busy=BusyBar; - /* no automatic movement busy bar */ - set(data->busy,MUIA_Busy_Speed,MUIV_Busy_Speed_Off); - DoMethod(obj,OM_ADDMEMBER,data->busy); - - DoMethod(obj,MUIM_Group_ExitChange); - } - else if((!data->progressbar) && (!busy)) { - /* yes, replace with progress bar */ - DoMethod(obj,MUIM_Group_InitChange); - - DoMethod(obj,OM_REMMEMBER,data->busy); - DisposeObject(data->busy); - data->busy=NULL; - - data->progressbar=GaugeObject, - GaugeFrame, - MUIA_Gauge_InfoText, data->text, - MUIA_Gauge_Horiz, TRUE, - End; - - DoMethod(obj,OM_ADDMEMBER,data->progressbar); - - DoMethod(obj,MUIM_Group_ExitChange); - return; - } - - if(data->busy) { - /* we got a pulse, so move it! */ - DoMethod(data->busy,MUIM_Busy_Move,TRUE); - } - -} -/******************************************* - * mSet - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - - struct TagItem *tstate, *tag; - - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) { - switch (tag->ti_Tag) { - case MA_Pulse: - pulse(data,tag->ti_Data); - break; - case MUIA_Gauge_InfoText: - if(data->progressbar) { - set(data->progressbar,MUIA_Gauge_InfoText,tag->ti_Data); - } - g_free(data->text); - data->text=g_strdup((gchar *) tag->ti_Data); - break; - } - - } -} - -/******************************************* - * mGet - * - * MA_Widget: GtkWidget of this spin - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) { - - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - case MUIA_Gauge_InfoText : - DebOut("mGet: MUIA_Gauge_InfoText=%s\n",data->text); - rc = (ULONG) data->text; - break; - default: - return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_progressbar_class(void) { - - DebOut("mgtk_create_notebook_class()\n"); - - CL_ProgressBar = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_ProgressBar=%lx\n",CL_ProgressBar); - - return CL_ProgressBar ? 1 : 0; -} - -void mgtk_delete_progressbar_class(void) { - - if (CL_ProgressBar) { - MUI_DeleteCustomClass(CL_ProgressBar); - } -} diff --git a/mui/gtk-mui/classes/radiobutton.c b/mui/gtk-mui/classes/radiobutton.c deleted file mode 100644 index 108a7198f..000000000 --- a/mui/gtk-mui/classes/radiobutton.c +++ /dev/null @@ -1,280 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; - Object *box; - Object *radio; -}; - -void mgtk_radio_widget_update(GtkWidget *widget) { - - GtkWidget *act; - GSList *next; - - DebOut("mgtk_radio_widget_update(%lx)\n",widget); - - if(!widget->active) { - next=gtk_radio_button_get_group(widget); - DebOut(" group length: %ld\n",g_slist_length(next)); - - while(next!=NULL) { - act=next->data; - /* clear the previous active object */ - if(act->active) { - nnset(act->MuiObject,MUIA_Selected,0); - act->active=0; - } - next=g_slist_next(next); - } - /* make our object the active one */ - widget->active=1; - } - nnset(widget->MuiObject,MUIA_Selected,1); - - DebOut(" emit newstyle toggled signal\n"); - g_signal_emit(widget,g_signal_lookup("toggled",0),0); -} - -/******************************************* - * MUIHook_radiobutton - * - * clear/set all other widget objects in - * our group and emit the right signal(s) - *******************************************/ -HOOKPROTO(MUIHook_radio, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *active; - - DebOut("MUIHook_radio called(%lx)\n",obj); - active=mgtk_get_widget_from_obj(obj); - DebOut(" widget=%x\n",(int) active); - - mgtk_radio_widget_update(active); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_radio, MUIHook_radio); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - Object *box; - Object *radio; - Object *space; - Object *labelobj; - GtkWidget *widget; - const char *label; - struct TagItem *tstate, *tag; - - DebOut("mNew (radiobutton)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("radiobutton: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - label=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - case MA_Radio_Label: - label = (const char *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/radiobutton.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - DebOut(" widget=%lx\n",widget); - - box=HGroup, - End; - - radio=ImageObject, - NoFrame, - MUIA_CycleChain , 1, - MUIA_InputMode , MUIV_InputMode_Toggle, - MUIA_Image_Spec , MUII_RadioButton, - MUIA_ShowSelState , FALSE, - End; - - labelobj=Label1(label); - space=HSpace(0); - - - DoMethod(box,OM_ADDMEMBER,radio); - DoMethod(box,OM_ADDMEMBER,labelobj); - DoMethod(box,OM_ADDMEMBER,space); - DoMethod(obj,OM_ADDMEMBER,box); - - data->box=box; - data->radio=radio; - data->widget=widget; - - /* setup internal hooks */ - DoMethod(radio,MUIM_Notify,MUIA_Selected,MUIV_EveryTime, radio,2,MUIM_CallHook,&MyMuiHook_radio); - } - - return (ULONG)obj; -} - -/******************************************* - * mSet - * - * MA_Toggle_Value only usefull TAG here - * MA_Radio_String_Value *private* - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - struct TagItem *tstate, *tag; - GtkWidget *widget; - - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); - - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Toggle_Value: - DebOut("mSet(%lx) to %d\n",obj,tag->ti_Data); - widget=mgtk_get_widget_from_obj(obj); - if(!widget) { - ErrOut("classes/radiobutton.c: mgtk_get_widget_from_obj return NULL !?\n"); - } - else { - if(tag->ti_Data) { /* radio can only be set to TRUE */ - mgtk_radio_widget_update(widget); -// mgtk_radio_value_update0(widget,data,(int)tag->ti_Data); - } - else { - DebOut("WARNING: MA_Toggle_Value=0 for a radio widget !? (ignored)\n"); - } - } - break; - } - } -} - -/******************************************* - * mGet - * - * MA_Toggle_Value: value as string - * MA_Widget: GtkWidget of this radio - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) { - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - case MA_Toggle_Value : - rc=xget(data->radio, MUIA_Selected); - DebOut("mGet: MA_Toggle_Value =%d\n", rc); - break; - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_radiobutton_class(void) -{ - DebOut("mgtk_create_radiobutton_class()\n"); - - CL_RadioButton = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_RadioButton=%lx\n",CL_RadioButton); - - return CL_RadioButton ? 1 : 0; -} - -void mgtk_delete_radiobutton_class(void) -{ - if (CL_RadioButton) - { - MUI_DeleteCustomClass(CL_RadioButton); - } -} diff --git a/mui/gtk-mui/classes/rootgroup.c b/mui/gtk-mui/classes/rootgroup.c deleted file mode 100644 index 5ccb34184..000000000 --- a/mui/gtk-mui/classes/rootgroup.c +++ /dev/null @@ -1,224 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk_globals.h" - -struct Data -{ - LONG is_resizable; - LONG defwidth, defheight; -}; - -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) -{ - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if (obj) - { - GETDATA; - - data->defwidth = -1; - data->defheight = -1; - data->is_resizable = -1; - } - - return (ULONG)obj; -} - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) -{ - struct TagItem *tstate, *tag; - ULONG relayout = 0; - - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); - - tstate = msg->ops_AttrList; - - while ((tag = NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_RootGroup_Resizable: - if (!(data->is_resizable & tag->ti_Data)) - { - relayout = 1; - data->is_resizable = tag->ti_Data; - } - break; - - case MA_DefWidth: - if (data->defwidth != tag->ti_Data) - { - relayout = 1; - data->defwidth = tag->ti_Data; - } - break; - - case MA_DefHeight: - if (data->defheight != tag->ti_Data) - { - relayout = 1; - data->defheight = tag->ti_Data; - } - break; - } - } - - if (relayout) - { - DoMethod(obj, MUIM_Group_InitChange); - DoMethod(obj, MUIM_Group_ExitChange); - } -} - -static ULONG mAskMinMax(struct Data *data, APTR obj, struct MUIP_AskMinMax *msg, struct IClass *cl) -{ - DebOut("mAskMinMax(%lx,%lx,%lx,%lx)\n",data,obj,msg,cl); - - DoSuperMethodA(cl, obj, msg); - - if (!data->is_resizable || data->defwidth >=0 || data->defheight >= 0) - { - struct MUI_MinMax *mm = msg->MinMaxInfo; - struct Window *window = _window(obj); - LONG defwidth, defheight; - LONG bl,br,bt,bb; - - /* during window_show, _window(obj) is NULL, - on AROS accessing window->BorderLeft crashes - with a core dump - */ - DebOut(" window: %lx\n",window); - - if(window) { - bl=window->BorderLeft; - br=window->BorderRight; - bt=window->BorderTop; - bb=window->BorderBottom; - } - else { - /* ? */ - bl=0; - br=0; - bt=0; - bb=0; - } - - if (data->defwidth < 0) { - defwidth = mm->DefWidth; - } - else if (data->defwidth == 0) { - defwidth = mm->MinWidth; - } - else { - defwidth = data->defwidth - bl - br; - - if (defwidth < mm->MinWidth) { - defwidth = mm->MinWidth; - } - else if (defwidth > mm->MaxWidth) { - defwidth = mm->MaxWidth; - } - } - - if (data->defheight < 0) - defheight = mm->DefHeight; - else if (data->defheight == 0) - defheight = mm->MinHeight; - else - { - defheight = data->defheight - bt - bb; - - if (defheight < mm->MinHeight) - defheight = mm->MinHeight; - else if (defheight > mm->MaxHeight) - defheight = mm->MaxHeight; - } - - if (!data->is_resizable) - { - mm->MinWidth = mm->DefWidth = mm->MaxWidth = defwidth; - mm->MinHeight = mm->DefHeight = mm->MaxHeight = defheight; - } - else - { - mm->DefWidth = defwidth; - mm->DefHeight = defheight; - } - } - - return 0; -} - -static ULONG mSetup(struct IClass *cl, APTR obj, Msg msg) -{ - ULONG rc = DoSuperMethodA(cl, obj, msg); - - if (rc) - { - mgtk_update_default_style(obj); - } - - return rc; -} - -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case MUIM_AskMinMax : return mAskMinMax (data, obj, (APTR)msg, cl); - case MUIM_Setup : return mSetup (cl, obj, (APTR)msg); - } - -ENDMTABLE - -int mgtk_create_rootgroup_class(void) -{ - CL_RootGroup = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - return CL_RootGroup ? 1 : 0; -} - -void mgtk_delete_rootgroup_class(void) -{ - if (CL_RootGroup) - { - MUI_DeleteCustomClass(CL_RootGroup); - } -} diff --git a/mui/gtk-mui/classes/spinbutton.c b/mui/gtk-mui/classes/spinbutton.c deleted file mode 100644 index 4987efb1c..000000000 --- a/mui/gtk-mui/classes/spinbutton.c +++ /dev/null @@ -1,375 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk_globals.h" - -struct Data -{ - GtkWidget *widget; - Object *text; - Object *up; - Object *down; -}; - -/******************************************* - * mgtk_spin_value_update(GtkWidget *widget) - * - * update shown text to widget->value - *******************************************/ - /*internal */ -static void mgtk_spin_value_update0(GtkWidget *widget, gdouble f) { - char format[]="%%4.%xxf"; - const char *text; - gdouble old; - - DebOut("mgtk_spin_value_update0(%x,..)\n",widget); - - old=widget->value; - - /* care for boundaries */ - if(f < widget->lower) { - if(widget->wrap) { - f=widget->upper; - } - else { - f=widget->lower; - } - } - else if(f > widget->upper) { - if(widget->wrap) { - f=widget->lower; - } - else { - f=widget->upper; - } - } - - /* new value */ - widget->value=f; - - sprintf(format,"%%4.%df",widget->decimalplaces); - text=g_strdup_printf(format,widget->value); - - set(widget->MuiObject,MA_Spin_String_Value,text); - - if(widget->value != old) { - g_signal_emit(widget,g_signal_lookup("value_changed",0),0); - } - g_free((APTR) text); -} - -static void mgtk_spin_value_update(GtkWidget *widget) { - const char *text; - gdouble f; - - DebOut("mgtk_spin_value_update(%x)\n",(int) widget); - - text=(const char *) xget(widget->MuiObject,MA_Spin_Value); - DebOut(" New value: %s\n",text); - f=atof(text); - - /* DebOut seems to be unable to print %f ..? - DebOut("===>Float: %2.2f<====\n",f); - */ - - if(widget->value != f) { - mgtk_spin_value_update0(widget,f); - } -} - -/******************************************* - * MUIHook_spinbutton - *******************************************/ -HOOKPROTO(MUIHook_spinbutton, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_spinbutton(%x) called\n", (int) obj); - widget=mgtk_get_widget_from_obj(obj); - - g_signal_emit(widget,g_signal_lookup("activate",0),0); - - mgtk_spin_value_update(widget); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_spinbutton, MUIHook_spinbutton); - -/******************************************* - * up arrow - *******************************************/ -HOOKPROTO(MUIHook_up, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_up called\n"); - widget=mgtk_get_widget_from_obj(obj); - DebOut(" widget=%x\n",(int) widget); - - mgtk_spin_value_update0(widget,widget->value + widget->step_increment); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_up, MUIHook_up); - -/******************************************* - * down arrow - *******************************************/ -HOOKPROTO(MUIHook_down, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *widget; - - DebOut("MUIHook_down called\n"); - widget=mgtk_get_widget_from_obj(obj); - DebOut(" widget=%x\n",(int) widget); - - mgtk_spin_value_update0(widget,widget->value - widget->step_increment); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_down, MUIHook_down); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) -{ - Object *text; - Object *updown; - Object *up; - Object *down; - Object *hgroup; - GtkWidget *widget; - struct TagItem *tstate, *tag; - - DebOut("mNew (spinbutton)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("spinbutton: unable to create object!"); - return (ULONG) NULL; - } - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/spinbutton.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - DebOut(" widget=%d\n",widget); - - hgroup=HGroup, - MUIA_Group_HorizSpacing, 0, - End; - - text=StringObject, - StringFrame, - MUIA_CycleChain, 1, - MUIA_String_MaxLen, 256, - MUIA_String_Contents, "", - MUIA_String_Accept, "0123456789.", - End; - - updown=VGroup, - MUIA_Group_VertSpacing, 0, - Child, - up=ImageObject, - ImageButtonFrame, - MUIA_CycleChain, 1, - MUIA_InputMode,MUIV_InputMode_RelVerify, - MUIA_Image_Spec, MUII_ArrowUp, - /* itix ..? */ -/* MUIA_FixHeight, 4, - MUIA_Image_FreeVert, TRUE, - MUIA_Image_FreeHoriz, TRUE,*/ - MUIA_Background , MUII_ImageButtonBack, - End, - Child, - down=ImageObject, - ImageButtonFrame, - MUIA_CycleChain, 1, - MUIA_InputMode,MUIV_InputMode_RelVerify, - MUIA_Image_Spec, MUII_ArrowDown, - MUIA_Background , MUII_ImageButtonBack, - End, - End; - - DoMethod(obj,OM_ADDMEMBER,hgroup); - DoMethod(hgroup,OM_ADDMEMBER,text); - DoMethod(hgroup,OM_ADDMEMBER,updown); - - /* setup internal hooks */ - DoMethod(text,MUIM_Notify,MUIA_String_Acknowledge,MUIV_EveryTime, text,2,MUIM_CallHook,&MyMuiHook_spinbutton); - DoMethod(up,MUIM_Notify,MUIA_Pressed,FALSE, up,2,MUIM_CallHook,&MyMuiHook_up,1); - DoMethod(down,MUIM_Notify,MUIA_Pressed,FALSE, down,2,MUIM_CallHook,&MyMuiHook_down); - - if (obj) - { - GETDATA; - - data->text=text; - data->up=up; - data->down=down; - data->widget=widget; - } - - return (ULONG)obj; -} - -/******************************************* - * mNew - * - * MA_Spin_Value only usefull TAG here - * MA_Spin_String_Value *private* - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - struct TagItem *tstate, *tag; - GtkWidget *widget; - - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); - - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Spin_Value: - DebOut("mSet(%lx) to %s\n",obj,tag->ti_Data); - widget=mgtk_get_widget_from_obj(obj); - mgtk_spin_value_update0(widget,atof((const char *)tag->ti_Data)); - break; - case MA_Spin_String_Value: - DebOut("mSet string (%lx) to %s\n",obj,tag->ti_Data); - set(data->text,MUIA_String_Contents,(LONG) tag->ti_Data); - break; - case MUIA_String_Accept: - set(data->text,MUIA_String_Accept,(LONG) tag->ti_Data); - break; - } - } -} - -/******************************************* - * mGet - * - * MA_Spin_Value: value as string - * MA_Widget: GtkWidget of this spin - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) -{ - ULONG rc; - const char *text; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - case MA_Spin_Value : - DebOut("mGet: data->text obj =%x\n",(int) data->text); - get(data->text, MUIA_String_Contents, &text ); - DebOut("mGet: text=%s\n",text); - rc = (ULONG) text; - break; - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); -/* case MUIM_Draw : return(mDraw (cl,obj,(APTR)msg));*/ - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_spinbutton_class(void) -{ - DebOut("mgtk_create_spinbutton_class()\n"); - - CL_SpinButton = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_SpinButton=%lx\n",CL_SpinButton); - - return CL_SpinButton ? 1 : 0; -} - -void mgtk_delete_spinbutton_class(void) -{ - if (CL_SpinButton) - { - MUI_DeleteCustomClass(CL_SpinButton); - } -} diff --git a/mui/gtk-mui/classes/table.c b/mui/gtk-mui/classes/table.c deleted file mode 100644 index 988457299..000000000 --- a/mui/gtk-mui/classes/table.c +++ /dev/null @@ -1,399 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -/* table class -** -** emulates table widget in gtk -** -** supports: -** -** gtk_table_attach() (no options, no padding) -** gtk_table_attach_defaults() -** gtk_table_set_row_spacings() -** gtk_table_set_col_spacings() -** gtk_table_get_default_col_spacing() -** gtk_table_get_default_row_spacing() -** -** todo: -** -** gtk_table_set_homogeneous() -** gtk_table_get_col_spacing() -** gtk_table_get_row_spacing() -** -** in short, cells are homogenous -** -*/ - -#include -#include -#include -#include - -#include "classes.h" -#include "gtk_globals.h" -#include "gtk.h" -#include "debug.h" - -/*********************************************************************/ - -struct Data -{ - struct Hook LayoutHook; - struct MinList ChildList; - - ULONG columns, rows, vertspacing, horizspacing; - LONG defwidth, defheight; -}; - -struct TableNode -{ - struct MinNode node; - GtkWidget *widget; - UWORD left, right, top, bottom; -}; - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg, ULONG is_new); - -#ifndef __AROS__ -HOOKPROTO(LayoutHook, ULONG, APTR obj, struct MUI_LayoutMsg *lm) -{ -#else -AROS_UFH3(static ULONG, LayoutHook, AROS_UFHA(struct Hook *, hook, a0), AROS_UFHA(APTR, obj, a2), AROS_UFHA(struct MUI_LayoutMsg *, lm, a1)) -#endif - switch (lm->lm_Type) - { - case MUILM_MINMAX: - { - struct Data *data = hook->h_Data; - struct TableNode *node; - ULONG mincw, minch, defcw, defch, maxcw, maxch; - - mincw = 0; - minch = 0; - defcw = data->horizspacing; - defch = data->vertspacing; - maxcw = 0; - maxch = 0; - - ForeachNode(&data->ChildList, node) - { - ULONG w, h, cols, rows; - - w = _minwidth(node->widget->MuiObject); - h = _minheight(node->widget->MuiObject); - - cols = node->right - node->left; - rows = node->bottom - node->top; - - if (cols) - { - ULONG s = w / cols; - - if (s > mincw) - { - mincw = s + (s % cols ? 1 : 0); - } - } - - if (rows) - { - ULONG s = h / rows; - - if (s > minch) - { - minch = s + (s % rows ? 1 : 0); - } - } - - // calculate default cell width/height - - w = _defwidth(node->widget->MuiObject); - h = _defheight(node->widget->MuiObject); - - if (cols) - { - ULONG s = w / cols; - - if (s > defcw) - { - defcw = s + (s % cols ? 1 : 0); - } - } - - if (rows) - { - ULONG s = h / rows; - - if (s > defch) - { - defch = s + (s % rows ? 1 : 0); - } - } - - // calculate max cell width/height - - w = _maxwidth(node->widget->MuiObject); - h = _maxheight(node->widget->MuiObject); - - if (cols) - { - ULONG s = w / cols; - - if (s > maxcw) - { - maxcw = s + (s % cols ? 1 : 0); - } - } - - if (rows) - { - ULONG s = h / rows; - - if (s > maxch) - { - maxch = s + (s % rows ? 1 : 0); - } - } - } - - lm->lm_MinMax.MinWidth = mincw * data->columns; - lm->lm_MinMax.MinHeight = minch * data->rows; - lm->lm_MinMax.DefWidth = defcw * data->columns; - lm->lm_MinMax.DefHeight = defch * data->rows; - lm->lm_MinMax.MaxWidth = maxcw * data->columns; - lm->lm_MinMax.MaxHeight = maxch * data->rows; - } - return 0; - - case MUILM_LAYOUT: - { - struct Data *data = hook->h_Data; - - if (data->columns && data->rows) - { - struct TableNode *node; - ULONG cw, ch; - - cw = lm->lm_Layout.Width / data->columns; - ch = lm->lm_Layout.Height / data->rows; /* +1 ? */ - - ForeachNode(&data->ChildList, node) - { - if (!MUI_Layout(node->widget->MuiObject, - node->left * cw, - node->top * ch , - (node->right - node->left) * cw, - (node->bottom - node->top ) * ch, - 0)) - { - return FALSE; - } - } - } - } - return TRUE; - } - - return MUILM_UNKNOWN; -} - -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) -{ - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if (obj) - { - GETDATA; - - SETUPHOOK(&data->LayoutHook, LayoutHook, data); -//afxgroup - Is this a typo? (&data->ChildList) - MGTK_NEWLIST(data->ChildList); - - data->vertspacing = 0; - data->horizspacing = 0; - data->defwidth = -1; - data->defheight = -1; - - set(obj, MUIA_Group_LayoutHook, &data->LayoutHook); - mSet(data, obj, (APTR)msg, TRUE); - } - - return (ULONG)obj; -} - -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) -{ - ULONG rc; - - switch (msg->opg_AttrID) - { - case MA_Table_VertSpacing : rc = data->vertspacing; break; - case MA_Table_HorizSpacing: rc = data->horizspacing; break; - - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg, ULONG is_new) -{ - struct TagItem *tstate, *tag; - ULONG relayout = 0; - - tstate = msg->ops_AttrList; - - while ((tag = NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Table_Columns: - data->columns = tag->ti_Data; - break; - - case MA_Table_Rows: - data->rows = tag->ti_Data; - break; - - case MA_Table_VertSpacing: - if (data->vertspacing != tag->ti_Data) - { - data->vertspacing = tag->ti_Data; - relayout = 1; - } - break; - - case MA_Table_HorizSpacing: - if (data->horizspacing != tag->ti_Data) - { - data->horizspacing = tag->ti_Data; - relayout = 1; - } - break; - - case MA_DefWidth: - if (data->defwidth != tag->ti_Data) - { - data->defwidth = tag->ti_Data; - relayout = 1; - } - break; - - case MA_DefHeight: - if (data->defheight != tag->ti_Data) - { - data->defheight = tag->ti_Data; - relayout = 1; - } - break; - } - } - - if (relayout) - { - DoMethod(obj, MUIM_Group_InitChange); - DoMethod(obj, MUIM_Group_ExitChange); - } -} - -static VOID mRemMember(struct Data *data, struct opMember *msg) -{ - struct TableNode *node; - - ForeachNode(&data->ChildList, node) - { - if (node->widget->MuiObject == msg->opam_Object) - { - REMOVE(node); - mgtk_freemem(node, sizeof(*node)); - return; - } - } -} - -static ULONG mAttach(struct Data *data, APTR obj, struct MUIP_Table_Attach *msg) { - struct TableNode *node; -//afxgroup - msg redeclared as different kind of symbol - - DebOut("mAttach(..)\n"); - - DebOut("msg=%lx\n",msg); - - node = mgtk_allocmem(sizeof(*node), MEMF_ANY); - - if (node) - { - ADDTAIL(&data->ChildList, node); - - node->widget = msg->widget; - node->left = msg->left; - node->right = msg->right; - node->top = msg->top; - node->bottom = msg->bottom; - - DebOut(" msg->widget: %lx\n",msg->widget); - DebOut(" msg->widget->MuiObject: %lx\n",msg->widget->MuiObject); - DebOut(" obj: %lx\n",obj); - DoMethod(obj, MUIM_Group_InitChange); - DoMethod(obj, OM_ADDMEMBER, msg->widget->MuiObject); - DoMethod(obj, MUIM_Group_ExitChange); - } - - return 0; -} - -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg, FALSE); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - case OM_REMMEMBER : mRemMember (data, (APTR)msg); break; - case MM_Table_Attach: return mAttach (data, obj, (APTR)msg); - } - -ENDMTABLE - -int mgtk_create_table_class(void) -{ - CL_Table = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - return CL_Table ? 1 : 0; -} - -void mgtk_delete_table_class(void) -{ - if (CL_Table) - { - MUI_DeleteCustomClass(CL_Table); - } -} diff --git a/mui/gtk-mui/classes/timer.c b/mui/gtk-mui/classes/timer.c deleted file mode 100644 index bfa884be7..000000000 --- a/mui/gtk-mui/classes/timer.c +++ /dev/null @@ -1,172 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -struct Data { - guint32 intervall; - GSourceFunc function; - gpointer parameter; -}; - -/******************************************* - * MUIHook_timer - *******************************************/ -HOOKPROTO(MUIHook_timer, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - - DebOut("MUIHook_timer(%x) called\n", (int) obj); - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_timer, MUIHook_timer); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) -{ - guint32 intervall; - GSourceFunc function; - gpointer parameter; - - struct TagItem *tstate, *tag; - - DebOut("mNew (timer)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("timer: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - intervall=0; - function=0; - parameter=0; - while ((tag = (struct TagItem *) NextTagItem((APTR) &tstate))) - { - switch (tag->ti_Tag) - { - case MA_Timer_Intervall: - intervall = (guint32) tag->ti_Data; - break; - case MA_Timer_Data: - parameter = (gpointer) tag->ti_Data; - break; - case MA_Timer_Function: - function = (GSourceFunc) tag->ti_Data; - break; - } - } - - if(!intervall || !function) { - ErrOut("classes/timer.c: mNew: required parameter not supplied!\n"); - DebOut("ERROR: classes/timer.c: mNew: required parameter not supplied (%d,%lx)!\n",intervall,function); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - data->function=function; - data->parameter=parameter; - data->intervall=intervall; - } - - return (ULONG)obj; -} - -ULONG mTrigger(struct IClass *cl,Object *obj,Msg msg) { - void (*callme)(gpointer parameter); - GETDATA; - - DebOut("mTrigger!\n"); - - DebOut("data=%lx\n",data); - callme=(APTR) data->function; - - DebOut("calling: %lx(%lx)\n",callme,data->parameter); - - (*callme)(data->parameter); - - return(FALSE); -} - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE - - switch (msg->MethodID) - { - case OM_NEW : return(mNew (cl,obj,(APTR)msg)); - case MUIM_Class5_Trigger: return(mTrigger(cl,obj,(APTR)msg)); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_timer_class(void) -{ - DebOut("mgtk_create_timer_class()\n"); - - CL_Timer = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_Timer=%lx\n",CL_Timer); - - return CL_Timer ? 1 : 0; -} - -void mgtk_delete_timer_class(void) -{ - if (CL_Timer) - { - MUI_DeleteCustomClass(CL_Timer); - } -} diff --git a/mui/gtk-mui/classes/togglebutton.c b/mui/gtk-mui/classes/togglebutton.c deleted file mode 100644 index 0e91d76e5..000000000 --- a/mui/gtk-mui/classes/togglebutton.c +++ /dev/null @@ -1,412 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - - /* this one is quite similiar to the checkbutton class */ - -#include -#include -#include - -#include "debug.h" -#include "classes.h" -#include "gtk.h" -#include "gtk_globals.h" - -struct Data { - GtkWidget *widget; - Object *toggle; - LONG defwidth; - LONG defheight; - struct Hook LayoutHook; - int have_layout_hook; -}; - -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg); - -/****************************** - * LayoutHook - * - * Hopefully will work both with - * a set fixed size and without - * one - ******************************/ -#ifndef __AROS__ -HOOKPROTO(LayoutHook, ULONG, APTR obj, struct MUI_LayoutMsg *lm) { -#else -AROS_UFH3(static ULONG, LayoutHook, AROS_UFHA(struct Hook *, hook, a0), AROS_UFHA(APTR, obj, a2), AROS_UFHA(struct MUI_LayoutMsg *, lm, a1)) -#endif - - struct Data *data = hook->h_Data; - Object *cstate; - Object *child; - - DebOut("LayoutHook(%lx,..)\n",obj); - - switch (lm->lm_Type) { - case MUILM_MINMAX: - DebOut(" data->defwidth: %d\n",data->defwidth); - DebOut(" data->defheight: %d\n",data->defheight); - - lm->lm_MinMax.MinWidth = 0; - lm->lm_MinMax.MinHeight = 0; - lm->lm_MinMax.DefWidth = data->defwidth; - lm->lm_MinMax.DefHeight = data->defheight; - lm->lm_MinMax.MaxWidth = MUI_MAXMAX;; - lm->lm_MinMax.MaxHeight = MUI_MAXMAX;; - DebOut("return FALSE\n"); - return 0; - case MUILM_LAYOUT: - cstate = (Object *)lm->lm_Children->mlh_Head; - while ((child = NextObject(&cstate))) { - if (!MUI_Layout(child,0,0,lm->lm_Layout.Width,lm->lm_Layout.Height,0)) { - return(FALSE); - } - } - return(TRUE); - } - return(MUILM_UNKNOWN); -} - -/******************************************* - * mgtk_toggle_value_update(GtkWidget *widget) - * - *******************************************/ - /*internal */ -static void mgtk_toggle_value_update0(GtkWidget *widget,struct Data *data, int b) { - - DebOut("mgtk_toggle_value_update0(%x,%x,%d)\n",widget,data,b); - - DebOut(" data->toggle=%lx\n",data->toggle); - nnset(data->toggle,MUIA_Selected,b); - widget->active=b; -} - -/******************************************* - * MUIHook_togglebutton - * - * clear/set all other widget objects in - * our group and emit the right signal(s) - *******************************************/ -HOOKPROTO(MUIHook_toggle, ULONG, MGTK_HOOK_OBJECT_POINTER obj, MGTK_HOOK_APTR hookpointer) -{ - MGTK_USERFUNC_INIT - GtkWidget *active; - GtkWidget *act; - GSList *next; - int toggled; - - DebOut("MUIHook_toggle called\n"); - active=mgtk_get_widget_from_obj(obj); - DebOut(" widget=%x\n",(int) active); - - toggled=FALSE; - /* active->active was our old state */ - if(!active->active) { - next=gtk_radio_button_get_group(active); - DebOut(" group length: %ld\n",g_slist_length(next)); - - while(next!=NULL) { - /* if we are in a radio group, clear all others */ - act=next->data; - /* clear the previous active object */ - if(act->active) { - nnset(act->MuiObject,MA_Toggle_Value,0); - act->active=0; - } - next=g_slist_next(next); - } - /* make our object the active one */ - active->active=1; - /* we have changed our status */ - toggled=TRUE; - } - else { /* active */ - if(gtk_radio_button_get_group(active)) { - /* we are part of a radio group, then we stay active */ - nnset(active->MuiObject,MA_Toggle_Value,1); - } - else { - /* if we are stand alone, we go inactive and we have changed our status*/ - active->active=0; - nnset(active->MuiObject,MA_Toggle_Value,0); - toggled=TRUE; - } - } - - if(toggled) { - DebOut(" emit newstyle toggled signal\n"); - g_signal_emit(active,g_signal_lookup("toggled",0),0); - } - - return 0; - MGTK_USERFUNC_EXIT -} -MakeHook(MyMuiHook_toggle, MUIHook_toggle); - -/******************************************* - * mNew - * - * requires MA_Widget! - *******************************************/ -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - GtkWidget *widget; - Object *toggle; - struct TagItem *tstate, *tag; - - DebOut("mNew (togglebutton)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if(!obj) { - ErrOut("togglebutton: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - - DebOut(" new obj=%lx\n",obj); - - tstate=((struct opSet *)msg)->ops_AttrList; - - widget=NULL; - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/togglebutton.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - DebOut(" widget=%d\n",widget); - - /* why another group? - * Because the normal button does it the same way, and we can hide - * all parameters in here. - */ - - toggle=VGroup, - GroupSpacing(0), - ButtonFrame, - MUIA_InputMode , MUIV_InputMode_Toggle, - MUIA_Background , MUII_ButtonBack, - MUIA_ShowSelState , TRUE, - MUIA_Selected , FALSE, - MUIA_CycleChain, TRUE, - End; - - if (toggle) - { - DoMethod(obj,OM_ADDMEMBER,toggle); - - /* setup internal hooks */ - DoMethod(obj,MUIM_Notify,MUIA_Selected,MUIV_EveryTime, obj,2,MUIM_CallHook,&MyMuiHook_toggle); - - SETUPHOOK(&data->LayoutHook, LayoutHook, data); - - widget->active=FALSE; - data->widget=widget; - data->toggle=toggle; - data->defwidth =-1; - data->defheight=-1; - - mSet(data, obj, (APTR)msg); - } - else - { - /* We are out of memory or something */ - CoerceMethod(cl, obj, OM_DISPOSE); - obj = NULL; - } - } - - return (ULONG)obj; -} - -/******************************************* - * mSet - * - * MA_Toggle_Value only usefull TAG here - *******************************************/ -static VOID mSet(struct Data *data, APTR obj, struct opSet *msg) { - struct TagItem *tstate, *tag; - GtkWidget *widget; - ULONG relayout = 0; - - DebOut("mSet(%lx,%lx,%lx)\n",data,obj,msg); - - tstate = msg->ops_AttrList; - - while ((tag = (struct TagItem *) NextTagItem(&tstate))) - { - switch (tag->ti_Tag) - { - case MA_Toggle_Value: - DebOut("mSet(%lx) to %d\n",obj,tag->ti_Data); - widget=mgtk_get_widget_from_obj(obj); - mgtk_toggle_value_update0(widget,data,(int)tag->ti_Data); - break; - case MA_DefWidth: - if(!data->have_layout_hook) { - set(obj, MUIA_Group_LayoutHook, &data->LayoutHook); - data->have_layout_hook=1; - } - if (data->defwidth != tag->ti_Data) { - data->defwidth = tag->ti_Data; - relayout = 1; - } - break; - case MA_DefHeight: - if(!data->have_layout_hook) { - set(obj, MUIA_Group_LayoutHook, &data->LayoutHook); - data->have_layout_hook=1; - } - if (data->defheight != tag->ti_Data) { - data->defheight = tag->ti_Data; - relayout = 1; - } - break; - } - } - - if (relayout) { - DoMethod(obj, MUIM_Group_InitChange); - DoMethod(obj, MUIM_Group_ExitChange); - } -} - -/******************************************* - * mGet - * - * MA_Toggle_Value: value as string - * MA_Widget: GtkWidget of this toggle - *******************************************/ -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) { - ULONG rc; - - switch (msg->opg_AttrID) { - case MA_Widget : - DebOut("mGet: data->widget=%x\n",(int) data->widget); - rc = (ULONG) data->widget; - break; - case MA_Toggle_Value : - rc=xget(data->toggle, MUIA_Selected); - DebOut("mGet: MA_Toggle_Value =%d\n", rc); - break; - default: - return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - return TRUE; -} - -static int mRemMember(struct Data *data, Object *obj,struct opMember *msg,struct IClass *cl) { - - DebOut("togglebutton.c: mRemMember(%lx,%lx)\n",obj,msg->opam_Object); - - if(data->toggle) { - DebOut(" data->toggle,OM_REMMEMBER,msg->opam_Object\n"); - DoMethod(data->toggle,OM_REMMEMBER,msg->opam_Object); - return TRUE; - } - else { - /* if !data->toggle just pass it to the original method */ - DebOut(" DoSuperMethodA(cl, obj, (Msg)msg)\n"); - return DoSuperMethodA(cl, obj, (Msg)msg); - } -} - -static int mAddMember(struct Data *data, Object *obj,struct opMember *msg,struct IClass *cl) { - - DebOut("togglebutton.c: mAddMember(%lx,%lx)\n",obj,msg->opam_Object); - - if(data->toggle) { - /* now someone added a new object to us, so don't add it to the - * group object, but to the inner group!*/ - DebOut(" data->toggle,OM_ADDMEMBER,msg->opam_Object\n"); - DoMethod(data->toggle,OM_ADDMEMBER,msg->opam_Object); - return TRUE; - } - else { - /* if !data->toggle, we want to add the button to the object, - * so just pass it to the original method */ - DebOut(" DoSuperMethodA(cl, obj, (Msg)msg)\n"); - return DoSuperMethodA(cl, obj, (Msg)msg); - } -} - - -/******************************************* - * Dispatcher - *******************************************/ -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_SET : mSet (data, obj, (APTR)msg); break; - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - case OM_ADDMEMBER : return mAddMember (data, obj, (APTR)msg, cl); - case OM_REMMEMBER : return mRemMember (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -/******************************************* - * Custom class create/delete - *******************************************/ -int mgtk_create_togglebutton_class(void) -{ - DebOut("mgtk_create_togglebutton_class()\n"); - - CL_ToggleButton = MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - - DebOut("CL_ToggleButton=%lx\n",CL_ToggleButton); - - return CL_ToggleButton ? 1 : 0; -} - -void mgtk_delete_togglebutton_class(void) -{ - if (CL_ToggleButton) - { - MUI_DeleteCustomClass(CL_ToggleButton); - } -} diff --git a/mui/gtk-mui/classes/toolbar.c b/mui/gtk-mui/classes/toolbar.c deleted file mode 100644 index b2c7d3969..000000000 --- a/mui/gtk-mui/classes/toolbar.c +++ /dev/null @@ -1,137 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -/* toolbar class - * - * a lot of useless stuff in here, will clean up, promised .. - */ - -#include -#include -#include - -#include -#include - -#include "classes.h" -#include "gtk_globals.h" -#include "gtk.h" -#include "debug.h" - -/*********************************************************************/ - -struct Data { - GtkWidget *widget; -}; - -static ULONG mNew(struct IClass *cl, APTR obj, Msg msg) { - - GtkWidget *widget; - struct TagItem *tstate, *tag; - - DebOut("mNew(toolbar)\n"); - - obj = (APTR)DoSuperMethodA(cl, obj, msg); - - if (!obj) { - ErrOut("toolbar: unable to create object!"); - return (ULONG) NULL; - } - else - { - GETDATA; - - tstate=((struct opSet *)msg)->ops_AttrList; - widget=NULL; - - while ((tag = (struct TagItem *) NextTagItem((APTR) &tstate))) { - switch (tag->ti_Tag) { - case MA_Widget: - widget = (GtkWidget *) tag->ti_Data; - break; - } - } - - if(!widget) { - ErrOut("classes/toolbar.c: mNew: MA_Widget not supplied!\n"); - CoerceMethod(cl, obj, OM_DISPOSE); - return (ULONG) NULL; - } - - set(obj,MUIA_Frame, MUIV_Frame_Group); - set(obj,MUIA_Background, MUII_GroupBack); - - data->widget=widget; - } - - return (ULONG)obj; -} - -static ULONG mGet(struct Data *data, APTR obj, struct opGet *msg, struct IClass *cl) -{ - ULONG rc; - - switch (msg->opg_AttrID) - { - case MA_Widget: - rc = (ULONG) data->widget; - break; - - default: return DoSuperMethodA(cl, obj, (Msg)msg); - } - - *msg->opg_Storage = rc; - - return TRUE; -} - -BEGINMTABLE -GETDATA; - - switch (msg->MethodID) - { - case OM_NEW : return mNew (cl, obj, msg); - case OM_GET : return mGet (data, obj, (APTR)msg, cl); - } - -ENDMTABLE - -int mgtk_create_toolbar_class(void) { - - CL_Toolbar=MUI_CreateCustomClass(NULL, MUIC_Group, NULL, sizeof(struct Data), (APTR)&mDispatcher); - return CL_Toolbar ? 1 : 0; -} - -void mgtk_delete_toolbar_class(void) { - - if (CL_Toolbar) { - MUI_DeleteCustomClass(CL_Toolbar); - } -} diff --git a/mui/gtk-mui/debug.c b/mui/gtk-mui/debug.c deleted file mode 100644 index 485ea8e31..000000000 --- a/mui/gtk-mui/debug.c +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#ifndef __MORPHOS__ -#include -#endif -#include -#include - -#include "debug.h" -#include -#include "gtk_globals.h" - -/***************************************************************************** - * Errors are never nice, but they happen. This functions leaves the user - * the choice: - * - * He can continue at his own risk, which migth work, if - * for example an image could not be loaded, or which might crash, - * if a MuiObject could not be created. - * - * He can try to do a clean exit, resources should be released here. - * - * He can try to run, leave all resources allocated, but maybe he - * can avoid a full crash.. - * - * Default should be to Clean Exit .. - *****************************************************************************/ - -void handle_error(const char *format, ...) { - - LONG reply; - struct Window *w; - char *text; - va_list args; - struct EasyStruct easy = { - sizeof (struct EasyStruct), - 0, - "GTK-MUI Error", - "%s", - "Ignore|Clean Exit|Hard Exit", - }; - - DebOut("handle_error(..)\n"); - - if(mgtk && mgtk->MuiRoot) { - w=(struct Window *) xget(mgtk->MuiRoot,MUIA_Window_Window); - } - else { - w=NULL; - } - - va_start (args, format); - text = g_strdup_vprintf (format, args); - va_end (args); - - reply=EasyRequest( w, &easy, NULL, text); - DebOut(" reply=%d\n",reply); - - switch(reply) { - case 0: exit(1); /* Hard Exit, quit NOW! */ - case 2: gtk_main_quit(); /* Exit as soon as possible */ - break; - case 1: DebOut("User wants to continue at own risk!"); - break; - } - - g_free(text); - -} diff --git a/mui/gtk-mui/debug.h b/mui/gtk-mui/debug.h deleted file mode 100644 index 6e5a52f73..000000000 --- a/mui/gtk-mui/debug.h +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -void handle_error(const char *format, ...); - -#if defined (__AROS__) - #define DEBUG 1 -#endif - -/* define D and bug */ -#if defined(__MORPHOS__) - #if DEBUG - #define D(x) x - #define bug kprintf - #else - #define D(x) - #define bug - #endif -#elif defined(__AMIGAOS4__) - #define D(x) x - #define bug DebugPrintF -#elif defined(__AROS__) - #include -#endif - -/* DebOut */ -#if defined(MGTK_DEBUG) - #if defined(__MORPHOS__) || defined(__AROS__) - #define DebOut(...) D(bug(__VA_ARGS__)) - #else - #define DebOut printf - #endif -#else - #define DebOut(...) -#endif - -/* WarnOut */ -#if defined(MGTK_DEBUG) - #if defined(__AROS__) - #define WarnOut(...) printf("WARNING: ");printf(__VA_ARGS__);DebOut("WARNING");DebOut(__VA_ARGS__) - #else - #define WarnOut(...) printf("WARNING: ");printf(__VA_ARGS__); - #endif -#else - #if defined(__MORPHOS__) || defined(__AROS__) - #if defined(__AROS__) - #include - #endif - #define WarnOut(...) D(bug("WARNING: "));D(bug(__VA_ARGS__)) - #else - #define WarnOut(...) printf("WARNING: ");printf(__VA_ARGS__) - #endif -#endif - -/* ErrOut */ -#if defined(MGTK_DEBUG) - //#define ErrOut(...) printf("ERROR: ");printf(__VA_ARGS__);DebOut("ERROR");DebOut(__VA_ARGS__) - #define ErrOut(...) DebOut("ERROR: ");DebOut(__VA_ARGS__);handle_error(__VA_ARGS__) -#else - #define ErrOut(...) handle_error(__VA_ARGS__) -#endif - -#if defined(ENABLE_RT) - #include -#endif diff --git a/mui/gtk-mui/examples/arrow.c b/mui/gtk-mui/examples/arrow.c deleted file mode 100644 index 7dfb74beb..000000000 --- a/mui/gtk-mui/examples/arrow.c +++ /dev/null @@ -1,72 +0,0 @@ - -#include - -/* Create an Arrow widget with the specified parameters - * and pack it into a button */ -GtkWidget *create_arrow_button( GtkArrowType arrow_type, - GtkShadowType shadow_type ) -{ - GtkWidget *button; - GtkWidget *arrow; - - button = gtk_button_new (); - arrow = gtk_arrow_new (arrow_type, shadow_type); - - gtk_container_add (GTK_CONTAINER (button), arrow); - - gtk_widget_show (button); - gtk_widget_show (arrow); - - return button; -} - -int main( int argc, - char *argv[] ) -{ - /* GtkWidget is the storage type for widgets */ - GtkWidget *window; - GtkWidget *button; - GtkWidget *box; - - /* Initialize the toolkit */ - gtk_init (&argc, &argv); - - /* Create a new window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_window_set_title (GTK_WINDOW (window), "Arrow Buttons"); - - /* It's a good idea to do this for all windows. */ - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - - /* Sets the border width of the window. */ - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - /* Create a box to hold the arrows/buttons */ - box = gtk_hbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 2); - gtk_container_add (GTK_CONTAINER (window), box); - - /* Pack and show all our widgets */ - gtk_widget_show (box); - - button = create_arrow_button (GTK_ARROW_UP, GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); - - button = create_arrow_button (GTK_ARROW_DOWN, GTK_SHADOW_OUT); - gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); - - button = create_arrow_button (GTK_ARROW_LEFT, GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); - - button = create_arrow_button (GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_OUT); - gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 3); - - gtk_widget_show (window); - - /* Rest in gtk_main and wait for the fun to begin! */ - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/buttons.c b/mui/gtk-mui/examples/buttons.c deleted file mode 100644 index 581f6304e..000000000 --- a/mui/gtk-mui/examples/buttons.c +++ /dev/null @@ -1,92 +0,0 @@ - -#include -#include - -/* Create a new hbox with an image and a label packed into it - * and return the box. */ - -GtkWidget *xpm_label_box( gchar *xpm_filename, - gchar *label_text ) -{ - GtkWidget *box; - GtkWidget *label; - GtkWidget *image; - - /* Create box for image and label */ - box = gtk_hbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 2); - - /* Now on to the image stuff */ - image = gtk_image_new_from_file (xpm_filename); - - /* Create a label for the button */ - label = gtk_label_new (label_text); - - /* Pack the image and label into the box */ - gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 3); - gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 3); - - gtk_widget_show (image); - gtk_widget_show (label); - - return box; -} - -/* Our usual callback function */ -void callback( GtkWidget *widget, - gpointer data ) -{ - g_print ("Hello again - %s was pressed\n", (char *) data); -} - -int main( int argc, - char *argv[] ) -{ - /* GtkWidget is the storage type for widgets */ - GtkWidget *window; - GtkWidget *button; - GtkWidget *box; - - gtk_init (&argc, &argv); - - /* Create a new window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_window_set_title (GTK_WINDOW (window), "Pixmap'd Buttons!"); - - /* It's a good idea to do this for all windows. */ - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - - g_signal_connect (G_OBJECT (window), "delete_event", - G_CALLBACK (gtk_main_quit), NULL); - - /* Sets the border width of the window. */ - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - /* Create a new button */ - button = gtk_button_new (); - - /* Connect the "clicked" signal of the button to our callback */ - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (callback), (gpointer) "cool button"); - - /* This calls our box creating function */ - box = xpm_label_box ("info.png", "cool button"); - - /* Pack and show all our widgets */ - gtk_widget_show (box); - - gtk_container_add (GTK_CONTAINER (button), box); - - gtk_widget_show (button); - - gtk_container_add (GTK_CONTAINER (window), button); - - gtk_widget_show (window); - - /* Rest in gtk_main and wait for the fun to begin! */ - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/dial_test.c b/mui/gtk-mui/examples/dial_test.c deleted file mode 100644 index 3944c8b39..000000000 --- a/mui/gtk-mui/examples/dial_test.c +++ /dev/null @@ -1,67 +0,0 @@ - -#include -#include -#include -#include "gtkdial.h" - -void value_changed( GtkAdjustment *adjustment, - GtkWidget *label ) -{ - char buffer[16]; - - sprintf(buffer,"%4.2f",adjustment->value); - gtk_label_set_text (GTK_LABEL (label), buffer); -} - -int main( int argc, - char *argv[]) -{ - GtkWidget *window; - GtkAdjustment *adjustment; - GtkWidget *dial; - GtkWidget *frame; - GtkWidget *vbox; - GtkWidget *label; - - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_window_set_title (GTK_WINDOW (window), "Dial"); - - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (exit), NULL); - - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - vbox = gtk_vbox_new (FALSE, 5); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_widget_show (vbox); - - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_container_add (GTK_CONTAINER (vbox), frame); - gtk_widget_show (frame); - - adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0)); - - dial = gtk_dial_new (adjustment); - gtk_dial_set_update_policy (GTK_DIAL (dial), GTK_UPDATE_DELAYED); - /* gtk_widget_set_size_request (dial, 100, 100); */ - - gtk_container_add (GTK_CONTAINER (frame), dial); - gtk_widget_show (dial); - - label = gtk_label_new ("0.00"); - gtk_box_pack_end (GTK_BOX (vbox), label, 0, 0, 0); - gtk_widget_show (label); - - g_signal_connect (G_OBJECT (adjustment), "value_changed", - G_CALLBACK (value_changed), (gpointer) label); - - gtk_widget_show (window); - - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/entry.c b/mui/gtk-mui/examples/entry.c deleted file mode 100644 index 74cc0b871..000000000 --- a/mui/gtk-mui/examples/entry.c +++ /dev/null @@ -1,107 +0,0 @@ - -#include -#include -#include - -void enter_callback( GtkWidget *widget, - GtkWidget *entry ) -{ - const gchar *entry_text; - entry_text = gtk_entry_get_text (GTK_ENTRY (entry)); - printf("Entry contents: %s\n", entry_text); -} - -void entry_toggle_editable( GtkWidget *checkbutton, - GtkWidget *entry ) -{ - gtk_editable_set_editable (GTK_EDITABLE (entry), - GTK_TOGGLE_BUTTON (checkbutton)->active); -} - -void entry_toggle_visibility( GtkWidget *checkbutton, - GtkWidget *entry ) -{ - gtk_entry_set_visibility (GTK_ENTRY (entry), - GTK_TOGGLE_BUTTON (checkbutton)->active); -} - -int main( int argc, - char *argv[] ) -{ - - GtkWidget *window; - GtkWidget *vbox, *hbox; - GtkWidget *entry; - GtkWidget *button; - GtkWidget *check; - gint tmp_pos; - - gtk_init (&argc, &argv); - - /* create a new window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_size_request (GTK_WIDGET (window), 200, 100); - gtk_window_set_title (GTK_WINDOW (window), "GTK Entry"); - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - - g_signal_connect_swapped (G_OBJECT (window), "delete_event", - G_CALLBACK (gtk_widget_destroy), - G_OBJECT (window)); - - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_widget_show (vbox); - - entry = gtk_entry_new (); - gtk_entry_set_max_length (GTK_ENTRY (entry), 50); - g_signal_connect (G_OBJECT (entry), "activate", - G_CALLBACK (enter_callback), - (gpointer) entry); - gtk_entry_set_text (GTK_ENTRY (entry), "hello"); - tmp_pos = GTK_ENTRY(entry)->text_length; - gtk_editable_insert_text (GTK_EDITABLE (entry), " world", -1, &tmp_pos); - gtk_editable_select_region (GTK_EDITABLE (entry), - 0, GTK_ENTRY (entry)->text_length); - gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0); - gtk_widget_show (entry); - - hbox = gtk_hbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (vbox), hbox); - gtk_widget_show (hbox); - - check = gtk_check_button_new_with_label ("Editable"); - - gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); - - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (entry_toggle_editable), (gpointer) entry); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); - gtk_widget_show (check); - - check = gtk_check_button_new_with_label ("Visible"); - gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); - - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (entry_toggle_visibility), (gpointer) entry); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); - gtk_widget_show (check); - - button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (gtk_widget_destroy), - G_OBJECT (window)); - - gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); - GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); - gtk_widget_grab_default (button); - gtk_widget_show (button); - - gtk_widget_show (window); - - gtk_main(); - - return 0; -} diff --git a/mui/gtk-mui/examples/eurocalc/Makefile b/mui/gtk-mui/examples/eurocalc/Makefile deleted file mode 100644 index 873e50dca..000000000 --- a/mui/gtk-mui/examples/eurocalc/Makefile +++ /dev/null @@ -1,21 +0,0 @@ - -TARGET=eurocalc -CFLAGS = -O3 -Wall -I../.. -I../../include -I../../classes - - -EURO_OBJS = \ - main.o \ - support.o \ - interface.o \ - callbacks.o - -all: $(OBJS) $(EURO_OBJS) - $(CC) $(EURO_OBJS) $(OBJS) -o $(TARGET) -L../.. -lgtk-mui -larosc -lmui -larossupport -lamiga - -clean: - rm -f $(EURO_OBJS) $(TARGET) - -%.o: %.c - $(CC) $(CFLAGS) -o $@ -c $*.c - - diff --git a/mui/gtk-mui/examples/eurocalc/callbacks.c b/mui/gtk-mui/examples/eurocalc/callbacks.c deleted file mode 100644 index 4e8b36aa9..000000000 --- a/mui/gtk-mui/examples/eurocalc/callbacks.c +++ /dev/null @@ -1,55 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - -// Definetions -#define D_TO_E 0 -#define E_TO_D 1 - -// These are the declarations for the function and the flags -void compute_result(GtkWidget *this_widget, const char *fraga, int type); - -void -on_euro_entry_activate (GtkEntry *entry, - gpointer user_data) -{ - -compute_result(GTK_WIDGET(entry), gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1) , E_TO_D); -} - -void -on_drx_entry_activate (GtkEntry *entry, - gpointer user_data) -{ -compute_result(GTK_WIDGET(entry), gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1), D_TO_E); -} - -// Main Code -void compute_result(GtkWidget *this_widget, const char *fraga, int type) -{ - GtkWidget *other_entry = NULL; - double result = 0.0; - gchar *result_string = NULL; - - switch(type) { - case D_TO_E: - result = (atof(fraga) / 340.75); - other_entry = lookup_widget(this_widget, "euro_entry"); - break; - case E_TO_D: - result = (atof(fraga) * 340.75); - other_entry = lookup_widget(this_widget, "drx_entry"); - break; - } - result_string = g_strdup_printf("%5.2f",result); - gtk_entry_set_text(GTK_ENTRY(other_entry), result_string); - g_free(result_string); -} - diff --git a/mui/gtk-mui/examples/eurocalc/callbacks.h b/mui/gtk-mui/examples/eurocalc/callbacks.h deleted file mode 100644 index f318df91c..000000000 --- a/mui/gtk-mui/examples/eurocalc/callbacks.h +++ /dev/null @@ -1,10 +0,0 @@ -/*#include */ - - -void -on_euro_entry_activate (GtkEntry *entry, - gpointer user_data); - -void -on_drx_entry_activate (GtkEntry *entry, - gpointer user_data); diff --git a/mui/gtk-mui/examples/eurocalc/drx.png b/mui/gtk-mui/examples/eurocalc/drx.png deleted file mode 100644 index a1d0a8abb090c9d3a5cb85f91eed179b1a8bfaec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 627 zcwPZ>0*w8MP)f7DCW&x6w3>*VorCcFVHT$z+mvJiZn1 zXRR3b_xEZ0Xf*ODit zLI~{Z410Tfq*5s&kqDJag-)llF?=mJ6bcavg#f5ls~bZBKE2ERAN)^&*S2Cf9CCAW z1AOcBO2uLkfLJWX+1c6q!HdO$r>Cdi=BwG^;o)|PgTWw$LgCGKuh+XB*yVB&jYij5 zHUk@mL9JFJola9KmGJp|oS&a_b#+B9m*ej4j@{i|!r?H6Vc>SV2?PR|rb!?WARG>} zv$F&I(u!8A#d5i1I-N3`%@~iz=(>*E?WWi3ad2?JU@*XDv!UxckB^Vc=W`w&9;nyr zSeEr8@#+5SyPEKgI+bk9f91aK5=@eB}aXOs<93LNZ zbaeC`DoGM#v)N}&)5J$f(=?IIW}oe{ESEJ+y8u4yG|94Dmj2c;{R%wTBLBjKkxu{s N002ovPDHLkV1g>0Aq4;c diff --git a/mui/gtk-mui/examples/eurocalc/euro_16x16.png b/mui/gtk-mui/examples/eurocalc/euro_16x16.png deleted file mode 100644 index 27869a6f298eb5b28e79d4769e17fda09e39bbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 714 zcwPa@0yX`KP)b zl|4%%K^Vt>vsrI7MlhfQ8#E9JHe$7ekW>K|C55$Lz(z=MkRl?&eTA#;zCpkuporj0 zigamQY>Ws7Qi*Yi2-;+cI9ItCV`B8~{?#+j%Wq)jd1gd9o&J_erG9#zx8}NTSSiI< zB!oapd2blTPPJP7F7o;OuaS|F4coS{EDIsTm%vIX9LJ$tF4O6Be(Rp+t!1-WmX?;j z1bnR*#_sO!n&!H0*s`p@hQ7$MEL_(O>%*LByWQsM>I&C&@jQ=UFo=|rXf#SF6za)W zN}&$|Dy29)Jmlcu08P`dZ5z`xX*3!Xi$#=DY;A23i^Y0s2ZD>mB9%%7P1D%k-ez`o z7Jx(|L95l`?Cgx^=jV58`+{q=8kI@~fW^f{ANr!@ z9*@84?+bo>eB|iph>MF0-&e2KDV0iHdC6pwnVFg4!AdED!62`@B^HYjiA1{crl+U- zLf-{XOiW;!W|z-2P3Gq2{Pp41xBPPts(0RGw6WEjSd_+OvtAHR*~y>##q761SM07*qoM6N<$f`I5&)c^nh diff --git a/mui/gtk-mui/examples/eurocalc/interface.c b/mui/gtk-mui/examples/eurocalc/interface.c deleted file mode 100644 index dc78a8b0d..000000000 --- a/mui/gtk-mui/examples/eurocalc/interface.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include - -/* -#include -*/ -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - -#define GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) - -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ - g_object_set_data (G_OBJECT (component), name, widget) - -GtkWidget* -create_window1 (void) -{ - GtkWidget *window1; - GtkWidget *table1; - GtkWidget *euro_entry; - GtkWidget *drx_entry; - GtkWidget *image1; - GtkWidget *image2; - - window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window1), _("EuroCalc")); - /*gtk_window_set_position (GTK_WINDOW (window1), GTK_WIN_POS_CENTER_ALWAYS);*/ - gtk_window_set_resizable (GTK_WINDOW (window1), FALSE); - - table1 = gtk_table_new (2, 2, FALSE); - gtk_widget_show (table1); - gtk_container_add (GTK_CONTAINER (window1), table1); - gtk_container_set_border_width (GTK_CONTAINER (table1), 4); - gtk_table_set_row_spacings (GTK_TABLE (table1), 4); - gtk_table_set_col_spacings (GTK_TABLE (table1), 4); - - euro_entry = gtk_entry_new (); - gtk_widget_show (euro_entry); - gtk_table_attach (GTK_TABLE (table1), euro_entry, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - drx_entry = gtk_entry_new (); - gtk_widget_show (drx_entry); - gtk_table_attach (GTK_TABLE (table1), drx_entry, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - image1 = create_pixmap (window1, "euro_16x16.png"); - gtk_widget_show (image1); - gtk_table_attach (GTK_TABLE (table1), image1, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_SHRINK | GTK_FILL), - (GtkAttachOptions) (GTK_SHRINK | GTK_FILL), 0, 0); - - image2 = create_pixmap (window1, "drx.png"); - gtk_widget_show (image2); - gtk_table_attach (GTK_TABLE (table1), image2, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - g_signal_connect ((gpointer) window1, "destroy", - G_CALLBACK (gtk_main_quit), - NULL); - g_signal_connect ((gpointer) euro_entry, "activate", - G_CALLBACK (on_euro_entry_activate), - NULL); - g_signal_connect ((gpointer) drx_entry, "activate", - G_CALLBACK (on_drx_entry_activate), - NULL); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, "window1"); - GLADE_HOOKUP_OBJECT (window1, table1, "table1"); - GLADE_HOOKUP_OBJECT (window1, euro_entry, "euro_entry"); - GLADE_HOOKUP_OBJECT (window1, drx_entry, "drx_entry"); - GLADE_HOOKUP_OBJECT (window1, image1, "image1"); - GLADE_HOOKUP_OBJECT (window1, image2, "image2"); - - return window1; -} - diff --git a/mui/gtk-mui/examples/eurocalc/interface.h b/mui/gtk-mui/examples/eurocalc/interface.h deleted file mode 100644 index 4911e6bdf..000000000 --- a/mui/gtk-mui/examples/eurocalc/interface.h +++ /dev/null @@ -1,6 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - - -GtkWidget* create_window1 (void); diff --git a/mui/gtk-mui/examples/eurocalc/main.c b/mui/gtk-mui/examples/eurocalc/main.c deleted file mode 100644 index a9e49a3c5..000000000 --- a/mui/gtk-mui/examples/eurocalc/main.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Initial main.c file generated by Glade. Edit as required. - * Glade will not overwrite this file. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include "interface.h" -#include "support.h" - -int -main (int argc, char *argv[]) -{ - GtkWidget *window1; - -#ifdef ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); -#endif - - gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, - argc, argv, - GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR, - NULL); - - /* - * The following code was added by Glade to create one of each component - * (except popup menus), just so that you see something after building - * the project. Delete any components that you don't want shown initially. - */ - window1 = create_window1 (); - gtk_widget_show (window1); - - gtk_main (); - return 0; -} - diff --git a/mui/gtk-mui/examples/eurocalc/mmakefile.src b/mui/gtk-mui/examples/eurocalc/mmakefile.src deleted file mode 100644 index 01309e1bb..000000000 --- a/mui/gtk-mui/examples/eurocalc/mmakefile.src +++ /dev/null @@ -1,9 +0,0 @@ -include $(TOP)/config/make.cfg - -#MM contrib-gtk-mui-examples-eurocalc : includes linklibs contrib-gtk-mui - -%build_prog mmake=contrib-gtk-mui-examples-eurocalc \ - progname=eurocalc targetdir=$(CONTRIBDIR)/mui/gtk-mui/examples \ - files="callbacks interface main support" uselibs="gtk-mui mui arossupport amiga arosc m" - -%common diff --git a/mui/gtk-mui/examples/eurocalc/support.c b/mui/gtk-mui/examples/eurocalc/support.c deleted file mode 100644 index 9485b8387..000000000 --- a/mui/gtk-mui/examples/eurocalc/support.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include - -#include - -#include "support.h" - -/*other_entry = lookup_widget(this_widget, "euro_entry");*/ -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (!parent) - parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename) -{ - GtkWidget *pixmap; - gchar *pathname; - - if (!filename || !filename[0]) - return gtk_image_new (); - -/* - pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, - filename, TRUE, NULL); - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return gtk_image_new (); - } - - pixmap = gtk_image_new_from_file (pathname); - */ - pixmap = gtk_image_new_from_file (filename); - g_free (pathname); - return pixmap; -} - -/* This is an internally used function to create pixmaps. */ -GdkPixbuf* -create_pixbuf (const gchar *filename) -{ - gchar *pathname = NULL; - GdkPixbuf *pixbuf; - GError *error = NULL; - - if (!filename || !filename[0]) - return NULL; - -/* - pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, - filename, TRUE, NULL); - - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return NULL; - } - - pixbuf = gdk_pixbuf_new_from_file (pathname, &error); - */ - - pixbuf = gdk_pixbuf_new_from_file (filename, &error); - if (!pixbuf) - { - fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", - pathname, error->message); - g_error_free (error); - } - g_free (pathname); - return pixbuf; -} - -/* This is used to set ATK action descriptions. */ -/* -void -glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description) -{ - gint n_actions, i; - - n_actions = atk_action_get_n_actions (action); - for (i = 0; i < n_actions; i++) - { - if (!strcmp (atk_action_get_name (action, i), action_name)) - atk_action_set_description (action, i, description); - } -} -*/ diff --git a/mui/gtk-mui/examples/eurocalc/support.h b/mui/gtk-mui/examples/eurocalc/support.h deleted file mode 100644 index 4021ae1f6..000000000 --- a/mui/gtk-mui/examples/eurocalc/support.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -/*#include */ - -#undef Q_ -#ifdef ENABLE_NLS -# define Q_(String) g_strip_context ((String), gettext (String)) -#else -# define Q_(String) g_strip_context ((String), (String)) -#endif - - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget* lookup_widget (GtkWidget *widget, - const gchar *widget_name); - - - -/* - * Private Functions. - */ - -/* This is used to create the pixmaps used in the interface. */ -GtkWidget* create_pixmap (GtkWidget *widget, - const gchar *filename); - -/* This is used to create the pixbufs used in the interface. */ -GdkPixbuf* create_pixbuf (const gchar *filename); - -/* This is used to set ATK action descriptions. */ -void glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description); - diff --git a/mui/gtk-mui/examples/filesel.c b/mui/gtk-mui/examples/filesel.c deleted file mode 100644 index 8e26725ec..000000000 --- a/mui/gtk-mui/examples/filesel.c +++ /dev/null @@ -1,40 +0,0 @@ - -#include - -/* Get the selected filename and print it to the console */ -void file_ok_sel( GtkWidget *w, - GtkFileSelection *fs ) -{ - g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *filew; - - gtk_init (&argc, &argv); - - /* Create a new file selection widget */ - filew = gtk_file_selection_new ("File selection"); - - g_signal_connect (G_OBJECT (filew), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - /* Connect the ok_button to file_ok_sel function */ - g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), - "clicked", G_CALLBACK (file_ok_sel), (gpointer) filew); - - /* Connect the cancel_button to destroy the widget */ - g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), - "clicked", G_CALLBACK (gtk_widget_destroy), - G_OBJECT (filew)); - - /* Lets set the filename, as if this were a save dialog, and we are giving - a default filename */ - gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew), - "penguin.png"); - - gtk_widget_show (filew); - gtk_main (); - return 0; -} diff --git a/mui/gtk-mui/examples/fixed.c b/mui/gtk-mui/examples/fixed.c deleted file mode 100644 index 3a58beeb5..000000000 --- a/mui/gtk-mui/examples/fixed.c +++ /dev/null @@ -1,72 +0,0 @@ - -#include - -/* I'm going to be lazy and use some global variables to - * store the position of the widget within the fixed - * container */ -gint x = 50; -gint y = 50; - -/* This callback function moves the button to a new position - * in the Fixed container. */ -void move_button( GtkWidget *widget, - GtkWidget *fixed ) -{ - x = (x + 30) % 300; - y = (y + 50) % 300; - gtk_fixed_move (GTK_FIXED (fixed), widget, x, y); -} - -int main( int argc, - char *argv[] ) -{ - /* GtkWidget is the storage type for widgets */ - GtkWidget *window; - GtkWidget *fixed; - GtkWidget *button; - gint i; - - /* Initialise GTK */ - gtk_init (&argc, &argv); - - /* Create a new window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window), "Fixed Container"); - - /* Here we connect the "destroy" event to a signal handler */ - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - - /* Sets the border width of the window. */ - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - /* Create a Fixed Container */ - fixed = gtk_fixed_new (); - gtk_container_add (GTK_CONTAINER (window), fixed); - gtk_widget_show (fixed); - - for (i = 1 ; i <= 3 ; i++) { - /* Creates a new button with the label "Press me" */ - button = gtk_button_new_with_label ("Press me"); - - /* When the button receives the "clicked" signal, it will call the - * function move_button() passing it the Fixed Container as its - * argument. */ - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (move_button), (gpointer) fixed); - - /* This packs the button into the fixed containers window. */ - gtk_fixed_put (GTK_FIXED (fixed), button, i*50, i*50); - - /* The final step is to display this newly created widget. */ - gtk_widget_show (button); - } - - /* Display the window */ - gtk_widget_show (window); - - /* Enter the event loop */ - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/frame.c b/mui/gtk-mui/examples/frame.c deleted file mode 100644 index 3304cd3d0..000000000 --- a/mui/gtk-mui/examples/frame.c +++ /dev/null @@ -1,44 +0,0 @@ - -#include - -int main( int argc, - char *argv[] ) -{ - /* GtkWidget is the storage type for widgets */ - GtkWidget *window; - GtkWidget *frame; - GtkWidget *button; - - /* Initialise GTK */ - gtk_init (&argc, &argv); - - /* Create a new window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window), "Frame Example"); - - /* Here we connect the "destroy" event to a signal handler */ - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - - gtk_widget_set_size_request (window, 300, 300); - /* Sets the border width of the window. */ - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - /* Create a Frame */ - //frame = gtk_frame_new (NULL); - frame = gtk_frame_new ("GTK Frame"); - gtk_container_add (GTK_CONTAINER (window), frame); - - gtk_widget_show (frame); - - button = gtk_button_new_with_label ("dummy button"); - gtk_box_pack_end (GTK_BOX (frame), button, TRUE, TRUE, 2); - - /* Display the window */ - gtk_widget_show (window); - - /* Enter the event loop */ - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/gpassutil/Makefile b/mui/gtk-mui/examples/gpassutil/Makefile deleted file mode 100644 index 9fc1f45d9..000000000 --- a/mui/gtk-mui/examples/gpassutil/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# small Makefile to build gpassutil for AROS -# -# CC must be AROS cross compiler -# -# Oliver Brunner 2005 -# -# $Id$ -# -TARGET=gpass -CFLAGS=-I../.. -I../../include -I../../classes - - -OBJS = \ - main.o \ - support.o \ - interface.o \ - callbacks.o - -%.o: %.c - $(CC) $(CFLAGS) -o $@ -c $*.c - -all: $(OBJS) $(OBJS) - $(CC) $(OBJS) -o $(TARGET) -L ../.. -lgtk-mui -larosc -lmui -larossupport -lamiga - -clean: - rm -f $(OBJS) $(TARGET) - diff --git a/mui/gtk-mui/examples/gpassutil/callbacks.c b/mui/gtk-mui/examples/gpassutil/callbacks.c deleted file mode 100644 index ab9f2b0d0..000000000 --- a/mui/gtk-mui/examples/gpassutil/callbacks.c +++ /dev/null @@ -1,147 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -//#include -#include -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - -GString *alpha; -GString *numbers; -GString *symbols; -GString *custom; -GString *buffer; -GtkWidget *pass_lbl; -int pass_length; -gint timeout; - -gboolean -on_window_delete_event (GtkWidget *widget, - GdkEvent *event, - gpointer user_data) -{ - - return FALSE; -} - - -void -on_c_custom_toggled (GtkToggleButton *togglebutton, - gpointer user_data) -{ - extern GtkWidget *window; - GtkWidget *details; - - if (!(details = lookup_widget (window, "c_custom_details"))) - return; - - gtk_widget_set_sensitive (details, gtk_toggle_button_get_active (togglebutton)); -} - - -void -on_generate_btn_pressed (GtkButton *button, - gpointer user_data) -{ - extern GtkWidget *window; - GtkWidget *c_alpha = lookup_widget (window, "c_alpha"); - GtkWidget *c_numbers = lookup_widget (window, "c_numbers"); - GtkWidget *c_symbols = lookup_widget (window, "c_symbols"); - GtkWidget *c_custom = lookup_widget (window, "c_custom"); - GtkWidget *c_custom_details = lookup_widget (window, "c_custom_details"); - GtkWidget *length = lookup_widget (window, "length"); - int i; - -begin: - /* Initialize values */ - buffer = g_string_new (NULL); - pass_lbl = lookup_widget (window, "pass_lbl"); - alpha = g_string_new (NULL); - numbers = g_string_new (NULL); - symbols = g_string_new (NULL); - custom = g_string_new (NULL); - - /* Create alpha */ - for (i = 'A'; i <= 'Z'; i++) - alpha = g_string_append_c (alpha, i); - - for (i = 'a'; i <= 'z'; i++) - alpha = g_string_append_c (alpha, i); - - /* Create numbers */ - for (i = '0'; i <= '9'; i++) - numbers = g_string_append_c (numbers, i); - - /* Create symbols */ - symbols = g_string_append (symbols, "!@#$%&=?.;|+*~'\""); - - /* Create custom */ - custom = g_string_append (custom, gtk_entry_get_text (GTK_ENTRY (c_custom_details))); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (c_alpha))) buffer=g_string_append (buffer, alpha); - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (c_numbers))) buffer=g_string_append (buffer, numbers); - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (c_symbols))) buffer=g_string_append (buffer, symbols); - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (c_custom))) buffer=g_string_append (buffer, custom); - -/* buffer=g_string_append (buffer, alpha);*/ - - if (!strlen(buffer)) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c_alpha), TRUE); - goto begin; - } - - /* Get desired length */ - pass_length = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (length)); - - /* Create the timeout */ - timeout = g_timeout_add (50, generating_callback, NULL); - generating_callback (NULL); - - g_string_free (alpha, TRUE); - g_string_free (numbers, TRUE); - g_string_free (symbols, TRUE); - g_string_free (custom, TRUE); -} - -void -on_generate_btn_released (GtkButton *button, - gpointer user_data) -{ - g_source_remove (timeout); - - -} - -guint generating_callback (gpointer data) { - gchar *password = g_string_new (NULL); - static int v = 0; - int i; - - /* Randomize */ - srand (time (NULL)+(++v)); - - /* Create password */ - for (i = 0; i < pass_length; i++) { - password=g_string_append_c (password, buffer[(int)(rand()%strlen(buffer))]); - } - - gtk_label_set_text (GTK_LABEL (pass_lbl), password); - - return TRUE; -} - -void -on_about_btn_clicked (GtkButton *button, - gpointer user_data) -{ - /* - GnomeAbout *about; - - about = create_about (); - gtk_widget_show (about); - */ -} diff --git a/mui/gtk-mui/examples/gpassutil/callbacks.h b/mui/gtk-mui/examples/gpassutil/callbacks.h deleted file mode 100644 index a8c3e0962..000000000 --- a/mui/gtk-mui/examples/gpassutil/callbacks.h +++ /dev/null @@ -1,34 +0,0 @@ -#include - -gboolean -on_window_delete_event (GtkWidget *widget, - GdkEvent *event, - gpointer user_data); - -void -on_c_custom_toggled (GtkToggleButton *togglebutton, - gpointer user_data); - -void -on_generate_btn_clicked (GtkButton *button, - gpointer user_data); - -guint -generating_callback (gpointer data); - -void -on_about_btn_clicked (GtkButton *button, - gpointer user_data); - -gboolean -on_window_delete_event (GtkWidget *widget, - GdkEvent *event, - gpointer user_data); - -void -on_generate_btn_pressed (GtkButton *button, - gpointer user_data); - -void -on_generate_btn_released (GtkButton *button, - gpointer user_data); diff --git a/mui/gtk-mui/examples/gpassutil/gpass.readme b/mui/gtk-mui/examples/gpassutil/gpass.readme deleted file mode 100644 index ad449ddaf..000000000 --- a/mui/gtk-mui/examples/gpassutil/gpass.readme +++ /dev/null @@ -1,29 +0,0 @@ - -"About GPassUtil -A quick-yet-neat password generator for GNOME. - -GPassUtil is a quick-yet-neat GNOME password generator. -It's simple, but it integrates smoothly into GNOME, -and provides standard and custom charsets that will -help you build strong yet easy-to-remember passwords." - -Published by Staff TeamQ -License: GPL - -To get more info/sources, go to: -http://www.gnomefiles.org/app.php?soft_id=968 - -AROS Version: - -I had to comment out some functions from -the original sources, as gtk-mui does -not handle those (gnome etc.). So -according to the GPL, if you want to -get the modified sources, please write -me an e-Mail at: - -gtk-mui oliver-brunner.de - -gtk-mui is available from: -http://sourceforge.net/projects/gtk-mui/ - diff --git a/mui/gtk-mui/examples/gpassutil/interface.c b/mui/gtk-mui/examples/gpassutil/interface.c deleted file mode 100644 index 630c3158f..000000000 --- a/mui/gtk-mui/examples/gpassutil/interface.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include - -//#include -#include - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - -#define GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) - -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ - g_object_set_data (G_OBJECT (component), name, widget) - -GtkWidget* -create_window (void) -{ - GtkWidget *window; - GtkWidget *vbox1; - GtkWidget *hbox6; - GtkWidget *image2; - GtkWidget *label9; - GtkWidget *frame1; - GtkWidget *alignment1; - GtkWidget *vbox2; - GtkWidget *c_alpha; - GtkWidget *c_numbers; - GtkWidget *c_symbols; - GtkWidget *hbox1; - GtkWidget *c_custom; - GtkWidget *c_custom_details; - GtkWidget *label1; - GtkWidget *frame2; - GtkWidget *alignment2; - GtkWidget *vbox3; - GtkWidget *hbox3; - GtkWidget *label5; - GtkObject *length_adj; - GtkWidget *length; - GtkWidget *label4; - GtkWidget *frame3; - GtkWidget *alignment4; - GtkWidget *pass_lbl; - GtkWidget *label7; - GtkWidget *hbox4; - GtkWidget *generate_btn; - GtkWidget *generate_btn_stop; - GtkWidget *alignment3; - GtkWidget *hbox5; - GtkWidget *image1; - GtkWidget *label; - GtkWidget *button2; - GtkWidget *about_btn; - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window), "Password generator - by TeamQ"); - - vbox1 = gtk_vbox_new (FALSE, 7); - gtk_widget_show (vbox1); - gtk_container_add (GTK_CONTAINER (window), vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5); - - hbox6 = gtk_hbox_new (FALSE, 4); - gtk_widget_show (hbox6); - gtk_box_pack_start (GTK_BOX (vbox1), hbox6, FALSE, TRUE, 0); - -/* image2 = gtk_image_new_from_stock ("gnome-stock-authentication", GTK_ICON_SIZE_DND); - gtk_widget_show (image2); - gtk_box_pack_start (GTK_BOX (hbox6), image2, FALSE, TRUE, 0); - */ - - label9 = gtk_label_new ("Password generator - by TeamQ"); - gtk_widget_show (label9); - gtk_box_pack_start (GTK_BOX (hbox6), label9, FALSE, FALSE, 0); - //gtk_label_set_use_markup (GTK_LABEL (label9), TRUE); - - frame1 = gtk_frame_new (NULL); - gtk_widget_show (frame1); - gtk_box_pack_start (GTK_BOX (vbox1), frame1, FALSE, TRUE, 0); - //gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN); - -/* - alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_show (alignment1); - gtk_container_add (GTK_CONTAINER (frame1), alignment1); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0); - */ - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox2); - //gtk_container_add (GTK_CONTAINER (alignment1), vbox2); - gtk_container_add (GTK_CONTAINER (frame1), vbox2); - - //c_alpha = gtk_check_button_new_with_mnemonic ("Standard alphabet"); - c_alpha = gtk_check_button_new_with_label ("Standard alphabet"); - gtk_widget_show (c_alpha); - gtk_box_pack_start (GTK_BOX (vbox2), c_alpha, FALSE, FALSE, 0); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c_alpha), TRUE); - - c_numbers = gtk_check_button_new_with_label ("Numbers"); - gtk_widget_show (c_numbers); - gtk_box_pack_start (GTK_BOX (vbox2), c_numbers, FALSE, FALSE, 0); - - c_symbols = gtk_check_button_new_with_label ("Symbols"); - gtk_widget_show (c_symbols); - gtk_box_pack_start (GTK_BOX (vbox2), c_symbols, FALSE, FALSE, 0); - - hbox1 = gtk_hbox_new (FALSE, 4); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0); - - c_custom = gtk_check_button_new_with_label ("Custom"); - gtk_widget_show (c_custom); - gtk_box_pack_start (GTK_BOX (hbox1), c_custom, FALSE, FALSE, 0); - - c_custom_details = gtk_entry_new (); - gtk_widget_show (c_custom_details); - gtk_box_pack_start (GTK_BOX (hbox1), c_custom_details, TRUE, TRUE, 0); - gtk_widget_set_sensitive (c_custom_details, FALSE); - - label1 = gtk_frame_new ("Characters to use"); - gtk_widget_show (label1); -/* gtk_frame_set_label_widget (GTK_FRAME (frame1), label1); - gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);*/ - - frame2 = gtk_frame_new (NULL); - gtk_widget_show (frame2); - gtk_box_pack_start (GTK_BOX (vbox1), frame2, FALSE, TRUE, 0); - //gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN); - -/* - alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_show (alignment2); - gtk_container_add (GTK_CONTAINER (frame2), alignment2); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0); - */ - - vbox3 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox3); - //gtk_container_add (GTK_CONTAINER (alignment2), vbox3); - gtk_container_add (GTK_CONTAINER (frame2), vbox3); - - hbox3 = gtk_hbox_new (FALSE, 4); - gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox3), hbox3, TRUE, TRUE, 0); - - label5 = gtk_label_new ("Length:"); - gtk_widget_show (label5); - gtk_box_pack_start (GTK_BOX (hbox3), label5, FALSE, FALSE, 0); - - length_adj = gtk_adjustment_new (8, 0, 100, 1, 10, 10); - length = gtk_spin_button_new (GTK_ADJUSTMENT (length_adj), 1, 0); - gtk_widget_show (length); - gtk_box_pack_start (GTK_BOX (hbox3), length, FALSE, TRUE, 0); - - label4 = gtk_frame_new ("Details"); - gtk_widget_show (label4); -/* gtk_frame_set_label_widget (GTK_FRAME (frame2), label4); - gtk_label_set_use_markup (GTK_LABEL (label4), TRUE);*/ - - frame3 = gtk_frame_new (NULL); - gtk_widget_show (frame3); - gtk_box_pack_start (GTK_BOX (vbox1), frame3, FALSE, TRUE, 0); - //gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_IN); - -/* - alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_show (alignment4); - gtk_container_add (GTK_CONTAINER (frame3), alignment4); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 0, 0, 12, 0); - */ - - pass_lbl = gtk_label_new (""); - gtk_widget_show (pass_lbl); - //gtk_container_add (GTK_CONTAINER (alignment4), pass_lbl); - gtk_container_add (GTK_CONTAINER (frame3), pass_lbl); - GTK_WIDGET_SET_FLAGS (pass_lbl, GTK_CAN_FOCUS); - //gtk_label_set_use_markup (GTK_LABEL (pass_lbl), TRUE); - //gtk_label_set_selectable (GTK_LABEL (pass_lbl), TRUE); - - label7 = gtk_frame_new ("Password generated"); - gtk_widget_show (label7); -/* gtk_frame_set_label_widget (GTK_FRAME (frame3), label7); - gtk_label_set_use_markup (GTK_LABEL (label7), TRUE);*/ - - hbox4 = gtk_hbox_new (FALSE, 4); - gtk_widget_show (hbox4); - gtk_box_pack_start (GTK_BOX (vbox1), hbox4, FALSE, TRUE, 0); - gtk_widget_set_size_request (hbox4, -1, 47); - gtk_container_set_border_width (GTK_CONTAINER (hbox4), 6); - - generate_btn = gtk_button_new (); - gtk_widget_show (generate_btn); - gtk_box_pack_start (GTK_BOX (hbox4), generate_btn, FALSE, FALSE, 0); - -/* - alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0); - gtk_widget_show (alignment3); - gtk_container_add (GTK_CONTAINER (generate_btn), alignment3); - */ - - hbox5 = gtk_hbox_new (FALSE, 2); - gtk_widget_show (hbox5); - //gtk_container_add (GTK_CONTAINER (alignment3), hbox5); - gtk_container_add (GTK_CONTAINER (generate_btn), hbox5); - -/* image1 = gtk_image_new_from_stock ("gtk-index", GTK_ICON_SIZE_BUTTON); - gtk_widget_show (image1); - gtk_box_pack_start (GTK_BOX (hbox5), image1, FALSE, FALSE, 0); - */ - - label = gtk_label_new ("Generate"); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (hbox5), label, FALSE, FALSE, 0); - - button2 = gtk_button_new_from_stock ("gtk-close"); - gtk_widget_show (button2); - gtk_box_pack_start (GTK_BOX (hbox4), button2, FALSE, FALSE, 0); - -/* about_btn = gtk_button_new_from_stock ("gtk-about"); - gtk_widget_show (about_btn); - gtk_box_pack_end (GTK_BOX (hbox4), about_btn, FALSE, FALSE, 0);*/ - - g_signal_connect ((gpointer) window, "delete_event", - G_CALLBACK (gtk_main_quit), - NULL); - g_signal_connect ((gpointer) c_custom, "toggled", - G_CALLBACK (on_c_custom_toggled), - NULL); -/* g_signal_connect ((gpointer) generate_btn, "pressed",*/ - g_signal_connect ((gpointer) generate_btn, "pressed", - G_CALLBACK (on_generate_btn_pressed), - NULL); - g_signal_connect ((gpointer) generate_btn, "released", - G_CALLBACK (on_generate_btn_released), - NULL); - g_signal_connect ((gpointer) button2, "clicked", - G_CALLBACK (gtk_main_quit), - NULL); - /* - g_signal_connect ((gpointer) about_btn, "clicked", - G_CALLBACK (on_about_btn_clicked), - NULL); - */ - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (window, window, "window"); - GLADE_HOOKUP_OBJECT (window, vbox1, "vbox1"); - GLADE_HOOKUP_OBJECT (window, hbox6, "hbox6"); - GLADE_HOOKUP_OBJECT (window, image2, "image2"); - GLADE_HOOKUP_OBJECT (window, label9, "label9"); - GLADE_HOOKUP_OBJECT (window, frame1, "frame1"); - GLADE_HOOKUP_OBJECT (window, alignment1, "alignment1"); - GLADE_HOOKUP_OBJECT (window, vbox2, "vbox2"); - GLADE_HOOKUP_OBJECT (window, c_alpha, "c_alpha"); - GLADE_HOOKUP_OBJECT (window, c_numbers, "c_numbers"); - GLADE_HOOKUP_OBJECT (window, c_symbols, "c_symbols"); - GLADE_HOOKUP_OBJECT (window, hbox1, "hbox1"); - GLADE_HOOKUP_OBJECT (window, c_custom, "c_custom"); - GLADE_HOOKUP_OBJECT (window, c_custom_details, "c_custom_details"); - GLADE_HOOKUP_OBJECT (window, label1, "label1"); - GLADE_HOOKUP_OBJECT (window, frame2, "frame2"); - GLADE_HOOKUP_OBJECT (window, alignment2, "alignment2"); - GLADE_HOOKUP_OBJECT (window, vbox3, "vbox3"); - GLADE_HOOKUP_OBJECT (window, hbox3, "hbox3"); - GLADE_HOOKUP_OBJECT (window, label5, "label5"); - GLADE_HOOKUP_OBJECT (window, length, "length"); - GLADE_HOOKUP_OBJECT (window, label4, "label4"); - GLADE_HOOKUP_OBJECT (window, frame3, "frame3"); - GLADE_HOOKUP_OBJECT (window, alignment4, "alignment4"); - GLADE_HOOKUP_OBJECT (window, pass_lbl, "pass_lbl"); - GLADE_HOOKUP_OBJECT (window, label7, "label7"); - GLADE_HOOKUP_OBJECT (window, hbox4, "hbox4"); - GLADE_HOOKUP_OBJECT (window, generate_btn, "generate_btn"); - GLADE_HOOKUP_OBJECT (window, alignment3, "alignment3"); - GLADE_HOOKUP_OBJECT (window, hbox5, "hbox5"); - GLADE_HOOKUP_OBJECT (window, image1, "image1"); - GLADE_HOOKUP_OBJECT (window, label, "label"); - GLADE_HOOKUP_OBJECT (window, button2, "button2"); - GLADE_HOOKUP_OBJECT (window, about_btn, "about_btn"); - - return window; -} -/* -GtkWidget* -create_about (void) -{ - const gchar *authors[] = { - "Staff TeamQ", - NULL - }; - const gchar *documenters[] = { NULL }; - gchar *translators = NULL; - GdkPixbuf *about_logo_pixbuf; - GtkWidget *about; - - about_logo_pixbuf = create_pixbuf ("gpassutil/icon.png"); - about = gnome_about_new ("GPassUtil", VERSION, - "© Copyright 2005 TeamQ\nhttp://www.teamq.info/", - "A quick password generator.", - authors, - documenters, - translators, - about_logo_pixbuf); - gtk_container_set_border_width (GTK_CONTAINER (about), 5); - - GLADE_HOOKUP_OBJECT_NO_REF (about, about, "about"); - - return about; -} -*/ - diff --git a/mui/gtk-mui/examples/gpassutil/interface.h b/mui/gtk-mui/examples/gpassutil/interface.h deleted file mode 100644 index bafcfd5c1..000000000 --- a/mui/gtk-mui/examples/gpassutil/interface.h +++ /dev/null @@ -1,6 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -GtkWidget* create_window (void); -GtkWidget* create_about (void); diff --git a/mui/gtk-mui/examples/gpassutil/main.c b/mui/gtk-mui/examples/gpassutil/main.c deleted file mode 100644 index 6caefb034..000000000 --- a/mui/gtk-mui/examples/gpassutil/main.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Initial main.c file generated by Glade. Edit as required. - * Glade will not overwrite this file. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -/* -#include -*/ -#include - -#include "interface.h" -#include "support.h" - -GtkWidget *window; - -int -main (int argc, char *argv[]) -{ - -#ifdef ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); -#endif - -/* - gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, - argc, argv, - GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR, - NULL); - */ - gtk_init (&argc, &argv); - - - /* - * The following code was added by Glade to create one of each component - * (except popup menus), just so that you see something after building - * the project. Delete any components that you don't want shown initially. - */ - window = create_window (); - gtk_widget_show (window); - - gtk_main (); - return 0; -} diff --git a/mui/gtk-mui/examples/gpassutil/mmakefile.src b/mui/gtk-mui/examples/gpassutil/mmakefile.src deleted file mode 100644 index d6851f1df..000000000 --- a/mui/gtk-mui/examples/gpassutil/mmakefile.src +++ /dev/null @@ -1,11 +0,0 @@ -include $(TOP)/config/make.cfg - -#MM contrib-gtk-mui-examples-gpassutil : includes linklibs contrib-gtk-mui - -USER_CFLAGS := -I../ -I./ - -%build_prog mmake=contrib-gtk-mui-examples-gpassutil \ - progname=gpassutil targetdir=$(CONTRIBDIR)/mui/gtk-mui/examples \ - files="callbacks interface main support" uselibs="gtk-mui mui arossupport amiga arosc m" - -%common diff --git a/mui/gtk-mui/examples/gpassutil/support.c b/mui/gtk-mui/examples/gpassutil/support.c deleted file mode 100644 index 5a5b607fb..000000000 --- a/mui/gtk-mui/examples/gpassutil/support.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include - -#include - -#include "support.h" - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (!parent) - parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename) -{ - GtkWidget *pixmap; - gchar *pathname; - - if (!filename || !filename[0]) - return gtk_image_new (); - - pathname = g_strdup("PROGDIR:");/*gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, - filename, TRUE, NULL);*/ - if (!pathname) - { - g_warning ("Couldn't find pixmap file: %s", filename); - return gtk_image_new (); - } - - pixmap = gtk_image_new_from_file (pathname); - g_free (pathname); - return pixmap; -} - -/* This is an internally used function to create pixmaps. */ -GdkPixbuf* -create_pixbuf (const gchar *filename) -{ - gchar *pathname = NULL; - GdkPixbuf *pixbuf; - GError *error = NULL; - - if (!filename || !filename[0]) - return NULL; - - pathname = g_strdup("PROGDIR:"); /*gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP, - filename, TRUE, NULL);*/ - - if (!pathname) - { - g_warning ("Couldn't find pixmap file: %s", filename); - return NULL; - } - - pixbuf = gdk_pixbuf_new_from_file (pathname, &error); - if (!pixbuf) - { - fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", - pathname, error->message); - g_error_free (error); - } - g_free (pathname); - return pixbuf; -} - -/* This is used to set ATK action descriptions. */ -/* -void -glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description) -{ - gint n_actions, i; - - n_actions = atk_action_get_n_actions (action); - for (i = 0; i < n_actions; i++) - { - if (!strcmp (atk_action_get_name (action, i), action_name)) - atk_action_set_description (action, i, description); - } -} -*/ diff --git a/mui/gtk-mui/examples/gpassutil/support.h b/mui/gtk-mui/examples/gpassutil/support.h deleted file mode 100644 index c6287e2df..000000000 --- a/mui/gtk-mui/examples/gpassutil/support.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#undef Q_ -#ifdef ENABLE_NLS -# define Q_(String) g_strip_context ((String), gettext (String)) -#else -# define Q_(String) g_strip_context ((String), (String)) -#endif - - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget* lookup_widget (GtkWidget *widget, - const gchar *widget_name); - - - -/* - * Private Functions. - */ - -/* This is used to create the pixmaps used in the interface. */ -GtkWidget* create_pixmap (GtkWidget *widget, - const gchar *filename); - -/* This is used to create the pixbufs used in the interface. */ -GdkPixbuf* create_pixbuf (const gchar *filename); - -/* This is used to set ATK action descriptions. */ -void glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description); - diff --git a/mui/gtk-mui/examples/gtk.png b/mui/gtk-mui/examples/gtk.png deleted file mode 100644 index afe269bc2173c0cf4a80e37102449626808b9667..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 1137 zcwQY+e`wZa5Wn>{*$)J_evu{J+;B7y3Tybs%3HkdebKnkoN3aVfVt^fvTKn83e z25MjiZU7GGKo0C64(ebI?twWl2At>|O`={rjjTk8NQA^lf}}`>=nMs(G$(Xz#iIS--Btj}=LS8UO&G)P%N~&Z^UdVx#McGJ<)X0py&U|frimLDrMN&xTG3C&5u<_ zw!~R2_Q2PV+!_fjgXRA9D^Kp5>~BAcO^x4w`OWe}&mH@%>m{1oF|_yk7l*nJFC8r% zyz1#yZQE8I*>&Og&WAUyeD&(uc>5`?-M(nu6?;xUxVY4||Ak)~#y6k2cg=zoPwfBd zfoHpZJhH6){ssSx&g?$$LA7t7e|W18R4T)-G<9!O93OuD(du-=(l>W}KD&LkR{3z> z4ZUMMy&s?W^u4_ehexkF)9}fam$v>|JAJPC_s1{ay?kuRN3CxSUVP@MiIGE{eU-kB zk>g{V&o+0|w`{ANzhvr`3uoIdZhdIkfAr*v){fcFI`5lV_wwZYc;DaWZ|vFh$2C)n z?!tE(cYRyxJo(d}iBsKo&up6S=zZ -#include -#include -#include - -#include "gtkdial.h" -#include "../debug.h" - -#define SCROLL_DELAY_LENGTH 300 -#define DIAL_DEFAULT_SIZE 100 - -/* Forward declarations */ - -static void gtk_dial_class_init (GtkDialClass *klass); -static void gtk_dial_init (GtkDial *dial); -static void gtk_dial_destroy (GtkObject *object); -static void gtk_dial_realize (GtkWidget *widget); -static void gtk_dial_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_dial_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static gint gtk_dial_expose (GtkWidget *widget, - GdkEventExpose *event); -static gint gtk_dial_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_dial_button_release (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_dial_motion_notify (GtkWidget *widget, - GdkEventMotion *event); -static gint gtk_dial_timer (GtkDial *dial); - -static void gtk_dial_update_mouse (GtkDial *dial, gint x, gint y); -static void gtk_dial_update (GtkDial *dial); -static void gtk_dial_adjustment_changed (GtkAdjustment *adjustment, - gpointer data); -static void gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment, - gpointer data); - -/* Local data */ - -static GtkWidgetClass *parent_class = NULL; - -GType -gtk_dial_get_type () -{ - static GType dial_type = 0; - - DebOut("1\n"); - - if (!dial_type) - { - static const GTypeInfo dial_info = - { - sizeof (GtkDialClass), - NULL, - NULL, - (GClassInitFunc) gtk_dial_class_init, - NULL, - NULL, - sizeof (GtkDial), - 0, - (GInstanceInitFunc) gtk_dial_init, - }; - - DebOut("2\n"); - dial_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkDial", &dial_info, 0); - DebOut("3\n"); - } - - return dial_type; -} - -static void -gtk_dial_class_init (GtkDialClass *class) -{ - DebOut("========================= gtk_dial_class_init =================\n"); - DebOut("class=%lx\n",class); - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - - parent_class = gtk_type_class (gtk_widget_get_type ()); - - object_class->destroy = gtk_dial_destroy; /* TODO */ - - widget_class->realize = gtk_dial_realize; - widget_class->expose_event = gtk_dial_expose; - widget_class->size_request = gtk_dial_size_request; - widget_class->size_allocate = gtk_dial_size_allocate; - widget_class->button_press_event = gtk_dial_button_press; /* TODO */ - widget_class->button_release_event = gtk_dial_button_release; /* TODO */ - widget_class->motion_notify_event = gtk_dial_motion_notify; /* TODO */ - -} - -static void -gtk_dial_init (GtkDial *dial) -{ - - DebOut("=============== gtk_dial_init ===================== \n"); - DebOut(" dialconstructor(%lx)\n",dial); - dial->button = 0; - dial->policy = GTK_UPDATE_CONTINUOUS; - dial->timer = 0; - dial->radius = 0; - dial->pointer_width = 0; - dial->angle = 0.0; - dial->old_value = 0.0; - dial->old_lower = 0.0; - dial->old_upper = 0.0; - dial->adjustment = NULL; -} - -GtkWidget* -gtk_dial_new (GtkAdjustment *adjustment) -{ - GtkDial *dial; - - DebOut("=============== gtk_dial_new ===================== \n"); - dial = g_object_new (gtk_dial_get_type (), NULL); - DebOut("dial=%lx\n",dial); - - if (!adjustment) - adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - - gtk_dial_set_adjustment (dial, adjustment); - - return GTK_WIDGET (dial); -} - -static void -gtk_dial_destroy (GtkObject *object) -{ - GtkDial *dial; - -DebOut("ok\n"); - g_return_if_fail (object != NULL); - g_return_if_fail (GTK_IS_DIAL (object)); - -DebOut("ok\n"); - dial = GTK_DIAL (object); -DebOut("ok ok\n"); - - if (dial->adjustment) - { - g_object_unref (GTK_OBJECT (dial->adjustment)); - dial->adjustment = NULL; - } - -DebOut("ok ok ok\n"); - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -GtkAdjustment* -gtk_dial_get_adjustment (GtkDial *dial) -{ - g_return_val_if_fail (dial != NULL, NULL); - g_return_val_if_fail (GTK_IS_DIAL (dial), NULL); - - return dial->adjustment; -} - -void -gtk_dial_set_update_policy (GtkDial *dial, - GtkUpdateType policy) -{ - g_return_if_fail (dial != NULL); - g_return_if_fail (GTK_IS_DIAL (dial)); - - dial->policy = policy; -} - -void -gtk_dial_set_adjustment (GtkDial *dial, - GtkAdjustment *adjustment) -{ - g_return_if_fail (dial != NULL); - g_return_if_fail (GTK_IS_DIAL (dial)); - - DebOut("ok\n"); - DebOut("dial: %lx\n",dial); - DebOut("dial->adjustment: %lx",dial->adjustment); - if (dial->adjustment) - { - g_signal_handlers_disconnect_by_func (GTK_OBJECT (dial->adjustment), NULL, (gpointer) dial); - g_object_unref (GTK_OBJECT (dial->adjustment)); - } - DebOut("ok ok\n"); - - dial->adjustment = adjustment; - g_object_ref (GTK_OBJECT (dial->adjustment)); - DebOut("ok ok ok\n"); - - g_signal_connect (GTK_OBJECT (adjustment), "changed", - GTK_SIGNAL_FUNC (gtk_dial_adjustment_changed), - (gpointer) dial); - g_signal_connect (GTK_OBJECT (adjustment), "value_changed", - GTK_SIGNAL_FUNC (gtk_dial_adjustment_value_changed), - (gpointer) dial); - - dial->old_value = adjustment->value; - dial->old_lower = adjustment->lower; - dial->old_upper = adjustment->upper; - - gtk_dial_update (dial); -} - -static void -gtk_dial_realize (GtkWidget *widget) -{ - - DebOut("====================== gtk_dial_realize ======================\n"); - GtkDial *dial; - GdkWindowAttr attributes; - gint attributes_mask; - - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_DIAL (widget)); - - GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); - dial = GTK_DIAL (widget); - - attributes.x = widget->allocation.x; - attributes.y = widget->allocation.y; - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.window_type = GDK_WINDOW_CHILD; - attributes.event_mask = gtk_widget_get_events (widget) | - GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask); - widget->style = gtk_style_attach (widget->style, widget->window); - - gdk_window_set_user_data (widget->window, widget); - - gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE); -} - -static void -gtk_dial_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - requisition->width = DIAL_DEFAULT_SIZE; - requisition->height = DIAL_DEFAULT_SIZE; -} - -static void -gtk_dial_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkDial *dial; - - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_DIAL (widget)); - g_return_if_fail (allocation != NULL); - - DebOut(" ================= gtk_dial_size_allocate ==================\n"); - - widget->allocation = *allocation; - dial = GTK_DIAL (widget); - - if (GTK_WIDGET_REALIZED (widget)) - { - - gdk_window_move_resize (widget->window, - allocation->x, allocation->y, - allocation->width, allocation->height); - - } - dial->radius = MIN (allocation->width, allocation->height) * 0.45; - dial->pointer_width = dial->radius / 5; - - DebOut("dial->radius=%d\n",dial->radius); - DebOut("dial->pointer_width=%d\n",dial->pointer_width); -} - -static void testme(GtkWidget *widget) { - gint w, h; - w=widget->allocation.width; - h=widget->allocation.height; - - /* boxes */ - - gtk_paint_box (widget->style,widget->window,GTK_STATE_NORMAL,GTK_SHADOW_OUT,NULL,widget,NULL,0,0,w/4,h/4); - - - gtk_paint_slider(widget->style,widget->window,GTK_STATE_NORMAL,GTK_SHADOW_OUT,NULL,widget,"hscale",w/3,0,w/4,h/4,GTK_ORIENTATION_HORIZONTAL); - - gtk_paint_flat_box(widget->style,widget->window,GTK_STATE_NORMAL,GTK_SHADOW_OUT,NULL,widget,"text",2*w/3,0,w/4,h/4); - /* arrows */ - - gtk_paint_arrow(widget->style,widget->window,GTK_STATE_SELECTED,GTK_SHADOW_OUT,NULL,widget,NULL,GTK_ARROW_DOWN,1,0,h/3,w/4,h/4); - gtk_paint_arrow(widget->style,widget->window,GTK_STATE_NORMAL,GTK_SHADOW_OUT,NULL,widget,NULL,GTK_ARROW_UP,0,w/3,h/3,w/4,h/4); - gtk_paint_arrow(widget->style,widget->window,GTK_STATE_NORMAL,GTK_SHADOW_OUT,NULL,widget,NULL,GTK_ARROW_LEFT,1,2*w/3,h/3,w/4,h/4); - - /* check */ - gtk_paint_check(widget->style,widget->window,GTK_STATE_NORMAL,GTK_SHADOW_OUT,NULL,widget,"cellcheck",0,2*h/3,w/4,h/4); - gtk_paint_check(widget->style,widget->window,GTK_STATE_ACTIVE,GTK_SHADOW_OUT,NULL,widget,NULL,w/3,2*h/3,w/4,h/4); - /* extension */ - gtk_paint_extension(widget->style,widget->window,GTK_STATE_ACTIVE,GTK_SHADOW_OUT,NULL,widget,NULL,2*w/3,2*h/3,w/4,h/4,GTK_POS_RIGHT); - -} - -static gint -gtk_dial_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - GtkDial *dial; - GdkPoint points[6]; - gdouble s,c; - gdouble theta, last, increment; - GtkStyle *blankstyle; - gint xc, yc; - gint upper, lower; - gint tick_length; - gint i, inc; - - DebOut("====================== gtk_dial_expose ========================\n"); - g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - DebOut("1\n"); - - if (event->count > 0) - return FALSE; - - DebOut("2\n"); - - dial = GTK_DIAL (widget); - - gdk_window_clear_area (widget->window, - 0, 0, - widget->allocation.width, - widget->allocation.height); - - xc = widget->allocation.width / 2; - yc = widget->allocation.height / 2; - - upper = dial->adjustment->upper; - lower = dial->adjustment->lower; - - /* Erase old pointer */ - - DebOut(" dial->last_angle=%d\n",dial->last_angle/2); - s = sin (dial->last_angle); - c = cos (dial->last_angle); - dial->last_angle = dial->angle; - - points[0].x = xc + s*dial->pointer_width/2; - points[0].y = yc + c*dial->pointer_width/2; - DebOut("points[0].x:\n"); - DebOut(" xc=%d\n",xc); - DebOut(" yc=%d\n",yc); - DebOut(" s=%d\n",s); - DebOut(" c=%d\n",c); - DebOut(" dial->pointer_width=%d\n",dial->pointer_width/2); - DebOut(" dial->angle=%d\n",dial->angle); - - points[1].x = xc + c*dial->radius; - points[1].y = yc - s*dial->radius; - points[2].x = xc - s*dial->pointer_width/2; - points[2].y = yc - c*dial->pointer_width/2; - points[3].x = xc - c*dial->radius/10; - points[3].y = yc + s*dial->radius/10; - points[4].x = points[0].x; - points[4].y = points[0].y; - - blankstyle = gtk_style_new (); - - blankstyle->bg_gc[GTK_STATE_NORMAL] = - widget->style->bg_gc[GTK_STATE_NORMAL]; - blankstyle->dark_gc[GTK_STATE_NORMAL] = - widget->style->bg_gc[GTK_STATE_NORMAL]; - blankstyle->light_gc[GTK_STATE_NORMAL] = - widget->style->bg_gc[GTK_STATE_NORMAL]; - blankstyle->black_gc = - widget->style->bg_gc[GTK_STATE_NORMAL]; - - gtk_paint_polygon (blankstyle, - widget->window, - GTK_STATE_NORMAL, - GTK_SHADOW_OUT, - NULL, - widget, - NULL, - points, 5, - FALSE); - - g_object_unref (blankstyle); - - - /* Draw ticks */ - - if ((upper - lower) == 0) - return FALSE; - - DebOut("4 Draw Ticks\n"); - - increment = (100*M_PI) / (dial->radius*dial->radius); - - inc = (upper - lower); - - while (inc < 100) inc *= 10; - while (inc >= 1000) inc /= 10; - last = -1; - - DebOut("4a Draw Ticks\n"); - - - for (i = 0; i <= inc; i++) - { - - theta = ((gfloat)i*M_PI / (18*inc/24.) - M_PI/6.); - - if ((theta - last) < (increment)) - continue; - last = theta; - - s = sin (theta); - c = cos (theta); - - tick_length = (i%(inc/10) == 0) ? dial->pointer_width : dial->pointer_width / 2; - - - gdk_draw_line (widget->window, - widget->style->fg_gc[widget->state], - xc + c*(dial->radius - tick_length), - yc - s*(dial->radius - tick_length), - xc + c*dial->radius, - yc - s*dial->radius); - } - - DebOut("4b Draw Ticks\n"); - - /* Draw pointer */ - - s = sin (dial->angle); - c = cos (dial->angle); - dial->last_angle = dial->angle; - - points[0].x = xc + s*dial->pointer_width/2; - points[0].y = yc + c*dial->pointer_width/2; - points[1].x = xc + c*dial->radius; - points[1].y = yc - s*dial->radius; - points[2].x = xc - s*dial->pointer_width/2; - points[2].y = yc - c*dial->pointer_width/2; - points[3].x = xc - c*dial->radius/10; - points[3].y = yc + s*dial->radius/10; - points[4].x = points[0].x; - points[4].y = points[0].y; - - gtk_paint_polygon (widget->style, - widget->window, - GTK_STATE_NORMAL, - GTK_SHADOW_OUT, - NULL, - widget, - NULL, - points, 5, - TRUE); - -#if 0 - testme(widget); -#endif - - return FALSE; -} - -static gint -gtk_dial_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - GtkDial *dial; - gint dx, dy; - double s, c; - double d_parallel; - double d_perpendicular; - - g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - dial = GTK_DIAL (widget); - - /* Determine if button press was within pointer region - we - do this by computing the parallel and perpendicular distance of - the point where the mouse was pressed from the line passing through - the pointer */ - - dx = event->x - widget->allocation.width / 2; - dy = widget->allocation.height / 2 - event->y; - - s = sin (dial->angle); - c = cos (dial->angle); - - d_parallel = s*dy + c*dx; - d_perpendicular = fabs (s*dx - c*dy); - - if (!dial->button && - (d_perpendicular < dial->pointer_width/2) && - (d_parallel > - dial->pointer_width)) - { - gtk_grab_add (widget); - - dial->button = event->button; - - gtk_dial_update_mouse (dial, event->x, event->y); - } - - return FALSE; -} - -static gint -gtk_dial_button_release (GtkWidget *widget, - GdkEventButton *event) -{ - GtkDial *dial; - - g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - dial = GTK_DIAL (widget); - - if (dial->button == event->button) - { - gtk_grab_remove (widget); - - dial->button = 0; - - if (dial->policy == GTK_UPDATE_DELAYED) - gtk_timeout_remove (dial->timer); - - if ((dial->policy != GTK_UPDATE_CONTINUOUS) && - (dial->old_value != dial->adjustment->value)) - g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); - } - - return FALSE; -} - -static gint -gtk_dial_motion_notify (GtkWidget *widget, - GdkEventMotion *event) -{ - GtkDial *dial; - GdkModifierType mods; - gint x, y, mask; - - g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - dial = GTK_DIAL (widget); - - if (dial->button != 0) - { - x = event->x; - y = event->y; - - if (event->is_hint || (event->window != widget->window)) - gdk_window_get_pointer (widget->window, &x, &y, &mods); - - switch (dial->button) - { - case 1: - mask = GDK_BUTTON1_MASK; - break; - case 2: - mask = GDK_BUTTON2_MASK; - break; - case 3: - mask = GDK_BUTTON3_MASK; - break; - default: - mask = 0; - break; - } - - if (mods & mask) - gtk_dial_update_mouse (dial, x,y); - } - - return FALSE; -} - -static gint -gtk_dial_timer (GtkDial *dial) -{ - g_return_val_if_fail (dial != NULL, FALSE); - g_return_val_if_fail (GTK_IS_DIAL (dial), FALSE); - - if (dial->policy == GTK_UPDATE_DELAYED) - g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); - - return FALSE; -} - -static void -gtk_dial_update_mouse (GtkDial *dial, gint x, gint y) -{ - gint xc, yc; - gfloat old_value; - - g_return_if_fail (dial != NULL); - g_return_if_fail (GTK_IS_DIAL (dial)); - - xc = GTK_WIDGET(dial)->allocation.width / 2; - yc = GTK_WIDGET(dial)->allocation.height / 2; - - old_value = dial->adjustment->value; - dial->angle = atan2(yc-y, x-xc); - - if (dial->angle < -M_PI/2.) - dial->angle += 2*M_PI; - - if (dial->angle < -M_PI/6) - dial->angle = -M_PI/6; - - if (dial->angle > 7.*M_PI/6.) - dial->angle = 7.*M_PI/6.; - - dial->adjustment->value = dial->adjustment->lower + (7.*M_PI/6 - dial->angle) * - (dial->adjustment->upper - dial->adjustment->lower) / (4.*M_PI/3.); - - if (dial->adjustment->value != old_value) - { - if (dial->policy == GTK_UPDATE_CONTINUOUS) - { - g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); - } - else - { - gtk_widget_queue_draw (GTK_WIDGET (dial)); - - if (dial->policy == GTK_UPDATE_DELAYED) - { - if (dial->timer) - gtk_timeout_remove (dial->timer); - - dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH, - (GtkFunction) gtk_dial_timer, - (gpointer) dial); - } - } - } -} - -static void -gtk_dial_update (GtkDial *dial) -{ - gfloat new_value; - - g_return_if_fail (dial != NULL); - g_return_if_fail (GTK_IS_DIAL (dial)); - - new_value = dial->adjustment->value; - - if (new_value < dial->adjustment->lower) - new_value = dial->adjustment->lower; - - if (new_value > dial->adjustment->upper) - new_value = dial->adjustment->upper; - - if (new_value != dial->adjustment->value) - { - dial->adjustment->value = new_value; - g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); - } - - dial->angle = 7.*M_PI/6. - (new_value - dial->adjustment->lower) * 4.*M_PI/3. / - (dial->adjustment->upper - dial->adjustment->lower); - - gtk_widget_queue_draw (GTK_WIDGET (dial)); -} - -static void -gtk_dial_adjustment_changed (GtkAdjustment *adjustment, - gpointer data) -{ - GtkDial *dial; - - g_return_if_fail (adjustment != NULL); - g_return_if_fail (data != NULL); - - dial = GTK_DIAL (data); - - if ((dial->old_value != adjustment->value) || - (dial->old_lower != adjustment->lower) || - (dial->old_upper != adjustment->upper)) - { - gtk_dial_update (dial); - - dial->old_value = adjustment->value; - dial->old_lower = adjustment->lower; - dial->old_upper = adjustment->upper; - } -} - -static void -gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment, - gpointer data) -{ - GtkDial *dial; - - g_return_if_fail (adjustment != NULL); - g_return_if_fail (data != NULL); - - dial = GTK_DIAL (data); - - if (dial->old_value != adjustment->value) - { - gtk_dial_update (dial); - - dial->old_value = adjustment->value; - } -} diff --git a/mui/gtk-mui/examples/gtkdial.h b/mui/gtk-mui/examples/gtkdial.h deleted file mode 100644 index 850d7ea1e..000000000 --- a/mui/gtk-mui/examples/gtkdial.h +++ /dev/null @@ -1,91 +0,0 @@ - -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ -#ifndef __GTK_DIAL_H__ -#define __GTK_DIAL_H__ - - -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -#define GTK_DIAL(obj) GTK_CHECK_CAST (obj, gtk_dial_get_type (), GtkDial) -#define GTK_DIAL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_dial_get_type (), GtkDialClass) -#define GTK_IS_DIAL(obj) GTK_CHECK_TYPE (obj, gtk_dial_get_type ()) - - -typedef struct _GtkDial GtkDial; -typedef struct _GtkDialClass GtkDialClass; - -struct _GtkDial -{ - GtkWidget widget; - - /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */ - guint policy : 2; - - /* Button currently pressed or 0 if none */ - guint8 button; - - /* Dimensions of dial components */ - gint radius; - gint pointer_width; - - /* ID of update timer, or 0 if none */ - guint32 timer; - - /* Current angle */ - gfloat angle; - gfloat last_angle; - - /* Old values from adjustment stored so we know when something changes */ - gfloat old_value; - gfloat old_lower; - gfloat old_upper; - - /* The adjustment object that stores the data for this dial */ - GtkAdjustment *adjustment; -}; - -struct _GtkDialClass -{ - GtkWidgetClass parent_class; -}; - - -GtkWidget* gtk_dial_new (GtkAdjustment *adjustment); -GtkType gtk_dial_get_type (void); -GtkAdjustment* gtk_dial_get_adjustment (GtkDial *dial); -void gtk_dial_set_update_policy (GtkDial *dial, - GtkUpdateType policy); - -void gtk_dial_set_adjustment (GtkDial *dial, - GtkAdjustment *adjustment); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __GTK_DIAL_H__ */ diff --git a/mui/gtk-mui/examples/menu.c b/mui/gtk-mui/examples/menu.c deleted file mode 100644 index b72b34472..000000000 --- a/mui/gtk-mui/examples/menu.c +++ /dev/null @@ -1,134 +0,0 @@ - -#include -#include - -static gint button_press (GtkWidget *, GdkEvent *); -static void menuitem_response (gchar *); - -int main( int argc, - char *argv[] ) -{ - - GtkWidget *window; - GtkWidget *menu; - GtkWidget *menu_bar; - GtkWidget *root_menu; - GtkWidget *menu_items; - GtkWidget *vbox; - GtkWidget *button; - char buf[128]; - int i; - - gtk_init (&argc, &argv); - - /* create a new window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - //gtk_widget_set_size_request (GTK_WIDGET (window), 200, 100); - gtk_window_set_title (GTK_WINDOW (window), "GTK Menu Test"); - g_signal_connect (G_OBJECT (window), "delete_event", - G_CALLBACK (gtk_main_quit), NULL); - - /* Init the menu-widget, and remember -- never - * gtk_show_widget() the menu widget!! - * This is the menu that holds the menu items, the one that - * will pop up when you click on the "Root Menu" in the app */ - menu = gtk_menu_new (); - - /* Next we make a little loop that makes three menu-entries for "test-menu". - * Notice the call to gtk_menu_shell_append. Here we are adding a list of - * menu items to our menu. Normally, we'd also catch the "clicked" - * signal on each of the menu items and setup a callback for it, - * but it's omitted here to save space. */ - - for (i = 0; i < 3; i++) - { - /* Copy the names to the buf. */ - sprintf (buf, "Test-undermenu - %d", i); - - /* Create a new menu-item with a name... */ - menu_items = gtk_menu_item_new_with_label (buf); - - /* ...and add it to the menu. */ - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - - /* Do something interesting when the menuitem is selected */ - g_signal_connect_swapped (G_OBJECT (menu_items), "activate", - G_CALLBACK (menuitem_response), - (gpointer) g_strdup (buf)); - - /* Show the widget */ - gtk_widget_show (menu_items); - } - - /* This is the root menu, and will be the label - * displayed on the menu bar. There won't be a signal handler attached, - * as it only pops up the rest of the menu when pressed. */ - root_menu = gtk_menu_item_new_with_label ("Root Menu"); - - gtk_widget_show (root_menu); - - /* Now we specify that we want our newly created "menu" to be the menu - * for the "root menu" */ - gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu); - - /* A vbox to put a menu and a button in: */ - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_widget_show (vbox); - - /* Create a menu-bar to hold the menus and add it to our main window */ - menu_bar = gtk_menu_bar_new (); - gtk_box_pack_start (GTK_BOX (vbox), menu_bar, FALSE, FALSE, 2); - gtk_widget_show (menu_bar); - - /* Create a button to which to attach menu as a popup */ - button = gtk_button_new_with_label ("press me"); - g_signal_connect_swapped (G_OBJECT (button), "event", - G_CALLBACK (button_press), - G_OBJECT (menu)); - gtk_box_pack_end (GTK_BOX (vbox), button, TRUE, TRUE, 2); - gtk_widget_show (button); - - /* And finally we append the menu-item to the menu-bar -- this is the - * "root" menu-item I have been raving about =) */ - gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), root_menu); - - /* always display the window as the last step so it all splashes on - * the screen at once. */ - gtk_widget_show (window); - - gtk_main (); - - return 0; -} - -/* Respond to a button-press by posting a menu passed in as widget. - * - * Note that the "widget" argument is the menu being posted, NOT - * the button that was pressed. - */ - -static gint button_press( GtkWidget *widget, - GdkEvent *event ) -{ - - if (event->type == GDK_BUTTON_PRESS) { - GdkEventButton *bevent = (GdkEventButton *) event; -/* gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, - bevent->button, bevent->time);*/ - /* Tell calling code that we have handled this event; the buck - * stops here. */ - return TRUE; - } - - /* Tell calling code that we have not handled this event; pass it on. */ - return FALSE; -} - - -/* Print a string when a menu item is selected */ - -static void menuitem_response( gchar *string ) -{ - printf ("%s\n", string); -} diff --git a/mui/gtk-mui/examples/mmakefile.src b/mui/gtk-mui/examples/mmakefile.src deleted file mode 100755 index a180dbd7e..000000000 --- a/mui/gtk-mui/examples/mmakefile.src +++ /dev/null @@ -1,31 +0,0 @@ - -# $Id$ -# -# gtk-mui example progs -# -include $(TOP)/config/make.cfg - -#MM contrib-gtk-mui-examples: includes linklibs contrib-gtk-mui - -GTKMUIEXAMPLES := arrow \ - buttons \ - entry \ - filesel \ - fixed \ - frame \ - menu \ - notebook \ - progressbar \ - radiobuttons \ - spinbutton \ - table \ - toolbar \ - tooltips \ - -USER_CFLAGS= -I../ - -%build_progs mmake=contrib-gtk-mui-examples files=$(GTKMUIEXAMPLES) \ - targetdir=$(CONTRIBDIR)/mui/gtk-mui/examples \ - uselibs="gtk-mui mui arossupport amiga arosc m" - -%common diff --git a/mui/gtk-mui/examples/notebook.c b/mui/gtk-mui/examples/notebook.c deleted file mode 100644 index 519bcfa58..000000000 --- a/mui/gtk-mui/examples/notebook.c +++ /dev/null @@ -1,174 +0,0 @@ - -#include -#include - -/* This function rotates the position of the tabs */ -void rotate_book( GtkButton *button, - GtkNotebook *notebook ) -{ -// gtk_notebook_set_tab_pos (notebook, (notebook->tab_pos + 1) % 4); -} - -/* Add/Remove the page tabs and the borders */ -void tabsborder_book( GtkButton *button, - GtkNotebook *notebook ) -{ - gint tval = FALSE; - gint bval = FALSE; - if (notebook->show_tabs == 0) - tval = TRUE; - if (notebook->show_border == 0) - bval = TRUE; - -// gtk_notebook_set_show_tabs (notebook, tval); -// gtk_notebook_set_show_border (notebook, bval); -} - -/* Remove a page from the notebook */ -void remove_book( GtkButton *button, - GtkNotebook *notebook ) -{ - -// page = gtk_notebook_get_current_page (notebook); -// gtk_notebook_remove_page (notebook, page); - /* Need to refresh the widget -- - This forces the widget to redraw itself. */ -// gtk_widget_queue_draw (GTK_WIDGET (notebook)); -} - -gint delete( GtkWidget *widget, - GtkWidget *event, - gpointer data ) -{ - gtk_main_quit (); - return FALSE; -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window; - GtkWidget *button; - GtkWidget *table; - GtkWidget *notebook; - GtkWidget *frame; - GtkWidget *label; - GtkWidget *checkbutton; - int i; - char bufferf[32]; - char bufferl[32]; - - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - g_signal_connect (G_OBJECT (window), "delete_event", - G_CALLBACK (delete), NULL); - - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - table = gtk_table_new (3, 6, FALSE); - gtk_container_add (GTK_CONTAINER (window), table); - - /* Create a new notebook, place the position of the tabs */ - notebook = gtk_notebook_new (); -// gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP); - gtk_table_attach_defaults (GTK_TABLE (table), notebook, 0, 6, 0, 1); - gtk_widget_show (notebook); - - /* Let's append a bunch of pages to the notebook */ - for (i = 0; i < 5; i++) { - sprintf(bufferf, "Append Frame %d", i + 1); - sprintf(bufferl, "Page %d", i + 1); - - frame = gtk_frame_new (bufferf); - gtk_container_set_border_width (GTK_CONTAINER (frame), 10); - gtk_widget_set_size_request (frame, 100, 75); - gtk_widget_show (frame); - - label = gtk_label_new (bufferf); - gtk_container_add (GTK_CONTAINER (frame), label); - gtk_widget_show (label); - - label = gtk_label_new (bufferl); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label); - } - - /* Now let's add a page to a specific spot */ - checkbutton = gtk_check_button_new_with_label ("Check me please!"); - gtk_widget_set_size_request (checkbutton, 100, 75); - gtk_widget_show (checkbutton); - - label = gtk_label_new ("Add page"); -// gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), checkbutton, label, 2); - - /* Now finally let's prepend pages to the notebook */ - for (i = 0; i < 5; i++) { - sprintf (bufferf, "Prepend Frame %d", i + 1); - sprintf (bufferl, "PPage %d", i + 1); - - frame = gtk_frame_new (bufferf); - gtk_container_set_border_width (GTK_CONTAINER (frame), 10); - gtk_widget_set_size_request (frame, 100, 75); - gtk_widget_show (frame); - - label = gtk_label_new (bufferf); - gtk_container_add (GTK_CONTAINER (frame), label); - gtk_widget_show (label); - - label = gtk_label_new (bufferl); - gtk_notebook_prepend_page (GTK_NOTEBOOK (notebook), frame, label); - } - - /* Set what page to start at (page 4) */ -// gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 3); - - /* Create a bunch of buttons */ - button = gtk_button_new_with_label ("close me here"); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (delete), NULL); - gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 1, 2); - gtk_widget_show (button); - - button = gtk_button_new_with_label ("next page"); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (gtk_notebook_next_page), - G_OBJECT (notebook)); - gtk_table_attach_defaults (GTK_TABLE (table), button, 1, 2, 1, 2); - gtk_widget_show (button); - - button = gtk_button_new_with_label ("prev page"); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (gtk_notebook_prev_page), - G_OBJECT (notebook)); - gtk_table_attach_defaults (GTK_TABLE (table), button, 2, 3, 1, 2); - gtk_widget_show (button); - - button = gtk_button_new_with_label ("tab position"); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (rotate_book), - (gpointer) notebook); - gtk_table_attach_defaults (GTK_TABLE (table), button, 3, 4, 1, 2); - gtk_widget_show (button); - - button = gtk_button_new_with_label ("tabs/border on/off"); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (tabsborder_book), - (gpointer) notebook); - gtk_table_attach_defaults (GTK_TABLE (table), button, 4, 5, 1, 2); - gtk_widget_show (button); - - button = gtk_button_new_with_label ("remove page"); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (remove_book), - (gpointer) notebook); - gtk_table_attach_defaults (GTK_TABLE (table), button, 5, 6, 1, 2); - gtk_widget_show (button); - - gtk_widget_show (table); - gtk_widget_show (window); - - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/progressbar.c b/mui/gtk-mui/examples/progressbar.c deleted file mode 100644 index e4c882411..000000000 --- a/mui/gtk-mui/examples/progressbar.c +++ /dev/null @@ -1,198 +0,0 @@ - -#include - -typedef struct _ProgressData { - int badmagic; - GtkWidget *window; - GtkWidget *pbar; - int timer; - gboolean activity_mode; -} ProgressData; - -/* Update the value of the progress bar so that we get - * some movement */ -gint progress_timeout( gpointer data ) -{ - ProgressData *pdata = (ProgressData *)data; - gdouble new_val; - - if (pdata->activity_mode) - gtk_progress_bar_pulse (GTK_PROGRESS_BAR (pdata->pbar)); - else - { - /* Calculate the value of the progress bar using the - * value range set in the adjustment object */ - - new_val = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (pdata->pbar)) + 0.01; - - if (new_val > 1.0) - new_val = 0.0; - - /* Set the new value */ - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pdata->pbar), new_val); - } - - /* As this is a timeout function, return TRUE so that it - * continues to get called */ - return TRUE; -} - -/* Callback that toggles the text display within the progress bar trough */ -void toggle_show_text( GtkWidget *widget, - ProgressData *pdata ) -{ - const gchar *text; - - text = gtk_progress_bar_get_text (GTK_PROGRESS_BAR (pdata->pbar)); - if (text && *text) - gtk_progress_bar_set_text (GTK_PROGRESS_BAR (pdata->pbar), ""); - else - gtk_progress_bar_set_text (GTK_PROGRESS_BAR (pdata->pbar), "some text"); -} - -/* Callback that toggles the activity mode of the progress bar */ -void toggle_activity_mode( GtkWidget *widget, - ProgressData *pdata ) -{ - pdata->activity_mode = !pdata->activity_mode; - if (pdata->activity_mode) - gtk_progress_bar_pulse (GTK_PROGRESS_BAR (pdata->pbar)); - else - gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pdata->pbar), 0.0); -} - - -/* Callback that toggles the orientation of the progress bar */ -void toggle_orientation( GtkWidget *widget, - ProgressData *pdata ) -{ - switch (gtk_progress_bar_get_orientation (GTK_PROGRESS_BAR (pdata->pbar))) { - case GTK_PROGRESS_LEFT_TO_RIGHT: - gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (pdata->pbar), - GTK_PROGRESS_RIGHT_TO_LEFT); - break; - case GTK_PROGRESS_RIGHT_TO_LEFT: - gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (pdata->pbar), - GTK_PROGRESS_LEFT_TO_RIGHT); - break; - } -} - - -/* Clean up allocated memory and remove the timer */ -void destroy_progress( GtkWidget *widget, - ProgressData *pdata) -{ - gtk_timeout_remove (pdata->timer); - pdata->timer = 0; - pdata->window = NULL; - g_free (pdata); - gtk_main_quit (); -} - -int main( int argc, - char *argv[]) -{ - ProgressData *pdata; - GtkWidget *separator; - GtkWidget *table; - GtkWidget *button; - GtkWidget *check; - GtkWidget *vbox; - - gtk_init (&argc, &argv); - - /* Allocate memory for the data that is passed to the callbacks */ - //pdata = g_malloc (sizeof (ProgressData)); - pdata = g_new (ProgressData,sizeof (ProgressData)); - pdata->badmagic=BADMAGIC; - - pdata->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_resizable (GTK_WINDOW (pdata->window), TRUE); - - g_signal_connect (G_OBJECT (pdata->window), "destroy", - G_CALLBACK (destroy_progress), - (gpointer) pdata); - gtk_window_set_title (GTK_WINDOW (pdata->window), "GtkProgressBar"); - gtk_container_set_border_width (GTK_CONTAINER (pdata->window), 0); - - vbox = gtk_vbox_new (FALSE, 5); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); - gtk_container_add (GTK_CONTAINER (pdata->window), vbox); - gtk_widget_show (vbox); - - /* Create a centering alignment object */ -// align = gtk_alignment_new (0.5, 0.5, 0, 0); -// gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 5); -// gtk_widget_show (align); - - /* Create the GtkProgressBar */ - pdata->pbar = gtk_progress_bar_new (); - -// gtk_container_add (GTK_CONTAINER (align), pdata->pbar); - gtk_container_add (GTK_CONTAINER (vbox), pdata->pbar); - gtk_widget_show (pdata->pbar); - - /* Add a timer callback to update the value of the progress bar */ - pdata->timer = gtk_timeout_add (100, progress_timeout, pdata); - - separator = gtk_hseparator_new (); - gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); - gtk_widget_show (separator); - - /* rows, columns, homogeneous */ - table = gtk_table_new (3, 2, FALSE); - gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); - gtk_widget_show (table); - - /* Add a check button to select displaying of the trough text */ - check = gtk_check_button_new_with_label ("Show text"); - gtk_table_attach (GTK_TABLE (table), check, 0, 1, 0, 1, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, - 5, 5); - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (toggle_show_text), - (gpointer) pdata); - gtk_widget_show (check); - - /* Add a check button to toggle activity mode */ - check = gtk_check_button_new_with_label ("Activity mode"); - gtk_table_attach (GTK_TABLE (table), check, 0, 1, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, - 5, 5); - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (toggle_activity_mode), - (gpointer) pdata); - gtk_widget_show (check); - - /* Add a check button to toggle orientation */ - check = gtk_check_button_new_with_label ("Right to Left"); - gtk_table_attach (GTK_TABLE (table), check, 0, 1, 2, 3, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, - 5, 5); - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (toggle_orientation), - (gpointer) pdata); - gtk_widget_show (check); - - /* Add a button to exit the program */ - button = gtk_button_new_with_label ("close"); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (gtk_widget_destroy), - G_OBJECT (pdata->window)); - gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - /* This makes it so the button is the default. */ - GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); - - /* This grabs this button to be the default button. Simply hitting - * the "Enter" key will cause this button to activate. */ - gtk_widget_grab_default (button); - gtk_widget_show (button); - - gtk_widget_show (pdata->window); - - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/radiobuttons.c b/mui/gtk-mui/examples/radiobuttons.c deleted file mode 100644 index b71e9fe28..000000000 --- a/mui/gtk-mui/examples/radiobuttons.c +++ /dev/null @@ -1,80 +0,0 @@ - -#include -#include - -gint close_application( GtkWidget *widget, - GdkEvent *event, - gpointer data ) -{ - gtk_main_quit (); - return FALSE; -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window = NULL; - GtkWidget *box1; - GtkWidget *box2; - GtkWidget *button; - GtkWidget *separator; - GSList *group; - - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - g_signal_connect (G_OBJECT (window), "delete_event", - G_CALLBACK (close_application), - NULL); - - gtk_window_set_title (GTK_WINDOW (window), "radio buttons"); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); - - box1 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), box1); - gtk_widget_show (box1); - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - button = gtk_radio_button_new_with_label (NULL, "button1"); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_show (button); - - group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); - button = gtk_radio_button_new_with_label (group, "button2"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_show (button); - - button = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (button), - "button3"); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_show (button); - - separator = gtk_hseparator_new (); - gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); - gtk_widget_show (separator); - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); - gtk_widget_show (box2); - - button = gtk_button_new_with_label ("close"); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (close_application), - G_OBJECT (window)); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); - gtk_widget_grab_default (button); - gtk_widget_show (button); - gtk_widget_show (window); - - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/rangewidgets.c b/mui/gtk-mui/examples/rangewidgets.c deleted file mode 100644 index f4fa7f1b4..000000000 --- a/mui/gtk-mui/examples/rangewidgets.c +++ /dev/null @@ -1,293 +0,0 @@ - -#include - -GtkWidget *hscale, *vscale; - -void cb_pos_menu_select( GtkWidget *item, - GtkPositionType pos ) -{ - /* Set the value position on both scale widgets */ - gtk_scale_set_value_pos (GTK_SCALE (hscale), pos); - gtk_scale_set_value_pos (GTK_SCALE (vscale), pos); -} - -void cb_update_menu_select( GtkWidget *item, - GtkUpdateType policy ) -{ - /* Set the update policy for both scale widgets */ - gtk_range_set_update_policy (GTK_RANGE (hscale), policy); - gtk_range_set_update_policy (GTK_RANGE (vscale), policy); -} - -void cb_digits_scale( GtkAdjustment *adj ) -{ - /* Set the number of decimal places to which adj->value is rounded */ - gtk_scale_set_digits (GTK_SCALE (hscale), (gint) adj->value); - gtk_scale_set_digits (GTK_SCALE (vscale), (gint) adj->value); -} - -void cb_page_size( GtkAdjustment *get, - GtkAdjustment *set ) -{ - /* Set the page size and page increment size of the sample - * adjustment to the value specified by the "Page Size" scale */ - set->page_size = get->value; - set->page_increment = get->value; - - /* This sets the adjustment and makes it emit the "changed" signal to - reconfigure all the widgets that are attached to this signal. */ - gtk_adjustment_set_value (set, CLAMP (set->value, - set->lower, - (set->upper - set->page_size))); -} - -void cb_draw_value( GtkToggleButton *button ) -{ - /* Turn the value display on the scale widgets off or on depending - * on the state of the checkbutton */ - gtk_scale_set_draw_value (GTK_SCALE (hscale), button->active); - gtk_scale_set_draw_value (GTK_SCALE (vscale), button->active); -} - -/* Convenience functions */ - -GtkWidget *make_menu_item (gchar *name, - GCallback callback, - gpointer data) -{ - GtkWidget *item; - - item = gtk_menu_item_new_with_label (name); - g_signal_connect (G_OBJECT (item), "activate", - callback, (gpointer) data); - gtk_widget_show (item); - - return item; -} - -void scale_set_default_values( GtkScale *scale ) -{ - gtk_range_set_update_policy (GTK_RANGE (scale), - GTK_UPDATE_CONTINUOUS); - gtk_scale_set_digits (scale, 1); - gtk_scale_set_value_pos (scale, GTK_POS_TOP); - gtk_scale_set_draw_value (scale, TRUE); -} - -/* makes the sample window */ - -void create_range_controls( void ) -{ - GtkWidget *window; - GtkWidget *box1, *box2, *box3; - GtkWidget *button; - GtkWidget *scrollbar; - GtkWidget *separator; - GtkWidget *opt, *menu, *item; - GtkWidget *label; - GtkWidget *scale; - GtkWidget *adj1, *adj2; - - /* Standard window-creating stuff */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), - NULL); - gtk_window_set_title (GTK_WINDOW (window), "range controls"); - - box1 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), box1); - gtk_widget_show (box1); - - box2 = gtk_hbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - /* value, lower, upper, step_increment, page_increment, page_size */ - /* Note that the page_size value only makes a difference for - * scrollbar widgets, and the highest value you'll get is actually - * (upper - page_size). */ - adj1 = gtk_adjustment_new (0.0, 0.0, 101.0, 0.1, 1.0, 1.0); - - vscale = gtk_vscale_new (GTK_ADJUSTMENT (adj1)); - scale_set_default_values (GTK_SCALE (vscale)); - gtk_box_pack_start (GTK_BOX (box2), vscale, TRUE, TRUE, 0); - gtk_widget_show (vscale); - - box3 = gtk_vbox_new (FALSE, 10); - gtk_box_pack_start (GTK_BOX (box2), box3, TRUE, TRUE, 0); - gtk_widget_show (box3); - - /* Reuse the same adjustment */ - - hscale = gtk_hscale_new (GTK_ADJUSTMENT (adj1)); - gtk_widget_set_size_request (GTK_WIDGET (hscale), 200, -1); - scale_set_default_values (GTK_SCALE (hscale)); - gtk_box_pack_start (GTK_BOX (box3), hscale, TRUE, TRUE, 0); - gtk_widget_show (hscale); - - /* Reuse the same adjustment again */ - scrollbar = gtk_hscrollbar_new (GTK_ADJUSTMENT (adj1)); - /* Notice how this causes the scales to always be updated - * continuously when the scrollbar is moved */ - gtk_range_set_update_policy (GTK_RANGE (scrollbar), - GTK_UPDATE_CONTINUOUS); - gtk_box_pack_start (GTK_BOX (box3), scrollbar, TRUE, TRUE, 0); - gtk_widget_show (scrollbar); - - box2 = gtk_hbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - /* A checkbutton to control whether the value is displayed or not */ - button = gtk_check_button_new_with_label("Display value on scale widgets"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (cb_draw_value), NULL); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_show (button); - - box2 = gtk_hbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - - /* An option menu to change the position of the value */ - label = gtk_label_new ("Scale Value Position:"); - gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); - gtk_widget_show (label); - - opt = gtk_option_menu_new (); - menu = gtk_menu_new (); - - item = make_menu_item ("Top", - G_CALLBACK (cb_pos_menu_select), - GINT_TO_POINTER (GTK_POS_TOP)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - - item = make_menu_item ("Bottom", G_CALLBACK (cb_pos_menu_select), - GINT_TO_POINTER (GTK_POS_BOTTOM)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - - item = make_menu_item ("Left", G_CALLBACK (cb_pos_menu_select), - GINT_TO_POINTER (GTK_POS_LEFT)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - - item = make_menu_item ("Right", G_CALLBACK (cb_pos_menu_select), - GINT_TO_POINTER (GTK_POS_RIGHT)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - - gtk_option_menu_set_menu (GTK_OPTION_MENU (opt), menu); - gtk_box_pack_start (GTK_BOX (box2), opt, TRUE, TRUE, 0); - gtk_widget_show (opt); - - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - box2 = gtk_hbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - - /* Yet another option menu, this time for the update policy of the - * scale widgets */ - label = gtk_label_new ("Scale Update Policy:"); - gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); - gtk_widget_show (label); - - opt = gtk_option_menu_new (); - menu = gtk_menu_new (); - - item = make_menu_item ("Continuous", - G_CALLBACK (cb_update_menu_select), - GINT_TO_POINTER (GTK_UPDATE_CONTINUOUS)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - - item = make_menu_item ("Discontinuous", - G_CALLBACK (cb_update_menu_select), - GINT_TO_POINTER (GTK_UPDATE_DISCONTINUOUS)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - - item = make_menu_item ("Delayed", - G_CALLBACK (cb_update_menu_select), - GINT_TO_POINTER (GTK_UPDATE_DELAYED)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - - gtk_option_menu_set_menu (GTK_OPTION_MENU (opt), menu); - gtk_box_pack_start (GTK_BOX (box2), opt, TRUE, TRUE, 0); - gtk_widget_show (opt); - - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - box2 = gtk_hbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - - /* An HScale widget for adjusting the number of digits on the - * sample scales. */ - label = gtk_label_new ("Scale Digits:"); - gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); - gtk_widget_show (label); - - adj2 = gtk_adjustment_new (1.0, 0.0, 5.0, 1.0, 1.0, 0.0); - g_signal_connect (G_OBJECT (adj2), "value_changed", - G_CALLBACK (cb_digits_scale), NULL); - scale = gtk_hscale_new (GTK_ADJUSTMENT (adj2)); - gtk_scale_set_digits (GTK_SCALE (scale), 0); - gtk_box_pack_start (GTK_BOX (box2), scale, TRUE, TRUE, 0); - gtk_widget_show (scale); - - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - box2 = gtk_hbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - - /* And, one last HScale widget for adjusting the page size of the - * scrollbar. */ - label = gtk_label_new ("Scrollbar Page Size:"); - gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0); - gtk_widget_show (label); - - adj2 = gtk_adjustment_new (1.0, 1.0, 101.0, 1.0, 1.0, 0.0); - g_signal_connect (G_OBJECT (adj2), "value_changed", - G_CALLBACK (cb_page_size), (gpointer) adj1); - scale = gtk_hscale_new (GTK_ADJUSTMENT (adj2)); - gtk_scale_set_digits (GTK_SCALE (scale), 0); - gtk_box_pack_start (GTK_BOX (box2), scale, TRUE, TRUE, 0); - gtk_widget_show (scale); - - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - separator = gtk_hseparator_new (); - gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); - gtk_widget_show (separator); - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); - gtk_widget_show (box2); - - button = gtk_button_new_with_label ("Quit"); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (gtk_main_quit), - NULL); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); - gtk_widget_grab_default (button); - gtk_widget_show (button); - - gtk_widget_show (window); -} - -int main( int argc, - char *argv[] ) -{ - gtk_init (&argc, &argv); - - create_range_controls (); - - gtk_main (); - - return 0; -} - diff --git a/mui/gtk-mui/examples/spinbutton.c b/mui/gtk-mui/examples/spinbutton.c deleted file mode 100644 index 8931e49c9..000000000 --- a/mui/gtk-mui/examples/spinbutton.c +++ /dev/null @@ -1,223 +0,0 @@ - -#include -#include -#ifdef __AROS__ -#include -#endif /* __AROS__ */ -static GtkWidget *spinner1; - -void toggle_snap( GtkWidget *widget, - GtkSpinButton *spin ) -{ -// gtk_spin_button_set_snap_to_ticks (spin, GTK_TOGGLE_BUTTON (widget)->active); -} - -void toggle_numeric( GtkWidget *widget, - GtkSpinButton *spin ) -{ - gtk_spin_button_set_numeric (spin, GTK_TOGGLE_BUTTON (widget)->active); -} - -void change_digits( GtkWidget *widget, - GtkSpinButton *spin ) -{ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (spinner1), - gtk_spin_button_get_value_as_int (spin)); -} - -void get_value( GtkWidget *widget, - gpointer data ) -{ - gchar buf[32]; - GtkLabel *label; - GtkSpinButton *spin; - - spin = GTK_SPIN_BUTTON (spinner1); - label = GTK_LABEL (g_object_get_data (G_OBJECT (widget), "user_data")); - - if (!strcmp(data,"1")) - sprintf (buf, "%d", gtk_spin_button_get_value_as_int (spin)); - else - sprintf (buf, "%0.*f", spin->digits, - gtk_spin_button_get_value (spin)); - gtk_label_set_text (label, buf); -} - - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window; - GtkWidget *frame; - GtkWidget *hbox; - GtkWidget *main_vbox; - GtkWidget *vbox; - GtkWidget *vbox2; - GtkWidget *spinner2; - GtkWidget *spinner; - GtkWidget *button; - GtkWidget *label; - GtkWidget *val_label; - GtkAdjustment *adj; - - /* Initialise GTK */ - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), - NULL); - - gtk_window_set_title (GTK_WINDOW (window), "Spin Button"); - - main_vbox = gtk_vbox_new (FALSE, 5); - gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 10); - gtk_container_add (GTK_CONTAINER (window), main_vbox); - - frame = gtk_frame_new ("Not accelerated"); - gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); - - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); - gtk_container_add (GTK_CONTAINER (frame), vbox); - - /* Day, month, year spinners */ - - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 5); - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); - - label = gtk_label_new ("Day :"); -// gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, - 5.0, 0.0); - spinner = gtk_spin_button_new (adj, 0, 0); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); - gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); - - label = gtk_label_new ("Month :"); -// gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, - 5.0, 0.0); - spinner = gtk_spin_button_new (adj, 0, 0); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE); - gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); - - label = gtk_label_new ("Year :"); -// gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (1998.0, 0.0, 2100.0, - 1.0, 100.0, 0.0); - spinner = gtk_spin_button_new (adj, 0, 0); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), FALSE); - gtk_widget_set_size_request (spinner, 55, -1); - gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0); - - frame = gtk_frame_new ("Accelerated"); - gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); - - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); - gtk_container_add (GTK_CONTAINER (frame), vbox); - - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5); - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); - - label = gtk_label_new ("Value :"); -// gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (0.0, -10000.0, 10000.0, - 0.5, 100.0, 0.0); - spinner1 = gtk_spin_button_new (adj, 1.0, 2); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE); - gtk_widget_set_size_request (spinner1, 100, -1); - gtk_box_pack_start (GTK_BOX (vbox2), spinner1, FALSE, TRUE, 0); - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 5); - - label = gtk_label_new ("Digits :"); -// gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); - gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0); - - adj = (GtkAdjustment *) gtk_adjustment_new (2, 1, 5, 1, 1, 0); - spinner2 = gtk_spin_button_new (adj, 0.0, 0); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner2), TRUE); - g_signal_connect (G_OBJECT (adj), "value_changed", - G_CALLBACK (change_digits), - (gpointer) spinner2); - gtk_box_pack_start (GTK_BOX (vbox2), spinner2, FALSE, TRUE, 0); - - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5); - - button = gtk_check_button_new_with_label ("Snap to 0.5-ticks"); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (toggle_snap), - (gpointer) spinner1); - gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - - button = gtk_check_button_new_with_label ("Numeric only input mode"); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (toggle_numeric), - (gpointer) spinner1); - gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); - - val_label = gtk_label_new (""); - - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5); - button = gtk_button_new_with_label ("Value as Int"); - g_object_set_data (G_OBJECT (button), "user_data", val_label); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (get_value), - "1"); - gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5); - - button = gtk_button_new_with_label ("Value as Float"); - g_object_set_data (G_OBJECT (button), "user_data", val_label); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (get_value), - "2"); - gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5); - - gtk_box_pack_start (GTK_BOX (vbox), val_label, TRUE, TRUE, 0); - gtk_label_set_text (GTK_LABEL (val_label), "0"); - - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, TRUE, 0); - - button = gtk_button_new_with_label ("Close"); - g_signal_connect_swapped (G_OBJECT (button), "clicked", - G_CALLBACK (gtk_widget_destroy), - G_OBJECT (window)); - gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5); - - gtk_widget_show_all (window); - - /* Enter the event loop */ - gtk_main (); - - return 0; -} - diff --git a/mui/gtk-mui/examples/table.c b/mui/gtk-mui/examples/table.c deleted file mode 100644 index 454f9571e..000000000 --- a/mui/gtk-mui/examples/table.c +++ /dev/null @@ -1,99 +0,0 @@ - -#include - -/* Our callback. - * The data passed to this function is printed to stdout */ -void callback( GtkWidget *widget, - gpointer data ) -{ - g_print ("Hello again - %s was pressed\n", (char *) data); -} - -/* This callback quits the program */ -gint delete_event( GtkWidget *widget, - GdkEvent *event, - gpointer data ) -{ - gtk_main_quit (); - return FALSE; -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window; - GtkWidget *button; - GtkWidget *table; - char *foo; - - gtk_init (&argc, &argv); - - - /* Create a new window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - /* Set the window title */ - gtk_window_set_title (GTK_WINDOW (window), "Table"); - - /* Set a handler for delete_event that immediately - * exits GTK. */ - g_signal_connect (G_OBJECT (window), "delete_event", - G_CALLBACK (delete_event), NULL); - - /* Sets the border width of the window. */ - gtk_container_set_border_width (GTK_CONTAINER (window), 20); - - /* Create a 2x2 table */ - table = gtk_table_new (2, 2, TRUE); - - /* Put the table in the main window */ - gtk_container_add (GTK_CONTAINER (window), table); - - /* Create first button */ - button = gtk_button_new_with_label ("button 1"); - - /* When the button is clicked, we call the "callback" function - * with a pointer to "button 1" as its argument */ - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (callback), (gpointer) "button 1"); - - - /* Insert button 1 into the upper left quadrant of the table */ - gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 0, 1); - - gtk_widget_show (button); - - /* Create second button */ - - button = gtk_button_new_with_label ("button 2"); - - /* When the button is clicked, we call the "callback" function - * with a pointer to "button 2" as its argument */ - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (callback), (gpointer) "button 2"); - /* Insert button 2 into the upper right quadrant of the table */ - gtk_table_attach_defaults (GTK_TABLE (table), button, 1, 2, 0, 1); - - gtk_widget_show (button); - - /* Create "Quit" button */ - button = gtk_button_new_with_label ("Quit"); - - /* When the button is clicked, we call the "delete_event" function - * and the program exits */ - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (delete_event), NULL); - - /* Insert the quit button into the both - * lower quadrants of the table */ - gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 2, 1, 2); - - gtk_widget_show (button); - - gtk_widget_show (table); - gtk_widget_show (window); - - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/tictactoe.c b/mui/gtk-mui/examples/tictactoe.c deleted file mode 100644 index 71f80d408..000000000 --- a/mui/gtk-mui/examples/tictactoe.c +++ /dev/null @@ -1,162 +0,0 @@ - -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ -#include "gtk/gtksignal.h" -#include "gtk/gtktable.h" -#include "gtk/gtktogglebutton.h" -#include "tictactoe.h" - -enum { - TICTACTOE_SIGNAL, - LAST_SIGNAL -}; - -static void tictactoe_class_init (TictactoeClass *klass); -static void tictactoe_init (Tictactoe *ttt); -static void tictactoe_toggle (GtkWidget *widget, Tictactoe *ttt); - -static gint tictactoe_signals[LAST_SIGNAL] = { 0 }; - -GType -tictactoe_get_type (void) -{ - static GType ttt_type = 0; - - if (!ttt_type) - { - static const GTypeInfo ttt_info = - { - sizeof (TictactoeClass), - NULL, - NULL, - (GClassInitFunc) tictactoe_class_init, - NULL, - NULL, - sizeof (Tictactoe), - 0, - (GInstanceInitFunc) tictactoe_init, - }; - - ttt_type = g_type_register_static (GTK_TYPE_VBOX, "Tictactoe", &ttt_info, 0); - } - - return ttt_type; -} - -static void -tictactoe_class_init (TictactoeClass *class) -{ - GtkObjectClass *object_class; - - object_class = (GtkObjectClass*) class; - - tictactoe_signals[TICTACTOE_SIGNAL] = g_signal_new ("tictactoe", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - 0, - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0, NULL); - - class->tictactoe = NULL; -} - -static void -tictactoe_init (Tictactoe *ttt) -{ - GtkWidget *table; - gint i,j; - - table = gtk_table_new (3, 3, TRUE); - gtk_container_add (GTK_CONTAINER (ttt), table); - gtk_widget_show (table); - - for (i = 0; i < 3; i++) - for (j = 0; j < 3; j++) - { - ttt->buttons[i][j] = gtk_toggle_button_new (); - gtk_table_attach_defaults (GTK_TABLE (table), ttt->buttons[i][j], - i, i+1, j, j+1); - g_signal_connect (G_OBJECT (ttt->buttons[i][j]), "toggled", - G_CALLBACK (tictactoe_toggle), (gpointer) ttt); - gtk_widget_set_size_request (ttt->buttons[i][j], 20, 20); - gtk_widget_show (ttt->buttons[i][j]); - } -} - -GtkWidget* -tictactoe_new () -{ - return GTK_WIDGET (g_object_new (tictactoe_get_type (), NULL)); -} - -void -tictactoe_clear (Tictactoe *ttt) -{ - int i,j; - - for (i = 0; i < 3; i++) - for (j = 0; j < 3; j++) - { - g_signal_handlers_block_by_func (G_OBJECT (ttt->buttons[i][j]), - NULL, ttt); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ttt->buttons[i][j]), - FALSE); - g_signal_handlers_unblock_by_func (G_OBJECT (ttt->buttons[i][j]), - NULL, ttt); - } -} - -static void -tictactoe_toggle (GtkWidget *widget, Tictactoe *ttt) -{ - int i,k; - - static int rwins[8][3] = { { 0, 0, 0 }, { 1, 1, 1 }, { 2, 2, 2 }, - { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, - { 0, 1, 2 }, { 0, 1, 2 } }; - static int cwins[8][3] = { { 0, 1, 2 }, { 0, 1, 2 }, { 0, 1, 2 }, - { 0, 0, 0 }, { 1, 1, 1 }, { 2, 2, 2 }, - { 0, 1, 2 }, { 2, 1, 0 } }; - - int success, found; - - for (k = 0; k < 8; k++) - { - success = TRUE; - found = FALSE; - - for (i = 0; i < 3; i++) - { - success = success && - GTK_TOGGLE_BUTTON (ttt->buttons[rwins[k][i]][cwins[k][i]])->active; - found = found || - ttt->buttons[rwins[k][i]][cwins[k][i]] == widget; - } - - if (success && found) - { - g_signal_emit (G_OBJECT (ttt), - tictactoe_signals[TICTACTOE_SIGNAL], 0); - break; - } - } -} - diff --git a/mui/gtk-mui/examples/tictactoe.h b/mui/gtk-mui/examples/tictactoe.h deleted file mode 100644 index 70fb9c48f..000000000 --- a/mui/gtk-mui/examples/tictactoe.h +++ /dev/null @@ -1,62 +0,0 @@ - -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ -#ifndef __TICTACTOE_H__ -#define __TICTACTOE_H__ - - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define TICTACTOE(obj) GTK_CHECK_CAST (obj, tictactoe_get_type (), Tictactoe) -#define TICTACTOE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, tictactoe_get_type (), TictactoeClass) -#define IS_TICTACTOE(obj) GTK_CHECK_TYPE (obj, tictactoe_get_type ()) - - -typedef struct _Tictactoe Tictactoe; -typedef struct _TictactoeClass TictactoeClass; - -struct _Tictactoe -{ - GtkVBox vbox; - - GtkWidget *buttons[3][3]; -}; - -struct _TictactoeClass -{ - GtkVBoxClass parent_class; - - void (* tictactoe) (Tictactoe *ttt); -}; - -GtkType tictactoe_get_type (void); -GtkWidget* tictactoe_new (void); -void tictactoe_clear (Tictactoe *ttt); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __TICTACTOE_H__ */ - diff --git a/mui/gtk-mui/examples/toolbar.c b/mui/gtk-mui/examples/toolbar.c deleted file mode 100644 index b5e2b3e89..000000000 --- a/mui/gtk-mui/examples/toolbar.c +++ /dev/null @@ -1,209 +0,0 @@ -#include -#ifndef __AROS__ -#include -#else -#include -#endif /* __AROS__ */ -#include - -/* This function is connected to the Close button or - * closing the window from the WM */ -static gboolean delete_event( GtkWidget *widget, - GdkEvent *event, - gpointer data ) -{ - gtk_main_quit (); - return FALSE; -} - -/*The above beginning seems for sure familiar to you if it's not your first GTK program. There is one additional thing though, we include a nice XPM picture to serve as an icon for all of the buttons.*/ - -GtkWidget* close_button; /* This button will emit signal to close - * application */ -GtkWidget* tooltips_button; /* to enable/disable tooltips */ -GtkWidget* text_button, - * icon_button, - * both_button; /* radio buttons for toolbar style */ -GtkWidget* entry; /* a text entry to show packing any widget into - * toolbar */ - -/*In fact not all of the above widgets are needed here, but to make things clearer I put them all together.*/ - -/* that's easy... when one of the buttons is toggled, we just - * check which one is active and set the style of the toolbar - * accordingly - * ATTENTION: our toolbar is passed as data to callback ! */ -static void radio_event( GtkWidget *widget, - gpointer data ) -{ - if (GTK_TOGGLE_BUTTON (text_button)->active) - gtk_toolbar_set_style (GTK_TOOLBAR (data), GTK_TOOLBAR_TEXT); - else if (GTK_TOGGLE_BUTTON (icon_button)->active) - gtk_toolbar_set_style (GTK_TOOLBAR (data), GTK_TOOLBAR_ICONS); - else if (GTK_TOGGLE_BUTTON (both_button)->active) - gtk_toolbar_set_style (GTK_TOOLBAR (data), GTK_TOOLBAR_BOTH); -} - -/* even easier, just check given toggle button and enable/disable - * tooltips */ -static void toggle_event( GtkWidget *widget, - gpointer data ) -{ - gtk_toolbar_set_tooltips (GTK_TOOLBAR (data), - GTK_TOGGLE_BUTTON (widget)->active ); -} - -/*The above are just two callback functions that will be called when one of the buttons on a toolbar is pressed. You should already be familiar with things like this if you've already used toggle buttons (and radio buttons).*/ - -int main (int argc, char *argv[]) -{ - /* Here is our main window (a dialog) and a handle for the handlebox */ - GtkWidget* dialog; - GtkWidget* handlebox; - - /* Ok, we need a toolbar, an icon with a mask (one for all of - the buttons) and an icon widget to put this icon in (but - we'll create a separate widget for each button) */ - GtkWidget * toolbar; - GtkWidget * iconw; - - /* this is called in all GTK application. */ - gtk_init (&argc, &argv); - - /* create a new window with a given title, and nice size */ - dialog = gtk_window_new (0); - gtk_window_set_title (dialog, "GTKToolbar Tutorial"); - // gtk_widget_set_size_request (GTK_WIDGET (dialog), 600, 300); -// GTK_WINDOW (dialog)->allow_shrink = TRUE; - - /* typically we quit if someone tries to close us */ - g_signal_connect (G_OBJECT (dialog), "delete_event", - G_CALLBACK (delete_event), NULL); - - /* we need to realize the window because we use pixmaps for - * items on the toolbar in the context of it */ - gtk_widget_realize (dialog); - - /* to make it nice we'll put the toolbar into the handle box, - * so that it can be detached from the main window */ - handlebox = gtk_handle_box_new (); - gtk_box_pack_start (dialog, handlebox, FALSE, FALSE, 5); - -/*The above should be similar to any other GTK application. Just initialization of GTK, creating the window, etc. There is only one thing that probably needs some explanation: a handle box. A handle box is just another box that can be used to pack widgets in to. The difference between it and typical boxes is that it can be detached from a parent window (or, in fact, the handle box remains in the parent, but it is reduced to a very small rectangle, while all of its contents are reparented to a new freely floating window). It is usually nice to have a detachable toolbar, so these two widgets occur together quite often.*/ - - /* toolbar will be horizontal, with both icons and text, and - * with 5pxl spaces between items and finally, - * we'll also put it into our handlebox */ - toolbar = gtk_toolbar_new (); -//1 gtk_toolbar_set_orientation (GTK_TOOLBAR (toolbar), GTK_ORIENTATION_HORIZONTAL); - //1gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH); - gtk_container_set_border_width (GTK_CONTAINER (toolbar), 5); -// gtk_toolbar_set_space_size (GTK_TOOLBAR (toolbar), 5); - GTK_TOOLBAR (toolbar)->space_size=5; - gtk_container_add (GTK_CONTAINER (handlebox), toolbar); - -/*Well, what we do above is just a straightforward initialization of the toolbar widget.*/ - - /* our first item is button */ - iconw = gtk_image_new_from_file ("PROGDIR:gtk.png"); /* icon widget */ - close_button = - gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), /* our toolbar */ - "Close", /* button label */ - "Closes this app", /* this button's tooltip */ - "Private", /* tooltip private info */ - iconw, /* icon widget */ - GTK_SIGNAL_FUNC (delete_event), /* a signal */ - NULL); - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); /* space after item */ - -/*In the above code you see the simplest case: adding a button to toolbar. Just before appending a new item, we have to construct an image widget to serve as an icon for this item; this step will have to be repeated for each new item. Just after the item we also add a space, so the following items will not touch each other. As you see gtk_toolbar_append_item() returns a pointer to our newly created button widget, so that we can work with it in the normal way.*/ - - /* now, let's make our radio buttons group... */ - iconw = gtk_image_new_from_file ("gtk.png"); - icon_button = gtk_toolbar_append_element ( - GTK_TOOLBAR (toolbar), - GTK_TOOLBAR_CHILD_RADIOBUTTON, /* a type of element */ - NULL, /* pointer to widget */ - "Icon", /* label */ - "Only icons in toolbar", /* tooltip */ - "Private", /* tooltip private string */ - iconw, /* icon */ - GTK_SIGNAL_FUNC (radio_event), /* signal */ - toolbar); /* data for signal */ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (icon_button), FALSE); //o1i - // gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - -/*Here we begin creating a radio buttons group. To do this we use gtk_toolbar_append_element. In fact, using this function one can also +add simple items or even spaces (type = GTK_TOOLBAR_CHILD_SPACE or +GTK_TOOLBAR_CHILD_BUTTON). In the above case we start creating a radio group. In creating other radio buttons for this group a pointer to the previous button in the group is required, so that a list of buttons can be easily constructed (see the section on Radio Buttons earlier in this tutorial).*/ - - /* following radio buttons refer to previous ones */ - iconw = gtk_image_new_from_file ("gtk.png"); - text_button = - gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), - GTK_TOOLBAR_CHILD_RADIOBUTTON, - icon_button, - "Text", - "Only texts in toolbar", - "Private", - iconw, - GTK_SIGNAL_FUNC (radio_event), - toolbar); -// gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (text_button), FALSE); //o1i - - iconw = gtk_image_new_from_file ("PROGDIR:gtk.png"); - both_button = - gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), - GTK_TOOLBAR_CHILD_RADIOBUTTON, - text_button, - "Both", - "Icons and text in toolbar", - "Private", - iconw, - GTK_SIGNAL_FUNC (radio_event), - toolbar); - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (both_button), TRUE); - -/*In the end we have to set the state of one of the buttons manually (otherwise they all stay in active state, preventing us from switching between them).*/ - - /* here we have just a simple toggle button */ - iconw = gtk_image_new_from_file ("gtk.png"); - tooltips_button = - gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), - GTK_TOOLBAR_CHILD_TOGGLEBUTTON, - NULL, - "Tooltips", - "Toolbar with or without tips", - "Private", - iconw, - GTK_SIGNAL_FUNC (toggle_event), - toolbar); - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tooltips_button), TRUE); - -/*A toggle button can be created in the obvious way (if one knows how to create radio buttons already).*/ - - /* to pack a widget into toolbar, we only have to - * create it and append it with an appropriate tooltip */ - - entry = gtk_entry_new (); - gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), - entry, - "This is just an entry", - "Private"); - - /* well, it isn't created within the toolbar, so we must still show it */ - gtk_widget_show (entry); - -/*As you see, adding any kind of widget to a toolbar is simple. The one thing you have to remember is that this widget must be shown manually (contrary to other items which will be shown together with the toolbar).*/ - - /* that's it ! let's show everything. */ - gtk_widget_show (toolbar); - gtk_widget_show (handlebox); - gtk_widget_show (dialog); - - /* rest in gtk_main and wait for the fun to begin! */ - gtk_main (); - - return 0; -} diff --git a/mui/gtk-mui/examples/tooltips.c b/mui/gtk-mui/examples/tooltips.c deleted file mode 100644 index a599f1a1c..000000000 --- a/mui/gtk-mui/examples/tooltips.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include - - -int main( int argc, - char *argv[] ) -{ - - GtkWidget *window; - - GtkWidget *load_button, *save_button, *hbox; - GtkTooltips *button_bar_tips; - - gtk_init (&argc, &argv); - - button_bar_tips = gtk_tooltips_new (); - - /* Create the buttons and pack them into a GtkHBox */ - hbox = gtk_hbox_new (TRUE, 2); - - load_button = gtk_button_new_with_label ("Load a file"); - gtk_box_pack_start (GTK_BOX (hbox), load_button, TRUE, TRUE, 2); - gtk_widget_show (load_button); - - save_button = gtk_button_new_with_label ("Save a file"); - gtk_box_pack_start (GTK_BOX (hbox), save_button, TRUE, TRUE, 2); - gtk_widget_show (save_button); - gtk_widget_show (hbox); - - /* Add the tips */ - gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), load_button, - "Load a new document into this window", - "Requests the filename of a document. This will then be loaded into the current window, replacing the contents of whatever is already loaded."); - gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), save_button, - "Saves the current document to a file", - "If you have saved the document previously, then the new version will be saved over the old one. Otherwise, you will be prompted for a filename."); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_window_set_title (GTK_WINDOW (window), "GTK Tooltips"); - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - - g_signal_connect_swapped (G_OBJECT (window), "delete_event", - G_CALLBACK (gtk_widget_destroy), - G_OBJECT (window)); - gtk_container_add (GTK_CONTAINER (window), hbox); - - gtk_widget_show (window); - gtk_main(); - return 0; -} - diff --git a/mui/gtk-mui/examples/ttt_test.c b/mui/gtk-mui/examples/ttt_test.c deleted file mode 100644 index 6065593e6..000000000 --- a/mui/gtk-mui/examples/ttt_test.c +++ /dev/null @@ -1,44 +0,0 @@ - -#include -#include -#include "tictactoe.h" - -void win( GtkWidget *widget, - gpointer data ) -{ - g_print ("Yay!\n"); - tictactoe_clear (TICTACTOE (widget)); -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window; - GtkWidget *ttt; - - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_window_set_title (GTK_WINDOW (window), "Aspect Frame"); - - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (exit), NULL); - - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - - ttt = tictactoe_new (); - - gtk_container_add (GTK_CONTAINER (window), ttt); - gtk_widget_show (ttt); - - g_signal_connect (G_OBJECT (ttt), "tictactoe", - G_CALLBACK (win), NULL); - - gtk_widget_show (window); - - gtk_main (); - - return 0; -} - diff --git a/mui/gtk-mui/g_lib.c b/mui/gtk-mui/g_lib.c deleted file mode 100644 index ec30ba71a..000000000 --- a/mui/gtk-mui/g_lib.c +++ /dev/null @@ -1,503 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -/* GLADE_HOOKUP_OBJECT (window1, table1, "table1");*/ -/*GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) */ - -/* -typedef struct { - char *key; - gpointer value; - struct internalGObject *next; -} internalGObject; - -*/ -void g_object_set_data(GObject *object, - const gchar *key, - gpointer data) { - internalGObject *new; - internalGObject *act; - char *string; - - DebOut("g_object_set_data(%lx,%s,%lx)\n",object,key,data); - - new=g_new0(internalGObject,1); - - string=g_strdup(key); - - new->key=string; - new->value=data; - new->next=NULL; - - /* add new key/value pair */ - if(object->gobjs == NULL) { - /*first object*/ - DebOut(" added first key value pair\n"); - object->gobjs=(struct internalGObject *) new; - return; - } - - /* append */ - act=object->gobjs; - while(act->next != NULL) { - DebOut(" act->next=%lx\n",act->next); - act=(internalGObject *) act->next; - } - - DebOut(" append %lx to %lx\n",new,act); - - act->next=(struct internalGObject *) new; -} -/* g_object_set_data_full(window1,"table1",gtk_widget_ref (widget),GDestroyNotify) gtk_widget_unref */ - -void g_object_set_data_full(GObject *object, - const gchar *key, - gpointer data, - GDestroyNotify destroy) { - DebOut("WARNING: g_object_set_data_full just a wrapper to g_object_set_data ( NOT DONE!)\n"); - - g_object_set_data(object,key,data); -} - -gpointer g_object_get_data(GObject *object, - const gchar *key) { - - internalGObject *act; - - DebOut("g_object_get_data(%lx,%s)\n",object,key); - - /* this one is normally not set manually, but present for GObjects */ - if(!strcmp(key,"GladeParentKey")) { - return (gpointer) ((GtkWidget *)object)->parent; - } - - DebOut(" object->gobjs=%lx\n",object->gobjs); - DebOut(" searching for %s..\n",key); - act=(internalGObject *) object->gobjs; - DebOut(" act=%lx\n",act); - DebOut(" act->key=%s\n",act->key); - DebOut(" act->next=%lx\n",act->next); - - DebOut(" loop:\n"); - while((act != NULL) && strcmp(act->key,key)) { - DebOut(" act: %lx\n",act); - DebOut(" key: %s\n",act->key); - DebOut(" next: %lx\n",act->next); - act=(internalGObject *) act->next; - } - DebOut(" loop end\n"); - - if (act) - { - DebOut(" found value: %lx for key %s (%s)\n",act->value,act->key,key); - return(act->value); - } - - DebOut(" value not found!\n"); - return NULL; -} - -/* g_object_unref might be called on everey object. Bad thing is, that - * not all GTK-MUI Object do have the base class GObject, so you - * cannot assume, that there is a ref_count in GObject. - * Bad, needs to be fixed on various places.. TODO! - */ -void g_object_unref (GObject *object) { - - DebOut("g_object_unref(%lx)\n",object); - - if(!object) { - DebOut("WARNING: g_object_unref called on NULL object ..?\n"); - return; - } - -#warning g_object_unref is not completely implemented - if(!object->ref_count) { - DebOut("WARNING: g_object_unref not done yet (ref==0)!\n"); - /* TODO: free widget resources..*/ - } - else { - object->ref_count--; - } -} - -GObject *g_object_ref (GObject *object) { - - DebOut("g_object_ref(%lx)\n",object); - - object->ref_count++; - - return object; -} - - -void g_free (gpointer mem) { - DebOut("faked g_free called\n"); - return; -} - -void g_error_free(GError **error) { - DebOut("faked g_error_free called\n"); - return; -} - -/* -gchar* g_strdup_vprintf (const gchar *format, va_list args) { - gchar *string = NULL; - - g_vasprintf (&string, format, args); - - return string; -} -*/ - -/* -gchar* g_strdup_printf (const gchar *format, ...) -{ - gchar *buffer; - va_list args; - - va_start (args, format); - buffer = g_strdup_vprintf (format, args); - va_end (args); - - return buffer; -} -*/ -/**********************/ - -gchar* g_strdup (const gchar *str) { - gchar *new_str; - - if (str) - { - new_str = g_new (char, strlen (str) + 1); - strcpy (new_str, str); - } - else - new_str = NULL; - - return new_str; -} - -gchar* g_strndup (const gchar *str, guint n) { - gchar *new_str; - - if (str) - { - new_str = g_new (gchar, n + 1); - strncpy (new_str, str, n); - new_str[n] = '\0'; - } - else - new_str = NULL; - - return new_str; -} - -gchar* g_strnfill (guint length, gchar fill_char) { - register gchar *str, *s, *end; - - str = g_new (gchar, length + 1); - s = str; - end = str + length; - while (s < end) - *(s++) = fill_char; - *s = 0; - - return str; -} - -gchar* g_strdup_vprintf (const gchar *format, va_list args1) { - gchar *buffer; - va_list args2; - - va_copy(args2, args1); - - buffer = g_new (gchar, g_printf_string_upper_bound (format, args2)); - - if (buffer) - vsprintf (buffer, format, args1); - va_end (args2); - - return buffer; -} - -gchar* g_strdup_printf (const gchar *format, ...) { - gchar *buffer; - va_list args; - - va_start (args, format); - buffer = g_strdup_vprintf (format, args); - va_end (args); - - return buffer; -} - -/* -gchar* g_strconcat (const gchar *string1, ...) { - guint l; - va_list args; - gchar *s; - gchar *concat; - - g_return_val_if_fail (string1 != NULL, NULL); - - l = 1 + strlen (string1); - va_start (args, string1); - s = va_arg (args, gchar*); - while (s) - { - l += strlen (s); - s = va_arg (args, gchar*); - } - va_end (args); - - concat = g_new (gchar, l); - concat[0] = 0; - - strcat (concat, string1); - va_start (args, string1); - s = va_arg (args, gchar*); - while (s) - { - strcat (concat, s); - s = va_arg (args, gchar*); - } - va_end (args); - - return concat; -} - -gdouble -g_strtod (const gchar *nptr, - gchar **endptr) -{ - gchar *fail_pos_1; - gchar *fail_pos_2; - gdouble val_1; - gdouble val_2 = 0; - - g_return_val_if_fail (nptr != NULL, 0); - - fail_pos_1 = NULL; - fail_pos_2 = NULL; - - val_1 = strtod (nptr, &fail_pos_1); - - if (fail_pos_1 && fail_pos_1[0] != 0) - { -#ifndef NATIVE_AMIGA - gchar *old_locale; - - old_locale = g_strdup (setlocale (LC_NUMERIC, NULL)); - setlocale (LC_NUMERIC, "C"); - val_2 = strtod (nptr, &fail_pos_2); - setlocale (LC_NUMERIC, old_locale); - g_free (old_locale); -#else - val_2 = strtod(nptr, &fail_pos_2); -#endif - } - - if (!fail_pos_1 || fail_pos_1[0] == 0 || fail_pos_1 >= fail_pos_2) - { - if (endptr) - *endptr = fail_pos_1; - return val_1; - } - else - { - if (endptr) - *endptr = fail_pos_2; - return val_2; - } -} - -*/ - -gchar* g_strerror (gint errnum) { - char *msg; - - msg=g_strdup_printf ("unknown error (%d)", errnum); - - return msg; -} - -guint g_printf_string_upper_bound (const gchar* format, va_list args) { - guint len = 1; - - while (*format) - { - gboolean long_int = FALSE; - gboolean extra_long = FALSE; - gchar c; - - c = *format++; - - if (c == '%') - { - gboolean done = FALSE; - - while (*format && !done) - { - switch (*format++) - { - gchar *string_arg; - - case '*': - len += va_arg (args, int); - break; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - /* add specified format length, since it might exceed the - * size we assume it to have. - */ - format -= 1; - len += strtol (format, (char**) &format, 10); - break; - case 'h': - /* ignore short int flag, since all args have at least the - * same size as an int - */ - break; - case 'l': - if (long_int) - extra_long = TRUE; /* linux specific */ - else - long_int = TRUE; - break; - case 'q': - case 'L': - long_int = TRUE; - extra_long = TRUE; - break; - case 's': - string_arg = va_arg (args, char *); - if (string_arg) - len += strlen (string_arg); - else - { - /* add enough padding to hold "(null)" identifier */ - len += 16; - } - done = TRUE; - break; - case 'd': - case 'i': - case 'o': - case 'u': - case 'x': - case 'X': -#ifdef G_HAVE_GINT64 - if (extra_long) - (void) va_arg (args, gint64); - else -#endif /* G_HAVE_GINT64 */ - { - if (long_int) - (void) va_arg (args, long); - else - (void) va_arg (args, int); - } - len += extra_long ? 64 : 32; - done = TRUE; - break; - case 'D': - case 'O': - case 'U': - (void) va_arg (args, long); - len += 32; - done = TRUE; - break; - case 'e': - case 'E': - case 'f': - case 'g': -#ifdef HAVE_LONG_DOUBLE - if (extra_long) - (void) va_arg (args, long double); - else -#endif /* HAVE_LONG_DOUBLE */ - (void) va_arg (args, double); - len += extra_long ? 128 : 64; - done = TRUE; - break; - case 'c': - (void) va_arg (args, int); - len += 1; - done = TRUE; - break; - case 'p': - case 'n': - (void) va_arg (args, void*); - len += 32; - done = TRUE; - break; - case '%': - len += 1; - done = TRUE; - break; - default: - /* ignore unknow/invalid flags */ - break; - } - } - } - else - len += 1; - } - - return len; -} - - diff --git a/mui/gtk-mui/gdk/gdk.h b/mui/gtk-mui/gdk/gdk.h deleted file mode 100644 index f70c49f76..000000000 --- a/mui/gtk-mui/gdk/gdk.h +++ /dev/null @@ -1,2 +0,0 @@ -/* dummy file */ - diff --git a/mui/gtk-mui/gdk/gdk_draw.c b/mui/gtk-mui/gdk/gdk_draw.c deleted file mode 100644 index 9dddb82b5..000000000 --- a/mui/gtk-mui/gdk/gdk_draw.c +++ /dev/null @@ -1,164 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "../debug.h" -#include -#include "../gtk_globals.h" - -#include "gdkmui.h" - -/* pens (gc) is still TODO! */ - -void gdk_draw_line(GdkDrawable *drawable, GdkGC *gc, gint x1, gint y1, gint x2, gint y2) { - GtkWidget *widget; - Object *obj; - - DebOut("gdk_draw_line(%lx,%lx,%d,%d,%d,%d)\n",drawable,gc,x1,y1,x2,y2); - - if(!drawable) { - DebOut("ERROR: drawable is NULL!\n"); - printf("ERROR: gdk/gdk_draw.c:drawable is NULL!\n"); - return; - } - - if(!gc) { - DebOut("ERROR: gc is NULL!\n"); - printf("ERROR: gdk/gdk_draw.c:gc is NULL!\n"); - return; - } - - widget=(GtkWidget *) drawable->mgtk_widget; - - if(!widget) { - DebOut("ERROR: drawable->mgtk_widget is NULL!\n"); - return; - } - obj=widget->MuiObject; - - if(!obj) { - DebOut("ERROR: obj is NULL!\n"); - printf("ERROR: gdk/gdk_draw.c: obj is NULL!\n"); - return; - } - - gdkmui_set_color(_rp(obj), gc); - Move(_rp(obj),_mleft(obj)+x1,_mtop(obj)+y1); - Draw(_rp(obj),_mleft(obj)+x2,_mtop(obj)+y2); - -} - -void gdk_draw_lines(GdkDrawable *drawable, GdkGC *gc, GdkPoint *points, gint npoints) { - - gint i; - - DebOut("gdk_draw_lines(%lx,%lx,%lx,%d)\n",drawable,gc,points,npoints); - - if(npoints<2) { - return; - } - - for (i=1; icolormap: %lx\n",gc->colormap); - DebOut(" gc->colormap->colors: %lx\n",gc->colormap->colors); - DebOut(" gc->colormap->colors->havepen: %lx\n",gc->colormap->colors->havepen); -#endif - - widget=(GtkWidget *) drawable->mgtk_widget; - DebOut(" widget=%lx\n",widget); - - if(!widget) { - DebOut("ERROR: drawable->mgtk_widget is NULL!\n"); - return; - } - obj=widget->MuiObject; - - if(!obj) { - DebOut("ERROR: obj is NULL!\n"); - printf("ERROR: gdk/gdk_draw.c: obj is NULL!\n"); - return; - } - -#if 0 - DebOut(" obj=%lx\n",obj); - DebOut(" rp(obj)=%lx\n",_rp(obj)); - DebOut(" dri(obj)=%lx\n",_dri(obj)); - DebOut(" mleft(obj)=%lx\n",_mleft(obj)); - DebOut(" mtop(obj)=%lx\n",_mtop(obj)); -#endif - - gdkmui_set_color(_rp(obj), gc); - Move(_rp(obj),_mleft(obj)+x,_mtop(obj)+y); - Draw(_rp(obj),_mleft(obj)+x+width,_mtop(obj)+y); - - Move(_rp(obj),_mleft(obj)+x,_mtop(obj)+y); - Draw(_rp(obj),_mleft(obj)+x,_mtop(obj)+y+height); - - Move(_rp(obj),_mleft(obj)+x+width,_mtop(obj)+y+height); - Draw(_rp(obj),_mleft(obj)+x+width,_mtop(obj)+y); - Move(_rp(obj),_mleft(obj)+x+width,_mtop(obj)+y+height); - Draw(_rp(obj),_mleft(obj)+x,_mtop(obj)+y+height); - -#if 0 - DebOut(" exit gdk_draw_rectangle\n"); -#endif -} diff --git a/mui/gtk-mui/gdk/gdk_window.c b/mui/gtk-mui/gdk/gdk_window.c deleted file mode 100644 index fcd19ce78..000000000 --- a/mui/gtk-mui/gdk/gdk_window.c +++ /dev/null @@ -1,111 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "../debug.h" -#include -#include "../gtk_globals.h" - -GdkWindow *gdk_window_new(GdkWindow *parent, GdkWindowAttr *attributes, gint attributes_mask) { - GdkWindow *ret; - GtkWidget *widget; - - DebOut("======================= gdk_window_new ====================\n"); - DebOut("gdk_window_new(%lx,%lx,%d),parent,attributes,attributes_mask\n"); - - ret=g_new0(GdkWindow,1); - - /* get back the dirty stored widget */ - widget=(GtkWidget *) attributes->visual->mgtk_widget; - if(widget) { - DebOut(" widget=%lx\n",widget); - - /* and store it dirty again ;) */ - ret->mgtk_widget=widget; - - /* set size of MUI object */ - DebOut(" x=%d\n",attributes->x); - DebOut(" y=%d\n",attributes->y); - /* TODO */ - } - else { - DebOut("WARNING: could not find widget\n"); - } - -#warning gdk_window_new: anything to do here ?? - - return ret; -} - -void gdk_window_clear_area(GdkWindow *window, gint x, gint y, gint width, gint height) { - GtkWidget *widget; - Object *obj; - - DebOut("gdk_window_clear_area(%lx,%d,%d,%d,%d)\n",window,x,y,width,height); - - widget=(GtkWidget *) window->mgtk_widget; - - if(!widget) { - DebOut("WARNING: could not find widget\n"); - return; - } - - obj=widget->MuiObject; - - SetAPen(_rp(obj),_dri(obj)->dri_Pens[MGTK_PEN_BG]); - RectFill(_rp(obj),_mleft(obj)+x,_mtop(obj)+y,_mleft(obj)+x+width,_mtop(obj)+y+height); -} - -void gdk_window_set_user_data(GdkWindow *window, gpointer user_data) { - - DebOut("gdk_window_set_user_data(%lx,%lx)\n",window,user_data); - DebOut("WARNING: Just a dummy\n"); -#warning gdk_window_set_user_data: Just a dummy -} - -void gdk_window_move_resize(GdkWindow *window, gint x, gint y, gint width, gint height) { - - DebOut("gdk_window_move_resize(%lx,%d,%d,%d,%d)\n",window,x,y,width,height); - DebOut("WARNING: Just a dummy\n"); -#warning gdk_window_move_resize: Just a dummy -} - -GdkWindow *gdk_window_get_pointer(GdkWindow *window, gint *x, gint *y, GdkModifierType *mask) { - - DebOut("gdk_window_get_pointer(%lx,..)\n",window); - DebOut("WARNING: Just a dummy\n"); -#warning gdk_window_get_pointer: Just a dummy - return window; -} diff --git a/mui/gtk-mui/gdk/gdkcolor.c b/mui/gtk-mui/gdk/gdkcolor.c deleted file mode 100644 index a86934fb5..000000000 --- a/mui/gtk-mui/gdk/gdkcolor.c +++ /dev/null @@ -1,75 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* modified by o1i 2005 */ - -#include -#include -#include -#include -#include - -#include "../debug.h" -#include -#include "../gtk_globals.h" - -/** - * gdk_color_copy: - * @color: a #GdkColor. - * - * Makes a copy of a color structure. The result - * must be freed using gdk_color_free(). - * - * Return value: a copy of @color. - **/ -GdkColor* -gdk_color_copy (const GdkColor *color) -{ - GdkColor *new_color; - - g_return_val_if_fail (color != NULL, NULL); - - new_color = g_new (GdkColor,1); - - *new_color = *color; - - return new_color; -} - -/** - * gdk_color_free: - * @color: a #GdkColor. - * - * Frees a color structure created with - * gdk_color_copy(). - **/ -void -gdk_color_free (GdkColor *color) -{ - g_return_if_fail (color != NULL); - - g_free (color); -} diff --git a/mui/gtk-mui/gdk/gdkcolor.h b/mui/gtk-mui/gdk/gdkcolor.h deleted file mode 100644 index 2b4437405..000000000 --- a/mui/gtk-mui/gdk/gdkcolor.h +++ /dev/null @@ -1,172 +0,0 @@ -/************************************************** - * taken and modified from the gtk+-2.6.9 sources, - * there was no "original copyright header", so - * don't complain, that it is missing. - * - * o1i - * - * $Id$ - **************************************************/ - -#ifndef __GDK_COLOR_H__ -#define __GDK_COLOR_H__ - -#include - -/* gtk-mui configuration */ -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* The color type. - * A color consists of red, green and blue values in the - * range 0-65535 and a pixel value. The pixel value is highly - * dependent on the depth and colormap which this color will - * be used to draw into. Therefore, sharing colors between - * colormaps is a bad idea. - */ - -struct _GdkColor -{ - guint32 pixel; - guint16 red; - guint16 green; - guint16 blue; - - /* GTK-MUI private */ - #if USE_PENS - guint16 havepen; - guint16 pen; - #endif -}; - -/* The colormap type. - */ - -typedef struct _GdkColormapClass GdkColormapClass; - -#define GDK_TYPE_COLORMAP (gdk_colormap_get_type ()) -#define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap)) -#define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass)) -#define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP)) -#define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP)) -#define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass)) - -#define GDK_TYPE_COLOR (gdk_color_get_type ()) - -struct _GdkColormap -{ - /* - GObject parent_instance; - */ - - /*< public >*/ - gint size; - GdkColor *colors; - - /*< private >*/ - GdkVisual *visual; - - gpointer windowing_data; -}; - -struct _GdkColormapClass -{ - /* - GObjectClass parent_class; - */ - int foo; - -}; - -GType gdk_colormap_get_type (void) G_GNUC_CONST; - -GdkColormap* gdk_colormap_new (GdkVisual *visual, - gboolean allocate); - -#ifndef GDK_DISABLE_DEPRECATED -GdkColormap* gdk_colormap_ref (GdkColormap *cmap); -void gdk_colormap_unref (GdkColormap *cmap); -#endif - -#ifndef GDK_MULTIHEAD_SAFE -GdkColormap* gdk_colormap_get_system (void); -#endif - -GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap); - -#ifndef GDK_DISABLE_DEPRECATED -gint gdk_colormap_get_system_size (void); -#endif - -#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION) -/* Used by gdk_colors_store () */ -void gdk_colormap_change (GdkColormap *colormap, - gint ncolors); -#endif - -gint gdk_colormap_alloc_colors (GdkColormap *colormap, - GdkColor *colors, - gint ncolors, - gboolean writeable, - gboolean best_match, - gboolean *success); -gboolean gdk_colormap_alloc_color (GdkColormap *colormap, - GdkColor *color, - gboolean writeable, - gboolean best_match); -void gdk_colormap_free_colors (GdkColormap *colormap, - GdkColor *colors, - gint ncolors); -void gdk_colormap_query_color (GdkColormap *colormap, - gulong pixel, - GdkColor *result); - -GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap); - -GdkColor *gdk_color_copy (const GdkColor *color); -void gdk_color_free (GdkColor *color); -gint gdk_color_parse (const gchar *spec, - GdkColor *color); -guint gdk_color_hash (const GdkColor *colora); -gboolean gdk_color_equal (const GdkColor *colora, - const GdkColor *colorb); - -GType gdk_color_get_type (void) G_GNUC_CONST; - -/* The following functions are deprecated */ -#ifndef GDK_DISABLE_DEPRECATED -void gdk_colors_store (GdkColormap *colormap, - GdkColor *colors, - gint ncolors); -gint gdk_color_white (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_black (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_alloc (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_change (GdkColormap *colormap, - GdkColor *color); -#endif /* GDK_DISABLE_DEPRECATED */ - -#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION) -/* Used by gdk_rgb_try_colormap () */ -gint gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels); -void gdk_colors_free (GdkColormap *colormap, - gulong *pixels, - gint npixels, - gulong planes); -#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __GDK_COLOR_H__ */ diff --git a/mui/gtk-mui/gdk/gdkconfig.h b/mui/gtk-mui/gdk/gdkconfig.h deleted file mode 100644 index 736e7041c..000000000 --- a/mui/gtk-mui/gdk/gdkconfig.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __GDKCONFIG_H__ -#define __GDKCONFIG_H__ - -/* Some lowlevel config options - * - * Usage: - * - * USE_PENS - pen support (ObtainBestPen() etc.) - * - * Fill in your own settings and modify source code if needed... - */ - -#if defined (__MORPHOS__) || (__AROS__) - - #define USE_PENS 0 - -#else - - #define USE_PENS 1 - -#endif - -#endif /* __GDKCONFIGH_H__ */ - diff --git a/mui/gtk-mui/gdk/gdkdrawable.h b/mui/gtk-mui/gdk/gdkdrawable.h deleted file mode 100644 index 2a02431f3..000000000 --- a/mui/gtk-mui/gdk/gdkdrawable.h +++ /dev/null @@ -1,425 +0,0 @@ -/************************************************** - * taken and modified from the gtk+-2.6.9 sources, - * there was no "original copyright header", so - * don't complain, that it is missing. - * - * o1i - * - * $Id$ - **************************************************/ - -#ifndef __GDK_DRAWABLE_H__ -#define __GDK_DRAWABLE_H__ - -#include -#include -#include -/* -#include -#include -#include -*/ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _GdkDrawableClass GdkDrawableClass; -typedef struct _GdkTrapezoid GdkTrapezoid; - -#define GDK_TYPE_DRAWABLE (gdk_drawable_get_type ()) -#define GDK_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE, GdkDrawable)) -#define GDK_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE, GdkDrawableClass)) -#define GDK_IS_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE)) -#define GDK_IS_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE)) -#define GDK_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE, GdkDrawableClass)) - -struct _GdkDrawable -{ - GObject parent_instance; - - GtkStyle *style; - - /* o1i: */ - APTR *mgtk_widget; -}; - -struct _GdkDrawableClass -{ - GObjectClass parent_class; - -#if 0 - GdkGC *(*create_gc) (GdkDrawable *drawable, - GdkGCValues *values, - GdkGCValuesMask mask); - void (*draw_rectangle) (GdkDrawable *drawable, - GdkGC *gc, - gboolean filled, - gint x, - gint y, - gint width, - gint height); - void (*draw_arc) (GdkDrawable *drawable, - GdkGC *gc, - gboolean filled, - gint x, - gint y, - gint width, - gint height, - gint angle1, - gint angle2); - void (*draw_polygon) (GdkDrawable *drawable, - GdkGC *gc, - gboolean filled, - GdkPoint *points, - gint npoints); - void (*draw_text) (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *text, - gint text_length); - void (*draw_text_wc) (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const GdkWChar *text, - gint text_length); - void (*draw_drawable) (GdkDrawable *drawable, - GdkGC *gc, - GdkDrawable *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); - void (*draw_points) (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); - void (*draw_segments) (GdkDrawable *drawable, - GdkGC *gc, - GdkSegment *segs, - gint nsegs); - void (*draw_lines) (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); - - void (*draw_glyphs) (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); - - void (*draw_image) (GdkDrawable *drawable, - GdkGC *gc, - GdkImage *image, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); - - gint (*get_depth) (GdkDrawable *drawable); - void (*get_size) (GdkDrawable *drawable, - gint *width, - gint *height); - - void (*set_colormap) (GdkDrawable *drawable, - GdkColormap *cmap); - - GdkColormap* (*get_colormap) (GdkDrawable *drawable); - GdkVisual* (*get_visual) (GdkDrawable *drawable); - GdkScreen* (*get_screen) (GdkDrawable *drawable); - - GdkImage* (*get_image) (GdkDrawable *drawable, - gint x, - gint y, - gint width, - gint height); - - GdkRegion* (*get_clip_region) (GdkDrawable *drawable); - GdkRegion* (*get_visible_region) (GdkDrawable *drawable); - - GdkDrawable* (*get_composite_drawable) (GdkDrawable *drawable, - gint x, - gint y, - gint width, - gint height, - gint *composite_x_offset, - gint *composite_y_offset); - - void (*draw_pixbuf) (GdkDrawable *drawable, - GdkGC *gc, - GdkPixbuf *pixbuf, - gint src_x, - gint src_y, - gint dest_x, - gint dest_y, - gint width, - gint height, - GdkRgbDither dither, - gint x_dither, - gint y_dither); - GdkImage* (*_copy_to_image) (GdkDrawable *drawable, - GdkImage *image, - gint src_x, - gint src_y, - gint dest_x, - gint dest_y, - gint width, - gint height); - - void (*draw_glyphs_transformed) (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); - void (*draw_trapezoids) (GdkDrawable *drawable, - GdkGC *gc, - GdkTrapezoid *trapezoids, - gint n_trapezoids); -#endif - - /* Padding for future expansion */ - void (*_gdk_reserved3) (void); - void (*_gdk_reserved4) (void); - void (*_gdk_reserved5) (void); - void (*_gdk_reserved6) (void); - void (*_gdk_reserved7) (void); - void (*_gdk_reserved9) (void); - void (*_gdk_reserved10) (void); - void (*_gdk_reserved11) (void); - void (*_gdk_reserved12) (void); - void (*_gdk_reserved13) (void); - void (*_gdk_reserved14) (void); - void (*_gdk_reserved15) (void); - void (*_gdk_reserved16) (void); -}; - -struct _GdkTrapezoid -{ - double y1, x11, x21, y2, x12, x22; -}; - -GType gdk_drawable_get_type (void) G_GNUC_CONST; - -/* Manipulation of drawables - */ - -#ifndef GDK_DISABLE_DEPRECATED -void gdk_drawable_set_data (GdkDrawable *drawable, - const gchar *key, - gpointer data, - GDestroyNotify destroy_func); -gpointer gdk_drawable_get_data (GdkDrawable *drawable, - const gchar *key); -#endif /* GDK_DISABLE_DEPRECATED */ - -void gdk_drawable_get_size (GdkDrawable *drawable, - gint *width, - gint *height); -void gdk_drawable_set_colormap (GdkDrawable *drawable, - GdkColormap *colormap); -GdkColormap* gdk_drawable_get_colormap (GdkDrawable *drawable); -GdkVisual* gdk_drawable_get_visual (GdkDrawable *drawable); -gint gdk_drawable_get_depth (GdkDrawable *drawable); -GdkScreen* gdk_drawable_get_screen (GdkDrawable *drawable); -GdkDisplay* gdk_drawable_get_display (GdkDrawable *drawable); - -#ifndef GDK_DISABLE_DEPRECATED -GdkDrawable* gdk_drawable_ref (GdkDrawable *drawable); -void gdk_drawable_unref (GdkDrawable *drawable); -#endif /* GDK_DISABLE_DEPRECATED */ - -/* Drawing - */ -void gdk_draw_point (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y); -void gdk_draw_line (GdkDrawable *drawable, - GdkGC *gc, - gint x1_, - gint y1_, - gint x2_, - gint y2_); -void gdk_draw_rectangle (GdkDrawable *drawable, - GdkGC *gc, - gboolean filled, - gint x, - gint y, - gint width, - gint height); -void gdk_draw_arc (GdkDrawable *drawable, - GdkGC *gc, - gboolean filled, - gint x, - gint y, - gint width, - gint height, - gint angle1, - gint angle2); -void gdk_draw_polygon (GdkDrawable *drawable, - GdkGC *gc, - gboolean filled, - GdkPoint *points, - gint npoints); -#if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION) -/* Used by gtk_default_draw_string () */ -void gdk_draw_string (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *string); -#endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */ -#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION) -/* Used by gdk_pixmap_draw_text (), gdk_window_draw_text() */ -void gdk_draw_text (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *text, - gint text_length); -/* Used by gdk_pixmap_draw_text_wc (), gdk_window_draw_text_wc () */ -void gdk_draw_text_wc (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const GdkWChar *text, - gint text_length); -#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */ -void gdk_draw_drawable (GdkDrawable *drawable, - GdkGC *gc, - GdkDrawable *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); -void gdk_draw_image (GdkDrawable *drawable, - GdkGC *gc, - GdkImage *image, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); -void gdk_draw_points (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); -void gdk_draw_segments (GdkDrawable *drawable, - GdkGC *gc, - GdkSegment *segs, - gint nsegs); -void gdk_draw_lines (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); -#if 0 -void gdk_draw_pixbuf (GdkDrawable *drawable, - GdkGC *gc, - GdkPixbuf *pixbuf, - gint src_x, - gint src_y, - gint dest_x, - gint dest_y, - gint width, - gint height, - GdkRgbDither dither, - gint x_dither, - gint y_dither); - -void gdk_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); -void gdk_draw_layout_line (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - PangoLayoutLine *line); -void gdk_draw_layout (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - PangoLayout *layout); -void gdk_draw_layout_line_with_colors (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - PangoLayoutLine *line, - const GdkColor *foreground, - const GdkColor *background); -void gdk_draw_layout_with_colors (GdkDrawable *drawable, - GdkGC *gc, - gint x, - gint y, - PangoLayout *layout, - const GdkColor *foreground, - const GdkColor *background); - -void gdk_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); -void gdk_draw_trapezoids (GdkDrawable *drawable, - GdkGC *gc, - GdkTrapezoid *trapezoids, - gint n_trapezoids); -#endif - -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_draw_pixmap gdk_draw_drawable -#define gdk_draw_bitmap gdk_draw_drawable -#endif /* GDK_DISABLE_DEPRECATED */ - -GdkImage* gdk_drawable_get_image (GdkDrawable *drawable, - gint x, - gint y, - gint width, - gint height); -GdkImage *gdk_drawable_copy_to_image (GdkDrawable *drawable, - GdkImage *image, - gint src_x, - gint src_y, - gint dest_x, - gint dest_y, - gint width, - gint height); - -GdkRegion *gdk_drawable_get_clip_region (GdkDrawable *drawable); -GdkRegion *gdk_drawable_get_visible_region (GdkDrawable *drawable); - -gboolean gdk_draw_rectangle_alpha_libgtk_only (GdkDrawable *drawable, - gint x, - gint y, - gint width, - gint height, - GdkColor *color, - guint16 alpha); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __GDK_DRAWABLE_H__ */ diff --git a/mui/gtk-mui/gdk/gdkevents.h b/mui/gtk-mui/gdk/gdkevents.h deleted file mode 100644 index 9d3ed7cd3..000000000 --- a/mui/gtk-mui/gdk/gdkevents.h +++ /dev/null @@ -1,534 +0,0 @@ -/************************************************** - * taken and modified from the gtk+-2.6.9 sources, - * there was no "original copyright header", so - * don't complain, that it is missing. - * - * o1i - * - * $Id$ - **************************************************/ - -#ifndef __GDK_EVENTS_H__ -#define __GDK_EVENTS_H__ - -#include -#include -#include -/* -#include -#include -*/ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define GDK_TYPE_EVENT (gdk_event_get_type ()) - -#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT) -#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20) - - -typedef struct _GdkEventAny GdkEventAny; -typedef struct _GdkEventExpose GdkEventExpose; -typedef struct _GdkEventNoExpose GdkEventNoExpose; -typedef struct _GdkEventVisibility GdkEventVisibility; -typedef struct _GdkEventMotion GdkEventMotion; -typedef struct _GdkEventButton GdkEventButton; -typedef struct _GdkEventScroll GdkEventScroll; -typedef struct _GdkEventKey GdkEventKey; -typedef struct _GdkEventFocus GdkEventFocus; -typedef struct _GdkEventCrossing GdkEventCrossing; -typedef struct _GdkEventConfigure GdkEventConfigure; -typedef struct _GdkEventProperty GdkEventProperty; -typedef struct _GdkEventSelection GdkEventSelection; -typedef struct _GdkEventOwnerChange GdkEventOwnerChange; -typedef struct _GdkEventProximity GdkEventProximity; -typedef struct _GdkEventClient GdkEventClient; -typedef struct _GdkEventDND GdkEventDND; -typedef struct _GdkEventWindowState GdkEventWindowState; -typedef struct _GdkEventSetting GdkEventSetting; - -typedef union _GdkEvent GdkEvent; - -typedef void (*GdkEventFunc) (GdkEvent *event, - gpointer data); - -/* Event filtering */ - -typedef void GdkXEvent; /* Can be cast to window system specific - * even type, XEvent on X11, MSG on Win32. - */ - -typedef enum { - GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */ - GDK_FILTER_TRANSLATE, /* Native event translated into a GDK event and - stored in the "event" structure that was - passed in */ - GDK_FILTER_REMOVE /* Terminate processing, removing event */ -} GdkFilterReturn; - -typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent, - GdkEvent *event, - gpointer data); - - -/* Event types. - * Nothing: No event occurred. - * Delete: A window delete event was sent by the window manager. - * The specified window should be deleted. - * Destroy: A window has been destroyed. - * Expose: Part of a window has been uncovered. - * NoExpose: Same as expose, but no expose event was generated. - * VisibilityNotify: A window has become fully/partially/not obscured. - * MotionNotify: The mouse has moved. - * ButtonPress: A mouse button was pressed. - * ButtonRelease: A mouse button was release. - * KeyPress: A key was pressed. - * KeyRelease: A key was released. - * EnterNotify: A window was entered. - * LeaveNotify: A window was exited. - * FocusChange: The focus window has changed. (The focus window gets - * keyboard events). - * Resize: A window has been resized. - * Map: A window has been mapped. (It is now visible on the screen). - * Unmap: A window has been unmapped. (It is no longer visible on - * the screen). - * Scroll: A mouse wheel was scrolled either up or down. - */ -typedef enum -{ - GDK_NOTHING = -1, - GDK_DELETE = 0, - GDK_DESTROY = 1, - GDK_EXPOSE = 2, - GDK_MOTION_NOTIFY = 3, - GDK_BUTTON_PRESS = 4, - GDK_2BUTTON_PRESS = 5, - GDK_3BUTTON_PRESS = 6, - GDK_BUTTON_RELEASE = 7, - GDK_KEY_PRESS = 8, - GDK_KEY_RELEASE = 9, - GDK_ENTER_NOTIFY = 10, - GDK_LEAVE_NOTIFY = 11, - GDK_FOCUS_CHANGE = 12, - GDK_CONFIGURE = 13, - GDK_MAP = 14, - GDK_UNMAP = 15, - GDK_PROPERTY_NOTIFY = 16, - GDK_SELECTION_CLEAR = 17, - GDK_SELECTION_REQUEST = 18, - GDK_SELECTION_NOTIFY = 19, - GDK_PROXIMITY_IN = 20, - GDK_PROXIMITY_OUT = 21, - GDK_DRAG_ENTER = 22, - GDK_DRAG_LEAVE = 23, - GDK_DRAG_MOTION = 24, - GDK_DRAG_STATUS = 25, - GDK_DROP_START = 26, - GDK_DROP_FINISHED = 27, - GDK_CLIENT_EVENT = 28, - GDK_VISIBILITY_NOTIFY = 29, - GDK_NO_EXPOSE = 30, - GDK_SCROLL = 31, - GDK_WINDOW_STATE = 32, - GDK_SETTING = 33, - GDK_OWNER_CHANGE = 34 -} GdkEventType; - -/* Event masks. (Used to select what types of events a window - * will receive). - */ -typedef enum -{ - GDK_EXPOSURE_MASK = 1 << 1, - GDK_POINTER_MOTION_MASK = 1 << 2, - GDK_POINTER_MOTION_HINT_MASK = 1 << 3, - GDK_BUTTON_MOTION_MASK = 1 << 4, - GDK_BUTTON1_MOTION_MASK = 1 << 5, - GDK_BUTTON2_MOTION_MASK = 1 << 6, - GDK_BUTTON3_MOTION_MASK = 1 << 7, - GDK_BUTTON_PRESS_MASK = 1 << 8, - GDK_BUTTON_RELEASE_MASK = 1 << 9, - GDK_KEY_PRESS_MASK = 1 << 10, - GDK_KEY_RELEASE_MASK = 1 << 11, - GDK_ENTER_NOTIFY_MASK = 1 << 12, - GDK_LEAVE_NOTIFY_MASK = 1 << 13, - GDK_FOCUS_CHANGE_MASK = 1 << 14, - GDK_STRUCTURE_MASK = 1 << 15, - GDK_PROPERTY_CHANGE_MASK = 1 << 16, - GDK_VISIBILITY_NOTIFY_MASK = 1 << 17, - GDK_PROXIMITY_IN_MASK = 1 << 18, - GDK_PROXIMITY_OUT_MASK = 1 << 19, - GDK_SUBSTRUCTURE_MASK = 1 << 20, - GDK_SCROLL_MASK = 1 << 21, - GDK_ALL_EVENTS_MASK = 0x3FFFFE -} GdkEventMask; - -typedef enum -{ - GDK_VISIBILITY_UNOBSCURED, - GDK_VISIBILITY_PARTIAL, - GDK_VISIBILITY_FULLY_OBSCURED -} GdkVisibilityState; - -typedef enum -{ - GDK_SCROLL_UP, - GDK_SCROLL_DOWN, - GDK_SCROLL_LEFT, - GDK_SCROLL_RIGHT -} GdkScrollDirection; - -/* Types of enter/leave notifications. - * Ancestor: - * Virtual: - * Inferior: - * Nonlinear: - * NonlinearVirtual: - * Unknown: An unknown type of enter/leave event occurred. - */ -typedef enum -{ - GDK_NOTIFY_ANCESTOR = 0, - GDK_NOTIFY_VIRTUAL = 1, - GDK_NOTIFY_INFERIOR = 2, - GDK_NOTIFY_NONLINEAR = 3, - GDK_NOTIFY_NONLINEAR_VIRTUAL = 4, - GDK_NOTIFY_UNKNOWN = 5 -} GdkNotifyType; - -/* Enter/leave event modes. - * NotifyNormal - * NotifyGrab - * NotifyUngrab - */ -typedef enum -{ - GDK_CROSSING_NORMAL, - GDK_CROSSING_GRAB, - GDK_CROSSING_UNGRAB -} GdkCrossingMode; - -typedef enum -{ - GDK_PROPERTY_NEW_VALUE, - GDK_PROPERTY_DELETE -} GdkPropertyState; - -typedef enum -{ - GDK_WINDOW_STATE_WITHDRAWN = 1 << 0, - GDK_WINDOW_STATE_ICONIFIED = 1 << 1, - GDK_WINDOW_STATE_MAXIMIZED = 1 << 2, - GDK_WINDOW_STATE_STICKY = 1 << 3, - GDK_WINDOW_STATE_FULLSCREEN = 1 << 4, - GDK_WINDOW_STATE_ABOVE = 1 << 5, - GDK_WINDOW_STATE_BELOW = 1 << 6 -} GdkWindowState; - -typedef enum -{ - GDK_SETTING_ACTION_NEW, - GDK_SETTING_ACTION_CHANGED, - GDK_SETTING_ACTION_DELETED -} GdkSettingAction; - -typedef enum -{ - GDK_OWNER_CHANGE_NEW_OWNER, - GDK_OWNER_CHANGE_DESTROY, - GDK_OWNER_CHANGE_CLOSE -} GdkOwnerChange; - -struct _GdkEventAny -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; -}; - -struct _GdkEventExpose -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkRectangle area; - GdkRegion *region; - gint count; /* If non-zero, how many more events follow. */ -}; - -struct _GdkEventNoExpose -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; -}; - -struct _GdkEventVisibility -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkVisibilityState state; -}; - -struct _GdkEventMotion -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 time; - gdouble x; - gdouble y; - gdouble *axes; - guint state; - gint16 is_hint; - GdkDevice *device; - gdouble x_root, y_root; -}; - -struct _GdkEventButton -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 time; - gdouble x; - gdouble y; - gdouble *axes; - guint state; - guint button; - GdkDevice *device; - gdouble x_root, y_root; -}; - -struct _GdkEventScroll -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 time; - gdouble x; - gdouble y; - guint state; - GdkScrollDirection direction; - GdkDevice *device; - gdouble x_root, y_root; -}; - -struct _GdkEventKey -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 time; - guint state; - guint keyval; - gint length; - gchar *string; - guint16 hardware_keycode; - guint8 group; -}; - -struct _GdkEventCrossing -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkWindow *subwindow; - guint32 time; - gdouble x; - gdouble y; - gdouble x_root; - gdouble y_root; - GdkCrossingMode mode; - GdkNotifyType detail; - gboolean focus; - guint state; -}; - -struct _GdkEventFocus -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - gint16 in; -}; - -struct _GdkEventConfigure -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - gint x, y; - gint width; - gint height; -}; - -struct _GdkEventProperty -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkAtom atom; - guint32 time; - guint state; -}; - -struct _GdkEventSelection -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkAtom selection; - GdkAtom target; - GdkAtom property; - guint32 time; - GdkNativeWindow requestor; -}; - -struct _GdkEventOwnerChange -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkNativeWindow owner; - GdkOwnerChange reason; - GdkAtom selection; - guint32 time; - guint32 selection_time; -}; - -/* This event type will be used pretty rarely. It only is important - for XInput aware programs that are drawing their own cursor */ - -struct _GdkEventProximity -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 time; - GdkDevice *device; -}; - -struct _GdkEventClient -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkAtom message_type; - gushort data_format; - union { - char b[20]; - short s[10]; - long l[5]; - } data; -}; - -struct _GdkEventSetting -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkSettingAction action; - char *name; -}; - -struct _GdkEventWindowState -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkWindowState changed_mask; - GdkWindowState new_window_state; -}; - -/* Event types for DND */ - -struct _GdkEventDND { - GdkEventType type; - GdkWindow *window; - gint8 send_event; - GdkDragContext *context; - - guint32 time; - gshort x_root, y_root; -}; - -union _GdkEvent -{ - GdkEventType type; - GdkEventAny any; - GdkEventExpose expose; - GdkEventNoExpose no_expose; - GdkEventVisibility visibility; - GdkEventMotion motion; - GdkEventButton button; - GdkEventScroll scroll; - GdkEventKey key; - GdkEventCrossing crossing; - GdkEventFocus focus_change; - GdkEventConfigure configure; - GdkEventProperty property; - GdkEventSelection selection; - GdkEventOwnerChange owner_change; - GdkEventProximity proximity; - GdkEventClient client; - GdkEventDND dnd; - GdkEventWindowState window_state; - GdkEventSetting setting; -}; - -GType gdk_event_get_type (void) G_GNUC_CONST; - -gboolean gdk_events_pending (void); -GdkEvent* gdk_event_get (void); - -GdkEvent* gdk_event_peek (void); -GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window); -void gdk_event_put (GdkEvent *event); - -GdkEvent* gdk_event_new (GdkEventType type); -GdkEvent* gdk_event_copy (GdkEvent *event); -void gdk_event_free (GdkEvent *event); - -guint32 gdk_event_get_time (GdkEvent *event); -gboolean gdk_event_get_state (GdkEvent *event, - GdkModifierType *state); -gboolean gdk_event_get_coords (GdkEvent *event, - gdouble *x_win, - gdouble *y_win); -gboolean gdk_event_get_root_coords (GdkEvent *event, - gdouble *x_root, - gdouble *y_root); -/* disabled by o1i -gboolean gdk_event_get_axis (GdkEvent *event, - GdkAxisUse axis_use, - gdouble *value); -*/ -void gdk_event_handler_set (GdkEventFunc func, - gpointer data, - GDestroyNotify notify); - -void gdk_event_set_screen (GdkEvent *event, - GdkScreen *screen); -GdkScreen *gdk_event_get_screen (GdkEvent *event); - -void gdk_set_show_events (gboolean show_events); -gboolean gdk_get_show_events (void); - -#ifndef GDK_MULTIHEAD_SAFE -void gdk_add_client_message_filter (GdkAtom message_type, - GdkFilterFunc func, - gpointer data); - -gboolean gdk_setting_get (const gchar *name, - GValue *value); -#endif /* GDK_MULTIHEAD_SAFE */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __GDK_EVENTS_H__ */ diff --git a/mui/gtk-mui/gdk/gdkgc.c b/mui/gtk-mui/gdk/gdkgc.c deleted file mode 100644 index 96e294770..000000000 --- a/mui/gtk-mui/gdk/gdkgc.c +++ /dev/null @@ -1,110 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* modified by o1i 2005 */ - -#include -#include -#include -#include -#include - -#include "../debug.h" -#include -#include "../gtk_globals.h" - -/** - * gdk_gc_set_dashes: - * @gc: a #GdkGC. - * @dash_offset: the phase of the dash pattern. - * @dash_list: an array of dash lengths. - * @n: the number of elements in @dash_list. - * - * Sets the way dashed-lines are drawn. Lines will be - * drawn with alternating on and off segments of the - * lengths specified in @dash_list. The manner in - * which the on and off segments are drawn is determined - * by the @line_style value of the GC. (This can - * be changed with gdk_gc_set_line_attributes().) - * - * The @dash_offset defines the phase of the pattern, - * specifying how many pixels into the dash-list the pattern - * should actually begin. - **/ -void -gdk_gc_set_dashes (GdkGC *gc, - gint dash_offset, - gint8 dash_list[], - gint n) -{ - g_return_if_fail (GDK_IS_GC (gc)); - g_return_if_fail (dash_list != NULL); - - DebOut("WARNING: gdk_gc_set_dashes: TODO\n"); -#warning gdk_gc_set_dashes: TODO - -/* GDK_GC_GET_CLASS (gc)->set_dashes (gc, dash_offset, dash_list, n);*/ -} - -/** - * gdk_gc_set_line_attributes: - * @gc: a #GdkGC. - * @line_width: the width of lines. - * @line_style: the dash-style for lines. - * @cap_style: the manner in which the ends of lines are drawn. - * @join_style: the in which lines are joined together. - * - * Sets various attributes of how lines are drawn. See - * the corresponding members of #GdkGCValues for full - * explanations of the arguments. - **/ -void -gdk_gc_set_line_attributes (GdkGC *gc, - gint line_width, - GdkLineStyle line_style, - GdkCapStyle cap_style, - GdkJoinStyle join_style) -{ - -#warning gdk_gc_set_line_attributes: TODO - DebOut("WARNING: gdk_gc_set_line_attributes: TODO\n"); - -#if 0 - GdkGCValues values; - - values.line_width = line_width; - values.line_style = line_style; - values.cap_style = cap_style; - values.join_style = join_style; - - gdk_gc_set_values (gc, &values, - GDK_GC_LINE_WIDTH | - GDK_GC_LINE_STYLE | - GDK_GC_CAP_STYLE | - GDK_GC_JOIN_STYLE); -#endif -} - diff --git a/mui/gtk-mui/gdk/gdkgc.h b/mui/gtk-mui/gdk/gdkgc.h deleted file mode 100644 index c17033e1b..000000000 --- a/mui/gtk-mui/gdk/gdkgc.h +++ /dev/null @@ -1,276 +0,0 @@ -#ifndef __GDK_GC_H__ -#define __GDK_GC_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _GdkGCValues GdkGCValues; -typedef struct _GdkGCClass GdkGCClass; - -/* GC cap styles - * CapNotLast: - * CapButt: - * CapRound: - * CapProjecting: - */ -typedef enum -{ - GDK_CAP_NOT_LAST, - GDK_CAP_BUTT, - GDK_CAP_ROUND, - GDK_CAP_PROJECTING -} GdkCapStyle; - -/* GC fill types. - * Solid: - * Tiled: - * Stippled: - * OpaqueStippled: - */ -typedef enum -{ - GDK_SOLID, - GDK_TILED, - GDK_STIPPLED, - GDK_OPAQUE_STIPPLED -} GdkFill; - -/* GC function types. - * Copy: Overwrites destination pixels with the source pixels. - * Invert: Inverts the destination pixels. - * Xor: Xor's the destination pixels with the source pixels. - * Clear: set pixels to 0 - * And: source AND destination - * And Reverse: source AND (NOT destination) - * And Invert: (NOT source) AND destination - * Noop: destination - * Or: source OR destination - * Nor: (NOT source) AND (NOT destination) - * Equiv: (NOT source) XOR destination - * Xor Reverse: source OR (NOT destination) - * Copy Inverted: NOT source - * Xor Inverted: (NOT source) OR destination - * Nand: (NOT source) OR (NOT destination) - * Set: set pixels to 1 - */ -typedef enum -{ - GDK_COPY, - GDK_INVERT, - GDK_XOR, - GDK_CLEAR, - GDK_AND, - GDK_AND_REVERSE, - GDK_AND_INVERT, - GDK_NOOP, - GDK_OR, - GDK_EQUIV, - GDK_OR_REVERSE, - GDK_COPY_INVERT, - GDK_OR_INVERT, - GDK_NAND, - GDK_NOR, - GDK_SET -} GdkFunction; - -/* GC join styles - * JoinMiter: - * JoinRound: - * JoinBevel: - */ -typedef enum -{ - GDK_JOIN_MITER, - GDK_JOIN_ROUND, - GDK_JOIN_BEVEL -} GdkJoinStyle; - -/* GC line styles - * Solid: - * OnOffDash: - * DoubleDash: - */ -typedef enum -{ - GDK_LINE_SOLID, - GDK_LINE_ON_OFF_DASH, - GDK_LINE_DOUBLE_DASH -} GdkLineStyle; - -typedef enum -{ - GDK_CLIP_BY_CHILDREN = 0, - GDK_INCLUDE_INFERIORS = 1 -} GdkSubwindowMode; - -typedef enum -{ - GDK_GC_FOREGROUND = 1 << 0, - GDK_GC_BACKGROUND = 1 << 1, - GDK_GC_FONT = 1 << 2, - GDK_GC_FUNCTION = 1 << 3, - GDK_GC_FILL = 1 << 4, - GDK_GC_TILE = 1 << 5, - GDK_GC_STIPPLE = 1 << 6, - GDK_GC_CLIP_MASK = 1 << 7, - GDK_GC_SUBWINDOW = 1 << 8, - GDK_GC_TS_X_ORIGIN = 1 << 9, - GDK_GC_TS_Y_ORIGIN = 1 << 10, - GDK_GC_CLIP_X_ORIGIN = 1 << 11, - GDK_GC_CLIP_Y_ORIGIN = 1 << 12, - GDK_GC_EXPOSURES = 1 << 13, - GDK_GC_LINE_WIDTH = 1 << 14, - GDK_GC_LINE_STYLE = 1 << 15, - GDK_GC_CAP_STYLE = 1 << 16, - GDK_GC_JOIN_STYLE = 1 << 17 -} GdkGCValuesMask; - -struct _GdkGCValues -{ - GdkColor foreground; - GdkColor background; - GdkFont *font; - GdkFunction function; - GdkFill fill; - GdkPixmap *tile; - GdkPixmap *stipple; - GdkPixmap *clip_mask; - GdkSubwindowMode subwindow_mode; - gint ts_x_origin; - gint ts_y_origin; - gint clip_x_origin; - gint clip_y_origin; - gint graphics_exposures; - gint line_width; - GdkLineStyle line_style; - GdkCapStyle cap_style; - GdkJoinStyle join_style; -}; - -#define GDK_TYPE_GC (gdk_gc_get_type ()) -#define GDK_GC(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC)) -#define GDK_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass)) -#define GDK_IS_GC(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC)) -#define GDK_IS_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC)) -#define GDK_GC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass)) - -struct _GdkGC -{ - GObject parent_instance; - - gint clip_x_origin; - gint clip_y_origin; - gint ts_x_origin; - gint ts_y_origin; - - GdkColormap *colormap; -}; - -struct _GdkGCClass -{ - GObjectClass parent_class; - - void (*get_values) (GdkGC *gc, - GdkGCValues *values); - void (*set_values) (GdkGC *gc, - GdkGCValues *values, - GdkGCValuesMask mask); - void (*set_dashes) (GdkGC *gc, - gint dash_offset, - gint8 dash_list[], - gint n); - - /* Padding for future expansion */ - void (*_gdk_reserved1) (void); - void (*_gdk_reserved2) (void); - void (*_gdk_reserved3) (void); - void (*_gdk_reserved4) (void); -}; - - -GType gdk_gc_get_type (void) G_GNUC_CONST; -GdkGC *gdk_gc_new (GdkDrawable *drawable); -GdkGC *gdk_gc_new_with_values (GdkDrawable *drawable, - GdkGCValues *values, - GdkGCValuesMask values_mask); - -#ifndef GDK_DISABLE_DEPRECATED -GdkGC *gdk_gc_ref (GdkGC *gc); -void gdk_gc_unref (GdkGC *gc); -#endif - -void gdk_gc_get_values (GdkGC *gc, - GdkGCValues *values); -void gdk_gc_set_values (GdkGC *gc, - GdkGCValues *values, - GdkGCValuesMask values_mask); -void gdk_gc_set_foreground (GdkGC *gc, - const GdkColor *color); -void gdk_gc_set_background (GdkGC *gc, - const GdkColor *color); -#ifndef GDK_DISABLE_DEPRECATED -void gdk_gc_set_font (GdkGC *gc, - GdkFont *font); -#endif /* GDK_DISABLE_DEPRECATED */ -void gdk_gc_set_function (GdkGC *gc, - GdkFunction function); -void gdk_gc_set_fill (GdkGC *gc, - GdkFill fill); -void gdk_gc_set_tile (GdkGC *gc, - GdkPixmap *tile); -void gdk_gc_set_stipple (GdkGC *gc, - GdkPixmap *stipple); -void gdk_gc_set_ts_origin (GdkGC *gc, - gint x, - gint y); -void gdk_gc_set_clip_origin (GdkGC *gc, - gint x, - gint y); -void gdk_gc_set_clip_mask (GdkGC *gc, - GdkBitmap *mask); -void gdk_gc_set_clip_rectangle (GdkGC *gc, - GdkRectangle *rectangle); -void gdk_gc_set_clip_region (GdkGC *gc, - GdkRegion *region); -void gdk_gc_set_subwindow (GdkGC *gc, - GdkSubwindowMode mode); -void gdk_gc_set_exposures (GdkGC *gc, - gboolean exposures); -void gdk_gc_set_line_attributes (GdkGC *gc, - gint line_width, - GdkLineStyle line_style, - GdkCapStyle cap_style, - GdkJoinStyle join_style); -void gdk_gc_set_dashes (GdkGC *gc, - gint dash_offset, - gint8 dash_list[], - gint n); -void gdk_gc_offset (GdkGC *gc, - gint x_offset, - gint y_offset); -void gdk_gc_copy (GdkGC *dst_gc, - GdkGC *src_gc); - - -void gdk_gc_set_colormap (GdkGC *gc, - GdkColormap *colormap); -GdkColormap *gdk_gc_get_colormap (GdkGC *gc); -void gdk_gc_set_rgb_fg_color (GdkGC *gc, - const GdkColor *color); -void gdk_gc_set_rgb_bg_color (GdkGC *gc, - const GdkColor *color); -GdkScreen * gdk_gc_get_screen (GdkGC *gc); - -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_gc_destroy gdk_gc_unref -#endif /* GDK_DISABLE_DEPRECATED */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __GDK_DRAWABLE_H__ */ diff --git a/mui/gtk-mui/gdk/gdkmui.c b/mui/gtk-mui/gdk/gdkmui.c deleted file mode 100644 index 553ad06ea..000000000 --- a/mui/gtk-mui/gdk/gdkmui.c +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner, Ilkka Lehtoranta - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include <../gtk_globals.h> - -#include -#include - -#include "gdkconfig.h" - -#if USE_PENS - -void gdkmui_set_color(struct RastPort *rp, GdkGC *gc) -{ - if(gc->colormap->colors->havepen==1) { - pen=(LONG) gc->colormap->colors->pen; - DebOut(" found pen: %d\n",(int) pen); - } - else { - DebOut("WARNING: assuming gc pointer is a pen (%d)..\n",gc); /* This should not be the case any more! */ - pen=(LONG) gc; - } - - SetAPen(_rp(obj),_dri(obj)->dri_Pens[pen]); -} - -#else - -void gdkmui_set_color(struct RastPort *rp, GdkGC *gc) -{ - ULONG r, g, b; - - r = gc->colormap->colors->red >> 8; - g = gc->colormap->colors->green >> 8; - b = gc->colormap->colors->blue >> 8; - - SetRPAttrs(rp, RPTAG_PenMode, FALSE, RPTAG_FgColor, (r << 16) | (g << 8) | (b << 0), TAG_DONE); -} - -#endif diff --git a/mui/gtk-mui/gdk/gdkmui.h b/mui/gtk-mui/gdk/gdkmui.h deleted file mode 100644 index 1b9642261..000000000 --- a/mui/gtk-mui/gdk/gdkmui.h +++ /dev/null @@ -1,36 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner, Ilkka Lehtoranta - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#ifndef __GDKMUI_H__ -#define __GDKMUI_H__ - -void gdkmui_set_color(struct RastPort *rp, GdkGC *gc); - -#endif /* __GDKMUI_H__ */ \ No newline at end of file diff --git a/mui/gtk-mui/gdk/gdktypes.h b/mui/gtk-mui/gdk/gdktypes.h deleted file mode 100644 index e8daf6fa6..000000000 --- a/mui/gtk-mui/gdk/gdktypes.h +++ /dev/null @@ -1,218 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* - * Modified by Oliver Brunner 2005 for mui-gtk - */ -#ifndef __GDK_TYPES_H__ -#define __GDK_TYPES_H__ - -/* GDK uses "glib". (And so does GTK). - */ - /* -#include -#include -#include - */ - -/* -#ifdef G_OS_WIN32 -# ifdef GDK_COMPILATION -# define GDKVAR __declspec(dllexport) -# else -# define GDKVAR extern __declspec(dllimport) -# endif -#else -# define GDKVAR extern -#endif -*/ - -/* The system specific file gdkconfig.h contains such configuration - * settings that are needed not only when compiling GDK (or GTK) - * itself, but also occasionally when compiling programs that use GDK - * (or GTK). One such setting is what windowing API backend is in use. - */ -/*#include */ - -/* some common magic values */ -#define GDK_CURRENT_TIME 0L -#define GDK_PARENT_RELATIVE 1L - - - -/*#ifdef __cplusplus -extern "C" { -#endif*/ /* __cplusplus */ - - -/* Type definitions for the basic structures. - */ -typedef struct _GdkPoint GdkPoint; -typedef struct _GdkRectangle GdkRectangle; -typedef struct _GdkSegment GdkSegment; -typedef struct _GdkSpan GdkSpan; - -/* - * Note that on some platforms the wchar_t type - * is not the same as GdkWChar. For instance - * on Win32, wchar_t is unsigned short. - */ -typedef guint32 GdkWChar; - -typedef struct _GdkAtom *GdkAtom; - -#define GDK_ATOM_TO_POINTER(atom) (atom) -#define GDK_POINTER_TO_ATOM(ptr) ((GdkAtom)(ptr)) - -#define _GDK_MAKE_ATOM(val) ((GdkAtom)GUINT_TO_POINTER(val)) -#define GDK_NONE _GDK_MAKE_ATOM (0) - -#ifdef GDK_NATIVE_WINDOW_POINTER -typedef gpointer GdkNativeWindow; -#else -typedef guint32 GdkNativeWindow; -#endif - -/* Forward declarations of commonly used types - */ -typedef struct _GdkColor GdkColor; -typedef struct _GdkColormap GdkColormap; -typedef struct _GdkCursor GdkCursor; -typedef struct _GdkFont GdkFont; -typedef struct _GdkGC GdkGC; -typedef struct _GdkImage GdkImage; -typedef struct _GdkRegion GdkRegion; -typedef struct _GdkVisual GdkVisual; - -typedef struct _GdkDrawable GdkDrawable; -typedef struct _GdkDrawable GdkBitmap; -typedef struct _GdkDrawable GdkPixmap; -typedef struct _GdkDrawable GdkWindow; -typedef struct _GdkDisplay GdkDisplay; -typedef struct _GdkScreen GdkScreen; - -typedef enum -{ - GDK_LSB_FIRST, - GDK_MSB_FIRST -} GdkByteOrder; - -/* Types of modifiers. - */ -typedef enum -{ - GDK_SHIFT_MASK = 1 << 0, - GDK_LOCK_MASK = 1 << 1, - GDK_CONTROL_MASK = 1 << 2, - GDK_MOD1_MASK = 1 << 3, - GDK_MOD2_MASK = 1 << 4, - GDK_MOD3_MASK = 1 << 5, - GDK_MOD4_MASK = 1 << 6, - GDK_MOD5_MASK = 1 << 7, - GDK_BUTTON1_MASK = 1 << 8, - GDK_BUTTON2_MASK = 1 << 9, - GDK_BUTTON3_MASK = 1 << 10, - GDK_BUTTON4_MASK = 1 << 11, - GDK_BUTTON5_MASK = 1 << 12, - /* The next few modifiers are used by XKB, so we skip to the end. - * Bits 16 - 28 are currently unused, but will eventually - * be used for "virtual modifiers". Bit 29 is used internally. - */ - GDK_RELEASE_MASK = 1 << 30, - GDK_MODIFIER_MASK = GDK_RELEASE_MASK | 0x1fff -} GdkModifierType; - -typedef enum -{ - GDK_INPUT_READ = 1 << 0, - GDK_INPUT_WRITE = 1 << 1, - GDK_INPUT_EXCEPTION = 1 << 2 -} GdkInputCondition; - -typedef enum -{ - GDK_OK = 0, - GDK_ERROR = -1, - GDK_ERROR_PARAM = -2, - GDK_ERROR_FILE = -3, - GDK_ERROR_MEM = -4 -} GdkStatus; - -/* We define specific numeric values for these constants, - * since old application code may depend on them matching the X values - * We don't actually depend on the matchup ourselves. - */ -typedef enum -{ - GDK_GRAB_SUCCESS = 0, - GDK_GRAB_ALREADY_GRABBED = 1, - GDK_GRAB_INVALID_TIME = 2, - GDK_GRAB_NOT_VIEWABLE = 3, - GDK_GRAB_FROZEN = 4 -} GdkGrabStatus; - -typedef void (*GdkInputFunction) (gpointer data, - gint source, - GdkInputCondition condition); - -typedef void (*GdkDestroyNotify) (gpointer data); - -struct _GdkPoint -{ - gint x; - gint y; -}; - -struct _GdkRectangle -{ - gint x; - gint y; - gint width; - gint height; -}; - -struct _GdkSegment -{ - gint x1; - gint y1; - gint x2; - gint y2; -}; - -struct _GdkSpan -{ - gint x; - gint y; - gint width; -}; - -/* -#ifdef __cplusplus -} -#endif*/ /* __cplusplus */ - - -#endif /* __GDK_TYPES_H__ */ diff --git a/mui/gtk-mui/gdk/gdkvisual.h b/mui/gtk-mui/gdk/gdkvisual.h deleted file mode 100644 index 37a26ff8f..000000000 --- a/mui/gtk-mui/gdk/gdkvisual.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef __GDK_VISUAL_H__ -#define __GDK_VISUAL_H__ - -#include - -/*G_BEGIN_DECLS*/ - -#define GDK_TYPE_VISUAL (gdk_visual_get_type ()) -#define GDK_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_VISUAL, GdkVisual)) -#define GDK_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_VISUAL, GdkVisualClass)) -#define GDK_IS_VISUAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_VISUAL)) -#define GDK_IS_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_VISUAL)) -#define GDK_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_VISUAL, GdkVisualClass)) - -typedef struct _GdkVisualClass GdkVisualClass; - -/* Types of visuals. - * StaticGray: - * Grayscale: - * StaticColor: - * PseudoColor: - * TrueColor: - * DirectColor: - */ -typedef enum -{ - GDK_VISUAL_STATIC_GRAY, - GDK_VISUAL_GRAYSCALE, - GDK_VISUAL_STATIC_COLOR, - GDK_VISUAL_PSEUDO_COLOR, - GDK_VISUAL_TRUE_COLOR, - GDK_VISUAL_DIRECT_COLOR -} GdkVisualType; - -/* The visual type. - * "type" is the type of visual this is (PseudoColor, TrueColor, etc). - * "depth" is the bit depth of this visual. - * "colormap_size" is the size of a colormap for this visual. - * "bits_per_rgb" is the number of significant bits per red, green and blue. - * The red, green and blue masks, shifts and precisions refer - * to value needed to calculate pixel values in TrueColor and DirectColor - * visuals. The "mask" is the significant bits within the pixel. The - * "shift" is the number of bits left we must shift a primary for it - * to be in position (according to the "mask"). "prec" refers to how - * much precision the pixel value contains for a particular primary. - */ -struct _GdkVisual -{ -/* GObject parent_instance;*/ - - GdkVisualType type; - gint depth; - GdkByteOrder byte_order; - gint colormap_size; - gint bits_per_rgb; - - guint32 red_mask; - gint red_shift; - gint red_prec; - - guint32 green_mask; - gint green_shift; - gint green_prec; - - guint32 blue_mask; - gint blue_shift; - gint blue_prec; - -/* GTK-MUI internal: - * - * more than ugly hack, to get a params - */ - int *mgtk_widget; -}; - -GType gdk_visual_get_type (void) G_GNUC_CONST; - -#ifndef GDK_MULTIHEAD_SAFE -gint gdk_visual_get_best_depth (void); -GdkVisualType gdk_visual_get_best_type (void); -GdkVisual* gdk_visual_get_system (void); -GdkVisual* gdk_visual_get_best (void); -GdkVisual* gdk_visual_get_best_with_depth (gint depth); -GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type); -GdkVisual* gdk_visual_get_best_with_both (gint depth, - GdkVisualType visual_type); - -void gdk_query_depths (gint **depths, - gint *count); -void gdk_query_visual_types (GdkVisualType **visual_types, - gint *count); - -GList* gdk_list_visuals (void); -#endif - -GdkScreen *gdk_visual_get_screen (GdkVisual *visual); - -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_visual_ref(v) g_object_ref(v) -#define gdk_visual_unref(v) g_object_unref(v) -#endif - -/*G_END_DECLS*/ - -#endif /* __GDK_VISUAL_H__ */ diff --git a/mui/gtk-mui/gdk/gdkwindow.h b/mui/gtk-mui/gdk/gdkwindow.h deleted file mode 100644 index ac0211c0e..000000000 --- a/mui/gtk-mui/gdk/gdkwindow.h +++ /dev/null @@ -1,608 +0,0 @@ -/************************************************** - * taken and modified from the gtk+-2.6.9 sources, - * there was no "original copyright header", so - * don't complain, that it is missing. - * - * o1i - * - * $Id$ - **************************************************/ - -#ifndef __GDK_WINDOW_H__ -#define __GDK_WINDOW_H__ - -#include -#include -#include -#include -/* -#include -*/ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _GdkGeometry GdkGeometry; -typedef struct _GdkWindowAttr GdkWindowAttr; -typedef struct _GdkPointerHooks GdkPointerHooks; - -/* Classes of windows. - * InputOutput: Almost every window should be of this type. Such windows - * receive events and are also displayed on screen. - * InputOnly: Used only in special circumstances when events need to be - * stolen from another window or windows. Input only windows - * have no visible output, so they are handy for placing over - * top of a group of windows in order to grab the events (or - * filter the events) from those windows. - */ -typedef enum -{ - GDK_INPUT_OUTPUT, - GDK_INPUT_ONLY -} GdkWindowClass; - -/* Types of windows. - * Root: There is only 1 root window and it is initialized - * at startup. Creating a window of type GDK_WINDOW_ROOT - * is an error. - * Toplevel: Windows which interact with the window manager. - * Child: Windows which are children of some other type of window. - * (Any other type of window). Most windows are child windows. - * Dialog: A special kind of toplevel window which interacts with - * the window manager slightly differently than a regular - * toplevel window. Dialog windows should be used for any - * transient window. - * Foreign: A window that actually belongs to another application - */ -typedef enum -{ - GDK_WINDOW_ROOT, - GDK_WINDOW_TOPLEVEL, - GDK_WINDOW_CHILD, - GDK_WINDOW_DIALOG, - GDK_WINDOW_TEMP, - GDK_WINDOW_FOREIGN -} GdkWindowType; - -/* Window attribute mask values. - * GDK_WA_TITLE: The "title" field is valid. - * GDK_WA_X: The "x" field is valid. - * GDK_WA_Y: The "y" field is valid. - * GDK_WA_CURSOR: The "cursor" field is valid. - * GDK_WA_COLORMAP: The "colormap" field is valid. - * GDK_WA_VISUAL: The "visual" field is valid. - */ -typedef enum -{ - GDK_WA_TITLE = 1 << 1, - GDK_WA_X = 1 << 2, - GDK_WA_Y = 1 << 3, - GDK_WA_CURSOR = 1 << 4, - GDK_WA_COLORMAP = 1 << 5, - GDK_WA_VISUAL = 1 << 6, - GDK_WA_WMCLASS = 1 << 7, - GDK_WA_NOREDIR = 1 << 8 -} GdkWindowAttributesType; - -/* Size restriction enumeration. - */ -typedef enum -{ - GDK_HINT_POS = 1 << 0, - GDK_HINT_MIN_SIZE = 1 << 1, - GDK_HINT_MAX_SIZE = 1 << 2, - GDK_HINT_BASE_SIZE = 1 << 3, - GDK_HINT_ASPECT = 1 << 4, - GDK_HINT_RESIZE_INC = 1 << 5, - GDK_HINT_WIN_GRAVITY = 1 << 6, - GDK_HINT_USER_POS = 1 << 7, - GDK_HINT_USER_SIZE = 1 << 8 -} GdkWindowHints; - - -/* Window type hints. - * These are hints for the window manager that indicate - * what type of function the window has. The window manager - * can use this when determining decoration and behaviour - * of the window. The hint must be set before mapping the - * window. - * - * Normal: Normal toplevel window - * Dialog: Dialog window - * Menu: Window used to implement a menu. - * Toolbar: Window used to implement toolbars. - */ -typedef enum -{ - GDK_WINDOW_TYPE_HINT_NORMAL, - GDK_WINDOW_TYPE_HINT_DIALOG, - GDK_WINDOW_TYPE_HINT_MENU, - GDK_WINDOW_TYPE_HINT_TOOLBAR, - GDK_WINDOW_TYPE_HINT_SPLASHSCREEN, - GDK_WINDOW_TYPE_HINT_UTILITY, - GDK_WINDOW_TYPE_HINT_DOCK, - GDK_WINDOW_TYPE_HINT_DESKTOP -} GdkWindowTypeHint; - - -/* The next two enumeration values current match the - * Motif constants. If this is changed, the implementation - * of gdk_window_set_decorations/gdk_window_set_functions - * will need to change as well. - */ -typedef enum -{ - GDK_DECOR_ALL = 1 << 0, - GDK_DECOR_BORDER = 1 << 1, - GDK_DECOR_RESIZEH = 1 << 2, - GDK_DECOR_TITLE = 1 << 3, - GDK_DECOR_MENU = 1 << 4, - GDK_DECOR_MINIMIZE = 1 << 5, - GDK_DECOR_MAXIMIZE = 1 << 6 -} GdkWMDecoration; - -typedef enum -{ - GDK_FUNC_ALL = 1 << 0, - GDK_FUNC_RESIZE = 1 << 1, - GDK_FUNC_MOVE = 1 << 2, - GDK_FUNC_MINIMIZE = 1 << 3, - GDK_FUNC_MAXIMIZE = 1 << 4, - GDK_FUNC_CLOSE = 1 << 5 -} GdkWMFunction; - -/* Currently, these are the same values numerically as in the - * X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints() - * will need fixing. - */ -typedef enum -{ - GDK_GRAVITY_NORTH_WEST = 1, - GDK_GRAVITY_NORTH, - GDK_GRAVITY_NORTH_EAST, - GDK_GRAVITY_WEST, - GDK_GRAVITY_CENTER, - GDK_GRAVITY_EAST, - GDK_GRAVITY_SOUTH_WEST, - GDK_GRAVITY_SOUTH, - GDK_GRAVITY_SOUTH_EAST, - GDK_GRAVITY_STATIC -} GdkGravity; - - -typedef enum -{ - GDK_WINDOW_EDGE_NORTH_WEST, - GDK_WINDOW_EDGE_NORTH, - GDK_WINDOW_EDGE_NORTH_EAST, - GDK_WINDOW_EDGE_WEST, - GDK_WINDOW_EDGE_EAST, - GDK_WINDOW_EDGE_SOUTH_WEST, - GDK_WINDOW_EDGE_SOUTH, - GDK_WINDOW_EDGE_SOUTH_EAST -} GdkWindowEdge; - -struct _GdkWindowAttr -{ - gchar *title; - gint event_mask; - gint x, y; - gint width; - gint height; - GdkWindowClass wclass; - GdkVisual *visual; - GdkColormap *colormap; - GdkWindowType window_type; - GdkCursor *cursor; - gchar *wmclass_name; - gchar *wmclass_class; - gboolean override_redirect; -}; - -struct _GdkGeometry -{ - gint min_width; - gint min_height; - gint max_width; - gint max_height; - gint base_width; - gint base_height; - gint width_inc; - gint height_inc; - gdouble min_aspect; - gdouble max_aspect; - GdkGravity win_gravity; -}; - -struct _GdkPointerHooks -{ - GdkWindow* (*get_pointer) (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask); - GdkWindow* (*window_at_pointer) (GdkScreen *screen, /* unused */ - gint *win_x, - gint *win_y); -}; - -typedef struct _GdkWindowObject GdkWindowObject; -typedef struct _GdkWindowObjectClass GdkWindowObjectClass; - -#define GDK_TYPE_WINDOW (gdk_window_object_get_type ()) -#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow)) -#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass)) -#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW)) -#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW)) -#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass)) -#define GDK_WINDOW_OBJECT(object) ((GdkWindowObject *) GDK_WINDOW (object)) - -struct _GdkWindowObject -{ - GdkDrawable parent_instance; - - GdkDrawable *impl; /* window-system-specific delegate object */ - - GdkWindowObject *parent; - - gpointer user_data; - - gint x; - gint y; - - gint extension_events; - - GList *filters; - GList *children; - - GdkColor bg_color; - GdkPixmap *bg_pixmap; - - GSList *paint_stack; - - GdkRegion *update_area; - guint update_freeze_count; - - guint8 window_type; - guint8 depth; - guint8 resize_count; - - GdkWindowState state; - - guint guffaw_gravity : 1; - guint input_only : 1; - guint modal_hint : 1; - - guint destroyed : 2; - - guint accept_focus : 1; - guint focus_on_map : 1; - - GdkEventMask event_mask; -}; - -struct _GdkWindowObjectClass -{ - GdkDrawableClass parent_class; -}; - -/* Windows - */ -GType gdk_window_object_get_type (void) G_GNUC_CONST; -GdkWindow* gdk_window_new (GdkWindow *parent, - GdkWindowAttr *attributes, - gint attributes_mask); -void gdk_window_destroy (GdkWindow *window); -GdkWindowType gdk_window_get_window_type (GdkWindow *window); -GdkWindow* gdk_window_at_pointer (gint *win_x, - gint *win_y); -void gdk_window_show (GdkWindow *window); -void gdk_window_hide (GdkWindow *window); -void gdk_window_withdraw (GdkWindow *window); -void gdk_window_show_unraised (GdkWindow *window); -void gdk_window_move (GdkWindow *window, - gint x, - gint y); -void gdk_window_resize (GdkWindow *window, - gint width, - gint height); -void gdk_window_move_resize (GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gdk_window_reparent (GdkWindow *window, - GdkWindow *new_parent, - gint x, - gint y); -void gdk_window_clear (GdkWindow *window); -void gdk_window_clear_area (GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gdk_window_clear_area_e (GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gdk_window_raise (GdkWindow *window); -void gdk_window_lower (GdkWindow *window); -void gdk_window_focus (GdkWindow *window, - guint32 timestamp); -void gdk_window_set_user_data (GdkWindow *window, - gpointer user_data); -void gdk_window_set_override_redirect (GdkWindow *window, - gboolean override_redirect); -void gdk_window_set_accept_focus (GdkWindow *window, - gboolean accept_focus); -void gdk_window_set_focus_on_map (GdkWindow *window, - gboolean focus_on_map); -void gdk_window_add_filter (GdkWindow *window, - GdkFilterFunc function, - gpointer data); -void gdk_window_remove_filter (GdkWindow *window, - GdkFilterFunc function, - gpointer data); -void gdk_window_scroll (GdkWindow *window, - gint dx, - gint dy); - -/* - * This allows for making shaped (partially transparent) windows - * - cool feature, needed for Drag and Drag for example. - * The shape_mask can be the mask - * from gdk_pixmap_create_from_xpm. Stefan Wille - */ -void gdk_window_shape_combine_mask (GdkWindow *window, - GdkBitmap *mask, - gint x, - gint y); -void gdk_window_shape_combine_region (GdkWindow *window, - GdkRegion *shape_region, - gint offset_x, - gint offset_y); - -/* - * This routine allows you to quickly take the shapes of all the child windows - * of a window and use their shapes as the shape mask for this window - useful - * for container windows that dont want to look like a big box - * - * - Raster - */ -void gdk_window_set_child_shapes (GdkWindow *window); - -/* - * This routine allows you to merge (ie ADD) child shapes to your - * own window's shape keeping its current shape and ADDING the child - * shapes to it. - * - * - Raster - */ -void gdk_window_merge_child_shapes (GdkWindow *window); - -/* - * Check if a window has been shown, and whether all its - * parents up to a toplevel have been shown, respectively. - * Note that a window that is_viewable below is not necessarily - * viewable in the X sense. - */ -gboolean gdk_window_is_visible (GdkWindow *window); -gboolean gdk_window_is_viewable (GdkWindow *window); - -GdkWindowState gdk_window_get_state (GdkWindow *window); - -/* Set static bit gravity on the parent, and static - * window gravity on all children. - */ -gboolean gdk_window_set_static_gravities (GdkWindow *window, - gboolean use_static); - -/* Functions to create/lookup windows from their native equivalents */ -#ifndef GDK_MULTIHEAD_SAFE -GdkWindow* gdk_window_foreign_new (GdkNativeWindow anid); -GdkWindow* gdk_window_lookup (GdkNativeWindow anid); -#endif -GdkWindow *gdk_window_foreign_new_for_display (GdkDisplay *display, - GdkNativeWindow anid); -GdkWindow* gdk_window_lookup_for_display (GdkDisplay *display, - GdkNativeWindow anid); - - -/* GdkWindow */ - -#ifndef GDK_DISABLE_DEPRECATED -void gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags); -#endif -void gdk_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint); -void gdk_window_set_modal_hint (GdkWindow *window, - gboolean modal); - -void gdk_window_set_skip_taskbar_hint (GdkWindow *window, - gboolean skips_taskbar); -void gdk_window_set_skip_pager_hint (GdkWindow *window, - gboolean skips_pager); - -void gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask); -void gdk_set_sm_client_id (const gchar *sm_client_id); - -void gdk_window_begin_paint_rect (GdkWindow *window, - GdkRectangle *rectangle); -void gdk_window_begin_paint_region (GdkWindow *window, - GdkRegion *region); -void gdk_window_end_paint (GdkWindow *window); - -void gdk_window_set_title (GdkWindow *window, - const gchar *title); -void gdk_window_set_role (GdkWindow *window, - const gchar *role); -void gdk_window_set_transient_for (GdkWindow *window, - GdkWindow *parent); -void gdk_window_set_background (GdkWindow *window, - const GdkColor *color); -void gdk_window_set_back_pixmap (GdkWindow *window, - GdkPixmap *pixmap, - gboolean parent_relative); -void gdk_window_set_cursor (GdkWindow *window, - GdkCursor *cursor); -void gdk_window_get_user_data (GdkWindow *window, - gpointer *data); -void gdk_window_get_geometry (GdkWindow *window, - gint *x, - gint *y, - gint *width, - gint *height, - gint *depth); -void gdk_window_get_position (GdkWindow *window, - gint *x, - gint *y); -gint gdk_window_get_origin (GdkWindow *window, - gint *x, - gint *y); - -#if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION) -/* Used by gtk_handle_box_button_changed () */ -gboolean gdk_window_get_deskrelative_origin (GdkWindow *window, - gint *x, - gint *y); -#endif - -void gdk_window_get_root_origin (GdkWindow *window, - gint *x, - gint *y); -void gdk_window_get_frame_extents (GdkWindow *window, - GdkRectangle *rect); -GdkWindow* gdk_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask); -GdkWindow * gdk_window_get_parent (GdkWindow *window); -GdkWindow * gdk_window_get_toplevel (GdkWindow *window); - -GList * gdk_window_get_children (GdkWindow *window); -GList * gdk_window_peek_children (GdkWindow *window); -GdkEventMask gdk_window_get_events (GdkWindow *window); -void gdk_window_set_events (GdkWindow *window, - GdkEventMask event_mask); - -void gdk_window_set_icon_list (GdkWindow *window, - GList *pixbufs); -void gdk_window_set_icon (GdkWindow *window, - GdkWindow *icon_window, - GdkPixmap *pixmap, - GdkBitmap *mask); -void gdk_window_set_icon_name (GdkWindow *window, - const gchar *name); -void gdk_window_set_group (GdkWindow *window, - GdkWindow *leader); -GdkWindow* gdk_window_get_group (GdkWindow *window); -void gdk_window_set_decorations (GdkWindow *window, - GdkWMDecoration decorations); -gboolean gdk_window_get_decorations (GdkWindow *window, - GdkWMDecoration *decorations); -void gdk_window_set_functions (GdkWindow *window, - GdkWMFunction functions); -#ifndef GDK_MULTIHEAD_SAFE -GList * gdk_window_get_toplevels (void); -#endif - -void gdk_window_iconify (GdkWindow *window); -void gdk_window_deiconify (GdkWindow *window); -void gdk_window_stick (GdkWindow *window); -void gdk_window_unstick (GdkWindow *window); -void gdk_window_maximize (GdkWindow *window); -void gdk_window_unmaximize (GdkWindow *window); -void gdk_window_fullscreen (GdkWindow *window); -void gdk_window_unfullscreen (GdkWindow *window); -void gdk_window_set_keep_above (GdkWindow *window, - gboolean setting); -void gdk_window_set_keep_below (GdkWindow *window, - gboolean setting); - -void gdk_window_register_dnd (GdkWindow *window); - -void gdk_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, - gint button, - gint root_x, - gint root_y, - guint32 timestamp); -void gdk_window_begin_move_drag (GdkWindow *window, - gint button, - gint root_x, - gint root_y, - guint32 timestamp); - -/* Interface for dirty-region queueing */ -void gdk_window_invalidate_rect (GdkWindow *window, - GdkRectangle *rect, - gboolean invalidate_children); -void gdk_window_invalidate_region (GdkWindow *window, - GdkRegion *region, - gboolean invalidate_children); -void gdk_window_invalidate_maybe_recurse (GdkWindow *window, - GdkRegion *region, - gboolean (*child_func) (GdkWindow *, gpointer), - gpointer user_data); -GdkRegion *gdk_window_get_update_area (GdkWindow *window); - -void gdk_window_freeze_updates (GdkWindow *window); -void gdk_window_thaw_updates (GdkWindow *window); - -void gdk_window_process_all_updates (void); -void gdk_window_process_updates (GdkWindow *window, - gboolean update_children); - -/* Enable/disable flicker, so you can tell if your code is inefficient. */ -void gdk_window_set_debug_updates (gboolean setting); - -void gdk_window_constrain_size (GdkGeometry *geometry, - guint flags, - gint width, - gint height, - gint *new_width, - gint *new_height); - -void gdk_window_get_internal_paint_info (GdkWindow *window, - GdkDrawable **real_drawable, - gint *x_offset, - gint *y_offset); - -void gdk_window_enable_synchronized_configure (GdkWindow *window); -void gdk_window_configure_finished (GdkWindow *window); - -#ifndef GDK_MULTIHEAD_SAFE -GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); -#endif /* GDK_MULTIHEAD_SAFE */ - -GdkWindow *gdk_get_default_root_window (void); - -#ifndef GDK_DISABLE_DEPRECATED -#define GDK_ROOT_PARENT() (gdk_get_default_root_window ()) -#define gdk_window_get_size gdk_drawable_get_size -#define gdk_window_get_type gdk_window_get_window_type -#define gdk_window_get_colormap gdk_drawable_get_colormap -#define gdk_window_set_colormap gdk_drawable_set_colormap -#define gdk_window_get_visual gdk_drawable_get_visual -#define gdk_window_ref gdk_drawable_ref -#define gdk_window_unref gdk_drawable_unref - -#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \ - gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height) -#endif /* GDK_DISABLE_DEPRECATED */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __GDK_WINDOW_H__ */ diff --git a/mui/gtk-mui/gdk/gobject/gtype.h b/mui/gtk-mui/gdk/gobject/gtype.h deleted file mode 100644 index 487335ec1..000000000 --- a/mui/gtk-mui/gdk/gobject/gtype.h +++ /dev/null @@ -1,3 +0,0 @@ -/* file has moved to glib/gobject/gtype.h */ - -#include "../../glib/gobject/gtype.h" diff --git a/mui/gtk-mui/gdk/gobject/gvalue.h b/mui/gtk-mui/gdk/gobject/gvalue.h deleted file mode 100644 index f677f49d2..000000000 --- a/mui/gtk-mui/gdk/gobject/gvalue.h +++ /dev/null @@ -1,50 +0,0 @@ -/* GObject - GLib Type, Object, Parameter and Signal Library - * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * gvalue.h: generic GValue functions - * - * modified by o1i - */ - -#ifndef __G_VALUE_H__ -#define __G_VALUE_H__ - -#include - -/* --- typedefs & structures --- */ -struct _GValue -{ - /*< private >*/ - GType g_type; - - /* public for GTypeValueTable methods */ - union { - gint v_int; - guint v_uint; - glong v_long; - gulong v_ulong; - gint64 v_int64; - guint64 v_uint64; - gfloat v_float; - gdouble v_double; - gpointer v_pointer; - } data[2]; -}; - -#endif /* __G_VALUE_H__ */ - diff --git a/mui/gtk-mui/gdk/gobject/gvaluecollector.h b/mui/gtk-mui/gdk/gobject/gvaluecollector.h deleted file mode 100644 index 07869c8ee..000000000 --- a/mui/gtk-mui/gdk/gobject/gvaluecollector.h +++ /dev/null @@ -1,55 +0,0 @@ -/* GObject - GLib Type, Object, Parameter and Signal Library - * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * gvaluecollector.h: GValue varargs stubs - * - * modified by o1i - */ -#ifndef __G_VALUE_COLLECTOR_H__ -#define __G_VALUE_COLLECTOR_H__ - -#include - - -/* we may want to add aggregate types here some day, if requested - * by users. the basic C types are covered already, everything - * smaller than an int is promoted to an integer and floats are - * always promoted to doubles for varargs call constructions. - */ -enum /*< skip >*/ -{ - G_VALUE_COLLECT_INT = 'i', - G_VALUE_COLLECT_LONG = 'l', - G_VALUE_COLLECT_INT64 = 'q', - G_VALUE_COLLECT_DOUBLE = 'd', - G_VALUE_COLLECT_POINTER = 'p' -}; - - -/* vararg union holding actuall values collected - */ -union _GTypeCValue -{ - gint v_int; - glong v_long; - gint64 v_int64; - gdouble v_double; - gpointer v_pointer; -}; - -#endif /* __G_VALUE_COLLECTOR_H__ */ diff --git a/mui/gtk-mui/gdk/mmakefile.src b/mui/gtk-mui/gdk/mmakefile.src deleted file mode 100755 index db0968375..000000000 --- a/mui/gtk-mui/gdk/mmakefile.src +++ /dev/null @@ -1,21 +0,0 @@ -# $Id$ -# -include $(TOP)/config/make.cfg - -#MM- contrib-gdk-includes : includes - -INCLUDE_FILES := gdk.h \ - gdkcolor.h \ - gdkconfig.h \ - gdkdrawable.h \ - gdkevents.h \ - gdkgc.h \ - gdkmui.h \ - gdktypes.h \ - gdkvisual.h \ - gdkwindow.h \ - -%copy_includes path=gdk includes=$(INCLUDE_FILES) - -%common - diff --git a/mui/gtk-mui/glib.h b/mui/gtk-mui/glib.h deleted file mode 100644 index 8f518369b..000000000 --- a/mui/gtk-mui/glib.h +++ /dev/null @@ -1,11 +0,0 @@ - -#define G_BEGIN_DECLS -#define G_END_DECLS -#define DISABLE_MEM_POOLS 1 - -/* -#define g_return_val_if_fail(expr,val) -*/ - -#include -#include diff --git a/mui/gtk-mui/glib/config.h b/mui/gtk-mui/glib/config.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/mui/gtk-mui/glib/g_object.c b/mui/gtk-mui/glib/g_object.c deleted file mode 100644 index 6e123c735..000000000 --- a/mui/gtk-mui/glib/g_object.c +++ /dev/null @@ -1,232 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -/* - * This stuff contains a lot of bad magic. - * If someone wants to write his own custom widget, he - * - calls g_type_register_static with a parent widget type - * - and with the returned new id he calls g_object_new - * - * so we try to emulate this here ;) - * - * g_object_new calls the parent class new method and the - * custom class init function, resizes the class instance to - * the correct size and returns the new class instance. - */ -gpointer g_object_new(GType object_type, const gchar *first_property_name, ...) { - GtkWidget *ret; - GtkWidget *tmpret; - mgtk_Fundamental *f; - GtkWidget *(*callme)(); - void (*callme2)(GtkWidget *widget); - - DebOut("g_object_new(%d,..)\n",object_type); - WarnOut("g_object_new: some parameters ignored\n"); /* TODO */ - - f=mgtk_g_type_get_fundamental(object_type); - - if(f) { - if(f->newparentobject) { - callme=(APTR) f->newparentobject; - DebOut(" calling constructor of fundamental parent object_type\n"); - ret=(APTR) (*callme)(); /* TODO, parameters..!? */ - DebOut("f->instance_size: %d\n",f->instance_size); - DebOut("sizeof(GtkWidget): %d\n",sizeof(GtkWidget)); - if(f->instance_size > sizeof(GtkWidget)) { - /* copy ret to a new mem area with new size */ - tmpret=g_new(GtkWidget,f->instance_size); - DebOut(" resize object\n"); - memcpy(tmpret,ret,sizeof(GtkWidget)); - g_free(ret); - ret=tmpret; - if(ret->MuiObject) { - /* correct the reverse pointer ..*/ - set(ret->MuiObject,MA_Widget,ret); - } - } - - callme2=(APTR) f->newobject; - DebOut(" calling constructor of object_type\n"); - (*callme2)(ret); - /* now set up signal handlers of class, if present */ - if(f->class) { - if(f->class->realize) { - DebOut(" setting up realize handler\n"); - g_signal_connect_data(ret,"realized",G_CALLBACK(f->class->realize),ret,NULL,0); - DebOut("==============> f->class->realize=%lx\n",f->class->realize); - } - DebOut("ret->class=f->class: %lx->class:=%lx\n",ret,f->class); - ret->class=f->class; - } - - } - else { - DebOut(" there is no newparentobject, may cause problems..?\n"); - callme=(APTR) f->newobject; - DebOut(" calling constructor of object_type\n"); - ret=(APTR) (*callme)(); - } - } - else { - DebOut("WARNING: g_object_new returns NULL, we will soon crash..\n"); - ret=NULL; - } - - return (gpointer) ret; -} - -GType g_type_register_static(GType parent_type, const gchar *type_name, const GTypeInfo *info, GTypeFlags flags) { - - GType new_type; - mgtk_Fundamental *newf; - mgtk_Fundamental *oldf; - GtkWidgetClass *class; - void (*call_class_init)(APTR class); - - DebOut("g_type_register_static(%d,%s,%ld,%d)\n",parent_type,type_name,info,flags); - - if(!mgtk->mgtk_fundamental_count) { - /* init */ - mgtk->mgtk_fundamental_count=IS_LASTONE; - } - mgtk->mgtk_fundamental_count++; - new_type=mgtk->mgtk_fundamental_count; - - if(!mgtk_g_type_register_fundamental(new_type,type_name,NULL)) { - ErrOut("g_type_register_static failed!\n"); - return 0; - } - - newf=mgtk_g_type_get_fundamental(new_type); - oldf=mgtk_g_type_get_fundamental(parent_type); - - /* call class initializer */ - call_class_init=(APTR) info->class_init; - if(call_class_init) { - - /* create empty class */ - class=g_new0(GtkWidgetClass,sizeof(GtkWidgetClass)); - - DebOut(" calling class init 2\n"); - /*(*callme)(); * TODO, parameters..!? */ - (*call_class_init)(class); - DebOut("..\n"); - newf->class=class; - DebOut(" calling class init was successful\n"); - - /* the class has all signalhandlers, which are needed by - * the widgets afterwards - */ - } - - if(oldf) { - newf->newparentobject=oldf->newobject; - } - else { - DebOut("WARNING: no parent fundamental found!\n"); - } - newf->newobject=(APTR) info->instance_init; - newf->instance_size=info->instance_size; - - return new_type; -} - -GType mgtk_g_type_register_fundamental(GType type_id, const gchar *type_name, GtkWidget *(*newobject) (void)) { - - mgtk_Fundamental *newf; - mgtk_Fundamental *i; - - DebOut("mgtkg_type_register_fundamental(%d,%s,..)\n",type_id,type_name); - - newf=g_new(mgtk_Fundamental,sizeof(mgtk_Fundamental)); - - if(!mgtk->mgtk_fundamental) { - mgtk->mgtk_fundamental=newf; - } - else { - i=mgtk->mgtk_fundamental; - while(i->next != NULL) { - i=i->next; - } - i->next=newf; - } - - newf->type_id=type_id; - newf->type_name=g_strdup(type_name); - newf->newobject=newobject; - - return type_id; -} - -mgtk_Fundamental *mgtk_g_type_get_fundamental(GType type_id) { - mgtk_Fundamental *i; - - DebOut("mgtk_g_type_get_fundamental(%d)\n",type_id); - - if(type_id==0) { - DebOut(" type_id is 0 => use type_id IS_CUSTOM!\n"); - type_id=IS_CUSTOM; - } - - if(!mgtk->mgtk_fundamental) { - DebOut(" no registered fundamentals, returning NULL\n"); - return NULL; - } - - i=mgtk->mgtk_fundamental; - - while((i!=NULL) && (i->type_id != type_id)) { -/* DebOut("i->type_id: %d==%d\n",type_id,i->type_id);*/ - i=i->next; - } - - if((i) && (i->type_id == type_id)) { - DebOut(" found fundamental %d: %lx\n",type_id,i); - return i; - } - - DebOut("WARNING: fundamental type not found, returning NULL!\n"); - return NULL; -} - diff --git a/mui/gtk-mui/glib/garray.h b/mui/gtk-mui/glib/garray.h deleted file mode 100644 index b01c3ea3b..000000000 --- a/mui/gtk-mui/glib/garray.h +++ /dev/null @@ -1,175 +0,0 @@ -/* GLIB - Library of useful routines for C programming - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GLib Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GLib Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* modified by o1i 2005 */ - -#ifndef __G_ARRAY_H__ -#define __G_ARRAY_H__ - -#include - -/*G_BEGIN_DECLS*/ - -typedef struct _GArray GArray; -typedef struct _GByteArray GByteArray; -typedef struct _GPtrArray GPtrArray; - -struct _GArray -{ - gchar *data; - guint len; -}; - -struct _GByteArray -{ - guint8 *data; - guint len; -}; - -struct _GPtrArray -{ - gpointer *pdata; - guint len; -}; - -/* Resizable arrays. remove fills any cleared spot and shortens the - * array, while preserving the order. remove_fast will distort the - * order by moving the last element to the position of the removed. - */ - -#define g_array_append_val(a,v) g_array_append_vals (a, &(v), 1) -#define g_array_prepend_val(a,v) g_array_prepend_vals (a, &(v), 1) -#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &(v), 1) -#define g_array_index(a,t,i) (((t*) (a)->data) [(i)]) - -GArray* g_array_new (gboolean zero_terminated, - gboolean clear_, - guint element_size); -GArray* g_array_sized_new (gboolean zero_terminated, - gboolean clear_, - guint element_size, - guint reserved_size); -gchar* g_array_free (GArray *array, - gboolean free_segment); -GArray* g_array_append_vals (GArray *array, - gconstpointer data, - guint len); -GArray* g_array_prepend_vals (GArray *array, - gconstpointer data, - guint len); -GArray* g_array_insert_vals (GArray *array, - guint index_, - gconstpointer data, - guint len); -GArray* g_array_set_size (GArray *array, - guint length); -GArray* g_array_remove_index (GArray *array, - guint index_); -GArray* g_array_remove_index_fast (GArray *array, - guint index_); -GArray* g_array_remove_range (GArray *array, - guint index_, - guint length); -/* -void g_array_sort (GArray *array, - GCompareFunc compare_func); -void g_array_sort_with_data (GArray *array, - GCompareDataFunc compare_func, - gpointer user_data); -*/ - -/* Resizable pointer array. This interface is much less complicated - * than the above. Add appends a pointer. Remove fills any cleared - * spot and shortens the array. remove_fast will again distort order. - */ -#define g_ptr_array_index(array,index_) ((array)->pdata)[index_] -GPtrArray* g_ptr_array_new (void); -GPtrArray* g_ptr_array_sized_new (guint reserved_size); -gpointer* g_ptr_array_free (GPtrArray *array, - gboolean free_seg); -void g_ptr_array_set_size (GPtrArray *array, - gint length); -gpointer g_ptr_array_remove_index (GPtrArray *array, - guint index_); -gpointer g_ptr_array_remove_index_fast (GPtrArray *array, - guint index_); -gboolean g_ptr_array_remove (GPtrArray *array, - gpointer data); -gboolean g_ptr_array_remove_fast (GPtrArray *array, - gpointer data); -void g_ptr_array_remove_range (GPtrArray *array, - guint index_, - guint length); -void g_ptr_array_add (GPtrArray *array, - gpointer data); -/* -void g_ptr_array_sort (GPtrArray *array, - GCompareFunc compare_func); -void g_ptr_array_sort_with_data (GPtrArray *array, - GCompareDataFunc compare_func, - gpointer user_data); -void g_ptr_array_foreach (GPtrArray *array, - GFunc func, - gpointer user_data); -*/ - - -/* Byte arrays, an array of guint8. Implemented as a GArray, - * but type-safe. - */ - -GByteArray* g_byte_array_new (void); -GByteArray* g_byte_array_sized_new (guint reserved_size); -guint8* g_byte_array_free (GByteArray *array, - gboolean free_segment); -GByteArray* g_byte_array_append (GByteArray *array, - const guint8 *data, - guint len); -GByteArray* g_byte_array_prepend (GByteArray *array, - const guint8 *data, - guint len); -GByteArray* g_byte_array_set_size (GByteArray *array, - guint length); -GByteArray* g_byte_array_remove_index (GByteArray *array, - guint index_); -GByteArray* g_byte_array_remove_index_fast (GByteArray *array, - guint index_); -GByteArray* g_byte_array_remove_range (GByteArray *array, - guint index_, - guint length); -/* -void g_byte_array_sort (GByteArray *array, - GCompareFunc compare_func); -void g_byte_array_sort_with_data (GByteArray *array, - GCompareDataFunc compare_func, - gpointer user_data); -*/ - - -/*G_END_DECLS*/ - -#endif /* __G_ARRAY_H__ */ - diff --git a/mui/gtk-mui/glib/gfileutils.c b/mui/gtk-mui/glib/gfileutils.c deleted file mode 100644 index 735c5cbad..000000000 --- a/mui/gtk-mui/glib/gfileutils.c +++ /dev/null @@ -1,1490 +0,0 @@ -/* gfileutils.c - File utility functions - * - * Copyright 2000 Red Hat, Inc. - * - * GLib is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * GLib is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GLib; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#include - -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef G_OS_WIN32 -#include -#include -#endif /* G_OS_WIN32 */ - -#ifndef S_ISLNK -#define S_ISLNK(x) 0 -#endif - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -/* -#include "gstdio.h" -#include "glibintl.h" - -#include "galias.h" -*/ - -/** - * g_file_test: - * @filename: a filename to test in the GLib file name encoding - * @test: bitfield of #GFileTest flags - * - * Returns %TRUE if any of the tests in the bitfield @test are - * %TRUE. For example, (G_FILE_TEST_EXISTS | - * G_FILE_TEST_IS_DIR) will return %TRUE if the file exists; - * the check whether it's a directory doesn't matter since the existence - * test is %TRUE. With the current set of available tests, there's no point - * passing in more than one test at a time. - * - * Apart from %G_FILE_TEST_IS_SYMLINK all tests follow symbolic links, - * so for a symbolic link to a regular file g_file_test() will return - * %TRUE for both %G_FILE_TEST_IS_SYMLINK and %G_FILE_TEST_IS_REGULAR. - * - * Note, that for a dangling symbolic link g_file_test() will return - * %TRUE for %G_FILE_TEST_IS_SYMLINK and %FALSE for all other flags. - * - * You should never use g_file_test() to test whether it is safe - * to perform an operation, because there is always the possibility - * of the condition changing before you actually perform the operation. - * For example, you might think you could use %G_FILE_TEST_IS_SYMLINK - * to know whether it is is safe to write to a file without being - * tricked into writing into a different location. It doesn't work! - * - * - * /* DON'T DO THIS */ - * if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK)) { - * fd = g_open (filename, O_WRONLY); - * /* write to fd */ - * } - * - * - * Another thing to note is that %G_FILE_TEST_EXISTS and - * %G_FILE_TEST_IS_EXECUTABLE are implemented using the access() - * system call. This usually doesn't matter, but if your program - * is setuid or setgid it means that these tests will give you - * the answer for the real user ID and group ID, rather than the - * effective user ID and group ID. - * - * On Windows, there are no symlinks, so testing for - * %G_FILE_TEST_IS_SYMLINK will always return %FALSE. Testing for - * %G_FILE_TEST_IS_EXECUTABLE will just check that the file exists and - * its name indicates that it is executable, checking for well-known - * extensions and those listed in the %PATHEXT environment variable. - * - * Return value: whether a test was %TRUE - **/ - /* -gboolean -g_file_test (const gchar *filename, - GFileTest test) -{ -#ifdef G_OS_WIN32 -# ifndef INVALID_FILE_ATTRIBUTES -# define INVALID_FILE_ATTRIBUTES -1 -# endif -# ifndef FILE_ATTRIBUTE_DEVICE -# define FILE_ATTRIBUTE_DEVICE 64 -# endif - int attributes; - - if (G_WIN32_HAVE_WIDECHAR_API ()) - { - wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL); - - if (wfilename == NULL) - return FALSE; - - attributes = GetFileAttributesW (wfilename); - - g_free (wfilename); - } - else - { - gchar *cpfilename = g_locale_from_utf8 (filename, -1, NULL, NULL, NULL); - - if (cpfilename == NULL) - return FALSE; - - attributes = GetFileAttributesA (cpfilename); - - g_free (cpfilename); - } - - if (attributes == INVALID_FILE_ATTRIBUTES) - return FALSE; - - if (test & G_FILE_TEST_EXISTS) - return TRUE; - - if (test & G_FILE_TEST_IS_REGULAR) - return (attributes & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE)) == 0; - - if (test & G_FILE_TEST_IS_DIR) - return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; - - if (test & G_FILE_TEST_IS_EXECUTABLE) - { - const gchar *lastdot = strrchr (filename, '.'); - const gchar *pathext = NULL, *p; - int extlen; - - if (lastdot == NULL) - return FALSE; - - if (stricmp (lastdot, ".exe") == 0 || - stricmp (lastdot, ".cmd") == 0 || - stricmp (lastdot, ".bat") == 0 || - stricmp (lastdot, ".com") == 0) - return TRUE; - - - pathext = g_getenv ("PATHEXT"); - if (pathext == NULL) - return FALSE; - - pathext = g_utf8_casefold (pathext, -1); - - lastdot = g_utf8_casefold (lastdot, -1); - extlen = strlen (lastdot); - - p = pathext; - while (TRUE) - { - const gchar *q = strchr (p, ';'); - if (q == NULL) - q = p + strlen (p); - if (extlen == q - p && - memcmp (lastdot, p, extlen) == 0) - { - g_free ((gchar *) pathext); - g_free ((gchar *) lastdot); - return TRUE; - } - if (*q) - p = q + 1; - else - break; - } - - g_free ((gchar *) pathext); - g_free ((gchar *) lastdot); - return FALSE; - } - - return FALSE; -#else - if ((test & G_FILE_TEST_EXISTS) && (access (filename, F_OK) == 0)) - return TRUE; - - if ((test & G_FILE_TEST_IS_EXECUTABLE) && (access (filename, X_OK) == 0)) - { - if (getuid () != 0) - return TRUE; - - * For root, on some POSIX systems, access (filename, X_OK) - * will succeed even if no executable bits are set on the - * file. We fall through to a stat test to avoid that. - * - } - else - test &= ~G_FILE_TEST_IS_EXECUTABLE; - - if (test & G_FILE_TEST_IS_SYMLINK) - { - struct stat s; - - if ((lstat (filename, &s) == 0) && S_ISLNK (s.st_mode)) - return TRUE; - } - - if (test & (G_FILE_TEST_IS_REGULAR | - G_FILE_TEST_IS_DIR | - G_FILE_TEST_IS_EXECUTABLE)) - { - struct stat s; - - if (stat (filename, &s) == 0) - { - if ((test & G_FILE_TEST_IS_REGULAR) && S_ISREG (s.st_mode)) - return TRUE; - - if ((test & G_FILE_TEST_IS_DIR) && S_ISDIR (s.st_mode)) - return TRUE; - - * The extra test for root when access (file, X_OK) succeeds. - * - if ((test & G_FILE_TEST_IS_EXECUTABLE) && - ((s.st_mode & S_IXOTH) || - (s.st_mode & S_IXUSR) || - (s.st_mode & S_IXGRP))) - return TRUE; - } - } - - return FALSE; -#endif -} - -*/ -#ifdef G_OS_WIN32 - -#undef g_file_test - -/* Binary compatibility version. Not for newly compiled code. */ - -gboolean -g_file_test (const gchar *filename, - GFileTest test) -{ - gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL); - gboolean retval; - - if (utf8_filename == NULL) - return FALSE; - - retval = g_file_test_utf8 (utf8_filename, test); - - g_free (utf8_filename); - - return retval; -} - -#endif - -/* -GQuark -g_file_error_quark (void) -{ - static GQuark q = 0; - if (q == 0) - q = g_quark_from_static_string ("g-file-error-quark"); - - return q; -} -*/ - -/** - * g_file_error_from_errno: - * @err_no: an "errno" value - * - * Gets a #GFileError constant based on the passed-in @errno. - * For example, if you pass in %EEXIST this function returns - * #G_FILE_ERROR_EXIST. Unlike @errno values, you can portably - * assume that all #GFileError values will exist. - * - * Normally a #GFileError value goes into a #GError returned - * from a function that manipulates files. So you would use - * g_file_error_from_errno() when constructing a #GError. - * - * Return value: #GFileError corresponding to the given @errno - **/ - /* -GFileError -g_file_error_from_errno (gint err_no) -{ - switch (err_no) - { -#ifdef EEXIST - case EEXIST: - return G_FILE_ERROR_EXIST; - break; -#endif - -#ifdef EISDIR - case EISDIR: - return G_FILE_ERROR_ISDIR; - break; -#endif - -#ifdef EACCES - case EACCES: - return G_FILE_ERROR_ACCES; - break; -#endif - -#ifdef ENAMETOOLONG - case ENAMETOOLONG: - return G_FILE_ERROR_NAMETOOLONG; - break; -#endif - -#ifdef ENOENT - case ENOENT: - return G_FILE_ERROR_NOENT; - break; -#endif - -#ifdef ENOTDIR - case ENOTDIR: - return G_FILE_ERROR_NOTDIR; - break; -#endif - -#ifdef ENXIO - case ENXIO: - return G_FILE_ERROR_NXIO; - break; -#endif - -#ifdef ENODEV - case ENODEV: - return G_FILE_ERROR_NODEV; - break; -#endif - -#ifdef EROFS - case EROFS: - return G_FILE_ERROR_ROFS; - break; -#endif - -#ifdef ETXTBSY - case ETXTBSY: - return G_FILE_ERROR_TXTBSY; - break; -#endif - -#ifdef EFAULT - case EFAULT: - return G_FILE_ERROR_FAULT; - break; -#endif - -#ifdef ELOOP - case ELOOP: - return G_FILE_ERROR_LOOP; - break; -#endif - -#ifdef ENOSPC - case ENOSPC: - return G_FILE_ERROR_NOSPC; - break; -#endif - -#ifdef ENOMEM - case ENOMEM: - return G_FILE_ERROR_NOMEM; - break; -#endif - -#ifdef EMFILE - case EMFILE: - return G_FILE_ERROR_MFILE; - break; -#endif - -#ifdef ENFILE - case ENFILE: - return G_FILE_ERROR_NFILE; - break; -#endif - -#ifdef EBADF - case EBADF: - return G_FILE_ERROR_BADF; - break; -#endif - -#ifdef EINVAL - case EINVAL: - return G_FILE_ERROR_INVAL; - break; -#endif - -#ifdef EPIPE - case EPIPE: - return G_FILE_ERROR_PIPE; - break; -#endif - -#ifdef EAGAIN - case EAGAIN: - return G_FILE_ERROR_AGAIN; - break; -#endif - -#ifdef EINTR - case EINTR: - return G_FILE_ERROR_INTR; - break; -#endif - -#ifdef EIO - case EIO: - return G_FILE_ERROR_IO; - break; -#endif - -#ifdef EPERM - case EPERM: - return G_FILE_ERROR_PERM; - break; -#endif - -#ifdef ENOSYS - case ENOSYS: - return G_FILE_ERROR_NOSYS; - break; -#endif - - default: - return G_FILE_ERROR_FAILED; - break; - } -} - -*/ - -/* -static gboolean -get_contents_stdio (const gchar *display_filename, - FILE *f, - gchar **contents, - gsize *length, - GError **error) -{ - gchar buf[2048]; - size_t bytes; - char *str; - size_t total_bytes; - size_t total_allocated; - - g_assert (f != NULL); - -#define STARTING_ALLOC 64 - - total_bytes = 0; - total_allocated = STARTING_ALLOC; - str = g_malloc (STARTING_ALLOC); - - while (!feof (f)) - { - int save_errno; - - bytes = fread (buf, 1, 2048, f); - save_errno = errno; - - while ((total_bytes + bytes + 1) > total_allocated) - { - total_allocated *= 2; - str = g_try_realloc (str, total_allocated); - - if (str == NULL) - { - g_set_error (error, - G_FILE_ERROR, - G_FILE_ERROR_NOMEM, - _("Could not allocate %lu bytes to read file \"%s\""), - (gulong) total_allocated, - display_filename); - - goto error; - } - } - - if (ferror (f)) - { - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Error reading file '%s': %s"), - display_filename, - g_strerror (save_errno)); - - goto error; - } - - memcpy (str + total_bytes, buf, bytes); - total_bytes += bytes; - } - - fclose (f); - - str[total_bytes] = '\0'; - - if (length) - *length = total_bytes; - - *contents = str; - - return TRUE; - - error: - - g_free (str); - fclose (f); - - return FALSE; -} -*/ - -#ifdef NEVER - -#ifndef G_OS_WIN32 - -static gboolean -get_contents_regfile (const gchar *display_filename, - struct stat *stat_buf, - gint fd, - gchar **contents, - gsize *length, - GError **error) -{ - gchar *buf; - size_t bytes_read; - size_t size; - size_t alloc_size; - - size = stat_buf->st_size; - - alloc_size = size + 1; - buf = g_try_malloc (alloc_size); - - if (buf == NULL) - { - g_set_error (error, - G_FILE_ERROR, - G_FILE_ERROR_NOMEM, - _("Could not allocate %lu bytes to read file \"%s\""), - (gulong) alloc_size, - display_filename); - - goto error; - } - - bytes_read = 0; - while (bytes_read < size) - { - gssize rc; - - rc = read (fd, buf + bytes_read, size - bytes_read); - - if (rc < 0) - { - if (errno != EINTR) - { - int save_errno = errno; - - g_free (buf); - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Failed to read from file '%s': %s"), - display_filename, - g_strerror (save_errno)); - - goto error; - } - } - else if (rc == 0) - break; - else - bytes_read += rc; - } - - buf[bytes_read] = '\0'; - - if (length) - *length = bytes_read; - - *contents = buf; - - close (fd); - - return TRUE; - - error: - - close (fd); - - return FALSE; -} - -static gboolean -get_contents_posix (const gchar *filename, - gchar **contents, - gsize *length, - GError **error) -{ - struct stat stat_buf; - gint fd; - gchar *display_filename = g_filename_display_name (filename); - - /* O_BINARY useful on Cygwin */ - fd = open (filename, O_RDONLY|O_BINARY); - - if (fd < 0) - { - int save_errno = errno; - - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Failed to open file '%s': %s"), - display_filename, - g_strerror (save_errno)); - g_free (display_filename); - - return FALSE; - } - - /* I don't think this will ever fail, aside from ENOMEM, but. */ - if (fstat (fd, &stat_buf) < 0) - { - int save_errno = errno; - - close (fd); - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Failed to get attributes of file '%s': fstat() failed: %s"), - display_filename, - g_strerror (save_errno)); - g_free (display_filename); - - return FALSE; - } - - if (stat_buf.st_size > 0 && S_ISREG (stat_buf.st_mode)) - { - gboolean retval = get_contents_regfile (display_filename, - &stat_buf, - fd, - contents, - length, - error); - g_free (display_filename); - - return retval; - } - else - { - FILE *f; - gboolean retval; - - f = fdopen (fd, "r"); - - if (f == NULL) - { - int save_errno = errno; - - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Failed to open file '%s': fdopen() failed: %s"), - display_filename, - g_strerror (save_errno)); - g_free (display_filename); - - return FALSE; - } - - retval = get_contents_stdio (display_filename, f, contents, length, error); - g_free (display_filename); - - return retval; - } -} - -#else /* G_OS_WIN32 */ - -static gboolean -get_contents_win32 (const gchar *filename, - gchar **contents, - gsize *length, - GError **error) -{ - FILE *f; - gboolean retval; - gchar *display_filename = g_filename_display_name (filename); - int save_errno; - - f = g_fopen (filename, "rb"); - save_errno = errno; - - if (f == NULL) - { - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Failed to open file '%s': %s"), - display_filename, - g_strerror (save_errno)); - g_free (display_filename); - - return FALSE; - } - - retval = get_contents_stdio (display_filename, f, contents, length, error); - g_free (display_filename); - - return retval; -} - - -#endif -#endif -/** - * g_file_get_contents: - * @filename: name of a file to read contents from, in the GLib file name encoding - * @contents: location to store an allocated string - * @length: location to store length in bytes of the contents, or %NULL - * @error: return location for a #GError, or %NULL - * - * Reads an entire file into allocated memory, with good error - * checking. - * - * If the call was successful, it returns %TRUE and sets @contents to the file - * contents and @length to the length of the file contents in bytes. The string - * stored in @contents will be nul-terminated, so for text files you can pass - * %NULL for the @length argument. If the call was not successful, it returns - * %FALSE and sets @error. The error domain is #G_FILE_ERROR. Possible error - * codes are those in the #GFileError enumeration. In the error case, - * @contents is set to %NULL and @length is set to zero. - * - * Return value: %TRUE on success, %FALSE if an error occurred - **/ -#ifdef NEVER -gboolean -g_file_get_contents (const gchar *filename, - gchar **contents, - gsize *length, - GError **error) -{ - g_return_val_if_fail (filename != NULL, FALSE); - g_return_val_if_fail (contents != NULL, FALSE); - - *contents = NULL; - if (length) - *length = 0; - -#ifdef G_OS_WIN32 - return get_contents_win32 (filename, contents, length, error); -#else - return get_contents_posix (filename, contents, length, error); -#endif -} - -#ifdef G_OS_WIN32 - -#undef g_file_get_contents - -/* Binary compatibility version. Not for newly compiled code. */ - -gboolean -g_file_get_contents (const gchar *filename, - gchar **contents, - gsize *length, - GError **error) -{ - gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); - gboolean retval; - - if (utf8_filename == NULL) - return FALSE; - - retval = g_file_get_contents_utf8 (utf8_filename, contents, length, error); - - g_free (utf8_filename); - - return retval; -} - -#endif - -#endif -/* - * mkstemp() implementation is from the GNU C library. - * Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc. - */ -/** - * g_mkstemp: - * @tmpl: template filename - * - * Opens a temporary file. See the mkstemp() documentation - * on most UNIX-like systems. This is a portability wrapper, which simply calls - * mkstemp() on systems that have it, and implements - * it in GLib otherwise. - * - * The parameter is a string that should match the rules for - * mkstemp(), i.e. end in "XXXXXX". The X string will - * be modified to form the name of a file that didn't exist. - * The string should be in the GLib file name encoding. Most importantly, - * on Windows it should be in UTF-8. - * - * Return value: A file handle (as from open()) to the file - * opened for reading and writing. The file is opened in binary mode - * on platforms where there is a difference. The file handle should be - * closed with close(). In case of errors, -1 is returned. - */ -gint -g_mkstemp (gchar *tmpl) -{ -#ifdef HAVE_MKSTEMP - return mkstemp (tmpl); -#else - int len; - char *XXXXXX; - int count, fd; - static const char letters[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - static const int NLETTERS = sizeof (letters) - 1; - glong value; - GTimeVal tv; - static int counter = 0; - - len = strlen (tmpl); - if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) - { - errno = EINVAL; - return -1; - } - - /* This is where the Xs start. */ - XXXXXX = &tmpl[len - 6]; - - /* Get some more or less random data. */ - g_get_current_time (&tv); - value = (tv.tv_usec ^ tv.tv_sec) + counter++; - - for (count = 0; count < 100; value += 7777, ++count) - { - glong v = value; - - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[1] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[2] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[3] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[4] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[5] = letters[v % NLETTERS]; - - /* tmpl is in UTF-8 on Windows, thus use g_open() */ - fd = g_open (tmpl, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); - - if (fd >= 0) - return fd; - else if (errno != EEXIST) - /* Any other error will apply also to other names we might - * try, and there are 2^32 or so of them, so give up now. - */ - return -1; - } - - /* We got out of the loop because we ran out of combinations to try. */ - errno = EEXIST; - return -1; -#endif -} - -#ifdef G_OS_WIN32 - -#undef g_mkstemp - -/* Binary compatibility version. Not for newly compiled code. */ - -gint -g_mkstemp (gchar *tmpl) -{ - int len; - char *XXXXXX; - int count, fd; - static const char letters[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - static const int NLETTERS = sizeof (letters) - 1; - glong value; - GTimeVal tv; - static int counter = 0; - - len = strlen (tmpl); - if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) - { - errno = EINVAL; - return -1; - } - - /* This is where the Xs start. */ - XXXXXX = &tmpl[len - 6]; - - /* Get some more or less random data. */ - g_get_current_time (&tv); - value = (tv.tv_usec ^ tv.tv_sec) + counter++; - - for (count = 0; count < 100; value += 7777, ++count) - { - glong v = value; - - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[1] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[2] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[3] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[4] = letters[v % NLETTERS]; - v /= NLETTERS; - XXXXXX[5] = letters[v % NLETTERS]; - - /* This is the backward compatibility system codepage version, - * thus use normal open(). - */ - fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); - - if (fd >= 0) - return fd; - else if (errno != EEXIST) - /* Any other error will apply also to other names we might - * try, and there are 2^32 or so of them, so give up now. - */ - return -1; - } - - /* We got out of the loop because we ran out of combinations to try. */ - errno = EEXIST; - return -1; -} - -#endif - -/** - * g_file_open_tmp: - * @tmpl: Template for file name, as in g_mkstemp(), basename only - * @name_used: location to store actual name used - * @error: return location for a #GError - * - * Opens a file for writing in the preferred directory for temporary - * files (as returned by g_get_tmp_dir()). - * - * @tmpl should be a string in the GLib file name encoding ending with - * six 'X' characters, as the parameter to g_mkstemp() (or mkstemp()). - * However, unlike these functions, the template should only be a - * basename, no directory components are allowed. If template is - * %NULL, a default template is used. - * - * Note that in contrast to g_mkstemp() (and mkstemp()) - * @tmpl is not modified, and might thus be a read-only literal string. - * - * The actual name used is returned in @name_used if non-%NULL. This - * string should be freed with g_free() when not needed any longer. - * The returned name is in the GLib file name encoding. - * - * Return value: A file handle (as from open()) to - * the file opened for reading and writing. The file is opened in binary - * mode on platforms where there is a difference. The file handle should be - * closed with close(). In case of errors, -1 is returned - * and @error will be set. - **/ -gint -g_file_open_tmp (const gchar *tmpl, - gchar **name_used, - GError **error) -{ - int retval; - const char *tmpdir; - char *sep; - char *fulltemplate; - const char *slash; - - if (tmpl == NULL) - tmpl = ".XXXXXX"; - - if ((slash = strchr (tmpl, G_DIR_SEPARATOR)) != NULL -#ifdef G_OS_WIN32 - || (strchr (tmpl, '/') != NULL && (slash = "/")) -#endif - ) - { - gchar *display_tmpl = g_filename_display_name (tmpl); - char c[2]; - c[0] = *slash; - c[1] = '\0'; - - g_set_error (error, - G_FILE_ERROR, - G_FILE_ERROR_FAILED, - _("Template '%s' invalid, should not contain a '%s'"), - display_tmpl, c); - g_free (display_tmpl); - - return -1; - } - - if (strlen (tmpl) < 6 || - strcmp (tmpl + strlen (tmpl) - 6, "XXXXXX") != 0) - { - gchar *display_tmpl = g_filename_display_name (tmpl); - g_set_error (error, - G_FILE_ERROR, - G_FILE_ERROR_FAILED, - _("Template '%s' doesn't end with XXXXXX"), - display_tmpl); - g_free (display_tmpl); - return -1; - } - - tmpdir = g_get_tmp_dir (); - - if (G_IS_DIR_SEPARATOR (tmpdir [strlen (tmpdir) - 1])) - sep = ""; - else - sep = G_DIR_SEPARATOR_S; - - fulltemplate = g_strconcat (tmpdir, sep, tmpl, NULL); - - retval = g_mkstemp (fulltemplate); - - if (retval == -1) - { - int save_errno = errno; - gchar *display_fulltemplate = g_filename_display_name (fulltemplate); - - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Failed to create file '%s': %s"), - display_fulltemplate, g_strerror (save_errno)); - g_free (display_fulltemplate); - g_free (fulltemplate); - return -1; - } - - if (name_used) - *name_used = fulltemplate; - else - g_free (fulltemplate); - - return retval; -} - -#ifdef G_OS_WIN32 - -#undef g_file_open_tmp - -/* Binary compatibility version. Not for newly compiled code. */ - -gint -g_file_open_tmp (const gchar *tmpl, - gchar **name_used, - GError **error) -{ - gchar *utf8_tmpl = g_locale_to_utf8 (tmpl, -1, NULL, NULL, error); - gchar *utf8_name_used; - gint retval; - - if (utf8_tmpl == NULL) - return -1; - - retval = g_file_open_tmp_utf8 (utf8_tmpl, &utf8_name_used, error); - - if (retval == -1) - return -1; - - if (name_used) - *name_used = g_locale_from_utf8 (utf8_name_used, -1, NULL, NULL, NULL); - - g_free (utf8_name_used); - - return retval; -} - -#endif - -static gchar * -g_build_pathv (const gchar *separator, - const gchar *first_element, - va_list args) -{ - GString *result; - gint separator_len = strlen (separator); - gboolean is_first = TRUE; - gboolean have_leading = FALSE; - const gchar *single_element = NULL; - const gchar *next_element; - const gchar *last_trailing = NULL; - - result = g_string_new (NULL); - - next_element = first_element; - - while (TRUE) - { - const gchar *element; - const gchar *start; - const gchar *end; - - if (next_element) - { - element = next_element; - next_element = va_arg (args, gchar *); - } - else - break; - - /* Ignore empty elements */ - if (!*element) - continue; - - start = element; - - if (separator_len) - { - while (start && - strncmp (start, separator, separator_len) == 0) - start += separator_len; - } - - end = start + strlen (start); - - if (separator_len) - { - while (end >= start + separator_len && - strncmp (end - separator_len, separator, separator_len) == 0) - end -= separator_len; - - last_trailing = end; - while (last_trailing >= element + separator_len && - strncmp (last_trailing - separator_len, separator, separator_len) == 0) - last_trailing -= separator_len; - - if (!have_leading) - { - /* If the leading and trailing separator strings are in the - * same element and overlap, the result is exactly that element - */ - if (last_trailing <= start) - single_element = element; - - g_string_append_len (result, element, start - element); - have_leading = TRUE; - } - else - single_element = NULL; - } - - if (end == start) - continue; - - if (!is_first) - g_string_append (result, separator); - - g_string_append_len (result, start, end - start); - is_first = FALSE; - } - - if (single_element) - { - g_string_free (result, TRUE); - return g_strdup (single_element); - } - else - { - if (last_trailing) - g_string_append (result, last_trailing); - - return g_string_free (result, FALSE); - } -} - -/** - * g_build_path: - * @separator: a string used to separator the elements of the path. - * @first_element: the first element in the path - * @Varargs: remaining elements in path, terminated by %NULL - * - * Creates a path from a series of elements using @separator as the - * separator between elements. At the boundary between two elements, - * any trailing occurrences of separator in the first element, or - * leading occurrences of separator in the second element are removed - * and exactly one copy of the separator is inserted. - * - * Empty elements are ignored. - * - * The number of leading copies of the separator on the result is - * the same as the number of leading copies of the separator on - * the first non-empty element. - * - * The number of trailing copies of the separator on the result is - * the same as the number of trailing copies of the separator on - * the last non-empty element. (Determination of the number of - * trailing copies is done without stripping leading copies, so - * if the separator is ABA, ABABA - * has 1 trailing copy.) - * - * However, if there is only a single non-empty element, and there - * are no characters in that element not part of the leading or - * trailing separators, then the result is exactly the original value - * of that element. - * - * Other than for determination of the number of leading and trailing - * copies of the separator, elements consisting only of copies - * of the separator are ignored. - * - * Return value: a newly-allocated string that must be freed with g_free(). - **/ -gchar * -g_build_path (const gchar *separator, - const gchar *first_element, - ...) -{ - gchar *str; - va_list args; - - g_return_val_if_fail (separator != NULL, NULL); - - va_start (args, first_element); - str = g_build_pathv (separator, first_element, args); - va_end (args); - - return str; -} - -/** - * g_build_filename: - * @first_element: the first element in the path - * @Varargs: remaining elements in path, terminated by %NULL - * - * Creates a filename from a series of elements using the correct - * separator for filenames. - * - * On Unix, this function behaves identically to g_build_path - * (G_DIR_SEPARATOR_S, first_element, ....). - * - * On Windows, it takes into account that either the backslash - * (\ or slash (/) can be used - * as separator in filenames, but otherwise behaves as on Unix. When - * file pathname separators need to be inserted, the one that last - * previously occurred in the parameters (reading from left to right) - * is used. - * - * No attempt is made to force the resulting filename to be an absolute - * path. If the first element is a relative path, the result will - * be a relative path. - * - * Return value: a newly-allocated string that must be freed with g_free(). - **/ -gchar * -g_build_filename (const gchar *first_element, - ...) -{ -#ifndef G_OS_WIN32 - gchar *str; - va_list args; - - va_start (args, first_element); - str = g_build_pathv (G_DIR_SEPARATOR_S, first_element, args); - va_end (args); - - return str; -#else - /* Code copied from g_build_pathv(), and modifed to use two - * alternative single-character separators. - */ - va_list args; - GString *result; - gboolean is_first = TRUE; - gboolean have_leading = FALSE; - const gchar *single_element = NULL; - const gchar *next_element; - const gchar *last_trailing = NULL; - gchar current_separator = '\\'; - - va_start (args, first_element); - - result = g_string_new (NULL); - - next_element = first_element; - - while (TRUE) - { - const gchar *element; - const gchar *start; - const gchar *end; - - if (next_element) - { - element = next_element; - next_element = va_arg (args, gchar *); - } - else - break; - - /* Ignore empty elements */ - if (!*element) - continue; - - start = element; - - if (TRUE) - { - while (start && - (*start == '\\' || *start == '/')) - { - current_separator = *start; - start++; - } - } - - end = start + strlen (start); - - if (TRUE) - { - while (end >= start + 1 && - (end[-1] == '\\' || end[-1] == '/')) - { - current_separator = end[-1]; - end--; - } - - last_trailing = end; - while (last_trailing >= element + 1 && - (last_trailing[-1] == '\\' || last_trailing[-1] == '/')) - last_trailing--; - - if (!have_leading) - { - /* If the leading and trailing separator strings are in the - * same element and overlap, the result is exactly that element - */ - if (last_trailing <= start) - single_element = element; - - g_string_append_len (result, element, start - element); - have_leading = TRUE; - } - else - single_element = NULL; - } - - if (end == start) - continue; - - if (!is_first) - g_string_append_len (result, ¤t_separator, 1); - - g_string_append_len (result, start, end - start); - is_first = FALSE; - } - - va_end (args); - - if (single_element) - { - g_string_free (result, TRUE); - return g_strdup (single_element); - } - else - { - if (last_trailing) - g_string_append (result, last_trailing); - - return g_string_free (result, FALSE); - } -#endif -} - -/** - * g_file_read_link: - * @filename: the symbolic link - * @error: return location for a #GError - * - * Reads the contents of the symbolic link @filename like the POSIX - * readlink() function. The returned string is in the encoding used - * for filenames. Use g_filename_to_utf8() to convert it to UTF-8. - * - * Returns: A newly allocated string with the contents of the symbolic link, - * or %NULL if an error occurred. - * - * Since: 2.4 - */ -gchar * -g_file_read_link (const gchar *filename, - GError **error) -{ -#ifdef HAVE_READLINK - gchar *buffer; - guint size; - gint read_size; - - size = 256; - buffer = g_malloc (size); - - while (TRUE) - { - read_size = readlink (filename, buffer, size); - if (read_size < 0) { - int save_errno = errno; - gchar *display_filename = g_filename_display_name (filename); - - g_free (buffer); - g_set_error (error, - G_FILE_ERROR, - g_file_error_from_errno (save_errno), - _("Failed to read the symbolic link '%s': %s"), - display_filename, - g_strerror (save_errno)); - g_free (display_filename); - - return NULL; - } - - if (read_size < size) - { - buffer[read_size] = 0; - return buffer; - } - - size *= 2; - buffer = g_realloc (buffer, size); - } -#else - g_set_error (error, - G_FILE_ERROR, - G_FILE_ERROR_INVAL, - _("Symbolic links not supported")); - - return NULL; -#endif -} - -#define __G_FILEUTILS_C__ -#include "galiasdef.c" diff --git a/mui/gtk-mui/glib/gfileutils.h b/mui/gtk-mui/glib/gfileutils.h deleted file mode 100644 index cc3b4941a..000000000 --- a/mui/gtk-mui/glib/gfileutils.h +++ /dev/null @@ -1,108 +0,0 @@ -/* gfileutils.h - File utility functions - * - * Copyright 2000 Red Hat, Inc. - * - * GLib is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * GLib is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GLib; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __G_FILEUTILS_H__ -#define __G_FILEUTILS_H__ - -#include - -G_BEGIN_DECLS - -#define G_FILE_ERROR g_file_error_quark () - -typedef enum -{ - G_FILE_ERROR_EXIST, - G_FILE_ERROR_ISDIR, - G_FILE_ERROR_ACCES, - G_FILE_ERROR_NAMETOOLONG, - G_FILE_ERROR_NOENT, - G_FILE_ERROR_NOTDIR, - G_FILE_ERROR_NXIO, - G_FILE_ERROR_NODEV, - G_FILE_ERROR_ROFS, - G_FILE_ERROR_TXTBSY, - G_FILE_ERROR_FAULT, - G_FILE_ERROR_LOOP, - G_FILE_ERROR_NOSPC, - G_FILE_ERROR_NOMEM, - G_FILE_ERROR_MFILE, - G_FILE_ERROR_NFILE, - G_FILE_ERROR_BADF, - G_FILE_ERROR_INVAL, - G_FILE_ERROR_PIPE, - G_FILE_ERROR_AGAIN, - G_FILE_ERROR_INTR, - G_FILE_ERROR_IO, - G_FILE_ERROR_PERM, - G_FILE_ERROR_NOSYS, - G_FILE_ERROR_FAILED -} GFileError; - -/* For backward-compat reasons, these are synced to an old - * anonymous enum in libgnome. But don't use that enum - * in new code. - */ -typedef enum -{ - G_FILE_TEST_IS_REGULAR = 1 << 0, - G_FILE_TEST_IS_SYMLINK = 1 << 1, - G_FILE_TEST_IS_DIR = 1 << 2, - G_FILE_TEST_IS_EXECUTABLE = 1 << 3, - G_FILE_TEST_EXISTS = 1 << 4 -} GFileTest; - -GQuark g_file_error_quark (void); -/* So other code can generate a GFileError */ -GFileError g_file_error_from_errno (gint err_no); - -#ifdef G_OS_WIN32 -#define g_file_test g_file_test_utf8 -#define g_file_get_contents g_file_get_contents_utf8 -#define g_mkstemp g_mkstemp_utf8 -#define g_file_open_tmp g_file_open_tmp_utf8 -#endif - -gboolean g_file_test (const gchar *filename, - GFileTest test); -gboolean g_file_get_contents (const gchar *filename, - gchar **contents, - gsize *length, - GError **error); -gchar *g_file_read_link (const gchar *filename, - GError **error); - -/* Wrapper / workalike for mkstemp() */ -gint g_mkstemp (gchar *tmpl); - -/* Wrapper for g_mkstemp */ -gint g_file_open_tmp (const gchar *tmpl, - gchar **name_used, - GError **error); - -gchar *g_build_path (const gchar *separator, - const gchar *first_element, - ...); -gchar *g_build_filename (const gchar *first_element, - ...); - -G_END_DECLS - -#endif /* __G_FILEUTILS_H__ */ diff --git a/mui/gtk-mui/glib/gmacros.h b/mui/gtk-mui/glib/gmacros.h deleted file mode 100644 index 945905e96..000000000 --- a/mui/gtk-mui/glib/gmacros.h +++ /dev/null @@ -1,46 +0,0 @@ -/* GLIB - Library of useful routines for C programming - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GLib Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GLib Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* This file must not include any other glib header file and must thus - * not refer to variables from glibconfig.h - */ - -#ifndef __G_MACROS_H__ -#define __G_MACROS_H__ - -#undef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) - -#undef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - -#undef ABS -#define ABS(a) (((a) < 0) ? -(a) : (a)) - -#undef CLAMP -#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) - -#endif /* __G_MACROS_H__ */ diff --git a/mui/gtk-mui/glib/gmem.h b/mui/gtk-mui/glib/gmem.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/mui/gtk-mui/glib/gobject/gobject.h b/mui/gtk-mui/glib/gobject/gobject.h deleted file mode 100644 index 97ca4d4f8..000000000 --- a/mui/gtk-mui/glib/gobject/gobject.h +++ /dev/null @@ -1,127 +0,0 @@ -/* GObject - GLib Type, Object, Parameter and Signal Library - * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __G_OBJECT_H__ -#define __G_OBJECT_H__ - -#include -#include - -//typedef struct _GTypeClass GTypeClass; -typedef struct _GObjectConstructParam GObjectConstructParam; -typedef struct _GObjectClass GObjectClass; - -//struct _GTypeClass -//{ - /*< private >*/ -// GType g_type; -//}; - -/* --- typedefs & structures --- */ -typedef struct _GParamSpec GParamSpec; -typedef struct _GParamSpecClass GParamSpecClass; -typedef struct _GParameter GParameter; -typedef struct _GParamSpecPool GParamSpecPool; - -/* dummy */ -//typedef unsigned int GTypeInstance ; - -struct _GParamSpec -{ - GTypeInstance g_type_instance; - - gchar *name; -// GParamFlags flags; - GType value_type; - GType owner_type; /* class or interface using this property */ - - /*< private >*/ - gchar *_nick; - gchar *_blurb; -// GData *qdata; - guint ref_count; - guint param_id; /* sort-criteria */ -}; - -struct _GParamSpecClass -{ - GTypeClass g_type_class; - - GType value_type; - - void (*finalize) (GParamSpec *pspec); - - /* GParam methods */ - void (*value_set_default) (GParamSpec *pspec, - GValue *value); - gboolean (*value_validate) (GParamSpec *pspec, - GValue *value); - gint (*values_cmp) (GParamSpec *pspec, - const GValue *value1, - const GValue *value2); - /*< private >*/ - gpointer dummy[4]; -}; - -struct _GObjectConstructParam -{ - GParamSpec *pspec; - GValue *value; -}; - - -struct _GObjectClass -{ - GTypeClass g_type_class; - - /*< private >*/ - GSList *construct_properties; - - /*< public >*/ - /* overridable methods */ -#if 0 - GObject* (*constructor) (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties); - void (*set_property) (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); - void (*get_property) (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); - void (*dispose) (GObject *object); - void (*finalize) (GObject *object); - - /* seldomly overidden */ - void (*dispatch_properties_changed) (GObject *object, - guint n_pspecs, - GParamSpec **pspecs); - - /* signals */ - void (*notify) (GObject *object, - GParamSpec *pspec); -#endif - /*< private >*/ - /* padding */ - gpointer pdummy[8]; -}; - -#endif /* __G_OBJECT_H__ */ diff --git a/mui/gtk-mui/glib/gobject/gsignal.h b/mui/gtk-mui/glib/gobject/gsignal.h deleted file mode 100644 index 11eadc420..000000000 --- a/mui/gtk-mui/glib/gobject/gsignal.h +++ /dev/null @@ -1,54 +0,0 @@ -/* GObject - GLib Type, Object, Parameter and Signal Library - * Copyright (C) 2000-2001 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * modified by o1i - */ - -#ifndef __G_SIGNAL_H__ -#define __G_SIGNAL_H__ - -/* --- run, match and connect types --- */ -typedef enum -{ - G_SIGNAL_RUN_FIRST = 1 << 0, - G_SIGNAL_RUN_LAST = 1 << 1, - G_SIGNAL_RUN_CLEANUP = 1 << 2, - G_SIGNAL_NO_RECURSE = 1 << 3, - G_SIGNAL_DETAILED = 1 << 4, - G_SIGNAL_ACTION = 1 << 5, - G_SIGNAL_NO_HOOKS = 1 << 6 -} GSignalFlags; -#define G_SIGNAL_FLAGS_MASK 0x7f -typedef enum -{ - G_CONNECT_AFTER = 1 << 0, - G_CONNECT_SWAPPED = 1 << 1 -} GConnectFlags; -typedef enum -{ - G_SIGNAL_MATCH_ID = 1 << 0, - G_SIGNAL_MATCH_DETAIL = 1 << 1, - G_SIGNAL_MATCH_CLOSURE = 1 << 2, - G_SIGNAL_MATCH_FUNC = 1 << 3, - G_SIGNAL_MATCH_DATA = 1 << 4, - G_SIGNAL_MATCH_UNBLOCKED = 1 << 5 -} GSignalMatchType; -#define G_SIGNAL_MATCH_MASK 0x3f -#define G_SIGNAL_TYPE_STATIC_SCOPE (G_TYPE_FLAG_RESERVED_ID_BIT) - -#endif /* __G_SIGNAL_H__ */ diff --git a/mui/gtk-mui/glib/gobject/gtype.h b/mui/gtk-mui/glib/gobject/gtype.h deleted file mode 100644 index e65d153cf..000000000 --- a/mui/gtk-mui/glib/gobject/gtype.h +++ /dev/null @@ -1,162 +0,0 @@ -/* GObject - GLib Type, Object, Parameter and Signal Library - * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * Modified by o1i - */ - -#ifndef __G_TYPE_H__ -#define __G_TYPE_H__ - -#include - -/* Basic Type Macros - */ -#define G_TYPE_FUNDAMENTAL(type) (g_type_fundamental (type)) -#define G_TYPE_FUNDAMENTAL_MAX (255 << G_TYPE_FUNDAMENTAL_SHIFT) - -/* Constant fundamental types, - * introduced by g_type_init(). - */ -#define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) -#define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1) -#define G_TYPE_INTERFACE G_TYPE_MAKE_FUNDAMENTAL (2) -#define G_TYPE_CHAR G_TYPE_MAKE_FUNDAMENTAL (3) -#define G_TYPE_UCHAR G_TYPE_MAKE_FUNDAMENTAL (4) -#define G_TYPE_BOOLEAN G_TYPE_MAKE_FUNDAMENTAL (5) -#define G_TYPE_INT G_TYPE_MAKE_FUNDAMENTAL (6) -#define G_TYPE_UINT G_TYPE_MAKE_FUNDAMENTAL (7) -#define G_TYPE_LONG G_TYPE_MAKE_FUNDAMENTAL (8) -#define G_TYPE_ULONG G_TYPE_MAKE_FUNDAMENTAL (9) -#define G_TYPE_INT64 G_TYPE_MAKE_FUNDAMENTAL (10) -#define G_TYPE_UINT64 G_TYPE_MAKE_FUNDAMENTAL (11) -#define G_TYPE_ENUM G_TYPE_MAKE_FUNDAMENTAL (12) -#define G_TYPE_FLAGS G_TYPE_MAKE_FUNDAMENTAL (13) -#define G_TYPE_FLOAT G_TYPE_MAKE_FUNDAMENTAL (14) -#define G_TYPE_DOUBLE G_TYPE_MAKE_FUNDAMENTAL (15) -#define G_TYPE_STRING G_TYPE_MAKE_FUNDAMENTAL (16) -#define G_TYPE_POINTER G_TYPE_MAKE_FUNDAMENTAL (17) -#define G_TYPE_BOXED G_TYPE_MAKE_FUNDAMENTAL (18) -#define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19) -#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) - -/* Reserved fundamental type numbers to create new fundamental - * type IDs with G_TYPE_MAKE_FUNDAMENTAL(). - * Send email to gtk-devel-list@redhat.com for reservations. - */ -#define G_TYPE_FUNDAMENTAL_SHIFT (2) -#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) -#define G_TYPE_RESERVED_GLIB_FIRST (21) -#define G_TYPE_RESERVED_GLIB_LAST (31) -#define G_TYPE_RESERVED_BSE_FIRST (32) -#define G_TYPE_RESERVED_BSE_LAST (48) -#define G_TYPE_RESERVED_USER_FIRST (49) - -typedef struct _GTypeInfo GTypeInfo; -typedef struct _GValue GValue; -typedef struct _GTypeValueTable GTypeValueTable; -typedef union _GTypeCValue GTypeCValue; -typedef struct _GTypeClass GTypeClass; -typedef struct _GTypeInstance GTypeInstance; - - -/* already defined in gtk.h -typedef gulong GType; -*/ - -typedef void (*GBaseInitFunc) (gpointer g_class); -typedef void (*GBaseFinalizeFunc) (gpointer g_class); -typedef void (*GClassInitFunc) (gpointer g_class, - gpointer class_data); -typedef void (*GClassFinalizeFunc) (gpointer g_class, - gpointer class_data); -typedef void (*GInstanceInitFunc) (GTypeInstance *instance, - gpointer g_class); -typedef void (*GInterfaceInitFunc) (gpointer g_iface, - gpointer iface_data); -typedef void (*GInterfaceFinalizeFunc) (gpointer g_iface, - gpointer iface_data); -typedef gboolean (*GTypeClassCacheFunc) (gpointer cache_data, - GTypeClass *g_class); -typedef void (*GTypeInterfaceCheckFunc) (gpointer check_data, - gpointer g_iface); - -/* Basic Type Structures - */ -struct _GTypeClass -{ - /*< private >*/ - GType g_type; -}; - -struct _GTypeInstance -{ - /*< private >*/ - GTypeClass *g_class; -}; - -#define G_TYPE_FROM_CLASS(g_class) (((GTypeClass*) (g_class))->g_type) - -struct _GTypeValueTable -{ - void (*value_init) (GValue *value); - void (*value_free) (GValue *value); - void (*value_copy) (const GValue *src_value, - GValue *dest_value); - /* varargs functionality (optional) */ - gpointer (*value_peek_pointer) (const GValue *value); - gchar *collect_format; - gchar* (*collect_value) (GValue *value, - guint n_collect_values, - GTypeCValue *collect_values, - guint collect_flags); - gchar *lcopy_format; - gchar* (*lcopy_value) (const GValue *value, - guint n_collect_values, - GTypeCValue *collect_values, - guint collect_flags); -}; - -typedef enum /*< skip >*/ -{ - G_TYPE_FLAG_ABSTRACT = (1 << 4), - G_TYPE_FLAG_VALUE_ABSTRACT = (1 << 5) -} GTypeFlags; - -struct _GTypeInfo -{ - /* interface types, classed types, instantiated types */ - guint16 class_size; - - GBaseInitFunc base_init; - GBaseFinalizeFunc base_finalize; - - /* interface types, classed types, instantiated types */ - GClassInitFunc class_init; - GClassFinalizeFunc class_finalize; - gconstpointer class_data; - - /* instantiated types */ - guint16 instance_size; - guint16 n_preallocs; - GInstanceInitFunc instance_init; - - /* value handling */ - const GTypeValueTable *value_table; -}; - -#endif /* __G_TYPE_H__ */ diff --git a/mui/gtk-mui/glib/gobject/gvalue.h b/mui/gtk-mui/glib/gobject/gvalue.h deleted file mode 100644 index f677f49d2..000000000 --- a/mui/gtk-mui/glib/gobject/gvalue.h +++ /dev/null @@ -1,50 +0,0 @@ -/* GObject - GLib Type, Object, Parameter and Signal Library - * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * gvalue.h: generic GValue functions - * - * modified by o1i - */ - -#ifndef __G_VALUE_H__ -#define __G_VALUE_H__ - -#include - -/* --- typedefs & structures --- */ -struct _GValue -{ - /*< private >*/ - GType g_type; - - /* public for GTypeValueTable methods */ - union { - gint v_int; - guint v_uint; - glong v_long; - gulong v_ulong; - gint64 v_int64; - guint64 v_uint64; - gfloat v_float; - gdouble v_double; - gpointer v_pointer; - } data[2]; -}; - -#endif /* __G_VALUE_H__ */ - diff --git a/mui/gtk-mui/glib/gobject/gvaluecollector.h b/mui/gtk-mui/glib/gobject/gvaluecollector.h deleted file mode 100644 index 07869c8ee..000000000 --- a/mui/gtk-mui/glib/gobject/gvaluecollector.h +++ /dev/null @@ -1,55 +0,0 @@ -/* GObject - GLib Type, Object, Parameter and Signal Library - * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. - * - * gvaluecollector.h: GValue varargs stubs - * - * modified by o1i - */ -#ifndef __G_VALUE_COLLECTOR_H__ -#define __G_VALUE_COLLECTOR_H__ - -#include - - -/* we may want to add aggregate types here some day, if requested - * by users. the basic C types are covered already, everything - * smaller than an int is promoted to an integer and floats are - * always promoted to doubles for varargs call constructions. - */ -enum /*< skip >*/ -{ - G_VALUE_COLLECT_INT = 'i', - G_VALUE_COLLECT_LONG = 'l', - G_VALUE_COLLECT_INT64 = 'q', - G_VALUE_COLLECT_DOUBLE = 'd', - G_VALUE_COLLECT_POINTER = 'p' -}; - - -/* vararg union holding actuall values collected - */ -union _GTypeCValue -{ - gint v_int; - glong v_long; - gint64 v_int64; - gdouble v_double; - gpointer v_pointer; -}; - -#endif /* __G_VALUE_COLLECTOR_H__ */ diff --git a/mui/gtk-mui/glib/gobject/mmakefile.src b/mui/gtk-mui/glib/gobject/mmakefile.src deleted file mode 100755 index 94349b148..000000000 --- a/mui/gtk-mui/glib/gobject/mmakefile.src +++ /dev/null @@ -1,17 +0,0 @@ -# $Id$ -# -include $(TOP)/config/make.cfg - -#MM- contrib-gobject-includes : includes - -INCLUDE_FILES := gobject.h \ - gsignal.h \ - gtype.h \ - gvalue.h \ - gvaluecollector.h \ - - -%copy_includes path=glib/gobject includes=$(INCLUDE_FILES) - -%common - diff --git a/mui/gtk-mui/glib/gsignal.c b/mui/gtk-mui/glib/gsignal.c deleted file mode 100644 index 07d3f7d59..000000000 --- a/mui/gtk-mui/glib/gsignal.c +++ /dev/null @@ -1,360 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -/* g_signal_new - * - * Creates a new signal. (This is usually done in the class initializer.) - * - * A signal name consists of segments consisting of ASCII letters and digits, - * separated by either the '-' or '_' character. The first character of a - * signal name must be a letter. Names which violate these rules lead to - * undefined behaviour of the GSignal system. - */ - -/* example: - g_signal_new ("tictactoe", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - 0, - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0, NULL); -*/ - -guint g_signal_new(const gchar *signal_name, GType itype, GSignalFlags signal_flags, guint class_offset, GSignalAccumulator accumulator, gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, ...) { - - mgtk_SignalType *newsignal; - mgtk_SignalType *i; - - DebOut("g_signal_new(%s,...)\n",signal_name); - - if(n_params) { - WarnOut("g_signal_new n_params ignored\n"); - } - - newsignal=g_new(mgtk_SignalType,sizeof(mgtk_SignalType)); - newsignal->type=100; /* ?? TODO */ - newsignal->name=g_strdup(signal_name); - newsignal->next=NULL; - - if(!mgtk->mgtk_signal) { - /* first signal, start count with 100 */ - mgtk->mgtk_signal_count=100; - newsignal->id=mgtk->mgtk_signal_count; - - mgtk->mgtk_signal=newsignal; - } - else { - mgtk->mgtk_signal_count++; - newsignal->id=mgtk->mgtk_signal_count; - i=mgtk->mgtk_signal; - - while(i->next) { - i=i->next; - } - i->next=newsignal; - } - return newsignal->id; -} - -/* Given the name of the signal and the type of object - * it connects to, gets the signal's identifying integer. - * Emitting the signal by number is somewhat faster - * than using the name each time. - */ - -guint g_signal_lookup(const gchar *name, GType itype) { - - mgtk_SignalType *s; - - DebOut("g_signal_lookup(%s,%d)\n",name,itype); - DebOut("WARNING: itype ignored\n"); - - s=mgtk->mgtk_signal; - - while(s) { - if(!strcmp(s->name,name)) { - return s->id; - } - s=s->next; - } - return 0; -} - - /* g_signal_connect_data may be called on Adjustments, which have no MUI object themselves. - * So we just store the call and redo it, as soon as the adjustment is connected to - * a real Object. - * On the other hand, the adjustment may have been used for a real widget - * already. In this case, you have to store the widget in the GSList - * of the adjustment. See spinbutton for an example. - */ - - /* Menuitems might be used in "real menus", then the applied hook - * works. But they might end up in an option menu, - * and the hooks would not work. So remember them additionally - */ - - /* Fileselectors are quite different under AmigaOS than under GTK - * So we remember the callbacks for them, too - */ - - /* if we have a custom/new style signal, we will deal with at - * the beginning (we will remember them) - * In the long run, all signals should be handled in this way.. - * - * At the moment, the following signals are handled here: - * - * - custom signals (of course) - * - toggled signals - * - */ - -gulong g_signal_connect_data(gpointer instance, /*widget */ - const gchar *detailed_signal, - GCallback c_handler, /* callback*/ - gpointer data, - GClosureNotify destroy_data, - GConnectFlags connect_flags) { - - GtkWidget *widget; - GtkWidget *w; - mgtk_signal_connect_data *store; - mgtk_signal_connect_data *newrem; - mgtk_signal_connect_data *i; - GSList *gs; - - widget=(GtkWidget *) instance; - - DebOut("g_signal_connect_data(%lx,%s,%lx,%lx,%lx)\n",instance,detailed_signal,c_handler,data,destroy_data,connect_flags); - - if(g_signal_lookup(detailed_signal,0)) { - DebOut(" custom/newstyle signal %s detected\n",detailed_signal); - - store=widget->mgtk_signal_connect_data; - DebOut(" store=%lx\n",store); - if(store) { - while(store->next) { - DebOut(" store->next=%lx\n",store->next); - if(store!=store->next) { - store=store->next; - } - else { - store->next=NULL; - WarnOut("gtk_hooks.c: Loop detected (fixed the hard way)\n"); - } - } - } - - DebOut("found store: %lx\n",store); - - /* create and init new mgtk_signal_connect_data */ - newrem=g_new0(mgtk_signal_connect_data,sizeof(mgtk_signal_connect_data)); - DebOut("newrem=%lx\n",newrem); - newrem->detailed_signal=g_strdup(detailed_signal); - newrem->id=g_signal_lookup(detailed_signal,0); - newrem->c_handler=c_handler; - newrem->data=data; - newrem->destroy_data=destroy_data; - newrem->connect_flags=connect_flags; - newrem->next=NULL; - - /* add it to list */ - if(widget->mgtk_signal_connect_data) { - DebOut(" appending mgtk_signal_connect_data\n"); - store->next=newrem; - } - else { - DebOut(" stored first mgtk_signal_connect_data\n"); - widget->mgtk_signal_connect_data=newrem; - } - DebOut(" remembered it for later use\n"); - - /* An adjustment may have been used for a real widget - * already. In this case, you have to store the widget in the GSList - * of the adjustment. See spinbutton for an example. - */ - if(widget->type==IS_ADJUSTMENT) { - if(widget->GSList) { - /* we already have widgets, which use this adjustment */ - DebOut(" connecting adjustment signals to stored widgets\n"); - gs=widget->GSList; - while(gs) { - w=(GtkWidget *) gs->data; - /* copy all signals */ - /* this should be *one* list, referred from more - * objects, TODO: introduce counter and just link the - * list: - * w->mgtk_signal_connect_data=widget->mgtk_signal_connect_data; - */ - i=widget->mgtk_signal_connect_data; - while(i) { - g_signal_connect_data(w,i->detailed_signal,i->c_handler,i->data,i->destroy_data,i->connect_flags); - i=i->next; - } - gs=gs->next; - } - } - } - - return 0; - } - - WarnOut("g_signal_connect_data: unknown signal %s ignored\n",detailed_signal); - return 0; -} - -/* - * g_signal_emit just has to look through the callbacks - * stored in widget->mgtk_signal_connect_data, if it - * finds matching signal_ids. If yes, call the - * hooks according to the connect_flags. - * This seems to be more clean, than the mess in - * gtk_hooks. Maybe I'll have to rewrite gtk_hooks.. - */ -void g_signal_emit(gpointer instance, guint signal_id, GQuark detail, ...) { - - GtkWidget *widget; - mgtk_signal_connect_data *s; - void (*callme)(GtkWidget *widget,gpointer data); - - DebOut("g_signal_emit(%lx,%d,..)\n",instance,signal_id); - - widget=(GtkWidget *) instance; - - s=widget->mgtk_signal_connect_data; - - while(s) { - /* DebOut(" compare s->id %d == signal_id %d\n",s->id,signal_id); */ - if(s->id == signal_id) { - /* now call all matching callbacks of this item */ - callme=(void *) s->c_handler; - DebOut(" calling custom/newstyle signal hook %lx..\n",callme); - if(s->connect_flags == G_CONNECT_SWAPPED) { - (*callme)(s->data,widget); - } - else { - (*callme)(widget,s->data); - } - } - if(s == s->next) { - WarnOut("loop in mgtk_signal_connect_data detected! (fixed hard)\n"); - /* fix the loop in a hard way and pray ;) */ - s->next=NULL; - } - s=s->next; - } - /* we did it, phew. */ -} - -/* Emits a signal. - * - * TODO: - * Note that g_signal_emit_by_name() resets the return - * value to the default if no handlers are connected, - * in contrast to g_signal_emitv(). - * instance : the instance the signal is being emitted on. - * detailed_signal : a string of the form "signal-name::detail". - * ... : parameters to be passed to the signal, followed - * by a location for the return value. If the return type of - * the signal is G_TYPE_NONE, the return value location can be omitted. -*/ -void g_signal_emit_by_name(gpointer instance, const gchar *detailed_signal, ...) { - - DebOut("g_signal_emit_by_name(%lx,%s,..)\n",instance,detailed_signal); - - g_signal_emit(instance,g_signal_lookup(detailed_signal,0),0); -} - -/* Disconnects all handlers on an instance that match func and data. - * instance : The instance to remove handlers from. - * func : The C closure callback of the handlers (useless for non-C closures). - * data : The closure data of the handlers' closures. - * Returns : The number of handlers that got disconnected. - */ - -static void remove_signal_handler(GtkWidget *widget,mgtk_signal_connect_data *deleteme) { - mgtk_signal_connect_data *s; - - if(deleteme==widget->mgtk_signal_connect_data) { - widget->mgtk_signal_connect_data=NULL; - } - else { - s=widget->mgtk_signal_connect_data; - while(s->next != deleteme) { - /* this should terminate, match was found before */ - s=s->next; - } - /* skip deleteme */ - s->next=deleteme->next; - } - g_free(deleteme); -} - -guint g_signal_handlers_disconnect_by_func(gpointer instance, GCallback func, gpointer data) { - GtkWidget *widget; - mgtk_signal_connect_data *s; - guint count; - - DebOut("g_signal_handlers_disconnect_by_func(%lx,%lx,%lx)\n",instance,func,data); - - widget=(GtkWidget *) instance; - - s=widget->mgtk_signal_connect_data; - - count=0; - while(s) { - if((s->data == data) && (s->c_handler == func)){ - /* now we have to remove this item */ - count++; - remove_signal_handler(widget,s); - } - if(s == s->next) { - WarnOut("loop in mgtk_signal_connect_data detected!\n"); - /* fix the loop in a hard way and pray ;) */ - s->next=NULL; - } - s=s->next; - } - return count; -} diff --git a/mui/gtk-mui/glib/gslist.c b/mui/gtk-mui/glib/gslist.c deleted file mode 100644 index 76340db0b..000000000 --- a/mui/gtk-mui/glib/gslist.c +++ /dev/null @@ -1,774 +0,0 @@ -/* GLIB - Library of useful routines for C programming - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GLib Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GLib Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* - * MT safe - */ - -#include "config.h" - -#include "glib.h" -/*#include "galias.h"*/ - - -#ifndef DISABLE_MEM_POOLS -struct _GAllocator /* from gmem.c */ -{ - gchar *name; - guint16 n_preallocs; - guint is_unused : 1; - guint type : 4; - GAllocator *last; - GMemChunk *mem_chunk; - GSList *free_lists; /* implementation specific */ -}; - -G_LOCK_DEFINE_STATIC (current_allocator); -static GAllocator *current_allocator = NULL; - -/* HOLDS: current_allocator_lock */ -static void -g_slist_validate_allocator (GAllocator *allocator) -{ - g_return_if_fail (allocator != NULL); - g_return_if_fail (allocator->is_unused == TRUE); - - if (allocator->type != G_ALLOCATOR_SLIST) - { - allocator->type = G_ALLOCATOR_SLIST; - if (allocator->mem_chunk) - { - g_mem_chunk_destroy (allocator->mem_chunk); - allocator->mem_chunk = NULL; - } - } - - if (!allocator->mem_chunk) - { - allocator->mem_chunk = g_mem_chunk_new (allocator->name, - sizeof (GSList), - sizeof (GSList) * allocator->n_preallocs, - G_ALLOC_ONLY); - allocator->free_lists = NULL; - } - - allocator->is_unused = FALSE; -} - -void -g_slist_push_allocator (GAllocator *allocator) -{ - G_LOCK (current_allocator); - g_slist_validate_allocator (allocator); - allocator->last = current_allocator; - current_allocator = allocator; - G_UNLOCK (current_allocator); -} - -void -g_slist_pop_allocator (void) -{ - G_LOCK (current_allocator); - if (current_allocator) - { - GAllocator *allocator; - - allocator = current_allocator; - current_allocator = allocator->last; - allocator->last = NULL; - allocator->is_unused = TRUE; - } - G_UNLOCK (current_allocator); -} - -static inline GSList* -_g_slist_alloc (void) -{ - GSList *list; - - G_LOCK (current_allocator); - if (!current_allocator) - { - GAllocator *allocator = g_allocator_new ("GLib default GSList allocator", - 128); - g_slist_validate_allocator (allocator); - allocator->last = NULL; - current_allocator = allocator; - } - if (!current_allocator->free_lists) - { - list = g_chunk_new (GSList, current_allocator->mem_chunk); - list->data = NULL; - } - else - { - if (current_allocator->free_lists->data) - { - list = current_allocator->free_lists->data; - current_allocator->free_lists->data = list->next; - list->data = NULL; - } - else - { - list = current_allocator->free_lists; - current_allocator->free_lists = list->next; - } - } - G_UNLOCK (current_allocator); - - list->next = NULL; - - return list; -} - -GSList* -g_slist_alloc (void) -{ - return _g_slist_alloc (); -} - -void -g_slist_free (GSList *list) -{ - if (list) - { - GSList *last_node = list; - -#ifdef ENABLE_GC_FRIENDLY - while (last_node->next) - { - last_node->data = NULL; - last_node = last_node->next; - } - last_node->data = NULL; -#else /* !ENABLE_GC_FRIENDLY */ - list->data = list->next; -#endif /* ENABLE_GC_FRIENDLY */ - - G_LOCK (current_allocator); - last_node->next = current_allocator->free_lists; - current_allocator->free_lists = list; - G_UNLOCK (current_allocator); - } -} - -static inline void -_g_slist_free_1 (GSList *list) -{ - if (list) - { - list->data = NULL; - G_LOCK (current_allocator); - list->next = current_allocator->free_lists; - current_allocator->free_lists = list; - G_UNLOCK (current_allocator); - } -} - -void -g_slist_free_1 (GSList *list) -{ - _g_slist_free_1 (list); -} -#else /* DISABLE_MEM_POOLS */ - -#define _g_slist_alloc g_slist_alloc -GSList* -g_slist_alloc (void) -{ - GSList *list; - - list = g_new0 (GSList, 1); - - return list; -} - -void -g_slist_free (GSList *list) -{ - GSList *last; - - while (list) - { - last = list; - list = list->next; - g_free (last); - } -} - -#define _g_slist_free_1 g_slist_free_1 -void -g_slist_free_1 (GSList *list) -{ - g_free (list); -} - -#endif - -GSList* -g_slist_append (GSList *list, - gpointer data) -{ - GSList *new_list; - GSList *last; - - new_list = _g_slist_alloc (); - new_list->data = data; - - if (list) - { - last = g_slist_last (list); - /* g_assert (last != NULL); */ - last->next = new_list; - - return list; - } - else - return new_list; -} - -GSList* -g_slist_prepend (GSList *list, - gpointer data) -{ - GSList *new_list; - - new_list = _g_slist_alloc (); - new_list->data = data; - new_list->next = list; - - return new_list; -} - -GSList* -g_slist_insert (GSList *list, - gpointer data, - gint position) -{ - GSList *prev_list; - GSList *tmp_list; - GSList *new_list; - - if (position < 0) - return g_slist_append (list, data); - else if (position == 0) - return g_slist_prepend (list, data); - - new_list = _g_slist_alloc (); - new_list->data = data; - - if (!list) - return new_list; - - prev_list = NULL; - tmp_list = list; - - while ((position-- > 0) && tmp_list) - { - prev_list = tmp_list; - tmp_list = tmp_list->next; - } - - if (prev_list) - { - new_list->next = prev_list->next; - prev_list->next = new_list; - } - else - { - new_list->next = list; - list = new_list; - } - - return list; -} - -GSList* -g_slist_insert_before (GSList *slist, - GSList *sibling, - gpointer data) -{ - if (!slist) - { - slist = g_slist_alloc (); - slist->data = data; - g_return_val_if_fail (sibling == NULL, slist); - return slist; - } - else - { - GSList *node, *last = NULL; - - for (node = slist; node; last = node, node = last->next) - if (node == sibling) - break; - if (!last) - { - node = g_slist_alloc (); - node->data = data; - node->next = slist; - - return node; - } - else - { - node = g_slist_alloc (); - node->data = data; - node->next = last->next; - last->next = node; - - return slist; - } - } -} - -GSList * -g_slist_concat (GSList *list1, GSList *list2) -{ - if (list2) - { - if (list1) - g_slist_last (list1)->next = list2; - else - list1 = list2; - } - - return list1; -} - -GSList* -g_slist_remove (GSList *list, - gconstpointer data) -{ - GSList *tmp, *prev = NULL; - - tmp = list; - while (tmp) - { - if (tmp->data == data) - { - if (prev) - prev->next = tmp->next; - else - list = tmp->next; - - g_slist_free_1 (tmp); - break; - } - prev = tmp; - tmp = prev->next; - } - - return list; -} - -GSList* -g_slist_remove_all (GSList *list, - gconstpointer data) -{ - GSList *tmp, *prev = NULL; - - tmp = list; - while (tmp) - { - if (tmp->data == data) - { - GSList *next = tmp->next; - - if (prev) - prev->next = next; - else - list = next; - - g_slist_free_1 (tmp); - tmp = next; - } - else - { - prev = tmp; - tmp = prev->next; - } - } - - return list; -} - -static inline GSList* -_g_slist_remove_link (GSList *list, - GSList *link) -{ - GSList *tmp; - GSList *prev; - - prev = NULL; - tmp = list; - - while (tmp) - { - if (tmp == link) - { - if (prev) - prev->next = tmp->next; - if (list == tmp) - list = list->next; - - tmp->next = NULL; - break; - } - - prev = tmp; - tmp = tmp->next; - } - - return list; -} - -GSList* -g_slist_remove_link (GSList *list, - GSList *link) -{ - return _g_slist_remove_link (list, link); -} - -GSList* -g_slist_delete_link (GSList *list, - GSList *link) -{ - list = _g_slist_remove_link (list, link); - _g_slist_free_1 (link); - - return list; -} - -GSList* -g_slist_copy (GSList *list) -{ - GSList *new_list = NULL; - - if (list) - { - GSList *last; - - new_list = _g_slist_alloc (); - new_list->data = list->data; - last = new_list; - list = list->next; - while (list) - { - last->next = _g_slist_alloc (); - last = last->next; - last->data = list->data; - list = list->next; - } - } - - return new_list; -} - -GSList* -g_slist_reverse (GSList *list) -{ - GSList *prev = NULL; - - while (list) - { - GSList *next = list->next; - - list->next = prev; - - prev = list; - list = next; - } - - return prev; -} - -GSList* -g_slist_nth (GSList *list, - guint n) -{ - while (n-- > 0 && list) - list = list->next; - - return list; -} - -gpointer -g_slist_nth_data (GSList *list, - guint n) -{ - while (n-- > 0 && list) - list = list->next; - - return list ? list->data : NULL; -} - -GSList* -g_slist_find (GSList *list, - gconstpointer data) -{ - while (list) - { - if (list->data == data) - break; - list = list->next; - } - - return list; -} - -/* -GSList* -g_slist_find_custom (GSList *list, - gconstpointer data, - GCompareFunc func) -{ - g_return_val_if_fail (func != NULL, list); - - while (list) - { - if (! func (list->data, data)) - return list; - list = list->next; - } - - return NULL; -} -*/ -gint -g_slist_position (GSList *list, - GSList *link) -{ - gint i; - - i = 0; - while (list) - { - if (list == link) - return i; - i++; - list = list->next; - } - - return -1; -} - -gint -g_slist_index (GSList *list, - gconstpointer data) -{ - gint i; - - i = 0; - while (list) - { - if (list->data == data) - return i; - i++; - list = list->next; - } - - return -1; -} - -GSList* -g_slist_last (GSList *list) -{ - if (list) - { - while (list->next) - list = list->next; - } - - return list; -} - -guint -g_slist_length (GSList *list) -{ - guint length; - - length = 0; - while (list) - { - length++; - list = list->next; - } - - return length; -} - -/* -void -g_slist_foreach (GSList *list, - GFunc func, - gpointer user_data) -{ - while (list) - { - GSList *next = list->next; - (*func) (list->data, user_data); - list = next; - } -} - -GSList* -g_slist_insert_sorted (GSList *list, - gpointer data, - GCompareFunc func) -{ - GSList *tmp_list = list; - GSList *prev_list = NULL; - GSList *new_list; - gint cmp; - - g_return_val_if_fail (func != NULL, list); - - if (!list) - { - new_list = _g_slist_alloc (); - new_list->data = data; - return new_list; - } - - cmp = (*func) (data, tmp_list->data); - - while ((tmp_list->next) && (cmp > 0)) - { - prev_list = tmp_list; - tmp_list = tmp_list->next; - cmp = (*func) (data, tmp_list->data); - } - - new_list = _g_slist_alloc (); - new_list->data = data; - - if ((!tmp_list->next) && (cmp > 0)) - { - tmp_list->next = new_list; - return list; - } - - if (prev_list) - { - prev_list->next = new_list; - new_list->next = tmp_list; - return list; - } - else - { - new_list->next = list; - return new_list; - } -} - -static GSList * -g_slist_sort_merge (GSList *l1, - GSList *l2, - GFunc compare_func, - gboolean use_data, - gpointer user_data) -{ - GSList list, *l; - gint cmp; - - l=&list; - - while (l1 && l2) - { - if (use_data) - cmp = ((GCompareDataFunc) compare_func) (l1->data, l2->data, user_data); - else - cmp = ((GCompareFunc) compare_func) (l1->data, l2->data); - - if (cmp <= 0) - { - l=l->next=l1; - l1=l1->next; - } - else - { - l=l->next=l2; - l2=l2->next; - } - } - l->next= l1 ? l1 : l2; - - return list.next; -} - -static GSList * -g_slist_sort_real (GSList *list, - GFunc compare_func, - gboolean use_data, - gpointer user_data) -{ - GSList *l1, *l2; - - if (!list) - return NULL; - if (!list->next) - return list; - - l1 = list; - l2 = list->next; - - while ((l2 = l2->next) != NULL) - { - if ((l2 = l2->next) == NULL) - break; - l1=l1->next; - } - l2 = l1->next; - l1->next = NULL; - - return g_slist_sort_merge (g_slist_sort_real (list, compare_func, use_data, user_data), - g_slist_sort_real (l2, compare_func, use_data, user_data), - compare_func, - use_data, - user_data); -} - -GSList * -g_slist_sort (GSList *list, - GCompareFunc compare_func) -{ - return g_slist_sort_real (list, (GFunc) compare_func, FALSE, NULL); -} - -GSList * -g_slist_sort_with_data (GSList *list, - GCompareDataFunc compare_func, - gpointer user_data) -{ - return g_slist_sort_real (list, (GFunc) compare_func, TRUE, user_data); -} -*/ - -#define __G_SLIST_C__ -/* -#include "galiasdef.c" -*/ diff --git a/mui/gtk-mui/glib/gslist.h b/mui/gtk-mui/glib/gslist.h deleted file mode 100644 index 308e3bfeb..000000000 --- a/mui/gtk-mui/glib/gslist.h +++ /dev/null @@ -1,106 +0,0 @@ -/* GLIB - Library of useful routines for C programming - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GLib Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GLib Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __G_SLIST_H__ -#define __G_SLIST_H__ - -#include - -/*G_BEGIN_DECLS*/ - -#ifndef HAVE_GSLIST_DEFINED -#define HAVE_GSLIST_DEFINED 1 -typedef struct _GSList GSList; - -struct _GSList -{ - gpointer data; - GSList *next; -}; -#endif - -/* Singly linked lists - */ - /* void g_slist_push_allocator (GAllocator *allocator); */ -void g_slist_pop_allocator (void); -GSList* g_slist_alloc (void); -void g_slist_free (GSList *list); -void g_slist_free_1 (GSList *list); -GSList* g_slist_append (GSList *list, - gpointer data); -GSList* g_slist_prepend (GSList *list, - gpointer data); -GSList* g_slist_insert (GSList *list, - gpointer data, - gint position); -/*GSList* g_slist_insert_sorted (GSList *list, - gpointer data, - GCompareFunc func);*/ -GSList* g_slist_insert_before (GSList *slist, - GSList *sibling, - gpointer data); -GSList* g_slist_concat (GSList *list1, - GSList *list2); -GSList* g_slist_remove (GSList *list, - gconstpointer data); -GSList* g_slist_remove_all (GSList *list, - gconstpointer data); -GSList* g_slist_remove_link (GSList *list, - GSList *link_); -GSList* g_slist_delete_link (GSList *list, - GSList *link_); -GSList* g_slist_reverse (GSList *list); -GSList* g_slist_copy (GSList *list); -GSList* g_slist_nth (GSList *list, - guint n); -GSList* g_slist_find (GSList *list, - gconstpointer data); -/* -GSList* g_slist_find_custom (GSList *list, - gconstpointer data, - GCompareFunc func); */ -gint g_slist_position (GSList *list, - GSList *llink); -gint g_slist_index (GSList *list, - gconstpointer data); -GSList* g_slist_last (GSList *list); -guint g_slist_length (GSList *list); -/*void g_slist_foreach (GSList *list, - GFunc func, - gpointer user_data);*/ -/*GSList* g_slist_sort (GSList *list, - GCompareFunc compare_func); -GSList* g_slist_sort_with_data (GSList *list, - GCompareDataFunc compare_func, - gpointer user_data); */ -gpointer g_slist_nth_data (GSList *list, - guint n); -#define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL) - -/*G_END_DECLS*/ - -#endif /* __G_SLIST_H__ */ - diff --git a/mui/gtk-mui/glib/gstrfuncs.h b/mui/gtk-mui/glib/gstrfuncs.h deleted file mode 100644 index 76a0365bb..000000000 --- a/mui/gtk-mui/glib/gstrfuncs.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __G_STRFUNCS_H__ -#define __G_STRFUNCS_H__ - -gchar* g_strdup (const gchar *str); -gpointer g_memdup (gconstpointer mem, guint byte_size); -gchar* g_strndup (const gchar *str, guint n); -gchar* g_strnfill (guint length, gchar fill_char); -gchar* g_strdup_vprintf (const gchar *format, va_list args1); -gchar* g_strdup_printf (const gchar *format, ...) ; -gchar* g_strconcat (const gchar *string1, ...); -gdouble g_strtod (const gchar *nptr, gchar **endptr); -gchar* g_strerror (gint errnum); -gchar* g_strsignal (gint signum); -guint g_printf_string_upper_bound (const gchar* format, va_list args); -void g_strdown (gchar *string); -void g_strup (gchar *string); -void g_strreverse (gchar *string); -gint g_strcasecmp (const gchar *s1, const gchar *s2); -gint g_strncasecmp (const gchar *s1, const gchar *s2, guint n); -gchar* g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delim); -gchar* g_strescape (gchar *string); -gchar* g_strchug (gchar *string); -gchar* g_strchomp (gchar *string); -gchar** -g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens); -void g_strfreev (gchar **str_array); -gchar* g_strjoinv (const gchar *separator, gchar **str_array); -gchar* g_strjoin (const gchar *separator, ...); - -#endif /* __G_STRFUNCS_H__ */ diff --git a/mui/gtk-mui/glib/gstrfuncs2.c b/mui/gtk-mui/glib/gstrfuncs2.c deleted file mode 100644 index 9001b78e2..000000000 --- a/mui/gtk-mui/glib/gstrfuncs2.c +++ /dev/null @@ -1,105 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -/* just a warning, this is a quick hack.. */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -GString *g_string_new(const gchar *init) { - - if(!init) { - return g_strdup(""); - } - - return g_strdup(init); -} - -gchar *g_string_free(GString *string, gboolean free_segment) { - - if(free_segment) { - g_free(string); - return NULL; - } - return string; -} - -GString *g_string_append_c(GString *string, gchar c) { - - char *tmp; - - DebOut("g_string_append_c(%s,%c)\n",string,c); - - if(string) { - tmp=g_strdup_printf("%s%c",string,c); - g_free(string); - } - else { - tmp=g_strdup_printf("%c",c); - } - - return tmp; -} - -GString *g_string_append(GString *string, const gchar *val) { - - char *tmp; - - DebOut("g_string_append(%s,%s)\n",string,val); - - if(string) { - if(val) { - tmp=g_strdup_printf("%s%s",string,val); - g_free(string); - } - else { - tmp=string; - } - } - else { - tmp=(char *)val; - } - - return tmp; -} - - - - diff --git a/mui/gtk-mui/glib/gtypes.h b/mui/gtk-mui/glib/gtypes.h deleted file mode 100644 index 5746cbb5f..000000000 --- a/mui/gtk-mui/glib/gtypes.h +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#ifndef __G_TYPES_H__ -#define __G_TYPES_H__ - -typedef APTR gpointer; -typedef LONG guint32; -typedef char gchar; -typedef char gint8; -typedef unsigned char guint8; -typedef short gint16; -typedef unsigned short guint16; -typedef short gshort; -typedef unsigned short gushort; -typedef int gint; -typedef unsigned int guint; -typedef double gdouble; -typedef int gboolean; -typedef long glong; -typedef unsigned long gulong; -typedef float gfloat; -typedef long int gint64; // is this correct? -oli -typedef unsigned long int guint64; // is this correct? -oli -typedef gulong GType; // is this correct? -itix -typedef gulong GtkType; // is this correct? -oli ;) -typedef guint32 GQuark; -typedef const void *gconstpointer; -typedef char GString; - -#define G_PI_4 0.78539816339744830961566084581987572104929234984378 - -#endif /* __G_TYPES_H__ */ - diff --git a/mui/gtk-mui/glib/mem.h b/mui/gtk-mui/glib/mem.h deleted file mode 100644 index 9a38112c1..000000000 --- a/mui/gtk-mui/glib/mem.h +++ /dev/null @@ -1,2 +0,0 @@ - -/* empty for now */ diff --git a/mui/gtk-mui/glib/mmakefile.src b/mui/gtk-mui/glib/mmakefile.src deleted file mode 100755 index 7d545c613..000000000 --- a/mui/gtk-mui/glib/mmakefile.src +++ /dev/null @@ -1,21 +0,0 @@ -# $Id$ -# -include $(TOP)/config/make.cfg - -#MM- contrib-glib-includes : includes - -INCLUDE_FILES := config.h \ - garray.h \ - gfileutils.h \ - gmacros.h \ - gmem.h \ - gslist.h \ - gstrfuncs.h \ - gtypes.h \ - mem.h \ - - -%copy_includes path=glib includes=$(INCLUDE_FILES) - -%common - diff --git a/mui/gtk-mui/gtk-mui.c b/mui/gtk-mui/gtk-mui.c deleted file mode 100644 index 2299ef93b..000000000 --- a/mui/gtk-mui/gtk-mui.c +++ /dev/null @@ -1,973 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#ifdef __AROS__ -#include -#endif -#include -/* cross platform hooks */ -#include - -#include "classes.h" -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "gtk/gtkrange.h" -#include "mui.h" - -/* stolen from YAM */ -ULONG xget(Object *obj, ULONG attr) { - ULONG b = 0; - GetAttr(attr, obj, &b); - return b; -} - -/********************************************************************** - mgtk_allocvec, mgtk_freevec, mgtk_allocmem, mgtk_freemem -**********************************************************************/ - -APTR mgtk_allocvec(ULONG size, ULONG req) -{ - APTR ptr; -#ifdef __MORPHOS__ - ptr = AllocVecTaskPooled(size); - - if (ptr && (req & MEMF_CLEAR)) - { - memset(ptr, 0, size); - } -#else - ptr = AllocVec(size, req); -#endif - - return ptr; -} - -VOID mgtk_freevec(APTR ptr) -{ -#ifdef __MORPHOS__ - FreeVecTaskPooled(ptr); -#else - FreeVec(ptr); -#endif -} - -APTR mgtk_allocmem(ULONG size, ULONG req) -{ - APTR ptr; -#ifdef __MORPHOS__ - ptr = AllocTaskPooled(size); - - if (ptr && (req & MEMF_CLEAR)) - { - memset(ptr, 0, size); - } -#else - ptr = AllocMem(size, req); -#endif - - return ptr; -} - -VOID mgtk_freemem(APTR ptr, ULONG size) -{ -#ifdef __MORPHOS__ - FreeTaskPooled(ptr, size); -#else - FreeMem(ptr, size); -#endif -} - -/********************************* - * private functions - *********************************/ - -APTR mgtk_malloc(int size) { - APTR ret; - - DebOut("mgtk_malloc(%d)\n",size); - - if (!(ret = AllocRemember(&rememberKey, size, MEMF_CLEAR ))) { - printf("mgtk_malloc: Unable to allocate %d bytes of memory\n",size); - return(NULL); - } - - return(ret); -} - -GtkWidget *mgtk_widget_new(int type) { - - GtkWidget *ret; - - switch(type) { - case IS_SCROLLBAR: - ret=(GtkWidget *) g_new0(GtkRange,1); - break; - case IS_TOOLBAR: - ret=(GtkWidget *) g_new0(GtkToolbar,1); - break; - default: - ret=g_new0(GtkWidget,1); - break; - } - - /* init data structure */ - G_OBJECT(ret)->badmagic=BADMAGIC; - G_OBJECT(ret)->gobjs=NULL; - G_OBJECT(ret)->ref_count=0; - ret->type=type; - ret->MuiWin=NULL; - ret->MuiWinMenustrip=NULL; - ret->MuiGroup=NULL; - ret->MuiObject=NULL; - ret->title=NULL; - ret->rows=0; - ret->columns=0; - ret->text_length=0; - ret->parent=NULL; - ret->nextObject=NULL; - ret->GSList=NULL; - ret->value=0; - ret->lower=0; - ret->upper=0; - ret->step_increment=0; - ret->page_increment=0; - ret->page_size=0; - ret->mgtk_signal_connect_data=NULL; - ret->style=mgtk_get_default_style(mgtk->MuiRoot); - - switch (type) - { - default : ret->mainclass = CL_AREA; break; - case IS_WINDOW : ret->mainclass = CL_WINDOW; break; - - case IS_MENUBAR : - case IS_MENU : - case IS_OPTIONMENU: - case IS_MENUITEM : - ret->mainclass = CL_FAMILY; - break; - - case IS_TOOLTIPS : - case IS_FILESEL : - case IS_FILESEL_BUTTON: - ret->mainclass = CL_OTHER; - break; - } - - return ret; -} - -int mgtk_add_child(GtkWidget *parent, GtkWidget *child) { - - DebOut("mgtk_add_child(parent %lx, child %lx\n",parent,child); - - if(child->parent != NULL) { - WarnOut("mgtk_add_child: child %x has already a parent (%x), new parent now: %x\n",(int) child,(int) child->parent,(int) parent); - } - - child->parent=(APTR) parent; - - if((child->MuiWin!=NULL) && (child->MuiWin!=parent->MuiWin)) { - WarnOut("mgtk_add_child: child %x has already a MuiWin (%x), new MuiWin now: %x\n",(int) child,(int) child->MuiWin,(int) parent->MuiWin); - } - - if(parent->MuiWin!=NULL) { - child->MuiWin=parent->MuiWin; - } - else { - DebOut("WARNING: mgtk_add_child: someone forgot to set MuiWin for %x\n",(int) parent); - } - - return 0; -} - -/* to iterate is human .. */ -void mgtk_initchange(GtkWidget *change) { - - DebOut("mgtk_initchange(%lx)\n",change); - - if(change==NULL) { - return; - } - - /* - if(change->type != IS_GROUP) { - mgtk_initchange((APTR) change->parent); - return; - } - - mgtk_initchange((APTR) change->parent);*/ - - change=(APTR) change->parent; - DebOut(" mgtk_initchange: DoMethod(%lx,MUIM_Group_InitChange)\n",change); - DoMethod(change->MuiObject,MUIM_Group_InitChange); - return; -} - -void mgtk_exitchange(GtkWidget *change) { - - DebOut("mgtk_exitchange(%lx)\n",change); - - if(change==NULL) { - return; - } - - /* - if(change->type != IS_GROUP) { - mgtk_exitchange((APTR) change->parent); - return; - } - */ - - change=(APTR) change->parent; - - DebOut(" mgtk_exitchange: DoMethod(%lx,MUIM_Group_ExitChange)\n",change); - DoMethod(change->MuiObject,MUIM_Group_ExitChange); -/* mgtk_exitchange((APTR) change->parent);*/ - return; -} - - -void mgtk_file_selection_show(GtkWidget *widget); - -/********************************* - * gtk_widget_show - *********************************/ - -void gtk_widget_show(GtkWidget *widget) { - - int realized; - - DebOut("gtk_widget_show(%lx)\n",widget); - - realized=widget->flags && GTK_REALIZED; - - /* set realized flag */ - widget->flags |= GTK_REALIZED; - - if(widget->type == IS_WINDOW) { - set(widget->MuiWin,MUIA_Window_Open,TRUE); - return; - } - else if(widget->type == IS_FILESEL) { - mgtk_file_selection_show(widget); - return; - } - else if (widget->mainclass == CL_AREA) - { - DebOut("better not use ShowMe (?)\n"); - SetAttrs(widget->MuiObject, MUIA_Group_Forward, FALSE, MUIA_ShowMe, TRUE, TAG_DONE); - } - else - { - WarnOut("gtk_widget_show() for non window/area ignored\n"); - } - - if(!realized) { - g_signal_emit_by_name(widget,"realized"); - } - - DebOut(" exit\n"); -} - -void gtk_widget_hide(GtkWidget *widget) -{ - if (widget->mainclass == CL_WINDOW) - { - set(widget->MuiWin, MUIA_Window_Open, FALSE); - } - else if (widget->mainclass == CL_AREA) - { - SetAttrs(widget->MuiObject, MUIA_Group_Forward, FALSE, MUIA_ShowMe, FALSE, TAG_DONE); - } - else - { - WarnOut("gtk_widget_hide() for non window/area ignored\n"); - } -} - -void gtk_widget_show_all(GtkWidget *widget) { - if(widget->type == IS_WINDOW) { - set(widget->MuiWin,MUIA_Window_Open,TRUE); - return; - } - else if(widget->type == IS_FILESEL) { - mgtk_file_selection_show(widget); - return; - } - else if (widget->mainclass == CL_AREA) - { - // MUIA_ShowMe is forwarded to children - - set(widget->MuiObject, MUIA_ShowMe, TRUE); - } - else - { - WarnOut("gtk_widget_show_all() for non window/area ignored\n"); - } -} - -void gtk_widget_hide_all(GtkWidget *widget) -{ - if (widget->mainclass == CL_WINDOW) - { - set(widget->MuiWin, MUIA_Window_Open, FALSE); - } - else if (widget->mainclass == CL_AREA) - { - set(widget->MuiObject, MUIA_ShowMe, FALSE); - } - else - { - WarnOut("gtk_widget_hide_all() for non window/area ignored\n"); - } -} - -void gtk_widget_set_sensitive(GtkWidget *widget, gboolean sensitive) -{ - if (widget->mainclass == CL_AREA) - { - set(widget->MuiObject, MUIA_Disabled, !sensitive); - } - else - { - WarnOut("gtk_widget_set_sensitive() - only area class objects supported\n"); - } -} - -/* Creates the GDK (windowing system) resources associated with a widget. - * For example, widget->window will be created when a widget is realized. - * Normally realization happens implicitly; if you show a widget and all - * its parent containers, then the widget will be realized and mapped - * automatically. - - * Realizing a widget requires all the widget's parent widgets to be - * realized; calling gtk_widget_realize() realizes the widget's parents - * in addition to widget itself. If a widget is not yet inside a toplevel - * window when you realize it, bad things will happen. - - * This function is primarily used in widget implementations, and isn't - * very useful otherwise. Many times when you think you might need it, - * a better approach is to connect to a signal that will be called after - * the widget is realized automatically, such as "expose_event". Or simply - * g_signal_connect_after() to the "realize" signal. - */ -void gtk_widget_realize(GtkWidget *widget) { - GdkWindow *win; - - DebOut("gtk_widget_realize(%lx\n",widget); - - if(!widget) { - DebOut("WARNING: widget is NULL\n"); - return; - } - - if(!widget->window) { - win=g_new0(GdkWindow,1); - /* and store it dirty */ - win->mgtk_widget=(APTR) widget; - } -} - -void gtk_container_add (GtkContainer *container, GtkWidget *button) { - - DebOut("gtk_container_add(window %lx, button %lx)\n",container,button); - - if(container == NULL) { - ErrOut("gtk_container_add: window is NULL!?\n"); - } - -/* - DoMethod(container,MUIM_Group_InitChange); - DoMethod(container,OM_ADDMEMBER,button->MuiObject); - DoMethod(container,MUIM_Group_ExitChange); - */ - - mgtk_add_child((APTR) container,button); - - mgtk_initchange(button); - DebOut("DoMethod(%lx,OM_ADDMEMBER,%lx)\n",container->MuiObject,button->MuiObject); - DoMethod(container->MuiObject,OM_ADDMEMBER,button->MuiObject); - mgtk_exitchange(button); - - return; -} - -void Close_Libs(void); - -void gtk_main(void) { - ULONG sigs = 0; - - while ((DoMethod(mgtk->MuiApp,MUIM_Application_NewInput,&sigs) != MUIV_Application_ReturnID_Quit) && (!gtk_do_main_quit)) { - if (sigs) - { - sigs = Wait(sigs | SIGBREAKF_CTRL_C); - if (sigs & SIGBREAKF_CTRL_C) break; - } - } - - set(mgtk->MuiRoot,MUIA_Window_Open,FALSE); - - #if USE_PENS - if(mgtk->white_black_optained) { - ReleasePen(mgtk->screen->ViewPort.ColorMap, mgtk->white_pen); - ReleasePen(mgtk->screen->ViewPort.ColorMap, mgtk->black_pen); - mgtk->white_black_optained=0; - } - - if (mgtk->visualinfo) { - FreeVisualInfo(mgtk->visualinfo); - } - if (mgtk->screen) { - if (mgtk->dri) { - FreeScreenDrawInfo(mgtk->screen, mgtk->dri); - } - UnlockPubScreen(0, mgtk->screen); - } - #endif - -/* - ReleasePen(ViewAddress()->ViewPort->ColorMap,mgtk->black_pen); - ReleasePen(ViewAddress()->ViewPort->ColorMap,mgtk->white_pen); - */ - - MUI_DisposeObject(mgtk->MuiApp); - - FreeRemember(&rememberKey,TRUE); - Close_Libs(); -#if defined ENABLE_RT - RT_Exit(); -#endif -} - -GtkContainer* GTK_CONTAINER(GtkWidget *widget) { - DebOut("GTK_CONTAINER(GtkWidget %lx)\n",widget); - return widget; -} - -GtkWindow* GTK_WINDOW(GtkWidget *widget) { - DebOut("GTK_WINDOW(GtkWidget %lx)\n",widget); - return widget; -} - -GtkBox* GTK_BOX(GtkWidget *widget) { - DebOut("GTK_BOX(GtkWidget %lx)\n",widget); - return widget; -} - -/* -GtkWidget* GTK_WIDGET(APTR widget) { - DebOut("GTK_WIDGET(GtkWidget %lx)\n",widget); - return (GtkWidget *) widget; -} -*/ - -GtkMenu* GTK_MENU(GtkWidget *widget) { - DebOut("GTK_MENU(GtkWidget %lx)\n",widget); - return widget; -} - -GtkMenuShell* GTK_MENU_SHELL(GtkWidget *widget) { - DebOut("GTK_MENU_SHELL(GtkWidget %lx)\n",widget); - return widget; -} - -GtkMenuItem *GTK_MENU_ITEM(GtkWidget *widget) { - DebOut("GTK_MENU_ITEM(GtkWidget %lx)\n",widget); - return widget; -} - -void GTK_WIDGET_SET_FLAGS (GtkWidget *widget, gint flags) { - DebOut("GTK_WIDGET_SET_FLAGS(%lx,%ld)\n",widget,flags); - - if(flags && GTK_CAN_DEFAULT) { - DebOut(" GTK_CAN_DEFAULT: nothing required todo.\n"); - flags=flags && (!GTK_CAN_DEFAULT); - } - - if(flags) { - widget->flags|=flags; - } - return; -} - -gboolean GTK_IS_MENU(GtkWidget *widget) { - DebOut("GTK_ISMENU(GtkWidget %lx)\n",widget); - - if(widget->type==IS_MENU) { - DebOut(" IS_MENU\n"); - return(1); - } - if(widget->type==IS_MENUITEM) { - DebOut(" IS_MENUITEM\n"); - return(1); - } - if(widget->type==IS_MENUBAR) { - DebOut(" IS_MENUBAR\n"); - return(1); - } - - return(0); -} - - -void gtk_container_set_border_width (GtkContainer *container, guint border_width) { - - WarnOut("gtk_container_set_border_width: ignored (MUI does not need this?)\n"); -} - -GtkWidget *gtk_hbox_new( gint homogeneous, gint spacing ) { - - Object *box; - GtkWidget *ret; - - ret=mgtk_widget_new(IS_GROUP); - - box = HGroup, - GroupSpacing(spacing), - End; - - /* does this work!? */ - if(box && homogeneous) { - SetAttrs(box,MUIA_Group_SameWidth,(LONG) 1, TAG_DONE); - } - - DebOut("gtk_hbox_new: %lx\n",box); - - ret->MuiObject=box; - ret->columns=1; - - return ret; -} - -GtkWidget *mgtk_hbox_new_noparams() { - return gtk_hbox_new(0,0); -} - -GType gtk_vbox_get_type (void) { - - return (GType) IS_GROUP; -} - -GtkWidget *gtk_vbox_new( gint homogeneous, gint spacing ) { - - Object *box; - GtkWidget *ret; - - ret=mgtk_widget_new(IS_GROUP); - - box = VGroup, - GroupSpacing(spacing), - End; - - /* does this work!? */ - if(homogeneous) { - SetAttrs(box,MUIA_Group_SameHeight,(LONG) 1, TAG_DONE); - } - - DebOut("gtk_vbox_new: %lx\n",box); - - ret->MuiObject=box; - ret->rows=1; - - return ret; -} - -void mgtk_optionmenu_pack(GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding ); - -void gtk_box_pack_start(GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding ) { - - DebOut("gtk_box_pack_start: box %lx, widget %lx..)\n",box,child); - DebOut(" box->MuiObject, child->MuiObject: %lx,%lx\n",box->MuiObject,child->MuiObject); - - /* argl,== not = ..*/ - if(child->type == IS_MENUBAR) { - DebOut(" gtk_box_pack_start for IS_MENUBAR: faked\n"); - /* remember in child, to which menustrip it will belong */ - child->MuiWinMenustrip=mgtk->MuiRootStrip; /* TODO! */ - return; - } - - if(child->type == IS_OPTIONMENU) { - DebOut(" gtk_box_pack_start for IS_OPTIONMENU\n"); - mgtk_optionmenu_pack(box, child, expand, fill, padding); - return; - } - - /* expand: TRUE if the new child is to be given extra space - allocated to box. The extra space will be divided - evenly between all children of box that use this option. - fill.: TRUE if space given to child by the expand option is - actually allocated to child, rather than just padding it. - This parameter has no effect if expand is set to FALSE. - A child is always allocated the full height of a GtkHBox - and the full width of a GtkVBox. - This option affects the other dimension. - padding.: extra space in pixels to put between this child - and its neighbors, over and above the global amount - specified by spacing in GtkBox-struct. If child is a - widget at one of the reference ends of box, then - padding pixels are also put between child and the - reference edge of box. - */ - - if(!expand) { - fill=TRUE; - } - - if((!fill) || (!expand)) { - WarnOut("gtk_box_pack_start: expand=%d, fill=%d ignored\n",expand, fill); - } - - if(box->type != IS_GROUP) { - WarnOut("gtk_box_pack_start called on non box !?\n"); - } - - DoMethod(box->MuiObject,MUIM_Group_InitChange); - if(padding) { - if(box->columns) { - DoMethod(box->MuiObject,OM_ADDMEMBER,HSpace(padding)); - } - else { - DoMethod(box->MuiObject,OM_ADDMEMBER,VSpace(padding)); - } - } - DoMethod(box->MuiObject,OM_ADDMEMBER,child->MuiObject); - if(padding) { - if(box->columns) { - DoMethod(box->MuiObject,OM_ADDMEMBER,HSpace(padding)); - } - else { - DoMethod(box->MuiObject,OM_ADDMEMBER,VSpace(padding)); - } - } - DoMethod(box->MuiObject,MUIM_Group_ExitChange); - - mgtk_add_child(box,child); - return; -} - -void gtk_box_pack_end(GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding ) { - - DebOut("gtk_box_pack_end: box %lx, widget %lx ..\n",box,child); - -#warning gtk_box_pack_end just calls gtk_box_pack_start - - WarnOut("gtk_box_pack_end just calls gtk_box_pack_start\n"); - - gtk_box_pack_start(box,child,expand,fill,padding); - - return; -} - -void gtk_main_quit (void) { - gtk_do_main_quit=1; -} - -void gtk_widget_destroy( GtkWidget *widget/*, GtkWidget *causingwidget*/ ) { - GSList *gl; - gl=mgtk->windows; - - DebOut("gtk_widget_destroy(%lx)\n",widget); - if(widget->type == IS_WINDOW) { - DebOut(" widget->type == IS_WINDOW\n"); - /* if more than one window is possible, check if this is the last.\n");*/ - if(g_slist_length(gl)>1) { - DebOut("WARNING: gtk_widget_destroy: we only hide the window (TODO)\n"); - set(mgtk->MuiRoot,MUIA_Window_Open,FALSE); - /*MUI_DisposeObject(mgtk->MuiApp);*/ - gl=g_slist_remove(gl,widget); - mgtk->windows=gl; - } - else { - DebOut(" this was the last window\n"); -/* mgtk_call_destroy_hooks(widget);*/ - g_signal_emit(widget,g_signal_lookup("destroy",0),0); - gtk_main_quit(); - } - return; - } - - if(widget->type == IS_FILESEL) { - DebOut(" widget->type == IS_FILESEL\n"); - widget->active=0; - gl=g_slist_remove(gl,widget); - mgtk->windows=gl; - - return; - } - - if (widget->mainclass == CL_AREA) - { - APTR parent = _parent(widget->MuiObject); - - if (parent) - { - DoMethod(parent, MUIM_Group_InitChange); - DoMethod(parent, OM_REMMEMBER, parent); - DoMethod(parent, MUIM_Group_ExitChange); - } - - MUI_DisposeObject(widget->MuiObject); - #warning how to destroy widget? how? damn... - } - - DebOut("widget->type == %ld\n",widget->type); - /*DebOut("causingwidget->type == %ld\n",causingwidget->type);*/ -} - -/* does not work !? */ -void gtk_widget_set_size_request(GtkWidget *widget, - gint width, - gint height) { - DebOut("gtk_widget_set_size_request(%lx,%ld,%ld)\n",widget,width,height); - -/*gtk_widget_set_size_request is disabled in parts.. */ -#if 0 - if(widget->type == IS_WINDOW) { - DebOut("MuiWin: %lx\n",widget->MuiWin); - - SetAttrs(widget->MuiObject, - MA_RootGroup_DefWidth, width, - MA_RootGroup_DefHeight, height, - TAG_DONE); - } - else { - printf(" gtk_widget_set_size_request on non window!?\n"); - if(width>0) { - SetAttrs(widget->MuiObject,MUIA_FixWidth,width, TAG_DONE); - g_object_set_data(widget,"MUIA_FixWidth",GINT_TO_POINTER(width)); - } - if(height>0) { - SetAttrs(widget->MuiObject,MUIA_FixHeight,height, TAG_DONE); - g_object_set_data(widget,"MUIA_FixHeight",GINT_TO_POINTER(height)); - } - } -#endif - - /* if MUI object doesnt support this... too bad - ** however using MUIA_FixWidth/MUIA_FixHeight is not sufficient - */ - - SetAttrs(widget->MuiObject, - MA_DefWidth, width, - MA_DefHeight, height, - TAG_DONE); -} - - -/* Deprecated: Use gtk_widget_set_size_request() instead. */ -void gtk_widget_set_usize(GtkWidget *widget, gint width, gint height) { - - DebOut("gtk_widget_set_usize(%lx,%d,%d)\n",widget,width,height); - - gtk_widget_set_size_request(widget,width,height); -} - -/* not perfect.. */ -void gtk_widget_grab_default (GtkWidget *widget) { - - DebOut("gtk_widget_grab_default(%lx)\n",widget); - DebOut(" disabled\n"); - - // only area class objects can become default objects -/* - DebOut(" muiobj: %lx\n",widget->MuiObject); - - if (widget->mainclass == CL_AREA && _win(widget->MuiObject)) - { - set(_win(widget->MuiObject), MUIA_Window_DefaultObject, (ULONG)widget->MuiObject); - } - else - { - WarnOut("gtk_widget_grab_default(): not in window or object is wrong type\n"); - } - */ - - return; -} - -void gtk_widget_set_state(GtkWidget *widget, GtkStateType state) { - - DebOut("gtk_widget_set_state(%lx,%d)\n",widget,state); - - switch(state) { - case GTK_STATE_NORMAL: - if(widget->MuiObject) { - set(widget->MuiObject,MUIA_Selected,(ULONG) FALSE); - } - return; - case GTK_STATE_ACTIVE: - case GTK_STATE_SELECTED: - if(widget->MuiObject) { - set(widget->MuiObject,MUIA_Selected,(ULONG) TRUE); - } - return; - case GTK_STATE_PRELIGHT: - return; - case GTK_STATE_INSENSITIVE: - gtk_widget_set_sensitive(widget,FALSE); - return; - } -} - -void gtk_widget_unref(GtkWidget *widget) { - DebOut("gtk_widget_unref(%lx) is just a fake\n",widget); - return; -} - -GtkWidget *gtk_widget_ref(GtkWidget *widget) { - DebOut("gtk_widget_ref(%lx) is just a fake\n",widget); - return (GtkWidget *) widget; -} - -#include -gpointer gtk_type_class(GtkType type) { - - GtkWidgetClass *ret; - - DebOut("gtk_type_class(%ld)\n",type); - - DebOut("WARNING: gtk_type_class is just a dummy returning empty Class\n"); - - if(type != 0) { - DebOut("WARNING: unkown widget type %d supplied to gtk_type_class\n"); - } - ret=g_new(GtkWidgetClass,1); - - return ret; -} - -/* gtk_widget_get_type() returns the type code for GtkWidget. */ -GType gtk_widget_get_type(void) { - - DebOut("gtk_widget_get_type()\n"); - DebOut("WARNING: gtk_widget_get_type is just a dummy,but should be ok \n"); - - return (GType) 0; /* we only have one GType at the moment, widgets */ - - /* "The GType API is the foundation of the GObject system. It - * provides the facilities for registering and managing all - * fundamental data types, user-defined object and interface types. " - */ -} - -GtkObject* GTK_OBJECT(APTR widget) { - return (GtkObject *) widget; -} - -/* well, maybe a function to set the events would be - * more usefull ;) - */ -gint gtk_widget_get_events(GtkWidget *widget) { - - DebOut("gtk_widget_get_events(%lx)\n",widget); - - return widget->gdkevents; -} - -GdkVisual *gtk_widget_get_visual(GtkWidget *widget) { - - DebOut("gtk_widget_get_visual(%lx)\n",widget); - - if(!widget->visual) { - widget->visual=g_new(GdkVisual,1); - } - - /* we might need that! */ - widget->visual->mgtk_widget=(int *) widget; - - return widget->visual; -} - -GdkColormap *gtk_widget_get_colormap(GtkWidget *widget) { - - DebOut("gtk_widget_get_colormap(%lx)\n",widget); - - if(!widget->style) { - DebOut("WARNING: widget has no style\n"); - return NULL; - } - - return widget->style->colormap; -} - -void gtk_widget_queue_draw(GtkWidget *widget) { - DebOut("gtk_widget_queue_draw(%lx)\n"); - - if(widget->MuiObject) { - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - } - else { - DebOut(" WARNING: gtk_widget_queue_draw called on non MUI widget, what to do?n"); - } -} - -void gtk_widget_style_get(GtkWidget *widget, const gchar *first_property_name, ...) { - - DebOut("gtk_widget_style_get(%lx,..)\n",widget); - - DebOut("WARNING: Just a dummy\n"); -} - -/* Sets the GtkStyle for a widget (widget->style). You probably - * don't want to use this function; it interacts badly with - * themes, because themes work by replacing the GtkStyle. - */ -void gtk_widget_set_style(GtkWidget *widget, GtkStyle *style) { - - DebOut("gtk_widget_set_style(%lx,%lx)\n",widget,style); - - if(!style) { - DebOut(" style is NULL => set default style\n"); - widget->style=mgtk_get_default_style(mgtk->MuiRoot); - } - else { - widget->style=style; - g_object_ref(G_OBJECT(style)); - } -} - -/* gtk_widget_set_rc_style is deprecated and should not be - * used in newly-written code. - */ -void gtk_widget_set_rc_style(GtkWidget *widget) { - - DebOut("gtk_widget_set_rc_style(%lx)\n",widget); - - gtk_widget_set_style(widget,NULL); -} diff --git a/mui/gtk-mui/gtk-mui.notes b/mui/gtk-mui/gtk-mui.notes deleted file mode 100644 index 0b8fcd172..000000000 --- a/mui/gtk-mui/gtk-mui.notes +++ /dev/null @@ -1,210 +0,0 @@ -$Id: gtk-mui.notes,v 1.53 2005/12/12 17:22:17 itix Exp $ - -2005-12-12 Ilkka Lehtoranta - - * classes/custom.c: On failure CoerceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. - * classes/timer.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. - * classes/fixed.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. - * classes/button.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. Removed - unnecessary string duplication. - * classes/spinbutton.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. - * classes/checkbutton.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. Removed - unnecessary string duplication. - * classes/togglebutton.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. - * classes/radiobutton.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. Removed - unnecessary string duplication. - * classes/toolbar.c: On failure CoreceMethod() was not called causing - permanent memory loss. Reorganized for GCC2 compatibility. - * gdk/gdkconfig.h, gdk/gdkmui.c, dgk/gdkmui.h, gdk/gdk_draw.c: Added support - for true color rendering. Modify sources (gdkmui.c) and gdkconfig.h - according to your OS's capabilities. - * gtk-mui.c, gtk_init.c, gtk_style.c, classes/rootgroup.c, gtk/gtk.h: Changed - behaviour of default style initialization. The structure is now allocated - before initializing gtkmui app but style is updated when window is opened - or MUI preferences change. - -2005-12-04 Oliver Brunner - - * SORRY, made a big mistake, commited files without - checking if newer versions have been commited. - Tried to fix it manually, please check. - * added missing files from my build tree - * added examples dir - -2005-12-03 Oliver Brunner - - * many updates, see this as a first beta version - -2005-11-10 Oliver Brunner - - * gtk/gtkrange.h: added - * gtk_init.c: added changed signal - * gtk_scrollbar.c: removed compiler warnings, added range functions - * gdk/gdkevents.h: added - * gtk/gtksettings.h: added - * gtk_style.c: gtk_rc_get_style_by_paths done - -2005-11-09 Oliver Brunner - - * fixed random crash bug (g_object_unref..) - * removed many compiler warnings - * gdk/gdkgc.c added - * some smaller gtk bounty functions added - -2005-11-07 Oliver Brunner - - * added gtk_paint functions - * added gdk functions - -2005-11-03 Oliver Brunner - - * implemented GTK styles stubs - * gdk/gdkgc.h added - -2005-11-02 Oliver Brunner - - * fixed all g_new calls (lot of memory useless allocated) - * gtk_paint_polygon/gdk_draw_line done - * custom widget realize and size_allocate hooks work now - -2005-10-28 Oliver Brunner - - * custom widget size request works now - -2005-10-27 Oliver Brunner - - * lot of changes, to implement custom widgets better - * added lot of headers for gdk, glib and pango - * cleaned up headers (a little bit) - * added dummy functions to make dial example compile - * gtk_style.c: Stubs for Styles - * gtk_grab.c: Stubs for Grabs - * gtk_paint.c: Dummy stubs for paint ops - -2005-10-20 Oliver Brunner - - * classes/button.c: bugfix - * old signal code removed, many small fixes - * g_signal_connect moved to glib/gsignals.c - * glib/gstrfuncs2.c: use those functions with care, they are - very fast hacks, that don't work in many cases - -2005-10-19 Oliver Brunner - - * classes/button.c: Buttons have a MUI custom class now, - and emit pressed, released and clicked signals - * gtk_button.c: uses custom class now - * gtk_init.c: init pressed, released and clicked signals - -2005-10-17 Oliver Brunner - - * multiple fixes/changes - * fixed widget done - * first GTK custom widget works (tictactoe) - * added custom signals - * checkbutton: now has a custom class - * toggled signal now done via register_signal/emit_signal (new style) - * radiobutton: now has a custom class - -2005-09-29 Oliver Brunner - - * progressbar: activity mode added - -2005-09-22 Oliver Brunner - - * progressbar: added set/gettext - * timer: added remove timer - -2005-09-21 Oliver Brunner - - * classes/timer.c: new timer class - * classes/progressbar.c: new progress bar class - * gtk_timer.c: gtk timer functions added - * gtk_progressbar.c: gtk progressbar functions added - * Makefile.AROS: new files added - -2005-09-19 Oliver Brunner - - * gtk_notebook.c: added new functions - -2005-09-14 Oliver Brunner - - * returned from vacation ;) - * classes/spinbutton.c: debugged spinbutton - * gtk-mui.c: added padding - * classes/notebook.c: added notebook class - * gtk_notebook.c: added Notebook widget - * classes/table.c: enabled itix's table class from 2005-08-06 - -2005-08-19 Oliver Brunner - - * all memory allocations are done through g_new now - * lots of compiler warnings removed (classes/ still missing) - * added glib/gstrfuncs.h - * gtk_label.c: text now can be changed through gtk calls - * classes/spinbutton.c: now my class works, added to init etc. - -2005-08-12 Oliver Brunner - - * classes/spinbutton.c: maybe a custom class is better, - my first custom class, still buggy of course ;) - -2005-08-11 Oliver Brunner - - * gtk_globals: added gtk_do_main_quit - * gtk_checkbutton.c/gtk_entry.c: moved functions - * gtk-mui.c: silenced gcc - * gtk_init.c: MUIA_Application_Title is now argv[0] - -2005-08-10 Oliver Brunner - - * classes/rootgroup.c: fixed NULL pointer access - * gtk_checkbutton.c: gtk_entry_set_visibility sets MUIA_String_Secret - now. Does not seem to work.. - * Makefile.AROS: Makefile for AROS, builds library and some examples - -2005-08-08 Ilkka Lehtoranta - - * classes/classes.h, classes/rootgroup.c, classes/table.c: simplified - MUI dispatcher. - -2005-08-06 Ilkka Lehtoranta - - * src/gtk-mui.c: added mgtk_allocvec() and mgtk_freevec() to get some - temporary memory. - * classes/table.c: added preliminary table class to replace functionality in - gtk_table.c - * classes/classext.c: custom class helper functions - * src/gtk-mui.c: added mgtk_allocmem() and mgtk_allocmem() - -2005-08-05 Ilkka Lehtoranta - - * src/gtk_arrow.c: shortened code considerably, added MUIA_CycleChain - * src/gtk_#?.c: added MUIA_CycleChain where applicable - -2005-08-05 Oliver Bunner - - * src/gtk*.c: moved all mui*.h includes to mui.h - * src/classes/rootclass.c: DISPATCHER failed to compile under gcc2.9/aos3, - replaced with explicit code - * src/gtk_init.c: aos3 fixes - -2005-08-04 Ilkka Lehtoranta - - * src/gtk_window.c: Toggle resizing gadget properly when window is open - * src/gtk_window.c: Added gtk_window_get_resizable() - * src/gtk.h: Added an identifier for major MUI class (area, window, family) - * src/gtk-mui.c: gtk_widget_show() now supports area class objects - * src/gtk-mui.c: added gtk_widget_hide(), gtk_widget_set_sensitive(), - gtk_widget_show_all(), gtk_widget_hide_all() - * src/classes/rootgroup.c: Takes care of window sizing and resizing feature - * src/gtk-mui.c: gtk_widget_destroy() can destroy normal area class objects too - diff --git a/mui/gtk-mui/gtk.h b/mui/gtk-mui/gtk.h deleted file mode 100644 index 228eb4f60..000000000 --- a/mui/gtk-mui/gtk.h +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -/* - * gtk.h moved to gtk/gtk.h - * - * this is just for compatibility at the moment - */ - -#ifndef MGTK_HAVE_GTK_H - -#include - -#endif /*MGTK_HAVE_GTK_H */ diff --git a/mui/gtk-mui/gtk/gtk.h b/mui/gtk-mui/gtk/gtk.h deleted file mode 100644 index b9e3eb961..000000000 --- a/mui/gtk-mui/gtk/gtk.h +++ /dev/null @@ -1,1096 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#ifndef MGTK_HAVE_GTK_H -#define MGTK_HAVE_GTK_H 1 - -#include -#include -#include -#include -#include - -#include -#include -#include - -/* internal GTK-MUI defines */ -#define BADMAGIC 0xDEADBEEF; - -/* Pens used for GTK styles */ -#define MGTK_PEN_FG TEXTPEN -#define MGTK_PEN_BG BACKGROUNDPEN -#define MGTK_PEN_LIGHT SHADOWPEN -#define MGTK_PEN_DARK TEXTPEN -#define MGTK_PEN_MID TEXTPEN -#define MGTK_PEN_TEXT TEXTPEN -#define MGTK_PEN_BASE BACKGROUNDPEN -#define MGTK_PEN_TEXT_AA TEXTPEN - -#define MGTK_PEN_WHITE SHINEPEN -#define MGTK_PEN_BLACK TEXTPEN - -/* GLIB */ -#include - -/*typedef TimeVal GTimeVal ;*/ -#define G_GNUC_CONST -#define GDestroyNotify gint - -typedef struct _GClosure GClosure; -struct _GClosure { - int foo; - /* only glib private stuff in here */ -}; - -#include - -typedef struct _GError GError; -struct _GError -{ - int badmagic; - char *message; -}; - -typedef struct _GList GList; - -struct _GList -{ - gpointer data; - GList *next; - GList *prev; -}; - - -#ifndef HAVE_GSLIST_DEFINED -#define HAVE_GSLIST_DEFINED 1 -typedef struct _GSList GSList; - -struct _GSList -{ - gpointer data; - GSList *next; -}; -#endif - - -/* GTK */ - -typedef void (*GCallback) (void); -typedef void (*GtkSignalFunc) (void); -typedef void (*GSourceFunc) (void); -typedef void (*GtkFunction) (void); -typedef void (*GClosureNotify) (gpointer data, - GClosure *closure); -typedef void (*GtkDestroyNotify) (gpointer data, - GClosure *closure); - -typedef gpointer GtkCallbackMarshal; /* dummy only */ - -gchar* g_strdup (const gchar *str); - -APTR mgtk_allocvec(ULONG size, ULONG req); -VOID mgtk_freevec (APTR ptr); -APTR mgtk_allocmem(ULONG size, ULONG req); -VOID mgtk_freemem (APTR ptr, ULONG size); - -#define g_new(type, count) \ - ((type *) mgtk_malloc ((unsigned) sizeof (type) * (count))) - -#define g_new0(type, count) \ - ((type *) mgtk_malloc ((unsigned) sizeof (type) * (count))) - - -#define g_print printf -#define g_signal_connect(instance, detailed_signal, c_handler, data) \ - g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), \ - NULL, (GConnectFlags) 0) -#define g_signal_connect_swapped(instance, detailed_signal, c_handler, data) \ - g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED) -#define G_CALLBACK(f) ((GCallback) (f)) - -#define gtk_signal_lookup(name,object_type) \ - g_signal_lookup ((name), (object_type)) -#define gtk_signal_name(signal_id) \ - g_signal_name (signal_id) -#define gtk_signal_emit_stop(object,signal_id) \ - g_signal_stop_emission ((object), (signal_id), 0) -#define gtk_signal_connect(object,name,func,func_data) \ - gtk_signal_connect_full ((object), (name), (func), 0, (func_data), 0, 0, 0) -#define gtk_signal_connect_after(object,name,func,func_data) \ - gtk_signal_connect_full ((object), (name), (func), 0, (func_data), 0, 0, 1) -#define gtk_signal_connect_object(object,name,func,slot_object) \ - gtk_signal_connect_full ((object), (name), (func), 0, (slot_object), 0, 1, 0) -#define gtk_signal_connect_object_after(object,name,func,slot_object) \ - gtk_signal_connect_full ((object), (name), (func), 0, (slot_object), 0, 1, 1) -#define gtk_signal_disconnect(object,handler_id) \ - g_signal_handler_disconnect ((object), (handler_id)) - - -/* all checks disabled ;) */ -#define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip) - -#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) -#define G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject)) -#define GTK_CHECK_CAST(tobj, cast_type, cast) ((cast*) (tobj)) -#define g_return_if_fail(expr) { (void)0; } -#define g_return_val_if_fail(expr,val) { (void)0; } - -/* bad hack, of course ;) */ -/* see glib-2.0/gobject/gmarshal.h .. */ -#define g_cclosure_marshal_VOID__VOID NULL - -#define g_print printf - -/* from gaim/internal.h*/ -#define N_(String) (String) -#define _(x) (x) - -/* normally in limits.h */ -#define MB_LEN_MAX 6 - -typedef enum -{ - CL_UNDEFINED, - CL_FAMILY, - /* CL_APPLICATION, */ /* not possible */ - CL_WINDOW, - CL_AREA, - CL_OTHER, /* really undefined */ -} mgtkMUIClass; - -typedef struct { - char *key; - gpointer value; - struct internalGObject *next; -} internalGObject; - -typedef struct _mgtk_signal_connect_data mgtk_signal_connect_data; -struct _mgtk_signal_connect_data{ - gchar *detailed_signal; - guint id; - GCallback c_handler; /* callback*/ - gpointer data; - GClosureNotify destroy_data; - GConnectFlags connect_flags; - mgtk_signal_connect_data *next; -}; - -typedef struct { - guint type; - guint id; - gchar *name; - APTR next; -} mgtk_SignalType; - -/*gdk */ - -typedef struct _GObject GObject; -typedef struct _GObject GtkObject; - -struct _GObject { - /* GObject parentstuff;*/ - /* internal attributes */ - int badmagic; - /* GLIB */ - struct internalGObject *gobjs; - guint ref_count; -}; - -#include -#include -#include -#include - -typedef struct _GdkDevice GdkDevice; -struct _GdkDevice -{ -/* GObject parent_instance;*/ - /* All fields are read-only */ - - gchar *name; - /* don't care about the rest for now ;) */ -}; - - -typedef enum -{ - GDK_DRAG_PROTO_MOTIF, - GDK_DRAG_PROTO_XDND, - GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming - * drags */ - GDK_DRAG_PROTO_NONE, /* Not a valid drag window */ - GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */ - GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */ - GDK_DRAG_PROTO_LOCAL /* Intra-app */ -} GdkDragProtocol; - -typedef enum -{ - GDK_ACTION_DEFAULT = 1 << 0, - GDK_ACTION_COPY = 1 << 1, - GDK_ACTION_MOVE = 1 << 2, - GDK_ACTION_LINK = 1 << 3, - GDK_ACTION_PRIVATE = 1 << 4, - GDK_ACTION_ASK = 1 << 5 -} GdkDragAction; - -typedef struct _GdkDragContext GdkDragContext; -struct _GdkDragContext { - /* GObject parent_instance;*/ - - /*< public >*/ - - GdkDragProtocol protocol; - - gboolean is_source; - - GdkWindow *source_window; - GdkWindow *dest_window; - - GList *targets; - GdkDragAction actions; - GdkDragAction suggested_action; - GdkDragAction action; - - guint32 start_time; - - /*< private >*/ - - gpointer windowing_data; -}; - -#include - -/* GTK */ -typedef enum -{ - GTK_TOPLEVEL = 1 << 4, - GTK_NO_WINDOW = 1 << 5, - GTK_REALIZED = 1 << 6, - GTK_MAPPED = 1 << 7, - GTK_VISIBLE = 1 << 8, - GTK_SENSITIVE = 1 << 9, - GTK_PARENT_SENSITIVE = 1 << 10, - GTK_CAN_FOCUS = 1 << 11, - GTK_HAS_FOCUS = 1 << 12, - GTK_CAN_DEFAULT = 1 << 13, - GTK_HAS_DEFAULT = 1 << 14, - - GTK_HAS_GRAB = 1 << 15, - GTK_RC_STYLE = 1 << 16, - GTK_COMPOSITE_CHILD = 1 << 17, - GTK_NO_REPARENT = 1 << 18, - GTK_APP_PAINTABLE = 1 << 19, - GTK_RECEIVES_DEFAULT = 1 << 20, - GTK_DOUBLE_BUFFERED = 1 << 21, - GTK_NO_SHOW_ALL = 1 << 22 -} GtkWidgetFlags; - - - -#include - -/*************************************************** - * GtkWidget - * - * Every GTK Object uses the following struct - ***************************************************/ -#include - -#ifndef GtkWidget -typedef struct _GtkWidget GtkWidget; -#endif - -#include -#include - -struct _GtkWidget { - GObject object; - - int type; - GtkWidget *parent; - APTR MuiWin; /* if !IS_WINDOW, this points to the MUI root Window (TODO) */ - APTR MuiWinMenustrip; - APTR MuiGroup; - Object *MuiObject; - /*** GTK attributes ***/ - /* stuff to clean up ;): */ - GSList *GSList; /* for radio buttons and more */ - mgtk_signal_connect_data *mgtk_signal_connect_data; /* if you want to add a signal later */ - mgtkMUIClass mainclass; /* main class tree (area, window, application), defines what kind of tags and methods are available */ - - /*** GTK attributes ***/ - GtkStateType state; - GtkWidgetFlags flags; - /*** official GTK Widget attributes ***/ - /* The style for the widget. The style contains the - * colors the widget should be drawn in for each state - * along with graphics contexts used to draw with and - * the font to use for text. - */ - GtkStyle *style; - /* The widgets allocated size. */ - GtkAllocation allocation; - /* The widgets window or its parent window if it does - * not have a window. (Which will be indicated by the - * GTK_NO_WINDOW flag being set). - */ - GdkWindow *window; - /* at the moment, not used */ - GdkEventMask gdkevents; - /* stuff to clean up ;): */ - gchar *title; - gchar *tip_text; /* tooltip */ - int rows; /* table stuff */ - int columns; - int text_length; /* for entry */ - int active; /* for checkboxes, and windows */ - GtkWidget *nextObject; - guint draw_value; /* sliders: non-zero if the scale's current value is displayed next to the slider.*/ - guint value_pos; /* sliders: the position in which the textual value is displayed, selected from GtkPositionType.*/ - guint decimalplaces; /* sliders: the number of decimal places to display, 1 to display 1.0, 2 to display 1.00 etc.*/ - guint digits; /* spin buttons */ - gboolean wrap; /* spin buttons */ - gdouble lower; /* adjustment start */ - gdouble upper; - gdouble value; - gdouble step_increment; - gdouble page_increment; - gdouble page_size; /*adjustment stop */ - guint tab_pos; /* notebook */ - guint show_tabs; /* notebook */ - guint show_border; /* notebook */ - GtkWidget *ok_button; /* file selection */ - GtkWidget *cancel_button; /* file selection */ - /* internal ones ? */ - GdkVisual *visual; - GtkWidgetClass *class; -}; - - -typedef struct { - GType type_id; - gchar *type_name; - guint16 instance_size; - GtkWidget *(*newparentobject) (void); - GtkWidget *(*newobject) (void); - GtkWidgetClass *class; - APTR next; -} mgtk_Fundamental; - -/*************************************************** - * global data - ***************************************************/ -struct mgtk_ObjApp { - APTR MuiApp; - APTR MuiRoot; /* WindowObject */ - APTR MuiRootStrip; /* WindowObject Menu Strip*/ - APTR Group; /* GroupObject */ - GSList *windows; /* all GTK windows in a linked list */ - GtkWidget *grab; /* the widget getting all keystrokes.. TODO */ - guint mgtk_signal_count; - mgtk_SignalType *mgtk_signal; /* All GTK (custom) signals */ - GType mgtk_fundamental_count; - mgtk_Fundamental *mgtk_fundamental; /* All widget types */ - GtkStyle *default_style; - - #if USE_PENS - guint white_black_optained; - LONG white_pen; - LONG black_pen; - guint other_pens_optained; - struct Screen *screen; - struct DrawInfo *dri; - APTR visualinfo; - #endif - -// int winnr; -}; - -/* ATTENTION: take care in hooks.c, when you add!! */ -typedef enum { - IS_NULL, /* if type=IS_NULL, something is not initialized correctly */ - IS_WINDOW, - IS_GROUP, - IS_MENUBAR, /* 3 top level (not visible under AmigaOS) */ - IS_MENU, /* 4 menu (not visible) */ - IS_OPTIONMENU, /* 5 menu (not visible) */ - IS_MENUITEM, /* 6 menu item (menu item) */ - IS_TABLE, /* 7 */ - IS_TABLECELL, /* 8 */ - IS_ENTRY, /* 9 */ - IS_TOGGLEBUTTON, - IS_CHECKBUTTON, - IS_BUTTON, - IS_LABEL, - IS_IMAGE, - IS_RADIO, - IS_SEPARATOR, - IS_ARROW, - IS_SCROLLBAR, /* 18 */ - IS_ADJUSTMENT, /* (not visible under AmigaOS) */ - IS_TOOLTIPS, /* group of tooltips, not visible */ - IS_FILESEL, /* file selector, no MuiObject attached */ - IS_FILESEL_BUTTON, /* file selector button, no MuiObject attached */ - IS_FRAME, - IS_SPINBUTTON, - IS_NOTEBOOK, - IS_PROGRESS, - IS_FIXED, - IS_HANDLEBOX, - IS_TOOLBAR, - IS_SPACE, - IS_CUSTOM, - IS_LASTONE /* type=IS_LASTONE, something is not initialized correctly */ -} mgtkWidgetType; - -typedef enum -{ - GTK_MESSAGE_INFO, - GTK_MESSAGE_WARNING, - GTK_MESSAGE_QUESTION, - GTK_MESSAGE_ERROR -} GtkMessageType; - -#include - -typedef GtkWidget GtkWindow; -typedef GtkWidget GtkBox; -typedef GtkWidget GtkVBox; -typedef GtkWidget GtkMenu; -typedef GtkWidget GtkMenuShell; -typedef GtkWidget GtkMenuItem; -typedef GtkWidget GtkTable; -typedef GtkWidget GtkEntry; -typedef GtkWidget GtkEditable; -typedef GtkWidget GtkToggleButton; -typedef GtkWidget GtkContainer; -typedef GtkWidget GdkPixbuf; -typedef GtkWidget GtkTextBuffer; -typedef GtkWidget GtkRadioButton; -typedef GtkWidget GtkScale; -typedef GtkWidget GtkAdjustment; -/*typedef GtkWidget GtkRange;*/ -typedef GtkWidget GtkOptionMenu; -typedef GtkWidget GtkTooltips; -typedef GtkWidget GtkFileSelection; -typedef GtkWidget GtkFrame; -typedef GtkWidget GtkSpinButton; -typedef GtkWidget GtkNotebook; -typedef GtkWidget GtkProgressBar; -typedef GtkWidget GtkFixed; -typedef GtkWidget GtkHandleBox; -typedef GtkWidget GtkLabel; /*TODO*/ -typedef GtkWidget GtkButton; /*TODO*/ - - -#include -#include -#include -#include - -/* internal functions */ -ULONG xget(Object *obj, ULONG attr); -GtkWidget *mgtk_widget_new(int type); -int mgtk_add_child(GtkWidget *parent, GtkWidget *child); -void mgtk_initchange(GtkWidget *w); -void mgtk_exitchange(GtkWidget *w); -void *mgtk_malloc(int size); -void mgtk_radio_button_muify(GtkWidget *button); -Object *mgtk_get_mui_action_object(GtkWidget *widget); -void mgtk_call_destroy_hooks(GtkWidget *widget); -GType mgtk_g_type_register_fundamental(GType type_id, const gchar *type_name, GtkWidget *(*newobject) (void)); -mgtk_Fundamental *mgtk_g_type_get_fundamental(GType type_id); - -/* gtk functions */ -void gtk_init(int *argc, char ***argv); -GtkWidget* gtk_window_new (GtkWindowType type); -void gtk_window_set_title (GtkWindow *window, const gchar *title); -void gtk_window_set_resizable (GtkWindow *window, - gboolean resizable); - -gboolean gtk_window_get_resizable(GtkWindow *window); -GtkWidget* gtk_button_new (void); -GtkWidget* gtk_button_new_with_label (const char *label); -GtkWidget* gtk_button_new_from_stock (const gchar *stock_id); -void gtk_widget_show (GtkWidget *widget); -void gtk_widget_hide (GtkWidget *widget); -void gtk_widget_show_all(GtkWidget *widget); -void gtk_widget_hide_all(GtkWidget *widget); -void gtk_widget_grab_default (GtkWidget *widget); -void gtk_widget_set_sensitive(GtkWidget *widget, gboolean sensitive); -gint gtk_widget_get_events (GtkWidget *widget); -GdkVisual* gtk_widget_get_visual (GtkWidget *widget); -GdkColormap* gtk_widget_get_colormap (GtkWidget *widget); -GType gtk_widget_get_type(void); -void gtk_widget_queue_draw(GtkWidget *widget); -void gtk_widget_style_get (GtkWidget *widget, - const gchar *first_property_name, - ...); -void gtk_widget_set_rc_style(GtkWidget *widget); -void gtk_widget_set_style (GtkWidget *widget, - GtkStyle *style); -void gtk_widget_realize (GtkWidget *widget); -gpointer gtk_type_class (GtkType type); -#define GTK_TYPE_WIDGET (gtk_widget_get_type ()) -void gtk_grab_add (GtkWidget *widget); -void gtk_grab_remove (GtkWidget *widget); -GtkWidget* gtk_grab_get_current (void); -void gtk_main (void); -void gtk_main_quit (void); -void gtk_widget_destroy( GtkWidget *widget/*, GtkWidget *param*/ ); -void gtk_widget_unref(GtkWidget *widget); -GtkWidget *gtk_widget_ref(GtkWidget *widget); -void gtk_widget_set_size_request (GtkWidget *widget, - gint width, - gint height); -void gtk_widget_set_usize (GtkWidget *widget, - gint width, - gint height); -void gtk_widget_set_state (GtkWidget *widget, - GtkStateType state); -void gtk_container_add(GtkContainer *container, GtkWidget *widget); -void gtk_container_set_border_width (GtkContainer *container, guint border_width); -GtkWidget *gtk_hbox_new (gint homogeneous, gint spacing ); -GtkWidget *mgtk_hbox_new_noparams(); -GtkWidget *gtk_vbox_new (gint homogeneous, gint spacing ); -GType gtk_vbox_get_type (void); -void gtk_box_pack_start( GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding ); -void gtk_box_pack_end (GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding ); - -GtkWidget *gtk_menu_new (void); -GtkWidget *gtk_menu_bar_new (void); -GtkWidget *gtk_option_menu_new (void); -GtkWidget *gtk_menu_item_new_with_label (const char *label ); -GtkWidget *gtk_menu_item_new (); -void gtk_menu_shell_append (GtkMenuShell *menu_shell, GtkWidget *child); -void gtk_menu_item_set_submenu (GtkMenuItem *menu_item, - GtkWidget *submenu); -GtkWidget *gtk_menu_get_attach_widget (GtkMenu *menu); -void gtk_option_menu_set_menu(GtkOptionMenu *option_menu, GtkWidget *menu); - - -GtkWidget *gtk_table_new(guint rows, guint columns, gboolean homogeneous); -void gtk_table_attach_defaults (GtkTable *table, - GtkWidget *widget, - guint left_attach, - guint right_attach, - guint top_attach, - guint bottom_attach); -void gtk_table_attach( GtkTable *table, - GtkWidget *child, - guint left_attach, - guint right_attach, - guint top_attach, - guint bottom_attach, - GtkAttachOptions xoptions, - GtkAttachOptions yoptions, - guint xpadding, - guint ypadding ); -void gtk_table_set_row_spacings (GtkTable *table, - guint spacing); -void gtk_table_set_col_spacings (GtkTable *table, - guint spacing); -GtkWidget *gtk_entry_new( void ); -void gtk_entry_set_text( GtkEntry *entry, - const gchar *text ); -const gchar *gtk_entry_get_text( GtkEntry *entry ); -void gtk_entry_set_visibility( GtkEntry *entry, - gboolean visible ); -void gtk_entry_set_max_length (GtkEntry *entry, - gint max); -void gtk_editable_select_region( GtkEditable *entry, - gint start, - gint end ); -void gtk_editable_insert_text (GtkEditable *editable, - const gchar *new_text, - gint new_text_length, - gint *position); - -GtkWidget *gtk_toggle_button_new( void ); -GtkWidget *gtk_toggle_button_new_with_label( const gchar *label ); -GtkWidget *gtk_toggle_button_new_with_mnemonic( const gchar *label ); -gboolean gtk_toggle_button_get_active (GtkToggleButton *toggle_button); -void gtk_toggle_button_set_active( GtkToggleButton *toggle_button, - gboolean is_active ); - -GtkWidget* gtk_check_button_new (void); -GtkWidget* gtk_check_button_new_with_label (const gchar *label); -GtkWidget* gtk_check_button_new_with_mnemonic (const gchar *label); -void gtk_editable_set_editable (GtkEditable *editable, - gboolean is_editable); -gboolean gtk_editable_get_editable (GtkEditable *editable); -gchar* gtk_editable_get_chars (GtkEditable *editable, - gint start_pos, - gint end_pos); - -GtkWidget* gtk_image_new (void); -GtkWidget* gtk_image_new_from_file (const gchar *filename); -GSList *gtk_radio_button_group(GtkWidget *widget); -GSList *gtk_radio_button_get_group(GtkWidget *widget); -GtkWidget *gtk_radio_button_new_with_label_from_widget( GtkRadioButton *group, const gchar *label ); -GtkWidget *gtk_radio_button_new_with_label( GSList *group, const gchar *label ); -GtkWidget *gtk_arrow_new(GtkArrowType arrow_type, GtkShadowType shadow_type); -GtkWidget *gtk_hseparator_new(void); -GtkWidget *gtk_hscrollbar_new(GtkAdjustment *adjustment); -GtkWidget *gtk_hscale_new( GtkAdjustment *adjustment ); -GtkWidget *gtk_vscale_new( GtkAdjustment *adjustment ); -void gtk_scale_set_digits (GtkScale *scale, - gint digits); -void gtk_scale_set_value_pos(GtkScale *scale, GtkPositionType pos); -GtkAdjustment *gtk_adjustment_new(gdouble value, - gdouble lower, - gdouble upper, - gdouble step_increment, - gdouble page_increment, - gdouble page_size ); -void gtk_adjustment_set_value(GtkAdjustment *adjustment, gdouble value); -void gtk_adjustment_changed (GtkAdjustment *adjustment); -void gtk_range_set_update_policy (GtkRange *range, GtkUpdateType policy); -GtkTooltips* gtk_tooltips_new(void); -void gtk_tooltips_set_tip(GtkTooltips *tooltips, - GtkWidget *widget, - const gchar *tip_text, - const gchar *tip_private); -void gtk_tooltips_disable(GtkTooltips *tooltips); -void gtk_tooltips_enable(GtkTooltips *tooltips); -void gtk_tooltips_force_window(GtkTooltips *tooltips); -GtkWidget* gtk_file_selection_new (const gchar *title); -void gtk_file_selection_set_filename (GtkFileSelection *filesel, - const gchar *filename); -const gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); - -GtkWidget* gtk_frame_new (const gchar *label); -void gtk_frame_set_label (GtkFrame *frame, - const gchar *label); -void gtk_frame_set_label_align (GtkFrame *frame, - gfloat xalign, - gfloat yalign); -void gtk_frame_set_shadow_type (GtkFrame *frame, - GtkShadowType type); -GtkWidget* gtk_spin_button_new (GtkAdjustment *adjustment, - gdouble climb_rate, - guint digits); -gint gtk_spin_button_get_value_as_int - (GtkSpinButton *spin_button); -void gtk_spin_button_set_digits (GtkSpinButton *spin_button, - guint digits); -gdouble gtk_spin_button_get_value (GtkSpinButton *spin_button); -gdouble gtk_spin_button_get_value_as_float(GtkSpinButton *spin_button); -void gtk_spin_button_set_wrap (GtkSpinButton *spin_button, - gboolean wrap); -void gtk_spin_button_set_numeric (GtkSpinButton *spin_button, - gboolean numeric); -GtkWidget* gtk_label_new (const char *str); -void gtk_label_set_text (GtkLabel *label, - const char *str); -GtkWidget* gtk_notebook_new (void); -gint gtk_notebook_append_page (GtkNotebook *notebook, - GtkWidget *child, - GtkWidget *tab_label); -gint gtk_notebook_prepend_page (GtkNotebook *notebook, - GtkWidget *child, - GtkWidget *tab_label); -void gtk_notebook_next_page (GtkNotebook *notebook); -void gtk_notebook_prev_page (GtkNotebook *notebook); -GtkWidget* gtk_progress_bar_new (void); -const gchar* gtk_progress_bar_get_text (GtkProgressBar *pbar); -void gtk_progress_bar_set_text (GtkProgressBar *pbar, - const gchar *text); -gdouble gtk_progress_bar_get_fraction (GtkProgressBar *pbar); -GtkProgressBarOrientation gtk_progress_bar_get_orientation - (GtkProgressBar *pbar); -void gtk_progress_bar_pulse (GtkProgressBar *pbar); -void gtk_progress_bar_set_fraction (GtkProgressBar *pbar, - gdouble fraction); -void gtk_progress_bar_set_orientation - (GtkProgressBar *pbar, - GtkProgressBarOrientation orientation); - -guint g_timeout_add (guint interval, GSourceFunc function, gpointer data); -guint gtk_timeout_add (guint32 interval, GtkFunction function, gpointer data); -void gtk_timeout_remove (guint timeout_handler_id); -gboolean g_source_remove (guint tag); -GtkWidget* gtk_fixed_new (void); -void gtk_fixed_put (GtkFixed *fixed, - GtkWidget *widget, - gint x, - gint y); -void gtk_fixed_move (GtkFixed *fixed, - GtkWidget *widget, - gint x, - gint y); -gpointer gtk_type_class (GtkType type); - -GtkStyle* gtk_style_new (void); -GtkStyle* gtk_style_attach (GtkStyle *style, - GdkWindow *window); -void gtk_style_set_background (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type); -GtkStyle* gtk_rc_get_style_by_paths (GtkSettings *settings, - const char *widget_path, - const char *class_path, - GType type); -void mgtk_update_default_style (APTR obj); -GtkStyle* mgtk_get_default_style (Object *obj); -void gtk_paint_polygon (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GdkPoint *points, - gint npoints, - gboolean fill); -void gtk_paint_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_arrow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_check (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_extension (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side); -void gtk_paint_flat_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_focus (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_option (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_slider (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); -void gtk_paint_vline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint y1_, - gint y2_, - gint x); -void gtk_paint_hline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x1, - gint x2, - gint y); -GtkWidget* gtk_handle_box_new (void); -GtkWidget *mgtk_custom_new(); - -#define GTK_OBJECT_CLASS(n) ((GtkObjectClass *) n) -#define GTK_HANDLE_BOX(n) ((GtkHandleBox *) n) -#define GTK_SIGNAL_FUNC(f) ((GtkSignalFunc) (f)) - -GtkObject *GTK_OBJECT(APTR widget); -GtkContainer *GTK_CONTAINER(GtkWidget *widget); -GtkWindow *GTK_WINDOW(GtkWidget *widget); -GtkBox *GTK_BOX(GtkWidget *widget); -/*GtkWidget *GTK_WIDGET(APTR widget);*/ -GtkMenu *GTK_MENU(GtkWidget *widget); -GtkMenuShell *GTK_MENU_SHELL(GtkWidget *widget); -GtkMenuItem *GTK_MENU_ITEM(GtkWidget *widget); -GtkTable *GTK_TABLE(GtkWidget *widget); -GtkEditable *GTK_EDITABLE(GtkWidget *widget); -GtkEntry *GTK_ENTRY(GtkWidget *widget); -GtkToggleButton *GTK_TOGGLE_BUTTON(GtkWidget *widget); -GtkRadioButton *GTK_RADIO_BUTTON(GtkWidget *widget); -GtkScale *GTK_SCALE(GtkWidget *widget); -GtkOptionMenu *GTK_OPTION_MENU(GtkWidget *widget); -//GtkRange *GTK_RANGE(GtkWidget *widget); -GtkTooltips *GTK_TOOLTIPS(GtkWidget* widget); -GtkFileSelection *GTK_FILE_SELECTION(GtkWidget* widget); -GtkFrame *GTK_FRAME(GtkWidget* widget); -GtkSpinButton *GTK_SPIN_BUTTON(GtkWidget* widget); -GtkLabel *GTK_LABEL(GtkWidget* widget); -GtkNotebook *GTK_NOTEBOOK(GtkWidget* widget); -GtkProgressBar *GTK_PROGRESS_BAR(GtkWidget* widget); -GtkFixed *GTK_FIXED(GtkWidget* widget); - -void GTK_WIDGET_SET_FLAGS (GtkWidget *widget, gint flags); - -int GTK_IS_MENU(GtkWidget *widget); - -/*#define GTK_ENTRY(a) a*/ - -/* -void GLADE_HOOKUP_OBJECT(GtkWidget *a,GtkWidget *b,gchar *foo); -void GLADE_HOOKUP_OBJECT_NO_REF(GtkWidget *a,GtkWidget *b,gchar *foo); -*/ - -#define GTK_CHECK_VERSION(major,minor,micro) 1 -#define GINT_TO_POINTER(i) ((gpointer) (i)) -#define GPOINTER_TO_INT(p) ((gint) (p)) - -/* GLIB */ -#define g_warning printf - -gulong g_signal_connect_data(gpointer instance, - const gchar *detailed_signal, - GCallback c_handler, - gpointer data, - GClosureNotify destroy_data, - GConnectFlags connect_flags); - -guint g_signal_handlers_disconnect_by_func(gpointer instance, GCallback func, gpointer data); - -void g_object_set_data(GObject *object, - const gchar *key, - gpointer data); - -void g_object_set_data_full(GObject *object, - const gchar *key, - gpointer data, - GDestroyNotify destroy); - -gpointer g_object_get_data(GObject *object, - const gchar *key); -GObject* g_object_ref (GObject *object); -void g_object_unref (GObject *object); - -void g_free (gpointer mem); -void g_error_free(GError **error); -gchar* g_build_filename (const gchar *first_element, va_list args); - -/* -typedef struct _GdkPixbuf GdkPixbuf; -struct GdkPixbuf -{ - int priv; -}; -*/ - - -#include - -#include -#include -#include -#include - -GdkPixbuf* gdk_pixbuf_new_from_file(const char *filename, GError **error); - -/* gnome */ -#define PACKAGE "GTK-MUI" -#define VERSION "0.0666" -#define LIBGNOMEUI_MODULE NULL -#define GNOME_PARAM_APP_DATADIR "PROGDIR:" -#define GNOME_FILE_DOMAIN_APP_PIXMAP "PROGDIR:" -#define PACKAGE_DATA_DIR "PROGDIR" - -typedef struct { - const char *name; - const char *version; - const char *description; -/* GnomeModuleRequirement *requirements; - - GnomeModuleHook instance_init; - GnomeModuleHook pre_args_parse, post_args_parse; - - struct poptOption *options; - - GnomeModuleInitHook init_pass; - - GnomeModuleClassInitHook class_init;*/ - - const char *opt_prefix; - gpointer expansion1; -} GnomeModuleInfo; - -/* -void gnome_program_init (const char *app_id, - const char *app_version, - const GnomeModuleInfo *module_info, - int argc, - char **argv, - const char *first_property_name, - ...); -*/ - -/* maybe wrong parameters..*/ -#define gnome_program_init(a,b,c,argc,argv,f,g,h) gtk_init(&argc,&argv) - -/*ATK*/ -typedef struct _AtkAction AtkAction; -typedef struct { - int badmagic; -} _AtkAction; - - -/* mui */ -#ifndef __AROS__ -#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) -#endif - -#include -#include -#include - -gpointer g_object_new (GType object_type, - const gchar *first_property_name, - ...); -GType g_type_register_static (GType parent_type, - const gchar *type_name, - const GTypeInfo *info, - GTypeFlags flags); -void g_signal_emit (gpointer instance, - guint signal_id, - GQuark detail, - ...); -void g_signal_emit_by_name (gpointer instance, - const gchar *detailed_signal, - ...); -#define g_signal_handlers_unblock_by_func(instance, func, data) /*?*/ -#define g_signal_handlers_block_by_func(instance, func, data) -typedef void (*GClosureMarshal) (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -typedef GClosureMarshal GSignalCMarshaller; - -typedef struct _GSignalInvocationHint GSignalInvocationHint; - -struct _GSignalInvocationHint -{ - int foo; /* TODO */ -}; - - -typedef gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint, - GValue *return_accu, - const GValue *handler_return, - gpointer data); - -guint g_signal_new (const gchar *signal_name, - GType itype, - GSignalFlags signal_flags, guint class_offset, - GSignalAccumulator accumulator, - gpointer accu_data, - GSignalCMarshaller c_marshaller, - GType return_type, - guint n_params, - ...); -guint g_signal_lookup (const gchar *name, - GType itype); - -#endif /*MGTK_HAVE_GTK_H */ diff --git a/mui/gtk-mui/gtk/gtkadjustment.h b/mui/gtk-mui/gtk/gtkadjustment.h deleted file mode 100644 index c7ec6ca5d..000000000 --- a/mui/gtk-mui/gtk/gtkadjustment.h +++ /dev/null @@ -1,105 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_ADJUSTMENT_H__ -#define __GTK_ADJUSTMENT_H__ - -/* -#include -#include -*/ - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -#define GTK_TYPE_ADJUSTMENT (gtk_adjustment_get_type ()) -#define GTK_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ADJUSTMENT, GtkAdjustment)) -#define GTK_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ADJUSTMENT, GtkAdjustmentClass)) -#define GTK_IS_ADJUSTMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ADJUSTMENT)) -#define GTK_IS_ADJUSTMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ADJUSTMENT)) -#define GTK_ADJUSTMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ADJUSTMENT, GtkAdjustmentClass)) - - -typedef struct _GtkAdjustmentClass GtkAdjustmentClass; - -/* -typedef struct _GtkAdjustment GtkAdjustment; -struct _GtkAdjustment -{ - *GtkObject parent_instance;* - APTR parent_instance; - - gdouble lower; - gdouble upper; - gdouble value; - gdouble step_increment; - gdouble page_increment; - gdouble page_size; -}; -*/ - -struct _GtkAdjustmentClass -{ - /*GtkObjectClass parent_class;*/ - APTR parent_class; - - void (* changed) (GtkAdjustment *adjustment); - void (* value_changed) (GtkAdjustment *adjustment); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - - -GType gtk_adjustment_get_type (void) G_GNUC_CONST; -GtkAdjustment *gtk_adjustment_new (gdouble value, - gdouble lower, - gdouble upper, - gdouble step_increment, - gdouble page_increment, - gdouble page_size); -void gtk_adjustment_changed (GtkAdjustment *adjustment); -void gtk_adjustment_value_changed (GtkAdjustment *adjustment); -void gtk_adjustment_clamp_page (GtkAdjustment *adjustment, - gdouble lower, - gdouble upper); -gdouble gtk_adjustment_get_value (GtkAdjustment *adjustment); -void gtk_adjustment_set_value (GtkAdjustment *adjustment, - gdouble value); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __GTK_ADJUSTMENT_H__ */ diff --git a/mui/gtk-mui/gtk/gtkbox.h b/mui/gtk-mui/gtk/gtkbox.h deleted file mode 100644 index 3760dd962..000000000 --- a/mui/gtk-mui/gtk/gtkbox.h +++ /dev/null @@ -1,11 +0,0 @@ - -#include -#include - -typedef struct _GtkBoxClass GtkBoxClass; - -struct _GtkBoxClass -{ - GtkContainerClass parent_class; -}; - diff --git a/mui/gtk-mui/gtk/gtkcontainer.h b/mui/gtk-mui/gtk/gtkcontainer.h deleted file mode 100644 index 6c317696f..000000000 --- a/mui/gtk-mui/gtk/gtkcontainer.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef MGTK_HAVE_CONTAINER_H -#define MGTK_HAVE_CONTAINER_H 1 - -#include - -#include - -typedef struct _GtkContainerClass GtkContainerClass; - -struct _GtkContainerClass -{ - GtkWidgetClass parent_class; - - /* TODO ? */ -}; - -#endif diff --git a/mui/gtk-mui/gtk/gtkenums.h b/mui/gtk-mui/gtk/gtkenums.h deleted file mode 100644 index fb070d817..000000000 --- a/mui/gtk-mui/gtk/gtkenums.h +++ /dev/null @@ -1,462 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_ENUMS_H__ -#define __GTK_ENUMS_H__ - -/* -#include - -G_BEGIN_DECLS -*/ - -/* Anchor types */ -typedef enum -{ - GTK_ANCHOR_CENTER, - GTK_ANCHOR_NORTH, - GTK_ANCHOR_NORTH_WEST, - GTK_ANCHOR_NORTH_EAST, - GTK_ANCHOR_SOUTH, - GTK_ANCHOR_SOUTH_WEST, - GTK_ANCHOR_SOUTH_EAST, - GTK_ANCHOR_WEST, - GTK_ANCHOR_EAST, - GTK_ANCHOR_N = GTK_ANCHOR_NORTH, - GTK_ANCHOR_NW = GTK_ANCHOR_NORTH_WEST, - GTK_ANCHOR_NE = GTK_ANCHOR_NORTH_EAST, - GTK_ANCHOR_S = GTK_ANCHOR_SOUTH, - GTK_ANCHOR_SW = GTK_ANCHOR_SOUTH_WEST, - GTK_ANCHOR_SE = GTK_ANCHOR_SOUTH_EAST, - GTK_ANCHOR_W = GTK_ANCHOR_WEST, - GTK_ANCHOR_E = GTK_ANCHOR_EAST -} GtkAnchorType; - -/* Arrow types */ -typedef enum -{ - GTK_ARROW_UP, - GTK_ARROW_DOWN, - GTK_ARROW_LEFT, - GTK_ARROW_RIGHT -} GtkArrowType; - -/* Attach options (for tables) */ -typedef enum -{ - GTK_EXPAND = 1 << 0, - GTK_SHRINK = 1 << 1, - GTK_FILL = 1 << 2 -} GtkAttachOptions; - -/* Button box styles */ -typedef enum -{ - GTK_BUTTONBOX_DEFAULT_STYLE, - GTK_BUTTONBOX_SPREAD, - GTK_BUTTONBOX_EDGE, - GTK_BUTTONBOX_START, - GTK_BUTTONBOX_END -} GtkButtonBoxStyle; - -/* Curve types */ -typedef enum -{ - GTK_CURVE_TYPE_LINEAR, /* linear interpolation */ - GTK_CURVE_TYPE_SPLINE, /* spline interpolation */ - GTK_CURVE_TYPE_FREE /* free form curve */ -} GtkCurveType; - -typedef enum { - GTK_DELETE_CHARS, - GTK_DELETE_WORD_ENDS, /* delete only the portion of the word to the - * left/right of cursor if we're in the middle - * of a word */ - GTK_DELETE_WORDS, - GTK_DELETE_DISPLAY_LINES, - GTK_DELETE_DISPLAY_LINE_ENDS, - GTK_DELETE_PARAGRAPH_ENDS, /* like C-k in Emacs (or its reverse) */ - GTK_DELETE_PARAGRAPHS, /* C-k in pico, kill whole line */ - GTK_DELETE_WHITESPACE /* M-\ in Emacs */ -} GtkDeleteType; - -/* Focus movement types */ -typedef enum -{ - GTK_DIR_TAB_FORWARD, - GTK_DIR_TAB_BACKWARD, - GTK_DIR_UP, - GTK_DIR_DOWN, - GTK_DIR_LEFT, - GTK_DIR_RIGHT -} GtkDirectionType; - -/* Expander styles */ -typedef enum -{ - GTK_EXPANDER_COLLAPSED, - GTK_EXPANDER_SEMI_COLLAPSED, - GTK_EXPANDER_SEMI_EXPANDED, - GTK_EXPANDER_EXPANDED -} GtkExpanderStyle; - -/* Built-in stock icon sizes */ -typedef enum -{ - GTK_ICON_SIZE_INVALID, - GTK_ICON_SIZE_MENU, - GTK_ICON_SIZE_SMALL_TOOLBAR, - GTK_ICON_SIZE_LARGE_TOOLBAR, - GTK_ICON_SIZE_BUTTON, - GTK_ICON_SIZE_DND, - GTK_ICON_SIZE_DIALOG -} GtkIconSize; - -#ifndef GTK_DISABLE_DEPRECATED -/* side types */ -typedef enum -{ - GTK_SIDE_TOP, - GTK_SIDE_BOTTOM, - GTK_SIDE_LEFT, - GTK_SIDE_RIGHT -} GtkSideType; -#endif /* GTK_DISABLE_DEPRECATED */ - -/* Reading directions for text */ -typedef enum -{ - GTK_TEXT_DIR_NONE, - GTK_TEXT_DIR_LTR, - GTK_TEXT_DIR_RTL -} GtkTextDirection; - -/* justification for label and maybe other widgets (text?) */ -typedef enum -{ - GTK_JUSTIFY_LEFT, - GTK_JUSTIFY_RIGHT, - GTK_JUSTIFY_CENTER, - GTK_JUSTIFY_FILL -} GtkJustification; - -#ifndef GTK_DISABLE_DEPRECATED -/* GtkPatternSpec match types */ -typedef enum -{ - GTK_MATCH_ALL, /* "*A?A*" */ - GTK_MATCH_ALL_TAIL, /* "*A?AA" */ - GTK_MATCH_HEAD, /* "AAAA*" */ - GTK_MATCH_TAIL, /* "*AAAA" */ - GTK_MATCH_EXACT, /* "AAAAA" */ - GTK_MATCH_LAST -} GtkMatchType; -#endif /* GTK_DISABLE_DEPRECATED */ - -/* Menu keyboard movement types */ -typedef enum -{ - GTK_MENU_DIR_PARENT, - GTK_MENU_DIR_CHILD, - GTK_MENU_DIR_NEXT, - GTK_MENU_DIR_PREV -} GtkMenuDirectionType; - -typedef enum -{ - GTK_PIXELS, - GTK_INCHES, - GTK_CENTIMETERS -} GtkMetricType; - -typedef enum -{ - GTK_MOVEMENT_LOGICAL_POSITIONS, /* move by forw/back graphemes */ - GTK_MOVEMENT_VISUAL_POSITIONS, /* move by left/right graphemes */ - GTK_MOVEMENT_WORDS, /* move by forward/back words */ - GTK_MOVEMENT_DISPLAY_LINES, /* move up/down lines (wrapped lines) */ - GTK_MOVEMENT_DISPLAY_LINE_ENDS, /* move up/down lines (wrapped lines) */ - GTK_MOVEMENT_PARAGRAPHS, /* move up/down paragraphs (newline-ended lines) */ - GTK_MOVEMENT_PARAGRAPH_ENDS, /* move to either end of a paragraph */ - GTK_MOVEMENT_PAGES, /* move by pages */ - GTK_MOVEMENT_BUFFER_ENDS, /* move to ends of the buffer */ - GTK_MOVEMENT_HORIZONTAL_PAGES /* move horizontally by pages */ -} GtkMovementStep; - -typedef enum -{ - GTK_SCROLL_STEPS, - GTK_SCROLL_PAGES, - GTK_SCROLL_ENDS, - GTK_SCROLL_HORIZONTAL_STEPS, - GTK_SCROLL_HORIZONTAL_PAGES, - GTK_SCROLL_HORIZONTAL_ENDS -} GtkScrollStep; - -/* Orientation for toolbars, etc. */ -typedef enum -{ - GTK_ORIENTATION_HORIZONTAL, - GTK_ORIENTATION_VERTICAL -} GtkOrientation; - -/* Placement type for scrolled window */ -typedef enum -{ - GTK_CORNER_TOP_LEFT, - GTK_CORNER_BOTTOM_LEFT, - GTK_CORNER_TOP_RIGHT, - GTK_CORNER_BOTTOM_RIGHT -} GtkCornerType; - -/* Packing types (for boxes) */ -typedef enum -{ - GTK_PACK_START, - GTK_PACK_END -} GtkPackType; - -/* priorities for path lookups */ -typedef enum -{ - GTK_PATH_PRIO_LOWEST = 0, - GTK_PATH_PRIO_GTK = 4, - GTK_PATH_PRIO_APPLICATION = 8, - GTK_PATH_PRIO_THEME = 10, - GTK_PATH_PRIO_RC = 12, - GTK_PATH_PRIO_HIGHEST = 15 -} GtkPathPriorityType; -#define GTK_PATH_PRIO_MASK 0x0f - -/* widget path types */ -typedef enum -{ - GTK_PATH_WIDGET, - GTK_PATH_WIDGET_CLASS, - GTK_PATH_CLASS -} GtkPathType; - -/* Scrollbar policy types (for scrolled windows) */ -typedef enum -{ - GTK_POLICY_ALWAYS, - GTK_POLICY_AUTOMATIC, - GTK_POLICY_NEVER -} GtkPolicyType; - -typedef enum -{ - GTK_POS_LEFT, - GTK_POS_RIGHT, - GTK_POS_TOP, - GTK_POS_BOTTOM -} GtkPositionType; - -#ifndef GTK_DISABLE_DEPRECATED -typedef enum -{ - GTK_PREVIEW_COLOR, - GTK_PREVIEW_GRAYSCALE -} GtkPreviewType; -#endif /* GTK_DISABLE_DEPRECATED */ - -/* Style for buttons */ -typedef enum -{ - GTK_RELIEF_NORMAL, - GTK_RELIEF_HALF, - GTK_RELIEF_NONE -} GtkReliefStyle; - -/* Resize type */ -typedef enum -{ - GTK_RESIZE_PARENT, /* Pass resize request to the parent */ - GTK_RESIZE_QUEUE, /* Queue resizes on this widget */ - GTK_RESIZE_IMMEDIATE /* Perform the resizes now */ -} GtkResizeMode; - -#if 0 -#ifndef GTK_DISABLE_DEPRECATED -/* signal run types */ -typedef enum /*< flags >*/ -{ - GTK_RUN_FIRST = G_SIGNAL_RUN_FIRST, - GTK_RUN_LAST = G_SIGNAL_RUN_LAST, - GTK_RUN_BOTH = (GTK_RUN_FIRST | GTK_RUN_LAST), - GTK_RUN_NO_RECURSE = G_SIGNAL_NO_RECURSE, - GTK_RUN_ACTION = G_SIGNAL_ACTION, - GTK_RUN_NO_HOOKS = G_SIGNAL_NO_HOOKS -} GtkSignalRunType; -#endif /* GTK_DISABLE_DEPRECATED */ -#endif - -/* scrolling types */ -typedef enum -{ - GTK_SCROLL_NONE, - GTK_SCROLL_JUMP, - GTK_SCROLL_STEP_BACKWARD, - GTK_SCROLL_STEP_FORWARD, - GTK_SCROLL_PAGE_BACKWARD, - GTK_SCROLL_PAGE_FORWARD, - GTK_SCROLL_STEP_UP, - GTK_SCROLL_STEP_DOWN, - GTK_SCROLL_PAGE_UP, - GTK_SCROLL_PAGE_DOWN, - GTK_SCROLL_STEP_LEFT, - GTK_SCROLL_STEP_RIGHT, - GTK_SCROLL_PAGE_LEFT, - GTK_SCROLL_PAGE_RIGHT, - GTK_SCROLL_START, - GTK_SCROLL_END -} GtkScrollType; - -/* list selection modes */ -typedef enum -{ - GTK_SELECTION_NONE, /* Nothing can be selected */ - GTK_SELECTION_SINGLE, - GTK_SELECTION_BROWSE, - GTK_SELECTION_MULTIPLE, - GTK_SELECTION_EXTENDED = GTK_SELECTION_MULTIPLE /* Deprecated */ -} GtkSelectionMode; - -/* Shadow types */ -typedef enum -{ - GTK_SHADOW_NONE, - GTK_SHADOW_IN, - GTK_SHADOW_OUT, - GTK_SHADOW_ETCHED_IN, - GTK_SHADOW_ETCHED_OUT -} GtkShadowType; - -/* Widget states */ -typedef enum -{ - GTK_STATE_NORMAL, - GTK_STATE_ACTIVE, - GTK_STATE_PRELIGHT, - GTK_STATE_SELECTED, - GTK_STATE_INSENSITIVE -} GtkStateType; - -#if !defined(GTK_DISABLE_DEPRECATED) || defined (GTK_MENU_INTERNALS) -/* Directions for submenus */ -typedef enum -{ - GTK_DIRECTION_LEFT, - GTK_DIRECTION_RIGHT -} GtkSubmenuDirection; - -/* Placement of submenus */ -typedef enum -{ - GTK_TOP_BOTTOM, - GTK_LEFT_RIGHT -} GtkSubmenuPlacement; -#endif /* GTK_DISABLE_DEPRECATED */ - -/* Style for toolbars */ -typedef enum -{ - GTK_TOOLBAR_ICONS, - GTK_TOOLBAR_TEXT, - GTK_TOOLBAR_BOTH, - GTK_TOOLBAR_BOTH_HORIZ -} GtkToolbarStyle; - -/* Data update types (for ranges) */ -typedef enum -{ - GTK_UPDATE_CONTINUOUS, - GTK_UPDATE_DISCONTINUOUS, - GTK_UPDATE_DELAYED -} GtkUpdateType; - -/* Generic visibility flags */ -typedef enum -{ - GTK_VISIBILITY_NONE, - GTK_VISIBILITY_PARTIAL, - GTK_VISIBILITY_FULL -} GtkVisibility; - -/* Window position types */ -typedef enum -{ - GTK_WIN_POS_NONE, - GTK_WIN_POS_CENTER, - GTK_WIN_POS_MOUSE, - GTK_WIN_POS_CENTER_ALWAYS, - GTK_WIN_POS_CENTER_ON_PARENT -} GtkWindowPosition; - -/* Window types */ -typedef enum -{ - GTK_WINDOW_TOPLEVEL, - GTK_WINDOW_POPUP -} GtkWindowType; - -/* Text wrap */ -typedef enum -{ - GTK_WRAP_NONE, - GTK_WRAP_CHAR, - GTK_WRAP_WORD, - GTK_WRAP_WORD_CHAR -} GtkWrapMode; - -/* How to sort */ -typedef enum -{ - GTK_SORT_ASCENDING, - GTK_SORT_DESCENDING -} GtkSortType; - -/* Style for gtk input method preedit/status */ -typedef enum -{ - GTK_IM_PREEDIT_NOTHING, - GTK_IM_PREEDIT_CALLBACK, - GTK_IM_PREEDIT_NONE -} GtkIMPreeditStyle; - -typedef enum -{ - GTK_IM_STATUS_NOTHING, - GTK_IM_STATUS_CALLBACK, - GTK_IM_STATUS_NONE -} GtkIMStatusStyle; - -/* -G_END_DECLS -*/ - - -#endif /* __GTK_ENUMS_H__ */ diff --git a/mui/gtk-mui/gtk/gtkmain.h b/mui/gtk-mui/gtk/gtkmain.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/mui/gtk-mui/gtk/gtkobject.h b/mui/gtk-mui/gtk/gtkobject.h deleted file mode 100644 index 44560ac04..000000000 --- a/mui/gtk-mui/gtk/gtkobject.h +++ /dev/null @@ -1,31 +0,0 @@ - -#include - -typedef struct _GtkObjectClass GtkObjectClass; -typedef struct _GtkArg GtkArg; - -struct _GtkArg -{ - GtkType type; - gchar *name; - - /* union skipped ..*/ -}; - -struct _GtkObjectClass -{ - GObjectClass parent_class; - /* Non overridable class methods to set and get per class arguments */ -#if 0 - void (*set_arg) (GtkObject *object, - GtkArg *arg, - guint arg_id); - void (*get_arg) (GtkObject *object, - GtkArg *arg, - guint arg_id); - -#endif - void (*destroy) (GtkObject *object); - - int foo; -}; diff --git a/mui/gtk-mui/gtk/gtkprogressbar.h b/mui/gtk-mui/gtk/gtkprogressbar.h deleted file mode 100644 index 5665a9905..000000000 --- a/mui/gtk-mui/gtk/gtkprogressbar.h +++ /dev/null @@ -1,56 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* lot of stuff removed by Oliver Brunner for gtk-mui */ - -#ifndef __GTK_PROGRESS_BAR_H__ -#define __GTK_PROGRESS_BAR_H__ - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef enum -{ - GTK_PROGRESS_CONTINUOUS, - GTK_PROGRESS_DISCRETE -} GtkProgressBarStyle; - -typedef enum -{ - GTK_PROGRESS_LEFT_TO_RIGHT, - GTK_PROGRESS_RIGHT_TO_LEFT, - GTK_PROGRESS_BOTTOM_TO_TOP, - GTK_PROGRESS_TOP_TO_BOTTOM -} GtkProgressBarOrientation; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __GTK_PROGRESS_BAR_H__ */ diff --git a/mui/gtk-mui/gtk/gtkrange.h b/mui/gtk-mui/gtk/gtkrange.h deleted file mode 100644 index c09f457b9..000000000 --- a/mui/gtk-mui/gtk/gtkrange.h +++ /dev/null @@ -1,164 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* modified by o1i 2005 */ - -#ifndef __GTK_RANGE_H__ -#define __GTK_RANGE_H__ - - -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define GTK_TYPE_RANGE (gtk_range_get_type ()) -#define GTK_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RANGE, GtkRange)) -#define GTK_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RANGE, GtkRangeClass)) -#define GTK_IS_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RANGE)) -#define GTK_IS_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RANGE)) -#define GTK_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RANGE, GtkRangeClass)) - -/* These two are private/opaque types, ignore */ -typedef struct _GtkRangeLayout GtkRangeLayout; -typedef struct _GtkRangeStepTimer GtkRangeStepTimer; - -typedef struct _GtkRange GtkRange; -typedef struct _GtkRangeClass GtkRangeClass; - -struct _GtkRange -{ - GtkWidget widget; - - GtkAdjustment *adjustment; - GtkUpdateType update_policy; - guint inverted : 1; - - /*< protected >*/ - - guint flippable : 1; - - /* Steppers are: < > ---- < > - * a b c d - */ - - guint has_stepper_a : 1; - guint has_stepper_b : 1; - guint has_stepper_c : 1; - guint has_stepper_d : 1; - - guint need_recalc : 1; - - guint slider_size_fixed : 1; - - gint min_slider_size; - - GtkOrientation orientation; - - /* Area of entire stepper + trough assembly in widget->window coords */ - GdkRectangle range_rect; - /* Slider range along the long dimension, in widget->window coords */ - gint slider_start, slider_end; - - /* Round off value to this many digits, -1 for no rounding */ - gint round_digits; - - /*< private >*/ - guint trough_click_forward : 1; /* trough click was on the forward side of slider */ - guint update_pending : 1; /* need to emit value_changed */ - GtkRangeLayout *layout; - GtkRangeStepTimer *timer; - gint slide_initial_slider_position; - gint slide_initial_coordinate; - guint update_timeout_id; - GdkWindow *event_window; -}; - -struct _GtkRangeClass -{ - GtkWidgetClass parent_class; - - /* what detail to pass to GTK drawing functions */ - gchar *slider_detail; - gchar *stepper_detail; - - void (* value_changed) (GtkRange *range); - void (* adjust_bounds) (GtkRange *range, - gdouble new_value); - - /* action signals for keybindings */ - void (* move_slider) (GtkRange *range, - GtkScrollType scroll); - - /* Virtual functions */ - void (* get_range_border) (GtkRange *range, - GtkBorder *border_); - - gboolean (* change_value) (GtkRange *range, - GtkScrollType scroll, - gdouble new_value); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); -}; - - -GType gtk_range_get_type (void) G_GNUC_CONST; - -void gtk_range_set_update_policy (GtkRange *range, - GtkUpdateType policy); -GtkUpdateType gtk_range_get_update_policy (GtkRange *range); -void gtk_range_set_adjustment (GtkRange *range, - GtkAdjustment *adjustment); -GtkAdjustment* gtk_range_get_adjustment (GtkRange *range); -void gtk_range_set_inverted (GtkRange *range, - gboolean setting); -gboolean gtk_range_get_inverted (GtkRange *range); -void gtk_range_set_increments (GtkRange *range, - gdouble step, - gdouble page); -void gtk_range_set_range (GtkRange *range, - gdouble min, - gdouble max); -void gtk_range_set_value (GtkRange *range, - gdouble value); -gdouble gtk_range_get_value (GtkRange *range); - -gdouble _gtk_range_get_wheel_delta (GtkRange *range, - GdkScrollDirection direction); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* __GTK_RANGE_H__ */ diff --git a/mui/gtk-mui/gtk/gtkrequisition.h b/mui/gtk-mui/gtk/gtkrequisition.h deleted file mode 100644 index 55fa1290d..000000000 --- a/mui/gtk-mui/gtk/gtkrequisition.h +++ /dev/null @@ -1,11 +0,0 @@ - -typedef GdkRectangle GtkAllocation; -/* A requisition is a desired amount of space which a - * widget may request. - */ -struct _GtkRequisition -{ - gint width; - gint height; -}; - diff --git a/mui/gtk-mui/gtk/gtksettings.h b/mui/gtk-mui/gtk/gtksettings.h deleted file mode 100644 index 3c1468708..000000000 --- a/mui/gtk-mui/gtk/gtksettings.h +++ /dev/null @@ -1,141 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* modified by o1i 2005 */ - -#ifndef __GTK_SETTINGS_H__ -#define __GTK_SETTINGS_H__ - -/* -#include - -G_BEGIN_DECLS -*/ - -#include "gdk/gobject/gvalue.h" - -/* -- type macros --- */ -#define GTK_TYPE_SETTINGS (gtk_settings_get_type ()) -#define GTK_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SETTINGS, GtkSettings)) -#define GTK_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SETTINGS, GtkSettingsClass)) -#define GTK_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SETTINGS)) -#define GTK_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SETTINGS)) -#define GTK_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SETTINGS, GtkSettingsClass)) - - -/* --- typedefs --- */ -typedef struct _GtkSettingsClass GtkSettingsClass; -typedef struct _GtkSettingsValue GtkSettingsValue; -typedef struct _GtkSettingsPropertyValue GtkSettingsPropertyValue; /* Internal */ - - -/* --- structures --- */ -struct _GtkSettings -{ - GObject parent_instance; - -/* GData *queued_settings;*/ /* of type GtkSettingsValue* */ - GtkSettingsPropertyValue *property_values; - -/* GtkRcContext *rc_context;*/ - GdkScreen *screen; -}; -struct _GtkSettingsClass -{ - GObjectClass parent_class; - -}; -struct _GtkSettingsValue -{ - /* origin should be something like "filename:linenumber" for rc files, - * or e.g. "XProperty" for other sources - */ - gchar *origin; - - /* valid types are LONG, DOUBLE and STRING corresponding to the token parsed, - * or a GSTRING holding an unparsed statement - */ - GValue value; -}; - - -/* --- functions --- */ -GType gtk_settings_get_type (void) G_GNUC_CONST; -#ifndef GDK_MULTIHEAD_SAFE -GtkSettings* gtk_settings_get_default (void); -#endif -GtkSettings* gtk_settings_get_for_screen (GdkScreen *screen); - -void gtk_settings_install_property (GParamSpec *pspec); -void gtk_settings_install_property_parser (GParamSpec *pspec, - GtkRcPropertyParser parser); - -/* --- precoded parsing functions --- */ -gboolean gtk_rc_property_parse_color (const GParamSpec *pspec, - const GString *gstring, - GValue *property_value); -gboolean gtk_rc_property_parse_enum (const GParamSpec *pspec, - const GString *gstring, - GValue *property_value); -gboolean gtk_rc_property_parse_flags (const GParamSpec *pspec, - const GString *gstring, - GValue *property_value); -gboolean gtk_rc_property_parse_requisition (const GParamSpec *pspec, - const GString *gstring, - GValue *property_value); -gboolean gtk_rc_property_parse_border (const GParamSpec *pspec, - const GString *gstring, - GValue *property_value); - -/*< private >*/ -void gtk_settings_set_property_value (GtkSettings *settings, - const gchar *name, - const GtkSettingsValue *svalue); -void gtk_settings_set_string_property (GtkSettings *settings, - const gchar *name, - const gchar *v_string, - const gchar *origin); -void gtk_settings_set_long_property (GtkSettings *settings, - const gchar *name, - glong v_long, - const gchar *origin); -void gtk_settings_set_double_property (GtkSettings *settings, - const gchar *name, - gdouble v_double, - const gchar *origin); - - -/* implementation details */ -void _gtk_settings_set_property_value_from_rc (GtkSettings *settings, - const gchar *name, - const GtkSettingsValue *svalue); -void _gtk_settings_reset_rc_values (GtkSettings *settings); - -void _gtk_settings_handle_event (GdkEventSetting *event); -GtkRcPropertyParser _gtk_rc_property_parser_from_type (GType type); -gboolean _gtk_settings_parse_convert (GtkRcPropertyParser parser, - const GValue *src_value, - GParamSpec *pspec, - GValue *dest_value); - - -/* -G_END_DECLS -*/ - -#endif /* __GTK_SETTINGS_H__ */ diff --git a/mui/gtk-mui/gtk/gtksignal.h b/mui/gtk-mui/gtk/gtksignal.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/mui/gtk-mui/gtk/gtkstock.h b/mui/gtk-mui/gtk/gtkstock.h deleted file mode 100644 index 685ca6e00..000000000 --- a/mui/gtk-mui/gtk/gtkstock.h +++ /dev/null @@ -1,126 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_STOCK_H__ -#define __GTK_STOCK_H__ - - -/* Stock IDs (not all are stock items; some are images only) */ -#define GTK_STOCK_DIALOG_AUTHENTICATION \ - "gtk-dialog-authentication" -#define GTK_STOCK_DIALOG_INFO "gtk-dialog-info" -#define GTK_STOCK_DIALOG_WARNING "gtk-dialog-warning" -#define GTK_STOCK_DIALOG_ERROR "gtk-dialog-error" -#define GTK_STOCK_DIALOG_QUESTION "gtk-dialog-question" - -#define GTK_STOCK_DND "gtk-dnd" -#define GTK_STOCK_DND_MULTIPLE "gtk-dnd-multiple" - -#define GTK_STOCK_ABOUT "gtk-about" -#define GTK_STOCK_ADD "gtk-add" -#define GTK_STOCK_APPLY "gtk-apply" -#define GTK_STOCK_BOLD "gtk-bold" -#define GTK_STOCK_CANCEL "gtk-cancel" -#define GTK_STOCK_CDROM "gtk-cdrom" -#define GTK_STOCK_CLEAR "gtk-clear" -#define GTK_STOCK_CLOSE "gtk-close" -#define GTK_STOCK_COLOR_PICKER "gtk-color-picker" -#define GTK_STOCK_CONVERT "gtk-convert" -#define GTK_STOCK_CONNECT "gtk-connect" -#define GTK_STOCK_COPY "gtk-copy" -#define GTK_STOCK_CUT "gtk-cut" -#define GTK_STOCK_DELETE "gtk-delete" -#define GTK_STOCK_DIRECTORY "gtk-directory" -#define GTK_STOCK_DISCONNECT "gtk-disconnect" -#define GTK_STOCK_EDIT "gtk-edit" -#define GTK_STOCK_EXECUTE "gtk-execute" -#define GTK_STOCK_FILE "gtk-file" -#define GTK_STOCK_FIND "gtk-find" -#define GTK_STOCK_FIND_AND_REPLACE "gtk-find-and-replace" -#define GTK_STOCK_FLOPPY "gtk-floppy" -#define GTK_STOCK_GOTO_BOTTOM "gtk-goto-bottom" -#define GTK_STOCK_GOTO_FIRST "gtk-goto-first" -#define GTK_STOCK_GOTO_LAST "gtk-goto-last" -#define GTK_STOCK_GOTO_TOP "gtk-goto-top" -#define GTK_STOCK_GO_BACK "gtk-go-back" -#define GTK_STOCK_GO_DOWN "gtk-go-down" -#define GTK_STOCK_GO_FORWARD "gtk-go-forward" -#define GTK_STOCK_GO_UP "gtk-go-up" -#define GTK_STOCK_HARDDISK "gtk-harddisk" -#define GTK_STOCK_HELP "gtk-help" -#define GTK_STOCK_HOME "gtk-home" -#define GTK_STOCK_INDEX "gtk-index" -#define GTK_STOCK_INDENT "gtk-indent" -#define GTK_STOCK_UNINDENT "gtk-unindent" -#define GTK_STOCK_ITALIC "gtk-italic" -#define GTK_STOCK_JUMP_TO "gtk-jump-to" -#define GTK_STOCK_JUSTIFY_CENTER "gtk-justify-center" -#define GTK_STOCK_JUSTIFY_FILL "gtk-justify-fill" -#define GTK_STOCK_JUSTIFY_LEFT "gtk-justify-left" -#define GTK_STOCK_JUSTIFY_RIGHT "gtk-justify-right" -#define GTK_STOCK_MISSING_IMAGE "gtk-missing-image" -#define GTK_STOCK_MEDIA_FORWARD "gtk-media-forward" -#define GTK_STOCK_MEDIA_NEXT "gtk-media-next" -#define GTK_STOCK_MEDIA_PAUSE "gtk-media-pause" -#define GTK_STOCK_MEDIA_PLAY "gtk-media-play" -#define GTK_STOCK_MEDIA_PREVIOUS "gtk-media-previous" -#define GTK_STOCK_MEDIA_RECORD "gtk-media-record" -#define GTK_STOCK_MEDIA_REWIND "gtk-media-rewind" -#define GTK_STOCK_MEDIA_STOP "gtk-media-stop" -#define GTK_STOCK_NETWORK "gtk-network" -#define GTK_STOCK_NEW "gtk-new" -#define GTK_STOCK_NO "gtk-no" -#define GTK_STOCK_OK "gtk-ok" -#define GTK_STOCK_OPEN "gtk-open" -#define GTK_STOCK_PASTE "gtk-paste" -#define GTK_STOCK_PREFERENCES "gtk-preferences" -#define GTK_STOCK_PRINT "gtk-print" -#define GTK_STOCK_PRINT_PREVIEW "gtk-print-preview" -#define GTK_STOCK_PROPERTIES "gtk-properties" -#define GTK_STOCK_QUIT "gtk-quit" -#define GTK_STOCK_REDO "gtk-redo" -#define GTK_STOCK_REFRESH "gtk-refresh" -#define GTK_STOCK_REMOVE "gtk-remove" -#define GTK_STOCK_REVERT_TO_SAVED "gtk-revert-to-saved" -#define GTK_STOCK_SAVE "gtk-save" -#define GTK_STOCK_SAVE_AS "gtk-save-as" -#define GTK_STOCK_SELECT_COLOR "gtk-select-color" -#define GTK_STOCK_SELECT_FONT "gtk-select-font" -#define GTK_STOCK_SORT_ASCENDING "gtk-sort-ascending" -#define GTK_STOCK_SORT_DESCENDING "gtk-sort-descending" -#define GTK_STOCK_SPELL_CHECK "gtk-spell-check" -#define GTK_STOCK_STOP "gtk-stop" -#define GTK_STOCK_STRIKETHROUGH "gtk-strikethrough" -#define GTK_STOCK_UNDELETE "gtk-undelete" -#define GTK_STOCK_UNDERLINE "gtk-underline" -#define GTK_STOCK_UNDO "gtk-undo" -#define GTK_STOCK_YES "gtk-yes" -#define GTK_STOCK_ZOOM_100 "gtk-zoom-100" -#define GTK_STOCK_ZOOM_FIT "gtk-zoom-fit" -#define GTK_STOCK_ZOOM_IN "gtk-zoom-in" -#define GTK_STOCK_ZOOM_OUT "gtk-zoom-out" - -#endif diff --git a/mui/gtk-mui/gtk/gtkstyle.h b/mui/gtk-mui/gtk/gtkstyle.h deleted file mode 100644 index c7afdf804..000000000 --- a/mui/gtk-mui/gtk/gtkstyle.h +++ /dev/null @@ -1,919 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* modified by o1i 2005 - * - * $Id$ - */ - -#ifndef __GTK_STYLE_H__ -#define __GTK_STYLE_H__ - - -#include -#include -#include -#include -#include - -/*G_BEGIN_DECLS*/ - -#define GTK_TYPE_STYLE (gtk_style_get_type ()) -#define GTK_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_STYLE, GtkStyle)) -#define GTK_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STYLE, GtkStyleClass)) -#define GTK_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_STYLE)) -#define GTK_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STYLE)) -#define GTK_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE, GtkStyleClass)) - -#define GTK_TYPE_BORDER (gtk_border_get_type ()) - -/* Some forward declarations needed to rationalize the header - * files. - */ -typedef struct _GtkBorder GtkBorder; -typedef struct _GtkStyle GtkStyle; -typedef struct _GtkStyleClass GtkStyleClass; -typedef struct _GtkThemeEngine GtkThemeEngine; -typedef struct _GtkRcStyle GtkRcStyle; -typedef struct _GtkIconSet GtkIconSet; -typedef struct _GtkIconSource GtkIconSource; -typedef struct _GtkRcProperty GtkRcProperty; -typedef struct _GtkSettings GtkSettings; -typedef gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec, - const GString *rc_string, - GValue *property_value); - -/* We make this forward declaration here, since we pass - * GtkWidget's to the draw functions. - */ -#if 0 -typedef struct _GtkWidget GtkWidget; -#endif - -#define GTK_STYLE_ATTACHED(style) (GTK_STYLE (style)->attach_count > 0) - - -struct _GtkStyle -{ - GObject parent_instance; - - /*< public >*/ - - GdkColor fg[5]; - GdkColor bg[5]; - GdkColor light[5]; - GdkColor dark[5]; - GdkColor mid[5]; - GdkColor text[5]; - GdkColor base[5]; - GdkColor text_aa[5]; /* Halfway between text/base */ - - GdkColor black; - GdkColor white; - PangoFontDescription *font_desc; - - gint xthickness; - gint ythickness; - - GdkGC *fg_gc[5]; - GdkGC *bg_gc[5]; - GdkGC *light_gc[5]; - GdkGC *dark_gc[5]; - GdkGC *mid_gc[5]; - GdkGC *text_gc[5]; - GdkGC *base_gc[5]; - GdkGC *text_aa_gc[5]; - GdkGC *black_gc; - GdkGC *white_gc; - - GdkPixmap *bg_pixmap[5]; - - /*< private >*/ - - gint attach_count; - - gint depth; - GdkColormap *colormap; - GdkFont *private_font; - PangoFontDescription *private_font_desc; /* Font description for style->private_font or %NULL */ - - /* the RcStyle from which this style was created */ - GtkRcStyle *rc_style; - - GSList *styles; /* of type GtkStyle* */ - GArray *property_cache; - GSList *icon_factories; /* of type GtkIconFactory* */ -}; - -struct _GtkStyleClass -{ - GObjectClass parent_class; - - /* Initialize for a particular colormap/depth - * combination. style->colormap/style->depth will have - * been set at this point. Will typically chain to parent. - */ - void (*realize) (GtkStyle *style); - - /* Clean up for a particular colormap/depth combination. Will - * typically chain to parent. - */ - void (*unrealize) (GtkStyle *style); - - /* Make style an exact duplicate of src. - */ - void (*copy) (GtkStyle *style, - GtkStyle *src); - - /* Create an empty style of the same type as this style. - * The default implementation, which does - * g_object_new (G_OBJECT_TYPE (style), NULL); - * should work in most cases. - */ - GtkStyle *(*clone) (GtkStyle *style); - - /* Initialize the GtkStyle with the values in the GtkRcStyle. - * should chain to the parent implementation. - */ - void (*init_from_rc) (GtkStyle *style, - GtkRcStyle *rc_style); - - void (*set_background) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type); - - -#if 0 - GdkPixbuf * (* render_icon) (GtkStyle *style, - const GtkIconSource *source, - GtkTextDirection direction, - GtkStateType state, - GtkIconSize size, - GtkWidget *widget, - const gchar *detail); - - /* Drawing functions - */ - - void (*draw_hline) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x1, - gint x2, - gint y); - void (*draw_vline) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint y1_, - gint y2_, - gint x); - void (*draw_shadow) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_polygon) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GdkPoint *point, - gint npoints, - gboolean fill); - void (*draw_arrow) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height); - void (*draw_diamond) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_string) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string); - void (*draw_box) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_flat_box) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_check) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_option) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_tab) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_shadow_gap) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); - void (*draw_box_gap) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); - void (*draw_extension) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side); - void (*draw_focus) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_slider) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); - void (*draw_handle) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); - - void (*draw_expander) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - GtkExpanderStyle expander_style); - /* - void (*draw_layout) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gboolean use_text, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - PangoLayout *layout); - */ - void (*draw_resize_grip) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GdkWindowEdge edge, - gint x, - gint y, - gint width, - gint height); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); - void (*_gtk_reserved5) (void); - void (*_gtk_reserved6) (void); - void (*_gtk_reserved7) (void); - void (*_gtk_reserved8) (void); - void (*_gtk_reserved9) (void); - void (*_gtk_reserved10) (void); - void (*_gtk_reserved11) (void); - void (*_gtk_reserved12) (void); -#endif -}; - -struct _GtkBorder -{ - gint left; - gint right; - gint top; - gint bottom; -}; - -GType gtk_style_get_type (void) G_GNUC_CONST; -GtkStyle* gtk_style_new (void); -GtkStyle* gtk_style_copy (GtkStyle *style); -GtkStyle* gtk_style_attach (GtkStyle *style, - GdkWindow *window); -void gtk_style_detach (GtkStyle *style); - -#ifndef GTK_DISABLE_DEPRECATED -GtkStyle* gtk_style_ref (GtkStyle *style); -void gtk_style_unref (GtkStyle *style); - -GdkFont * gtk_style_get_font (GtkStyle *style); -void gtk_style_set_font (GtkStyle *style, - GdkFont *font); -#endif /* GTK_DISABLE_DEPRECATED */ - -void gtk_style_set_background (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type); -void gtk_style_apply_default_background (GtkStyle *style, - GdkWindow *window, - gboolean set_bg, - GtkStateType state_type, - GdkRectangle *area, - gint x, - gint y, - gint width, - gint height); - -GtkIconSet* gtk_style_lookup_icon_set (GtkStyle *style, - const gchar *stock_id); -/* -GdkPixbuf* gtk_style_render_icon (GtkStyle *style, - const GtkIconSource *source, - GtkTextDirection direction, - GtkStateType state, - GtkIconSize size, - GtkWidget *widget, - const gchar *detail); -*/ -#ifndef GTK_DISABLE_DEPRECATED -void gtk_draw_hline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x1, - gint x2, - gint y); -void gtk_draw_vline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint y1_, - gint y2_, - gint x); -void gtk_draw_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_polygon (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkPoint *points, - gint npoints, - gboolean fill); -void gtk_draw_arrow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_diamond (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_flat_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_check (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_option (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_tab (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_shadow_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); -void gtk_draw_box_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); -void gtk_draw_extension (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side); -void gtk_draw_focus (GtkStyle *style, - GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_slider (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); -void gtk_draw_handle (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); -void gtk_draw_expander (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x, - gint y, - GtkExpanderStyle expander_style); -/* -void gtk_draw_layout (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gboolean use_text, - gint x, - gint y, - PangoLayout *layout); -void gtk_draw_resize_grip (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkWindowEdge edge, - gint x, - gint y, - gint width, - gint height); -*/ -#endif /* GTK_DISABLE_DEPRECATED */ - -#if 0 -void gtk_paint_hline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x1, - gint x2, - gint y); -void gtk_paint_vline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint y1_, - gint y2_, - gint x); -void gtk_paint_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_polygon (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GdkPoint *points, - gint npoints, - gboolean fill); -void gtk_paint_arrow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_diamond (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_flat_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_check (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_option (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_tab (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_shadow_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); -void gtk_paint_box_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); -void gtk_paint_extension (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side); -void gtk_paint_focus (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_slider (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); -void gtk_paint_handle (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); -void gtk_paint_expander (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - GtkExpanderStyle expander_style); -/* -void gtk_paint_layout (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gboolean use_text, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - PangoLayout *layout); -*/ - -void gtk_paint_resize_grip (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GdkWindowEdge edge, - gint x, - gint y, - gint width, - gint height); - - -GType gtk_border_get_type (void) G_GNUC_CONST; -GtkBorder *gtk_border_copy (const GtkBorder *border_); -void gtk_border_free ( GtkBorder *border_); - -/* --- private API --- */ -const GValue* _gtk_style_peek_property_value (GtkStyle *style, - GType widget_type, - GParamSpec *pspec, - GtkRcPropertyParser parser); - -void _gtk_style_init_for_settings (GtkStyle *style, - GtkSettings *settings); - -/* deprecated */ -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_style_apply_default_pixmap(s,gw,st,a,x,y,w,h) gtk_style_apply_default_background (s,gw,1,st,a,x,y,w,h) -void gtk_draw_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x, - gint y, - const gchar *string); -void gtk_paint_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string); -#endif /* GTK_DISABLE_DEPRECATED */ - -void gtk_draw_insertion_cursor (GtkWidget *widget, - GdkDrawable *drawable, - GdkRectangle *area, - GdkRectangle *location, - gboolean is_primary, - GtkTextDirection direction, - gboolean draw_arrow); - -#endif - -/*G_END_DECLS*/ - -#endif /* __GTK_STYLE_H__ */ diff --git a/mui/gtk-mui/gtk/gtktable.h b/mui/gtk-mui/gtk/gtktable.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/mui/gtk-mui/gtk/gtktogglebutton.h b/mui/gtk-mui/gtk/gtktogglebutton.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/mui/gtk-mui/gtk/gtktoolbar.h b/mui/gtk-mui/gtk/gtktoolbar.h deleted file mode 100644 index a9bbe03b7..000000000 --- a/mui/gtk-mui/gtk/gtktoolbar.h +++ /dev/null @@ -1,271 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * GtkToolbar copyright (C) Federico Mena - * - * Copyright (C) 2002 Anders Carlsson - * Copyright (C) 2002 James Henstridge - * Copyright (C) 2003 Soeren Sandmann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* modified by o1i 2005 - * $Id$ - */ - -#ifndef __GTK_TOOLBAR_H__ -#define __GTK_TOOLBAR_H__ - -#include -#include -#include -#include -/*#include */ - -#include - -#define GTK_TYPE_TOOLBAR (gtk_toolbar_get_type ()) -#define GTK_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOOLBAR, GtkToolbar)) -#define GTK_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLBAR, GtkToolbarClass)) -#define GTK_IS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOOLBAR)) -#define GTK_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR)) -#define GTK_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass)) - -#ifndef GTK_DISABLE_DEPRECATED -typedef enum -{ - GTK_TOOLBAR_CHILD_SPACE, - GTK_TOOLBAR_CHILD_BUTTON, - GTK_TOOLBAR_CHILD_TOGGLEBUTTON, - GTK_TOOLBAR_CHILD_RADIOBUTTON, - GTK_TOOLBAR_CHILD_WIDGET -} GtkToolbarChildType; - -typedef struct _GtkToolbarChild GtkToolbarChild; - -struct _GtkToolbarChild -{ - GtkToolbarChildType type; - GtkWidget *widget; - GtkWidget *icon; - GtkWidget *label; -}; - -#endif /* GTK_DISABLE_DEPRECATED */ - -typedef enum -{ - GTK_TOOLBAR_SPACE_EMPTY, - GTK_TOOLBAR_SPACE_LINE -} GtkToolbarSpaceStyle; - -typedef struct _GtkToolbar GtkToolbar; -typedef struct _GtkToolbarClass GtkToolbarClass; -typedef struct _GtkToolbarPrivate GtkToolbarPrivate; - -struct _GtkToolbar -{ - GtkContainer container; - - /*< public >*/ - gint num_children; - GList *children; - GSList *mgtk_children; /* as long as we have no GList .. TODO */ - GtkOrientation orientation; - GtkToolbarStyle style; - GtkIconSize icon_size; - - GtkTooltips *tooltips; - - /*< private >*/ - gint button_maxw; /* maximum width of homogeneous children */ - gint button_maxh; /* maximum height of homogeneous children */ - - guint style_set_connection; - guint icon_size_connection; - - guint style_set : 1; - guint icon_size_set : 1; - - guint space_size; -}; - -struct _GtkToolbarClass -{ - GtkContainerClass parent_class; - - /* signals */ - void (* orientation_changed) (GtkToolbar *toolbar, - GtkOrientation orientation); - void (* style_changed) (GtkToolbar *toolbar, - GtkToolbarStyle style); - gboolean (* popup_context_menu) (GtkToolbar *toolbar, - gint x, - gint y, - gint button_number); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); -}; - -GType gtk_toolbar_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_toolbar_new (void); -void gtk_toolbar_insert (GtkToolbar *toolbar, - GtkToolItem *item, - gint pos); -gint gtk_toolbar_get_item_index (GtkToolbar *toolbar, - GtkToolItem *item); -gint gtk_toolbar_get_n_items (GtkToolbar *toolbar); -GtkToolItem * gtk_toolbar_get_nth_item (GtkToolbar *toolbar, - gint n); -gboolean gtk_toolbar_get_show_arrow (GtkToolbar *toolbar); -void gtk_toolbar_set_show_arrow (GtkToolbar *toolbar, - gboolean show_arrow); -GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar); -void gtk_toolbar_set_orientation (GtkToolbar *toolbar, - GtkOrientation orientation); -gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar); -void gtk_toolbar_set_tooltips (GtkToolbar *toolbar, - gboolean enable); -GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar); -void gtk_toolbar_set_style (GtkToolbar *toolbar, - GtkToolbarStyle style); -void gtk_toolbar_unset_style (GtkToolbar *toolbar); -GtkIconSize gtk_toolbar_get_icon_size (GtkToolbar *toolbar); -GtkReliefStyle gtk_toolbar_get_relief_style (GtkToolbar *toolbar); -gint gtk_toolbar_get_drop_index (GtkToolbar *toolbar, - gint x, - gint y); -void gtk_toolbar_set_drop_highlight_item (GtkToolbar *toolbar, - GtkToolItem *tool_item, - gint index_); - -/* internal functions */ -gchar * _gtk_toolbar_elide_underscores (const gchar *original); -void _gtk_toolbar_paint_space_line (GtkWidget *widget, - GtkToolbar *toolbar, - GdkRectangle *area, - GtkAllocation *allocation); -gint _gtk_toolbar_get_default_space_size (void); -void _gtk_toolbar_rebuild_menu (GtkToolbar *toolbar); - - -/* deprecated */ -#ifndef GTK_DISABLE_DEPRECATED -void gtk_toolbar_set_icon_size (GtkToolbar *toolbar, - GtkIconSize icon_size); -void gtk_toolbar_unset_icon_size (GtkToolbar *toolbar); - -/* Simple button items */ -GtkWidget* gtk_toolbar_append_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GtkSignalFunc callback, - gpointer user_data); -GtkWidget* gtk_toolbar_prepend_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GtkSignalFunc callback, - gpointer user_data); -GtkWidget* gtk_toolbar_insert_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GtkSignalFunc callback, - gpointer user_data, - gint position); - -/* Stock Items */ -GtkWidget* gtk_toolbar_insert_stock (GtkToolbar *toolbar, - const gchar *stock_id, - const char *tooltip_text, - const char *tooltip_private_text, - GtkSignalFunc callback, - gpointer user_data, - gint position); - -/* Space Items */ -void gtk_toolbar_append_space (GtkToolbar *toolbar); -void gtk_toolbar_prepend_space (GtkToolbar *toolbar); -void gtk_toolbar_insert_space (GtkToolbar *toolbar, - gint position); -void gtk_toolbar_remove_space (GtkToolbar *toolbar, - gint position); -/* Any element type */ -GtkWidget* gtk_toolbar_append_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GtkSignalFunc callback, - gpointer user_data); - -GtkWidget* gtk_toolbar_prepend_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GtkSignalFunc callback, - gpointer user_data); - -GtkWidget* gtk_toolbar_insert_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GtkSignalFunc callback, - gpointer user_data, - gint position); - -/* Generic Widgets */ -void gtk_toolbar_append_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const char *tooltip_text, - const char *tooltip_private_text); -void gtk_toolbar_prepend_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const char *tooltip_text, - const char *tooltip_private_text); -void gtk_toolbar_insert_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const char *tooltip_text, - const char *tooltip_private_text, - gint position); - -#endif /* GTK_DISABLE_DEPRECATED */ - - -#endif /* __GTK_TOOLBAR_H__ */ diff --git a/mui/gtk-mui/gtk/gtktoolitem.h b/mui/gtk-mui/gtk/gtktoolitem.h deleted file mode 100644 index 2ec902ecd..000000000 --- a/mui/gtk-mui/gtk/gtktoolitem.h +++ /dev/null @@ -1,123 +0,0 @@ -/* gtktoolitem.c - * - * Copyright (C) 2002 Anders Carlsson - * Copyright (C) 2002 James Henstridge - * Copyright (C) 2003 Soeren Sandmann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* modified 2005 o1i - * $Id$ - */ - -#ifndef __GTK_TOOL_ITEM_H__ -#define __GTK_TOOL_ITEM_H__ - -#include -/*#include */ -/*#include */ -/*#include */ - -#define GTK_TYPE_TOOL_ITEM (gtk_tool_item_get_type ()) -#define GTK_TOOL_ITEM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_TOOL_ITEM, GtkToolItem)) -#define GTK_TOOL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOL_ITEM, GtkToolItemClass)) -#define GTK_IS_TOOL_ITEM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_TOOL_ITEM)) -#define GTK_IS_TOOL_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOL_ITEM)) -#define GTK_TOOL_ITEM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GTK_TYPE_TOOL_ITEM, GtkToolItemClass)) - -typedef struct _GtkToolItem GtkToolItem; -typedef struct _GtkToolItemClass GtkToolItemClass; -typedef struct _GtkToolItemPrivate GtkToolItemPrivate; - -struct _GtkToolItem -{ - /*GtkBin parent;*/ - GtkWidget parent; - - /*< private >*/ - GtkToolItemPrivate *priv; -}; - -struct _GtkToolItemClass -{ - /*GtkBinClass parent_class;*/ - GtkWidgetClass parent_class; - - /* signals */ - gboolean (* create_menu_proxy) (GtkToolItem *tool_item); - void (* toolbar_reconfigured) (GtkToolItem *tool_item); - gboolean (* set_tooltip) (GtkToolItem *tool_item, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private); - - /* Padding for future expansion */ - void (* _gtk_reserved1) (void); - void (* _gtk_reserved2) (void); - void (* _gtk_reserved3) (void); - void (* _gtk_reserved4) (void); -}; - -GType gtk_tool_item_get_type (void) G_GNUC_CONST; -GtkToolItem *gtk_tool_item_new (void); - -void gtk_tool_item_set_homogeneous (GtkToolItem *tool_item, - gboolean homogeneous); -gboolean gtk_tool_item_get_homogeneous (GtkToolItem *tool_item); - -void gtk_tool_item_set_expand (GtkToolItem *tool_item, - gboolean expand); -gboolean gtk_tool_item_get_expand (GtkToolItem *tool_item); - -void gtk_tool_item_set_tooltip (GtkToolItem *tool_item, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private); - -void gtk_tool_item_set_use_drag_window (GtkToolItem *toolitem, - gboolean use_drag_window); -gboolean gtk_tool_item_get_use_drag_window (GtkToolItem *toolitem); - -void gtk_tool_item_set_visible_horizontal (GtkToolItem *toolitem, - gboolean visible_horizontal); -gboolean gtk_tool_item_get_visible_horizontal (GtkToolItem *toolitem); - -void gtk_tool_item_set_visible_vertical (GtkToolItem *toolitem, - gboolean visible_vertical); -gboolean gtk_tool_item_get_visible_vertical (GtkToolItem *toolitem); - -gboolean gtk_tool_item_get_is_important (GtkToolItem *tool_item); -void gtk_tool_item_set_is_important (GtkToolItem *tool_item, - gboolean is_important); - -GtkIconSize gtk_tool_item_get_icon_size (GtkToolItem *tool_item); -GtkOrientation gtk_tool_item_get_orientation (GtkToolItem *tool_item); -GtkToolbarStyle gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item); -GtkReliefStyle gtk_tool_item_get_relief_style (GtkToolItem *tool_item); - -GtkWidget * gtk_tool_item_retrieve_proxy_menu_item (GtkToolItem *tool_item); -GtkWidget * gtk_tool_item_get_proxy_menu_item (GtkToolItem *tool_item, - const gchar *menu_item_id); -void gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item, - const gchar *menu_item_id, - GtkWidget *menu_item); -void gtk_tool_item_rebuild_menu (GtkToolItem *tool_item); - -/* internal function */ -void _gtk_tool_item_toolbar_reconfigured (GtkToolItem *tool_item); - -#endif /* __GTK_TOOL_ITEM_H__ */ diff --git a/mui/gtk-mui/gtk/gtkvbox.h b/mui/gtk-mui/gtk/gtkvbox.h deleted file mode 100644 index 3db56dfe7..000000000 --- a/mui/gtk-mui/gtk/gtkvbox.h +++ /dev/null @@ -1,16 +0,0 @@ - -/* dummy */ - -#include - -#include - -#define GTK_TYPE_VBOX (gtk_vbox_get_type ()) - -typedef struct _GtkVBoxClass GtkVBoxClass; - -struct _GtkVBoxClass -{ - GtkBoxClass parent_class; -}; - diff --git a/mui/gtk-mui/gtk/gtkwidget.h b/mui/gtk-mui/gtk/gtkwidget.h deleted file mode 100644 index 638057d19..000000000 --- a/mui/gtk-mui/gtk/gtkwidget.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __GTK_WIDGET_H__ -#define __GTK_WIDGET_H__ - -#include -#include - - -/* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer. - * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET. - */ -#define GTK_TYPE_WIDGET (gtk_widget_get_type ()) -#define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget)) -#define GTK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass)) -#define GTK_IS_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET)) -#define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET)) -#define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass)) - -/* Macros for extracting various fields from GtkWidget and GtkWidgetClass. - */ -#define GTK_WIDGET_TYPE(wid) (GTK_OBJECT_TYPE (wid)) -#define GTK_WIDGET_STATE(wid) (GTK_WIDGET (wid)->state) -#define GTK_WIDGET_SAVED_STATE(wid) (GTK_WIDGET (wid)->saved_state) - -/* Macros for extracting the widget flags from GtkWidget. - */ -#define GTK_WIDGET_FLAGS(wid) (wid->flags) -#define GTK_WIDGET_TOPLEVEL(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0) -#define GTK_WIDGET_NO_WINDOW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0) -#define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0) -#define GTK_WIDGET_MAPPED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0) -#define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0) -#define GTK_WIDGET_DRAWABLE(wid) (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid)) -#define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0) -#define GTK_WIDGET_PARENT_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0) -#define GTK_WIDGET_IS_SENSITIVE(wid) (GTK_WIDGET_SENSITIVE (wid) && \ - GTK_WIDGET_PARENT_SENSITIVE (wid)) -#define GTK_WIDGET_CAN_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0) -#define GTK_WIDGET_HAS_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0) -#define GTK_WIDGET_CAN_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0) -#define GTK_WIDGET_HAS_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0) -#define GTK_WIDGET_HAS_GRAB(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0) -#define GTK_WIDGET_RC_STYLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0) -#define GTK_WIDGET_COMPOSITE_CHILD(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0) -#define GTK_WIDGET_APP_PAINTABLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0) -#define GTK_WIDGET_RECEIVES_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0) -#define GTK_WIDGET_DOUBLE_BUFFERED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_DOUBLE_BUFFERED) != 0) - -/* Macros for setting and clearing widget flags. - */ -#define GTK_WIDGET_UNSET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END - -#define GTK_TYPE_REQUISITION (gtk_requisition_get_type ()) - - -typedef struct _GtkRequisition GtkRequisition; -typedef struct _GtkWidgetClass GtkWidgetClass; - -struct _GtkWidgetClass -{ - GtkObjectClass parent_class; - - /* Default signal handler for the ::destroy signal, which is - * invoked to request that references to the widget be dropped. - * If an object class overrides destroy() in order to perform class - * specific destruction then it must still invoke its superclass' - * implementation of the method after it is finished with its - * own cleanup. (See gtk_widget_real_destroy() for an example of - * how to do this). - */ - - - /* o1i: I could not find the following stuff in the GLib/GTK includes..? */ - void (*realize) (GtkObject *object); - gint (*expose_event) (GtkObject *object,GdkEventExpose *event); - void (*size_request) (GtkObject *object, GtkRequisition *requisition); - void (*size_allocate) (GtkObject *object, GtkAllocation *allocation); - gint (*button_press_event) (GtkObject *object, GdkEventButton *event); - gint (*button_release_event) (GtkObject *object, GdkEventButton *event); - gint (*motion_notify_event) (GtkObject *object, GdkEventMotion *event); - - /* normal stuff continues..*/ - - guint activate_signal; - guint set_scroll_adjustments_signal; - -}; - - -#endif /* __GTK_WIDGET_H__ */ - diff --git a/mui/gtk-mui/gtk/mmakefile.src b/mui/gtk-mui/gtk/mmakefile.src deleted file mode 100755 index 291c59361..000000000 --- a/mui/gtk-mui/gtk/mmakefile.src +++ /dev/null @@ -1,31 +0,0 @@ -# $Id$ -# -include $(TOP)/config/make.cfg - -#MM- contrib-gtk-includes : includes - -INCLUDE_FILES := gtk.h \ - gtkadjustment.h \ - gtkbox.h \ - gtkcontainer.h \ - gtkenums.h \ - gtkmain.h \ - gtkobject.h \ - gtkprogressbar.h \ - gtkrange.h \ - gtkrequisition.h \ - gtksettings.h \ - gtksignal.h \ - gtkstock.h \ - gtkstyle.h \ - gtktable.h \ - gtktogglebutton.h \ - gtktoolbar.h \ - gtktoolitem.h \ - gtkvbox.h \ - gtkwidget.h - -%copy_includes path=gtk includes=$(INCLUDE_FILES) - -%common - diff --git a/mui/gtk-mui/gtk_arrow.c b/mui/gtk-mui/gtk_arrow.c deleted file mode 100644 index 63c224b6c..000000000 --- a/mui/gtk-mui/gtk_arrow.c +++ /dev/null @@ -1,85 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -GtkWidget *gtk_arrow_new(GtkArrowType arrow_type, GtkShadowType shadow_type) { - - GtkWidget *ret = NULL; - Object *arr; - ULONG spec; - - DebOut("gtk_arrow_new(%ld,%ld)\n",arrow_type,shadow_type); - - if(shadow_type!=GTK_SHADOW_OUT) { - WarnOut("gtk_arrow_new: only GTK_SHADOW_OUT supported (type: %d)\n",shadow_type); - } - - switch (arrow_type) - { - case GTK_ARROW_UP : spec = MUII_ArrowUp; break; - case GTK_ARROW_DOWN : spec = MUII_ArrowDown; break; - case GTK_ARROW_LEFT : spec = MUII_ArrowLeft; break; - case GTK_ARROW_RIGHT: spec = MUII_ArrowRight; break; - default : - ErrOut("gtk_arrow_new: unknown type: %d\n",arrow_type); - return(NULL); - break; - } - - arr = ImageObject, ImageButtonFrame, - MUIA_InputMode , MUIV_InputMode_RelVerify, - MUIA_Image_Spec , spec, -#ifdef __MORPHOS__ - MUIA_Background , MUII_ImageButtonBack, -#else - MUIA_Background , MUII_ButtonBack, -#endif - MUIA_CycleChain , 1, - End; - - if (arr) - { - ret = mgtk_widget_new(IS_ARROW); - - if (ret) - ret->MuiObject = arr; - } - - return ret; -} diff --git a/mui/gtk-mui/gtk_button.c b/mui/gtk-mui/gtk_button.c deleted file mode 100644 index 1b374ad23..000000000 --- a/mui/gtk-mui/gtk_button.c +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id: - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -/* cross platform hooks */ -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkWidget* gtk_button_new (void) { - Object *button; - GtkWidget *ret; - - ret=mgtk_widget_new(IS_BUTTON); - -/* - button = (Object *) VGroup, - GroupSpacing(0), - MUIA_Weight, 0, - ButtonFrame, - MUIA_InputMode , MUIV_InputMode_RelVerify, - End; - */ - if(ret) { - button=NewObject(CL_Button->mcc_Class, NULL,MA_Widget,ret,TAG_DONE); - DebOut("gtk_button_new: %lx\n",button); - ret->MuiObject=button; - } - - return ret; -} - -GtkWidget* gtk_button_new_with_label(const char *label) { - Object *button; - GtkWidget *ret = NULL; - - /* Note: MUI_MakeObject() uses underscored char for keyboard shortcuts - ** - ** If this is not desired then we must use taglist way - */ - - ret = mgtk_widget_new(IS_BUTTON); - - if(ret) { - /*button = MUI_MakeObject(MUIO_Button, (ULONG)label);*/ - button=NewObject(CL_Button->mcc_Class, NULL,MA_Widget,ret,MA_Button_Label,(ULONG) label,TAG_DONE); - DebOut("gtk_button_new_with_label: %lx\n",button); - ret->MuiObject=button; - } - - return ret; -} - -GtkWidget* gtk_button_new_from_stock (const gchar *stock_id){ - - DebOut("gtk_button_new_from_stock(%s)\n",stock_id); - - if(!strcmp(stock_id,GTK_STOCK_CLOSE)) { - return gtk_button_new_with_label("\033cClose"); - } - - ErrOut("Unknown stock object: %s\n",stock_id); - return NULL; -} diff --git a/mui/gtk-mui/gtk_checkbutton.c b/mui/gtk-mui/gtk_checkbutton.c deleted file mode 100644 index 802452216..000000000 --- a/mui/gtk-mui/gtk_checkbutton.c +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -/* cross platform hooks */ -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkToggleButton *GTK_TOGGLE_BUTTON(GtkWidget *widget) { - - return (GtkToggleButton *) widget; -} - -/* to be tested.. */ -GtkWidget *gtk_toggle_button_new(void) { - GtkWidget *button; - - DebOut("gtk_toggle_button_new()\n"); - - button=mgtk_widget_new(IS_TOGGLEBUTTON); - - button->MuiObject=(APTR) NewObject(CL_ToggleButton->mcc_Class, NULL,MA_Widget,button,TAG_DONE); - - //return gtk_check_button_new_with_label (""); - - return button; - -} - -GtkWidget *gtk_check_button_new_with_label (const gchar *label) { - GtkWidget *ret = NULL; - Object *check; - - DebOut("gtk_check_button_new_with_label(%s)\n",label); - - ret=mgtk_widget_new(IS_CHECKBUTTON); - - check = NewObject(CL_CheckButton->mcc_Class, NULL,MA_Widget,ret,MA_Check_Label,label,TAG_DONE); - - ret->MuiObject = (APTR) check; - - return ret; -} - -void gtk_toggle_button_set_active( GtkToggleButton *toggle_button, gboolean is_active) { - - DebOut("gtk_toggle_button_set_active(%lx,%ld)\n",toggle_button,is_active); - - set(toggle_button->MuiObject,MA_Toggle_Value,(ULONG) is_active); - - return; -} - -gboolean gtk_toggle_button_get_active(GtkToggleButton *toggle_button) { - - DebOut("gtk_toggle_button_get_active(%lx)\n",toggle_button); - - return xget(toggle_button->MuiObject,MA_Toggle_Value); -} diff --git a/mui/gtk-mui/gtk_custom.c b/mui/gtk-mui/gtk_custom.c deleted file mode 100644 index f424064ae..000000000 --- a/mui/gtk-mui/gtk_custom.c +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkWidget *mgtk_custom_new(void) { - - GtkWidget *ret; - Object *custom; - - DebOut("gtk_custom_new()\n"); - - ret=mgtk_widget_new(IS_CUSTOM); - - custom = (APTR) NewObject(CL_Custom->mcc_Class, NULL,MA_Widget,ret,TAG_DONE); - - DebOut(" NewObject=%lx\n",custom); - - ret->MuiObject=custom; - - return ret; -} - diff --git a/mui/gtk-mui/gtk_entry.c b/mui/gtk-mui/gtk_entry.c deleted file mode 100644 index 218a57086..000000000 --- a/mui/gtk-mui/gtk_entry.c +++ /dev/null @@ -1,251 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -/* cross platform hooks */ -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -/* set textlenght here */ -GtkEntry *GTK_ENTRY(GtkWidget *widget) { - - widget->text_length=strlen(gtk_entry_get_text(widget)); - - return (GtkEntry *) widget; -} - -GtkTable *GTK_EDITABLE(GtkWidget *widget) { - return (GtkTable *) widget; -} - -GtkWidget *gtk_entry_new() { - GtkWidget *ret = NULL; - APTR entry; - - DebOut("gtk_entry_new()\n"); - - ret=mgtk_widget_new(IS_ENTRY); - -// entry = (APTR) MUI_MakeObject(MUIO_String, 0, 256); - entry=NewObject(CL_Entry->mcc_Class, NULL,MA_Widget,ret,MUIA_String_MaxLen,(LONG) 256,TAG_DONE); - - DebOut("ret=%lx\n",ret); - DebOut("entry=%lx\n",entry); - - - if (entry) { - set(entry, MUIA_CycleChain, 1); - - if (ret) { - ret->MuiObject = entry; - } - } - else { - ErrOut("Unable to get new entry object\n"); - } - - return ret; -} - -const gchar *gtk_entry_get_text( GtkEntry *entry ) { - const char *text; - - DebOut("gtk_entry_get_text(%lx)\n",entry); - DebOut(" MuiObject: %lx\n",entry->MuiObject); - -/* SetAttrs(entry->MuiObject,MUIA_String_Contents,(LONG) text, TAG_DONE);*/ - get( entry->MuiObject, MUIA_String_Contents, &text ); - - DebOut("Text is: %s\n",text); - - return text; -} - -void gtk_entry_set_max_length (GtkEntry *entry, gint length) { - - DebOut("gtk_entry_set_max_length(entry %lx, length %ld)\n",entry,length); - - SetAttrs(entry->MuiObject,MUIA_String_MaxLen,(LONG) length, TAG_DONE); - - return; -} - -void gtk_entry_set_text (GtkEntry *entry, const gchar *text) { - - DebOut("gtk_entry_set_text(entry %lx, text: %s)\n",entry,text); - - SetAttrs(entry->MuiObject,MUIA_String_Contents,(LONG) text, TAG_DONE); - - return; -} - -/*gtk_editable_insert_text (GTK_EDITABLE (entry), " world", -1, &tmp_pos);*/ - -void gtk_editable_insert_text (GtkEditable *editable, const gchar *in_text, gint new_text_length, gint *position) { - const char *oldtext; - char *newtext; - int newlen; - - DebOut("gtk_editable_insert_text (GtkEditable %lx, in_text: %s, new_text_length %ld, position: %ld)\n",editable,in_text,new_text_length,*position); - - oldtext=gtk_entry_get_text(editable); - - DebOut("oldtext: %s\n",oldtext); - - if(new_text_length == -1) { - new_text_length=strlen(in_text); - } - - newlen=strlen(oldtext)+new_text_length; - - DebOut("new_text_length: %ld\n",newlen); - DebOut("newlen: %ld\n",newlen); - - newtext = mgtk_allocvec(newlen+1, MEMF_ANY); - - if (newtext) - { - /* Btw in MUI4 there is a method to insert text directly - */ - - strncpy(newtext, oldtext, *position); - strncpy(newtext + *position, in_text, new_text_length); - strcpy(newtext + *position + new_text_length, oldtext + *position); - - *position = *position+new_text_length; - - gtk_entry_set_text(editable, newtext); - mgtk_freevec(newtext); - } - - DebOut("gtk_editable_insert_text: exit\n"); -} - -void gtk_editable_select_region(GtkEditable *editable, gint start, gint end) { - - WarnOut("WARNING: gtk_editable_select_region(): requires MUI4 (%d/%d)\n", start, end); - -#if 0 - // according to GTK documentation this is not required - set(editable->MuiObject, MUIA_String_BufferPos, start); -#endif - - /* Requires MUI4 - ** - ** VaporWare donated TextInput.mcc source code to Stefan Stuntz and it was - ** integrated to String.mui class. - */ - - set(editable->MuiObject, MUIA_Textinput_MarkStart, start); - set(editable->MuiObject, MUIA_Textinput_MarkEnd, end < 0 ? end : start + end); - - return; -} - -gchar* gtk_editable_get_chars(GtkEditable *editable, gint start_pos, gint end_pos) { - const gchar *gtext; - gchar *ret; - int size; - - DebOut("gtk_editable_get_chars(%lx,%ld,%ld=\n",editable,start_pos,end_pos); - - gtext=gtk_entry_get_text(editable); - - if(start_pos>strlen(gtext)) { - WarnOut("gtk_editable_get_chars: illegal start_pos\n"); - start_pos=0; - } - - if(end_pos==-1) { - end_pos=strlen(gtext); - } - - size=end_pos-start_pos+1; - - ret=g_strndup(gtext+start_pos,end_pos-start_pos); - - DebOut(" return: >%s<\n",ret); - return ret; -} - -void gtk_editable_set_editable(GtkEditable *editable, gboolean is_editable) { - LONG disable; - - DebOut("gtk_editable_set_editable(%lx,%ld)\n",editable,is_editable); - - if(is_editable) { - disable=0; - } - else { - disable=1; - } - - - if(editable->nextObject !=NULL) { - set(editable->nextObject,MUIA_Disabled,disable); /* there is a label around */ - } - else { - set(editable->MuiObject,MUIA_Disabled,disable); /* there is a label around */ - } - return; -} - -/* this does not hide the entry gadget, but sets secret mode - * this seems not to work under AROS - */ -void gtk_entry_set_visibility(GtkEditable *editable, gboolean is_visible) { - ULONG secret; - - DebOut("gtk_entry_set_visibility(%lx,%ld)\n",editable,is_visible); - - if(is_visible) { - secret=(ULONG) FALSE; - } - else { - secret=(ULONG) TRUE; - } - - set(mgtk_get_mui_action_object(editable),MUIA_String_Secret,secret); - - gtk_entry_set_text(editable,gtk_entry_get_text(editable)); - - return; -} - diff --git a/mui/gtk-mui/gtk_filesel.c b/mui/gtk-mui/gtk_filesel.c deleted file mode 100644 index 9e9ef5f7c..000000000 --- a/mui/gtk-mui/gtk_filesel.c +++ /dev/null @@ -1,206 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -#define OK_WIDGET 1; -#define CANCEL_WIDGET 2; - -GtkWidget* gtk_file_selection_new(const gchar *title){ - - GtkWidget *ret; - GtkWidget *ok; - GtkWidget *cancel; - GSList *gl; - - DebOut("gtk_file_selection_new(%s)\n",title); - - ret=mgtk_widget_new(IS_FILESEL); - ok=mgtk_widget_new(IS_FILESEL); - cancel=mgtk_widget_new(IS_FILESEL); - - ret->title=g_strdup(title); - - /* we store in draw_value, which button this is */ - ok->draw_value=OK_WIDGET; - cancel->draw_value=CANCEL_WIDGET; - - ret->ok_button=(APTR) ok; - ret->cancel_button=(APTR) cancel; - ret->active=1; /* if 0, someone called a destroy on us */ - - mgtk_add_child(ret,ok); - mgtk_add_child(ret,cancel); - - gl=mgtk->windows; - gl=g_slist_append(gl,ret); - mgtk->windows=gl; - - return ret; -} - -GtkFileSelection* GTK_FILE_SELECTION(GtkWidget *widget) { - return((GtkFileSelection *) widget); -} - -const gchar* gtk_file_selection_get_filename(GtkFileSelection *filesel) { - - DebOut("gtk_file_selection_get_filename(%lx)\n",filesel); - - return filesel->tip_text; -} - -void gtk_file_selection_set_filename (GtkFileSelection *filesel, const gchar *filename) { - - DebOut("gtk_file_selection_set_filename(%lx,%s)\n",filesel,filename); - - filesel->tip_text=g_strdup(filename); - - return; -} - -/* - * this is the main function: - * - show file selector with all stored parameters - * - call the stored callbacks for ok/cancel - */ -void mgtk_file_selection_show(GtkWidget *widget) { - struct FileRequester *req; - char *dir; - char *file; - char empty[]=""; - GtkWidget *button; - void (*callme)(GtkWidget *widget,gpointer data); - mgtk_signal_connect_data *callback; - GSList *gl; - - DebOut("mgtk_file_selection_show(%lx)\n",widget); - - if(widget->tip_text) { /* we already have a filename */ - file=g_strdup(widget->tip_text); - } - else { - file=g_strdup(empty); - } - - while(widget->active) { - if ((req=MUI_AllocAslRequestTags(ASL_FileRequest, - ASLFR_Window,mgtk->MuiRoot , - ASLFR_TitleText, widget->title, - /* ASLFR_InitialLeftEdge, left, - ASLFR_InitialTopEdge , top, - ASLFR_InitialWidth , width, - ASLFR_InitialHeight , height,*/ - ASLFR_InitialDrawer , "PROGDIR:", - ASLFR_InitialFile, file, - /* ASLFR_InitialPattern , "#?.iff",*/ - /* ASLFR_DoSaveMode , save, - ASLFR_DoPatterns , TRUE,*/ - ASLFR_RejectIcons , TRUE, - ASLFR_UserData , widget, - /* ASLFR_IntuiMsgFunc , &IntuiMsgHook,*/ - TAG_DONE))) { - - set(mgtk->MuiApp,MUIA_Application_Sleep,TRUE); - - if (MUI_AslRequestTags(req,TAG_DONE)) - { - if (*req->fr_File) - { - DebOut(" selected dir: >%s<\n",req->fr_Drawer); - DebOut(" selected file: >%s<\n",req->fr_File); - dir=g_strdup(req->fr_Drawer); - if(strlen(dir)>0) { - if((dir[strlen(dir)-1] == ':')||(dir[strlen(dir)-1] == '/')) { - widget->tip_text=g_strdup_printf("%s%s",dir,req->fr_File); - } - else { - widget->tip_text=g_strdup_printf("%s/%s",dir,req->fr_File); - } - } - else { - widget->tip_text=g_strdup(req->fr_File); - } - DebOut(" full filename: %s\n",widget->tip_text); - g_free(dir); - } - button=(GtkWidget *) widget->ok_button; - } - else { /* cancel */ - button=(GtkWidget *) widget->cancel_button; - } -#ifndef __AROS__ - MUI_FreeAslRequest(req); /*??*/ -#endif - set(mgtk->MuiApp,MUIA_Application_Sleep,FALSE); - - /* now call all callbacks of this button */ - if(button->mgtk_signal_connect_data) { - DebOut(" found remember structure\n"); - callback=(mgtk_signal_connect_data *) button->mgtk_signal_connect_data; - /* call all remembered functions */ - while(callback) { - callme=(void *) callback->c_handler; - DebOut(" calling callback %lx\n",callme); - if(callback->connect_flags == G_CONNECT_SWAPPED) { - (*callme)(callback->data,button); - } - else { - (*callme)(button,callback->data); - } - callback=(mgtk_signal_connect_data *)callback->next; - } - } - } - else { - ErrOut("gtk_filesel.c: ERROR: unable to AllocAslRequest!\n"); - } - } - - g_free(file); - - /* now check, if there is still a window left */ - - gl=mgtk->windows; - if(!g_slist_length(gl)) { - DebOut(" request was the last open window, so quit\n"); - gtk_main_quit(); - } - - /* we did it, phew. */ - return; -} diff --git a/mui/gtk-mui/gtk_fixed.c b/mui/gtk-mui/gtk_fixed.c deleted file mode 100644 index 5b1a7b22b..000000000 --- a/mui/gtk-mui/gtk_fixed.c +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkFixed *GTK_FIXED(GtkWidget* widget) { - return (GtkFixed *) widget; -} - -GtkWidget *gtk_fixed_new(void) { - - GtkWidget *ret; - Object *fixed; - - DebOut("gtk_fixed_new()\n"); - - ret=mgtk_widget_new(IS_FIXED); - - fixed = (APTR) NewObject(CL_Fixed->mcc_Class, NULL,MA_Widget,ret,TAG_DONE); - - DebOut(" NewObject=%lx\n",fixed); - - ret->MuiObject=fixed; - - return ret; -} - -void gtk_fixed_put(GtkFixed *fixed, GtkWidget *widget, gint x, gint y) { - - DebOut("gtk_fixed_put(%lx,%lx,%d,%d)\n",fixed,widget,x,y); - - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - DoMethod(fixed->MuiObject,OM_ADDMEMBER,widget->MuiObject); - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - - gtk_fixed_move(fixed,widget,x,y); -} - -void gtk_fixed_move(GtkFixed *fixed, GtkWidget *widget, gint x, gint y) { - - struct MA_Fixed_Move_Data *data; - - DebOut("gtk_fixed_move(%lx,%lx,%d,%d)\n",fixed,widget,x,y); - - data=g_new(struct MA_Fixed_Move_Data,1); - - data->widget=widget; - data->x=x; - data->y=y; - - set(fixed->MuiObject,MA_Fixed_Move,data); - - g_free(data); - -} - diff --git a/mui/gtk-mui/gtk_frame.c b/mui/gtk-mui/gtk_frame.c deleted file mode 100644 index 1cff46a08..000000000 --- a/mui/gtk-mui/gtk_frame.c +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -GtkWidget* gtk_frame_new(const gchar *label) { - - GtkWidget *ret; - Object *frame; - gchar *t; - gchar empty[]=""; - - DebOut("gtk_frame_new(%s)\n",label); - - ret=mgtk_widget_new(IS_FRAME); - - if(label) { - t=g_strdup(label); - frame=(APTR) HGroup,MUIA_Frame, MUIV_Frame_Group, MUIA_FrameTitle, t, MUIA_Background, MUII_GroupBack,End; - } - else { - t=g_strdup(empty); - frame=(APTR) HGroup,MUIA_Frame, MUIV_Frame_Group, MUIA_Background, MUII_GroupBack,End; - } - - - ret->MuiObject=frame; - ret->title=t; - - return ret; -} - -void gtk_frame_set_shadow_type(GtkFrame *frame, GtkShadowType type) { - - DebOut("gtk_frame_set_shadow_type(%lx,%d)\n",frame,type); - - if(type == GTK_SHADOW_NONE) { - DebOut("TODO: type=GTK_SHADOW_NONE\n"); - } - - /* just ignore it.. */ -} - -GtkFrame* GTK_FRAME(GtkWidget* widget) { - return((GtkFrame *) widget); -} - diff --git a/mui/gtk-mui/gtk_globals.c b/mui/gtk-mui/gtk_globals.c deleted file mode 100644 index b370b8706..000000000 --- a/mui/gtk-mui/gtk_globals.c +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -/* cross platform hooks */ -#include - -#include -#include "debug.h" - -/* globals */ -#ifndef __AMIGAOS4__ -struct GfxBase *GfxBase; -struct IntuitionBase *IntuitionBase; -struct Library *UtilityBase; -#else -struct Library *GadToolsBase ; -struct GadToolsIFace *IGadTools; -struct MUIMasterIFace *IMUIMaster; -#endif -struct Library *MUIMasterBase; - -struct mgtk_ObjApp *mgtk; -struct Remember *rememberKey = NULL; - -struct MUI_CustomClass *CL_RootGroup; -struct MUI_CustomClass *CL_Custom; -struct MUI_CustomClass *CL_Table; -struct MUI_CustomClass *CL_SpinButton; -struct MUI_CustomClass *CL_NoteBook; -struct MUI_CustomClass *CL_ProgressBar; -struct MUI_CustomClass *CL_Timer; -struct MUI_CustomClass *CL_Fixed; -struct MUI_CustomClass *CL_CheckButton; -struct MUI_CustomClass *CL_ToggleButton; -struct MUI_CustomClass *CL_RadioButton; -struct MUI_CustomClass *CL_Button; -struct MUI_CustomClass *CL_Menu; -struct MUI_CustomClass *CL_Entry; -struct MUI_CustomClass *CL_Toolbar; - -int gtk_do_main_quit=0; diff --git a/mui/gtk-mui/gtk_globals.h b/mui/gtk-mui/gtk_globals.h deleted file mode 100644 index a2be26854..000000000 --- a/mui/gtk-mui/gtk_globals.h +++ /dev/null @@ -1,70 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#ifndef GLOBALS_H -#define GLOBALS_H 1 -/* globals */ - -#include - -#ifndef va_copy -#define va_copy __va_copy -#endif - -#ifndef __AMIGAOS4__ -extern struct GfxBase *GfxBase; -extern struct IntuitionBase *IntuitionBase; -#else -extern struct GadToolsIFace *IGadTools; -#endif -extern struct Library *MUIMasterBase; - -extern struct mgtk_ObjApp *mgtk; -extern struct Remember *rememberKey; - -extern struct MUI_CustomClass *CL_RootGroup; -extern struct MUI_CustomClass *CL_Table; -extern struct MUI_CustomClass *CL_Custom; -extern struct MUI_CustomClass *CL_SpinButton; -extern struct MUI_CustomClass *CL_NoteBook; -extern struct MUI_CustomClass *CL_ProgressBar; -extern struct MUI_CustomClass *CL_Timer; -extern struct MUI_CustomClass *CL_Fixed; -extern struct MUI_CustomClass *CL_CheckButton; -extern struct MUI_CustomClass *CL_ToggleButton; -extern struct MUI_CustomClass *CL_RadioButton; -extern struct MUI_CustomClass *CL_Button; -extern struct MUI_CustomClass *CL_Menu; -extern struct MUI_CustomClass *CL_Entry; -extern struct MUI_CustomClass *CL_Toolbar; - -extern int gtk_do_main_quit; - -#endif diff --git a/mui/gtk-mui/gtk_grab.c b/mui/gtk-mui/gtk_grab.c deleted file mode 100644 index a4ffe9c09..000000000 --- a/mui/gtk-mui/gtk_grab.c +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -GtkWidget *gtk_grab_get_current(void) { - - DebOut("gtk_grab_get_current()\n"); - - return mgtk->grab; -} - -void gtk_grab_add(GtkWidget *widget) { - - DebOut("gtk_grab_add(%lx)\n"); - - if(widget != mgtk->grab) { - WarnOut("gtk_grab_add is just a dummy\n"); - mgtk->grab=widget; - } -} - -void gtk_grab_remove(GtkWidget *widget) { - DebOut("gtk_grab_remove(%lx)\n"); - - WarnOut("gtk_grab_remove is just a dummy\n"); - mgtk->grab=NULL; -} diff --git a/mui/gtk-mui/gtk_handle_box.c b/mui/gtk-mui/gtk_handle_box.c deleted file mode 100644 index 3b7f3c71d..000000000 --- a/mui/gtk-mui/gtk_handle_box.c +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -GtkWidget* gtk_handle_box_new() { - - GtkWidget *ret; - Object *box; - - DebOut("gtk_handle_box_new()\n"); - - ret=mgtk_widget_new(IS_HANDLEBOX); - - box=(APTR) HGroup,End; - - ret->MuiObject=box; - - return ret; -} - diff --git a/mui/gtk-mui/gtk_hooks.c b/mui/gtk-mui/gtk_hooks.c deleted file mode 100644 index 987629b21..000000000 --- a/mui/gtk-mui/gtk_hooks.c +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id: - * - *****************************************************************************/ - -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -/******************************************* - *mgtk_get_action_object(GtkWidget *widget) - * - * in case a MuiObject is packed in a frame or such, - * this function returns the action object - * (frame with a checkbox -> checkbox) - *******************************************/ -Object *mgtk_get_mui_action_object(GtkWidget *widget) { - - if(widget->nextObject!=NULL) { - return((APTR) widget->nextObject); - } - if(widget->MuiObject==NULL) { - ErrOut("mgtk_get_mui_action_object called on NULL pointer..\n"); - } - return(widget->MuiObject); -} - -/***************************************************************************/ - -/* #define MUIA_Prop_Pressed 0x80422cd7*/ /* V6 g BOOL */ /* private */ - - -/* - * gtk_signal_connect_full is deprecated and should not be used in - * newly-written code. Use g_signal_connect_data() instead. - */ -gulong gtk_signal_connect_full (GtkObject *object, - const gchar *name, - GtkSignalFunc func, - GtkCallbackMarshal unsupported, - gpointer data, - GtkDestroyNotify destroy_func, - gint object_signal, - gint after) { - - return g_signal_connect_data((gpointer) object, name, (GCallback) func, data, (GClosureNotify) destroy_func, (GConnectFlags) object_signal); - -} - diff --git a/mui/gtk-mui/gtk_image.c b/mui/gtk-mui/gtk_image.c deleted file mode 100644 index 319a41d80..000000000 --- a/mui/gtk-mui/gtk_image.c +++ /dev/null @@ -1,109 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id: - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -#ifndef __AROS__ -#define MUIA_Dtpic_Name 0x80423d72 -#else -#warning I hacked this in here - Jack -#define MUIA_Dtpic_Name (MUIB_MUI|0x00423d72) /* i.. STRPTR */ -#endif - -GtkWidget* gtk_image_new(void) { - Object *pic; - GtkWidget*ret; - - DebOut("gtk_image_new()\n"); - - ret=mgtk_widget_new(IS_IMAGE); - - pic=(APTR) ImageObject, - End; - - ret->MuiObject=pic; - - return ret; -} - -GtkWidget* gtk_image_new_from_file(const gchar *filename) { - - Object *pic; - GtkWidget*ret; -#ifdef __AROS__ - BPTR lock; -#else - APTR lock; -#endif - - DebOut("gtk_image_new_from_file(%s)\n",filename); - - ret=mgtk_widget_new(IS_IMAGE); - - DebOut("Loading %s..\n",filename); - - lock=NULL; - pic=NULL; - if ((lock = Lock(filename, ACCESS_READ)) != NULL) { - pic=(APTR) MUI_NewObject("Dtpic.mui",MUIA_Dtpic_Name,(ULONG) filename,TAG_DONE); - UnLock(lock); - DebOut("Loaded %s successfully\n",filename); - } - - if(!pic) { - pic=HVSpace; - WarnOut("gtk_image_new_from_file: pic (%s) can't be loaded, we use a HVSpace instead.\n",filename); - } - - ret->MuiObject=pic; - - return ret; -} - -GdkPixbuf* gdk_pixbuf_new_from_file(const char *filename, GError **error) { - - GError *newerror; - - newerror=(GError *) g_new(GError *,1); - - DebOut("gdk_pixbuf_new_from_file(%s)\n",filename); - - return (GdkPixbuf*) gtk_image_new_from_file(filename); -} - diff --git a/mui/gtk-mui/gtk_init.c b/mui/gtk-mui/gtk_init.c deleted file mode 100644 index e280bc606..000000000 --- a/mui/gtk-mui/gtk_init.c +++ /dev/null @@ -1,273 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#ifndef __MORPHOS__ -#include -#endif -#include -#include -#include -#include -#include -/* I need exactly one place, where proto/muimaster.h is included..? */ -#include -#include -/* cross platform hooks */ -#include - -#include "classes.h" -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -void Close_Libs(void); - -BOOL Open_Libs(void ) -{ - if ((MUIMasterBase=(struct Library *) OpenLibrary(MUIMASTER_NAME,19)) ) -#ifndef __AMIGAOS4__ - if ((IntuitionBase=(struct IntuitionBase *) OpenLibrary("intuition.library",39)) ) - if ((GfxBase= (struct GfxBase *) OpenLibrary("graphics.library",0)) ) - if ((UtilityBase= (struct UtilityBase *) OpenLibrary("utility.library", 0))) -#else - if ((GadToolsBase= OpenLibrary("gadtools.library" ,39)) ) - if ((IMUIMaster= (struct Interface *) GetInterface(MUIMasterBase,"main",1,NULL)) ) - if ((IGadTools= (struct GadToolsIFace *) GetInterface(GadToolsBase, "main", 1, NULL)) ) -#endif - if (mgtk_create_rootgroup_class()) - if (mgtk_create_table_class()) - if (mgtk_create_spinbutton_class()) - if (mgtk_create_notebook_class()) - if (mgtk_create_progressbar_class()) - if (mgtk_create_timer_class()) - if (mgtk_create_fixed_class()) - if (mgtk_create_checkbutton_class()) - if (mgtk_create_togglebutton_class()) - if (mgtk_create_radiobutton_class()) - if (mgtk_create_button_class()) - if (mgtk_create_menu_class()) - if (mgtk_create_entry_class()) - if (mgtk_create_toolbar_class()) - if (mgtk_create_custom_class()) - { - return (1); - } - - Close_Libs(); - return(0); -} - -void Close_Libs(void) -{ - mgtk_delete_table_class(); - mgtk_delete_spinbutton_class(); - mgtk_delete_notebook_class(); - mgtk_delete_progressbar_class(); - mgtk_delete_timer_class(); - mgtk_delete_fixed_class(); - mgtk_delete_checkbutton_class(); - mgtk_delete_togglebutton_class(); - mgtk_delete_radiobutton_class(); - mgtk_delete_button_class(); - mgtk_delete_menu_class(); - mgtk_delete_entry_class(); - mgtk_delete_toolbar_class(); - mgtk_delete_custom_class(); - mgtk_delete_rootgroup_class(); - -#ifndef __AMIGAOS4__ - CloseLibrary((struct Library *)IntuitionBase); - CloseLibrary((struct Library *)GfxBase); - CloseLibrary((struct Library *)UtilityBase); -#else - if (IMUIMaster) DropInterface((struct Interface *)IMUIMaster); - if (GadToolsBase) CloseLibrary(GadToolsBase); - if (IGadTools) DropInterface(IGadTools); -#endif - CloseLibrary(MUIMasterBase); -} - -/********************************* - * init_fundamentals - *********************************/ -static int init_fundamentals() { - mgtk->default_style=mgtk_get_default_style(mgtk->MuiRoot); - - if (mgtk->default_style) - { - mgtk_g_type_register_fundamental(IS_GROUP,"hbox",&mgtk_hbox_new_noparams); - mgtk_g_type_register_fundamental(IS_CUSTOM,"mgtkcustom",&mgtk_custom_new); - - g_signal_new("toggled", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("clicked", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("pressed", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("released", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("destroy", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("changed", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("value_changed", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("realized", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("activate", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("child-detached", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - g_signal_new("child-attached", 0, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL); - return 1; - } - return 0; -} -/********************************* - * gtk_init - * - * create MuiApp and init mgtk - * - *********************************/ -void gtk_init(int *argc, char ***argv) -{ - char *tname; - char *i; - char *name; - -#if defined ENABLE_RT - RT_Init(); -#endif - - if ( ! Open_Libs() ) - { - printf("GTK: fatal error: Cannot open libs\n"); - exit(1); - } - - mgtk=g_new(struct mgtk_ObjApp,1); - - if(!mgtk) { - exit(1); - } - - /* get program name */ - tname=*argv[0]; - i=*argv[0]; - - while(i[0]) { - if((i[0]=='/') || (i[0]==':')) { - tname=i+1; - } - i++; - } - - /* TODO: This could (should) be handled in the application class subclass -itix - */ - - if(tname[0]) { - name=g_strdup_printf("GTK %s",tname); - } - else { - name=g_strdup("GTK Application"); - } - - if (!init_fundamentals()) - { - printf("GTK: out of memory\n"); - exit(1); - } - - mgtk->MuiApp = (APTR) ApplicationObject, - MUIA_Application_Title , name, - MUIA_Application_Version , "$VER: 0.0.1 (6/13/05)", - MUIA_Application_Copyright , "GTK-MUI: LGPL", - MUIA_Application_Author , "GTK by Oliver Brunner", - MUIA_Application_Description,"A program built with GTK wrapper", -#ifndef __AROS__ - MUIA_Application_Base , "GTK wrapper", -#endif - SubWindow, mgtk->MuiRoot = (APTR) WindowObject, - MUIA_Window_Menustrip, mgtk->MuiRootStrip = (APTR) MenustripObject, - MUIA_Menustrip_Enabled, (LONG) FALSE, - End, - MUIA_Window_Title, "First empty Window", -#ifndef __AROS__ - MUIA_Window_ID , MAKE_ID('M','G','T','K'), -#endif - WindowContents, mgtk->Group = (APTR) NewObject(CL_RootGroup->mcc_Class, NULL,TAG_DONE), - End, - End; - - g_free(name); - - /* MuiApp fails if MuiRootStrip failed */ - - if (!mgtk->MuiApp) { - printf("gtk_window_new: Cannot create application. (%ld,%ld)\n",(long int) mgtk->MuiApp,(long int) mgtk->MuiRootStrip); - exit(1); - } - - DoMethod(mgtk->MuiRoot,MUIA_Window_Width,150); - DoMethod(mgtk->MuiRoot,MUIM_Notify,MUIA_Window_CloseRequest,TRUE, - mgtk->MuiApp,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit); - - DebOut("mgtk->MuiApp: %lx\n",mgtk->MuiApp); - DebOut("mgtk->MuiRoot: %lx\n",mgtk->MuiRoot); - DebOut("mgtk->MuiRootStrip: %lx\n",mgtk->MuiRootStrip); - DebOut("mgtk->MuiGroup: %lx\n",mgtk->Group); - -/* - mgtk->black_pen=ObtainBestPenA( ViewAddress()->ViewPort->ColorMap, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, NULL ); - */ - - #if USE_PENS - mgtk->white_black_optained=0; - if ((mgtk->screen = LockPubScreen(0))) { - if ((mgtk->dri = GetScreenDrawInfo(mgtk->screen))) { - if ((mgtk->visualinfo = GetVisualInfoA(mgtk->screen, NULL))) { - mgtk->white_pen=ObtainBestPen( mgtk->screen->ViewPort.ColorMap, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, OBP_FailIfBad, FALSE, TAG_DONE ); - mgtk->black_pen=ObtainBestPen( mgtk->screen->ViewPort.ColorMap, 0, 0, 0, OBP_FailIfBad, FALSE, TAG_DONE ); - mgtk->white_black_optained=1; - } - else { - DebOut("WARNING: Init: Unable to GetVisualInfoA\n"); - } - } - else { - DebOut("WARNING: Init: Unable to GetScreenDrawInfo\n"); - } - } - else { - DebOut("WARNING: Init: Unable to LockPubScreen\n"); - } - - /* if anything above failed */ - if(!mgtk->white_black_optained) { - mgtk->white_pen=MGTK_PEN_WHITE; - mgtk->black_pen=MGTK_PEN_BLACK; /* naja.. */ - } - #endif - - return; -} - diff --git a/mui/gtk-mui/gtk_label.c b/mui/gtk-mui/gtk_label.c deleted file mode 100644 index 5eb587347..000000000 --- a/mui/gtk-mui/gtk_label.c +++ /dev/null @@ -1,165 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#ifdef __MORPHOS__ - #include -#endif - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - - -GtkLabel *GTK_LABEL(GtkWidget *widget) { - return (GtkLabel *) widget; -} - -GtkWidget *gtk_label_new( const char *str ) { - - GtkWidget *ret; - Object *label; - char *s; - - DebOut("gtk_label_new(%s)\n",str); - - ret = mgtk_widget_new(IS_LABEL); - - if(str) { - s=g_strdup_printf("%s%s",MUIX_L,str); - label = (APTR) MUI_MakeObject(MUIO_Label, s,MUIO_Label_Centered,0); - ret->title=s; - } - else { - label = (APTR) MUI_MakeObject(MUIO_Label, "",MUIO_Label_Centered,0); - ret->title=(char *) NULL; - } - - ret->MuiObject = label; - - return ret; -} - -/******************* - * as far as I see, changing the text of a text label is - * not possible in MUI!? - * ok, the we delete the label and create a new one ;) - *******************/ - -void gtk_label_set_text(GtkLabel *label, const char *str) { - Object *parent; - Object *old; - Object *new; - Object *o; - struct List *list; - struct Node *state; - int i; - ULONG *msg; - - DebOut("gtk_label_set_text(%x,%s)\n",(int) label,str); - - if(!strcmp(str,label->title)) { - DebOut(" same strings, nothing to do\n"); - return; - } - - /* delete old string.. */ - if(label->title) { - g_free(label->title); - label->title=(char *) NULL; - } - - if(str) { - label->title=g_strdup(str); - } - else { - label->title=g_strdup(""); - } - - old=label->MuiObject; - new = (APTR) MUI_MakeObject(MUIO_Label, label->title ,MUIO_Label_Centered, 0); - label->MuiObject=new; - - parent=(Object *) xget(old,MUIA_Parent); - DebOut(" parent: %x\n",parent); - - if(parent) { - list=(struct List *) xget(parent,MUIA_Group_ChildList); - DebOut(" list: %x\n",list); - - state = list->lh_Head; - i=0; - DebOut(" old object: %x\n",old); - while ( (o = NextObject( &state )) ) { - DebOut(" old childs: %x\n",o); - i++; - } - - /* thanks, Georg ;) */ - msg=(APTR) g_new(char,sizeof(struct MUIP_Group_Sort) + sizeof(Object *) * (i+1)); - - /* create new sort order */ - msg[0]=MUIM_Group_Sort; - - state = list->lh_Head; - i=1; - DebOut(" new object: %x\n",new); - while ( (o = NextObject( &state )) ) { - if(o!=old) { - msg[i]=(ULONG) o; - } - else { - msg[i]=(ULONG) new; - } - DebOut(" new childs: %x\n",msg[i]); - i++; - } - msg[i]=0; - - DebOut(" remove/add/sort childs\n"); - - DoMethod(parent,MUIM_Group_InitChange); - DoMethod(parent,OM_REMMEMBER,old); - DoMethod(parent,OM_ADDMEMBER,new); - DoMethodA(parent, msg); - DoMethod(parent,MUIM_Group_ExitChange); - - g_free(msg); - } - DisposeObject(old); - - return; -} - diff --git a/mui/gtk-mui/gtk_menu.c b/mui/gtk-mui/gtk_menu.c deleted file mode 100644 index f10afc1d7..000000000 --- a/mui/gtk-mui/gtk_menu.c +++ /dev/null @@ -1,397 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -/* cross platform hooks */ -#ifndef __AROS__ - #define MGTK_HOOK_OBJECT_POINTER Object * - #define MGTK_HOOK_APTR APTR - #define MGTK_USERFUNC_INIT - #define MGTK_USERFUNC_EXIT - #include -#else - #include "mgtk_aros.h" -#endif - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkWidget *gtk_menu_new( void ) { - GtkWidget *ret; - - /* gtk_menu_new creates a IS_MENU Object, which is *not* displayed in MUI - * it just contains IS_MENUITEM Objects, which are visible - */ - - ret=mgtk_widget_new(IS_MENU); - - return ret; -} - -#if 0 -HOOKPROTO(MUIHookFunc_menu,ULONG,MGTK_HOOK_OBJECT_POINTER obj,MGTK_HOOK_APTR bla) { - MGTK_USERFUNC_INIT - - GtkWidget *widget; - - DebOut("MUIHookFunc_menu called for obj %lx (%lx)\n",obj,bla); - - widget=(GtkWidget *) xget(obj,MA_Widget); - - if(!widget) { - DebOut("ERROR: widget for obj %lx not found!\n",obj); - } - else { - g_signal_emit_by_name(widget,"activate"); - } -// call_gtk_hooks_activated(obj); - return(0); - MGTK_USERFUNC_EXIT -} - -MakeHook(MyMuiHook_menu, MUIHookFunc_menu); -#endif - -GtkWidget *gtk_menu_item_new_with_label( const char *label ) { - APTR menu; - GtkWidget *ret; - char *s; - - DebOut("gtk_menu_item_new_with_label(%s)\n",label); - - ret=mgtk_widget_new(IS_MENUITEM); - - s=g_strdup(label); - -// menu = (APTR) MUI_MakeObject(MUIO_Menuitem,s ,0,0,0); - menu = (APTR) NewObject(CL_Menu->mcc_Class, NULL,MA_Widget,ret,MUIA_Menuitem_Title,s,TAG_DONE); - - // DoMethod(menu,MUIM_Notify, MUIA_Menuitem_Trigger, MUIV_EveryTime, menu, 2, MUIM_CallHook, &MyMuiHook_menu); - - ret->MuiObject=menu; - ret->title=s; - - return ret; -} - -/* not sure, if this is usefull ..*/ -GtkWidget *gtk_menu_item_new(void) { - - return gtk_menu_item_new_with_label(""); -} - -GtkWidget *gtk_menu_bar_new (void) { - GtkWidget *ret; - - ret=mgtk_widget_new(IS_MENUBAR); - - return ret; -} - -void gtk_menu_shell_append (GtkMenuShell *menu_shell, GtkWidget *child) { - GtkWidget *i; - - DebOut("gtk_menu_shell_append (GtkMenuShell %lx,GtkWidget %lx)\n",menu_shell,child); - - DebOut(" gtk_menu_shell_append: menu_shell->type: %lx\n",menu_shell->type); - DebOut(" gtk_menu_shell_append: child->type: %lx\n",child->type); - - if(child->type == IS_MENU) { - /* as a IS_MENU is invisible, we add it's children */ - DebOut(" gtk_menu_shell_append: adding children of IS_MENU\n"); - i=(GtkWidget *) child->nextObject; - while(i!=NULL) { - DoMethod(menu_shell->MuiObject,MUIM_Family_AddTail,i->MuiObject); - i=(GtkWidget *) i->nextObject; - } - return; - } - - if(menu_shell->type == IS_MENUBAR) { - /* level 1 (in screen bar) */ - - DebOut(" gtk_menu_shell_append: target is MENUBAR\n"); - DebOut(" mgtk->MuiRootStrip: %lx\n",mgtk->MuiRootStrip); - DebOut(" child->MuiObject: %lx\n",child->MuiObject); - DebOut(" menu_shell->MuiObject: %lx\n",menu_shell->MuiObject); - DebOut(" menu_shell->MuiWinMenustrip: %lx\n",menu_shell->MuiWinMenustrip); - - /* attach menu */ - DoMethod(menu_shell->MuiWinMenustrip,MUIM_Family_AddHead,child->MuiObject); - return; - } - - if((menu_shell->type == IS_MENU) && (child->type == IS_MENUITEM)) { - /* as menu_shell- is invisible, it does not have a MUI Object..*/ - DebOut(" gtk_menu_shell_append: remember this child in menu_shell\n"); - i=menu_shell; - while(i->nextObject != NULL) { - i=(GtkWidget *) i->nextObject; - } - i->nextObject=(APTR) child; - return; - } - - if((menu_shell->type == IS_MENU) && (child->type == IS_MENU)) { - /* add to level 1 */ - DebOut(" IS_MENU: menu_shell->MuiObject: %lx\n",menu_shell->MuiObject); - DebOut(" IS_MENU: child->MuiObject: %lx\n",child->MuiObject); - DoMethod(menu_shell->MuiObject,MUIM_Family_AddTail,child->MuiObject); - return; - } - - WarnOut("gtk_menu_shell_append with non strange objects (%d,%d) ignored !?\n",menu_shell->type,child->type); - return; -} - -void gtk_menu_item_set_submenu(GtkMenuItem *menu_item, GtkWidget *submenu) { - GtkWidget *i; - - DebOut("gtk_menu_item_set_submenu(GtkMenuItem %lx, GtkWidget %lx)\n",menu_item,submenu); - - if(menu_item->type != IS_MENUITEM) { - WarnOut("gtk_menu_item_set_submenu with non menuitem!?\n"); - } - - DebOut("gtk_menu_item_set_submenu: menu_item->type: %lx\n",menu_item->type); - DebOut("gtk_menu_item_set_submenu: submenu->type: %lx\n",submenu->type); - - if(submenu->type == IS_MENU) { - /* as a IS_MENU is invisible, we add it's children */ - DebOut("gtk_menu_item_set_submenu: adding children of IS_MENU\n"); - i=(GtkWidget *) submenu->nextObject; - while(i!=NULL) { - DebOut("gtk_menu_item_set_submenu: add %lx\n",i); - - DoMethod(menu_item->MuiObject,MUIM_Family_AddTail,i->MuiObject); - i=(APTR) i->nextObject; - } - return; - } - - /* attach submenu */ - DoMethod(menu_item->MuiObject,MUIM_Family_AddTail,submenu->MuiObject); - - return; -} - -GtkWidget *gtk_menu_get_attach_widget(GtkMenu *menu) { - - DebOut("gtk_menu_get_attach_widget(%lx)\n",menu); - - if(menu->parent==NULL) { - WarnOut("gtk_menu_get_attach_widget: nobody set parent for menu %x\n",(int) menu); - } - - return((GtkWidget *)menu->parent); -} - -/**************************************************************************************** - * option_menu - * - * gtk_option_menu_set_menu is deprecated and should not be used in newly-written code. - * - * an option menu is the MUI equivalent of MUIO_Cycle, just with a better API ;) - * - ****************************************************************************************/ -GtkWidget *gtk_option_menu_new ( void ) { - GtkWidget *ret; - - /* gtk_option_menu_new () creates a IS_OPTIONMENU Object, which is *not* displayed in MUI - * it just contains IS_MENUITEM Objects, which are visible - */ - - ret=mgtk_widget_new(IS_OPTIONMENU); - - return ret; -} - -void gtk_option_menu_set_menu(GtkOptionMenu *option_menu, GtkWidget *menu) { - - DebOut("gtk_option_menu_set_menu(%lx,%lx)\n",option_menu,menu); - - option_menu->nextObject=(APTR) menu; - - return; -} - -GtkOptionMenu *GTK_OPTION_MENU(GtkWidget *widget) { - - return((GtkOptionMenu *) widget); -} - -/* An MUI Cycle Menu is only one object. For GTK we have - * a single object per item. So we have one MUI callback, - * which has to call the GTK objects correct callback. - * - * With the help of this not really trivial stuff, you - * can add callbacks in GTK on option menus at - * any time (before and after you really show - * the option menu. - */ -void mgtk_option_menu_hook( GtkWidget *source, GtkWidget *widget) { - GtkWidget *i; - GtkWidget *item; - int num; - int c; - void (*callme)(GtkWidget *widget,gpointer data); - mgtk_signal_connect_data *callback; - - DebOut("mgtk_option_menu_hook(%lx,%lx)\n"); - - /* which one is active? */ - num=xget(widget->MuiObject,MUIA_Cycle_Active); - - DebOut(" num=%ld\n",num); - - i=(APTR) widget->nextObject; - - if(!i) { - WarnOut("mgtk_option_menu_hook: widget->nextObject is NULL !?\n"); - return; - } - - /* get correct menu item */ - c=0; - item=NULL; - while(i!=NULL) { - if(i->type==IS_MENUITEM) { - if(c==num) { - item=i; - break; - } - c++; - } - i=(APTR) i->nextObject; - } - - if(!item) { - WarnOut("mgtk_option_menu_hook: no matching item found!\n"); - return; - } - - /* so at least we know, what was selected ;) */ - DebOut(" found matching item %lx (number %ld)\n",item,num); - - /* now call all callbacks of this item */ - if(item->mgtk_signal_connect_data) { - DebOut(" found remember structure\n"); - callback=(mgtk_signal_connect_data *) item->mgtk_signal_connect_data; - /* call all remembered functions */ - while(callback) { - callme=(void *) callback->c_handler; - DebOut(" calling callback %lx\n",callme); - if(callback->connect_flags == G_CONNECT_SWAPPED) { - (*callme)(callback->data,item); - } - else { - (*callme)(item,callback->data); - } - callback=(mgtk_signal_connect_data *)callback->next; - } - } - /* we did it, phew. */ -} - -/* mgtk_optionmenu_pack assumes, that the menu has only - * one level, so no submenus. This is according to the - * GTK recommendation, but maybe not perfect.. - */ - -void mgtk_optionmenu_pack(GtkBox *box, GtkWidget *child, gint expand, gint fill, gint padding ) { - Object *menu; - GtkWidget *i; - GtkWidget *item; - char **menuitems; - int count; - - DebOut("mgtk_optionmenu_pack(%lx,%lx,%ld,%ld,%ld)\n"); - - /* even if the menu has quite some MUI Objects, we can't use them here - * MUI is far from beeing orthogonal :( - */ - i=(APTR) child->nextObject; - - if(!i) { - WarnOut("child->nextObject is NULL !?\n"); - return; - } - - /* get menu items */ - while(i->type!=IS_MENUITEM) { - i=(APTR) i->nextObject; - if(!i) { - WarnOut("nextObject is NULL, but no MENUITEM found before !?\n"); - return; - } - } - item=i; - /* now item is the first menuitem */ - - /* count the items */ - count=0; - while(i!=NULL) { - DebOut(" menu item: %s\n",i->title); - count++; - i=(APTR) i->nextObject; - } - - /* generate MUI parameter */ - menuitems=g_new(char *,count+2); - - i=item; - count=0; - while(i!=NULL) { - menuitems[count]=i->title; - count++; - i=(APTR) i->nextObject; - } - menuitems[count]=NULL; - - menu=(Object *) MUI_MakeObject(MUIO_Cycle,NULL,menuitems); - - child->MuiObject=menu; - - DoMethod(box->MuiObject,MUIM_Group_InitChange); - DoMethod(box->MuiObject,OM_ADDMEMBER,child->MuiObject); - DoMethod(box->MuiObject,MUIM_Group_ExitChange); - - mgtk_add_child(box,child); - - /* connect a hook to the menu */ - g_signal_connect (child, "activate", G_CALLBACK (mgtk_option_menu_hook), child); - - return; -} diff --git a/mui/gtk-mui/gtk_notebook.c b/mui/gtk-mui/gtk_notebook.c deleted file mode 100644 index f0af381cf..000000000 --- a/mui/gtk-mui/gtk_notebook.c +++ /dev/null @@ -1,111 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkNotebook *GTK_NOTEBOOK(GtkWidget* widget) { - return (GtkNotebook *) widget; -} - -GtkWidget* gtk_notebook_new(void) { - - GtkWidget *ret; - Object *note; - - DebOut("gtk_notebook_new()\n"); - - ret=mgtk_widget_new(IS_NOTEBOOK); - - note = (APTR) NewObject(CL_NoteBook->mcc_Class, NULL,MA_Widget,ret,TAG_DONE); - - DebOut(" NewObject=%lx\n",note); - - ret->MuiObject=note; - - return ret; -} - -gint gtk_notebook_append_page(GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label) { - LONG last; - LONG act; - - DebOut("gtk_notebook_append_page(%lx,%lx,%lx)\n",notebook,child,tab_label); - DebOut(" label=%s\n",tab_label->title); - - child->title=g_strdup(tab_label->title); - - set(notebook->MuiObject,MA_Note_Append_Child,child); - - mgtk_add_child(notebook,child); - - /* return position */ - act=xget(notebook->MuiObject,MUIA_Group_ActivePage); - set(notebook->MuiObject,MUIA_Group_ActivePage,MUIV_Group_ActivePage_Last); - last=xget(notebook->MuiObject,MUIA_Group_ActivePage); - set(notebook->MuiObject,MUIA_Group_ActivePage,act); - - return last; -} - -gint gtk_notebook_prepend_page(GtkNotebook *notebook, GtkWidget *child, GtkWidget *tab_label) { - - DebOut("gtk_notebook_append_page(%lx,%lx,%lx)\n",notebook,child,tab_label); - DebOut(" label=%s\n",tab_label->title); - - child->title=g_strdup(tab_label->title); - - set(notebook->MuiObject,MA_Note_Prepend_Child,child); - - mgtk_add_child(notebook,child); - - return 0; -} - -void gtk_notebook_next_page(GtkNotebook *notebook) { - DebOut("gtk_notebook_next_page(%lx)\n",notebook); - - set(notebook->MuiObject,MUIA_Group_ActivePage,MUIV_Group_ActivePage_Next); -} - -void gtk_notebook_prev_page(GtkNotebook *notebook) { - DebOut("gtk_notebook_prev_page(%lx)\n",notebook); - - set(notebook->MuiObject,MUIA_Group_ActivePage,MUIV_Group_ActivePage_Prev); -} - diff --git a/mui/gtk-mui/gtk_object.c b/mui/gtk-mui/gtk_object.c deleted file mode 100644 index f31db32c3..000000000 --- a/mui/gtk-mui/gtk_object.c +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -void gtk_object_unref(GtkObject *object) { - - DebOut("gtk_object_unref(%lx)\n",object); - - g_object_unref((GObject *) object); -} diff --git a/mui/gtk-mui/gtk_paint.c b/mui/gtk-mui/gtk_paint.c deleted file mode 100644 index d024375d0..000000000 --- a/mui/gtk-mui/gtk_paint.c +++ /dev/null @@ -1,2401 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Contact information: - * - * modified by Oliver Brunner 2005 - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -#define INDICATOR_PART_SIZE 13 - - -typedef enum { - CHECK_AA, - CHECK_BASE, - CHECK_BLACK, - CHECK_DARK, - CHECK_LIGHT, - CHECK_MID, - CHECK_TEXT, - CHECK_INCONSISTENT_TEXT, - RADIO_BASE, - RADIO_BLACK, - RADIO_DARK, - RADIO_LIGHT, - RADIO_MID, - RADIO_TEXT, - RADIO_INCONSISTENT_AA, - RADIO_INCONSISTENT_TEXT -} IndicatorPart; - -void gtk_paint_shadow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); - -void gdk_gc_set_clip_rectangle (GdkGC *gc, - GdkRectangle *rectangle) { -#warning gdk_gc_set_clip_rectangle is TODO - - DebOut("WARNING: gdk_gc_set_clip_rectangle is TODO\n"); -} - - -static GdkGC *create_aa_gc (GdkWindow *window, GtkStyle *style, GtkStateType state_type) { - - GdkColor aa_color; - GdkGC *gc = gdk_gc_new (window); - - aa_color.red = (style->fg[state_type].red + style->bg[state_type].red) / 2; - aa_color.green = (style->fg[state_type].green + style->bg[state_type].green) / 2; - aa_color.blue = (style->fg[state_type].blue + style->bg[state_type].blue) / 2; - - gdk_gc_set_rgb_fg_color (gc, &aa_color); - - return gc; -} - - -static void sanitize_size (GdkWindow *window, gint *width, gint *height) { - -/* - if ((*width == -1) && (*height == -1)) - gdk_drawable_get_size (window, width, height); - else if (*width == -1) - gdk_drawable_get_size (window, width, NULL); - else if (*height == -1) - gdk_drawable_get_size (window, NULL, height); -*/ -} - -static GtkTextDirection -get_direction (GtkWidget *widget) -{ - GtkTextDirection dir; - - /* - if (widget) - dir = gtk_widget_get_direction (widget); - else - */ - dir = GTK_TEXT_DIR_LTR; - - return dir; -} - -void gtk_paint_polygon(GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, GdkPoint *points, gint npoints, gboolean fill) { - - static const gdouble pi_over_4 = G_PI_4; - static const gdouble pi_3_over_4 = G_PI_4 * 3; - GdkGC *gc1; - GdkGC *gc2; - GdkGC *gc3; - GdkGC *gc4; - gdouble angle; - gint xadjust; - gint yadjust; - gint i; - - DebOut("gtk_paint_polygon(%lx,%lx,%lx,..)\n",style,widget,window); - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - g_return_if_fail (points != NULL); - - - /* taken from "gtk/gtkstyle.c" of original gtk sources (gtk_default_draw_polygon) */ - switch (shadow_type) - { - case GTK_SHADOW_IN: - gc1 = style->bg_gc[state_type]; - gc2 = style->dark_gc[state_type]; - gc3 = style->light_gc[state_type]; - gc4 = style->black_gc; - break; - case GTK_SHADOW_ETCHED_IN: - gc1 = style->light_gc[state_type]; - gc2 = style->dark_gc[state_type]; - gc3 = style->dark_gc[state_type]; - gc4 = style->light_gc[state_type]; - break; - case GTK_SHADOW_OUT: - gc1 = style->dark_gc[state_type]; - gc2 = style->light_gc[state_type]; - gc3 = style->black_gc; - gc4 = style->bg_gc[state_type]; - break; - case GTK_SHADOW_ETCHED_OUT: - gc1 = style->dark_gc[state_type]; - gc2 = style->light_gc[state_type]; - gc3 = style->light_gc[state_type]; - gc4 = style->dark_gc[state_type]; - break; - default: - return; - } - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - { - gdk_gc_set_clip_rectangle (gc1, area); - gdk_gc_set_clip_rectangle (gc2, area); - gdk_gc_set_clip_rectangle (gc3, area); - gdk_gc_set_clip_rectangle (gc4, area); - } -#endif - - /* - if (fill) - gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, points, npoints); - */ - - npoints--; - - for (i = 0; i < npoints; i++) - { - if ((points[i].x == points[i+1].x) && - (points[i].y == points[i+1].y)) - { - angle = 0; - } - else - { - angle = atan2 (points[i+1].y - points[i].y, - points[i+1].x - points[i].x); - } - - if ((angle > -pi_3_over_4) && (angle < pi_over_4)) - { - if (angle > -pi_over_4) - { - xadjust = 0; - yadjust = 1; - } - else - { - xadjust = 1; - yadjust = 0; - } - - gdk_draw_line (window, gc1, - points[i].x-xadjust, points[i].y-yadjust, - points[i+1].x-xadjust, points[i+1].y-yadjust); - gdk_draw_line (window, gc3, - points[i].x, points[i].y, - points[i+1].x, points[i+1].y); - } - else - { - if ((angle < -pi_3_over_4) || (angle > pi_3_over_4)) - { - xadjust = 0; - yadjust = 1; - } - else - { - xadjust = 1; - yadjust = 0; - } - - gdk_draw_line (window, gc4, - points[i].x+xadjust, points[i].y+yadjust, - points[i+1].x+xadjust, points[i+1].y+yadjust); - gdk_draw_line (window, gc2, - points[i].x, points[i].y, - points[i+1].x, points[i+1].y); - } - } - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - { - gdk_gc_set_clip_rectangle (gc1, NULL); - gdk_gc_set_clip_rectangle (gc2, NULL); - gdk_gc_set_clip_rectangle (gc3, NULL); - gdk_gc_set_clip_rectangle (gc4, NULL); - } -#endif -} - -static void draw_arrow (GdkWindow *window, GdkGC *gc, GdkRectangle *area, GtkArrowType arrow_type, gint x, gint y, gint width, gint height) { - gint i, j; - - if (area) - gdk_gc_set_clip_rectangle (gc, area); - - if (arrow_type == GTK_ARROW_DOWN) - { - for (i = 0, j = 0; i < height; i++, j++) - gdk_draw_line (window, gc, x + j, y + i, x + width - j - 1, y + i); - } - else if (arrow_type == GTK_ARROW_UP) - { - for (i = height - 1, j = 0; i >= 0; i--, j++) - gdk_draw_line (window, gc, x + j, y + i, x + width - j - 1, y + i); - } - else if (arrow_type == GTK_ARROW_LEFT) - { - for (i = width - 1, j = 0; i >= 0; i--, j++) - gdk_draw_line (window, gc, x + i, y + j, x + i, y + height - j - 1); - } - else if (arrow_type == GTK_ARROW_RIGHT) - { - for (i = 0, j = 0; i < width; i++, j++) - gdk_draw_line (window, gc, x + i, y + j, x + i, y + height - j - 1); - } - - if (area) - gdk_gc_set_clip_rectangle (gc, NULL); -} - - -static void -calculate_arrow_geometry (GtkArrowType arrow_type, - gint *x, - gint *y, - gint *width, - gint *height) { - - gint w = *width; - gint h = *height; - - switch (arrow_type) - { - case GTK_ARROW_UP: - case GTK_ARROW_DOWN: - w += (w % 2) - 1; - h = (w / 2 + 1); - - if (h > *height) - { - h = *height; - w = 2 * h - 1; - } - - if (arrow_type == GTK_ARROW_DOWN) - { - if (*height % 2 == 1 || h % 2 == 0) - *height += 1; - } - else - { - if (*height % 2 == 0 || h % 2 == 0) - *height -= 1; - } - break; - - case GTK_ARROW_RIGHT: - case GTK_ARROW_LEFT: - h += (h % 2) - 1; - w = (h / 2 + 1); - - if (w > *width) - { - w = *width; - h = 2 * w - 1; - } - - if (arrow_type == GTK_ARROW_RIGHT) - { - if (*width % 2 == 1 || w % 2 == 0) - *width += 1; - } - else - { - if (*width % 2 == 0 || w % 2 == 0) - *width -= 1; - } - break; - - default: - /* should not be reached */ - break; - } - - *x += (*width - w) / 2; - *y += (*height - h) / 2; - *height = h; - *width = w; -} - -static void -rgb_to_hls (gdouble *r, - gdouble *g, - gdouble *b) -{ - gdouble min; - gdouble max; - gdouble red; - gdouble green; - gdouble blue; - gdouble h, l, s; - gdouble delta; - - red = *r; - green = *g; - blue = *b; - - if (red > green) - { - if (red > blue) - max = red; - else - max = blue; - - if (green < blue) - min = green; - else - min = blue; - } - else - { - if (green > blue) - max = green; - else - max = blue; - - if (red < blue) - min = red; - else - min = blue; - } - - l = (max + min) / 2; - s = 0; - h = 0; - - if (max != min) - { - if (l <= 0.5) - s = (max - min) / (max + min); - else - s = (max - min) / (2 - max - min); - - delta = max -min; - if (red == max) - h = (green - blue) / delta; - else if (green == max) - h = 2 + (blue - red) / delta; - else if (blue == max) - h = 4 + (red - green) / delta; - - h *= 60; - if (h < 0.0) - h += 360; - } - - *r = h; - *g = l; - *b = s; -} - -static void -hls_to_rgb (gdouble *h, - gdouble *l, - gdouble *s) -{ - gdouble hue; - gdouble lightness; - gdouble saturation; - gdouble m1, m2; - gdouble r, g, b; - - lightness = *l; - saturation = *s; - - if (lightness <= 0.5) - m2 = lightness * (1 + saturation); - else - m2 = lightness + saturation - lightness * saturation; - m1 = 2 * lightness - m2; - - if (saturation == 0) - { - *h = lightness; - *l = lightness; - *s = lightness; - } - else - { - hue = *h + 120; - while (hue > 360) - hue -= 360; - while (hue < 0) - hue += 360; - - if (hue < 60) - r = m1 + (m2 - m1) * hue / 60; - else if (hue < 180) - r = m2; - else if (hue < 240) - r = m1 + (m2 - m1) * (240 - hue) / 60; - else - r = m1; - - hue = *h; - while (hue > 360) - hue -= 360; - while (hue < 0) - hue += 360; - - if (hue < 60) - g = m1 + (m2 - m1) * hue / 60; - else if (hue < 180) - g = m2; - else if (hue < 240) - g = m1 + (m2 - m1) * (240 - hue) / 60; - else - g = m1; - - hue = *h - 120; - while (hue > 360) - hue -= 360; - while (hue < 0) - hue += 360; - - if (hue < 60) - b = m1 + (m2 - m1) * hue / 60; - else if (hue < 180) - b = m2; - else if (hue < 240) - b = m1 + (m2 - m1) * (240 - hue) / 60; - else - b = m1; - - *h = r; - *l = g; - *s = b; - } -} -static void -gtk_style_shade (GdkColor *a, - GdkColor *b, - gdouble k) -{ - gdouble red; - gdouble green; - gdouble blue; - - red = (gdouble) a->red / 65535.0; - green = (gdouble) a->green / 65535.0; - blue = (gdouble) a->blue / 65535.0; - - rgb_to_hls (&red, &green, &blue); - - green *= k; - if (green > 1.0) - green = 1.0; - else if (green < 0.0) - green = 0.0; - - blue *= k; - if (blue > 1.0) - blue = 1.0; - else if (blue < 0.0) - blue = 0.0; - - hls_to_rgb (&red, &green, &blue); - - b->red = red * 65535.0; - b->green = green * 65535.0; - b->blue = blue * 65535.0; -} - - -static GdkGC* -get_darkened_gc (GdkWindow *window, - GdkColor *color, - gint darken_count) -{ - GdkColor src = *color; - GdkColor shaded = *color; - GdkGC *gc; - - gc = gdk_gc_new (window); - - while (darken_count) - { - gtk_style_shade (&src, &shaded, 0.93); - src = shaded; - --darken_count; - } - - gdk_gc_set_rgb_fg_color (gc, &shaded); - - return gc; -} - -static void gtk_default_draw_arrow (GtkStyle *style, - GdkWindow *window, - GtkStateType state, - GtkShadowType shadow, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height) { - - gint original_width, original_x; - - sanitize_size (window, &width, &height); - - original_width = width; - original_x = x; - - calculate_arrow_geometry (arrow_type, &x, &y, &width, &height); - - if (detail && strcmp (detail, "menu_scroll_arrow_up") == 0) - y++; - - if (state == GTK_STATE_INSENSITIVE) - draw_arrow (window, style->white_gc, area, arrow_type, - x + 1, y + 1, width, height); - draw_arrow (window, style->fg_gc[state], area, arrow_type, - x, y, width, height); -} - -/** - * gtk_paint_arrow: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @arrow_type: the type of arrow to draw - * @fill: %TRUE if the arrow tip should be filled - * @x: x origin of the rectangle to draw the arrow in - * @y: y origin of the rectangle to draw the arrow in - * @width: width of the rectangle to draw the arrow in - * @height: height of the rectangle to draw the arrow in - * - * Draws an arrow in the given rectangle on @window using the given - * parameters. @arrow_type determines the direction of the arrow. - */ -void -gtk_paint_arrow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height) { - - g_return_if_fail (GTK_IS_STYLE (style)); - - gtk_default_draw_arrow (style, window, state_type, shadow_type, area, widget, detail, arrow_type, fill, x, y, width, height); -} - -static void -gtk_default_draw_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - GdkGC *gc; - gboolean is_spinbutton_box = FALSE; - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - sanitize_size (window, &width, &height); - -#if 0 /* spinbuttons are done different in GTK-MUI anyways */ - if (widget && GTK_IS_SPIN_BUTTON (widget) && detail) { - if (strcmp (detail, "spinbutton_up") == 0) - { - y += 2; - width -= 3; - height -= 2; - - if (get_direction (widget) == GTK_TEXT_DIR_RTL) - x += 2; - else - x += 1; - - is_spinbutton_box = TRUE; - } - else if (strcmp (detail, "spinbutton_down") == 0) - { - width -= 3; - height -= 2; - - if (get_direction (widget) == GTK_TEXT_DIR_RTL) - x += 2; - else - x += 1; - - is_spinbutton_box = TRUE; - } - } -#endif - -#if 0 - if (!style->bg_pixmap[state_type] || - GDK_IS_PIXMAP (window) ) { - - GdkGC *gc = (GdkGC *) BACKGROUNDPEN; //style->bg_gc[state_type]; - - if (state_type == GTK_STATE_SELECTED && detail && strcmp (detail, "paned") == 0) { - - if (widget && !GTK_WIDGET_HAS_FOCUS (widget)) - gc = style->base_gc[GTK_STATE_ACTIVE]; - } -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - gdk_gc_set_clip_rectangle (gc, area); -#endif - gdk_draw_rectangle (window, gc, TRUE, x, y, width, height); -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - gdk_gc_set_clip_rectangle (gc, NULL); -#endif - } - else -#endif /* 0 */ - gc = style->bg_gc[state_type]; - gdk_draw_rectangle (window, gc, TRUE, x, y, width, height); - -#warning gtk_style_apply_default_background is TODO! -/* - gtk_style_apply_default_background (style, window, - widget && !GTK_WIDGET_NO_WINDOW (widget), - state_type, area, x, y, width, height); - */ - - if (is_spinbutton_box) - { - GdkGC *upper_gc; - GdkGC *lower_gc; - - lower_gc = style->dark_gc[state_type]; - if (shadow_type == GTK_SHADOW_OUT) - upper_gc = style->light_gc[state_type]; - else - upper_gc = style->dark_gc[state_type]; - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) { - gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area); - gdk_gc_set_clip_rectangle (style->light_gc[state_type], area); - } -#endif - - gdk_draw_line (window, upper_gc, x, y, x + width - 1, y); - gdk_draw_line (window, lower_gc, x, y + height - 1, x + width - 1, y + height - 1); - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) { - gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL); - gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL); - } -#endif - return; - } - - gtk_paint_shadow (style, window, state_type, shadow_type, area, widget, detail, - x, y, width, height); - -#ifdef MGTK_HAS_OPTIONMENU - if (detail && strcmp (detail, "optionmenu") == 0) - { - GtkRequisition indicator_size; - GtkBorder indicator_spacing; - gint vline_x; - - option_menu_get_props (widget, &indicator_size, &indicator_spacing); - - sanitize_size (window, &width, &height); - - if (get_direction (widget) == GTK_TEXT_DIR_RTL) - vline_x = x + indicator_size.width + indicator_spacing.left + indicator_spacing.right; - else - vline_x = x + width - (indicator_size.width + indicator_spacing.left + indicator_spacing.right) - style->xthickness; - - gtk_paint_vline (style, window, state_type, area, widget, - detail, - y + style->ythickness + 1, - y + height - style->ythickness - 3, - vline_x); - } -#endif -} - -/** - * gtk_paint_box: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @x: x origin of the box - * @y: y origin of the box - * @width: the width of the box - * @height: the height of the box - * - * Draws a box on @window with the given parameters. - */ -void -gtk_paint_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - - gtk_default_draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); -} - -static void -draw_thin_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state, - GdkRectangle *area, - gint x, - gint y, - gint width, - gint height) -{ - GdkGC *gc1, *gc2; - - sanitize_size (window, &width, &height); - - gc1 = style->light_gc[state]; - gc2 = style->dark_gc[state]; - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - { - gdk_gc_set_clip_rectangle (gc1, area); - gdk_gc_set_clip_rectangle (gc2, area); - } -#endif - - gdk_draw_line (window, gc1, - x, y + height - 1, x + width - 1, y + height - 1); - gdk_draw_line (window, gc1, - x + width - 1, y, x + width - 1, y + height - 1); - - gdk_draw_line (window, gc2, - x, y, x + width - 2, y); - gdk_draw_line (window, gc2, - x, y, x, y + height - 2); - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - { - gdk_gc_set_clip_rectangle (gc1, NULL); - gdk_gc_set_clip_rectangle (gc2, NULL); - } -#endif -} - -static void -draw_spinbutton_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state, - GtkTextDirection direction, - GdkRectangle *area, - gint x, - gint y, - gint width, - gint height) -{ - sanitize_size (window, &width, &height); - - /* spinbuttons are done different */ - -} - -static void -draw_menu_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state, - GdkRectangle *area, - gint x, - gint y, - gint width, - gint height) -{ - - /* menus are done different */ -} - -static void -gtk_default_draw_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) { - - GdkGC *gc1 = NULL; - GdkGC *gc2 = NULL; - gint thickness_light; - gint thickness_dark; - gint i; - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - if (shadow_type == GTK_SHADOW_IN) - { -#if 0 /* no buttons ! */ - if (detail && (strcmp (detail, "buttondefault") == 0)) { - sanitize_size (window, &width, &height); - - gdk_draw_rectangle (window, style->black_gc, FALSE, - x, y, width - 1, height - 1); - - return; - } -#endif - if (detail && strcmp (detail, "trough") == 0) - { - draw_thin_shadow (style, window, state_type, area, - x, y, width, height); - return; - } - /* if (widget && GTK_IS_SPIN_BUTTON (widget) &&*/ - if (widget && FALSE && - detail && strcmp (detail, "spinbutton") == 0) - { - draw_spinbutton_shadow (style, window, state_type, - get_direction (widget), area, x, y, width, height); - - return; - } - } - - if (shadow_type == GTK_SHADOW_OUT && detail && strcmp (detail, "menu") == 0) - { - draw_menu_shadow (style, window, state_type, area, x, y, width, height); - return; - } - - sanitize_size (window, &width, &height); - - switch (shadow_type) - { - case GTK_SHADOW_NONE: - return; - case GTK_SHADOW_IN: - case GTK_SHADOW_ETCHED_IN: - gc1 = style->light_gc[state_type]; - gc2 = style->dark_gc[state_type]; - break; - case GTK_SHADOW_OUT: - case GTK_SHADOW_ETCHED_OUT: - gc1 = style->dark_gc[state_type]; - gc2 = style->light_gc[state_type]; - break; - } - - if (area) - { -#ifdef GDK_GC_SET_CLIP_RECTANGLE - gdk_gc_set_clip_rectangle (gc1, area); - gdk_gc_set_clip_rectangle (gc2, area); -#endif - if (shadow_type == GTK_SHADOW_IN || - shadow_type == GTK_SHADOW_OUT) - { -#ifdef GDK_GC_SET_CLIP_RECTANGLE - gdk_gc_set_clip_rectangle (style->black_gc, area); - gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area); -#endif - } - } - - switch (shadow_type) - { - case GTK_SHADOW_NONE: - break; - - case GTK_SHADOW_IN: - /* Light around right and bottom edge */ - - if (style->ythickness > 0) - gdk_draw_line (window, gc1, - x, y + height - 1, x + width - 1, y + height - 1); - if (style->xthickness > 0) - gdk_draw_line (window, gc1, - x + width - 1, y, x + width - 1, y + height - 1); - - if (style->ythickness > 1) - gdk_draw_line (window, style->bg_gc[state_type], - x + 1, y + height - 2, x + width - 2, y + height - 2); - if (style->xthickness > 1) - gdk_draw_line (window, style->bg_gc[state_type], - x + width - 2, y + 1, x + width - 2, y + height - 2); - - /* Dark around left and top */ - - if (style->ythickness > 1) - gdk_draw_line (window,style->black_gc, - x + 1, y + 1, x + width - 2, y + 1); - if (style->xthickness > 1) - gdk_draw_line (window, style->black_gc, - x + 1, y + 1, x + 1, y + height - 2); - - if (style->ythickness > 0) - gdk_draw_line (window, gc2, - x, y, x + width - 1, y); - if (style->xthickness > 0) - gdk_draw_line (window, gc2, - x, y, x, y + height - 1); - break; - - case GTK_SHADOW_OUT: - /* Dark around right and bottom edge */ - - if (style->ythickness > 0) - { - if (style->ythickness > 1) - { - gdk_draw_line (window, gc1, - x + 1, y + height - 2, x + width - 2, y + height - 2); - gdk_draw_line (window, style->black_gc, - x, y + height - 1, x + width - 1, y + height - 1); - } - else - { - gdk_draw_line (window, gc1, - x + 1, y + height - 1, x + width - 1, y + height - 1); - } - } - - if (style->xthickness > 0) - { - if (style->xthickness > 1) - { - gdk_draw_line (window, gc1, - x + width - 2, y + 1, x + width - 2, y + height - 2); - - gdk_draw_line (window, style->black_gc, - x + width - 1, y, x + width - 1, y + height - 1); - } - else - { - gdk_draw_line (window, gc1, - x + width - 1, y + 1, x + width - 1, y + height - 1); - } - } - - /* Light around top and left */ - - if (style->ythickness > 0) - gdk_draw_line (window, gc2, - x, y, x + width - 2, y); - if (style->xthickness > 0) - gdk_draw_line (window, gc2, - x, y, x, y + height - 2); - - if (style->ythickness > 1) - gdk_draw_line (window, style->bg_gc[state_type], - x + 1, y + 1, x + width - 3, y + 1); - if (style->xthickness > 1) - gdk_draw_line (window, style->bg_gc[state_type], - x + 1, y + 1, x + 1, y + height - 3); - break; - - case GTK_SHADOW_ETCHED_IN: - case GTK_SHADOW_ETCHED_OUT: - if (style->xthickness > 0) - { - if (style->xthickness > 1) - { - thickness_light = 1; - thickness_dark = 1; - - for (i = 0; i < thickness_dark; i++) - { - gdk_draw_line (window, gc1, - x + width - i - 1, - y + i, - x + width - i - 1, - y + height - i - 1); - gdk_draw_line (window, gc2, - x + i, - y + i, - x + i, - y + height - i - 2); - } - - for (i = 0; i < thickness_light; i++) - { - gdk_draw_line (window, gc1, - x + thickness_dark + i, - y + thickness_dark + i, - x + thickness_dark + i, - y + height - thickness_dark - i - 1); - gdk_draw_line (window, gc2, - x + width - thickness_light - i - 1, - y + thickness_dark + i, - x + width - thickness_light - i - 1, - y + height - thickness_light - 1); - } - } - else - { - gdk_draw_line (window, - style->dark_gc[state_type], - x, y, x, y + height); - gdk_draw_line (window, - style->dark_gc[state_type], - x + width, y, x + width, y + height); - } - } - - if (style->ythickness > 0) - { - if (style->ythickness > 1) - { - thickness_light = 1; - thickness_dark = 1; - - for (i = 0; i < thickness_dark; i++) - { - gdk_draw_line (window, gc1, - x + i, - y + height - i - 1, - x + width - i - 1, - y + height - i - 1); - - gdk_draw_line (window, gc2, - x + i, - y + i, - x + width - i - 2, - y + i); - } - - for (i = 0; i < thickness_light; i++) - { - gdk_draw_line (window, gc1, - x + thickness_dark + i, - y + thickness_dark + i, - x + width - thickness_dark - i - 2, - y + thickness_dark + i); - - gdk_draw_line (window, gc2, - x + thickness_dark + i, - y + height - thickness_light - i - 1, - x + width - thickness_light - 1, - y + height - thickness_light - i - 1); - } - } - else - { - gdk_draw_line (window, - style->dark_gc[state_type], - x, y, x + width, y); - gdk_draw_line (window, - style->dark_gc[state_type], - x, y + height, x + width, y + height); - } - } - - break; - } - -#if 0 /* SPIN_BUTTON are not drawn.. */ - if (shadow_type == GTK_SHADOW_IN && - widget && GTK_IS_SPIN_BUTTON (widget) && - detail && strcmp (detail, "entry") == 0) - { - if (get_direction (widget) == GTK_TEXT_DIR_LTR) - { - gdk_draw_line (window, - style->base_gc[state_type], - x + width - 1, y + 2, - x + width - 1, y + height - 3); - gdk_draw_line (window, - style->base_gc[state_type], - x + width - 2, y + 2, - x + width - 2, y + height - 3); - gdk_draw_point (window, - style->black_gc, - x + width - 1, y + 1); - gdk_draw_point (window, - style->bg_gc[state_type], - x + width - 1, y + height - 2); - } - else - { - gdk_draw_line (window, - style->base_gc[state_type], - x, y + 2, - x, y + height - 3); - gdk_draw_line (window, - style->base_gc[state_type], - x + 1, y + 2, - x + 1, y + height - 3); - gdk_draw_point (window, - style->black_gc, - x, y + 1); - gdk_draw_line (window, - style->bg_gc[state_type], - x, y + height - 2, - x + 1, y + height - 2); - gdk_draw_point (window, - style->light_gc[state_type], - x, y + height - 1); - } - } -#endif - - - if (area) - { -#ifdef GDK_GC_SET_CLIP_RECTANGLE - gdk_gc_set_clip_rectangle (gc1, NULL); - gdk_gc_set_clip_rectangle (gc2, NULL); -#endif - if (shadow_type == GTK_SHADOW_IN || - shadow_type == GTK_SHADOW_OUT) - { -#ifdef GDK_GC_SET_CLIP_RECTANGLE - gdk_gc_set_clip_rectangle (style->black_gc, NULL); - gdk_gc_set_clip_rectangle (style->bg_gc[state_type], NULL); -#endif - } - } -} -/** - * gtk_paint_shadow: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @x: x origin of the rectangle - * @y: y origin of the rectangle - * @width: width of the rectangle - * @height: width of the rectangle - * - * Draws a shadow around the given rectangle in @window - * using the given style and state and shadow type. - */ -void -gtk_paint_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - - gtk_default_draw_shadow (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); -} - -static void gtk_default_draw_hline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x1, - gint x2, - gint y) { - gint thickness_light; - gint thickness_dark; - gint i; - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - thickness_light = style->ythickness / 2; - thickness_dark = style->ythickness - thickness_light; - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - { - gdk_gc_set_clip_rectangle (style->light_gc[state_type], area); - gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area); - } -#endif - - if (detail && !strcmp (detail, "label")) - { - if (state_type == GTK_STATE_INSENSITIVE) - gdk_draw_line (window, style->white_gc, x1 + 1, y + 1, x2 + 1, y + 1); - gdk_draw_line (window, style->fg_gc[state_type], x1, y, x2, y); - } - else - { - for (i = 0; i < thickness_dark; i++) - { - gdk_draw_line (window, style->dark_gc[state_type], x1, y + i, x2 - i - 1, y + i); - gdk_draw_line (window, style->light_gc[state_type], x2 - i, y + i, x2, y + i); - } - - y += thickness_dark; - for (i = 0; i < thickness_light; i++) - { - gdk_draw_line (window, style->dark_gc[state_type], x1, y + i, x1 + thickness_light - i - 1, y + i); - gdk_draw_line (window, style->light_gc[state_type], x1 + thickness_light - i, y + i, x2, y + i); - } - } - -#ifdef GDK_GC_SET_CLIP_RECTANGLE - if (area) - { - gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL); - gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL); - } -#endif -} - - -static void gtk_default_draw_vline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint y1, - gint y2, - gint x) { - gint thickness_light; - gint thickness_dark; - gint i; - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - thickness_light = style->xthickness / 2; - thickness_dark = style->xthickness - thickness_light; - - if (area) { - gdk_gc_set_clip_rectangle (style->light_gc[state_type], area); - gdk_gc_set_clip_rectangle (style->dark_gc[state_type], area); - } - - for (i = 0; i < thickness_dark; i++) { - gdk_draw_line (window, style->dark_gc[state_type], x + i, y1, x + i, y2 - i - 1); - gdk_draw_line (window, style->light_gc[state_type], x + i, y2 - i, x + i, y2); - } - - x += thickness_dark; - for (i = 0; i < thickness_light; i++) { - gdk_draw_line (window, style->dark_gc[state_type], x + i, y1, x + i, y1 + thickness_light - i - 1); - gdk_draw_line (window, style->light_gc[state_type], x + i, y1 + thickness_light - i, x + i, y2); - } - - if (area) { - gdk_gc_set_clip_rectangle (style->light_gc[state_type], NULL); - gdk_gc_set_clip_rectangle (style->dark_gc[state_type], NULL); - } -} - - -/** - * gtk_paint_hline: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @area: rectangle to which the output is clipped - * @widget: the widget - * @detail: a style detail - * @x1: the starting x coordinate - * @x2: the ending x coordinate - * @y: the y coordinate - * - * Draws a horizontal line from (@x1, @y) to (@x2, @y) in @window - * using the given style and state. - **/ -void gtk_paint_hline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x1, - gint x2, - gint y) { - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL); - - gtk_default_draw_hline (style, window, state_type, area, widget, detail, x1, x2, y); -} - -/** - * gtk_paint_vline: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @area: rectangle to which the output is clipped - * @widget: the widget - * @detail: a style detail - * @y1_: the starting y coordinate - * @y2_: the ending y coordinate - * @x: the x coordinate - * - * Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @window - * using the given style and state. - */ -void gtk_paint_vline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint y1_, - gint y2_, - gint x) { - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL); - - gtk_default_draw_vline (style, window, state_type, area, widget, detail, y1_, y2_, x); -} - -static void gtk_default_draw_slider (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation) { - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - sanitize_size (window, &width, &height); - - gtk_paint_box (style, window, state_type, shadow_type, - area, widget, detail, x, y, width, height); - - if (detail && - (strcmp ("hscale", detail) == 0 || - strcmp ("vscale", detail) == 0)) { - if (orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_paint_vline (style, window, state_type, area, widget, detail, - y + style->ythickness, - y + height - style->ythickness - 1, x + width / 2); - else - gtk_paint_hline (style, window, state_type, area, widget, detail, - x + style->xthickness, - x + width - style->xthickness - 1, y + height / 2); - } -} - -void gtk_paint_slider (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation) { - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != NULL); - - gtk_default_draw_slider (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation); -} - -static void -draw_part (GdkDrawable *drawable, - GdkGC *gc, - GdkRectangle *area, - gint x, - gint y, - IndicatorPart part) -{ - if (area) - gdk_gc_set_clip_rectangle (gc, area); - /* - gdk_gc_set_ts_origin (gc, x, y); - gdk_gc_set_stipple (gc, get_indicator_for_screen (drawable, part)); - gdk_gc_set_fill (gc, GDK_STIPPLED); - */ - - gdk_draw_rectangle (drawable, gc, TRUE, x, y, INDICATOR_PART_SIZE, INDICATOR_PART_SIZE); -/* - gdk_gc_set_fill (gc, GDK_SOLID); - */ - - if (area) - gdk_gc_set_clip_rectangle (gc, NULL); -} - -static void -gtk_default_draw_check (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) { - - if (detail && strcmp (detail, "cellcheck") == 0) { - if (area) { - gdk_gc_set_clip_rectangle (widget->style->base_gc[state_type], area); - } - - gdk_draw_rectangle (window, - widget->style->base_gc[state_type], - TRUE, - x, y, - width, height); - if (area) { - gdk_gc_set_clip_rectangle (widget->style->base_gc[state_type], NULL); - gdk_gc_set_clip_rectangle (widget->style->text_gc[state_type], area); - } - gdk_draw_rectangle (window, - widget->style->text_gc[state_type], - FALSE, - x, y, - width, height); - if (area) { - gdk_gc_set_clip_rectangle (widget->style->text_gc[state_type], NULL); - } - - x -= (1 + INDICATOR_PART_SIZE - width) / 2; - y -= (((1 + INDICATOR_PART_SIZE - height) / 2) - 1); - - if (shadow_type == GTK_SHADOW_IN) { - draw_part (window, style->text_gc[state_type], area, x, y, CHECK_TEXT); - draw_part (window, style->text_aa_gc[state_type], area, x, y, CHECK_AA); - } - else if (shadow_type == GTK_SHADOW_ETCHED_IN) { /* inconsistent */ - draw_part (window, style->text_gc[state_type], area, x, y, CHECK_INCONSISTENT_TEXT); - } - } - else { - GdkGC *free_me = NULL; - - GdkGC *base_gc; - GdkGC *text_gc; - GdkGC *aa_gc; - - x -= (1 + INDICATOR_PART_SIZE - width) / 2; - y -= (1 + INDICATOR_PART_SIZE - height) / 2; - - if (detail && strcmp (detail, "check") == 0) { /* Menu item */ - text_gc = style->fg_gc[state_type]; - base_gc = style->bg_gc[state_type]; - aa_gc = free_me = create_aa_gc (window, style, state_type); - } - else { - if (state_type == GTK_STATE_ACTIVE) { - text_gc = style->fg_gc[state_type]; - base_gc = style->bg_gc[state_type]; - aa_gc=create_aa_gc (window, style, state_type); - free_me=aa_gc; - } - else { - text_gc = style->text_gc[state_type]; - base_gc = style->base_gc[state_type]; - aa_gc = style->text_aa_gc[state_type]; - } - draw_part (window, base_gc, area, x, y, CHECK_BASE); - draw_part (window, style->black_gc, area, x, y, CHECK_BLACK); - draw_part (window, style->dark_gc[state_type], area, x, y, CHECK_DARK); - draw_part (window, style->mid_gc[state_type], area, x, y, CHECK_MID); - draw_part (window, style->light_gc[state_type], area, x, y, CHECK_LIGHT); - } - if (shadow_type == GTK_SHADOW_IN) { - draw_part (window, text_gc, area, x, y, CHECK_TEXT); - draw_part (window, aa_gc, area, x, y, CHECK_AA); - } - else if (shadow_type == GTK_SHADOW_ETCHED_IN) { /* inconsistent */ - draw_part (window, text_gc, area, x, y, CHECK_INCONSISTENT_TEXT); - } - - if (free_me) { - g_object_unref ((GObject *) free_me); - } - } -} - -/** - * gtk_paint_check: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @x: x origin of the rectangle to draw the check in - * @y: y origin of the rectangle to draw the check in - * @width: the width of the rectangle to draw the check in - * @height: the height of the rectangle to draw the check in - * - * Draws a check button indicator in the given rectangle on @window with - * the given parameters. - */ -void -gtk_paint_check (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL); - - gtk_default_draw_check (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); -} - - -static void -gtk_default_draw_extension (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side) -{ - GdkGC *gc1 = NULL; - GdkGC *gc2 = NULL; - GdkGC *gc3 = NULL; - GdkGC *gc4 = NULL; - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - gtk_style_apply_default_background (style, window, - widget && !GTK_WIDGET_NO_WINDOW (widget), - GTK_STATE_NORMAL, area, x, y, width, height); - - sanitize_size (window, &width, &height); - - switch (shadow_type) - { - case GTK_SHADOW_NONE: - return; - case GTK_SHADOW_IN: - gc1 = style->dark_gc[state_type]; - gc2 = style->black_gc; - gc3 = style->bg_gc[state_type]; - gc4 = style->light_gc[state_type]; - break; - case GTK_SHADOW_ETCHED_IN: - gc1 = style->dark_gc[state_type]; - gc2 = style->light_gc[state_type]; - gc3 = style->dark_gc[state_type]; - gc4 = style->light_gc[state_type]; - break; - case GTK_SHADOW_OUT: - gc1 = style->light_gc[state_type]; - gc2 = style->bg_gc[state_type]; - gc3 = style->dark_gc[state_type]; - gc4 = style->black_gc; - break; - case GTK_SHADOW_ETCHED_OUT: - gc1 = style->light_gc[state_type]; - gc2 = style->dark_gc[state_type]; - gc3 = style->light_gc[state_type]; - gc4 = style->dark_gc[state_type]; - break; - } - - if (area) - { - gdk_gc_set_clip_rectangle (gc1, area); - gdk_gc_set_clip_rectangle (gc2, area); - gdk_gc_set_clip_rectangle (gc3, area); - gdk_gc_set_clip_rectangle (gc4, area); - } - - switch (shadow_type) - { - case GTK_SHADOW_NONE: - case GTK_SHADOW_IN: - case GTK_SHADOW_OUT: - case GTK_SHADOW_ETCHED_IN: - case GTK_SHADOW_ETCHED_OUT: - switch (gap_side) - { - case GTK_POS_TOP: - gtk_style_apply_default_background (style, window, - widget && !GTK_WIDGET_NO_WINDOW (widget), - state_type, area, - x + style->xthickness, - y, - width - (2 * style->xthickness), - height - (style->ythickness)); - gdk_draw_line (window, gc1, - x, y, x, y + height - 2); - gdk_draw_line (window, gc2, - x + 1, y, x + 1, y + height - 2); - - gdk_draw_line (window, gc3, - x + 2, y + height - 2, x + width - 2, y + height - 2); - gdk_draw_line (window, gc3, - x + width - 2, y, x + width - 2, y + height - 2); - gdk_draw_line (window, gc4, - x + 1, y + height - 1, x + width - 2, y + height - 1); - gdk_draw_line (window, gc4, - x + width - 1, y, x + width - 1, y + height - 2); - break; - case GTK_POS_BOTTOM: - gtk_style_apply_default_background (style, window, - widget && !GTK_WIDGET_NO_WINDOW (widget), - state_type, area, - x + style->xthickness, - y + style->ythickness, - width - (2 * style->xthickness), - height - (style->ythickness)); - gdk_draw_line (window, gc1, - x + 1, y, x + width - 2, y); - gdk_draw_line (window, gc1, - x, y + 1, x, y + height - 1); - gdk_draw_line (window, gc2, - x + 1, y + 1, x + width - 2, y + 1); - gdk_draw_line (window, gc2, - x + 1, y + 1, x + 1, y + height - 1); - - gdk_draw_line (window, gc3, - x + width - 2, y + 2, x + width - 2, y + height - 1); - gdk_draw_line (window, gc4, - x + width - 1, y + 1, x + width - 1, y + height - 1); - break; - case GTK_POS_LEFT: - gtk_style_apply_default_background (style, window, - widget && !GTK_WIDGET_NO_WINDOW (widget), - state_type, area, - x, - y + style->ythickness, - width - (style->xthickness), - height - (2 * style->ythickness)); - gdk_draw_line (window, gc1, - x, y, x + width - 2, y); - gdk_draw_line (window, gc2, - x + 1, y + 1, x + width - 2, y + 1); - - gdk_draw_line (window, gc3, - x, y + height - 2, x + width - 2, y + height - 2); - gdk_draw_line (window, gc3, - x + width - 2, y + 2, x + width - 2, y + height - 2); - gdk_draw_line (window, gc4, - x, y + height - 1, x + width - 2, y + height - 1); - gdk_draw_line (window, gc4, - x + width - 1, y + 1, x + width - 1, y + height - 2); - break; - case GTK_POS_RIGHT: - gtk_style_apply_default_background (style, window, - widget && !GTK_WIDGET_NO_WINDOW (widget), - state_type, area, - x + style->xthickness, - y + style->ythickness, - width - (style->xthickness), - height - (2 * style->ythickness)); - gdk_draw_line (window, gc1, - x + 1, y, x + width - 1, y); - gdk_draw_line (window, gc1, - x, y + 1, x, y + height - 2); - gdk_draw_line (window, gc2, - x + 1, y + 1, x + width - 1, y + 1); - gdk_draw_line (window, gc2, - x + 1, y + 1, x + 1, y + height - 2); - - gdk_draw_line (window, gc3, - x + 2, y + height - 2, x + width - 1, y + height - 2); - gdk_draw_line (window, gc4, - x + 1, y + height - 1, x + width - 1, y + height - 1); - break; - } - } - - if (area) - { - gdk_gc_set_clip_rectangle (gc1, NULL); - gdk_gc_set_clip_rectangle (gc2, NULL); - gdk_gc_set_clip_rectangle (gc3, NULL); - gdk_gc_set_clip_rectangle (gc4, NULL); - } -} - -/** - * gtk_paint_extension: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @x: x origin of the extension - * @y: y origin of the extension - * @width: width of the extension - * @height: width of the extension - * @gap_side: the side on to which the extension is attached - * - * Draws an extension, i.e. a notebook tab. - **/ -void -gtk_paint_extension (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - gchar *detail, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != NULL); - - gtk_default_draw_extension (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side); -} - -static void -gtk_default_draw_flat_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - GdkGC *gc1; - GdkGC *freeme = NULL; - - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - sanitize_size (window, &width, &height); - - if (detail) - { - if (state_type == GTK_STATE_SELECTED) - { - if (!strcmp ("text", detail)) - gc1 = style->bg_gc[GTK_STATE_SELECTED]; - else if (!strncmp ("cell_even", detail, strlen ("cell_even")) || - !strncmp ("cell_odd", detail, strlen ("cell_odd"))) - { - /* This has to be really broken; alex made me do it. -jrb */ - if (GTK_WIDGET_HAS_FOCUS (widget)) - gc1 = style->base_gc[state_type]; - else - gc1 = style->base_gc[GTK_STATE_ACTIVE]; - } - else - { - gc1 = style->bg_gc[state_type]; - } - } - else - { - if (!strcmp ("viewportbin", detail)) - gc1 = style->bg_gc[GTK_STATE_NORMAL]; - else if (!strcmp ("entry_bg", detail)) - gc1 = style->base_gc[state_type]; - - /* For trees: even rows are base color, odd rows are a shade of - * the base color, the sort column is a shade of the original color - * for that row. - */ - - else if (!strcmp ("cell_even", detail) || - !strcmp ("cell_odd", detail) || - !strcmp ("cell_even_ruled", detail)) - { - GdkColor *color = NULL; - - gtk_widget_style_get (widget, - "even_row_color", &color, - NULL); - - if (color) - { - freeme = get_darkened_gc (window, color, 0); - gc1 = freeme; - - gdk_color_free (color); - } - else - gc1 = style->base_gc[state_type]; - } - else if (!strcmp ("cell_odd_ruled", detail)) - { - GdkColor *color; - - gtk_widget_style_get (widget, - "odd_row_color", &color, - NULL); - - if (color) - { - freeme = get_darkened_gc (window, color, 0); - gc1 = freeme; - - gdk_color_free (color); - } - else - { - gtk_widget_style_get (widget, - "even_row_color", &color, - NULL); - - if (color) - { - freeme = get_darkened_gc (window, color, 1); - gdk_color_free (color); - } - else - freeme = get_darkened_gc (window, &style->base[state_type], 1); - gc1 = freeme; - } - } - else if (!strcmp ("cell_even_sorted", detail) || - !strcmp ("cell_odd_sorted", detail) || - !strcmp ("cell_even_ruled_sorted", detail)) - { - GdkColor *color = NULL; - - if (!strcmp ("cell_odd_sorted", detail)) - gtk_widget_style_get (widget, - "odd_row_color", &color, - NULL); - else - gtk_widget_style_get (widget, - "even_row_color", &color, - NULL); - - if (color) - { - freeme = get_darkened_gc (window, color, 1); - gc1 = freeme; - - gdk_color_free (color); - } - else - { - freeme = get_darkened_gc (window, &style->base[state_type], 1); - gc1 = freeme; - } - } - else if (!strcmp ("cell_odd_ruled_sorted", detail)) - { - GdkColor *color = NULL; - - gtk_widget_style_get (widget, - "odd_row_color", &color, - NULL); - - if (color) - { - freeme = get_darkened_gc (window, color, 1); - gc1 = freeme; - - gdk_color_free (color); - } - else - { - gtk_widget_style_get (widget, - "even_row_color", &color, - NULL); - - if (color) - { - freeme = get_darkened_gc (window, color, 2); - gdk_color_free (color); - } - else - freeme = get_darkened_gc (window, &style->base[state_type], 2); - gc1 = freeme; - } - } - else - gc1 = style->bg_gc[state_type]; - } - } - else - gc1 = style->bg_gc[state_type]; - - if (!style->bg_pixmap[state_type] || gc1 != style->bg_gc[state_type] /*|| GDK_IS_PIXMAP (window)*/) - { - if (area) - gdk_gc_set_clip_rectangle (gc1, area); - - gdk_draw_rectangle (window, gc1, TRUE, - x, y, width, height); - - if (detail && !strcmp ("tooltip", detail)) - gdk_draw_rectangle (window, style->black_gc, FALSE, - x, y, width - 1, height - 1); - - if (area) - gdk_gc_set_clip_rectangle (gc1, NULL); - } - else - gtk_style_apply_default_background (style, window, - widget && !GTK_WIDGET_NO_WINDOW (widget), - state_type, area, x, y, width, height); - - - if (freeme) { - g_object_unref ((GObject *) freeme); - } -} -/** - * gtk_paint_flat_box: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @x: x origin of the box - * @y: y origin of the box - * @width: the width of the box - * @height: the height of the box - * - * Draws a flat box on @window with the given parameters. - */ -void -gtk_paint_flat_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL); - - gtk_default_draw_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); -} - -static void -gtk_default_draw_focus (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - GdkPoint points[5]; - GdkGC *gc; - gboolean free_dash_list = FALSE; - gint line_width = 1; - gint8 *dash_list = "\1\1"; - gint dash_len; - - if (widget) - { - gtk_widget_style_get (widget, - "focus-line-width", &line_width, - "focus-line-pattern", (gchar *)&dash_list, - NULL); - - free_dash_list = TRUE; - } - - sanitize_size (window, &width, &height); - - if (detail && !strcmp (detail, "colorwheel_light")) - gc = style->black_gc; - else if (detail && !strcmp (detail, "colorwheel_dark")) - gc = style->white_gc; - else - gc = style->fg_gc[state_type]; - - gdk_gc_set_line_attributes (gc, line_width, - dash_list[0] ? GDK_LINE_ON_OFF_DASH : GDK_LINE_SOLID, - GDK_CAP_BUTT, GDK_JOIN_MITER); - - if (area) - gdk_gc_set_clip_rectangle (gc, area); - - if (detail && !strcmp (detail, "add-mode")) - { - if (free_dash_list) - g_free (dash_list); - - dash_list = "\4\4"; - free_dash_list = FALSE; - } - - points[0].x = x + line_width / 2; - points[0].y = y + line_width / 2; - points[1].x = x + width - line_width + line_width / 2; - points[1].y = y + line_width / 2; - points[2].x = x + width - line_width + line_width / 2; - points[2].y = y + height - line_width + line_width / 2; - points[3].x = x + line_width / 2; - points[3].y = y + height - line_width + line_width / 2; - points[4] = points[0]; - - if (!dash_list[0]) - { - gdk_draw_lines (window, gc, points, 5); - } - else - { - /* We go through all the pain below because the X rasterization - * rules don't really work right for dashed lines if you - * want continuity in segments that go between top/right - * and left/bottom. For instance, a top left corner - * with a 1-1 dash is drawn as: - * - * X X X - * X - * - * X - * - * This is because pixels on the top and left boundaries - * of polygons are drawn, but not on the bottom and right. - * So, if you have a line going up that turns the corner - * and goes right, there is a one pixel shift in the pattern. - * - * So, to fix this, we drawn the top and right in one call, - * then the left and bottom in another call, fixing up - * the dash offset for the second call ourselves to get - * continuity at the upper left. - * - * It's not perfect since we really should have a join at - * the upper left and lower right instead of two intersecting - * lines but that's only really apparent for no-dashes, - * which (for this reason) are done as one polygon and - * don't to through this code path. - */ - - dash_len = strlen (dash_list); - - if (dash_list[0]) - gdk_gc_set_dashes (gc, 0, dash_list, dash_len); - - gdk_draw_lines (window, gc, points, 3); - - /* We draw this line one farther over than it is "supposed" to - * because of another rasterization problem ... if two 1 pixel - * unjoined lines meet at the lower right, there will be a missing - * pixel. - */ - points[2].x += 1; - - if (dash_list[0]) - { - gint dash_pixels = 0; - gint i; - - /* Adjust the dash offset for the bottom and left so we - * match up at the upper left. - */ - for (i = 0; i < dash_len; i++) - dash_pixels += dash_list[i]; - - if (dash_len % 2 == 1) - dash_pixels *= 2; - - gdk_gc_set_dashes (gc, dash_pixels - (width + height - 2 * line_width) % dash_pixels, dash_list, dash_len); - } - - gdk_draw_lines (window, gc, points + 2, 3); - } - - gdk_gc_set_line_attributes (gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); - - if (area) - gdk_gc_set_clip_rectangle (gc, NULL); - - if (free_dash_list) - g_free (dash_list); -} - -/** - * gtk_paint_focus: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @x: the x origin of the rectangle around which to draw a focus indicator - * @y: the y origin of the rectangle around which to draw a focus indicator - * @width: the width of the rectangle around which to draw a focus indicator - * @height: the height of the rectangle around which to draw a focus indicator - * - * Draws a focus indicator around the given rectangle on @window using the - * given style. - */ -void -gtk_paint_focus (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != NULL); - - gtk_default_draw_focus (style, window, state_type, area, widget, detail, x, y, width, height); -} - -static void -gtk_default_draw_option (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - if (detail && strcmp (detail, "cellradio") == 0) - { - - ErrOut("gtk_paint.c: cellradio was commented out..\n"); -#if 0 - - /* have no cellradios.. */ - if (area) - gdk_gc_set_clip_rectangle (widget->style->fg_gc[state_type], area); - gdk_draw_arc (window, - widget->style->fg_gc[state_type], - FALSE, - x, y, - width, - height, - 0, 360*64); - - if (shadow_type == GTK_SHADOW_IN) - { - gdk_draw_arc (window, - widget->style->fg_gc[state_type], - TRUE, - x + 2, - y + 2, - width - 4, - height - 4, - 0, 360*64); - } - else if (shadow_type == GTK_SHADOW_ETCHED_IN) /* inconsistent */ - { - draw_part (window, widget->style->fg_gc[state_type], - area, x, y, CHECK_INCONSISTENT_TEXT); - } - if (area) - gdk_gc_set_clip_rectangle (widget->style->fg_gc[state_type], NULL); -#endif - } - else { - GdkGC *free_me = NULL; - - GdkGC *base_gc; - GdkGC *text_gc; - GdkGC *aa_gc; - - x -= (1 + INDICATOR_PART_SIZE - width) / 2; - y -= (1 + INDICATOR_PART_SIZE - height) / 2; - - if (detail && strcmp (detail, "option") == 0) { /* Menu item */ - text_gc = style->fg_gc[state_type]; - base_gc = style->bg_gc[state_type]; - aa_gc = free_me = create_aa_gc (window, style, state_type); - } - else { - if (state_type == GTK_STATE_ACTIVE) { - text_gc = style->fg_gc[state_type]; - base_gc = style->bg_gc[state_type]; - aa_gc = free_me = create_aa_gc (window, style, state_type); - } - else { - text_gc = style->text_gc[state_type]; - base_gc = style->base_gc[state_type]; - aa_gc = style->text_aa_gc[state_type]; - } - - draw_part (window, base_gc, area, x, y, RADIO_BASE); - draw_part (window, style->black_gc, area, x, y, RADIO_BLACK); - draw_part (window, style->dark_gc[state_type], area, x, y, RADIO_DARK); - draw_part (window, style->mid_gc[state_type], area, x, y, RADIO_MID); - draw_part (window, style->light_gc[state_type], area, x, y, RADIO_LIGHT); - } - - if (shadow_type == GTK_SHADOW_IN) { - draw_part (window, text_gc, area, x, y, RADIO_TEXT); - } - else if (shadow_type == GTK_SHADOW_ETCHED_IN) { /* inconsistent */ - if (detail && strcmp (detail, "option") == 0) { /* Menu item */ - draw_part (window, text_gc, area, x, y, CHECK_INCONSISTENT_TEXT); - } - else { - draw_part (window, text_gc, area, x, y, RADIO_INCONSISTENT_TEXT); - draw_part (window, aa_gc, area, x, y, RADIO_INCONSISTENT_AA); - } - } - - if (free_me) { - g_object_unref ((GObject *) free_me); - } - } -} - -/** - * gtk_paint_option: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @area: clip rectangle - * @widget: the widget - * @detail: a style detail - * @x: x origin of the rectangle to draw the option in - * @y: y origin of the rectangle to draw the option in - * @width: the width of the rectangle to draw the option in - * @height: the height of the rectangle to draw the option in - * - * Draws a radio button indicator in the given rectangle on @window with - * the given parameters. - */ -void -gtk_paint_option (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL); - - gtk_default_draw_option (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); -} - - - diff --git a/mui/gtk-mui/gtk_progressbar.c b/mui/gtk-mui/gtk_progressbar.c deleted file mode 100644 index 4cba17734..000000000 --- a/mui/gtk-mui/gtk_progressbar.c +++ /dev/null @@ -1,142 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkProgressBar *GTK_PROGRESS_BAR(GtkWidget* widget) { - return (GtkProgressBar *) widget; -} - -GtkWidget* gtk_progress_bar_new(void) { - - GtkWidget *ret; - Object *progress; - - DebOut("gtk_progress_bar_new()\n"); - - ret=mgtk_widget_new(IS_PROGRESS); - - progress = (APTR) NewObject(CL_ProgressBar->mcc_Class, NULL,MA_Widget,ret,TAG_DONE); - - DebOut(" NewObject=%lx\n",progress); - - ret->MuiObject=progress; - - return ret; -} - -gdouble gtk_progress_bar_get_fraction(GtkProgressBar *pbar) { - int i; - - DebOut("gtk_progress_bar_get_fraction(%lx)\n",pbar); - - i=xget(pbar->MuiObject,MUIA_Gauge_Current); - - return (gdouble) i/100; -} - -GtkProgressBarOrientation gtk_progress_bar_get_orientation (GtkProgressBar *pbar) { - - DebOut("TODO: gtk_progress_bar_get_orientation(%lx)\n",pbar); - - return GTK_PROGRESS_LEFT_TO_RIGHT; -} - -void gtk_progress_bar_pulse(GtkProgressBar *pbar) { - - DebOut("gtk_progress_bar_pulse(%lx)\n",pbar); - - set(pbar->MuiObject,MA_Pulse,TRUE); - - return; -} - -void gtk_progress_bar_set_fraction(GtkProgressBar *pbar, gdouble fraction) { - int i=0; - float f=0.0; - - DebOut("gtk_progress_bar_set_fraction(%lx,..)\n",pbar); - - f=fraction*100.0; - - i= 1 * f; - - set(pbar->MuiObject,MA_Pulse,FALSE); - - nnset(pbar->MuiObject,MUIA_Gauge_Current,f); - - return; -} - -void gtk_progress_bar_set_orientation (GtkProgressBar *pbar, GtkProgressBarOrientation orientation) { - - DebOut("gtk_progress_bar_set_orientation(%lx,%d)\n",pbar,orientation); - - if(orientation!=GTK_PROGRESS_LEFT_TO_RIGHT) { - WarnOut("gtk_progress_bar_set_orientation(%d) ignored\n",orientation); - } - - return; -} - -const gchar* gtk_progress_bar_get_text(GtkProgressBar *pbar) { - gchar *muitext; - - DebOut("gtk_progress_bar_get_text(%lx)\n",pbar); - - muitext=(gchar *) xget(pbar->MuiObject,MUIA_Gauge_InfoText); - - return (const gchar *) muitext; -} - -void gtk_progress_bar_set_text(GtkProgressBar *pbar, const gchar *text) { - gchar *muitext; - - DebOut("gtk_progress_bar_set_text(%lx,%s)\n",pbar,text); - - if(/* no pattern*/ 1) { - muitext=g_strdup(text); - } - - set(pbar->MuiObject,MUIA_Gauge_InfoText,muitext); - - g_free(muitext); - - return; -} diff --git a/mui/gtk-mui/gtk_radio.c b/mui/gtk-mui/gtk_radio.c deleted file mode 100644 index 64e841459..000000000 --- a/mui/gtk-mui/gtk_radio.c +++ /dev/null @@ -1,124 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id: - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -/***************************************************************************** - * The MUI Radio stuff is quite limited. I tried to use it, it - * was *more than complicated* to update the lists dynamically - * and adding hooks to the single radio buttons was not even - * done. - * - * After rewriting this thing for three times, I choose - * to implement radio buttons on my own.. much better ;). - * - * After seeing, how ugly the hook code gets over the time, - * I made a MUI custom class for radio widgets. - *****************************************************************************/ - -void mgtk_update_group(GtkWidget *widget, GSList *group) { - - DebOut("mgtk_update_group(%lx,%lx)\n",widget,group); - - widget->GSList=(APTR) group; -} - -GtkRadioButton *GTK_RADIO_BUTTON(GtkWidget *widget) { - return((GtkRadioButton *) widget); -} - -GtkWidget *gtk_radio_button_new_with_label( GSList *group, const gchar *label ) { - GtkWidget *ret; - /* - GSList *last; - GtkWidget *w; - */ - Object *radio; - - DebOut("==============================================\n"); - DebOut("gtk_radio_button_new_with_label(%lx,%s)\n",group,label); - - ret=mgtk_widget_new(IS_RADIO); - - ret->title=g_strdup(label); - - if(group==NULL) { - DebOut(" first element in this radio group.\n"); - } - else { - DebOut(" add another element to group %lx\n",group); - DebOut(" group length: %ld\n",g_slist_length(group)); -/* last=g_slist_last (group); - w=(GtkWidget *) last->data; -*/ - } - - radio=NewObject(CL_RadioButton->mcc_Class, NULL,MA_Widget,ret,MA_Radio_Label,label,TAG_DONE); - - ret->MuiObject=(APTR) radio; - - group=g_slist_append(group,ret); - mgtk_update_group(ret,group); - - return ret; -} - -/* Deprecated compatibility macro. Use gtk_radio_button_get_group() instead. */ -GSList *gtk_radio_button_group(GtkWidget *widget) { - - DebOut("gtk_radio_button_group(%lx)\n",widget); - - return(gtk_radio_button_get_group(widget)); -} - -GSList *gtk_radio_button_get_group(GtkWidget *widget) { - - DebOut("gtk_radio_button_get_group(%lx): %lx\n",widget,widget->GSList); - - return((GSList *) widget->GSList); -} - -GtkWidget* gtk_radio_button_new_with_label_from_widget( GtkRadioButton *group, const gchar *label ) { - - DebOut("gtk_radio_button_new_with_label_from_widget(%lx,%s)\n",group,label); - - return(gtk_radio_button_new_with_label((GSList *)group->GSList,label)); -} - diff --git a/mui/gtk-mui/gtk_scrollbar.c b/mui/gtk-mui/gtk_scrollbar.c deleted file mode 100644 index 3d1a8de04..000000000 --- a/mui/gtk-mui/gtk_scrollbar.c +++ /dev/null @@ -1,554 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#ifdef __MORPHOS__ -#include -#else -#include -#endif -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -/****************************************************************************** - * Problem here is, that MUI only has integers as values for sliders, - * GTK can use floats. - ******************************************************************************/ - -GtkWidget *mgtk_scale_new(GtkAdjustment *adjustment, gint vert); -GtkWidget *mgtk_scroll_new(GtkAdjustment *adjustment, gint vert); -gchar* g_strdup_printf (const gchar *format, ...); - - -GtkWidget *gtk_hscale_new( GtkAdjustment *adjustment ) { - return mgtk_scale_new(adjustment,0); -} - -GtkWidget *gtk_vscale_new( GtkAdjustment *adjustment ) { - return mgtk_scale_new(adjustment,1); -} - -GtkWidget *gtk_hscrollbar_new( GtkAdjustment *adjustment ) { - return mgtk_scroll_new(adjustment,0); -} - -GtkWidget *gtk_vscrollbar_new( GtkAdjustment *adjustment ) { - return mgtk_scroll_new(adjustment,1); -} - -/******************************* - * mgtk_scale_update - * - * This hook updates the string - * of a scale widget, if there - * is one - * and of course sets value - *******************************/ - -void mgtk_scale_update( GtkWidget *source, GtkWidget *widget) { - Object *obj; - int level; - gchar *text; - gchar *format; - - DebOut("mgtk_scale_update(%lx,%lx)\n",source,widget); - - /* set value of GtkWidget */ - level=xget(mgtk_get_mui_action_object(widget),MUIA_Numeric_Value); - widget->value=level*widget->step_increment; - - if(widget->draw_value == 0) { - /* nothing to draw */ - return; - } - - /* which string is visible? also generate format string (position, decimal places)*/ - switch(widget->value_pos) { - case GTK_POS_TOP: - obj=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_top"); - format=g_strdup_printf("\033c%%2.%df",widget->decimalplaces); - break; - case GTK_POS_BOTTOM: - obj=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_bottom"); - format=g_strdup_printf("\033c%%2.%df",widget->decimalplaces); - break; - case GTK_POS_RIGHT: - obj=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_right"); - format=g_strdup_printf("\033l%%2.%df",widget->decimalplaces); - break; - case GTK_POS_LEFT: - obj=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_left"); - format=g_strdup_printf("\033r%%2.%df",widget->decimalplaces); - break; - default: - ErrOut("mgtk_scale_update: unknown case: %d\n",widget->value_pos); - return; - } - - text=g_strdup_printf(format,widget->value); - - DebOut(" Text MuiObj: %lx\n",obj); - DebOut(" Action MuiObj: %lx\n",mgtk_get_mui_action_object(widget)); - DebOut(" Level: %ld\n",level); - DebOut(" text: >%s<\n",text); - - /* update text */ - set(obj,MUIA_Text_Contents,(LONG) text); - - g_free(format); - g_free(text); -} - -void mgtk_scale_update_show(GtkWidget *widget) { - Object *top; - Object *bottom; - Object *left; - Object *right; - gint width; - gint height; - - DebOut("mgtk_scale_update_show(%lx)\n"); - - top=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_top"); - bottom=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_bottom"); - left=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_left"); - right=(Object *) g_object_get_data(G_OBJECT(widget),"mui_text_right"); - width=(gint) g_object_get_data(G_OBJECT(widget),"MUIA_FixWidth"); - height=(gint) g_object_get_data(G_OBJECT(widget),"MUIA_FixHeight"); - - - if(widget->draw_value == 0) { - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - set(top,MUIA_ShowMe,FALSE); - set(bottom,MUIA_ShowMe,FALSE); - set(left,MUIA_ShowMe,FALSE); - set(right,MUIA_ShowMe,FALSE); - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - return; - } - - /* seems magic, that you *have* to do it in this - * order? seting it to true and then hiding the - * others seems problematic, at least..? - * Will be interesting, how zune can do that stuff .. - */ - switch(widget->value_pos) { - case GTK_POS_TOP: - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - set(bottom,MUIA_ShowMe,FALSE); - set(left,MUIA_ShowMe,FALSE); - set(right,MUIA_ShowMe,FALSE); - set(top,MUIA_ShowMe,TRUE); - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - break; - case GTK_POS_BOTTOM: - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - set(top,MUIA_ShowMe,FALSE); - set(left,MUIA_ShowMe,FALSE); - set(right,MUIA_ShowMe,FALSE); - set(bottom,MUIA_ShowMe,TRUE); - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - break; - case GTK_POS_LEFT: - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - set(top,MUIA_ShowMe,FALSE); - set(bottom,MUIA_ShowMe,FALSE); - set(right,MUIA_ShowMe,FALSE); - set(left,MUIA_Weight,0); - set(left,MUIA_ShowMe,TRUE); - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - break; - case GTK_POS_RIGHT: - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - set(top,MUIA_ShowMe,FALSE); - set(bottom,MUIA_ShowMe,FALSE); - set(left,MUIA_ShowMe,FALSE); - set(right,MUIA_ShowMe,TRUE); - set(right,MUIA_Weight,0); - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - break; - default: - WarnOut("mgtk_scale_update_show: unknown case: %d\n",widget->value_pos); - break; - } - mgtk_scale_update(widget,widget); - - /* if it had a fixed width/height, this might have been lost, so redo it */ - if(width>0) { - DebOut(" we have a fixed width\n"); - SetAttrs(widget->MuiObject,MUIA_FixWidth,width, TAG_DONE); - } - if(height>0) { - SetAttrs(widget->MuiObject,MUIA_FixHeight,height, TAG_DONE); - } -} - -/* starting text values are overwritten through the hook automatically */ - -GtkWidget *mgtk_scale_new(GtkAdjustment *adjustment, gint vert) { - - GtkWidget *ret; - Object *scroll; - Object *box; - Object *top; - Object *bottom; - Object *left; - Object *right; - gint min; - gint max; - gint level; - mgtk_signal_connect_data *i; - - DebOut("gtk_scale_new(%lx,%ld)\n",adjustment,vert); - - ret=mgtk_widget_new(IS_SCROLLBAR); - - if(adjustment->step_increment) { - max=(int) (adjustment->upper / adjustment->step_increment); - if(((int) (adjustment->upper / adjustment->step_increment) * adjustment->step_increment) != adjustment->upper) { - /* correct rounding error */ - max++; - } - min=(int) adjustment->lower / adjustment->step_increment; - DebOut(" min=%ld\n",min); - DebOut(" max=%ld\n",max); - } - else { - DebOut("WARNING: adjustment->step_increment == 0 !?\n"); - max=adjustment->upper; - min=adjustment->lower; - } - - level=(int) adjustment->value/adjustment->step_increment; - - box=(APTR) - VGroup, - Child, - top=(APTR) TextObject, - MUIA_Text_Contents,/*MUIX_C*/"\033ctop", - MUIA_ShowMe,FALSE, - End, - Child, - HGroup, - Child, - left=(APTR) TextObject, - MUIA_Text_Contents,"left", - MUIA_Weight,0, - End, - Child, - scroll=(APTR) SliderObject, - MUIA_Numeric_Min , min, - MUIA_Numeric_Max , max, - MUIA_Numeric_Value, level, - MUIA_Weight,100, - End, - Child, - right=(APTR) TextObject, - MUIA_Text_Contents,/*MUIX_L*/"\033lright", - MUIA_ShowMe,FALSE, - MUIA_Weight,0, - End, - End, - Child, - bottom=(APTR) TextObject, - MUIA_Text_Contents,/*MUIX_C*/"\033cbottom", - MUIA_ShowMe,FALSE, - End, - End; - - /* remember the text objects */ - /* maybe we should use this more often.. would make the GtkWidget struct a lot smaller..? */ - g_object_set_data(G_OBJECT(ret),"mui_text_top",(gpointer) top); - g_object_set_data(G_OBJECT(ret),"mui_text_left",(gpointer) left); - g_object_set_data(G_OBJECT(ret),"mui_text_right",(gpointer) right); - g_object_set_data(G_OBJECT(ret),"mui_text_bottom",(gpointer) bottom); - - if(vert) { - set(scroll, MUIA_Slider_Horiz , FALSE); - } - - set(scroll,MUIA_Numeric_Format,(ULONG) ""); /* MUI can only do integers, we need floats.. :( */ - - ret->MuiObject=box; - ret->nextObject=(APTR) scroll; - ret->value=adjustment->value; - ret->lower=adjustment->lower; - ret->upper=adjustment->upper; - ret->step_increment=adjustment->step_increment; - /* - ret->page_increment=adjustment->page_increment; - ret->page_size=adjustment->page_size; - */ - /* this is a slider! */ - ret->page_increment=0; - ret->page_size=0; - /* defaults */ - ret->draw_value=FALSE; - ret->value_pos=GTK_POS_LEFT; - - /* special Range properties */ - GTK_RANGE(ret)->adjustment=adjustment; - if(vert) { - GTK_RANGE(ret)->orientation=GTK_ORIENTATION_VERTICAL; - } - else { - GTK_RANGE(ret)->orientation=GTK_ORIENTATION_HORIZONTAL; - } - - - /* connect our own string update hook */ - g_signal_connect (G_OBJECT (ret), "value_changed", G_CALLBACK (mgtk_scale_update), ret); - - if(adjustment->mgtk_signal_connect_data) { - DebOut(" we have signals to connect remembered..\n"); - i=(APTR) adjustment->mgtk_signal_connect_data; - while(i!=NULL) { - /* care for data !? */ - DebOut(" i=%lx\n",i); - DebOut(" ret=%lx\n",ret); - DebOut(" ret->MuiObject=%lx\n",ret->MuiObject); - g_signal_connect_data(ret,i->detailed_signal,i->c_handler,i->data,i->destroy_data,i->connect_flags); - - i=(APTR) i->next; - } - } - - /* remember all scales created with this adjustment */ - g_slist_append(adjustment->GSList,ret); - - return ret; -} - -/*gtk_adjustment_new (0.0, 0.0, 101.0, 0.1, 1.0, 1.0); value,lower,upper,step_increment,page_increment,page_size*/ -GtkWidget *mgtk_scroll_new(GtkAdjustment *adjustment, gint vert) { - - GtkWidget *ret; - Object *scroll; - gint min; - gint max; - mgtk_signal_connect_data *i; - - DebOut("gtk_hscrollbar_new(%lx)\n",adjustment); - - ret=mgtk_widget_new(IS_SCROLLBAR); - - max=(int) adjustment->upper - adjustment->page_size; - min=(int) adjustment->lower; - DebOut(" min=%ld\n",min); - DebOut(" max=%ld\n",max); - -/* - level=(int) adjustment->value/adjustment->step_increment; -*/ - - scroll = (APTR) MUI_NewObject( MUIC_Scrollbar, - MUIA_Group_Horiz, vert ? FALSE : TRUE, - TAG_DONE); - - set(scroll,MUIA_Prop_Entries,(ULONG) max-min); - - ret->MuiObject=scroll; - ret->value=adjustment->value; - ret->lower=adjustment->lower; - ret->upper=adjustment->upper; -/* ret->step_increment=adjustment->step_increment;*/ - /* this is a scrollbar */ - ret->step_increment=0; - ret->page_increment=adjustment->page_increment; - ret->page_size=adjustment->page_size; - - if(adjustment->mgtk_signal_connect_data!=NULL) { - DebOut(" we have signals to connect remembered..\n"); - i=(APTR) adjustment->mgtk_signal_connect_data; - while(i!=NULL) { - /* care for data !? */ - g_signal_connect_data(ret,i->detailed_signal,i->c_handler,i->data,i->destroy_data,i->connect_flags); - - i=(APTR) i->next; - } - } - - /* remember all scrollbars created with this adjustment */ - g_slist_append(adjustment->GSList,ret); - - return ret; -} - -GtkAdjustment *gtk_adjustment_new( gdouble value, gdouble lower, gdouble upper, gdouble step_increment, gdouble page_increment, gdouble page_size ) { - - GtkAdjustment *ret; - - DebOut("gtk_adjustment_new(%f,%f,%f,%f,%f,%f)\n",value,lower,upper,step_increment,page_increment,page_size); - - ret=mgtk_widget_new(IS_ADJUSTMENT); - - ret->lower=lower; - ret->upper=upper; - ret->value=value; - ret->step_increment=step_increment; - ret->page_increment=page_increment; - ret->page_size=page_size; - - return ret; -} - -void gtk_adjustment_set_value(GtkAdjustment *adjustment, gdouble value) { - int v; - GtkWidget *w; - GSList *g; - - DebOut("gtk_adjustment_set_value(%lx,%f)\n",adjustment,value); - - /* an adjustment is a quite abstract object, it has no MuiObject.. - * but we have all real Objects in the GSList */ - - g=(GSList *)adjustment->GSList; - - while(g) { - w=g->data; - w->value=value; - - if(w->step_increment) { - /* slider */ - DebOut(" set_value on slider\n"); - v=(int) value / w->step_increment; - - /* this should call the appropiate hooks, too */ - } - else { - /* scrollbar */ - DebOut(" set_value on scollbar\n"); - v=(int) value; - /*??*/ - } - set(mgtk_get_mui_action_object(w),MUIA_Numeric_Value,v); -/* g=g_slist_next(g);*/ - g=g->next; - } -} - -/* set the number of decimal points displayed */ -void gtk_scale_set_digits(GtkScale *scale, gint digits) { - - DebOut("gtk_scale_set_digits(%lx,%ld)\n",scale,digits); - - scale->decimalplaces=digits; - - if(scale->type == IS_SCROLLBAR) { - GTK_RANGE(scale)->round_digits=digits; - } - - mgtk_scale_update(scale,scale); -} - -GtkScale* GTK_SCALE(GtkWidget *widget) { - return (GtkScale*) widget; -} - -void gtk_scale_set_draw_value(GtkScale *scale, gboolean draw_value) { - - DebOut("gtk_scale_set_draw_value(%lx,%ld)\n",scale,draw_value); - - scale->draw_value=draw_value; - mgtk_scale_update_show(scale); -} - -void gtk_scale_set_value_pos(GtkScale *scale, GtkPositionType pos) { - - DebOut("gtk_scale_set_value_pos(%lx,%ld)\n",scale,pos); - - scale->value_pos=pos; - mgtk_scale_update_show(scale); -} - -void gtk_adjustment_changed(GtkAdjustment *adjustment) { - DebOut("gtk_adjustment_changed(%lx)\n",adjustment); - - g_signal_emit_by_name(adjustment,"changed"); -} - -/******************** - * GtkRange - ********************/ - -void gtk_range_set_update_policy(GtkRange *range, GtkUpdateType policy) { - - DebOut("gtk_range_set_update_policy(%lx,%ld)\n",range,policy); - - if(policy!=GTK_UPDATE_CONTINUOUS) { - DebOut(" WARNING: gtk_range_set_update_policy: policy %ld not supported (only GTK_UPDATE_CONTINUOUS)\n"); - } - - range->update_policy=policy; - - return; -} - -GtkAdjustment* gtk_range_get_adjustment(GtkRange *range) { - - DebOut("gtk_range_get_adjustment(%lx)\n",range); - - if(!range->adjustment) { - DebOut("WARNING: range has no linked adjustment!!\n"); - } - - return range->adjustment; -} - -/* not tested: */ -void gtk_range_set_adjustment(GtkRange *range, GtkAdjustment *adjustment) { - - DebOut("gtk_range_set_adjustment(%lx,%lx)\n",range,adjustment); - DebOut("WARNING: this function has not beed tested so far!\n"); - - - if(range->adjustment == adjustment) { - DebOut(" range had already this adjustment\n"); - return; - } - - if(range->adjustment) { - DebOut(" range had already an adjustment\n"); - g_object_unref(G_OBJECT(range->adjustment)); - } - - range->adjustment=adjustment; - g_object_ref(G_OBJECT(adjustment)); - range->round_digits=adjustment->digits; - - /* TODO: set orientation etc.. */ - -} diff --git a/mui/gtk-mui/gtk_separator.c b/mui/gtk-mui/gtk_separator.c deleted file mode 100644 index 756fc65d8..000000000 --- a/mui/gtk-mui/gtk_separator.c +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -GtkWidget* gtk_hseparator_new(void) { - - GtkWidget *ret; - Object *sep; - - DebOut("gtk_hseparator_new()\n"); - - ret=mgtk_widget_new(IS_SEPARATOR); - - sep=(APTR) RectangleObject, MUIA_Rectangle_HBar, TRUE, MUIA_FixHeight, 8, End; - - ret->MuiObject=sep; - - return ret; -} diff --git a/mui/gtk-mui/gtk_spinbutton.c b/mui/gtk-mui/gtk_spinbutton.c deleted file mode 100644 index 2b4bcc0fc..000000000 --- a/mui/gtk-mui/gtk_spinbutton.c +++ /dev/null @@ -1,159 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkSpinButton *GTK_SPIN_BUTTON(GtkWidget* widget) { - return (GtkSpinButton *) widget; -} - -GtkWidget* gtk_spin_button_new(GtkAdjustment *adjustment, gdouble climb_rate, guint digits) { - - GtkWidget *ret; - Object *spin; - char *value; - GSList *gs; - - DebOut("gtk_spin_button_new(%lx,,)\n",adjustment); - - ret=mgtk_widget_new(IS_SPINBUTTON); - - DebOut(" NewObject\n"); - DebOut("CL_SpinButton=%x\n",CL_SpinButton); - spin = (APTR) NewObject(CL_SpinButton->mcc_Class, NULL,MA_Widget,ret,TAG_DONE); - DebOut(" NewObject=%lx\n",spin); - - ret->MuiObject=spin; - - if(digits) { - ret->decimalplaces=digits; - ret->digits=digits; - } - else { - ret->decimalplaces=adjustment->decimalplaces; - ret->digits=digits; - } - ret->lower=adjustment->lower; - ret->upper=adjustment->upper; - if(climb_rate) { - ret->step_increment=climb_rate; - } - else { - ret->step_increment=adjustment->step_increment; - } - ret->value=adjustment->value; - - value=g_strdup_printf("%f",ret->value); - set(spin,MA_Spin_Value,value); - g_free(value); - - /* add this Widget to the adjustment */ - gs=adjustment->GSList; - gs=g_slist_append(gs,ret); - adjustment->GSList=gs; - - return ret; -} - -gint gtk_spin_button_get_value_as_int (GtkSpinButton *spin_button) { - const char *value_string; - gdouble f; - int i; - - DebOut("gtk_spin_button_get_value_as_int(%x)\n",(int) spin_button); - - value_string=(const char *) xget(spin_button->MuiObject,MA_Spin_Value); - f=atof(value_string); - i=(int) f; - - return i; -} - -void gtk_spin_button_set_digits(GtkSpinButton *spin_button, guint digits) { - char *value; - - DebOut("gtk_spin_button_set_digits(%x,%d)\n",(int) spin_button, digits); - - spin_button->decimalplaces=digits; - spin_button->digits=digits; - value=g_strdup_printf("%f",spin_button->value); - set(spin_button->MuiObject,MA_Spin_Value,value); - g_free(value); -} - -gdouble gtk_spin_button_get_value(GtkSpinButton *spin_button) { - - DebOut("gtk_spin_button_get_value(%x)\n",(int) spin_button); - - return spin_button->value; -} - -gdouble gtk_spin_button_get_value_as_float(GtkSpinButton *spin_button) { - - return gtk_spin_button_get_value(spin_button); -} - -void gtk_spin_button_set_wrap(GtkSpinButton *spin_button, gboolean wrap) { - DebOut("gtk_spin_button_set_wrap(%x,%d)\n",(int) spin_button,wrap); - - spin_button->wrap=wrap; -} - -void gtk_spin_button_set_numeric(GtkSpinButton *spin_button, gboolean numeric) { - char *all; - int i; - - DebOut("gtk_spin_button_set_numeric(%x,%d)\n",spin_button,numeric); - - if(numeric) { - set(spin_button->MuiObject,MUIA_String_Accept , "-0123456879."); - } - else { - all=g_new(char,256); - i=0; - while(i<(256-32)) { - all[i]=(char) i+32; - i++; - } - all[i]=(char) 0; - set(spin_button->MuiObject,MUIA_String_Accept , all); - g_free(all); - } -} diff --git a/mui/gtk-mui/gtk_style.c b/mui/gtk-mui/gtk_style.c deleted file mode 100644 index 625c52b94..000000000 --- a/mui/gtk-mui/gtk_style.c +++ /dev/null @@ -1,345 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -/* TODO: move gdk functions to gdk/ */ - -static GdkGC *allocgc() { - GdkGC *ret; - - ret=g_new0(GdkGC,1); - - ret->colormap=g_new0(GdkColormap,1); - - ret->colormap->colors=g_new0(GdkColor,1); - - #if USE_PENS - ret->colormap->colors->havepen=0; - #endif - - return ret; -} - -static GdkGC *newgc(struct ColorMap *cm, gint defaultpen) { - GdkGC *ret; - - ret=allocgc(); - - if (ret) - { - #if USE_PENS - ret->colormap->colors->pen=defaultpen; - ret->colormap->colors->havepen=1; - #else - ULONG colors[3]; - - GetRGB32(cm, defaultpen, 1, colors); - - ret->colormap->colors->red = colors[0] >> 16; - ret->colormap->colors->blue = colors[1] >> 16; - ret->colormap->colors->green = colors[2] >> 16; - #endif - } - - return ret; -} - -GdkGC *gdk_gc_new(GdkWindow *window) { - GdkGC *ret; - - ret=allocgc(); - #if USE_PENS - ret->colormap->colors->havepen=0; - #endif - - return ret; -} - -GtkStyle *gtk_style_new() { - - GtkStyle *ret; - int i; - - DebOut("gtk_style_new()\n"); - - ret=g_new0(GtkStyle,1); - i=0; - while(i<6) { - ret->fg_gc[i]=allocgc(); - ret->bg_gc[i]=allocgc(); - ret->light_gc[i]=allocgc(); - ret->dark_gc[i]=allocgc(); - ret->mid_gc[i]=allocgc(); - ret->text_gc[i]=allocgc(); - ret->base_gc[i]=allocgc(); - ret->text_aa_gc[i]=allocgc(); - ret->bg_pixmap[i]=g_new0(GdkPixmap,1); - - i++; - } - ret->white_gc=allocgc(); - ret->black_gc=allocgc(); - - ret->xthickness=2; - ret->ythickness=2; - - ret->colormap=g_new0(GdkColormap,1); - ret->colormap->colors=g_new0(GdkColor,1); - #if USE_PENS - ret->colormap->colors->havepen=0; - #endif - - ret->attach_count=0; - - return ret; -} - -void gtk_style_set_background(GtkStyle *style, GdkWindow *window, GtkStateType state_type) { - - DebOut("gtk_style_set_background(%lx,%lx,%d)\n",style,window,state_type); - - DebOut(" ... nothing to do, we care for styles in MUI?\n"); - -} - -void gtk_style_apply_default_background (GtkStyle *style, GdkWindow *window, gboolean set_bg, GtkStateType state_type, GdkRectangle *area, gint x, gint y, gint width, gint height) { - - DebOut("gtk_style_apply_default_background(%lx,%lx,%d)\n",style,window,set_bg); - - DebOut(" ... nothing to do, we care for styles in MUI?\n"); -} - -/* - DETAILPEN - Pen compatible with V34. Used to render text in the screen's title bar. - BLOCKPEN - Pen compatible with V34. Used to fill the screen's title bar. - TEXTPEN - Pen for regular text on BACKGROUNDPEN. - SHINEPEN - Pen for the bright edge on 3D objects. - SHADOWPEN - Pen for the dark edge on 3D objects. - FILLPEN - Pen for filling the active window borders and selected gadgets. - FILLTEXTPEN - Pen for text rendered over FILLPEN. - BACKGROUNDPEN - Pen for the background color. Currently must be zero. - HIGHLIGHTTEXTPEN - Pen for "special color" or highlighted text on BACKGROUNDPEN.k - - or MUI pens ?? - MPEN_SHINE = 0, - MPEN_HALFSHINE = 1, - MPEN_BACKGROUND = 2, - MPEN_HALFSHADOW = 3, - MPEN_SHADOW = 4, - MPEN_TEXT = 5, - MPEN_FILL = 6, - MPEN_MARK = 7, - MPEN_COUNT = 8, - -*/ - -/********************************************************************** - mgtk_update_default_style() - - Update style according to MUI settings -**********************************************************************/ - -void mgtk_update_default_style(APTR obj) -{ - struct MUI_RenderInfo *mri; - struct ColorMap *cm; - ULONG i; - - #if DEBUG - if (obj != mgtk->MuiRoot) - { - DebOut("mgtk_update_default_style(): Only MuiRoot is allowed to call this function\n"); - } - - if (!mgtk->default_style) - { - DebOut("mgtk_update_default_style(): BANG! mgtk->default_style is still NULL.\n"); - return; - } - #endif - - mri = muiRenderInfo(obj); - cm = _screen(obj)->ViewPort.ColorMap; - - for (i = 0; i < 6; i++) - { -#if USE_PENS - #define INTUI_PENS 0 - #if INTUI_PENS - mgtk->default_style->fg_gc[i]=newgc(cm, MGTK_PEN_FG); - mgtk->default_style->bg_gc[i]=newgc(cm, MGTK_PEN_BG); - mgtk->default_style->light_gc[i]=newgc(cm, MGTK_PEN_LIGHT); - mgtk->default_style->dark_gc[i]=newgc(cm, MGTK_PEN_DARK); - mgtk->default_style->mid_gc[i]=newgc(cm, MGTK_PEN_MID); /* hmm..*/ - mgtk->default_style->text_gc[i]=newgc(cm, MGTK_PEN_TEXT); - mgtk->default_style->base_gc[i]=newgc(cm, MGTK_PEN_BASE); - mgtk->default_style->text_aa_gc[i]=newgc(cm, MGTK_PEN_TEXT_AA); /* hmm..*/ - #else - mri = muiRenderInfo(obj); - mgtk->default_style->fg_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_TEXT])); - mgtk->default_style->bg_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_BACKGROUND])); - mgtk->default_style->light_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_SHINE])); - mgtk->default_style->mid_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_HALFSHADOW])); - mgtk->default_style->dark_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_SHADOW])); - mgtk->default_style->text_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_TEXT])); - mgtk->default_style->base_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_BACKGROUND])); - mgtk->default_style->text_aa_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_TEXT])); - #endif -#else - mgtk->default_style->fg_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_TEXT])); - mgtk->default_style->bg_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_BACKGROUND])); - mgtk->default_style->light_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_SHINE])); - mgtk->default_style->mid_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_HALFSHADOW])); - mgtk->default_style->dark_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_SHADOW])); - mgtk->default_style->text_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_TEXT])); - mgtk->default_style->base_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_BACKGROUND])); - mgtk->default_style->text_aa_gc[i]=newgc(cm, MUIPEN(mri->mri_Pens[MPEN_TEXT])); -#endif - - DebOut("mgtk->default_style->fg_gc[i]=%d\n",mgtk->default_style->fg_gc[i]->colormap->colors->pen); - DebOut("mgtk->default_style->bg_gc[i]=%d\n",mgtk->default_style->bg_gc[i]->colormap->colors->pen); - DebOut("mgtk->default_style->light_gc[i]=%d\n",mgtk->default_style->light_gc[i]->colormap->colors->pen); - DebOut("mgtk->default_style->mid_gc[i]=%d\n",mgtk->default_style->mid_gc[i]->colormap->colors->pen); - DebOut("mgtk->default_style->dark_gc[i]=%d\n",mgtk->default_style->dark_gc[i]->colormap->colors->pen); - DebOut("mgtk->default_style->text_gc[i]=%d\n",mgtk->default_style->text_gc[i]->colormap->colors->pen); - DebOut("mgtk->default_style->base_gc[i]=%d\n",mgtk->default_style->base_gc[i]->colormap->colors->pen); - DebOut("mgtk->default_style->text_aa_gc[i]=%d\n",mgtk->default_style->text_aa_gc[i]->colormap->colors->pen); - } - - #if USE_PENS - mgtk->default_style->white_gc=newgc(cm, mgtk->white_pen); - mgtk->default_style->black_gc=newgc(cm, mgtk->black_pen); - #endif -} - -GtkStyle *mgtk_get_default_style(Object *obj) { - /* Warning: current implementation leaves structure uninitialized. - * If widgets are caching values (they shouldnt) they get bad gfx... - * Should we use hardcoded defaults? -itix - */ - - unsigned int i; - - DebOut("mgtk_get_default_style(%lx)\n"); - - if(!mgtk->default_style) { - mgtk->default_style=gtk_style_new(); - i=0; - while(i<6) { - mgtk->default_style->bg_pixmap[i]=g_new0(GdkPixmap,1); - - i++; - } - } - else { - DebOut(" just return mgtk->default_style\n"); - } - - mgtk->default_style->attach_count++; - return mgtk->default_style; -} - -/* Attaches a style to a window; this process allocates - * the colors and creates the GC's for the style - it - * specializes it to a particular visual and colormap. - * The process may involve the creation of a new style if - * the style has already been attached to a window with a - * different style and colormap. - */ - -GtkStyle *gtk_style_attach(GtkStyle *style, GdkWindow *window) { - GtkWidget *widget; - - DebOut("gtk_style_attach(%lx,%lx)\n",style,window); - - if(!window) { - DebOut("WARNING: window is NULL, so I cannot attach style..\n"); - return NULL; - } - - if(style) { - window->style=style; - } - else { - widget=(GtkWidget *) window->mgtk_widget; - window->style=mgtk_get_default_style(widget->MuiObject); - } - - return window->style; -} - -void gdk_gc_set_rgb_fg_color(GdkGC *gc, const GdkColor *color) { - - DebOut("gdk_gc_set_rgb_fg_color(%lx,%lx)",gc,color); - - if(!gc->colormap) { - ErrOut("gdk_gc_set_rgb_fg_color: gc has no colormap!\n"); - return; - } - - gc->colormap->colors->red=color->red; - gc->colormap->colors->green=color->green; - gc->colormap->colors->blue=color->blue; - #if USE_PENS - gc->colormap->colors->havepen=0; - - /* TODO: ObtainPen..? */ - #endif -} - -/* A style created by matching with the supplied paths, or NULL - * if nothing matching was specified and the default style - * should be used. - */ -GtkStyle* gtk_rc_get_style_by_paths(GtkSettings *settings, const char *widget_path, const char *class_path, GType type) { - DebOut("gtk_rc_get_style_by_paths(%lx,%s,%s,%d)\n",settings,widget_path,class_path,type); - - /* as we ignore styles more or less completely, a default style is fine here */ - - return NULL; -} diff --git a/mui/gtk-mui/gtk_table.c b/mui/gtk-mui/gtk_table.c deleted file mode 100644 index b51823b4b..000000000 --- a/mui/gtk-mui/gtk_table.c +++ /dev/null @@ -1,151 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -/* cross platform hooks */ -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes.h" - -GtkTable *GTK_TABLE(GtkWidget *widget) { - return (GtkTable *) widget; -} - -GtkWidget *gtk_table_new(guint rows, guint columns, gboolean homogeneous) { - GtkWidget *ret = NULL; - APTR table; - - DebOut("gtk_table_new(rows %ld, columns %ld, homogeneous %ld)\n",rows,columns,homogeneous); - -#if 0 - table=(APTR) GroupObject, - MUIA_Group_Columns, columns, -/* Child,TextObject,MUIA_Text_Contents,"1",End, - Child,TextObject,MUIA_Text_Contents,"2",End, - Child,TextObject,MUIA_Text_Contents,"3",End, - Child,TextObject,MUIA_Text_Contents,"4",End,*/ - End; -#endif - - table = (APTR) NewObject(CL_Table->mcc_Class, NULL,TAG_DONE); - set(table,MA_Table_Columns,columns); - set(table,MA_Table_Rows,rows); - - if (table) - { - /* - APTR child; - int i; - GtkWidget * act; - GtkWidget * next; - char text[512]; - */ - - ret = mgtk_widget_new(IS_TABLE); - - if (ret) - { - ret->MuiObject = table;; - ret->columns = columns; - ret->rows = rows; - } - else - { - MUI_DisposeObject(table); - } - } - - return ret; -} - -/* -void GLADE_HOOKUP_OBJECT(GtkWidget *a,GtkWidget *b,char *foo) { - DebOut("GLADE_HOOKUP_OBJECT: not done yet\n"); -} - -void GLADE_HOOKUP_OBJECT_NO_REF(GtkWidget *a,GtkWidget *b,char *foo) { - DebOut("GLADE_HOOKUP_OBJECT: not done yet\n"); -} -*/ - -void gtk_table_attach(GtkTable *table, GtkWidget *child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach, GtkAttachOptions xoptions, GtkAttachOptions yoptions, guint xpadding, guint ypadding ) { - - DebOut("WARNING: gtk_table_attach not done yet, just a call to gtk_table_attach_defaults!!\n"); - gtk_table_attach_defaults(table, child, left_attach,right_attach,top_attach,bottom_attach); -} - -void gtk_table_attach_defaults (GtkTable *table, GtkWidget *widget, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach) { - /* - int number; - int i=0; - GtkWidget *act; - GtkWidget *replaceme; - */ - - DebOut("gtk_table_attach_defaults(table %lx, GtkWidget %lx, left_attach %ld, right_attach %ld, top_attach %ld, bottom_attach %ld)\n",table,widget,left_attach,right_attach,top_attach,bottom_attach); - - if(widget->parent!=NULL) { - printf("WARNING: widget %x has already a parent(%x), now: %x\n",(int) widget,(int) widget->parent,(int) table); - } - widget->parent=(APTR) table; - - DoMethod(table->MuiObject,MUIM_Group_InitChange); - - DebOut("tableattach=%lx\n",tableattach); - DoMethod(table->MuiObject,MM_Table_Attach,(ULONG)widget, left_attach, right_attach, top_attach, bottom_attach); - - DoMethod(table->MuiObject,MUIM_Group_ExitChange); - - return; -} - -void gtk_table_set_row_spacings(GtkTable *table, guint spacing) { - - DebOut("gtk_table_set_row_spacings(%lx,%ld)\n",table,spacing); - - SetAttrs(table->MuiObject,MUIA_Group_VertSpacing,(ULONG) spacing, TAG_DONE); - return; -} - -void gtk_table_set_col_spacings(GtkTable *table, guint spacing) { - - DebOut("gtk_table_set_row_spacings(%lx,%ld)\n",table,spacing); - - SetAttrs(table->MuiObject,MUIA_Group_HorizSpacing,(ULONG) spacing, TAG_DONE); - return; -} diff --git a/mui/gtk-mui/gtk_timer.c b/mui/gtk-mui/gtk_timer.c deleted file mode 100644 index 9dcfcf14b..000000000 --- a/mui/gtk-mui/gtk_timer.c +++ /dev/null @@ -1,163 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -/* a lot of the following is taken form the InputHandler - * example of MUI, but as I attach the handler to an - * invisible/not attached Object, I do all the - * Setup/Cleanup stuff here. Just the trigger is - * called through the object. - */ - -typedef struct { - int badmagic; - struct MsgPort *port; - struct timerequest *req; - struct MUI_InputHandlerNode ihnode; - Object *obj; -} mgtk_timer; - -guint g_timeout_add(guint interval, GSourceFunc function, gpointer parameter) { - Object *ret; - mgtk_timer *data; - - DebOut("g_timeout_add(%d,%lx,%lx)\n",interval,function,parameter); - - ret = (APTR) NewObject(CL_Timer->mcc_Class, NULL,MA_Timer_Intervall,(ULONG) interval,MA_Timer_Function,(ULONG) function, MA_Timer_Data,(ULONG) parameter,TAG_DONE); - - if(!ret) { - ErrOut("g_timeout_add: unable to create NewObject\n"); - } - - data=g_new(mgtk_timer,1); - - data->badmagic=BADMAGIC; - - if ((data->port = CreateMsgPort())) { - if ((data->req = (struct timerequest *) CreateIORequest(data->port,sizeof(struct timerequest)))) { - if ((!OpenDevice(TIMERNAME,UNIT_VBLANK,(struct IORequest *)data->req,0))) { - data->ihnode.ihn_Object = ret; - data->ihnode.ihn_Millis = interval; - data->ihnode.ihn_Method = MUIM_Class5_Trigger; - data->ihnode.ihn_Flags = MUIIHNF_TIMER; - - data->req->tr_node.io_Command = TR_ADDREQUEST; - data->req->tr_time.tv_secs = 1; - data->req->tr_time.tv_micro = 0; - - SendIO((struct IORequest *)data->req); - - DoMethod(mgtk->MuiApp,MUIM_Application_AddInputHandler,&data->ihnode); - - data->obj=ret; - } - } - } - - return (guint) data; -} - -/* - * g_source_remove needs to cleanup the mess, - * I caused above ;) - */ - -gboolean g_source_remove(guint tag) { - - mgtk_timer *data; - - DebOut("g_source_remove(%d)\n",tag); - data=(mgtk_timer *)tag; - - if(!data) { - DebOut("WARNING: g_source_remove called with NULL pointer!\n"); - return FALSE; - } - - DoMethod(mgtk->MuiApp,MUIM_Application_RemInputHandler,&data->ihnode); - - if(!data->req) { - DebOut("WARNING: g_source_remove data->req== NULL!\n"); - return FALSE; - } - - if (!CheckIO((struct IORequest *) data->req)) { - AbortIO((struct IORequest *) data->req); - } - WaitIO((struct IORequest *) data->req); - - if (data->req->tr_node.io_Device) { - CloseDevice((struct IORequest *)data->req); - } - DeleteIORequest((struct IORequest *) data->req); - data->req=NULL; - - if (data->port) { - DeleteMsgPort(data->port); - data->port=NULL; - } - - if(data->obj) { - DisposeObject(data->obj); - } - - g_free(data); - - return TRUE; -} - -/* - * gtk_timeout_add is deprecated and should not be - * used in newly-written code. Use g_timeout_add() instead. - */ -guint gtk_timeout_add(guint32 interval, GtkFunction function, gpointer data) { - - return g_timeout_add(interval,function,data); -} - -/* - * gtk_timeout_remove is deprecated and should not be - * used in newly-written code. Use g_source_remove() instead. - */ -void gtk_timeout_remove(guint timeout_handler_id) { - - g_source_remove(timeout_handler_id); -} - diff --git a/mui/gtk-mui/gtk_toolbar.c b/mui/gtk-mui/gtk_toolbar.c deleted file mode 100644 index b35ce0c94..000000000 --- a/mui/gtk-mui/gtk_toolbar.c +++ /dev/null @@ -1,332 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" -#include "classes/classes.h" - -GtkWidget *gtk_toolbar_new(void) { - - GtkWidget *ret; - Object *tb; - - DebOut("gtk_toolbar_new()\n"); - - ret=mgtk_widget_new(IS_TOOLBAR); - - tb = (APTR) NewObject(CL_Toolbar->mcc_Class, NULL,MA_Widget,ret,MUIA_Group_Horiz,TRUE,MUIA_Group_Spacing,0,TAG_DONE); - - DebOut(" NewObject=%lx\n",tb); - - ret->MuiObject=tb; - ((GtkToolbar *)ret)->space_size=12; /* default value */ - ((GtkToolbar *)ret)->style=GTK_TOOLBAR_BOTH; /* default value */ - - - return ret; -} - -GtkWidget *gtk_toolbar_append_item(GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data) { - - GtkWidget *button; - GtkWidget *box; - GtkWidget *label; - char *t; - - DebOut("gtk_toolbar_append_item(%lx,%s,%s,%s,%lx,%lx,%lx)\n",toolbar,text,tooltip_text,tooltip_private_text,icon,callback,user_data); - - button=gtk_button_new (); - - if(callback) { - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (callback), user_data); - } - - box=gtk_vbox_new (FALSE, 0); -// gtk_container_set_border_width (GTK_CONTAINER (box), 2); - gtk_box_pack_start (GTK_BOX (box), icon, FALSE, FALSE, 2); - gtk_widget_show (box); - - if(text) { - t=g_strdup_printf("%s%s",MUIX_C,text); - label=gtk_label_new(t); - gtk_container_add (GTK_CONTAINER (box), label); - gtk_widget_show (label); - button->title=t; - } - gtk_container_add (GTK_CONTAINER (button), box); - - gtk_container_add (GTK_CONTAINER ((GtkWidget *)toolbar),button); - - /* keep a list of all children of the toolbar */ - toolbar->mgtk_children=g_slist_append(toolbar->mgtk_children,button); - g_object_set_data(G_OBJECT(button),"mgtk_image_widget",(gpointer) icon); - g_object_set_data(G_OBJECT(button),"mgtk_text_widget",(gpointer) label); - g_object_set_data(G_OBJECT(button),"mgtk_parent_object",(gpointer) box); - - if(tooltip_text) { - if(! toolbar->tooltips) { - toolbar->tooltips=gtk_tooltips_new (); - } - gtk_tooltips_set_tip (toolbar->tooltips, button, tooltip_text,tooltip_private_text); - } - - return button; - -} - -static GtkWidget *mgtk_toolbar_append_toggle(GtkToolbar *toolbar, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data) { - - GtkWidget *button; - GtkWidget *box; - GtkWidget *label; - Object *image; - char *t; - - DebOut("gtk_toolbar_append_toggle(%lx,%s,%s,%s,%lx,%lx,%lx)\n",toolbar,text,tooltip_text,tooltip_private_text,icon,callback,user_data); - - button=gtk_toggle_button_new(); - - image=ImageObject, - MUIA_Image_Spec , icon->MuiObject, - MUIA_Image_FreeVert , TRUE, - MUIA_Image_FreeHoriz , TRUE, - End; - - DoMethod(button->MuiObject,MUIM_Group_InitChange); - DoMethod(button->MuiObject,OM_ADDMEMBER,image); - DoMethod(button->MuiObject,MUIM_Group_ExitChange); - - if(callback) { - g_signal_connect (G_OBJECT (button), "toggled", - G_CALLBACK (callback), user_data); - } - - box=gtk_vbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 2); - gtk_box_pack_start (GTK_BOX (box), icon, FALSE, FALSE, 3); - gtk_widget_show (box); - - if(text) { - t=g_strdup_printf("%s%s",MUIX_C,text); - label=gtk_label_new(t); - gtk_container_add (GTK_CONTAINER (box), label); - gtk_widget_show (label); - button->title=t; - } - gtk_container_add (GTK_CONTAINER (button), box); - - gtk_container_add (GTK_CONTAINER ((GtkWidget *)toolbar),button); - - /* keep a list of all children of the toolbar */ - toolbar->mgtk_children=g_slist_append(toolbar->mgtk_children,button); - g_object_set_data(G_OBJECT(button),"mgtk_image_widget",(gpointer) icon); - g_object_set_data(G_OBJECT(button),"mgtk_text_widget",(gpointer) label); - g_object_set_data(G_OBJECT(button),"mgtk_parent_object",(gpointer) box); - - if(tooltip_text) { - if(! toolbar->tooltips) { - toolbar->tooltips=gtk_tooltips_new (); - } - gtk_tooltips_set_tip (toolbar->tooltips, button, tooltip_text,tooltip_private_text); - } - - return button; -} - -void mgtk_update_group(GtkWidget *widget, GSList *group); - -static GtkWidget *mgtk_toolbar_append_radio(GtkToolbar *toolbar, GtkWidget *widget, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data) { - - GtkWidget *toggle; - - toggle=mgtk_toolbar_append_toggle(toolbar, text, tooltip_text, tooltip_private_text, icon, callback, user_data); - - if(widget && widget->GSList) { - /* get radio group from widget*/ - toggle->GSList=widget->GSList; - } - else { - /* new radio group */ - DebOut(" first element in this radio group.\n"); - } - toggle->GSList=g_slist_append(toggle->GSList,toggle); - mgtk_update_group(toggle,toggle->GSList); - - return toggle; -} - -GtkWidget *gtk_toolbar_append_element(GtkToolbar *toolbar, GtkToolbarChildType type, GtkWidget *widget, const char *text, const char *tooltip_text, const char *tooltip_private_text, GtkWidget *icon, GtkSignalFunc callback, gpointer user_data) { - - - DebOut("gtk_toolbar_append_element(%lx,%d,%lx,%s,%s,%s,%lx,%lx,%lx)\n",toolbar,type,widget,text,tooltip_text,tooltip_private_text,icon,callback,user_data); - - if(type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON) { - return mgtk_toolbar_append_toggle(toolbar, text, tooltip_text, tooltip_private_text, icon, callback, user_data); - } - else if(type == GTK_TOOLBAR_CHILD_BUTTON) { - return gtk_toolbar_append_item(toolbar, text, tooltip_text, tooltip_private_text, icon, callback, user_data); - } - else if(type == GTK_TOOLBAR_CHILD_RADIOBUTTON ){ - return mgtk_toolbar_append_radio(toolbar, widget, text, tooltip_text, tooltip_private_text, icon, callback, user_data); - } - - DebOut("WARNING: other types : %d NOT DONE YET\n",type); /*TODO*/ - return gtk_toolbar_append_item(toolbar, text, tooltip_text, tooltip_private_text, icon, callback, user_data); - -} - -void gtk_toolbar_append_widget(GtkToolbar *toolbar, GtkWidget *widget, const char *tooltip_text, const char *tooltip_private_text) { - DebOut("gtk_toolbar_append_widget(%lx,%lx,%s,%s)\n",toolbar,widget,tooltip_text,tooltip_private_text); - - gtk_container_add (GTK_CONTAINER ((GtkWidget *)toolbar),widget); - - /* keep a list of all children of the toolbar */ - toolbar->mgtk_children=g_slist_append(toolbar->mgtk_children,widget); - - if(tooltip_text) { - if(! toolbar->tooltips) { - toolbar->tooltips=gtk_tooltips_new (); - } - gtk_tooltips_set_tip (toolbar->tooltips, widget, tooltip_text,tooltip_private_text); - } - -} - -void gtk_toolbar_set_tooltips(GtkToolbar *toolbar, gboolean enable) { - DebOut("gtk_toolbar_set_tooltips(%lx,%d)\n",toolbar,enable); - - if(toolbar->tooltips) { - if(enable) { - gtk_tooltips_enable(toolbar->tooltips); - } - else { - gtk_tooltips_disable(toolbar->tooltips); - } - } -} - -void gtk_toolbar_append_space(GtkToolbar *toolbar) { - - GtkWidget *space; - - DebOut("gtk_toolbar_append_space(%lx)\n",toolbar); - - space=mgtk_widget_new(IS_SPACE); - - space->MuiObject=HSpace(toolbar->space_size); - - gtk_toolbar_append_widget(toolbar,space,NULL,NULL); -} - -/************* STYLE *****************/ - -void mgtk_toolitem_restyle(GtkToolbar *toolbar,GtkWidget *widget,GtkToolbarStyle style) { - GtkWidget *label; - GtkWidget *image; - Object *box; - DebOut("mgtk_toolitem_restyle(%ld,%d)\n",widget,style); - - if((widget->type==IS_TOGGLEBUTTON)||(widget->type==IS_BUTTON)) { - DebOut(" (Toggle)Button: %ld\n",widget); - - image=(GtkWidget *)g_object_get_data(G_OBJECT(widget),"mgtk_image_widget"); - label=(GtkWidget *)g_object_get_data(G_OBJECT(widget),"mgtk_text_widget"); - - box=widget->MuiObject; - - DebOut(" mgtk_image_widget=%lx\n",image); - DebOut(" mgtk_text_widget=%lx\n",label); - DebOut(" mgtk_parent_object=%lx\n",box); - - DoMethod(widget->MuiObject,MUIM_Group_InitChange); - - if(style==GTK_TOOLBAR_ICONS) { - DebOut(" set to GTK_TOOLBAR_ICONS\n"); - DoMethod(box,OM_REMMEMBER,label->MuiObject); - if(toolbar->style==GTK_TOOLBAR_TEXT) { - /* old style was text only */ - DoMethod(box,OM_ADDMEMBER,image->MuiObject); - } - } - else if(style==GTK_TOOLBAR_TEXT) { - DebOut(" set to GTK_TOOLBAR_TEXT\n"); - DoMethod(box,OM_REMMEMBER,image->MuiObject); - if(toolbar->style==GTK_TOOLBAR_ICONS) { - /* old style was text only */ - DoMethod(box,OM_ADDMEMBER,label->MuiObject); - } - } - else if((style==GTK_TOOLBAR_BOTH)||(style==GTK_TOOLBAR_BOTH_HORIZ)) { - DebOut(" set to GTK_TOOLBAR_BOTH\n"); - if(toolbar->style==GTK_TOOLBAR_TEXT) { - /* old style was text only */ - DoMethod(box,OM_REMMEMBER,label->MuiObject); - DoMethod(box,OM_ADDMEMBER,image->MuiObject); - } - DoMethod(box,OM_ADDMEMBER,label->MuiObject); - } - - DoMethod(widget->MuiObject,MUIM_Group_ExitChange); - } -} - -void gtk_toolbar_set_style(GtkToolbar *toolbar, GtkToolbarStyle style) { - - GSList *children; - - DebOut("gtk_toolbar_set_style(%lx,%d)\n",toolbar,style); - DebOut(" mgtk type: %lx\n",((GtkWidget *)toolbar)->type); - DebOut(" old style: %lx\n",toolbar->style); - - if(style == toolbar->style) { - DebOut(" nothing to do (keep old style)\n"); - return; - } - - children=toolbar->mgtk_children; - - while(children) { - mgtk_toolitem_restyle(toolbar,(GtkWidget *)children->data,style); - children=g_slist_next(children); - } - - DoMethod(mgtk->Group,MUIM_Group_InitChange); - DoMethod(mgtk->Group,MUIM_Group_ExitChange); - - toolbar->style=style; -} diff --git a/mui/gtk-mui/gtk_tooltips.c b/mui/gtk-mui/gtk_tooltips.c deleted file mode 100644 index 662516beb..000000000 --- a/mui/gtk-mui/gtk_tooltips.c +++ /dev/null @@ -1,129 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -GtkTooltips* GTK_TOOLTIPS(GtkWidget* widget) { - return((GtkTooltips*) widget); -} - -GtkTooltips* gtk_tooltips_new(void) { - GtkWidget *ret; - - DebOut("gtk_tooltips_new()\n"); - - ret=mgtk_widget_new(IS_TOOLTIPS); - return ret; -} - -void mgtk_tooltip_add(GtkTooltips *tooltips, GtkWidget *widget) { - GSList *list; - - DebOut("mgtk_tooltip_add(%ld,%ld)\n"); - - list=tooltips->GSList; - list=(GSList *) g_slist_append(list,(gpointer) widget); - tooltips->GSList=list; -} - -void gtk_tooltips_set_tip(GtkTooltips *tooltips, GtkWidget *widget, const gchar *tip_text, const gchar *tip_private) { - - DebOut("gtk_tooltips_set_tip(%lx,%lx,%s,%s)\n",tooltips,widget,tip_text,tip_private); - - /* - * tip_private is *not* shown normally, the docs say: - * - * "tip_private is a string that is not shown as the default tooltip. - * Instead, this message may be more informative and go towards forming - * a context-sensitive help system for your application. - * (FIXME: how to actually "switch on" private tips?)" - * - * so we ignore tip_private.. - */ - - widget->tip_text=g_strdup(tip_text); - mgtk_tooltip_add(tooltips,widget); - set(widget->MuiObject,MUIA_ShortHelp,(ULONG) widget->tip_text); -} - -/* - * gtk_tooltips_disable disables all attached - * help bubbles. As I did not find any documentation - * on how to disable a ShortHelp, I do a - * set MUIA_ShortHelp,NULL, which seems to work. - */ - -void gtk_tooltips_disable(GtkTooltips *tooltips) { - GSList *list; - GtkWidget *widget; - - DebOut("gtk_tooltips_disable(%ld)\n",tooltips); - - list=tooltips->GSList; - - while(list!=NULL) { - widget=(GtkWidget*) list->data; - DebOut(" disable: widget %lx object %lx\n",widget,widget->MuiObject); - set(widget->MuiObject,MUIA_ShortHelp,NULL); - list=list->next; - } -} - -void gtk_tooltips_enable(GtkTooltips *tooltips) { - GSList *list; - GtkWidget *widget; - - DebOut("gtk_tooltips_enable(%ld)\n",tooltips); - - list=tooltips->GSList; - - while(list!=NULL) { - widget=(GtkWidget*) list->data; - DebOut(" enable: widget %lx object %lx\n",widget,widget->MuiObject); - set(widget->MuiObject,MUIA_ShortHelp,(ULONG) widget->tip_text); - list=list->next; - } -} - -/* - * "Ensures that the window used for displaying the given tooltips is created. - * Applications should never have to call this function, since GTK+ takes care of this." - */ -void gtk_tooltips_force_window(GtkTooltips *tooltips) { - return; -} diff --git a/mui/gtk-mui/gtk_window.c b/mui/gtk-mui/gtk_window.c deleted file mode 100644 index 33ec26911..000000000 --- a/mui/gtk-mui/gtk_window.c +++ /dev/null @@ -1,212 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#include -#include -#include -#include -#include - -/* cross platform hooks */ -#include - -#include "classes.h" -#include "debug.h" -#include "gtk.h" -#include "gtk_globals.h" - -/********************************* - * gtk_window_new - *********************************/ -GtkWidget* gtk_window_new (GtkWindowType type) { - - GtkWidget *win; - GSList *gl; - - DebOut("gtk_window_new: TODO: check parameter\n"); - - win=mgtk_widget_new(IS_WINDOW); - - gl=mgtk->windows; - - if(!g_slist_length(gl)) { - /* first window */ - DebOut(" first window\n"); - - win->MuiWin=mgtk->MuiRoot; - win->MuiWinMenustrip=mgtk->MuiRootStrip; - win->MuiGroup=mgtk->Group; - win->MuiObject=mgtk->Group; - /* mgtk->winnr++; */ - gl=g_slist_append(gl,win); - mgtk->windows=gl; - /* active: - * 0: we are inactive (another window is modal) - * 1: everything normal, all are active - * 2: we are the modal one - */ - win->active=1; - return win; - } - - WarnOut("gtk_window_new: second window not done yet\n!"); - return(NULL); -} - -void gtk_window_set_title (GtkWindow *window, const gchar *title) { - DebOut("gtk_window_set_title(win %lx,%s)\n",window,title); - - SetAttrs(window->MuiWin,MUIA_Window_Title,(ULONG) title, TAG_DONE); /* ouch, casting it to ULONG.. */ -} - -void gtk_window_set_resizable(GtkWindow *window, gboolean resizable) { -#if 0 - ULONG is_open, was_resizable; -#endif - - DebOut("gtk_window_set_resizable(%lx,%d)\n",window,resizable); - -#if 0 - was_resizable = xget(window->MuiWin, MUIA_Window_SizeGadget); - is_open = xget(window->MuiWin, MUIA_Window_Open); - - SetAttrs(window->MuiWin,MUIA_Window_SizeGadget,(ULONG) resizable, TAG_DONE); - - if (is_open && !(was_resizable & resizable)) - { - /* We must reopen window to toggle sizing gadget - ** - ** This causes unavoidable flickery. It could be avoided by rootgroup subclass - ** (by making group fixed size) but the sizing gadget remains. - ** - ** Hmm... - */ - - SetAttrs(window->MuiWin, MUIA_Window_Open, FALSE, TAG_DONE); - SetAttrs(window->MuiWin, MUIA_Window_Open, TRUE, TAG_DONE); - } -#else - /* Drawback in this method: sizing gadget is still there - ** - ** OTOH is there any good reason to disable resizing? Because GTK coders are lame? - ** - ** Disable this - */ - - set(window->MuiObject, MA_RootGroup_Resizable, resizable); -#endif - - return; -} - -gboolean gtk_window_get_resizable(GtkWindow *window) -{ - return xget(window->MuiWin, MUIA_Window_SizeGadget); -} - -void gtk_window_set_modal(GtkWindow *window, gboolean modal) { - - GSList *windows; - GtkWidget *w; - - DebOut("gtk_window_set_modal(%lx,%d)\n",window,modal); - - if((window->active == 2) && modal) { - DebOut(" we are already modal.\n"); - return; - } - - windows=mgtk->windows; - if(modal) { - /* set all other windows to sleep */ - while(windows) { - w=(GtkWidget *)windows->data; - - if(w==window) { - DebOut(" set %lx to modal-active\n",w); - w->active=2; - if(w->type == IS_WINDOW) { - set(w->MuiObject,MUIA_Window_Sleep,FALSE); - } - } - else { - DebOut(" set %lx to modal-inactive\n",w); - w->active=0; - if(w->type == IS_WINDOW) { - set(w->MuiObject,MUIA_Window_Sleep,TRUE); - } - } - windows=g_slist_next(windows); - } - } - else { - /* wake all other windows */ - while(windows) { - w=(GtkWidget *)windows->data; - if(w->active==2) { - DebOut(" set %lx to normal (was modal)\n",w); - w->active=1; - } - else { - DebOut(" set %lx to normal (was modal-inactive)n",w); - w->active=1; - if(w->type == IS_WINDOW) { - set(w->MuiObject,MUIA_Window_Sleep,FALSE); - } - } - windows=g_slist_next(windows); - } - } -} - -/* Dialog windows should be set transient for the main application window - * they were spawned from. This allows window managers to e.g. keep the - * dialog on top of the main window, or center the dialog over the main window. - * gtk_dialog_new_with_buttons() and other convenience functions in - * GTK+ will sometimes call gtk_window_set_transient_for() on your behalf. - * - * On Windows, this function will and put the child window on top of - * the parent, much as the window manager would have done on X. - * In MUI we make the parent window the RefWindow of the child. - * The child won't stay at top, but it should be sufficient. - */ -void gtk_window_set_transient_for(GtkWindow *window, GtkWindow *parent) { - - DebOut("gtk_window_set_transient_for(%lx,%lx)\n"); - - if((!window) || (!parent) || (!window->MuiObject) || (!parent->MuiObject)) { - WarnOut(" unable to gtk_window_set_transient_for, something is NULL!\n"); - return; - } - - set(window->MuiObject, MUIA_Window_RefWindow,parent->MuiObject); - set(window->MuiObject, MUIA_Window_LeftEdge, MUIV_Window_LeftEdge_Centered); - set(window->MuiObject, MUIA_Window_TopEdge, MUIV_Window_TopEdge_Centered); -} diff --git a/mui/gtk-mui/gtkstock.h b/mui/gtk-mui/gtkstock.h deleted file mode 100644 index 094d79ef4..000000000 --- a/mui/gtk-mui/gtkstock.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __GTK_STOCK_H__ - -#include - -#endif diff --git a/mui/gtk-mui/include/SDI_compiler.h b/mui/gtk-mui/include/SDI_compiler.h deleted file mode 100644 index d75123f12..000000000 --- a/mui/gtk-mui/include/SDI_compiler.h +++ /dev/null @@ -1,203 +0,0 @@ -#ifndef SDI_COMPILER_H -#define SDI_COMPILER_H - -/* Includeheader - - Name: SDI_compiler.h - Versionstring: $VER: SDI_compiler.h 1.21 (28.02.2005) - Author: SDI & Jens Langner - Distribution: PD - Description: defines to hide compiler stuff - - 1.1 25.06.98 : created from data made by Gunter Nikl - 1.2 17.11.99 : added VBCC - 1.3 29.02.00 : fixed VBCC REG define - 1.4 30.03.00 : fixed SAVEDS for VBCC - 1.5 29.07.00 : added #undef statements (needed e.g. for AmiTCP together - with vbcc) - 1.6 19.05.01 : added STACKEXT and Dice stuff - 1.7 16.06.01 : added MorphOS specials and VARARGS68K - 1.8 21.09.02 : added MorphOS register stuff - 1.9 26.09.02 : added OFFSET macro. Thanks Frank Wille for suggestion - 1.10 18.10.02 : reverted to old MorphOS-method for GCC - 1.11 09.11.02 : added REGARGS define to MorphOS section - 1.12 18.01.04 : some adaptions for AmigaOS4 compatibility - 1.13 17.02.04 : changed ASM macros to be a simple define and added - INTERRUPT, CHIP and FAR - 1.14 02.03.04 : added UNUSED which can be used to specify a function parameter - or variable as "unused" which will not cause any compiler warning. - 1.15 02.03.04 : added special INLINE define for gcc > 3.0 version - 1.17 07.03.04 : changed INLINE definition of gcc <= 2.95.3 to be static aswell. - 1.18 21.06.04 : added USED and USED_VAR attribute to allow placing a - __attribute__((used)) to a function and a variable, taking care of - different compiler versions. - 1.19 04.07.04 : register specification for variables is not supported on MorphOS, - so we modified the REG() macro accordingly. - 1.20 28.02.05 : correct INLINE for VBCC. - 1.21 28.02.05 : cleanup __GCC__ case. -*/ - -/* -** This is PD (Public Domain). This means you can do with it whatever you want -** without any restrictions. I only ask you to tell me improvements, so I may -** fix the main line of this files as well. -** -** To keep confusion level low: When changing this file, please note it in -** above history list and indicate that the change was not made by myself -** (e.g. add your name or nick name). -** -** Jens Langner and -** Dirk Stöcker -*/ - -#undef ASM -#undef REG -#undef LREG -#undef CONST -#undef SAVEDS -#undef INLINE -#undef REGARGS -#undef STDARGS -#undef OFFSET -#undef INTERRUPT -#undef CHIP -#undef FAR -#undef UNUSED -#undef USED -#undef USED_VAR - -/* first "exceptions" */ - -#if defined(__MAXON__) - #define STDARGS - #define STACKEXT - #define REGARGS - #define SAVEDS - #define INLINE inline -#elif defined(__VBCC__) - #define STDARGS - #define STACKEXT - #define REGARGS - #if (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L) - #define INLINE inline - #else - #define INLINE static - #endif - #define OFFSET(p,m) __offsetof(struct p,m) - #if defined(__MORPHOS__) - #define REG(reg,arg) __reg(MOS__##reg) arg - - /* NOTE: This assumes "quick native mode" when compiling libraries. */ - #define MOS__a0 "r24" - #define MOS__a1 "r25" - #define MOS__a2 "r26" - #define MOS__a3 "r27" - #define MOS__a4 "r28" - #define MOS__a5 "r29" - #define MOS__a6 "r30" - /* #define MOS__a7 "r31" */ - #define MOS__d0 "r16" - #define MOS__d1 "r17" - #define MOS__d2 "r18" - #define MOS__d3 "r19" - #define MOS__d4 "r20" - #define MOS__d5 "r21" - #define MOS__d6 "r22" - #define MOS__d7 "r23" - - #else - #define REG(reg,arg) __reg(#reg) arg - #endif -#elif defined(__STORM__) - #define STDARGS - #define STACKEXT - #define REGARGS - #define INLINE inline -#elif defined(__SASC) - #define ASM __asm -#elif defined(__GNUC__) - #define UNUSED __attribute__((unused)) /* for functions, variables and types */ - #define USED __attribute__((used)) /* for functions only! */ - #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) - #define USED_VAR USED /* for variables only! */ - #define INLINE static __inline __attribute__((always_inline)) - #endif - /* we have to distinguish between AmigaOS4 and MorphOS */ - #if defined(__PPC__) - #define REG(reg,arg) arg - #define SAVEDS - #define STDARGS - #define REGARGS - #define STACKEXT - #if defined(__MORPHOS__) - #define VARARGS68K __attribute__((varargs68k)) - #endif - #define INTERRUPT - #define CHIP - #else - #define REG(reg,arg) arg __asm(#reg) - #define LREG(reg,arg) register REG(reg,arg) - #endif - #define FAR -#elif defined(_DCC) - #define REG(reg,arg) __##reg arg - #define STACKEXT __stkcheck - #define STDARGS __stkargs - #define INLINE static -#endif - -/* then "common" ones */ - -#if !defined(ASM) - #define ASM -#endif -#if !defined(REG) - #define REG(reg,arg) register __##reg arg -#endif -#if !defined(LREG) - #define LREG(reg,arg) register arg -#endif -#if !defined(CONST) - #define CONST const -#endif -#if !defined(SAVEDS) - #define SAVEDS __saveds -#endif -#if !defined(INLINE) - #define INLINE static __inline -#endif -#if !defined(REGARGS) - #define REGARGS __regargs -#endif -#if !defined(STDARGS) - #define STDARGS __stdargs -#endif -#if !defined(STACKEXT) - #define STACKEXT __stackext -#endif -#if !defined(VARARGS68K) - #define VARARGS68K -#endif -#if !defined(OFFSET) - #define OFFSET(structName, structEntry) \ - ((char *)(&(((struct structName *)0)->structEntry))-(char *)0) -#endif -#if !defined(INTERRUPT) - #define INTERRUPT __interrupt -#endif -#if !defined(CHIP) - #define CHIP __chip -#endif -#if !defined(FAR) - #define FAR __far -#endif -#if !defined(UNUSED) - #define UNUSED -#endif -#if !defined(USED) - #define USED -#endif -#if !defined(USED_VAR) - #define USED_VAR -#endif -#endif /* SDI_COMPILER_H */ diff --git a/mui/gtk-mui/include/SDI_hook.h b/mui/gtk-mui/include/SDI_hook.h deleted file mode 100644 index 14c948fe5..000000000 --- a/mui/gtk-mui/include/SDI_hook.h +++ /dev/null @@ -1,202 +0,0 @@ -#ifndef SDI_HOOK_H -#define SDI_HOOK_H - -/* Includeheader - - Name: SDI_hook.h - Versionstring: $VER: SDI_hook.h 1.9 (08.04.2005) - Author: SDI & Jens Langner - Distribution: PD - Description: defines to hide compiler specific hook stuff - - 1.0 21.06.02 : based on the work made for freeciv and YAM with - additional texts partly taken from YAM_hook.h changes made - by Jens Langner, largely reworked the mechanism - 1.1 07.10.02 : added HOOKPROTONP and HOOKPROTONONP requested by Jens - 1.2 18.10.02 : reverted to old MorphOS-method for GCC - 1.3 08.02.04 : modified to get it compatible to AmigaOS4 - 1.4 17.02.04 : modified to get compatible to latest SDI_compiler.h changes - 1.5 02.03.04 : added UNUSED define to OS4 hook specification so that the - compiler can ignore some warnings. - 1.6 02.03.04 : added (APTR) casts to MorphOS prototype definition to - reduce compiler warnings. - 1.7 04.07.04 : removed static from all DISPATCHERPROTO definitions as there - may dispatcher that are of course non static. - 1.8 07.04.05 : added MakeHookWithData (Sebastian Bauer) - 1.9 08.04.05 : changed MorphOS hooks to use HookEntry (Ilkka Lehtoranta) -*/ - -/* -** This is PD (Public Domain). This means you can do with it whatever you want -** without any restrictions. I only ask you to tell me improvements, so I may -** fix the main line of this files as well. -** -** To keep confusion level low: When changing this file, please note it in -** above history list and indicate that the change was not made by myself -** (e.g. add your name or nick name). -** -** Jens Langner and -** Dirk Stöcker -*/ - -#include "SDI_compiler.h" - -/* -** Hook macros to handle the creation of Hooks/Dispatchers for different -** Operating System versions. -** Currently AmigaOS and MorphOS is supported. -** -** For more information about hooks see include file or -** the relevant descriptions in utility.library autodocs. -** -** Example: -** -** Creates a hook with the name "TestHook" that calls a corresponding -** function "TestFunc" that will be called with a pointer "text" -** (in register A1) and returns a long. -** -** HOOKPROTONHNO(TestFunc, LONG, STRPTR text) -** { -** Printf(text); -** return 0; -** } -** MakeHook(TestHook, TestFunc); -** -** Every function that is created with HOOKPROTO* must have a MakeHook() or -** MakeStaticHook() to create the corresponding hook. Best is to call this -** directly after the hook function. This is required by the GCC macros. -** -** The naming convention for the Hook Prototype macros is as followed: -** -** HOOKPROTO[NH][NO][NP] -** ^^ ^^ ^^ -** NoHook | NoParameter -** NoObject -** -** So a plain HOOKPROTO() creates you a Hook function that requires -** 4 parameters, the "name" of the hookfunction, the "obj" in REG_A2, -** the "param" in REG_A1 and a "hook" in REG_A0. Usually you will always -** use NH, as the hook structure itself is nearly never required. -** -** The DISPATCHERPROTO macro is for MUI dispatcher functions. It gets the -** functionname as argument. To supply this function for use by MUI, use -** The ENTRY macro, which also gets the function name as argument. -*/ - -#if !defined(__MORPHOS__) || !defined(__GNUC__) - #if defined(__amigaos4__) - #define HOOKPROTO(name, ret, obj, param) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, obj), REG(a1, param)) - #define HOOKPROTONO(name, ret, param) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, UNUSED APTR obj), \ - REG(a1, param)) - #define HOOKPROTONP(name, ret, obj) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, obj), \ - REG(a1, UNUSED APTR param)) - #define HOOKPROTONONP(name, ret) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, UNUSED APTR obj), \ - REG(a1, UNUSED APTR param)) - #define HOOKPROTONH(name, ret, obj, param) static SAVEDS ASM ret \ - name(REG(a0, UNUSED struct Hook *hook), REG(a2, obj), REG(a1, param)) - #define HOOKPROTONHNO(name, ret, param) static SAVEDS ASM ret \ - name(REG(a0, UNUSED struct Hook *hook), REG(a2, UNUSED APTR obj), \ - REG(a1, param)) - #define HOOKPROTONHNP(name, ret, obj) static SAVEDS ASM ret \ - name(REG(a0, UNUSED struct Hook *hook), REG(a2, obj), \ - REG(a1, UNUSED APTR param)) - #define HOOKPROTONHNONP(name, ret) static SAVEDS ret name(void) - #else - #define HOOKPROTO(name, ret, obj, param) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, obj), REG(a1, param)) - #define HOOKPROTONO(name, ret, param) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a1, param)) - #define HOOKPROTONP(name, ret, obj) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, obj)) - #define HOOKPROTONONP(name, ret) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook)) - #define HOOKPROTONH(name, ret, obj, param) static SAVEDS ASM ret \ - name(REG(a2, obj), REG(a1, param)) - #define HOOKPROTONHNO(name, ret, param) static SAVEDS ASM ret \ - name(REG(a1, param)) - #define HOOKPROTONHNP(name, ret, obj) static SAVEDS ASM ret \ - name(REG(a2, obj)) - #define HOOKPROTONHNONP(name, ret) static SAVEDS ret name(void) - #endif -#endif - -#if defined(__MORPHOS__) - #include - - #define SDI_TRAP_LIB 0xFF00 /* SDI prefix to reduce conflicts */ - - struct SDI_EmulLibEntry - { - UWORD Trap; - UWORD pad; - APTR Func; - }; - - #define MakeHook(hookname, funcname) struct Hook hookname = {{NULL, NULL}, \ - (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, NULL} - #define MakeHookWithData(hookname, funcname, data) struct Hook hookname = \ - {{NULL, NULL}, (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, (APTR)data} - #define MakeStaticHook(hookname, funcname) static struct Hook hookname = \ - {{NULL, NULL}, (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, NULL} - - #if defined(__GNUC__) - #define HOOKPROTO(name, ret, obj, param) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, obj), REG(a1, param)) - #define HOOKPROTONO(name, ret, param) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, UNUSED APTR obj), \ - REG(a1, param)) - #define HOOKPROTONP(name, ret, obj) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, obj), \ - REG(a1, UNUSED APTR param)) - #define HOOKPROTONONP(name, ret) static SAVEDS ASM ret \ - name(REG(a0, struct Hook *hook), REG(a2, UNUSED APTR obj), \ - REG(a1, UNUSED APTR param)) - #define HOOKPROTONH(name, ret, obj, param) static SAVEDS ASM ret \ - name(REG(a0, UNUSED struct Hook *hook), REG(a2, obj), REG(a1, param)) - #define HOOKPROTONHNO(name, ret, param) static SAVEDS ASM ret \ - name(REG(a0, UNUSED struct Hook *hook), REG(a2, UNUSED APTR obj), \ - REG(a1, param)) - #define HOOKPROTONHNP(name, ret, obj) static SAVEDS ASM ret \ - name(REG(a0, UNUSED struct Hook *hook), REG(a2, obj), \ - REG(a1, UNUSED APTR param)) - #define HOOKPROTONHNONP(name, ret) static SAVEDS ret name(void) - #define DISPATCHERPROTO(name) \ - struct IClass; \ - ULONG name(struct IClass * cl, Object * obj, Msg msg); \ - static ULONG Trampoline_##name(void) {return name((struct IClass *) \ - REG_A0, (Object *) REG_A2, (Msg) REG_A1);} \ - static const struct SDI_EmulLibEntry Gate_##name = {SDI_TRAP_LIB, 0, \ - (void(*)())Trampoline_##name}; \ - ULONG name(struct IClass * cl, Object * obj, Msg msg) - #else - #define DISPATCHERPROTO(name) \ - struct IClass; \ - ASM ULONG name(REG(a0, \ - struct IClass * cl), REG(a2, Object * obj), REG(a1, Msg msg)); \ - static const struct SDI_EmulLibEntry Gate_##name = {SDI_TRAP_LIB, 0, \ - (APTR)name}; \ - ASM ULONG name(REG(a0, \ - struct IClass * cl), REG(a2, Object * obj), REG(a1, Msg msg)) - #endif - - #define ENTRY(func) (APTR)&Gate_##func -#else - #define DISPATCHERPROTO(name) SAVEDS ASM ULONG name(REG(a0, \ - struct IClass * cl), REG(a2, Object * obj), REG(a1, Msg msg)) - #define ENTRY(func) (APTR)func - #define MakeHook(hookname, funcname) struct Hook hookname = {{NULL, NULL}, \ - (HOOKFUNC)funcname, NULL, NULL} - #define MakeHookWithData(hookname, funcname, data) struct Hook hookname = \ - {{NULL, NULL}, (HOOKFUNC)funcname, NULL, (APTR)data} - #define MakeStaticHook(hookname, funcname) static struct Hook hookname = \ - {{NULL, NULL}, (HOOKFUNC)funcname, NULL, NULL} -#endif - -#define InitHook(hook, orighook, data) ((hook)->h_Entry = (orighook).h_Entry,\ - (hook)->h_SubEntry = (orighook).h_SubEntry,(hook)->h_Data = (APTR)(data)) - -#endif /* SDI_HOOK_H */ diff --git a/mui/gtk-mui/mgtk_aros.h b/mui/gtk-mui/mgtk_aros.h deleted file mode 100644 index 12caf51ea..000000000 --- a/mui/gtk-mui/mgtk_aros.h +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#ifdef __AROS__ - -#include -#include - -#define MGTK_HOOK_OBJECT_POINTER -#define MGTK_HOOK_APTR - -#define HOOKPROTO(name, ret, obj, param) AROS_UFH2(ret, name, AROS_UFHA(APTR, param, A3), AROS_UFHA(Object *, obj, D0)) - -#define MakeHook(hookname, funcname) struct Hook hookname = {{NULL, NULL}, \ - (HOOKFUNC)funcname, NULL, NULL} - -#define MGTK_USERFUNC_INIT AROS_USERFUNC_INIT -#define MGTK_USERFUNC_EXIT AROS_USERFUNC_EXIT - -#endif diff --git a/mui/gtk-mui/mmakefile.src b/mui/gtk-mui/mmakefile.src deleted file mode 100755 index d08a3612b..000000000 --- a/mui/gtk-mui/mmakefile.src +++ /dev/null @@ -1,86 +0,0 @@ -# $Id$ -# -include $(TOP)/config/make.cfg - -#MM- contrib-gtk-mui : linklibs-gtk-mui \ -#MM contrib-gtk-includes \ -#MM contrib-gdk-includes \ -#MM contrib-glib-includes \ -#MM contrib-gobject-includes \ -#MM contrib-pango-includes - -#MM- linklibs : linklibs-gtk-mui - -##MM linklibs-gtk-mui : linklibs-gtk-mui-config includes - - -USER_CFLAGS := -I./ -Iinclude -Iclasses - - -FILES := debug \ - g_lib \ - glib/gslist \ - glib/g_object \ - glib/gsignal \ - glib/gstrfuncs2 \ - gdk/gdk_window \ - gdk/gdk_draw \ - gdk/gdkcolor \ - gdk/gdkgc \ - gdk/gdkmui \ - gtk_init \ - gtk_globals \ - gtk_window \ - gtk_style \ - gtk_grab \ - gtk_hooks \ - gtk_menu \ - gtk_button \ - gtk_checkbutton \ - gtk_table \ - gtk_entry \ - gtk_image \ - gtk_label \ - gtk_radio \ - gtk_separator \ - gtk_scrollbar \ - gtk_arrow \ - gtk_tooltips \ - gtk_filesel \ - gtk_frame \ - gtk_spinbutton \ - gtk_notebook \ - gtk_progressbar \ - gtk_timer \ - gtk_fixed \ - gtk_paint \ - gtk_handle_box \ - gtk_toolbar \ - gtk_object \ - gtk_custom \ - gtk-mui \ - classes/rootgroup \ - classes/custom \ - classes/table \ - classes/notebook \ - classes/progressbar \ - classes/timer \ - classes/fixed \ - classes/button \ - classes/spinbutton \ - classes/checkbutton \ - classes/togglebutton \ - classes/radiobutton \ - classes/menu \ - classes/entry \ - classes/toolbar \ - classes/classext - - - -%copy_includes path=gtk includes="$(wildcard *.h)" - -%build_linklib mmake=linklibs-gtk-mui libname=gtk-mui files=$(FILES) - -%common - diff --git a/mui/gtk-mui/mui.h b/mui/gtk-mui/mui.h deleted file mode 100644 index 0440acad7..000000000 --- a/mui/gtk-mui/mui.h +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * - * mui-gtk - a wrapper library to wrap GTK+ calls to MUI - * - * Copyright (C) 2005 Oliver Brunner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Contact information: - * - * Oliver Brunner - * - * E-Mail: mui-gtk "at" oliver-brunner.de - * - * $Id$ - * - *****************************************************************************/ - -#ifndef MGTK_MUI_H -#define MGTK_MUI_H - -#if defined (__AROS__) || defined (__AMIGAOS4__) || defined (__MORPHOS__) - #ifndef LIBRARIES_MUI_H - #include - #endif - #include -#else - /* AmigaOS 3 */ - #include -#endif - -#ifndef MUIA_Group_Forward -#define MUIA_Group_Forward 0x80421422 /* V11 .s. BOOL */ -#endif - -#ifndef MUII_ImageButtonBack -#define MUII_ImageButtonBack MUII_ButtonBack /* MUII_ImageButtonBack not present in mui 3.8 */ -#endif - -#ifndef TEXTINPUT_MCC_H -# define MCC_TI_TAGBASE ((TAG_USER)|((1307<<16)+0x712)) -# define MCC_TI_ID(x) (MCC_TI_TAGBASE+(x)) -# define MUIA_Textinput_MarkStart MCC_TI_ID(133) /* V13 isg ULONG */ -# define MUIA_Textinput_MarkEnd MCC_TI_ID(134) /* V13 isg ULONG */ -#endif - -#ifndef _parent -#define _parent(_o) ((Object *)xget(_o, MUIA_Parent)) -#endif - -#endif /* MGTK_MUI_H */ diff --git a/mui/gtk-mui/pango/mmakefile.src b/mui/gtk-mui/pango/mmakefile.src deleted file mode 100755 index e31c2164e..000000000 --- a/mui/gtk-mui/pango/mmakefile.src +++ /dev/null @@ -1,12 +0,0 @@ -# $Id$ -# -include $(TOP)/config/make.cfg - -#MM- contrib-pango-includes : includes - -INCLUDE_FILES := pango.h - -%copy_includes path=pango includes=$(INCLUDE_FILES) - -%common - diff --git a/mui/gtk-mui/pango/pango.h b/mui/gtk-mui/pango/pango.h deleted file mode 100644 index ccc4107e7..000000000 --- a/mui/gtk-mui/pango/pango.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __PANGO_FONT_H__ -#define __PANGO_FONT_H__ - -#include - -typedef struct _PangoFontDescription PangoFontDescription; - -/* o1i: the following ins from pango/fonts.c, - * well, for me it's more logical to place - * it in a header.. */ - -struct _PangoFontDescription { - char *family_name; - -#if 0 - PangoStyle style; - PangoVariant variant; - PangoWeight weight; - PangoStretch stretch; -#endif - - guint16 mask; - guint static_family : 1; - guint size_is_absolute : 1; - - int size; -}; - -#endif /* __PANGO_FONT_H__ */ -- 2.11.4.GIT